/* ═══════════════════════════════════════════════════════════════════════════
   YELLOW GRID — Design System v2.0
   Sistema de diseño completo para la plataforma de movilidad urbana de Cali
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── LAYER ORDER ─── */
@layer reset, tokens, base, components, utilities, animations;

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: TOKENS — Design tokens (colors, spacing, typography, etc.)
   ═══════════════════════════════════════════════════════════════════════════ */
@layer tokens {
  :root {
    color-scheme: light;

    /* ── Color: Slate (Neutral) ── */
    --slate-50:  #F8FAFC; --slate-100: #F1F5F9; --slate-200: #E2E8F0;
    --slate-300: #CBD5E1; --slate-400: #94A3B8; --slate-500: #64748B;
    --slate-600: #475569; --slate-700: #334155; --slate-800: #1E293B;
    --slate-900: #0F172A; --slate-950: #020617;

    /* ── Color: Yellow (Primary/Brand) ── */
    --yellow-50:  #FEFCE8; --yellow-100: #FEF9C3; --yellow-200: #FEF08A;
    --yellow-300: #FDE047; --yellow-400: #FACC15; --yellow-500: #EAB308;
    --yellow-600: #CA8A04; --yellow-700: #A16207; --yellow-800: #854D0E;
    --yellow-900: #713F12; --yellow-950: #422006;
    --taxi-yellow: #FFD000;
    --taxi-yellow-hover: #F5C400;
    --taxi-yellow-dark: #D4A800;

    /* ── Color: Emerald (Success) ── */
    --emerald-50:  #ECFDF5; --emerald-100: #D1FAE5; --emerald-200: #A7F3D0;
    --emerald-300: #6EE7B7; --emerald-400: #34D399; --emerald-500: #10B981;
    --emerald-600: #059669; --emerald-700: #047857; --emerald-800: #065F46;
    --emerald-900: #064E3B; --emerald-950: #022C22;

    /* ── Color: Blue (Info) ── */
    --blue-50:  #EFF6FF; --blue-100: #DBEAFE; --blue-200: #BFDBFE;
    --blue-300: #93C5FD; --blue-400: #60A5FA; --blue-500: #3B82F6;
    --blue-600: #2563EB; --blue-700: #1D4ED8; --blue-800: #1E40AF;
    --blue-900: #1E3A8A; --blue-950: #172554;

    /* ── Color: Red (Danger/SOS) ── */
    --red-50:  #FEF2F2; --red-100: #FEE2E2; --red-200: #FECACA;
    --red-300: #FCA5A5; --red-400: #F87171; --red-500: #EF4444;
    --red-600: #DC2626; --red-700: #B91C1C; --red-800: #991B1B;
    --red-900: #7F1D1D; --red-950: #450A0A;

    /* ── Color: Amber (Warning) ── */
    --amber-50:  #FFFBEB; --amber-100: #FEF3C7; --amber-200: #FDE68A;
    --amber-300: #FCD34D; --amber-400: #FBBF24; --amber-500: #F59E0B;
    --amber-600: #D97706; --amber-700: #B45309; --amber-800: #92400E;
    --amber-900: #78350F; --amber-950: #451A03;

    /* ── Color: Purple (Twin/Digital) ── */
    --purple-50:  #FAF5FF; --purple-100: #F3E8FF; --purple-200: #E9D5FF;
    --purple-300: #D8B4FE; --purple-400: #C084FC; --purple-500: #A855F7;
    --purple-600: #9333EA; --purple-700: #7C3AED; --purple-800: #6B21A8;
    --purple-900: #581C87; --purple-950: #3B0764;

    /* ── Semantic Colors ── */
    --bg-app:          var(--slate-50);
    --bg-surface:      #FFFFFF;
    --bg-surface-2:    var(--slate-100);
    --bg-elevated:     #FFFFFF;
    --text-primary:    var(--slate-900);
    --text-secondary:  var(--slate-600);
    --text-muted:      var(--slate-400);
    --text-on-brand:   #000000;
    --border-subtle:   rgba(0, 0, 0, 0.06);
    --border-default:  rgba(0, 0, 0, 0.10);
    --border-strong:   rgba(0, 0, 0, 0.18);
    --brand-primary:   var(--taxi-yellow);
    --brand-hover:     var(--taxi-yellow-hover);
    --overlay:         rgba(0, 0, 0, 0.4);

    /* ── Spacing Scale (4px base) ── */
    --space-0: 0; --space-px: 1px; --space-0-5: 2px;
    --space-1: 4px;  --space-1-5: 6px;  --space-2: 8px;
    --space-2-5: 10px; --space-3: 12px; --space-3-5: 14px;
    --space-4: 16px; --space-5: 20px;  --space-6: 24px;
    --space-7: 28px; --space-8: 32px;  --space-9: 36px;
    --space-10: 40px; --space-12: 48px; --space-14: 56px;
    --space-16: 64px; --space-20: 80px; --space-24: 96px;

    /* ── Typography ── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --text-xs:   clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);    /* 11-12px */
    --text-sm:   clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);     /* 12-13px */
    --text-base: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);  /* 13-15px */
    --text-lg:   clamp(1rem, 0.95rem + 0.2vw, 1.125rem);         /* 16-18px */
    --text-xl:   clamp(1.125rem, 1rem + 0.4vw, 1.375rem);        /* 18-22px */
    --text-2xl:  clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);       /* 22-28px */
    --text-3xl:  clamp(1.75rem, 1.5rem + 0.8vw, 2.25rem);        /* 28-36px */
    --text-4xl:  clamp(2rem, 1.6rem + 1.3vw, 2.75rem);           /* 32-44px */
    --text-5xl:  clamp(2.5rem, 2rem + 1.6vw, 3.25rem);           /* 40-52px */

    --leading-none:    1;
    --leading-tight:   1.2;
    --leading-snug:    1.35;
    --leading-normal:  1.5;
    --leading-relaxed: 1.65;

    --weight-normal: 400; --weight-medium: 500;
    --weight-semibold: 600; --weight-bold: 700;
    --weight-extrabold: 800; --weight-black: 900;

    /* ── Border Radius ── */
    --radius-none: 0; --radius-xs: 4px; --radius-sm: 6px;
    --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
    --radius-2xl: 20px; --radius-3xl: 24px; --radius-full: 9999px;

    /* ── Shadows ── */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.04);
    --shadow-glow-yellow: 0 0 20px rgba(255, 208, 0, 0.25), 0 0 60px rgba(255, 208, 0, 0.08);
    --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.2);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.25);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.2);

    /* ── Z-Index Scale ── */
    --z-base: 0; --z-dropdown: 100; --z-sticky: 200;
    --z-fixed: 300; --z-header: 400; --z-modal-backdrop: 500;
    --z-modal: 600; --z-popover: 700; --z-tooltip: 800;
    --z-toast: 900; --z-max: 9999;

    /* ── Motion ── */
    --duration-instant: 75ms; --duration-fast: 150ms;
    --duration-normal: 250ms; --duration-slow: 350ms;
    --duration-slower: 500ms; --duration-slowest: 700ms;
    --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: RESET — Minimal modern CSS reset
   ═══════════════════════════════════════════════════════════════════════════ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100dvh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; border: none; background: none; }
  a { text-decoration: none; color: inherit; }
  ul, ol { list-style: none; }
  h1, h2, h3, h4, h5, h6 { font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
  p { line-height: var(--leading-normal); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: BASE — Typography, focus, reduced-motion, body defaults
   ═══════════════════════════════════════════════════════════════════════════ */
@layer base {
  body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-app);
    line-height: var(--leading-normal);
  }

  h1 { font-size: var(--text-4xl); letter-spacing: -0.025em; }
  h2 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
  h3 { font-size: var(--text-2xl); letter-spacing: -0.015em; }
  h4 { font-size: var(--text-xl); }
  h5 { font-size: var(--text-lg); }
  h6 { font-size: var(--text-base); font-weight: var(--weight-medium); }

  code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }
  code { background: var(--bg-surface-2); padding: 2px 6px; border-radius: var(--radius-xs); }
  pre { background: var(--slate-800); color: var(--slate-100); padding: var(--space-4); border-radius: var(--radius-lg); overflow-x: auto; }

  small { font-size: var(--text-sm); color: var(--text-secondary); }

  ::selection { background: rgba(255, 208, 0, 0.3); color: var(--slate-900); }

  /* Focus ring — accessible keyboard navigation */
  :focus-visible {
    outline: 2px solid var(--taxi-yellow-dark);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: COMPONENTS — All UI components
   ═══════════════════════════════════════════════════════════════════════════ */
@layer components {

  /* ─── BUTTONS ─── */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: var(--space-2-5) var(--space-5);
    font-size: var(--text-sm); font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
    border-radius: var(--radius-lg); border: 2px solid transparent;
    transition: transform var(--duration-fast) var(--ease-default),
                box-shadow var(--duration-fast) var(--ease-default),
                background var(--duration-fast) var(--ease-default),
                border-color var(--duration-fast) var(--ease-default);
    white-space: nowrap; user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active { transform: scale(0.97); }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

  .btn-primary {
    background: var(--taxi-yellow); color: #000;
    box-shadow: var(--shadow-sm), 0 0 0 0 rgba(255,208,0,0);
  }
  .btn-primary:hover:not(:disabled) { background: var(--taxi-yellow-hover); box-shadow: var(--shadow-md), var(--shadow-glow-yellow); }

  .btn-secondary {
    background: var(--bg-surface); color: var(--text-primary);
    border-color: var(--border-default);
  }
  .btn-secondary:hover:not(:disabled) { background: var(--slate-50); border-color: var(--border-strong); }

  .btn-outline {
    background: transparent; color: var(--text-primary);
    border-color: var(--border-default);
  }
  .btn-outline:hover:not(:disabled) { background: var(--bg-surface-2); }

  .btn-ghost {
    background: transparent; color: var(--text-secondary);
  }
  .btn-ghost:hover:not(:disabled) { background: var(--bg-surface-2); color: var(--text-primary); }

  .btn-danger {
    background: var(--red-600); color: white;
  }
  .btn-danger:hover:not(:disabled) { background: var(--red-700); box-shadow: var(--shadow-glow-red); }

  .btn-success {
    background: var(--emerald-600); color: white;
  }
  .btn-success:hover:not(:disabled) { background: var(--emerald-700); box-shadow: var(--shadow-glow-emerald); }

  .btn-sm { padding: var(--space-1-5) var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-md); }
  .btn-lg { padding: var(--space-3-5) var(--space-7); font-size: var(--text-lg); border-radius: var(--radius-xl); }
  .btn-xl { padding: var(--space-4) var(--space-8); font-size: var(--text-xl); border-radius: var(--radius-xl); min-height: 56px; }
  .btn-cockpit { padding: var(--space-5) var(--space-8); font-size: var(--text-xl); border-radius: var(--radius-2xl); min-height: 72px; min-width: 200px; }
  .btn-icon { padding: var(--space-2-5); aspect-ratio: 1; border-radius: var(--radius-full); }
  .btn-full { width: 100%; }

  .btn-loading { position: relative; color: transparent !important; pointer-events: none; }
  .btn-loading::after {
    content: ''; position: absolute; width: 18px; height: 18px;
    border: 2px solid rgba(0,0,0,0.2); border-top-color: currentColor;
    border-radius: 50%; animation: spin 0.6s linear infinite;
  }

  /* ─── CARDS ─── */
  .card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
  }
  .card-elevated { box-shadow: var(--shadow-lg); border-color: transparent; }
  .card-glass {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-color: rgba(255,255,255,0.5);
  }
  .card-interactive {
    transition: transform var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default),
                border-color var(--duration-normal) var(--ease-default);
    cursor: pointer;
  }
  .card-interactive:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-strong);
  }
  .card-yellow { border-left: 4px solid var(--taxi-yellow); }
  .card-emerald { border-left: 4px solid var(--emerald-500); }
  .card-blue { border-left: 4px solid var(--blue-500); }
  .card-red { border-left: 4px solid var(--red-500); }
  .card-purple { border-left: 4px solid var(--purple-500); }
  .card-header { padding-bottom: var(--space-3); margin-bottom: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
  .card-body { flex: 1; }
  .card-footer { padding-top: var(--space-3); margin-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
  .card-compact { padding: var(--space-3); }

  /* ─── BADGES ─── */
  .badge {
    display: inline-flex; align-items: center; gap: var(--space-1);
    padding: var(--space-0-5) var(--space-2);
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    line-height: var(--leading-snug);
    white-space: nowrap;
  }
  .badge-yellow { background: var(--yellow-100); color: var(--yellow-800); }
  .badge-emerald { background: var(--emerald-100); color: var(--emerald-800); }
  .badge-blue { background: var(--blue-100); color: var(--blue-800); }
  .badge-red { background: var(--red-100); color: var(--red-800); }
  .badge-purple { background: var(--purple-100); color: var(--purple-800); }
  .badge-slate { background: var(--slate-100); color: var(--slate-700); }

  .badge-solid-yellow { background: var(--taxi-yellow); color: #000; }
  .badge-solid-emerald { background: var(--emerald-600); color: white; }
  .badge-solid-blue { background: var(--blue-600); color: white; }
  .badge-solid-red { background: var(--red-600); color: white; }
  .badge-solid-purple { background: var(--purple-600); color: white; }

  .badge-outline {
    background: transparent;
    border: 1.5px solid var(--border-default);
    color: var(--text-secondary);
  }
  .badge-lg { padding: var(--space-1) var(--space-3); font-size: var(--text-sm); }

  .badge-dot::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  }
  .badge-dot-green::before { background: var(--emerald-500); }
  .badge-dot-yellow::before { background: var(--taxi-yellow); }
  .badge-dot-red::before { background: var(--red-500); }
  .badge-dot-blue::before { background: var(--blue-500); }
  .badge-dot-slate::before { background: var(--slate-400); }

  .badge-pulse::before { animation: pulse-dot 2s ease-in-out infinite; }

  /* ─── ALERTS ─── */
  .alert {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm); line-height: var(--leading-normal);
    border: 1px solid transparent;
  }
  .alert-icon { font-size: var(--text-lg); flex-shrink: 0; line-height: 1; }
  .alert-info { background: var(--blue-50); color: var(--blue-800); border-color: var(--blue-200); }
  .alert-success { background: var(--emerald-50); color: var(--emerald-800); border-color: var(--emerald-200); }
  .alert-warning { background: var(--amber-50); color: var(--amber-800); border-color: var(--amber-200); }
  .alert-danger { background: var(--red-50); color: var(--red-800); border-color: var(--red-200); }
  .alert-sos {
    background: var(--red-600); color: white; border-color: var(--red-700);
    animation: sos-glow 1.5s ease-in-out infinite;
  }

  /* ─── MODALS & SHEETS ─── */
  .modal-backdrop {
    position: fixed; inset: 0; background: var(--overlay);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0; transition: opacity var(--duration-normal) var(--ease-default);
    pointer-events: none;
  }
  .modal-backdrop.is-active { opacity: 1; pointer-events: auto; }

  .modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-surface); border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl); z-index: var(--z-modal);
    width: min(90vw, 480px); max-height: 85dvh; overflow-y: auto;
    opacity: 0; transition: opacity var(--duration-normal) var(--ease-default),
                            transform var(--duration-normal) var(--ease-spring);
    pointer-events: none;
  }
  .modal.is-active { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
  .modal-header { padding: var(--space-5) var(--space-5) var(--space-3); display: flex; align-items: center; justify-content: space-between; }
  .modal-body { padding: var(--space-1) var(--space-5) var(--space-5); }
  .modal-footer { padding: var(--space-3) var(--space-5) var(--space-5); display: flex; gap: var(--space-3); justify-content: flex-end; }
  .modal-close {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full); color: var(--text-muted);
    transition: background var(--duration-fast), color var(--duration-fast);
  }
  .modal-close:hover { background: var(--bg-surface-2); color: var(--text-primary); }

  .sheet-bottom {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.12);
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-spring);
    max-height: 85dvh; overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .sheet-bottom.is-active { transform: translateY(0); }
  .sheet-handle {
    width: 36px; height: 4px; background: var(--slate-300);
    border-radius: var(--radius-full); margin: var(--space-2) auto var(--space-3);
  }

  /* ─── TOASTS ─── */
  .toast-container {
    position: fixed; top: var(--space-4); right: var(--space-4);
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: var(--space-2);
    pointer-events: none;
    padding-top: env(safe-area-inset-top, 0);
  }
  .toast {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); border: 1px solid var(--border-subtle);
    font-size: var(--text-sm); font-weight: var(--weight-medium);
    min-width: 280px; max-width: 400px;
    pointer-events: auto;
    animation: slide-in-right var(--duration-normal) var(--ease-spring);
  }
  .toast-success { border-left: 4px solid var(--emerald-500); }
  .toast-error { border-left: 4px solid var(--red-500); }
  .toast-warning { border-left: 4px solid var(--amber-500); }
  .toast-info { border-left: 4px solid var(--blue-500); }
  .toast-dismiss { opacity: 0; transform: translateX(100%); transition: all var(--duration-normal); }

  /* ─── FORM CONTROLS ─── */
  .input {
    width: 100%; padding: var(--space-2-5) var(--space-3-5);
    background: var(--bg-surface); color: var(--text-primary);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  }
  .input:hover { border-color: var(--border-strong); }
  .input:focus { border-color: var(--taxi-yellow); box-shadow: 0 0 0 3px rgba(255,208,0,0.15); outline: none; }
  .input::placeholder { color: var(--text-muted); }
  .input-error { border-color: var(--red-400); }
  .input-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

  .input-search {
    padding-left: var(--space-10);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: var(--space-3) center;
  }

  .select {
    appearance: none; width: 100%;
    padding: var(--space-2-5) var(--space-10) var(--space-2-5) var(--space-3-5);
    background: var(--bg-surface); color: var(--text-primary);
    border: 1.5px solid var(--border-default); border-radius: var(--radius-lg);
    font-size: var(--text-base); cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right var(--space-3) center;
  }
  .select:focus { border-color: var(--taxi-yellow); box-shadow: 0 0 0 3px rgba(255,208,0,0.15); outline: none; }

  .toggle {
    position: relative; width: 44px; height: 24px; border-radius: var(--radius-full);
    background: var(--slate-300); cursor: pointer; border: none;
    transition: background var(--duration-fast);
  }
  .toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: white; box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast) var(--ease-spring);
  }
  .toggle.is-on { background: var(--emerald-500); }
  .toggle.is-on::after { transform: translateX(20px); }
  .toggle-yellow.is-on { background: var(--taxi-yellow); }

  .form-label { display: block; font-size: var(--text-sm); font-weight: var(--weight-medium); margin-bottom: var(--space-1-5); color: var(--text-primary); }
  .form-helper { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
  .form-error-text { font-size: var(--text-xs); color: var(--red-600); margin-top: var(--space-1); }

  /* ─── TABLES ─── */
  .table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .table th {
    text-align: left; padding: var(--space-2-5) var(--space-3);
    font-weight: var(--weight-semibold); color: var(--text-secondary);
    font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-default);
    white-space: nowrap;
  }
  .table td {
    padding: var(--space-2-5) var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
  }
  .table-hover tbody tr { transition: background var(--duration-fast); }
  .table-hover tbody tr:hover { background: var(--slate-50); }
  .table-striped tbody tr:nth-child(even) { background: var(--slate-50); }
  .table th.sortable { cursor: pointer; user-select: none; }
  .table th.sortable:hover { color: var(--text-primary); }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ─── TABS & SEGMENTED CONTROLS ─── */
  .tabs {
    display: flex; gap: var(--space-1); padding: var(--space-1);
    background: var(--bg-surface-2); border-radius: var(--radius-lg);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-item {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm); font-weight: var(--weight-medium);
    color: var(--text-secondary); border-radius: var(--radius-md);
    transition: all var(--duration-fast); cursor: pointer;
    white-space: nowrap; border: none; background: transparent;
  }
  .tab-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.5); }
  .tab-item.is-active {
    color: var(--text-primary); background: var(--bg-surface);
    box-shadow: var(--shadow-sm); font-weight: var(--weight-semibold);
  }

  .pill-nav {
    display: flex; gap: var(--space-2); overflow-x: auto;
    padding: var(--space-1) 0; scrollbar-width: none;
  }
  .pill-nav::-webkit-scrollbar { display: none; }
  .pill-nav-item {
    padding: var(--space-1-5) var(--space-3-5);
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    color: var(--text-secondary); background: var(--bg-surface);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-full); cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-fast);
  }
  .pill-nav-item:hover { border-color: var(--taxi-yellow); color: var(--text-primary); }
  .pill-nav-item.is-active {
    background: var(--taxi-yellow); color: #000;
    border-color: var(--taxi-yellow);
  }

  /* ─── SKELETON LOADERS ─── */
  .skeleton {
    background: linear-gradient(90deg, var(--slate-200) 25%, var(--slate-100) 50%, var(--slate-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
  }
  .skeleton-text { height: 14px; margin-bottom: var(--space-2); width: 80%; }
  .skeleton-text-sm { height: 10px; margin-bottom: var(--space-1-5); width: 60%; }
  .skeleton-circle { border-radius: 50%; }
  .skeleton-card { height: 120px; border-radius: var(--radius-xl); }
  .skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

  /* ─── SPINNER ─── */
  .spinner {
    width: 24px; height: 24px; border: 3px solid var(--border-default);
    border-top-color: var(--taxi-yellow);
    border-radius: 50%; animation: spin 0.7s linear infinite;
  }
  .spinner-sm { width: 16px; height: 16px; border-width: 2px; }
  .spinner-lg { width: 36px; height: 36px; border-width: 3px; }

  /* ─── PROGRESS BAR ─── */
  .progress-track {
    width: 100%; height: 6px; background: var(--bg-surface-2);
    border-radius: var(--radius-full); overflow: hidden;
  }
  .progress-bar {
    height: 100%; border-radius: var(--radius-full);
    background: var(--taxi-yellow);
    transition: width var(--duration-slow) var(--ease-default);
  }
  .progress-bar-emerald { background: var(--emerald-500); }
  .progress-bar-blue { background: var(--blue-500); }
  .progress-bar-red { background: var(--red-500); }
  .progress-bar-indeterminate { animation: indeterminate-progress 1.5s ease-in-out infinite; width: 40% !important; }

  /* ─── TOOLTIP ─── */
  .tooltip {
    position: relative; cursor: help;
  }
  .tooltip::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--slate-800); color: white;
    padding: var(--space-1-5) var(--space-2-5);
    border-radius: var(--radius-md);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    white-space: nowrap; z-index: var(--z-tooltip);
    opacity: 0; pointer-events: none;
    transition: opacity var(--duration-fast), transform var(--duration-fast);
  }
  .tooltip:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

  /* ─── DROPDOWN ─── */
  .dropdown { position: relative; }
  .dropdown-menu {
    position: absolute; top: calc(100% + 4px); left: 0;
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    min-width: 180px; z-index: var(--z-dropdown);
    opacity: 0; transform: translateY(-4px);
    transition: opacity var(--duration-fast), transform var(--duration-fast);
    pointer-events: none; padding: var(--space-1);
  }
  .dropdown-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .dropdown-item {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm); color: var(--text-primary);
    border-radius: var(--radius-md); cursor: pointer;
    transition: background var(--duration-fast);
  }
  .dropdown-item:hover { background: var(--bg-surface-2); }
  .dropdown-divider { height: 1px; background: var(--border-subtle); margin: var(--space-1) 0; }

  /* ─── KPI STAT CARD ─── */
  .kpi-card {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); padding: var(--space-4);
    display: flex; flex-direction: column; gap: var(--space-1);
  }
  .kpi-label { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .kpi-value { font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--text-primary); font-family: var(--font-mono); }
  .kpi-delta { font-size: var(--text-xs); font-weight: var(--weight-semibold); display: inline-flex; align-items: center; gap: 2px; }
  .kpi-delta-up { color: var(--emerald-600); }
  .kpi-delta-down { color: var(--red-600); }
  .kpi-spark { height: 24px; margin-top: var(--space-1); }

  /* ─── AVATAR ─── */
  .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-sm); font-weight: var(--weight-bold);
    overflow: hidden; flex-shrink: 0;
  }
  .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .avatar-placeholder { background: var(--taxi-yellow); color: #000; }
  .avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
  .avatar-lg { width: 52px; height: 52px; font-size: var(--text-lg); }
  .avatar-xl { width: 64px; height: 64px; font-size: var(--text-xl); }

  /* ─── DIVIDER ─── */
  .divider { height: 1px; background: var(--border-subtle); margin: var(--space-4) 0; }
  .divider-sm { margin: var(--space-2) 0; }

  /* ─── STAR RATING ─── */
  .star-rating { display: flex; gap: 2px; }
  .star-rating .star { width: 24px; height: 24px; cursor: pointer; color: var(--slate-300); transition: color var(--duration-fast), transform var(--duration-fast); }
  .star-rating .star.filled { color: var(--taxi-yellow); }
  .star-rating .star:hover { transform: scale(1.2); }
  .star-rating-sm .star { width: 16px; height: 16px; }

  /* ─── EMPTY STATE ─── */
  .empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: var(--space-12) var(--space-6); text-align: center;
  }
  .empty-state-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.5; }
  .empty-state-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
  .empty-state-text { font-size: var(--text-sm); color: var(--text-muted); max-width: 320px; }

  /* ─── CONNECTION STATUS ─── */
  .connection-pill {
    display: inline-flex; align-items: center; gap: var(--space-1-5);
    padding: var(--space-1) var(--space-2-5);
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
  }
  .connection-pill-connected { background: var(--emerald-100); color: var(--emerald-700); }
  .connection-pill-connecting { background: var(--amber-100); color: var(--amber-700); }
  .connection-pill-disconnected { background: var(--red-100); color: var(--red-700); }

  /* ─── HEADER / NAVBAR ─── */
  .header-nav {
    position: sticky; top: 0; z-index: var(--z-header);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-3) var(--space-5);
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3);
    padding-top: calc(var(--space-3) + env(safe-area-inset-top, 0));
  }

  .brand-logo {
    display: flex; align-items: center; gap: var(--space-2);
    font-weight: var(--weight-extrabold); font-size: var(--text-lg);
    color: var(--text-primary); text-decoration: none;
  }
  .brand-logo-badge {
    width: 34px; height: 34px; background: var(--taxi-yellow);
    border-radius: var(--radius-md); display: flex; align-items: center;
    justify-content: center; font-size: var(--text-sm);
    font-weight: var(--weight-black); color: #000;
    box-shadow: var(--shadow-sm);
  }

  .telemetry-chip {
    display: inline-flex; align-items: center; gap: var(--space-1-5);
    padding: var(--space-1) var(--space-2-5);
    background: var(--bg-surface-2); border-radius: var(--radius-full);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    color: var(--text-secondary); white-space: nowrap;
  }

  /* ─── HERO ─── */
  .hero {
    text-align: center;
    padding: var(--space-16) var(--space-6) var(--space-12);
    max-width: 800px; margin: 0 auto;
  }
  .hero-title {
    font-size: var(--text-4xl); font-weight: var(--weight-extrabold);
    color: var(--text-primary); margin-bottom: var(--space-4);
    letter-spacing: -0.03em; line-height: var(--leading-tight);
  }
  .hero-subtitle {
    font-size: var(--text-lg); color: var(--text-secondary);
    max-width: 600px; margin: 0 auto var(--space-6);
    line-height: var(--leading-relaxed);
  }
  .hero-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
  .hero-pill {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: var(--space-1-5) var(--space-4);
    background: var(--yellow-100); color: var(--yellow-800);
    border-radius: var(--radius-full);
    font-size: var(--text-sm); font-weight: var(--weight-semibold);
    margin-bottom: var(--space-5);
  }

  /* ─── GRID LAYOUTS ─── */
  .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
  .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
  .grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }

  /* ─── APP CARD (Landing) ─── */
  .app-card {
    background: var(--bg-surface); border-radius: var(--radius-2xl);
    border: 1px solid var(--border-subtle); padding: var(--space-6);
    display: flex; flex-direction: column; gap: var(--space-3);
    transition: transform var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default),
                border-color var(--duration-normal) var(--ease-default);
  }
  .app-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-xl);
    border-color: var(--border-strong);
  }
  .app-card-icon {
    width: 48px; height: 48px; border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
  }
  .app-card-title { font-size: var(--text-lg); font-weight: var(--weight-bold); }
  .app-card-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); }
  .app-card-tag {
    display: inline-flex; padding: var(--space-1) var(--space-2-5);
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    border-radius: var(--radius-full); width: fit-content;
  }

  /* ─── FOOTER ─── */
  .footer {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-10) var(--space-6) var(--space-6);
    margin-top: var(--space-12);
  }
  .footer-grid {
    display: grid; grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-8); max-width: 1200px; margin: 0 auto;
  }
  .footer-heading { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text-primary); margin-bottom: var(--space-3); text-transform: uppercase; letter-spacing: 0.05em; }
  .footer-link { display: block; font-size: var(--text-sm); color: var(--text-muted); padding: var(--space-1) 0; transition: color var(--duration-fast); }
  .footer-link:hover { color: var(--text-primary); }
  .footer-bottom { text-align: center; padding-top: var(--space-6); margin-top: var(--space-6); border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-muted); }

  /* ─── STATUS BAR ─── */
  .status-bar {
    display: flex; align-items: center; justify-content: center;
    gap: var(--space-6); flex-wrap: wrap;
    padding: var(--space-4); margin: var(--space-8) auto;
    max-width: 900px;
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  }
  .status-item {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    color: var(--text-secondary);
  }
  .status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    animation: pulse-dot 2.5s ease-in-out infinite;
  }
  .status-dot-green { background: var(--emerald-500); }
  .status-dot-yellow { background: var(--taxi-yellow); }
  .status-dot-blue { background: var(--blue-500); }

  /* ─── MAP CONTAINER ─── */
  .map-container {
    position: relative; border-radius: var(--radius-xl);
    overflow: hidden; border: 1px solid var(--border-subtle);
  }
  .map-container .leaflet-container { z-index: var(--z-base); }
  .map-overlay {
    position: absolute; z-index: calc(var(--z-base) + 10);
    pointer-events: none;
  }
  .map-overlay > * { pointer-events: auto; }
  .map-controls-top { top: var(--space-3); left: var(--space-3); right: var(--space-3); }
  .map-controls-bottom { bottom: var(--space-3); left: var(--space-3); right: var(--space-3); }

  /* ─── FLOATING ACTION BUTTON ─── */
  .fab {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg); display: flex; align-items: center;
    justify-content: center; font-size: 20px; cursor: pointer;
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
  }
  .fab:hover { transform: scale(1.08); box-shadow: var(--shadow-xl); }
  .fab:active { transform: scale(0.95); }
  .fab-primary { background: var(--taxi-yellow); color: #000; border-color: var(--taxi-yellow-dark); }
  .fab-danger { background: var(--red-600); color: white; border-color: var(--red-700); }

  /* ─── SECTION ─── */
  .section { padding: var(--space-16) var(--space-6); }
  .section-header { text-align: center; max-width: 640px; margin: 0 auto var(--space-10); }
  .section-title { font-size: var(--text-3xl); font-weight: var(--weight-bold); margin-bottom: var(--space-3); }
  .section-subtitle { font-size: var(--text-base); color: var(--text-secondary); line-height: var(--leading-relaxed); }
  .container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-5); }

  /* ─── STEP FLOW (How It Works) ─── */
  .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-6); counter-reset: step; }
  .step { position: relative; text-align: center; padding: var(--space-5); counter-increment: step; }
  .step-number {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--taxi-yellow); color: #000;
    font-weight: var(--weight-bold); font-size: var(--text-lg);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--space-3);
  }
  .step-number::after { content: counter(step); }
  .step-title { font-size: var(--text-base); font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
  .step-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); }

  /* ─── FAQ ACCORDION ─── */
  .faq-item { border-bottom: 1px solid var(--border-subtle); }
  .faq-question {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4) 0; cursor: pointer;
    font-size: var(--text-base); font-weight: var(--weight-medium);
    color: var(--text-primary); width: 100%; text-align: left;
    background: none; border: none;
  }
  .faq-question::after {
    content: '+'; font-size: var(--text-xl); color: var(--text-muted);
    transition: transform var(--duration-fast);
    font-weight: var(--weight-normal);
  }
  .faq-item.is-open .faq-question::after { content: '−'; transform: rotate(180deg); }
  .faq-answer {
    max-height: 0; overflow: hidden;
    transition: max-height var(--duration-slow) var(--ease-default);
    font-size: var(--text-sm); color: var(--text-secondary);
    line-height: var(--leading-relaxed);
  }
  .faq-item.is-open .faq-answer { max-height: 500px; padding-bottom: var(--space-4); }

  /* ─── COCKPIT SPECIFIC ─── */
  .cockpit-gauge {
    background: var(--bg-surface); border: 2px solid var(--border-subtle);
    border-radius: var(--radius-2xl); padding: var(--space-4);
    text-align: center; display: flex; flex-direction: column;
    align-items: center; gap: var(--space-2);
  }
  .cockpit-gauge-value { font-size: var(--text-3xl); font-weight: var(--weight-black); font-family: var(--font-mono); }
  .cockpit-gauge-label { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .cockpit-gauge-yellow { border-color: var(--taxi-yellow); }
  .cockpit-gauge-emerald { border-color: var(--emerald-500); }
  .cockpit-gauge-red { border-color: var(--red-500); }

  .taximeter {
    background: var(--slate-900); color: var(--taxi-yellow);
    border-radius: var(--radius-xl); padding: var(--space-4);
    font-family: var(--font-mono); text-align: center;
  }
  .taximeter-value { font-size: var(--text-4xl); font-weight: var(--weight-black); letter-spacing: 2px; }
  .taximeter-label { font-size: var(--text-xs); color: var(--slate-400); text-transform: uppercase; margin-top: var(--space-1); }
  .taximeter-surcharges { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-2); flex-wrap: wrap; }

  /* ─── GO TOGGLE (Driver) ─── */
  .go-toggle {
    width: 120px; height: 120px; border-radius: 50%;
    border: 4px solid var(--border-default);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-2xl); font-weight: var(--weight-black);
    cursor: pointer; transition: all var(--duration-normal) var(--ease-spring);
    background: var(--bg-surface); color: var(--text-muted);
    box-shadow: var(--shadow-lg);
    user-select: none; -webkit-tap-highlight-color: transparent;
  }
  .go-toggle.is-online {
    background: var(--taxi-yellow); color: #000;
    border-color: var(--taxi-yellow-dark);
    box-shadow: var(--shadow-lg), var(--shadow-glow-yellow);
  }
  .go-toggle:active { transform: scale(0.95); }

  /* ─── PIN KEYPAD (Driver) ─── */
  .pin-display {
    display: flex; gap: var(--space-2); justify-content: center;
    margin-bottom: var(--space-4);
  }
  .pin-digit {
    width: 48px; height: 56px; border: 2px solid var(--border-default);
    border-radius: var(--radius-lg); display: flex; align-items: center;
    justify-content: center; font-size: var(--text-2xl);
    font-weight: var(--weight-bold); font-family: var(--font-mono);
    background: var(--bg-surface);
    transition: border-color var(--duration-fast);
  }
  .pin-digit.filled { border-color: var(--taxi-yellow); background: var(--yellow-50); }
  .pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); max-width: 240px; margin: 0 auto; }
  .pin-key {
    padding: var(--space-3); font-size: var(--text-xl); font-weight: var(--weight-semibold);
    border-radius: var(--radius-lg); background: var(--bg-surface-2);
    transition: background var(--duration-fast), transform var(--duration-fast);
  }
  .pin-key:active { transform: scale(0.95); background: var(--slate-200); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: UTILITIES — Flex, spacing, text utilities
   ═══════════════════════════════════════════════════════════════════════════ */
@layer utilities {
  .sr-only {
    position: absolute !important; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    border: 0; white-space: nowrap;
  }

  .flex { display: flex; }
  .flex-col { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .items-center { align-items: center; }
  .items-start { align-items: flex-start; }
  .items-end { align-items: flex-end; }
  .justify-center { justify-content: center; }
  .justify-between { justify-content: space-between; }
  .justify-end { justify-content: flex-end; }
  .gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
  .gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
  .gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
  .gap-8 { gap: var(--space-8); }
  .flex-1 { flex: 1; }

  .text-center { text-align: center; }
  .text-left { text-align: left; }
  .text-right { text-align: right; }
  .text-xs { font-size: var(--text-xs); } .text-sm { font-size: var(--text-sm); }
  .text-base { font-size: var(--text-base); } .text-lg { font-size: var(--text-lg); }
  .text-xl { font-size: var(--text-xl); } .text-2xl { font-size: var(--text-2xl); }
  .text-3xl { font-size: var(--text-3xl); } .text-4xl { font-size: var(--text-4xl); }
  .font-medium { font-weight: var(--weight-medium); }
  .font-semibold { font-weight: var(--weight-semibold); }
  .font-bold { font-weight: var(--weight-bold); }
  .font-black { font-weight: var(--weight-black); }
  .font-mono { font-family: var(--font-mono); }
  .text-primary { color: var(--text-primary); }
  .text-secondary { color: var(--text-secondary); }
  .text-muted { color: var(--text-muted); }

  .w-full { width: 100%; }
  .h-full { height: 100%; }
  .max-w-sm { max-width: 480px; }
  .max-w-md { max-width: 640px; }
  .max-w-lg { max-width: 800px; }
  .max-w-xl { max-width: 1024px; }
  .max-w-2xl { max-width: 1200px; }
  .mx-auto { margin-left: auto; margin-right: auto; }

  .p-0 { padding: 0; } .p-2 { padding: var(--space-2); }
  .p-3 { padding: var(--space-3); } .p-4 { padding: var(--space-4); }
  .p-5 { padding: var(--space-5); } .p-6 { padding: var(--space-6); }

  .rounded-md { border-radius: var(--radius-md); }
  .rounded-lg { border-radius: var(--radius-lg); }
  .rounded-xl { border-radius: var(--radius-xl); }
  .rounded-2xl { border-radius: var(--radius-2xl); }
  .rounded-full { border-radius: var(--radius-full); }

  .shadow-sm { box-shadow: var(--shadow-sm); }
  .shadow-md { box-shadow: var(--shadow-md); }
  .shadow-lg { box-shadow: var(--shadow-lg); }
  .shadow-xl { box-shadow: var(--shadow-xl); }

  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .opacity-0 { opacity: 0; } .opacity-50 { opacity: 0.5; } .opacity-100 { opacity: 1; }
  .pointer-events-none { pointer-events: none; }
  .cursor-pointer { cursor: pointer; }
  .select-none { user-select: none; }
  .relative { position: relative; }
  .absolute { position: absolute; }
  .fixed { position: fixed; }
  .sticky { position: sticky; }
  .inset-0 { inset: 0; }
  .overflow-hidden { overflow: hidden; }
  .overflow-auto { overflow: auto; }
  .hidden { display: none; }
  .block { display: block; }
  .inline-flex { display: inline-flex; }
  .grid { display: grid; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: ANIMATIONS — Keyframes
   ═══════════════════════════════════════════════════════════════════════════ */
@layer animations {
  @keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
  }
  @keyframes pulse-radar {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
  }
  @keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
  }
  @keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  @keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  @keyframes slide-down {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  @keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }
  @keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes sos-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.6), 0 0 60px rgba(239, 68, 68, 0.2); }
  }
  @keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
  }
  @keyframes indeterminate-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
  }
  @keyframes count-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes taxi-move {
    0% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    100% { transform: translateX(-2px); }
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero { padding: var(--space-10) var(--space-4) var(--space-8); }
  .hero-title { font-size: var(--text-3xl); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .header-nav { padding: var(--space-2) var(--space-3); gap: var(--space-2); padding-top: calc(var(--space-2) + env(safe-area-inset-top, 0)); }
  .status-bar { flex-direction: column; gap: var(--space-2); }
  .kpi-card { padding: var(--space-3); }
  .section { padding: var(--space-10) var(--space-4); }
  .steps { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - var(--space-6)); }
  .btn-cockpit { min-width: 160px; min-height: 60px; }
  .go-toggle { width: 100px; height: 100px; }
  .pin-digit { width: 40px; height: 48px; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1025px) {
  .container { padding: 0 var(--space-8); }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: var(--space-6) var(--space-4); }
  .go-toggle { width: 80px; height: 80px; font-size: var(--text-lg); }
}
