/* F17 / US-084 — FleetSense visual tokens: the single source of colours, type, spacing,
   radii and shadows for every space. Screens use var(--fs-…), never a literal colour.
   Reference: production (app 1.6.0, console 2.1.0) — the calm dark slate of the back-office
   (css/fleetsense-ui.css, part 4), Urbanist titles, Inter text, blue actions.
   Names also defined by css/fleetsense-ui.css carry exactly the same values, so the back-office,
   which loads both files, looks the same as in production. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Urbanist:wght@600;700;800&display=swap');

:root {
  color-scheme: dark;

  /* Brand */
  --fs-ink: #f8fafc;            /* titles and brand on the dark surfaces */
  --fs-primary: #2563eb;        /* actions */
  --fs-primary-hover: #3b82f6;  /* production value, kept for the back-office */
  --fs-primary-active: #1d4ed8; /* hover of white-text actions: 6.7:1 (white on #3b82f6 is only 3.7:1) */
  --fs-primary-border: rgba(96, 165, 250, 0.45);
  --fs-primary-strong: #93c5fd; /* blue text on dark: current menu entry, secondary actions */
  --fs-primary-soft: rgba(59, 130, 246, 0.14);
  --fs-accent: #60a5fa;         /* links, eyebrows, focus */
  --fs-accent-soft: rgba(96, 165, 250, 0.1);

  /* Neutrals (production slate) */
  --fs-bg: #0a1120;
  --fs-surface: #0f172a;
  --fs-surface-raised: #131d33;
  --fs-surface-sunken: #0b1324;
  --fs-surface-alt: #131d33;
  --fs-surface-glass: rgba(15, 23, 42, 0.88);
  --fs-secondary-bg: rgba(15, 23, 42, 0.6);
  --fs-secondary-hover: rgba(30, 41, 59, 0.85);
  --fs-line: #1e293b;
  --fs-line-strong: #2b3a52;
  --fs-border: var(--fs-line);
  --fs-border-strong: var(--fs-line-strong);
  --fs-text: #f8fafc;
  --fs-text-2: #cbd5e1;
  --fs-text-3: #94a3b8;
  --fs-text-muted: #94a3b8;     /* 6.9:1 on --fs-surface */
  --fs-text-inverse: #ffffff;   /* on --fs-primary */
  --fs-placeholder: #8391a7;    /* 5.5:1 on --fs-surface-sunken */

  /* States (production colours; text meets WCAG AA on the dark surfaces and their soft background) */
  --fs-success: #34d399;  --fs-success-soft: rgba(52, 211, 153, 0.12);
  --fs-warning: #fbbf24;  --fs-warning-soft: rgba(251, 191, 36, 0.12);
  --fs-danger: #f87171;   --fs-danger-soft: rgba(239, 68, 68, 0.12);
  --fs-danger-strong: #dc2626;  /* filled counters, white text */
  --fs-info: #93c5fd;     --fs-info-soft: rgba(59, 130, 246, 0.12);

  /* Type */
  --fs-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --fs-font-display: 'Urbanist', 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --fs-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-text-xs: 12px;
  --fs-text-sm: 14px;
  --fs-text-md: 16px;
  --fs-text-lg: 18px;
  --fs-text-xl: 24px;
  --fs-text-2xl: 32px;
  --fs-text-3xl: 44px;
  --fs-leading: 1.5;

  /* Spacing (4 px grid) */
  --fs-space-1: 4px;
  --fs-space-2: 8px;
  --fs-space-3: 12px;
  --fs-space-4: 16px;
  --fs-space-5: 24px;
  --fs-space-6: 32px;
  --fs-space-7: 48px;
  --fs-space-8: 64px;

  /* Shapes (production: controls 10 px, cards 16 px, panels 20 px) */
  --fs-radius-sm: 8px;
  --fs-radius: 10px;
  --fs-radius-lg: 16px;
  --fs-radius-pill: 999px;
  --fs-radius-control: 10px;
  --fs-radius-card: 16px;
  --fs-radius-panel: 20px;
  --fs-control-height: 42px;
  --fs-shadow-sm: none;
  --fs-shadow: 0 16px 36px rgba(2, 8, 23, 0.14);
  --fs-shadow-lg: 0 18px 50px rgba(2, 8, 23, 0.45);
  --fs-focus: 0 0 0 3px rgba(96, 165, 250, 0.35);
  --fs-chevron: 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%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* Layout */
  --fs-content: 1120px;     /* public / conducteur reading width */
  --fs-content-wide: 1480px;/* gestion / admin working width (production .fs-page) */
  --fs-shell-height: 60px;
  /* Menu latéral Gestion, identique au back-office (réserve qualification .56). */
  --fs-sidebar-bg: #0a1324;
  --fs-sidebar-border: rgba(148, 163, 184, 0.12);
  --fs-sidebar-group: #64748b;
  --fs-sidebar-text: #a5b4c8;
  --fs-sidebar-hover: rgba(148, 163, 184, 0.08);
  --fs-sidebar-active-bg: rgba(59, 130, 246, 0.16);
  --fs-sidebar-active-text: #ffffff;
  --fs-sidebar-active-icon: #60a5fa;
}

/* Espace conducteur v2 (maquette validée du 3/11) : thème clair par défaut, le sombre ci-dessus reste
   disponible (data-theme="sombre", choisi par la personne). Mêmes noms de jetons : les écrans existants
   de l'espace conducteur passent au clair sans changement de leur feuille. Contrastes AA sur fond blanc.
   Classe driver-light posée par js/driver/theme.js et frame.mjs : le catalogue public (catalogue.html), conçu
   pour le sombre, n'en reçoit jamais. */
:root.driver-light:not([data-theme="sombre"]) {
  color-scheme: light;
  --fs-ink: #0f172a;
  --fs-primary: #2563eb;
  --fs-primary-hover: #1d4ed8;
  --fs-primary-active: #1d4ed8;
  --fs-primary-border: rgba(37, 99, 235, 0.45);
  --fs-primary-strong: #1d4ed8;
  --fs-primary-soft: #e8f0fe;
  --fs-accent: #1d4ed8;
  --fs-accent-soft: rgba(37, 99, 235, 0.08);
  --fs-bg: #f4f6fa;
  --fs-surface: #ffffff;
  --fs-surface-raised: #ffffff;
  --fs-surface-sunken: #f8fafc;
  --fs-surface-alt: #f1f5f9;
  --fs-surface-glass: rgba(255, 255, 255, 0.94);
  --fs-secondary-bg: #ffffff;
  --fs-secondary-hover: #f1f5f9;
  --fs-line: #e2e8f0;
  --fs-line-strong: #cbd5e1;
  --fs-text: #0f172a;
  --fs-text-2: #475569;
  --fs-text-3: #475569;
  --fs-text-muted: #475569;
  --fs-placeholder: #64748b;
  --fs-success: #065f46;  --fs-success-soft: #d1fae5;
  --fs-warning: #92400e;  --fs-warning-soft: #fef3c7;
  --fs-danger: #b91c1c;   --fs-danger-soft: #fee2e2;
  --fs-info: #1d4ed8;     --fs-info-soft: #e8f0fe;
  --fs-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --fs-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --fs-focus: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --fs-chevron: 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='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
/* Jetons propres à l'espace conducteur, dans les deux thèmes (maquette : okFill, off, bulle, barre d'onglets). */
:root[data-space="conducteur"] {
  --fs-done: #059669; --fs-off: #24324a; --fs-off-text: #cbd5e1; --fs-bubble: #1b2742; --fs-tab: #0f172a;
}
:root.driver-light:not([data-theme="sombre"]) {
  --fs-done: #047857; --fs-off: #cbd5e1; --fs-off-text: #475569; --fs-bubble: #f1f5f9; --fs-tab: #ffffff;
}
