/* =============================================================================
   Service Intel design tokens.

   The ONLY file that declares --si-* values. Every component reads var(--si-*); none declares one.
   Same technique as SI V2 (ServiceIntelligence.Web/Content/si-v2/si-tokens.css), with one change:
   V2 declared on .si-v2 because it lived inside legacy pages; this SPA owns the whole document,
   so the tokens live on :root.

   Sources, in order of precedence:
     1. DESIGN.md v8 of the base design
        (Claude-Docs/Requirements/SIPOS10-5932_UI-Improvements/UI-UX/ServiceIntel Vehicle Dashboard/uploads/
         stitch_service_intel_advisor_dashboard (8)/DESIGN.md). Colour names keep the on- prefixes
        so any token traces back to the file by string search.
     2. The twelve .dc.html templates, for what DESIGN.md does not define (status chips, muted text,
        soft primary tints, half-step spacing, the score size). Marked "templates" below.
   Where the two disagree, the resolution is documented in
     Claude-Docs/Requirements/SIPOS10-5932_UI-Improvements/UI-UX/Design-Tokens.md, section 3.

   Naming: --si-<category>-<role>[-<variant>]
   Categories: color, status, font, size, lh, ls, weight, space, radius, elev, focus, dur, ease, z, layout.
   ============================================================================= */

:root {
    /* ---- Surfaces (DESIGN.md) ---- */
    --si-color-surface:                    #f7f9ff;
    --si-color-surface-dim:                #d7dae0;
    --si-color-surface-bright:             #f7f9ff;
    --si-color-surface-container-lowest:   #ffffff;
    --si-color-surface-container-low:      #f1f4fa;
    --si-color-surface-container:          #ebeef4;
    --si-color-surface-container-high:     #e5e8ee;
    --si-color-surface-container-highest:  #dfe3e8;
    --si-color-surface-variant:            #dfe3e8;
    --si-color-surface-tint:               #005bc0;
    --si-color-background:                 #f7f9ff;
    --si-color-inverse-surface:            #2d3135;
    --si-color-inverse-on-surface:         #eef1f7;

    /* ---- Content on surfaces (DESIGN.md) ---- */
    --si-color-on-surface:                 #181c20;
    --si-color-on-surface-variant:         #414754;
    --si-color-on-background:              #181c20;
    --si-color-outline:                    #727785;
    --si-color-outline-variant:            #c1c6d6;
    /* A filled rating star (Location Settings design). */
    --si-color-rating:                     #f5b400;

    /* Templates: placeholders, timestamps, disabled icons. Between outline and on-surface-variant;
       used 40 times, DESIGN.md has no role for it. */
    --si-color-on-surface-muted:           #8d93a3;

    /* Templates: the slate of the sidebar rows, between on-surface and on-surface-variant (Sidebar template). */
    --si-color-on-surface-soft:            #2c3140;

    /* The backdrop of a modal and of the open mobile sidebar: on-surface at 40 percent, as the legacy modal backdrop. */
    --si-color-scrim:                      color-mix(in srgb, var(--si-color-on-surface) 40%, transparent);

    /* ---- Primary: Service Blue, actions and focus (DESIGN.md) ----
       primary is the button and link blue; primary-container (#1a73e8) is the brighter blue the
       templates use for the active nav item, the info badge and the toggle track. */
    --si-color-primary:                    #005bbf;
    --si-color-on-primary:                 #ffffff;
    --si-color-primary-container:          #1a73e8;
    --si-color-on-primary-container:       #ffffff;
    --si-color-inverse-primary:            #adc7ff;
    --si-color-primary-fixed:              #d8e2ff;
    --si-color-primary-fixed-dim:          #adc7ff;
    --si-color-on-primary-fixed:           #001a41;
    --si-color-on-primary-fixed-variant:   #004493;

    /* Templates: the soft blue tint behind the active nav item and the "new experience" toggle,
       with its hairline. Lighter than primary-fixed; used 15 times, so it is a token and not a tint
       computed in components. */
    --si-color-primary-soft:               #eaf2fe;
    --si-color-primary-soft-border:        #c9dcf7;

    /* ---- Secondary: Neutral Slate, utilitarian elements (DESIGN.md) ---- */
    --si-color-secondary:                  #5b5f64;
    --si-color-on-secondary:               #ffffff;
    --si-color-secondary-container:        #dde0e6;
    --si-color-on-secondary-container:     #5f6368;
    --si-color-secondary-fixed:            #dfe3e8;
    --si-color-secondary-fixed-dim:        #c3c7cc;
    --si-color-on-secondary-fixed:         #181c20;
    --si-color-on-secondary-fixed-variant: #43474c;

    /* ---- Tertiary: Electric Cyan, specialized highlights (DESIGN.md) ---- */
    --si-color-tertiary:                   #00667e;
    --si-color-on-tertiary:                #ffffff;
    --si-color-tertiary-container:         #00819e;
    --si-color-on-tertiary-container:      #ffffff;
    --si-color-tertiary-fixed:             #b6eaff;
    --si-color-tertiary-fixed-dim:         #4bd6ff;
    --si-color-on-tertiary-fixed:          #001f28;
    --si-color-on-tertiary-fixed-variant:  #004e60;

    /* ---- Error (DESIGN.md) ---- */
    --si-color-error:                      #ba1a1a;
    --si-color-on-error:                   #ffffff;
    --si-color-error-container:            #ffdad6;
    --si-color-on-error-container:         #93000a;

    /* ---- Status: bg / fg / bd triplets plus a solid, reserved for state (DESIGN.md prose) ----
       Not in the DESIGN.md frontmatter; values are the ones the templates apply to chips, stripes,
       rings and sidebar badges. due-now reuses the error family on purpose: "Urgent, Due Now,
       Safety" is the same signal as an error. */
    --si-status-due-now-bg:   #ffdad6;  --si-status-due-now-fg:   #93000a;  --si-status-due-now-bd:   #ffb4ad;  --si-status-due-now-solid:   #ba1a1a;
    --si-status-due-soon-bg:  #fff8e1;  --si-status-due-soon-fg:  #6b4f00;  --si-status-due-soon-bd:  #f0dda3;  --si-status-due-soon-solid:  #e8a800;
    --si-status-healthy-bg:   #e8f6ec;  --si-status-healthy-fg:   #0b6b2f;  --si-status-healthy-bd:   #b7e2c4;  --si-status-healthy-solid:   #0f7a37;
    --si-status-info-bg:      #eaf2fe;  --si-status-info-fg:      #00408a;  --si-status-info-bd:      #b9d2f0;  --si-status-info-solid:      #1a73e8;
    --si-status-neutral-bg:   #f1f4fa;  --si-status-neutral-fg:   #414754;  --si-status-neutral-bd:   #c1c6d6;  --si-status-neutral-solid:   #727785;

    /* Templates: the calendar badge in the sidebar is a solid amber with dark text. */
    --si-status-highlight-bg: #ffd54a;  --si-status-highlight-fg: #4a3600;

    /* ---- Typography (DESIGN.md: Inter only, tabular figures for money and mileage) ---- */
    --si-font-body: "Inter Variable", "Inter", "Segoe UI", system-ui, Arial, sans-serif;
    --si-font-mono: Consolas, Monaco, "Courier New", monospace;

    /* role: size / line-height / letter-spacing / weight. The first nine are DESIGN.md verbatim. */
    --si-size-display-lg:   32px;  --si-lh-display-lg:   40px;  --si-ls-display-lg:   -0.02em;  --si-weight-display-lg:   700;
    --si-size-headline-md:  24px;  --si-lh-headline-md:  32px;  --si-ls-headline-md:  -0.01em;  --si-weight-headline-md:  600;
    --si-size-headline-sm:  20px;  --si-lh-headline-sm:  28px;  --si-ls-headline-sm:  0;        --si-weight-headline-sm:  600;
    --si-size-title-lg:     18px;  --si-lh-title-lg:     24px;  --si-ls-title-lg:     0;        --si-weight-title-lg:     600;
    --si-size-body-md:      16px;  --si-lh-body-md:      24px;  --si-ls-body-md:      0;        --si-weight-body-md:      400;
    --si-size-body-sm:      14px;  --si-lh-body-sm:      20px;  --si-ls-body-sm:      0;        --si-weight-body-sm:      400;
    --si-size-label-md:     12px;  --si-lh-label-md:     16px;  --si-ls-label-md:     0.05em;   --si-weight-label-md:     600;
    --si-size-label-sm:     11px;  --si-lh-label-sm:     14px;  --si-ls-label-sm:     0;        --si-weight-label-sm:     500;
    --si-size-data-tabular: 14px;  --si-lh-data-tabular: 20px;  --si-ls-data-tabular: 0;        --si-weight-data-tabular: 400;

    /* Templates: three roles DESIGN.md lacks and the templates use in volume.
       display-xl: the health score number. caption: meta text under titles (13px, 53 uses).
       overline: the uppercase eyebrow above a section (10px bold, 0.08em, 21 uses). */
    --si-size-display-xl:   48px;  --si-lh-display-xl:   1;     --si-ls-display-xl:   -0.02em;  --si-weight-display-xl:   700;
    --si-size-caption:      13px;  --si-lh-caption:      18px;  --si-ls-caption:      0;        --si-weight-caption:      400;
    --si-size-overline:     10px;  --si-lh-overline:     14px;  --si-ls-overline:     0.08em;   --si-weight-overline:     700;

    /* Templates: the sidebar rows are 15px medium in every template; 14px reads visibly smaller next to them. */
    --si-size-nav:          15px;  --si-lh-nav:          20px;  --si-ls-nav:          0;        --si-weight-nav:          500;

    /* ---- Spacing: 4px baseline (DESIGN.md) ---- */
    --si-space-xs: 4px;
    --si-space-sm: 8px;
    --si-space-md: 16px;
    --si-space-lg: 24px;
    --si-space-xl: 32px;
    --si-gutter:   16px;

    /* Templates: two half-steps used more than the steps around them (12px: 52 gaps, 20px: card padding).
       Named by value on purpose: they are exceptions to the scale, not part of it. */
    --si-space-12: 12px;
    --si-space-20: 20px;

    /* ---- Radius: soft shape language (DESIGN.md frontmatter, confirmed by the templates) ---- */
    --si-radius-sm:   2px;    /* hairline chips, small toggles */
    --si-radius-md:   4px;    /* DEFAULT: buttons, inputs, checkboxes */
    --si-radius-lg:   8px;    /* cards, containers, nav items */
    --si-radius-xl:   12px;   /* panels, modals, the vehicle header card */
    --si-radius-nav:  10px;   /* the sidebar rows only (Sidebar template); named by use, an exception to the scale */
    --si-radius-pill: 9999px; /* status badges only, never buttons */

    /* ---- Elevation: tonal layering plus low-contrast outlines (DESIGN.md) ---- */
    --si-elev-0: none;
    --si-elev-1: 0 1px 3px rgba(0, 0, 0, 0.08);     /* Level 1: cards, sidebar. DESIGN.md verbatim */
    --si-elev-2: 0 4px 6px rgba(0, 0, 0, 0.1);      /* hover lift and dropdowns. Templates */
    --si-elev-3: 0 10px 15px rgba(0, 0, 0, 0.1);    /* Level 2: modals, active menus. DESIGN.md verbatim */
    --si-elev-inset: inset 0 1px 0 rgba(0, 0, 0, 0.12);   /* button press */
    --si-focus-ring: 0 0 0 3px rgba(0, 91, 191, 0.15);    /* templates; primary at 15% */
    --si-hairline: 1px solid var(--si-color-outline-variant);

    /* ---- Chart series: one sequential blue ramp, light to dark ----
       DESIGN.md defines none. The templates paint the RO upside bar and the Insights bars with seven
       hard-coded hues; as a categorical set those fail the colour-vision separation check, so a single
       ramp replaces them: the bar carries magnitude, the labelled list beside it carries identity.
       Steps 1, 2, 6 and 7 are the primary tokens above. */
    --si-chart-1: #d8e2ff;
    --si-chart-2: #adc7ff;
    --si-chart-3: #7fb0f1;
    --si-chart-4: #5b9df0;
    --si-chart-5: #2f80ea;
    --si-chart-6: #1a73e8;
    --si-chart-7: #005bbf;
    --si-chart-track: #eef1f6;

    /* ---- Motion (templates: .15s ease everywhere) ---- */
    --si-dur-fast: 150ms;
    --si-dur-base: 200ms;
    --si-dur-slow: 1000ms;   /* the score ring draw-in */
    --si-ease: cubic-bezier(0.2, 0, 0.2, 1);
    --si-ease-out: ease-out;

    /* ---- Z-index: one place. No legacy chrome shares the document, so the scale is short. ---- */
    --si-z-sidebar:    100;
    --si-z-topbar:     110;
    --si-z-sticky-bar: 900;   /* a sticky page bar covers the page under it, but sits below anything that opens over the page */
    --si-z-dropdown:   1000;
    --si-z-overlay:    1100;
    --si-z-modal:      1110;
    --si-z-popover:    1114;  /* a portaled list or menu: above a nested dialog's card (modal + 3), so a select inside a confirm still opens on top */
    --si-z-tooltip:    1150;  /* above a modal: a control inside a dialog has a tooltip too */
    --si-z-toast:      1200;

    /* ---- Layout (DESIGN.md sidebar and container; topbar height from the templates) ---- */
    --si-layout-sidebar-width: 280px;
    --si-layout-topbar-height: 54px;
    /* The sidebar's settings band from its top border to the bottom of the screen; a page footer that matches it
       continues that line. */
    --si-layout-footer-height: 75px;
    --si-layout-container-max: 1440px;
}
