/* speed-and-look (2026-10-22): the CRM's ONE set of design tokens -- colours for light and dark, the type scale, the
   spacing scale, one corner radius, one shadow, one transition. Loaded first (base.html); every other stylesheet
   reads these. The older names (app.css --bg/--text/--badge-*, frame.css --db-*, the page files' --wm-*, --lp-*, --pv-*)
   are aliases of these now, so a colour is changed here and nowhere else.
   Brand: navy sidebar, red accent (Company settings' accent colour still wins for --accent), ice-blue #D6E3F5 as the
   dark-mode highlight. Contrast (WCAG): body text >= 7:1, muted text >= 4.5:1, status text on its tint >= 4.5:1,
   in both modes. */

:root {
    /* brand */
    --c-navy: #10213A;
    --c-navy-2: #1C3357;           /* a line or hover on navy */
    --c-on-navy: #FFFFFF;
    --c-on-navy-muted: #C3CCDA;
    /* the sidebar (navy in both modes) */
    --c-nav-text: #DDE4EE;
    --c-nav-muted: #A9B6C9;
    --c-nav-tag: #F08C86;
    --c-nav-line: rgba(255, 255, 255, 0.10);
    --c-nav-line-strong: rgba(255, 255, 255, 0.18);
    --c-nav-hover: rgba(255, 255, 255, 0.08);
    --c-nav-active: rgba(255, 255, 255, 0.14);
    --c-nav-focus: #8FB8F5;
    --c-on-navy-ok: #6FD39B;       /* status text on a navy band (both modes) */
    --c-on-navy-warn: #FFD98A;
    --c-on-navy-bad: #FFB4AD;
    --c-live: #3FBF7F;             /* "clocked in / live" green on the hero card (both modes) */
    --c-red: #B3261E;              /* the brand red (fixed); --accent is the company's, red by default */
    --c-red-strong: #8C1D17;
    --c-ice: #D6E3F5;
    --c-green: #1E7A46;            /* fixed brand marks (both modes) */
    --c-amber: #E0A33A;
    --c-on-dark: #FFFFFF;          /* text on navy, red or a solid status fill (both modes) */
    --c-on-light: #10213A;         /* text on ice or white fills (both modes) */

    /* the hero card (clock box, profile / workspace headers): navy in light mode, ice-blue in dark */
    --c-hero: #10213A;
    --c-on-hero: #FFFFFF;
    --c-hero-muted: #B8C2D3;
    --c-hero-track: #2E4A75;
    --c-hero-line: rgba(255, 255, 255, 0.28);
    --c-hero-chip: rgba(255, 255, 255, 0.14);
    --c-on-hero-ok: #6FD39B;
    --c-on-hero-warn: #F2C46B;
    --c-on-hero-bad: #F7B7B2;
    --c-tab-off: transparent;
    /* personalisation (2026-10-31): set per theme in core/css/themes/<name>.css -- these are Classic's */
    --c-sidebar: #10213A;
    --c-nav-strong: #FFFFFF;       /* the sidebar's brand, active and hover text */
    --c-hero-grad: radial-gradient(120% 100% at 100% 0%, #24427A 0%, #10213A 55%, #0A1628 100%);
    --c-hero-dots: repeating-radial-gradient(circle at 115% 115%, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 16px);
    --c-hero-shadow: 0 12px 28px rgba(16, 33, 58, 0.28);
    --c-tile-edge: #1F5FBF;
    --theme-accent: #B3261E;       /* the theme's own accent: used when the person picked none */
    --accent-contrast: #FFFFFF;    /* text on an accent fill: white or near-black, per accent (themes/) */
    --c-green-strong: #17633A;     /* fixed */
    /* status chips ON the hero card: light tints in both modes (the card itself is navy or ice-blue) */
    --c-chip-ok: #17633A;      --c-chip-ok-bg: #E6F4EC;
    --c-chip-warn: #7A4F00;    --c-chip-warn-bg: #FFF1D6;
    --c-chip-bad: #8C1D17;     --c-chip-bad-bg: #FCE4E2;
    --c-chip-info: #1F4E9A;    --c-chip-info-bg: #E3ECFA;
    --c-chip-neutral: #3F4450; --c-chip-neutral-bg: #E9ECF1;

    /* surfaces and text */
    --c-bg: #EEF0F4;
    --c-surface: #FFFFFF;
    --c-surface-2: #F6F7F9;        /* insets, table headers, zebra rows */
    --c-input: #FFFFFF;
    --c-border: #E3E6EB;
    --c-border-strong: #CBD1DA;
    --c-text: #1B1D22;
    --c-muted: #5B6170;
    --c-faint: #8A919E;            /* placeholders, disabled -- never body text */
    --c-row-hover: #EEF3FB;
    --c-selected: #E3ECFA;
    --c-highlight: var(--accent);  /* the active tab's underline, the selected chip */
    --c-accent-text: var(--accent);
    --c-link: var(--accent);

    /* status: text on its tint, and a solid mark (dots, bars) */
    --c-ok: #17633A;      --c-ok-bg: #E6F4EC;      --c-ok-solid: #1E7A46;
    --c-warn: #8A5A00;    --c-warn-bg: #FFF1D6;    --c-warn-solid: #E0A33A;
    --c-bad: #8C1D17;     --c-bad-bg: #FCE4E2;     --c-bad-solid: #B3261E;
    --c-info: #1F4E9A;    --c-info-bg: #E3ECFA;    --c-info-solid: #1F5FBF;
    --c-neutral: #3F4450; --c-neutral-bg: #EEF0F3; --c-neutral-solid: #8A919E;
    --c-purple: #5B21B6;  --c-purple-bg: #EDE7FC;
    --c-teal: #0F6E6E;    --c-teal-bg: #E0F4F4;

    /* type: 14px base */
    --font-sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fs-2xs: 11px;    /* uppercase column labels */
    --fs-xs: 12px;     /* badges, help text */
    --fs-sm: 13px;     /* dense tables, form controls */
    --fs-base: 14px;
    --fs-md: 16px;     /* card / section titles */
    --fs-lg: 18px;
    --fs-xl: 22px;     /* page titles */
    --lh-base: 1.45;
    --fw-semibold: 600;

    /* spacing: 4px steps */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px;

    /* one radius, one shadow, one transition */
    --radius: 8px;
    --radius-pill: 999px;
    --shadow: 0 1px 2px rgba(16, 33, 58, 0.06), 0 2px 8px rgba(16, 33, 58, 0.06);
    --shadow-pop: 0 8px 24px rgba(16, 33, 58, 0.16);   /* menus and popovers only */
    --focus-ring: 0 0 0 3px rgba(31, 95, 191, 0.28);
    --ease: 120ms ease;
}

/* dark: the same names. Applied for the dark themes (Tech, Midnight -- each then sets its own surfaces in
   core/css/themes/), or an OS-dark device on a page with no theme (nobody signed in) -- the two blocks carry
   identical declarations; keep them in sync. */
:root[data-mode="dark"] {
    --c-hero: #D6E3F5;
    --c-on-hero: #10213A;
    --c-hero-muted: #4A5B72;
    --c-hero-track: #B9CBE3;
    --c-hero-line: #8FA5C2;
    --c-hero-chip: rgba(16, 33, 58, 0.10);
    --c-on-hero-ok: #17633A;
    --c-on-hero-warn: #8A5A00;
    --c-on-hero-bad: #8C1D17;
    --c-tab-off: #273040;
    --c-bg: #080B10;
    --c-surface: #1B222D;
    --c-surface-2: #151B24;
    --c-input: #121821;
    --c-border: #3B4556;
    --c-border-strong: #475468;
    --c-text: #EEF1F5;
    --c-muted: #A9B1BE;
    --c-faint: #7C8594;
    --c-row-hover: #202A3A;
    --c-selected: #1B2433;
    --c-highlight: var(--c-ice);
    --c-accent-text: #F08C86;
    --c-link: #F08C86;
    --c-ok: #6FD39B;      --c-ok-bg: #163A26;      --c-ok-solid: #3FBF7F;
    --c-warn: #F2C46B;    --c-warn-bg: #3A2C10;    --c-warn-solid: #E0A33A;
    --c-bad: #F08C86;     --c-bad-bg: #3B1715;     --c-bad-solid: #E0574E;
    --c-info: #8FB8F5;    --c-info-bg: #172A4A;    --c-info-solid: #8FB8F5;
    --c-neutral: #C3C9D2; --c-neutral-bg: #2C313B; --c-neutral-solid: #7C8594;
    --c-purple: #CDBEFB;  --c-purple-bg: #33295A;
    --c-teal: #6FD1CF;    --c-teal-bg: #123A3A;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.14);
    --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.6);
    --focus-ring: 0 0 0 3px rgba(214, 227, 245, 0.35);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --c-hero: #D6E3F5;
        --c-on-hero: #10213A;
        --c-hero-muted: #4A5B72;
        --c-hero-track: #B9CBE3;
        --c-hero-line: #8FA5C2;
        --c-hero-chip: rgba(16, 33, 58, 0.10);
        --c-on-hero-ok: #17633A;
        --c-on-hero-warn: #8A5A00;
        --c-on-hero-bad: #8C1D17;
        --c-tab-off: #273040;
        --c-bg: #080B10;
        --c-surface: #1B222D;
        --c-surface-2: #151B24;
        --c-input: #121821;
        --c-border: #3B4556;
        --c-border-strong: #475468;
        --c-text: #EEF1F5;
        --c-muted: #A9B1BE;
        --c-faint: #7C8594;
        --c-row-hover: #202A3A;
        --c-selected: #1B2433;
        --c-highlight: var(--c-ice);
        --c-accent-text: #F08C86;
        --c-link: #F08C86;
        --c-ok: #6FD39B;      --c-ok-bg: #163A26;      --c-ok-solid: #3FBF7F;
        --c-warn: #F2C46B;    --c-warn-bg: #3A2C10;    --c-warn-solid: #E0A33A;
        --c-bad: #F08C86;     --c-bad-bg: #3B1715;     --c-bad-solid: #E0574E;
        --c-info: #8FB8F5;    --c-info-bg: #172A4A;    --c-info-solid: #8FB8F5;
        --c-neutral: #C3C9D2; --c-neutral-bg: #2C313B; --c-neutral-solid: #7C8594;
        --c-purple: #CDBEFB;  --c-purple-bg: #33295A;
        --c-teal: #6FD1CF;    --c-teal-bg: #123A3A;
        --shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.14);
        --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.6);
        --focus-ring: 0 0 0 3px rgba(214, 227, 245, 0.35);
    }
}
