/* ==========================================================================
   WHOOSH MANIFEST — DESIGN SYSTEM & STYLESHEET
   Inspired by KCIC CR400AF Livery: Crimson Red, Metallic Slate, Gold & Dark Theme
   ========================================================================== */

:root {
  --bg-main: #0B0E14;
  --bg-card: #131A26;
  --bg-card-hover: #1A2333;
  --bg-chassis: #0F141E;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(199, 32, 39, 0.4);

  --whoosh-red: #C72027;
  --whoosh-red-light: #E53935;
  --whoosh-red-glow: rgba(199, 32, 39, 0.35);
  --whoosh-gold: #D4AF37;
  --whoosh-silver: #E2E8F0;

  --seat-avail: #10B981;
  --seat-avail-bg: rgba(16, 185, 129, 0.14);
  --seat-avail-border: #059669;
  --seat-avail-glow: rgba(16, 185, 129, 0.3);

  --seat-occup: #EF4444;
  --seat-occup-bg: rgba(239, 68, 68, 0.16);
  --seat-occup-border: #DC2626;

  --seat-partial: #F59E0B;
  --seat-partial-bg: rgba(245, 158, 11, 0.16);
  --seat-partial-border: #D97706;

  --seat-inspect: #06B6D4;
  --seat-inspect-bg: rgba(6, 182, 212, 0.18);
  --seat-inspect-border: #0891B2;
  --seat-inspect-glow: rgba(6, 182, 212, 0.45);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', var(--font-primary);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Theme-specific intermediate tokens (Dark = default) */
  --overlay-bg: rgba(0, 0, 0, 0.75);
  --overlay-light: rgba(255, 255, 255, 0.04);
  --overlay-lighter: rgba(255, 255, 255, 0.06);
  --overlay-hover: rgba(255, 255, 255, 0.08);
  --overlay-hover-strong: rgba(255, 255, 255, 0.12);
  --overlay-active: rgba(255, 255, 255, 0.15);
  --overlay-border: rgba(255, 255, 255, 0.08);
  --overlay-border-hover: rgba(255, 255, 255, 0.2);
  --shadow-card: rgba(0, 0, 0, 0.35);
  --shadow-heavy: rgba(0, 0, 0, 0.6);
  --exact-match-bg: rgba(147, 51, 234, 0.28);
  --exact-match-border: rgba(147, 51, 234, 0.55);
  --exact-match-glow: rgba(124, 58, 237, 0.3);
  --input-bg: var(--bg-card);
  --badge-bg: rgba(199, 32, 39, 0.15);
  --badge-border: rgba(199, 32, 39, 0.35);
  --header-bg: rgba(19, 26, 38, 0.85);
  --modal-border: rgba(255, 255, 255, 0.15);
  --toast-bg: rgba(15, 23, 42, 0.95);
  --scrollbar-track: rgba(255, 255, 255, 0.03);
  --scrollbar-thumb: rgba(255, 255, 255, 0.08);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.15);
}

/* ========================================================================
   KCIC LIGHT THEME — Inspired by kcic.co.id Official Website
   Clean white backgrounds, professional red accents, corporate styling
   ======================================================================== */
[data-theme="kcic-light"] {
  --bg-main: #F0F2F5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FA;
  --bg-chassis: #F5F6F8;
  --border-color: rgba(0, 0, 0, 0.10);
  --border-active: rgba(163, 0, 40, 0.5);

  --whoosh-red: #a30028;
  --whoosh-red-light: #c2183f;
  --whoosh-red-glow: rgba(163, 0, 40, 0.20);
  --whoosh-gold: #BF8C00;
  --whoosh-silver: #455A64;

  --seat-avail: #0D9668;
  --seat-avail-bg: rgba(13, 150, 104, 0.10);
  --seat-avail-border: #0D7A55;
  --seat-avail-glow: rgba(13, 150, 104, 0.18);

  --seat-occup: #D32F2F;
  --seat-occup-bg: rgba(211, 47, 47, 0.10);
  --seat-occup-border: #a30028;

  --seat-partial: #E08A00;
  --seat-partial-bg: rgba(224, 138, 0, 0.10);
  --seat-partial-border: #C67600;

  --seat-inspect: #0284C7;
  --seat-inspect-bg: rgba(2, 132, 199, 0.12);
  --seat-inspect-border: #0369A1;
  --seat-inspect-glow: rgba(2, 132, 199, 0.25);

  --text-main: #1A1A2E;
  --text-muted: #5A6478;
  --text-dim: #8896A8;

  --overlay-bg: rgba(0, 0, 0, 0.45);
  --overlay-light: rgba(0, 0, 0, 0.02);
  --overlay-lighter: rgba(0, 0, 0, 0.03);
  --overlay-hover: rgba(0, 0, 0, 0.04);
  --overlay-hover-strong: rgba(0, 0, 0, 0.06);
  --overlay-active: rgba(0, 0, 0, 0.08);
  --overlay-border: rgba(0, 0, 0, 0.10);
  --overlay-border-hover: rgba(0, 0, 0, 0.18);
  --shadow-card: rgba(0, 0, 0, 0.08);
  --shadow-heavy: rgba(0, 0, 0, 0.15);
  --exact-match-bg: rgba(126, 34, 206, 0.10);
  --exact-match-border: rgba(126, 34, 206, 0.35);
  --exact-match-glow: rgba(126, 34, 206, 0.15);
  --input-bg: #FFFFFF;
  --badge-bg: rgba(163, 0, 40, 0.08);
  --badge-border: rgba(163, 0, 40, 0.25);
  --header-bg: #a30028;
  --modal-border: rgba(0, 0, 0, 0.12);
  --toast-bg: rgba(255, 255, 255, 0.97);
  --scrollbar-track: rgba(0, 0, 0, 0.03);
  --scrollbar-thumb: rgba(0, 0, 0, 0.10);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.20);
}

/* Light theme body background - clean without dark gradient */
[data-theme="kcic-light"] body {
  background-color: var(--bg-main);
  color: var(--text-main);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(163, 0, 40, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(191, 140, 0, 0.03) 0%, transparent 40%);
}

/* Light theme header — KCIC Crimson Red */
[data-theme="kcic-light"] .app-header {
  background: linear-gradient(135deg, #a30028 0%, #7d001e 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 4px 20px rgba(163, 0, 40, 0.28), 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Light theme logo area inside red navbar — seamlessly blended without boxy frame */
[data-theme="kcic-light"] .train-bullet-icon,
[data-theme="kcic-light"] .kcic-logo-badge {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  height: 38px;
}

[data-theme="kcic-light"] .train-bullet-icon:hover,
[data-theme="kcic-light"] .kcic-logo-badge:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.92;
}

[data-theme="kcic-light"] .kcic-logo-img {
  height: 34px;
  max-width: 80px;
}

/* Brand typography inside red navbar */
[data-theme="kcic-light"] .app-header .brand-title {
  color: #FFFFFF;
}

[data-theme="kcic-light"] .app-header .brand-title span {
  color: #FFE4E6;
}

[data-theme="kcic-light"] .app-header .brand-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

/* ========================================================================
   KCIC LIGHT RED NAVBAR — REFINED HIERARCHY & GHOST BUTTON SYSTEM
   Eliminates boxy visual clutter and highlights the Upload Manifest CTA
   ======================================================================== */

/* Ghost Button System for Secondary Actions (Sync, Admin dropdown, etc.) */
[data-theme="kcic-light"] .app-header .btn-secondary {
  background: transparent;
  color: #FFFFFF;
  border: none;
  box-shadow: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

[data-theme="kcic-light"] .app-header .btn-secondary:hover,
[data-theme="kcic-light"] .app-header .admin-dropdown-wrapper.show .btn-secondary {
  background: rgba(255, 255, 255, 0.10);
  border: none;
  color: #FFFFFF;
  transform: none;
  box-shadow: none;
}

[data-theme="kcic-light"] .app-header .btn-secondary svg,
[data-theme="kcic-light"] .app-header .btn-secondary .sync-icon {
  stroke: #FFFFFF;
}

/* Theme Toggle Button as Ghost Button */
[data-theme="kcic-light"] .app-header .theme-toggle-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  box-shadow: none;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

[data-theme="kcic-light"] .app-header .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border: none;
  color: #FFFFFF;
  transform: none;
  box-shadow: none;
}

[data-theme="kcic-light"] .app-header .theme-toggle-btn svg {
  stroke: #FFFFFF;
}

/* Sole Primary Action CTA: Upload Manifest Button (Solid White with KCIC Red Text) */
[data-theme="kcic-light"] .app-header .btn-primary {
  background: #FFFFFF;
  color: #a30028;
  font-weight: 700;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="kcic-light"] .app-header .btn-primary:hover {
  background: #FFF0F3;
  color: #7d001e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

[data-theme="kcic-light"] .app-header .btn-primary svg {
  stroke: #a30028;
}

[data-theme="kcic-light"] .app-header .btn-primary:hover svg {
  stroke: #7d001e;
}

/* PWA Install Button as Ghost/Clean Accent */
[data-theme="kcic-light"] .app-header .btn-install {
  background: transparent;
  color: #FFFFFF;
  border: none;
  box-shadow: none;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

[data-theme="kcic-light"] .app-header .btn-install:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: none;
}

[data-theme="kcic-light"] .app-header .btn-install svg {
  stroke: #FFFFFF;
}

/* Admin Dropdown Panel opened from red navbar */
[data-theme="kcic-light"] .app-header .dropdown-menu-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.20);
}

[data-theme="kcic-light"] .app-header .dropdown-menu-item {
  color: #1A1A2E;
  background: transparent;
}

[data-theme="kcic-light"] .app-header .dropdown-menu-item:hover {
  background: #F4F5F7;
  color: #1A1A2E;
}

[data-theme="kcic-light"] .app-header .dropdown-menu-item.danger {
  color: #DC2626;
}

[data-theme="kcic-light"] .app-header .dropdown-menu-item.danger:hover {
  background: #FEE2E2;
  color: #B91C1C;
}

[data-theme="kcic-light"] .app-header .dropdown-divider {
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* Simplified Profile Menu with Subtle Left Divider */
[data-theme="kcic-light"] .app-header .user-profile-widget {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.2rem 0 0.2rem 0.85rem;
  border-left: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 0;
  margin-left: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Neutral Monochrome User Avatar: Darker red background with crisp white icon */
[data-theme="kcic-light"] .app-header .user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

[data-theme="kcic-light"] .app-header .user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

[data-theme="kcic-light"] .app-header .user-meta:hover {
  background: rgba(255, 255, 255, 0.10);
}

[data-theme="kcic-light"] .app-header .user-name {
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Hide nested stacked role-badge pill in navbar profile to eliminate crowding */
[data-theme="kcic-light"] .app-header .role-badge {
  display: none !important;
}

/* Subtle Ghost Logout Button */
[data-theme="kcic-light"] .app-header .btn-logout {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="kcic-light"] .app-header .btn-logout:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

/* Mobile more button inside red navbar as Ghost Button */
[data-theme="kcic-light"] .app-header .btn-mobile-more {
  background: transparent;
  border: none;
  color: #FFFFFF;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

[data-theme="kcic-light"] .app-header .btn-mobile-more:hover,
[data-theme="kcic-light"] .app-header .btn-mobile-more:active {
  background: rgba(255, 255, 255, 0.10);
}

[data-theme="kcic-light"] .app-header .btn-mobile-more svg {
  stroke: #FFFFFF;
}

/* Light theme select inputs */
[data-theme="kcic-light"] .custom-select-wrapper select,
[data-theme="kcic-light"] .trip-selector-box select {
  background: #FFFFFF;
  color: var(--text-main);
  border-color: var(--border-color);
}

/* Light theme buttons */
[data-theme="kcic-light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
[data-theme="kcic-light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--overlay-border-hover);
}

[data-theme="kcic-light"] .btn-primary {
  background: linear-gradient(135deg, #a30028 0%, #7d001e 100%);
  box-shadow: 0 4px 14px rgba(163, 0, 40, 0.25);
}
[data-theme="kcic-light"] .btn-primary:hover {
  background: linear-gradient(135deg, #b8002e 0%, #a30028 100%);
  box-shadow: 0 6px 20px rgba(163, 0, 40, 0.35);
}

[data-theme="kcic-light"] .btn-danger {
  background: rgba(163, 0, 40, 0.08);
  color: #a30028;
  border: 1px solid rgba(163, 0, 40, 0.25);
}
[data-theme="kcic-light"] .btn-danger:hover {
  background: rgba(163, 0, 40, 0.14);
  color: #7d001e;
}

/* Light theme trip schedule card */
[data-theme="kcic-light"] .trip-schedule-card {
  background: var(--bg-card);
  box-shadow: 0 4px 16px var(--shadow-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--whoosh-red);
}

[data-theme="kcic-light"] .trip-card-header {
  background: rgba(0, 0, 0, 0.01);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="kcic-light"] .trip-card-icon {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  box-shadow: none;
}

[data-theme="kcic-light"] .trip-card-title {
  color: #1A1A2E;
}

[data-theme="kcic-light"] .trip-select-label {
  color: var(--text-muted);
}

/* Light theme journey hero */
[data-theme="kcic-light"] .journey-hero {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
}

[data-theme="kcic-light"] .endpoint-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

[data-theme="kcic-light"] .station-endpoint.origin .endpoint-tag {
  color: #047857;
}

[data-theme="kcic-light"] .station-endpoint.destination .endpoint-tag {
  color: #a30028;
}

[data-theme="kcic-light"] .endpoint-name {
  color: #0F172A;
  font-weight: 800;
}

[data-theme="kcic-light"] .endpoint-time {
  color: #0F172A;
  font-weight: 900;
  text-shadow: none;
}

[data-theme="kcic-light"] .endpoint-sub {
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
}

[data-theme="kcic-light"] .track-line-visual {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .direction-pill-badge {
  background: rgba(163, 0, 40, 0.08);
  border: 1px solid rgba(163, 0, 40, 0.25);
  color: #800020;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="kcic-light"] .direction-pill-badge .dir-arrow {
  color: #a30028;
  font-weight: 900;
}

[data-theme="kcic-light"] .meta-pill {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  font-weight: 600;
  font-size: 0.78rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .meta-pill.highlight {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400E;
  font-weight: 700;
}

/* Light theme station stops & timetable progression */
[data-theme="kcic-light"] .timeline-header-label {
  color: #1E293B;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

[data-theme="kcic-light"] .timeline-station-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .timeline-station-card:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="kcic-light"] .timeline-station-card.origin {
  border-top: 3px solid #059669;
}

[data-theme="kcic-light"] .timeline-station-card.stop {
  border-top: 3px solid #2563EB;
}

[data-theme="kcic-light"] .timeline-station-card.direct {
  border-top: 3px solid #94A3B8;
  opacity: 0.85;
}

[data-theme="kcic-light"] .timeline-station-card.destination {
  border-top: 3px solid #a30028;
}

[data-theme="kcic-light"] .station-node-badge.origin {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  font-weight: 800;
}

[data-theme="kcic-light"] .station-node-badge.stop {
  background: rgba(37, 99, 235, 0.12);
  color: #1D4ED8;
  font-weight: 800;
}

[data-theme="kcic-light"] .station-node-badge.direct {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  font-weight: 800;
}

[data-theme="kcic-light"] .station-node-badge.destination {
  background: rgba(163, 0, 40, 0.12);
  color: #a30028;
  font-weight: 800;
}

[data-theme="kcic-light"] .station-node-name {
  color: #0F172A;
  font-weight: 700;
  font-size: 0.95rem;
}

[data-theme="kcic-light"] .station-node-time {
  color: #0F172A;
  font-weight: 800;
}

[data-theme="kcic-light"] .station-node-time.pass {
  color: #64748B;
  font-weight: 600;
  font-style: normal;
}

[data-theme="kcic-light"] .empty-state-content h3 {
  color: #0F172A;
}

[data-theme="kcic-light"] .empty-state-content p {
  color: #475569;
}

/* Light theme KPI cards */
[data-theme="kcic-light"] .kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px var(--shadow-card);
}

/* Light theme live status badge */
[data-theme="kcic-light"] .live-status-badge {
  background: rgba(13, 150, 104, 0.08);
  border: 1px solid rgba(13, 150, 104, 0.22);
  color: #0D7A55;
}

/* Light theme seat grid */
[data-theme="kcic-light"] .seat-grid-container {
  background: var(--bg-card);
}

[data-theme="kcic-light"] .seat-node {
  background: var(--overlay-light);
}

[data-theme="kcic-light"] .seat-node .seat-letter {
  color: var(--text-main);
}

[data-theme="kcic-light"] .seat-node .seat-code {
  color: var(--text-muted);
}

[data-theme="kcic-light"] .seat-aisle {
  color: var(--text-dim);
}

[data-theme="kcic-light"] .seat-aisle::before {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .seat-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* Light theme seat statuses */
[data-theme="kcic-light"] .seat-node.available {
  background: var(--seat-avail-bg);
  border-color: var(--seat-avail-border);
}

[data-theme="kcic-light"] .seat-node.occupied {
  background: var(--seat-occup-bg);
  border-color: var(--seat-occup-border);
}

[data-theme="kcic-light"] .seat-node.partial {
  background: var(--seat-partial-bg);
  border-color: var(--seat-partial-border);
}

[data-theme="kcic-light"] .seat-node.exact-match {
  background: var(--exact-match-bg);
  border-color: var(--exact-match-border);
  box-shadow: 0 0 12px var(--exact-match-glow);
}

[data-theme="kcic-light"] .seat-node.inspected {
  border-color: var(--seat-inspect-border) !important;
  box-shadow: 0 0 10px var(--seat-inspect-glow);
}

[data-theme="kcic-light"] .seat-node.inspected .seat-headrest {
  background: var(--seat-inspect-border);
}

[data-theme="kcic-light"] .seat-node .seat-inspected-badge {
  border-color: #FFFFFF;
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
}

[data-theme="kcic-light"] .seat-node.filtered-out {
  opacity: 0.3;
}

/* Light theme direction & train strip */
[data-theme="kcic-light"] .train-direction-tag {
  background: rgba(163, 0, 40, 0.06);
  border: 1px solid rgba(163, 0, 40, 0.20);
  color: #1A1A2E;
}

[data-theme="kcic-light"] .train-direction-tag .direction-arrow {
  color: #a30028;
}

[data-theme="kcic-light"] .train-car-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .train-car-card:hover {
  background: #F8FAFC;
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .train-car-card.active {
  border: 2px solid #a30028;
  background: rgba(163, 0, 40, 0.05);
  box-shadow: 0 4px 16px rgba(163, 0, 40, 0.18);
}

[data-theme="kcic-light"] .train-car-card.locomotive-front {
  background: linear-gradient(90deg, rgba(163, 0, 40, 0.09) 0%, #FFFFFF 100%);
}

[data-theme="kcic-light"] .train-car-card.locomotive-rear {
  background: linear-gradient(270deg, rgba(163, 0, 40, 0.08) 0%, #FFFFFF 100%);
}

[data-theme="kcic-light"] .train-car-card.active.locomotive-front {
  background: linear-gradient(90deg, rgba(163, 0, 40, 0.14) 0%, rgba(163, 0, 40, 0.04) 100%);
}

[data-theme="kcic-light"] .train-car-card.active.locomotive-rear {
  background: linear-gradient(270deg, rgba(163, 0, 40, 0.14) 0%, rgba(163, 0, 40, 0.04) 100%);
}

[data-theme="kcic-light"] .train-car-card.leading-car {
  border-color: rgba(5, 150, 105, 0.50);
}

[data-theme="kcic-light"] .car-num-badge {
  color: #0F172A;
  font-weight: 800;
}

[data-theme="kcic-light"] .train-car-card.active .car-num-badge {
  color: #a30028;
  font-weight: 900;
}

[data-theme="kcic-light"] .car-class-badge {
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .car-class-badge.first {
  background: rgba(245, 158, 11, 0.14);
  color: #B45309;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="kcic-light"] .car-class-badge.business {
  background: rgba(37, 99, 235, 0.12);
  color: #1D4ED8;
  border-color: rgba(37, 99, 235, 0.30);
}

[data-theme="kcic-light"] .car-class-badge.mixed {
  background: rgba(126, 34, 206, 0.12);
  color: #6B21A8;
  border-color: rgba(126, 34, 206, 0.30);
}

[data-theme="kcic-light"] .car-class-badge.premium {
  background: #F1F5F9;
  color: #334155;
  border-color: #CBD5E1;
}

[data-theme="kcic-light"] .car-role-badge.leading {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, 0.30);
  font-weight: 800;
}

[data-theme="kcic-light"] .car-role-badge.trailing {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-weight: 700;
}

[data-theme="kcic-light"] .car-occ-bar {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .car-strip-bottom {
  color: #475569;
  font-weight: 600;
}

[data-theme="kcic-light"] .car-empty-tag {
  color: #047857;
  font-weight: 800;
}

/* Light theme coach header */
[data-theme="kcic-light"] .coach-header-bar {
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* Light theme driver cab indicators */
[data-theme="kcic-light"] .train-driver-cab {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* Light theme chassis amenity bar */
[data-theme="kcic-light"] .chassis-amenity-bar {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="kcic-light"] .coach-front-end,
[data-theme="kcic-light"] .coach-rear-end {
  background: rgba(0, 0, 0, 0.015);
  border-color: var(--border-color);
}

/* Light theme modals */
[data-theme="kcic-light"] .modal-backdrop {
  background: var(--overlay-bg);
}

[data-theme="kcic-light"] .modal-card {
  background: var(--bg-card);
  border: 1px solid var(--modal-border);
  box-shadow: 0 24px 60px var(--shadow-heavy);
}

[data-theme="kcic-light"] .modal-close-btn {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

[data-theme="kcic-light"] .modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #1A1A2E;
}

[data-theme="kcic-light"] .modal-header {
  border-bottom-color: var(--border-color);
}

[data-theme="kcic-light"] .modal-title {
  color: #1A1A2E;
}

/* Light theme modal icon header */
[data-theme="kcic-light"] .modal-icon-header {
  background: var(--badge-bg);
  border-color: var(--badge-border);
}

/* Light theme status banners in modal */
[data-theme="kcic-light"] .seat-status-banner.exact-match {
  background: #F5EEFD;
  border: 1.5px solid #C084FC;
  color: #581C87;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.08);
}

[data-theme="kcic-light"] .seat-status-banner.exact-match .status-icon {
  background: #EDE9FE;
  border: 1px solid #DDD6FE;
  color: #7C3AED;
}

[data-theme="kcic-light"] .seat-status-banner.exact-match .status-text-wrap strong {
  color: #581C87;
  font-weight: 700;
}

[data-theme="kcic-light"] .seat-status-banner.exact-match .status-text-wrap span {
  color: #6B21A8;
  font-weight: 500;
}

/* Light theme seat detail modal */
[data-theme="kcic-light"] .seat-modal-badge {
  background: var(--badge-bg);
  color: var(--whoosh-red);
  border-color: var(--badge-border);
}

/* Light theme sidebar */
[data-theme="kcic-light"] .app-sidebar {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 2px 0 16px var(--shadow-card);
}

/* Light theme toast notifications */
[data-theme="kcic-light"] .toast {
  background: var(--toast-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow-card);
  color: var(--text-main);
}

/* Light theme login overlay */
[data-theme="kcic-light"] .login-overlay {
  background: var(--bg-main);
}

[data-theme="kcic-light"] .login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 48px var(--shadow-heavy);
}

/* Light theme input fields */
[data-theme="kcic-light"] input[type="text"],
[data-theme="kcic-light"] input[type="password"],
[data-theme="kcic-light"] input[type="search"],
[data-theme="kcic-light"] .search-input,
[data-theme="kcic-light"] .login-input {
  background: #F8F9FA;
  color: var(--text-main);
  border-color: var(--border-color);
}

[data-theme="kcic-light"] input:focus,
[data-theme="kcic-light"] .search-input:focus,
[data-theme="kcic-light"] .login-input:focus {
  border-color: var(--whoosh-red);
  background: #FFFFFF;
}

/* Light theme direction pill badge */
[data-theme="kcic-light"] .direction-pill-badge {
  background: var(--badge-bg);
  border-color: var(--badge-border);
  color: var(--text-main);
}

/* Light theme dropdown menus */
[data-theme="kcic-light"] .dropdown-menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 36px var(--shadow-heavy);
}

[data-theme="kcic-light"] .dropdown-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .dropdown-divider {
  border-color: var(--border-color);
}

/* Light theme segment multiselect dropdown */
[data-theme="kcic-light"] .multiselect-dropdown {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .multiselect-toolbar {
  background: #F8FAFC;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .multiselect-heading {
  color: #334155;
  font-weight: 800;
}

[data-theme="kcic-light"] .btn-quick-action {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  font-weight: 600;
}

[data-theme="kcic-light"] .btn-quick-action:hover {
  background: var(--whoosh-red);
  border-color: var(--whoosh-red);
  color: #FFFFFF;
}

[data-theme="kcic-light"] .multiselect-option {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .multiselect-option:hover {
  background: #F8FAFC;
}

[data-theme="kcic-light"] .multiselect-option.selected {
  background: rgba(163, 0, 40, 0.06);
}

[data-theme="kcic-light"] .multiselect-option input[type="checkbox"] {
  border: 1.5px solid #94A3B8;
  background: #FFFFFF;
}

[data-theme="kcic-light"] .multiselect-option input[type="checkbox"]:checked {
  background: var(--whoosh-red);
  border-color: var(--whoosh-red);
}

[data-theme="kcic-light"] .multiselect-option input[type="checkbox"]:checked::before {
  border-left-color: #FFFFFF;
  border-bottom-color: #FFFFFF;
}

[data-theme="kcic-light"] .multiselect-option .option-name {
  color: #1E293B;
  font-weight: 600;
}

[data-theme="kcic-light"] .multiselect-option.selected .option-name {
  color: var(--whoosh-red);
  font-weight: 700;
}

[data-theme="kcic-light"] .multiselect-option .option-badge {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-weight: 700;
}

[data-theme="kcic-light"] .multiselect-option.selected .option-badge {
  background: rgba(163, 0, 40, 0.10);
  border-color: rgba(163, 0, 40, 0.25);
  color: var(--whoosh-red);
}

/* Light theme filter toolbar */
[data-theme="kcic-light"] .filter-toolbar {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="kcic-light"] .filter-chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border-color);
  color: var(--text-main);
}

[data-theme="kcic-light"] .filter-chip.active,
[data-theme="kcic-light"] .filter-chip:hover {
  background: var(--badge-bg);
  border-color: var(--whoosh-red);
  color: var(--whoosh-red);
}

/* Light theme user profile widget */
[data-theme="kcic-light"] .user-profile-widget {
  border-color: var(--border-color);
}

[data-theme="kcic-light"] .user-name {
  color: var(--text-main);
}

/* Light theme role badges */
[data-theme="kcic-light"] .role-badge {
  background: var(--badge-bg);
  color: var(--whoosh-red);
}

/* Light theme timetable modal */
[data-theme="kcic-light"] .timetable-tabs {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
}

[data-theme="kcic-light"] .timetable-tab {
  color: #475569;
  font-weight: 700;
}

[data-theme="kcic-light"] .timetable-tab:hover {
  color: #0F172A;
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .timetable-tab.active {
  background: #a30028;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(163, 0, 40, 0.35);
}

[data-theme="kcic-light"] .timetable-search-wrap input {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  font-weight: 500;
}

[data-theme="kcic-light"] .timetable-search-wrap input::placeholder {
  color: #94A3B8;
}

[data-theme="kcic-light"] .timetable-search-wrap input:focus {
  border-color: #a30028;
  box-shadow: 0 0 0 3px rgba(163, 0, 40, 0.15);
}

[data-theme="kcic-light"] .timetable-table-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="kcic-light"] .timetable-table {
  background: #FFFFFF;
}

[data-theme="kcic-light"] .timetable-table th {
  background: #F8FAFC;
  color: #334155;
  border-bottom: 2px solid #E2E8F0;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

[data-theme="kcic-light"] .timetable-table tbody tr:nth-child(even) {
  background: #F8FAFC;
}

[data-theme="kcic-light"] .timetable-table tbody tr:nth-child(odd) {
  background: #FFFFFF;
}

[data-theme="kcic-light"] .timetable-table td {
  border-bottom: 1px solid #F1F5F9;
  color: #0F172A;
}

[data-theme="kcic-light"] .timetable-table tr:hover td {
  background: rgba(163, 0, 40, 0.04);
}

[data-theme="kcic-light"] .timetable-table tr.active-train-row {
  background: rgba(163, 0, 40, 0.08);
  border-left: 4px solid #a30028;
}

[data-theme="kcic-light"] .train-code-badge {
  background: rgba(163, 0, 40, 0.08);
  color: #a30028;
  border: 1px solid rgba(163, 0, 40, 0.22);
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 6px;
}

[data-theme="kcic-light"] .timetable-table tr.active-train-row .train-code-badge {
  background: #a30028;
  color: #FFFFFF;
  border-color: #a30028;
}

[data-theme="kcic-light"] .timetable-time {
  color: #0F172A;
  font-weight: 700;
  font-size: 0.88rem;
}

[data-theme="kcic-light"] .timetable-time.pass {
  color: #94A3B8;
  font-weight: 500;
}

[data-theme="kcic-light"] .op-days-badge.daily {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, 0.30);
  font-weight: 700;
}

[data-theme="kcic-light"] .op-days-badge.mon-sat {
  background: rgba(217, 119, 6, 0.12);
  color: #92400E;
  border: 1px solid rgba(217, 119, 6, 0.30);
  font-weight: 700;
}

[data-theme="kcic-light"] .timetable-footer-info {
  color: #475569;
  font-weight: 600;
}

[data-theme="kcic-light"] .car-class-badge.premium {
  background: rgba(0, 0, 0, 0.06);
  color: #334155;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

[data-theme="kcic-light"] .class-name.premium-class {
  color: #334155;
}

[data-theme="kcic-light"] .legend-pill.class-premium {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
  border-color: rgba(0, 0, 0, 0.12);
}

/* Light theme scrollbars */
[data-theme="kcic-light"] ::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

[data-theme="kcic-light"] ::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
}

[data-theme="kcic-light"] ::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Light theme flush/confirm cards */
[data-theme="kcic-light"] .flush-option-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: var(--border-color);
}

[data-theme="kcic-light"] .flush-option-card:hover {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="kcic-light"] .flush-opt-content h4 {
  color: #1A1A2E;
}

/* Light theme misc badges & pills */
[data-theme="kcic-light"] .car-badge {
  color: var(--text-main);
}

[data-theme="kcic-light"] .legend-label {
  color: var(--text-main);
}

/* Light theme mobile bottom nav */
[data-theme="kcic-light"] .mobile-bottom-nav {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 12px var(--shadow-card);
}

[data-theme="kcic-light"] .bnav-item {
  color: var(--text-muted);
}

[data-theme="kcic-light"] .bnav-item.active {
  color: var(--whoosh-red);
}

/* Light theme mobile sheets */
[data-theme="kcic-light"] .mobile-trip-sheet,
[data-theme="kcic-light"] .mobile-filter-sheet {
  background: var(--bg-card);
}

/* Light theme empty state banners */
[data-theme="kcic-light"] .empty-database-hero {
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* Light theme sync badge */
[data-theme="kcic-light"] .local-db-sync-badge {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* Light theme trip card body sections */
[data-theme="kcic-light"] .trip-selector-box {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--border-color);
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--overlay-hover);
  border: 1px solid var(--overlay-border);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--overlay-hover-strong);
  border-color: var(--overlay-border-hover);
  color: var(--text-main);
  transform: translateY(-1px);
}

.theme-toggle-btn .theme-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
  transform: rotate(25deg);
}

/* Smooth theme transition */
body,
.app-header,
.modal-card,
.modal-backdrop,
.trip-schedule-card,
.kpi-card,
.train-car-card,
.seat-grid-container,
.coach-header-bar,
.toast,
.dropdown-menu-card,
.segment-dropdown-panel,
.filter-toolbar,
.login-overlay,
.login-card,
.app-sidebar,
.mobile-bottom-nav {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

/* Global focus-visible for keyboard accessibility (WCAG 2.1 AA) */
*:focus-visible {
  outline: 2px solid var(--whoosh-red);
  outline-offset: 2px;
  border-radius: 4px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(199, 32, 39, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(212, 175, 55, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(19, 26, 38, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.train-bullet-icon,
.kcic-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 0 16px rgba(199, 32, 39, 0.2);
  transition: all 0.2s ease;
}

.train-bullet-icon:hover,
.kcic-logo-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(199, 32, 39, 0.45);
  box-shadow: 0 0 20px var(--whoosh-red-glow);
}

.kcic-logo-img {
  height: 30px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #FFFFFF;
}

.brand-title span {
  color: var(--whoosh-red-light);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.trip-selector-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.selector-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.selector-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.custom-select-wrapper select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}

.custom-select-wrapper select:hover,
.custom-select-wrapper select:focus {
  border-color: var(--whoosh-red);
}

.live-status-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #34D399;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #10B981; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--whoosh-red) 0%, #A01218 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--whoosh-red-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--whoosh-red-light) 0%, var(--whoosh-red) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(199, 32, 39, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #EF4444;
  color: #FECACA;
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Flush Modal Styles */
.modal-icon-header.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.flush-info-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.flush-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.flush-confirm-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.flush-confirm-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.flush-confirm-text {
  font-size: 0.85rem;
  color: var(--text-main);
}

.flush-confirm-text strong {
  display: block;
  margin-bottom: 0.25rem;
}

.flush-confirm-text ul {
  margin: 0.35rem 0 0 1.25rem;
  padding: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.flush-option-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition-fast);
}

.flush-option-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.flush-opt-icon {
  font-size: 1.75rem;
}

.flush-opt-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.35rem;
}

.flush-opt-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

/* ==========================================================================
   MAIN CONTENT & KPI SECTION
   ========================================================================== */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ==========================================================================
   DEDICATED TRIP SCHEDULE & TIMETABLE JOURNEY CARD
   ========================================================================== */
.trip-schedule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--whoosh-red);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.trip-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.trip-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(199, 32, 39, 0.15);
  border: 1px solid rgba(199, 32, 39, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 16px var(--whoosh-red-glow);
}

.trip-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  margin: 0;
}

.trip-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

.trip-card-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.trip-selector-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.trip-select-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #CBD5E1;
  white-space: nowrap;
}

.trip-card-controls .btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.45rem;
}

.trip-card-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Journey Hero Banner */
.journey-hero {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(280px, 2fr) minmax(180px, 1.2fr);
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.station-endpoint {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.station-endpoint.destination {
  text-align: right;
  align-items: flex-end;
}

.endpoint-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.station-endpoint.origin .endpoint-tag {
  color: #34D399;
}

.station-endpoint.destination .endpoint-tag {
  color: #F87171;
}

.endpoint-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
}

.endpoint-time {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: #F8FAFC;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.15rem 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.endpoint-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Track Center Visual */
.journey-track-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.direction-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(199, 32, 39, 0.15);
  border: 1px solid rgba(199, 32, 39, 0.35);
  color: #FECACA;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.direction-pill-badge .dir-arrow {
  color: var(--whoosh-red-light);
  font-weight: 900;
  animation: slide-arrow 1.5s infinite;
}

.direction-pill-badge.reverse .dir-arrow {
  animation: slide-arrow-right 1.5s infinite;
}

.track-line-visual {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin: 0.25rem 0;
}

.track-line {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10B981 0%, #3B82F6 50%, #C72027 100%);
}

.train-bullet-marker {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 6px rgba(199, 32, 39, 0.6));
  animation: marker-pulse 2s infinite ease-in-out;
}

@keyframes marker-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.15); }
}

.journey-meta-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.meta-pill.highlight {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #FCD34D;
}

/* Station Stops Stepper */
.journey-timeline-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-header-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.station-timeline-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.timeline-station-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  transition: var(--transition-fast);
}

.timeline-station-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.timeline-station-card.origin {
  border-top: 3px solid #10B981;
}

.timeline-station-card.stop {
  border-top: 3px solid #3B82F6;
}

.timeline-station-card.direct {
  border-top: 3px solid var(--text-dim);
  opacity: 0.65;
}

.timeline-station-card.destination {
  border-top: 3px solid var(--whoosh-red);
}

.station-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
}

.station-node-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.station-node-badge.origin {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.station-node-badge.stop {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

.station-node-badge.direct {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.station-node-badge.destination {
  background: rgba(199, 32, 39, 0.2);
  color: #F87171;
}

.station-node-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-top: 0.15rem;
}

.station-node-time {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.station-node-time.pass {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
  font-style: italic;
}

/* Empty State inside Card */
.trip-card-empty {
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 480px;
}

.empty-state-icon {
  font-size: 2.75rem;
  opacity: 0.7;
}

.empty-state-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #FFFFFF;
  margin: 0;
}

.empty-state-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Responsive adjustments for trip card */
@media (max-width: 992px) {
  .journey-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.25rem;
  }
  .station-endpoint.destination {
    text-align: center;
    align-items: center;
  }
  .station-endpoint.origin {
    text-align: center;
    align-items: center;
  }
  .station-timeline-stepper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .trip-card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .trip-card-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .trip-selector-box {
    width: 100%;
  }
  .trip-selector-box .custom-select-wrapper {
    flex: 1;
  }
  .trip-selector-box select {
    width: 100%;
  }
  .station-timeline-stepper {
    grid-template-columns: 1fr;
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: var(--transition-smooth);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--text-dim);
}

.kpi-card.total::before { background: #3B82F6; }
.kpi-card.available::before { background: #10B981; }
.kpi-card.occupied::before { background: #EF4444; }
.kpi-card.class-breakdown::before { background: var(--whoosh-gold); }

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-card.total .kpi-icon { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.kpi-card.available .kpi-icon { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.kpi-card.occupied .kpi-icon { background: rgba(239, 68, 68, 0.15); color: #F87171; }

.kpi-data {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.kpi-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-subtext {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.text-success { color: #34D399 !important; }
.text-danger { color: #F87171 !important; }
.text-warning { color: #FBBF24 !important; }

/* Class Stat Bars */
.kpi-card.class-breakdown {
  flex-direction: column;
  gap: 0.5rem;
}

.class-stat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.class-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.class-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
}

.class-name.first-class { color: #FCD34D; }
.class-name.business-class { color: #60A5FA; }
.class-name.premium-class { color: #E2E8F0; }

.class-ratio {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.progress-fill.first { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.progress-fill.business { background: linear-gradient(90deg, #2563EB, #60A5FA); }
.progress-fill.premium { background: linear-gradient(90deg, #EF4444, #F87171); }

/* ==========================================================================
   TRAIN CONSIST STRIP (8 CARS)
   ========================================================================== */
.train-consist-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.section-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 0.6rem;
}

.train-direction-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.direction-arrow {
  color: var(--whoosh-red-light);
  font-weight: 800;
  animation: slide-arrow 1.5s infinite;
}

.direction-arrow.reverse,
.blink-arrow.reverse {
  animation-name: slide-arrow-right;
}

@keyframes slide-arrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}

@keyframes slide-arrow-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.train-strip-container {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.65rem;
  padding: 0.5rem 0;
  position: relative;
}

/* Individual Train Car in Strip */
.train-car-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  text-align: center;
}

.train-car-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.train-car-card.active {
  background: rgba(199, 32, 39, 0.15);
  border-color: var(--whoosh-red);
  box-shadow: 0 0 16px var(--whoosh-red-glow);
}

.train-car-card.locomotive-front {
  border-top-left-radius: 24px;
  border-bottom-left-radius: 24px;
  background: linear-gradient(90deg, rgba(199, 32, 39, 0.25) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.train-car-card.locomotive-rear {
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
  background: linear-gradient(270deg, rgba(199, 32, 39, 0.2) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.car-strip-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.car-num-badge {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.train-car-card.active .car-num-badge {
  color: var(--whoosh-red-light);
}

.car-class-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

.car-class-badge.first { background: rgba(245, 158, 11, 0.2); color: #FCD34D; }
.car-class-badge.business { background: rgba(59, 130, 246, 0.2); color: #93C5FD; }
.car-class-badge.mixed { background: rgba(168, 85, 247, 0.2); color: #D8B4FE; }
.car-class-badge.premium { background: rgba(255, 255, 255, 0.1); color: #E2E8F0; }

.car-occ-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.car-occ-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--seat-avail);
}

.car-occ-fill.mid { background: var(--seat-partial); }
.car-occ-fill.high { background: var(--seat-occup); }

.car-strip-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.car-empty-tag {
  color: var(--seat-avail);
  font-weight: 700;
}

/* ==========================================================================
   CONTROLS & FILTER TOOLBAR
   ========================================================================== */
.toolbar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.styled-select {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 250px;
  transition: var(--transition-fast);
}

.styled-select:focus {
  border-color: var(--whoosh-red);
  box-shadow: 0 0 10px var(--whoosh-red-glow);
}

/* ==========================================================================
   SEGMENT MULTI-SELECT DROPDOWN COMPONENT
   ========================================================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  display: none !important;
}

.segment-multiselect {
  position: relative;
  min-width: 270px;
}

.multiselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  text-align: left;
  user-select: none;
}

.multiselect-trigger:hover {
  border-color: rgba(235, 34, 40, 0.45);
}

.multiselect-trigger.open {
  border-color: var(--whoosh-red);
  box-shadow: 0 0 12px var(--whoosh-red-glow);
}

.multiselect-trigger .trigger-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiselect-trigger .trigger-badge {
  background: linear-gradient(135deg, var(--whoosh-red), #b91c1c);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  line-height: 1.2;
}

.multiselect-trigger .trigger-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.multiselect-trigger.open .trigger-arrow {
  transform: rotate(180deg);
  color: var(--whoosh-red);
}

.multiselect-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  width: max-content;
  max-width: 440px;
  background: #1e222d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 100;
  overflow: hidden;
  animation: fadeInDown 0.18s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.multiselect-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.multiselect-heading {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.multiselect-quick-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-quick-action {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-quick-action:hover {
  background: var(--whoosh-red);
  border-color: var(--whoosh-red);
  color: #fff;
}

.multiselect-options {
  max-height: 280px;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  transition: background 0.15s ease;
  position: relative;
}

.multiselect-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.multiselect-option.selected {
  background: rgba(235, 34, 40, 0.1);
}

.multiselect-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin: 0;
}

.multiselect-option input[type="checkbox"]:checked {
  background: var(--whoosh-red);
  border-color: var(--whoosh-red);
}

.multiselect-option input[type="checkbox"]:checked::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.multiselect-option .option-name {
  flex: 1;
  color: var(--text-main);
  font-weight: 500;
}

.multiselect-option.selected .option-name {
  font-weight: 700;
  color: #fff;
}

.multiselect-option .option-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.multiselect-option.selected .option-badge {
  background: rgba(235, 34, 40, 0.2);
  color: var(--whoosh-red-light);
}

/* Switch Toggle */
/* Main .switch-control styling is in the Responsive section below */
.switch-control input {
  display: none;
}

.switch-slider {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  position: relative;
  transition: var(--transition-smooth);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  background: #FFFFFF;
  transition: var(--transition-smooth);
}

.switch-control input:checked + .switch-slider {
  background: var(--seat-avail);
  box-shadow: 0 0 12px var(--seat-avail-glow);
}

.switch-control input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Position Filter Pills */
.pill-buttons {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pill-btn:hover {
  color: #FFFFFF;
}

.pill-btn.active {
  background: rgba(199, 32, 39, 0.25);
  color: #FFFFFF;
  border: 1px solid var(--whoosh-red);
}

/* Search Bar */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input-wrapper input {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 2.25rem 0.5rem 2.4rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  width: 280px;
  transition: var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--whoosh-red);
  box-shadow: 0 0 12px var(--whoosh-red-glow);
  width: 320px;
}

.btn-clear-search {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Legend Row */
.legend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-box.seat-sample {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
}

.legend-box.seat-sample.available {
  background: var(--seat-avail-bg);
  border: 2px solid var(--seat-avail-border);
}

.legend-box.seat-sample.occupied {
  background: var(--seat-occup-bg);
  border: 2px solid var(--seat-occup-border);
}

.legend-box.seat-sample.partial {
  background: var(--seat-partial-bg);
  border: 2px solid var(--seat-partial-border);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(245, 158, 11, 0.4) 4px, rgba(245, 158, 11, 0.4) 8px);
}

.legend-box.seat-sample.exact-match {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(147, 51, 234, 0.55) 100%);
  border: 2px solid #A855F7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.legend-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
}

.legend-pill {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.74rem;
}

.legend-pill.class-first { background: rgba(245, 158, 11, 0.15); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.3); }
.legend-pill.class-business { background: rgba(59, 130, 246, 0.15); color: #93C5FD; border: 1px solid rgba(59, 130, 246, 0.3); }
.legend-pill.class-premium { background: rgba(255, 255, 255, 0.08); color: #E2E8F0; border: 1px solid rgba(255, 255, 255, 0.15); }

/* ==========================================================================
   COACH SEAT MAP SECTION
   ========================================================================== */
.seatmap-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.coach-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coach-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.active-car-badge {
  background: var(--whoosh-red);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: 0 0 14px var(--whoosh-red-glow);
}

.active-car-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.active-car-specs {
  font-size: 0.82rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.car-occupancy-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot-sep {
  color: var(--text-dim);
}

/* Coach Viewport & Chassis */
.coach-viewport {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.coach-chassis {
  background: var(--bg-chassis);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  min-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.coach-front-end, .coach-rear-end {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
}

.train-driver-cab {
  background: linear-gradient(90deg, rgba(199, 32, 39, 0.3) 0%, transparent 100%);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--whoosh-red-light);
  border-left: 3px solid var(--whoosh-red);
}

.train-driver-cab.rear-cab {
  margin-bottom: 0;
  margin-top: 0.65rem;
  background: linear-gradient(90deg, transparent 0%, rgba(199, 32, 39, 0.3) 100%);
  border-left: none;
  border-right: 3px solid var(--whoosh-red);
  text-align: right;
}

.train-driver-cab.active-cab {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.22) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-left: 3px solid #22c55e;
  color: #4ade80;
}

.train-driver-cab.rear-cab.active-cab {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, rgba(34, 197, 94, 0.22) 100%);
  border-left: none;
  border-right: 3px solid #22c55e;
  color: #4ade80;
  text-align: right;
}

.train-driver-cab.trailing-cab {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(255, 255, 255, 0.25);
  color: var(--text-muted);
}

.train-driver-cab.rear-cab.trailing-cab {
  background: rgba(255, 255, 255, 0.04);
  border-left: none;
  border-right: 3px solid rgba(255, 255, 255, 0.25);
  color: var(--text-muted);
  text-align: right;
}

.car-role-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.car-role-badge.leading {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.car-role-badge.trailing {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.train-car-card.leading-car {
  border-color: rgba(34, 197, 94, 0.4);
}

.chassis-amenity-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.amenity-icon {
  font-size: 1rem;
}

/* Seat Grid Container */
.seat-grid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0;
  width: 100%;
}

/* Individual Row */
.seat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.25rem 0;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.seat-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.row-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dim);
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

/* Row spacer matching row-label on the right for mathematical 50% aisle centering */
.row-spacer {
  width: 44px;
  flex-shrink: 0;
  visibility: hidden;
  pointer-events: none;
}

.seat-cluster {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Empty spacer slot to keep missing seats aligned with their column */
.seat-slot-empty {
  width: 58px;
  height: 52px;
  visibility: hidden;
  pointer-events: none;
  flex-shrink: 0;
}

/* 3-2 Coach Layout: 3 seats left, 2 seats right */
.seat-row.layout-32 .seat-cluster.left {
  min-width: calc(58px * 3 + 0.45rem * 2);
}
.seat-row.layout-32 .seat-cluster.right {
  min-width: calc(58px * 2 + 0.45rem);
}

/* 2-3 Coach Layout: 2 seats left, 3 seats right */
.seat-row.layout-23 .seat-cluster.left {
  min-width: calc(58px * 2 + 0.45rem);
}
.seat-row.layout-23 .seat-cluster.right {
  min-width: calc(58px * 3 + 0.45rem * 2);
}

/* Car 01 (2-2): Both sides balanced to 2 seats width */
.seat-row.layout-22 .seat-cluster.left,
.seat-row.layout-22 .seat-cluster.right {
  min-width: calc(58px * 2 + 0.45rem);
}

/* Aisle */
.seat-aisle {
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.15em;
  user-select: none;
  position: relative;
}

.seat-aisle::before {
  content: '';
  position: absolute;
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
}

/* Seat Component */
.seat-node {
  width: 58px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  user-select: none;
}

/* Seat Contours (Headrest & Cushion) */
.seat-headrest {
  width: 32px;
  height: 8px;
  border-radius: 3px;
  margin-bottom: 2px;
  transition: var(--transition-fast);
}

.seat-cushion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.seat-letter {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
}

.seat-code {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Seat States */
.seat-node.available {
  background: var(--seat-avail-bg);
  border: 1.5px solid var(--seat-avail-border);
  color: #34D399;
}
.seat-node.available .seat-headrest {
  background: var(--seat-avail-border);
}
.seat-node.available:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 4px 14px var(--seat-avail-glow);
  border-color: #34D399;
}

.seat-node.occupied {
  background: var(--seat-occup-bg);
  border: 1.5px solid var(--seat-occup-border);
  color: #F87171;
}
.seat-node.occupied .seat-headrest {
  background: var(--seat-occup-border);
}
.seat-node.occupied:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.seat-node.partial {
  background: var(--seat-partial-bg);
  border: 1.5px solid var(--seat-partial-border);
  color: #FBBF24;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(245, 158, 11, 0.3) 5px, rgba(245, 158, 11, 0.3) 10px);
}
.seat-node.partial .seat-headrest {
  background: var(--seat-partial-border);
}
.seat-node.partial:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.seat-node.exact-match {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28) 0%, rgba(147, 51, 234, 0.45) 100%);
  border: 1.5px solid #A855F7;
  color: #F3E8FF;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.32);
}

.seat-node.exact-match .seat-headrest {
  background: #A855F7;
}

.seat-node.exact-match:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.6);
  border-color: #C084FC;
}

.seat-node.exact-match.partial {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(168, 85, 247, 0.35) 5px, rgba(168, 85, 247, 0.35) 10px);
}

/* Inspected (Verified) Seat State */
.seat-node.inspected {
  border: 2px solid var(--seat-inspect-border) !important;
  box-shadow: 0 0 14px var(--seat-inspect-glow) !important;
  position: relative;
}

.seat-node.inspected .seat-headrest {
  background: var(--seat-inspect) !important;
  box-shadow: 0 1px 4px rgba(6, 182, 212, 0.5);
}

.seat-node.inspected:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 18px var(--seat-inspect-glow) !important;
  border-color: var(--seat-inspect) !important;
}

/* Inspected Badge on top right corner of seat node */
.seat-node .seat-inspected-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  background: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%);
  color: #FFFFFF;
  border: 1.5px solid #FFFFFF;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 8px rgba(6, 182, 212, 0.6);
  z-index: 5;
  animation: pulse-inspected 2.5s infinite ease-in-out;
}

@keyframes pulse-inspected {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 8px rgba(6, 182, 212, 0.6); }
  50% { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 14px rgba(6, 182, 212, 0.85); }
}

/* Rapid Checklist Mode Active Container */
.rapid-inspect-active .seat-node {
  cursor: pointer;
}
.rapid-inspect-active .seat-node:hover {
  outline: 2px dashed #06B6D4;
}

/* Sample Box in Legend */
.seat-sample.inspected {
  background: var(--seat-occup-bg);
  border: 2px solid var(--seat-inspect);
  box-shadow: 0 0 8px var(--seat-inspect-glow);
  position: relative;
}
.seat-sample.inspected::after {
  content: '✓';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: var(--seat-inspect);
  color: #FFF;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Detail Modal Inspection Section */
.seat-inspection-section {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 10px;
}
.seat-inspection-section.uninspected {
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.2);
}
.inspection-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.inspection-status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}
.inspection-status-badge.inspected {
  background: rgba(6, 182, 212, 0.25);
  color: #38BDF8;
  border: 1px solid rgba(6, 182, 212, 0.5);
}
.inspection-status-badge.uninspected {
  background: rgba(100, 116, 139, 0.2);
  color: #94A3B8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}
.inspection-time {
  font-size: 0.75rem;
  color: var(--text-muted, #94A3B8);
}
.inspection-inspector {
  font-size: 0.82rem;
  color: var(--text-primary, #F8FAFC);
}
.inspection-notes {
  font-size: 0.78rem;
  color: var(--text-secondary, #CBD5E1);
  margin-top: 4px;
  font-style: italic;
}
.inspection-notes-input-group {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
[data-theme="kcic-light"] .inspection-notes-input-group {
  border-top-color: rgba(0, 0, 0, 0.1);
}
.inspection-notes-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted, #94A3B8);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
[data-theme="kcic-light"] .inspection-notes-label {
  color: #64748B;
}
.inspection-notes-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inspection-notes-input {
  flex: 1;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary, #F8FAFC);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inspection-notes-input:focus {
  outline: none;
  border-color: #06B6D4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}
[data-theme="kcic-light"] .inspection-notes-input {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
}
[data-theme="kcic-light"] .inspection-notes-input:focus {
  border-color: #0284C7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}
.btn-save-notes {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38BDF8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-save-notes:hover {
  background: #0891B2;
  color: #FFFFFF;
  border-color: #06B6D4;
}
[data-theme="kcic-light"] .btn-save-notes {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0284C7;
}
[data-theme="kcic-light"] .btn-save-notes:hover {
  background: #0284C7;
  color: #FFFFFF;
}
.text-inspected {
  color: #38BDF8 !important;
}
[data-theme="kcic-light"] .text-inspected {
  color: #0284C7 !important;
}

/* Light theme inspection section styles */
[data-theme="kcic-light"] .seat-inspection-section {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
}

[data-theme="kcic-light"] .seat-inspection-section.uninspected {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

[data-theme="kcic-light"] .seat-inspection-section.inspected {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.35);
}

[data-theme="kcic-light"] .inspection-status-badge.inspected {
  background: rgba(2, 132, 199, 0.15);
  color: #0369A1;
  border: 1px solid rgba(2, 132, 199, 0.4);
}

[data-theme="kcic-light"] .inspection-status-badge.uninspected {
  background: #E2E8F0;
  color: #334155;
  border: 1px solid #CBD5E1;
}

[data-theme="kcic-light"] .inspection-time {
  color: #64748B;
}

[data-theme="kcic-light"] .inspection-inspector {
  color: #1E293B;
  font-weight: 500;
}

[data-theme="kcic-light"] .inspection-notes {
  color: #0369A1;
  font-weight: 500;
}


.btn-inspect {
  background: linear-gradient(135deg, #0891B2 0%, #0284C7 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
}
.btn-inspect:hover {
  background: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.5);
}
.btn-inspect.btn-uninspect {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.btn-inspect.btn-uninspect:hover {
  background: linear-gradient(135deg, #64748B 0%, #475569 100%);
}

/* Quick Inspect Switch Toggle (matches Show Available Seats Only toggle) */
.switch-control input#toggleQuickInspect:checked + .switch-slider {
  background: var(--seat-inspect-border, #06B6D4);
  border-color: #0891B2;
  box-shadow: 0 0 12px var(--seat-inspect-glow, rgba(6, 182, 212, 0.45));
}

[data-theme="kcic-light"] .switch-control input#toggleQuickInspect:checked + .switch-slider {
  background: #0284C7;
  border-color: #0369A1;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
}

.rapid-checklist-group .switch-control:hover {
  border-color: var(--seat-inspect-border, #06B6D4);
}

.rapid-checklist-group .switch-control:has(input:checked) {
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(6, 182, 212, 0.08);
}

[data-theme="kcic-light"] .rapid-checklist-group .switch-control:has(input:checked) {
  border-color: rgba(2, 132, 199, 0.4);
  background: rgba(2, 132, 199, 0.05);
}

/* Empty filtered state */
.seat-node.filtered-out {
  opacity: 0.15;
  filter: grayscale(1);
  pointer-events: none;
}

.seat-node.search-match {
  outline: 3px solid #38BDF8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.85);
  animation: bounce-match 0.8s infinite alternate;
  z-index: 10;
}

.seat-node.search-focus {
  outline: 4px solid #f59e0b !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.95), 0 0 45px rgba(56, 189, 248, 0.8) !important;
  animation: beacon-glow 0.5s ease-in-out 5 alternate !important;
  z-index: 30 !important;
}

@keyframes bounce-match {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

@keyframes beacon-glow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.18); filter: brightness(1.35); }
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 580px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: var(--transition-smooth);
}

.modal-backdrop.show .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.seat-modal-badge {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--whoosh-red);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: 0 0 16px var(--whoosh-red-glow);
}

.seat-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.seat-modal-class {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Seat Status Banner */
.seat-status-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
}

.seat-status-banner.available {
  background: var(--seat-avail-bg);
  border: 1px solid var(--seat-avail-border);
}

.seat-status-banner.occupied {
  background: var(--seat-occup-bg);
  border: 1px solid var(--seat-occup-border);
}

.seat-status-banner.partial {
  background: var(--seat-partial-bg);
  border: 1px solid var(--seat-partial-border);
}

.seat-status-banner.exact-match {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(147, 51, 234, 0.28) 100%);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #F3E8FF;
}

.seat-status-banner.exact-match .status-icon {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.55);
  color: #D8B4FE;
}

[data-theme="kcic-light"] .seat-status-banner.exact-match {
  background: #F5EEFD;
  border: 1.5px solid #C084FC;
  color: #581C87;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.08);
}

[data-theme="kcic-light"] .seat-status-banner.exact-match .status-icon {
  background: #EDE9FE;
  border: 1px solid #DDD6FE;
  color: #7C3AED;
}

[data-theme="kcic-light"] .seat-status-banner.exact-match .status-text-wrap strong {
  color: #581C87;
  font-weight: 700;
}

[data-theme="kcic-light"] .seat-status-banner.exact-match .status-text-wrap span {
  color: #6B21A8;
  font-weight: 500;
}


.status-icon {
  font-size: 1.5rem;
}

.status-text-wrap {
  display: flex;
  flex-direction: column;
}

.status-text-wrap strong {
  font-size: 0.95rem;
}

.status-text-wrap span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Timeline (Compact Segment Strip) */
.timeline-title, .section-subheading {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.segment-timeline-container {
  margin: 0;
}

.segment-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  min-height: 48px;
  gap: 4px;
  transition: all 0.2s ease;
}

.timeline-step.seg-occupied {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.timeline-step.seg-available {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="kcic-light"] .timeline-step.seg-occupied {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="kcic-light"] .timeline-step.seg-available {
  background: rgba(13, 150, 104, 0.06);
  border-color: rgba(13, 150, 104, 0.3);
}

.step-route-short {
  display: none;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.step-route-full {
  display: block;
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--text-secondary, #CBD5E1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

[data-theme="kcic-light"] .step-route-full {
  color: #334155;
}

[data-theme="kcic-light"] .step-route-short {
  color: #0F172A;
}

.step-status-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.step-status-tag.free {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.step-status-tag.taken {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

[data-theme="kcic-light"] .step-status-tag.free {
  background: rgba(13, 150, 104, 0.15);
  color: #0D7A55;
}

[data-theme="kcic-light"] .step-status-tag.taken {
  background: rgba(225, 29, 72, 0.15);
  color: #BE123C;
}

@media (max-width: 540px) {
  .step-route-short {
    display: block;
  }
  .step-route-full {
    display: none;
  }
  .step-status-tag {
    font-size: 0.62rem;
    padding: 0.12rem 0.35rem;
  }
}

/* Compact Adjustments for Seat Detail Modal */
.seat-detail-modal .modal-header {
  padding: 1rem 1.25rem 0.75rem;
  gap: 0.75rem;
}

.seat-detail-modal .seat-modal-badge {
  font-size: 1.35rem;
  padding: 0.25rem 0.65rem;
}

.seat-detail-modal .seat-modal-title {
  font-size: 1.1rem;
}

.seat-detail-modal .modal-body {
  padding: 0.85rem 1.25rem;
  gap: 0.7rem;
}

.seat-detail-modal .seat-status-banner {
  padding: 0.55rem 0.85rem;
  gap: 0.65rem;
}

.seat-detail-modal .status-icon {
  font-size: 1.25rem;
}

.seat-detail-modal .status-text-wrap strong {
  font-size: 0.88rem;
}

.seat-detail-modal .status-text-wrap span {
  font-size: 0.74rem;
  line-height: 1.25;
}

.seat-detail-modal .seat-inspection-section {
  margin-top: 0;
  padding: 9px 13px;
}

/* Passenger Card */
.passenger-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.passenger-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  transition: var(--transition-smooth);
}

.passenger-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.passenger-card.exact-route-card,
.passenger-card.exact-relasi-card {
  border-color: rgba(168, 85, 247, 0.65) !important;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(30, 41, 59, 0.85) 100%) !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.22) !important;
}

.exact-route-badge,
.exact-relasi-badge {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.55);
  color: #E9D5FF;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

.passenger-name-row {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(199, 32, 39, 0.14), rgba(255, 255, 255, 0.03));
  border-left: 3px solid var(--whoosh-red);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.15rem;
}

.passenger-name-val {
  font-size: 1.02rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.02em;
}

.passenger-child-badge {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
  padding: 0.6rem 0.8rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
}

.child-badge-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.2);
}

.child-badge-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #FBBF24;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.child-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
}

.child-info-col {
  display: flex;
  flex-direction: column;
}

.child-sub-label {
  font-size: 0.68rem;
  color: #D1D5DB;
  text-transform: uppercase;
  font-weight: 600;
}

.child-sub-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: #FEF3C7;
}

.passenger-info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.info-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.passenger-route-val {
  color: #60A5FA;
}

/* KCIC Light theme overrides for passenger card and exact match details */
[data-theme="kcic-light"] .passenger-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .passenger-card:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

[data-theme="kcic-light"] .passenger-card.exact-route-card,
[data-theme="kcic-light"] .passenger-card.exact-relasi-card {
  background: linear-gradient(135deg, #FAF5FF 0%, #F5EEFD 100%) !important;
  border: 1.5px solid #C084FC !important;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.12) !important;
}

[data-theme="kcic-light"] .exact-route-badge,
[data-theme="kcic-light"] .exact-relasi-badge {
  background: #EDE9FE;
  border: 1px solid #A855F7;
  color: #6B21A8;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.10);
}

[data-theme="kcic-light"] .passenger-name-row {
  background: linear-gradient(135deg, rgba(163, 0, 40, 0.08), rgba(255, 255, 255, 0.9));
  border-left: 3px solid var(--whoosh-red);
}

[data-theme="kcic-light"] .passenger-name-val {
  color: #0F172A;
}

[data-theme="kcic-light"] .info-label {
  color: #64748B;
  font-weight: 600;
}

[data-theme="kcic-light"] .info-val {
  color: #0F172A;
  font-weight: 700;
}

[data-theme="kcic-light"] .passenger-route-val,
[data-theme="kcic-light"] .passenger-card .info-val[style*="#60A5FA"] {
  color: #0369A1 !important;
  font-weight: 700;
}

[data-theme="kcic-light"] .passenger-child-badge {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
}

[data-theme="kcic-light"] .child-badge-header {
  border-bottom-color: rgba(245, 158, 11, 0.3);
}

[data-theme="kcic-light"] .child-badge-title {
  color: #B45309;
}

[data-theme="kcic-light"] .child-sub-label {
  color: #78350F;
}

[data-theme="kcic-light"] .child-sub-val {
  color: #92400E;
}


/* Upload Modal Styles */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--whoosh-red);
  background: rgba(199, 32, 39, 0.08);
}

.dropzone-icon {
  color: var(--whoosh-red-light);
  margin-bottom: 0.75rem;
}

.dropzone-main-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
}

.dropzone-sub-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.6rem;
}

.link-btn {
  background: none;
  border: none;
  color: #60A5FA;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.dropzone-format-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.or-divider span {
  padding: 0 0.85rem;
}

.styled-textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-family: monospace;
  font-size: 0.8rem;
  outline: none;
  resize: vertical;
}

.styled-textarea:focus {
  border-color: var(--whoosh-red);
}

.alert-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
}

.alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.file-info-pill {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Toast */
.toast-container {
  position: fixed;
  top: calc(1.25rem + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
  width: max-content;
  max-width: min(520px, calc(100vw - 2.5rem));
}

.toast {
  background: rgba(22, 30, 44, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slide-toast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.success { border-left: 4px solid var(--seat-avail); }
.toast.error { border-left: 4px solid var(--seat-occup); }
.toast.warning { border-left: 4px solid #F59E0B; }
.toast.info { border-left: 4px solid #3B82F6; }

@keyframes slide-toast {
  from { transform: translateY(-24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Install App Button */
.btn-install {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-install:hover {
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  transform: translateY(-1px);
}

/* Mobile More Button in Header */
.btn-mobile-more {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-mobile-more:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.95);
}

/* Bottom Sheet Drag Handle */
.bottom-sheet-drag-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  margin: -0.25rem auto 1rem;
}

/* Mobile Actions Bottom Sheet Drawer */
.mobile-actions-sheet {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 540px;
}

.offline-indicator-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #34D399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  display: inline-block;
}

.mobile-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
}

.mobile-action-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.09);
}

.mobile-action-btn .m-act-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mobile-action-btn .m-act-text {
  display: flex;
  flex-direction: column;
}

.mobile-action-btn .m-act-text strong {
  font-size: 0.92rem;
  color: #FFFFFF;
}

.mobile-action-btn .m-act-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mobile-action-btn.primary .m-act-icon { background: rgba(199, 32, 39, 0.2); }
.mobile-action-btn.success .m-act-icon { background: rgba(16, 185, 129, 0.2); }
.mobile-action-btn.info .m-act-icon { background: rgba(59, 130, 246, 0.2); }
.mobile-action-btn.danger .m-act-icon { background: rgba(239, 68, 68, 0.2); }
.mobile-action-btn.install .m-act-icon { background: rgba(16, 185, 129, 0.2); }

/* Persistent Mobile Bottom Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 8px));
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  min-width: 58px;
  position: relative;
}

.bottom-nav-item .b-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 1;
}

.bottom-nav-item .b-nav-icon svg {
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.bottom-nav-item .b-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bottom-nav-item.active {
  color: #FFFFFF;
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--whoosh-red);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-item.active .b-nav-label {
  color: var(--whoosh-red);
  font-weight: 700;
}

.bottom-nav-item.active .b-nav-icon svg {
  stroke: var(--whoosh-red);
}

.bottom-nav-item.highlight {
  background: linear-gradient(135deg, var(--whoosh-red) 0%, #991B1B 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px var(--whoosh-red-glow);
  transform: translateY(-4px);
  padding: 0.45rem 0.85rem;
}

.bottom-nav-item.highlight .b-nav-label {
  color: #FFFFFF;
}

.bottom-nav-item.highlight .b-nav-icon svg {
  stroke: #FFFFFF;
}

.bottom-nav-item:hover .b-nav-icon svg {
  transform: translateY(-1px);
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* ==========================================================================
   RESPONSIVE & MOBILE DESIGN SUITE
   ========================================================================== */

/* kcic-light theme: red-tinted bottom nav */
[data-theme="kcic-light"] .mobile-bottom-bar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(163, 0, 40, 0.12);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.10);
}

[data-theme="kcic-light"] .bottom-nav-item {
  color: #9BAAB8;
}

[data-theme="kcic-light"] .bottom-nav-item.active {
  color: #a30028;
}

[data-theme="kcic-light"] .bottom-nav-item.active .b-nav-label {
  color: #a30028;
}

[data-theme="kcic-light"] .bottom-nav-item.active .b-nav-icon svg {
  stroke: #a30028;
}

[data-theme="kcic-light"] .bottom-nav-item.active::before {
  background: #a30028;
}

/* Segment timeline contrast improvements */
.timeline-step.seg-available {
  background: rgba(13, 150, 104, 0.08);
  border-color: rgba(13, 150, 104, 0.25);
}

.timeline-step.seg-occupied {
  background: rgba(211, 47, 47, 0.07);
  border-color: rgba(211, 47, 47, 0.22);
}

/* Search empty state */
.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.search-no-results svg {
  opacity: 0.4;
}

.search-no-results strong {
  font-size: 1rem;
  color: var(--text-main);
  display: block;
}

.search-no-results span {
  font-size: 0.85rem;
  line-height: 1.5;
}

.search-no-results .btn-clear-all {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-no-results .btn-clear-all:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--whoosh-red);
  color: var(--whoosh-red);
}

/* Car strip pagination dots */
.car-strip-pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
}

.car-strip-pagination .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.car-strip-pagination .dot.active {
  background: var(--whoosh-red);
  width: 16px;
  border-radius: 3px;
}

/* Switch control: more visible container */
.switch-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.switch-control:hover {
  border-color: var(--whoosh-red);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="kcic-light"] .switch-control {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .switch-control:hover {
  border-color: var(--whoosh-red);
  background: rgba(163, 0, 40, 0.03);
}

[data-theme="kcic-light"] .switch-slider {
  background: #CBD5E1;
  border: 1.5px solid #94A3B8;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

[data-theme="kcic-light"] .switch-slider::before {
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  border: 1px solid #94A3B8;
}

[data-theme="kcic-light"] .switch-control input:checked + .switch-slider {
  background: #0D9668;
  border-color: #0D7A55;
  box-shadow: 0 0 10px rgba(13, 150, 104, 0.25);
}

[data-theme="kcic-light"] .switch-control input:checked + .switch-slider::before {
  background: #FFFFFF;
  border-color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="kcic-light"] .switch-label {
  color: #1E293B;
  font-weight: 600;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Show Mobile Bottom Bar */
  .mobile-bottom-bar {
    display: flex;
  }

  .btn-mobile-more {
    display: flex;
  }

  /* Adjust Main Content for Bottom Bar & Widen Available Area */
  .main-content {
    padding: 0.75rem 0.5rem calc(5.5rem + env(safe-area-inset-bottom, 12px));
    gap: 1rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Header compact */
  .app-header {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .header-left .brand-title {
    font-size: 1.05rem;
  }

  .header-left .brand-subtitle {
    display: none;
  }

  .header-center {
    display: none; /* Moved to mobile toolbar / header selector */
  }

  .header-right .btn-secondary,
  .header-right .btn-primary,
  .header-right .btn-danger {
    display: none; /* Accessible via mobile bottom bar / more sheet */
  }

  /* Sembunyikan Export CSV pada tampilan HP */
  #btnExportEmpty,
  #mBtnExportCSV {
    display: none !important;
  }

  .header-right #btnInstallPwa {
    display: inline-flex !important;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
  }

  /* KPI Grid on Mobile (2x2) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .kpi-card {
    padding: 0.9rem;
    gap: 0.6rem;
  }

  .kpi-icon {
    width: 38px;
    height: 38px;
  }

  .kpi-icon svg {
    width: 20px;
    height: 20px;
  }

  .kpi-val {
    font-size: 1.4rem;
  }

  .kpi-label {
    font-size: 0.72rem;
  }

  .kpi-subtext {
    font-size: 0.7rem;
  }

  /* Train Strip: Smooth Touch Swipe Carousel with Snap */
  .train-strip-section {
    padding: 0.85rem;
  }

  .train-strip-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.65rem;
    padding: 0.4rem 0.2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .train-strip-container::-webkit-scrollbar {
    display: none;
  }

  .car-card {
    flex: 0 0 145px;
    scroll-snap-align: start;
    padding: 0.75rem;
  }

  /* Toolbar Section on Mobile */
  .toolbar-section {
    padding: 1rem;
    gap: 0.85rem;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .filter-group {
    width: 100%;
  }

  /* Travel Segment: Stack Label and Dropdown Vertically on Mobile */
  .filter-group.segment-filter {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .filter-group.segment-filter .filter-label {
    width: 100%;
    justify-content: flex-start;
  }

  .segment-multiselect {
    width: 100%;
    min-width: 0;
  }

  .segment-multiselect .styled-select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .multiselect-dropdown {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filter-group select,
  .search-input-wrapper {
    width: 100%;
  }

  .pill-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    width: 100%;
  }

  .pill-btn {
    text-align: center;
    padding: 0.45rem 0.2rem;
    font-size: 0.75rem;
  }

  .legend-row {
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.75rem;
  }

  /* Coach Card & Seat Map on Mobile (Wider display, Zero Horizontal Scroll) */
  .seatmap-section {
    padding: 0.65rem 0.25rem;
    border-radius: var(--radius-md);
    gap: 0.65rem;
    width: 100%;
    box-sizing: border-box;
  }

  .coach-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.4rem;
  }

  .coach-header-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .active-car-badge {
    font-size: 0.92rem;
    padding: 0.25rem 0.65rem;
  }

  .active-car-title {
    font-size: 0.95rem;
  }

  .active-car-specs {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
  }

  .car-occupancy-pill {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
  }

  .coach-viewport {
    padding: 0.15rem 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .coach-chassis {
    --seat-w-mobile: clamp(38px, calc((100vw - 134px) / 5.2), 48px);
    --seat-h-mobile: calc(var(--seat-w-mobile) * 1.08);
    padding: 0.75rem 0.65rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    border-width: 1.5px;
    gap: 0.65rem;
  }

  .coach-front-end, .coach-rear-end {
    padding: 0.35rem 0.45rem;
    box-sizing: border-box;
  }

  .train-driver-cab {
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
    white-space: normal;
    line-height: 1.25;
  }

  .chassis-amenity-bar {
    gap: 0.75rem;
    font-size: 0.72rem;
    padding: 0.2rem 0;
    flex-wrap: wrap;
  }

  .seat-grid-container {
    gap: 0.35rem;
    padding: 0.35rem 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
  }

  /* Seat Row Layout on Mobile */
  .seat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    max-width: 100%;
    padding: 0.12rem 0;
    box-sizing: border-box;
  }

  .row-label {
    width: 24px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
    margin-right: 4px;
  }

  .row-spacer {
    width: 24px;
    flex-shrink: 0;
    visibility: hidden;
    pointer-events: none;
    margin-left: 4px;
  }

  .seat-cluster {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }

  .seat-slot-empty {
    width: var(--seat-w-mobile);
    height: var(--seat-h-mobile);
    visibility: hidden;
    pointer-events: none;
    flex-shrink: 0;
  }

  /* Layout 3-2 (3 seats left, 2 seats right) */
  .seat-row.layout-32 .seat-cluster.left {
    min-width: calc(var(--seat-w-mobile) * 3 + 6px);
    max-width: calc(var(--seat-w-mobile) * 3 + 6px);
  }
  .seat-row.layout-32 .seat-cluster.right {
    min-width: calc(var(--seat-w-mobile) * 2 + 3px);
    max-width: calc(var(--seat-w-mobile) * 2 + 3px);
  }

  /* Layout 2-3 (2 seats left, 3 seats right) */
  .seat-row.layout-23 .seat-cluster.left {
    min-width: calc(var(--seat-w-mobile) * 2 + 3px);
    max-width: calc(var(--seat-w-mobile) * 2 + 3px);
  }
  .seat-row.layout-23 .seat-cluster.right {
    min-width: calc(var(--seat-w-mobile) * 3 + 6px);
    max-width: calc(var(--seat-w-mobile) * 3 + 6px);
  }

  /* Layout 2-2 (Car 01) */
  .seat-row.layout-22 .seat-cluster.left,
  .seat-row.layout-22 .seat-cluster.right {
    min-width: calc(var(--seat-w-mobile) * 2 + 3px);
    max-width: calc(var(--seat-w-mobile) * 2 + 3px);
  }

  .seat-row.layout-eastbound .seat-cluster.right,
  .seat-row.layout-westbound .seat-cluster.left {
    justify-content: center;
  }

  .seat-aisle {
    width: 20px;
    flex-shrink: 0;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
  }

  [data-theme="kcic-light"] .seat-aisle {
    color: rgba(0, 0, 0, 0.35);
  }

  .seat-aisle::before {
    content: '';
    position: absolute;
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
  }

  [data-theme="kcic-light"] .seat-aisle::before {
    background: rgba(0, 0, 0, 0.08);
  }

  /* Seat Dimensions on Mobile (Finger Friendly & Proportional) */
  .seat-node {
    width: var(--seat-w-mobile);
    height: var(--seat-h-mobile);
    border-radius: 6px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 2px 0;
  }

  .seat-node .seat-headrest {
    width: calc(var(--seat-w-mobile) * 0.52);
    height: 5px;
    border-radius: 2px;
    margin-bottom: 2px;
  }

  .seat-node .seat-letter {
    font-size: calc(var(--seat-w-mobile) * 0.36);
    font-weight: 800;
    line-height: 1.1;
  }

  .seat-node .seat-code {
    font-size: calc(var(--seat-w-mobile) * 0.26);
    font-weight: 700;
    line-height: 1;
    opacity: 0.85;
  }

  /* Bottom-Sheet Transformation for Modals on Mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    padding: 1.25rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom, 16px));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-backdrop.show .modal-card {
    transform: translateY(0);
  }

  .toast-container {
    top: calc(0.75rem + env(safe-area-inset-top, 8px));
    bottom: auto;
    left: 1rem;
    right: 1rem;
    transform: none;
    width: auto;
    max-width: none;
    align-items: stretch;
  }

  .toast {
    width: 100%;
    font-size: 0.82rem;
  }
}

/* Empty Manifest Banner */
.empty-manifest-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  margin-bottom: 1rem;
}

.empty-banner-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.empty-banner-icon {
  font-size: 2rem;
  background: rgba(199, 32, 39, 0.15);
  border: 1px solid rgba(199, 32, 39, 0.3);
  border-radius: 14px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.empty-banner-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #F8FAFC;
}

.empty-banner-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #94A3B8;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .empty-manifest-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.15rem;
    gap: 1rem;
  }
  .empty-banner-content {
    align-items: flex-start;
  }
  .empty-manifest-banner .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   TIMETABLE REFERENCE MODAL
   ========================================================================== */
.modal-card.timetable-modal {
  max-width: 860px;
  max-height: 88vh;
  width: 95%;
}

.timetable-modal-body {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  flex: 1;
}

.timetable-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.timetable-tabs {
  display: flex;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.timetable-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.timetable-tab:hover {
  color: #FFFFFF;
}

.timetable-tab.active {
  background: var(--whoosh-red);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--whoosh-red-glow);
}

.timetable-search-wrap {
  flex: 1;
  min-width: 220px;
}

.timetable-search-wrap input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  color: #FFFFFF;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.timetable-search-wrap input:focus {
  outline: none;
  border-color: var(--whoosh-red);
  box-shadow: 0 0 0 2px var(--whoosh-red-glow);
}

.timetable-table-container {
  overflow-y: auto;
  max-height: 50vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
}

.timetable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.timetable-table th {
  background: rgba(16, 22, 34, 0.96);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.timetable-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.timetable-table tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.timetable-table tr.active-train-row {
  background: rgba(199, 32, 39, 0.15);
  border-left: 3px solid var(--whoosh-red);
}

.train-code-badge {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  font-size: 0.82rem;
}

.timetable-table tr.active-train-row .train-code-badge {
  background: var(--whoosh-red);
  color: #FFFFFF;
}

.timetable-time {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
}

.timetable-time.pass {
  color: var(--text-dim);
  font-weight: 400;
}

.op-days-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.op-days-badge.daily {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.op-days-badge.mon-sat {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.timetable-footer-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ROLE-BASED ACCESS CONTROL & HYBRID SYNC STYLES
   ========================================================================== */

/* Sync Button & Animation */
.btn-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

.sync-icon {
  transition: transform 0.4s ease;
}

.sync-icon.spinning {
  animation: spinSync 1s linear infinite;
}

@keyframes spinSync {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* User Profile Widget in Header */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.5rem 0.3rem 0.75rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar {
  font-size: 1.1rem;
  line-height: 1;
}

.user-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.role-badge.role-admin,
.role-chip-admin {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(168, 85, 247, 0.3));
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

.role-badge.role-hpr,
.role-chip-hpr {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(59, 130, 246, 0.3));
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.role-badge.role-services,
.role-chip-services {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.3), rgba(16, 185, 129, 0.3));
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.role-badge.role-regular,
.role-chip-regular {
  background: rgba(148, 163, 184, 0.15);
  color: #CBD5E1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.role-badge.role-custom,
.role-chip-custom {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

/* Hide KPI Grid metrics for Regular User role */
body.role-regular #kpiGridSection {
  display: none !important;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.btn-icon-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   AUTHENTICATION OVERLAY (LOGIN VIEW)
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 20%, rgba(199, 32, 39, 0.18) 0%, rgba(11, 14, 20, 0.95) 75%);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.auth-card {
  background: #131A26;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px var(--whoosh-red-glow);
  width: 100%;
  max-width: 440px;
  padding: 2.2rem 2rem;
  animation: authCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo-badge {
  width: 58px;
  height: 58px;
  background: var(--whoosh-red);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--whoosh-red-glow);
  margin-bottom: 0.8rem;
}

.auth-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  margin-bottom: 0.25rem;
}

.auth-title span {
  color: var(--whoosh-red-light);
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}



/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.password-hint-badge {
  font-size: 0.7rem;
  color: #34D399;
  background: rgba(52, 211, 153, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-dim);
  pointer-events: none;
}

.form-input {
  width: 100%;
  background: rgba(11, 14, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--whoosh-red-light);
  box-shadow: 0 0 0 3px rgba(199, 32, 39, 0.25);
  background: rgba(11, 14, 20, 0.95);
}

.form-select {
  padding-left: 1rem;
  appearance: auto;
}

.btn-toggle-password {
  position: absolute;
  right: 0.8rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 0.2rem;
}

.btn-toggle-password:hover {
  color: var(--text-main);
}

.btn-auth-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.4rem;
  justify-content: center;
  box-shadow: 0 4px 15px var(--whoosh-red-glow);
}

.auth-footer-links {
  text-align: center;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.link-btn:hover {
  color: var(--whoosh-red-light);
}

/* ==========================================================================
   USER MANAGEMENT MODAL (ADMIN ONLY) & ACCESS CONTROL
   ========================================================================== */
.user-mgmt-modal {
  max-width: 820px;
  width: 95%;
}

.roles-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.role-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  transition: all var(--transition-fast);
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.role-card-header strong {
  color: var(--text-main);
}

.role-card p {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.role-card.role-admin { border-left: 3px solid #A855F7; }
.role-card.role-hpr { border-left: 3px solid #3B82F6; }
.role-card.role-services { border-left: 3px solid #10B981; }
.role-card.role-regular { border-left: 3px solid #94A3B8; }

.user-mgmt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.user-mgmt-toolbar .search-wrap {
  flex: 1;
  max-width: 320px;
}

.user-mgmt-toolbar .form-input {
  padding: 0.6rem 0.9rem;
}

.users-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(11, 14, 20, 0.4);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.users-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.users-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-self-indicator {
  font-size: 0.7rem;
  color: #34D399;
  font-weight: 600;
  margin-left: 4px;
}

.user-date-col {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-role-perm-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.perm-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 250px;
}

.perm-chip {
  display: inline-block;
  font-size: 0.67rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93C5FD;
  font-weight: 500;
  line-height: 1.2;
}

.perm-chip.none {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94A3B8;
  font-style: italic;
}

.user-action-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-table-action {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-table-action.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #EF4444;
}

/* User Form Modal */
.user-form-modal {
  max-width: 520px;
}

.user-form-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-form-modal .form-input,
.user-form-modal .form-select {
  padding: 0.65rem 0.9rem;
}

/* Granular Permissions Checkbox Group */
.permissions-selection-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.permissions-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.permissions-hint {
  font-size: 0.72rem;
  color: var(--whoosh-red-light);
  font-weight: 500;
}

.permissions-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem;
}

.perm-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.perm-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.perm-checkbox-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--whoosh-red);
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.perm-custom-box {
  display: none;
}

.perm-info {
  display: flex;
  flex-direction: column;
}

.perm-info strong {
  font-size: 0.78rem;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.25;
}

.perm-info small {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}

.password-rules-box {
  margin-top: 0.3rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.rule-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  display: block;
}

/* Server Config Modal */
.server-config-modal {
  max-width: 480px;
}

.connection-status-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  margin-top: 0.8rem;
  font-size: 0.82rem;
}

/* Restricted Passenger Notice */
.passenger-restricted-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.restricted-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.restricted-text strong {
  color: #FBBF24;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
}

.restricted-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .user-profile-widget .user-text-group {
    display: none;
  }
  .roles-overview-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   KCIC LIGHT THEME OVERRIDES — USER MANAGEMENT & ROLE PERMISSIONS
   Enhanced readability, crisp contrast, official KCIC corporate styling
   ========================================================================== */
[data-theme="kcic-light"] .user-mgmt-modal,
[data-theme="kcic-light"] .user-form-modal,
[data-theme="kcic-light"] .server-config-modal {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

[data-theme="kcic-light"] .user-mgmt-modal .modal-title,
[data-theme="kcic-light"] .user-form-modal .modal-title,
[data-theme="kcic-light"] .server-config-modal .modal-title {
  color: #0F172A;
}

[data-theme="kcic-light"] .user-mgmt-modal .modal-subtitle,
[data-theme="kcic-light"] .server-config-modal .modal-subtitle {
  color: #64748B;
}

/* Role overview cards */
[data-theme="kcic-light"] .role-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="kcic-light"] .role-card-header strong {
  color: #0F172A;
  font-weight: 700;
}

[data-theme="kcic-light"] .role-card p {
  color: #475569;
}

[data-theme="kcic-light"] .role-card.role-admin {
  border-left: 3px solid #7E22CE;
  background: linear-gradient(135deg, rgba(243, 232, 255, 0.5), #F8FAFC);
}

[data-theme="kcic-light"] .role-card.role-hpr {
  border-left: 3px solid #2563EB;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.5), #F8FAFC);
}

[data-theme="kcic-light"] .role-card.role-services {
  border-left: 3px solid #059669;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.5), #F8FAFC);
}

[data-theme="kcic-light"] .role-card.role-regular {
  border-left: 3px solid #64748B;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.5), #F8FAFC);
}

/* Toolbar search and inputs */
[data-theme="kcic-light"] .user-mgmt-toolbar .search-wrap .form-input {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

[data-theme="kcic-light"] .user-mgmt-toolbar .search-wrap .form-input::placeholder {
  color: #94A3B8;
}

[data-theme="kcic-light"] .user-mgmt-toolbar .search-wrap .form-input:focus {
  border-color: #a30028;
  box-shadow: 0 0 0 3px rgba(163, 0, 40, 0.15);
}

/* Users Table Container & Table */
[data-theme="kcic-light"] .users-table-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="kcic-light"] .users-table {
  background: #FFFFFF;
}

[data-theme="kcic-light"] .users-table th {
  background: #F8FAFC;
  color: #334155;
  border-bottom: 2px solid #E2E8F0;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

[data-theme="kcic-light"] .users-table td {
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  font-weight: 500;
}

[data-theme="kcic-light"] .users-table tr:hover td {
  background: rgba(163, 0, 40, 0.04);
}

[data-theme="kcic-light"] .users-table tr td strong {
  color: #0F172A;
  font-weight: 700;
}

[data-theme="kcic-light"] .user-self-indicator {
  color: #047857;
  font-weight: 700;
  font-size: 0.7rem;
  background: #ECFDF5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #A7F3D0;
}

[data-theme="kcic-light"] .user-date-col {
  color: #64748B;
  font-size: 0.78rem;
}

/* Light Theme Role Badges (High Contrast, Professional Corporate Style) */
[data-theme="kcic-light"] .role-badge.role-admin,
[data-theme="kcic-light"] .role-chip-admin {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #D8B4FE;
  box-shadow: none;
  font-weight: 700;
}

[data-theme="kcic-light"] .role-badge.role-hpr,
[data-theme="kcic-light"] .role-chip-hpr {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  box-shadow: none;
  font-weight: 700;
}

[data-theme="kcic-light"] .role-badge.role-services,
[data-theme="kcic-light"] .role-chip-services {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  box-shadow: none;
  font-weight: 700;
}

[data-theme="kcic-light"] .role-badge.role-regular,
[data-theme="kcic-light"] .role-chip-regular {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  box-shadow: none;
  font-weight: 700;
}

[data-theme="kcic-light"] .role-badge.role-custom,
[data-theme="kcic-light"] .role-chip-custom {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FCD34D;
  box-shadow: none;
  font-weight: 700;
}

[data-theme="kcic-light"] .perm-chip {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  font-weight: 600;
}

[data-theme="kcic-light"] .perm-chip.none {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #64748B;
  font-style: italic;
}

[data-theme="kcic-light"] .permissions-hint {
  color: #A30028;
  font-weight: 600;
}

[data-theme="kcic-light"] .permissions-checkbox-grid {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

[data-theme="kcic-light"] .perm-checkbox-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

[data-theme="kcic-light"] .perm-checkbox-item:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

[data-theme="kcic-light"] .perm-checkbox-item input[type="checkbox"] {
  accent-color: #A30028;
}

[data-theme="kcic-light"] .perm-info strong {
  color: #0F172A;
}

[data-theme="kcic-light"] .perm-info small {
  color: #64748B;
}

/* Action Buttons in User List Table */
[data-theme="kcic-light"] .btn-table-action {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  font-weight: 600;
}

[data-theme="kcic-light"] .btn-table-action:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #0F172A;
}

[data-theme="kcic-light"] .btn-table-action.danger {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  font-weight: 600;
}

[data-theme="kcic-light"] .btn-table-action.danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}

/* User Form Modal (Add / Edit) Light Theme */
[data-theme="kcic-light"] .user-form-modal .form-label {
  color: #334155;
  font-weight: 600;
}

[data-theme="kcic-light"] .user-form-modal .form-input,
[data-theme="kcic-light"] .user-form-modal .form-select {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

[data-theme="kcic-light"] .user-form-modal .form-input:focus,
[data-theme="kcic-light"] .user-form-modal .form-select:focus {
  background: #FFFFFF;
  border-color: #a30028;
  box-shadow: 0 0 0 3px rgba(163, 0, 40, 0.15);
}

[data-theme="kcic-light"] .user-form-modal .form-input:disabled {
  background: #F1F5F9;
  color: #64748B;
  border-color: #E2E8F0;
  cursor: not-allowed;
}

[data-theme="kcic-light"] .user-form-modal .form-input::placeholder {
  color: #94A3B8;
}

[data-theme="kcic-light"] .user-form-modal .password-rules-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

[data-theme="kcic-light"] .user-form-modal .rule-hint {
  color: #64748B;
}

[data-theme="kcic-light"] .user-form-modal .form-select option {
  background: #FFFFFF;
  color: #0F172A;
}

/* Server Config Modal Light Theme */
[data-theme="kcic-light"] .server-config-modal .connection-status-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #334155;
}

[data-theme="kcic-light"] .server-config-modal .form-input {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

[data-theme="kcic-light"] .server-config-modal .form-input:focus {
  border-color: #a30028;
  box-shadow: 0 0 0 3px rgba(163, 0, 40, 0.15);
}

/* Restricted Notice in Light Theme */
[data-theme="kcic-light"] .passenger-restricted-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="kcic-light"] .restricted-text strong {
  color: #B45309;
}

[data-theme="kcic-light"] .restricted-text p {
  color: #475569;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  height: 38px;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
}

/* Local DB Sync Badge */
.local-db-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
}

.local-db-sync-badge.online {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
}

.local-db-sync-badge.offline {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93C5FD;
}

/* ==========================================================================
 * UNIFIED ADMIN DROPDOWN MENU
 * ========================================================================== */
.admin-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dropdown-menu-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  padding: 0.45rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 10000;
  backdrop-filter: blur(12px);
}

.admin-dropdown-wrapper.show .dropdown-menu-card {
  display: flex !important;
}

.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.dropdown-menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-menu-item.danger {
  color: #F87171;
  background: rgba(239, 68, 68, 0.08);
}

.dropdown-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #EF4444;
  color: #FFFFFF;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.3rem 0;
}

/* ==========================================================================
 * COLLAPSIBLE TRIP SCHEDULE CARD & CONTROLS
 * ========================================================================== */
.trip-schedule-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 1.25rem;
}

.trip-card-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trip-selector-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trip-select-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-card-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease, background var(--transition-fast), color var(--transition-fast);
}

.btn-card-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
}

.trip-schedule-card.collapsed .btn-card-toggle {
  transform: rotate(-90deg);
}

.trip-schedule-card.collapsed .trip-card-body,
.trip-schedule-card.collapsed .journey-timeline-section,
.trip-schedule-card.collapsed .trip-card-empty {
  display: none !important;
}

.trip-card-badges-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
 * MOBILE SHEETS & RESPONSIVE DESIGN
 * ========================================================================== */
.mobile-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.show .mobile-bottom-sheet {
  transform: translateY(0);
}

.mobile-sheet-scrollable {
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .trip-card-controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  /* Hide admin dropdown in header on mobile - use mobile action sheet */
  .admin-dropdown-wrapper {
    display: none !important;
  }

  .header-right #btnOpenUploadModal {
    display: none !important;
  }


  .header-right .btn-sync .sync-btn-text {
    display: none;
  }

  .trip-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .trip-card-controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .trip-selector-box {
    flex: 1;
    min-width: 0;
  }

  .trip-selector-box .custom-select-wrapper {
    flex: 1;
    min-width: 0;
  }

  .trip-dropdown {
    width: 100%;
    min-width: 0;
  }
}

/* ==========================================================================
   EMPTY DATABASE UPLOAD SECTION (STANDALONE EMPTY STATE)
   ========================================================================== */
.empty-upload-section {
  width: 100%;
  max-width: 960px;
  margin: 1.5rem auto 3rem;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.empty-upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.empty-upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--whoosh-red) 0%, #F59E0B 50%, var(--whoosh-red) 100%);
}

.empty-upload-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.25rem;
}

.empty-upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FBBF24;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.15rem;
}

.empty-upload-badge .pulsing-dot.warning {
  background: #F59E0B;
  box-shadow: 0 0 10px #F59E0B;
}

.empty-upload-title {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

.empty-upload-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.empty-dropzone {
  padding: 3.5rem 2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 2.5px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-xl);
  transition: var(--transition-smooth);
}

.empty-dropzone:hover, .empty-dropzone.dragover {
  background: rgba(199, 32, 39, 0.08);
  border-color: var(--whoosh-red);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(199, 32, 39, 0.15);
}

.empty-dropzone-icon-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(199, 32, 39, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--whoosh-red-light);
  border: 1px solid rgba(199, 32, 39, 0.25);
}

.btn-text-toggle {
  background: none;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-text-toggle:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.03);
}

.empty-upload-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.feature-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.feature-icon {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.feature-item span {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.restricted-empty-card {
  text-align: center;
  padding: 2.75rem 1.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 560px;
  margin: 0 auto;
}

.restricted-icon-lg {
  font-size: 3rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.restricted-empty-card h3 {
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.restricted-empty-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .empty-upload-card {
    padding: 1.75rem 1.25rem;
  }
  .empty-upload-title {
    font-size: 1.45rem;
  }
  .empty-dropzone {
    padding: 2.25rem 1rem;
  }
}

/* ============================================================
   NARROW DEVICE BREAKPOINT (≤ 375px)
   ============================================================ */
@media (max-width: 375px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-val {
    font-size: 1.6rem;
  }
  .kpi-label {
    font-size: 0.78rem;
  }
  .app-header {
    padding: 0.65rem 0.75rem;
  }
  .brand-title {
    font-size: 0.9rem;
  }
}

/* ============================================================
   TRAIN CONSIST SECTION — PAGINATION DOTS WRAPPER
   ============================================================ */
.train-consist-section {
  position: relative;
}

/* ============================================================
   KCIC LIGHT — SEGMENT TIMELINE CONTRAST
   ============================================================ */
[data-theme="kcic-light"] .timeline-step {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="kcic-light"] .timeline-step.seg-available {
  background: rgba(13, 150, 104, 0.06);
  border-color: rgba(13, 150, 104, 0.20);
}

[data-theme="kcic-light"] .timeline-step.seg-occupied {
  background: rgba(163, 0, 40, 0.06);
  border-color: rgba(163, 0, 40, 0.18);
}

[data-theme="kcic-light"] .step-route {
  color: #1A1A2E;
}

[data-theme="kcic-light"] .step-status-tag.free {
  background: rgba(13, 150, 104, 0.12);
  color: #0D7A55;
}

[data-theme="kcic-light"] .step-status-tag.taken {
  background: rgba(163, 0, 40, 0.10);
  color: #a30028;
}

/* ============================================================
   SEARCH NO RESULTS — KCIC LIGHT
   ============================================================ */
[data-theme="kcic-light"] .search-no-results .btn-clear-all {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: var(--text-main);
}

[data-theme="kcic-light"] .search-no-results .btn-clear-all:hover {
  border-color: var(--whoosh-red);
  color: var(--whoosh-red);
  background: rgba(163, 0, 40, 0.05);
}

/* ============================================================
   MODAL DRAG HANDLE — VISUAL CUE IMPROVEMENT
   ============================================================ */
.bottom-sheet-drag-handle {
  cursor: grab;
  padding: 0.5rem;
  margin: -0.5rem auto 0.25rem;
}

.bottom-sheet-drag-handle::after {
  display: block;
  content: '';
  width: 40px;
  height: 5px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  margin: 0 auto;
  transition: background 0.2s ease, width 0.2s ease;
}

[data-theme="kcic-light"] .bottom-sheet-drag-handle::after {
  background: rgba(0,0,0,0.12);
}

.bottom-sheet-drag-handle:hover::after {
  background: rgba(255,255,255,0.32);
  width: 52px;
}

[data-theme="kcic-light"] .bottom-sheet-drag-handle:hover::after {
  background: rgba(163, 0, 40, 0.25);
}

