/* School Bus Tracker Design System - Modern, High-End & Responsive */
:root {
  --primary: #4338ca;
  --primary-light: #6366f1;
  --primary-dark: #312e81;
  --primary-bg: #eef2ff;

  --accent-bus: #f59e0b;
  --accent-bus-light: #fef3c7;
  --accent-bus-dark: #b45309;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;

  --danger: #ef4444;
  --danger-bg: #fef2f2;

  --info: #0284c7;
  --info-bg: #f0f9ff;

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-light);
}

/* App Header & Navigation */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #0f172a;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-bg);
}

.user-badge-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Responsive Parent Portal Components */
.parent-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.parent-title-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.parent-title-heading h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.child-summary-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.child-summary-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.child-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.child-stop-badge-box {
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  min-width: 170px;
}

.child-stop-badge-box.pickup {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.child-stop-badge-box.drop {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.eta-spotlight-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.eta-spotlight-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 260px;
}

.eta-spotlight-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fbbf24;
  flex-shrink: 0;
}

.eta-spotlight-right {
  text-align: right;
  background: rgba(255,255,255,0.08);
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.15);
  min-width: 200px;
}

/* Utility to hide text on mobile */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  .child-summary-card {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .child-summary-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .child-summary-actions .btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .child-stop-badge-box {
    min-width: unset;
  }

  .parent-title-heading h1 {
    font-size: 1.35rem;
  }

  .eta-spotlight-card {
    padding: 1.125rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .eta-spotlight-right {
    text-align: center;
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .eta-spotlight-left {
    gap: 0.875rem;
  }

  .eta-spotlight-icon {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }
}

@media (max-width: 480px) {
  .child-summary-actions {
    grid-template-columns: 1fr;
  }
}
  align-items: center;
  gap: 1rem;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-pill.admin {
  background: #ede9fe;
  color: #6d28d9;
}
.role-pill.driver {
  background: #fef3c7;
  color: #b45309;
}
.role-pill.parent {
  background: #dbeafe;
  color: #1d4ed8;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* Page Layout */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

/* Cards & Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.stat-icon.bus { background: #fef3c7; color: #b45309; }
.stat-icon.route { background: #e0e7ff; color: #4338ca; }
.stat-icon.student { background: #ecfdf5; color: #047857; }
.stat-icon.driver { background: #fce7f3; color: #be185d; }

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-light);
  color: white;
}

.btn-accent {
  background: #f59e0b;
  color: #ffffff;
}
.btn-accent:hover {
  background: #d97706;
  color: white;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background: #059669;
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #dc2626;
  color: white;
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.375rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  font-family: inherit;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tr:hover {
  background: #f8fafc;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* Pulse dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background-color: currentColor;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Leaflet Map Containers */
.map-container {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

/* Leaflet Custom Markers */
.bus-marker-container {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bus-marker-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.35);
  animation: bus-beacon 2s ease-out infinite;
}

@keyframes bus-beacon {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.bus-marker-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f59e0b;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  position: relative;
  z-index: 2;
  transition: transform 0.4s ease;
}

/* Stop Marker Pins */
.stop-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.stop-pin.pending {
  background: #3b82f6;
  color: white;
}

.stop-pin.arrived {
  background: #f59e0b;
  color: white;
  animation: pulse-ring 1.5s infinite;
}

.stop-pin.completed {
  background: #10b981;
  color: white;
}

.stop-pin.child-stop {
  background: #7c3aed;
  color: white;
  border: 3px solid #fef08a;
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
}

/* Live Timeline & Stop Cards */
.stops-timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1rem;
}

.stops-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 14px;
  width: 3px;
  background: #e2e8f0;
  border-radius: 2px;
}

.timeline-step {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-icon {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 2;
}

.timeline-step.completed .timeline-icon {
  background: #10b981;
  color: white;
}
.timeline-step.arrived .timeline-icon {
  background: #f59e0b;
  color: white;
}
.timeline-step.pending .timeline-icon {
  background: #cbd5e1;
  color: #475569;
}
.timeline-step.child-target .timeline-icon {
  background: #7c3aed;
  color: white;
  border-color: #fde047;
}

.timeline-content {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-step.current .timeline-content {
  border-color: #f59e0b;
  background: #fffdf5;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.timeline-step.child-target .timeline-content {
  border-color: #a78bfa;
  background: #faf5ff;
}

/* Driver Console Panel */
.driver-active-stop-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.driver-active-stop-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.driver-stop-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

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

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Mobile Segmented Navigation Tabs */
.mobile-view-tabs {
  display: none;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  gap: 4px;
}

.mobile-view-tab {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.mobile-view-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Mobile Floating Action Dock for Driver */
.driver-mobile-dock {
  display: none;
}

/* Floating Map Buttons */
.map-floating-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-floating-btn:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

/* Touch targets */
.touch-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Mobile Responsiveness (Tablets & Smartphones) --- */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem 0.875rem 5rem;
  }

  .app-header {
    padding: 0.25rem 0;
  }

  .header-inner {
    padding: 0.6rem 0.85rem;
    gap: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .brand {
    font-size: 1.05rem;
    gap: 0.5rem;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  /* Compact top-right badge and action buttons */
  .user-badge-group {
    width: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    border: none;
    margin: 0;
  }

  .role-pill {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }

  .user-profile {
    display: none; /* Hide avatar on mobile to conserve header space */
  }

  .header-action-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
  }

  /* App nav on mobile */
  .app-nav {
    width: 100%;
    order: 3;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 0.25rem;
  }

  /* If nav only has 1 redundant link (e.g. parent or driver), hide on mobile */
  .app-nav:has(li:only-child) {
    display: none;
  }

  /* Make nav links scroll horizontally on mobile for admin */
  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.775rem;
    white-space: nowrap;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Map Container responsive height */
  .map-container {
    height: 380px !important;
    border-radius: var(--radius-md);
  }

  /* Show mobile tabs switcher */
  .mobile-view-tabs {
    display: flex;
  }

  /* Driver Mobile Sticky Dock */
  .driver-mobile-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    z-index: 1500;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  }

  .driver-mobile-dock button {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 700;
    min-height: 48px;
    border-radius: var(--radius-md);
  }

  .driver-stop-name {
    font-size: 1.25rem;
  }

  /* Timeline on mobile */
  .stops-timeline {
    padding-left: 1.75rem;
  }
  .stops-timeline::before {
    left: 11px;
  }
  .timeline-icon {
    left: -1.75rem;
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
  .timeline-content {
    padding: 0.65rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Stats grid on mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .stat-card {
    padding: 0.875rem;
  }
  .stat-val {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

