/* ============================================================================
   tokens.css — Catalyst H2O's design tokens: the single source of truth for
   colour, type, radius, spacing, elevation and layout across the application.

   Loaded before every other stylesheet (see ctlmain.php) so any sheet can use
   these custom properties. Always read them WITH a fallback equal to the
   token's current value, e.g. `color: var(--color-brand, #224487);` — a sheet
   loaded out of order, or viewed on its own, then still renders correctly.
   Raw hex belongs in this file only.

   The palette, type and shape are Catalyst's (the Wex app's redesign), ported
   unchanged. Plan and decisions: docs/REDESIGN_PLAN.md; how to use them:
   docs/UI_GUIDE.md.

   Contrast rules, measured:
     · --color-cyan (#2BACCC) is 2.67:1 on white — marks, indicators and focus
       only, NEVER text. Cyan-coloured text uses --color-cyan-ink (5.76:1).
     · --color-text-faint (#8A97AD) is 2.95:1 — icons and decoration only.
   ============================================================================ */

:root {
    /* ========================================================================
       BRAND — navy and cyan (Catalyst's palette, docs/REDESIGN_PLAN.md D3).
       ======================================================================== */
    --color-brand:          #224487;  /* navy — primary actions, selection, headings */
    --color-brand-hover:    #1b3a78;  /* hover on navy */
    --color-brand-active:   #16306a;  /* pressed / deep navy */
    --color-brand-contrast: #ffffff;  /* text ON navy (9.36:1) */
    --color-brand-accent:   #0B6F88;  /* links and cyan-coloured text */
    --color-brand-tint:     #E3F5FA;  /* selected row, active nav item */
    --color-brand-tint-2:   #F6F9FC;  /* hover row, table header */

    --color-cyan:           #2BACCC;  /* marks, indicators, focus ring — never text */
    --color-cyan-ink:       #0B6F88;  /* cyan-coloured text */
    --color-cyan-soft:      #E3F5FA;

    /* ========================================================================
       SURFACES
       ======================================================================== */
    --color-surface:       #ffffff;  /* cards, panels, table bodies */
    --color-page:          #EEF3F8;  /* the page behind the cards */
    --color-row:           #F6F9FC;  /* table headers, inputs at rest */
    --color-border:        #DDE6F0;  /* every hairline */
    --color-border-strong: #C9D5E4;  /* dividers that must read as a line */
    --color-input-border:  #CDD8E6;

    /* ========================================================================
       TEXT
       ======================================================================== */
    --color-text:        #15233F;  /* body copy and headings (15.6:1) */
    --color-text-2:      #2B3A55;  /* secondary emphasis */
    --color-text-muted:  #46536B;  /* captions, labels, hints, placeholders (7.75:1; 6.94:1 on the page) — darkened from #46536B, too light to read (Rohit, 2026-10-12) */
    --color-text-faint:  #8A97AD;  /* icons and decoration ONLY (2.95:1) */

    /* ========================================================================
       STATUS — RESERVED. These colours carry meaning and nothing decorative may
       borrow them; they always ship with a word or an icon, never colour alone.
       ======================================================================== */
    --color-success:      #16A34A;
    --color-success-bg:   #E6F4EA;
    --color-success-text: #166534;

    --color-danger:       #C2273A;
    --color-danger-hover: #A21F31;
    --color-danger-bg:    #FDE8EA;
    --color-danger-text:  #A61B2B;

    --color-warning:      #D97706;
    --color-warning-bg:   #FEF3C7;
    --color-warning-text: #92400E;

    --color-info:         #1AA0C2;
    --color-info-bg:      #E3F5FA;
    --color-info-text:    #0B6680;

    --color-inactive:      #94A3B8;
    --color-inactive-bg:   #EEF2F7;
    --color-inactive-text: #475569;

    /* H2O additions (redesign Phase 7): the few colours the shared components
       wrote out raw, given names so no sheet holds a raw colour. Same values
       as before, except the error toast's border, which shares the bad note's
       (#F3B6BE before - a shade apart). */
    --color-warning-hover:   #B45309;  /* .ui-btn--warn on hover */
    --color-warning-border:  #F6DCA6;  /* the warning note's edge */
    --color-danger-border:   #F3B8B8;  /* the bad note's and the error toast's edge */
    --color-success-on-dark: #4ADE80;  /* the tick on the dark success toast */
    --color-row-bad:         #FFF8F0;  /* a table row that cannot be used (.is-bad) */
    --color-border-soft:     #E8EEF5;  /* the hairline between sub-rows (.is-sub) */

    /* ========================================================================
       CHART SERIES — validated with the dataviz validator: normal-vision
       ΔE 18.3, colour-blind ΔE 9.2, all ≥ 3:1 on white. Assign in this order;
       a seventh series folds into "Other". Water keeps its pale diluent colour.
       ======================================================================== */
    --series-1: #2A57B5;
    --series-2: #1AA0C2;
    --series-3: #7A5BD0;
    --series-4: #3F9B57;
    --series-5: #C2569A;
    --series-6: #B8752A;
    --series-other: #A3AEBF;
    --series-water: #BFE6F0;
    --chart-grid:   #E6EDF5;

    /* ========================================================================
       TYPE — bundled in fonts/, declared in css/ui/fonts.css.
       ======================================================================== */
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

    /* ========================================================================
       RADIUS
       ======================================================================== */
    --radius-sm:   7px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-pill: 999px;

    /* ========================================================================
       SPACING — a 4px scale. Use these rather than arbitrary pixel values so
       rhythm stays consistent between modules written months apart.
       ======================================================================== */
    --space-1:  4px;
    --space-2:  8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    /* ========================================================================
       ELEVATION — navy-tinted shadows
       ======================================================================== */
    --shadow-sm: 0 1px 2px rgba(21, 35, 63, 0.06);
    --shadow-md: 0 4px 12px rgba(21, 35, 63, 0.10);
    --shadow-lg: 0 12px 32px rgba(21, 35, 63, 0.16);

    /* ========================================================================
       LAYOUT — the shell (css/ui/nav.css, css/ui/layout.css)
       ======================================================================== */
    --nav-w:           240px;
    --nav-w-collapsed:  68px;
    --top-h:            60px;
    --page-pad-x:       24px;

    /* Side panels (css/ui/panel.css) — the replacement for every modal. */
    --panel-sm: 460px;
    --panel-md: 620px;
    --panel-lg: 800px;
    --panel-xl: 940px;

    /* Stacking: the nav, then the scrim, the panel and the toasts above it
       all. (H2O's old modals, up to 2002, are gone since redesign Phase 5.) */
    --z-nav:    1000;
    --z-scrim: 20000;
    --z-panel: 20010;
    --z-toast: 20100;
}
