/* ==========================================================================
   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;

  --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;
}

*, *::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: #F8FAFC;
}

.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: #E2E8F0;
}

.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: #FFFFFF;
  margin-top: 0.15rem;
}

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

.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: #FFFFFF;
}

.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);
}

/* Switch Toggle */
.switch-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.switch-control input {
  display: none;
}

.switch-slider {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  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-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;
  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;
}

.direction-pill {
  margin-left: auto;
  color: var(--whoosh-red-light);
  font-weight: 700;
}

.blink-arrow {
  animation: slide-arrow 1.2s infinite;
}

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

/* Individual Row */
.seat-row {
  display: flex;
  align-items: 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;
}

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

/* Ensure First Class rows align seamlessly with adjacent rows */
.seat-row.first-class-row .seat-cluster.left {
  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);
}

/* 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);
}

.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 */
.timeline-title, .section-subheading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.segment-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.step-route {
  font-weight: 600;
  font-size: 0.88rem;
}

.step-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

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

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

/* 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;
}

.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);
}

/* 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;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slide-toast 0.3s ease;
}

.toast.success { border-left: 4px solid var(--seat-avail); }
.toast.error { border-left: 4px solid var(--seat-occup); }

@keyframes slide-toast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(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;
}

.bottom-nav-item .b-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.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 .b-nav-label {
  color: #EF4444;
  font-weight: 700;
}

.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:active {
  transform: scale(0.92);
}

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

@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 */
  .main-content {
    padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom, 12px));
    gap: 1.25rem;
  }

  /* 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%;
  }

  .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 */
  .coach-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem;
  }

  .coach-viewport {
    padding: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .coach-chassis {
    padding: 0.85rem 0.4rem;
    min-width: 320px;
    max-width: 100%;
  }

  .seat-grid-container {
    gap: 0.5rem;
    padding: 0.5rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Seat Row Layout on Mobile */
  .seat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 360px;
  }

  .seat-row-number {
    width: 24px;
    font-size: 0.72rem;
    text-align: center;
    color: var(--text-muted);
    font-weight: 700;
  }

  .seat-group {
    display: flex;
    gap: 0.25rem;
  }

  .seat-aisle-gap {
    width: 14px;
    flex-shrink: 0;
  }

  /* Seat Dimensions on Mobile (Finger Friendly) */
  .seat-node {
    width: 44px;
    height: 48px;
    border-radius: 8px;
  }

  .seat-node .seat-letter {
    font-size: 0.85rem;
  }

  .seat-node .seat-code {
    font-size: 0.65rem;
  }

  /* 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 {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 8px));
    right: 1rem;
    left: 1rem;
  }

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

@media (max-width: 420px) {
  .seat-node {
    width: 40px;
    height: 44px;
  }
  .seat-row {
    max-width: 330px;
  }
}

/* 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: #FFFFFF;
  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: #E2E8F0;
}

.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);
}

.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);
}

/* Demo Accounts Switcher */
.demo-accounts-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  margin-bottom: 1.5rem;
}

.demo-accounts-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.demo-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.demo-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all var(--transition-fast);
  text-align: left;
}

.demo-chip:hover {
  background: rgba(199, 32, 39, 0.2);
  border-color: var(--whoosh-red);
  transform: translateY(-1px);
}

.chip-icon {
  font-size: 0.95rem;
}

.chip-role {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 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)
   ========================================================================== */
.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;
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.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;
}

.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-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: 480px;
}

.user-form-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.password-rules-box {
  margin-top: 0.3rem;
}

.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;
  }
  .demo-chips {
    grid-template-columns: 1fr;
  }
  .roles-overview-grid {
    grid-template-columns: 1fr 1fr;
  }
}
