/*
 * CMS tokens: every raw colour, corner, shadow, size and timing the CMS uses,
 * in two moods. :root is the day; :root[data-mood="night"] overrides the
 * colours for the night. The only CMS stylesheet allowed hex codes, rgba() or
 * raw px/ms in border-radius, box-shadow and transition (UiConventionTest).
 * TokensContrastTest holds the text pairs below to 4.5 : 1 in both moods.
 */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 800; font-display: swap; src: url('../../assets/fonts/inter/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 800; font-display: swap; src: url('../../assets/fonts/inter/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Brand */
    --c-navy: #0C385E;
    --c-navy-2: #0A2F50;
    --c-brand: #258BF5;
    --c-sky: #16B4EC;
    --c-action: #1F6FD1;
    --c-action-hover: #1A5FB4;
    --c-primary: #1F6FD1;
    --c-primary-hover: #1A5FB4;
    --sh-primary: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 8px 20px rgba(31, 111, 209, .35);
    --c-band-1: #16B4EC;
    --c-band-2: #2489E0;
    --c-band-3: #2F6FD0;
    --band: linear-gradient(100deg, var(--c-band-1) 0%, var(--c-band-2) 55%, var(--c-band-3) 100%);

    /* Text */
    --c-ink: #16202B;
    --c-muted: #5B6B7B;
    --c-faint: #94A3B3;
    --c-title: #0C385E;
    --c-on-dark: #FFFFFF;
    --c-on-dark-muted: #CFDCEB;
    --c-on-dark-faint: #8FA6BF;

    /* Page: the wash behind every page, the photo behind the dashboard */
    --c-page: #F0F4F9;
    --c-wash: radial-gradient(900px 420px at 8% -10%, rgba(22, 180, 236, .32), transparent 60%), radial-gradient(800px 380px at 95% 0%, rgba(37, 139, 245, .26), transparent 60%), linear-gradient(180deg, #EAF2FB 0%, #F6F8FB 100%);
    --photo: url('../../assets/mining-site-images/landscape-trucks.webp');
    --photo-wash: linear-gradient(180deg, rgba(226, 237, 250, .22) 0%, rgba(236, 243, 250, .58) 30%, rgba(244, 247, 251, .93) 56%, rgba(246, 248, 251, .99) 100%);
    --photo-filter: saturate(1.05);
    --photo-wash-soft: radial-gradient(900px 420px at 8% -10%, rgba(22, 180, 236, .30), transparent 60%), radial-gradient(800px 380px at 95% 0%, rgba(37, 139, 245, .24), transparent 60%), linear-gradient(180deg, rgba(234, 242, 251, .90) 0%, rgba(246, 248, 251, .95) 100%);
    --photo-wash-tv: var(--photo-wash);
    --glow-accent: none; --glow-text: none; --glow-ok: none; --ring-logo: none; --glow-arc: none;

    /* Surfaces */
    --c-surface: #FFFFFF;
    --c-surface-flat: rgba(255, 255, 255, .74);
    --c-surface-solid: #FFFFFF;
    --c-surface-glass: rgba(255, 255, 255, .62);
    --c-surface-strong: rgba(255, 255, 255, .88);
    --c-subtle: #F8FAFC;
    --c-edge: rgba(255, 255, 255, .95);
    --c-line: rgba(12, 56, 94, .10);
    --c-line-strong: rgba(12, 56, 94, .18);
    --c-hover: rgba(255, 255, 255, .55);
    --c-row-hover: #F3F8FF;
    --c-input: rgba(255, 255, 255, .62);
    --c-kbd: rgba(255, 255, 255, .85);
    --c-side: rgba(255, 255, 255, .44);
    --c-topbar: rgba(255, 255, 255, .52);
    --c-active-bg: rgba(255, 255, 255, .88);
    --c-active-fg: #0C385E;
    --c-active-ic: #1F6FD1;
    --c-active-bar: transparent;
    --c-scrim: rgba(8, 20, 36, .32);
    --scrim: rgba(8, 20, 36, .32);
    --c-danger: #C2455F;
    --c-danger-soft: #FDF0F2;
    --c-danger-line: #F1C7D0;

    /* Status tones: text on background, each pair at least 4.5 : 1 */
    --tone-ok-fg: #157A5A;   --tone-ok-bg: #E2F5EE;
    --tone-bad-fg: #A3324B;  --tone-bad-bg: #FBE6EA;
    --tone-wait-fg: #9A5B0B; --tone-wait-bg: #FCF0DF;
    --tone-info-fg: #1A63B8; --tone-info-bg: #E3EFFD;
    --tone-idle-fg: #4B5B6B; --tone-idle-bg: #EEF2F6;

    /* Stockyards on the live site view: the one colour only yards use */
    --c-yard: #C2410C; --c-yard-bg: #FDEBE0;

    /* Glass over the band (the top bar until the shell task) */
    --glass-bg: rgba(10, 47, 80, .18);
    --glass-strong: rgba(10, 47, 80, .26);
    --glass-edge: rgba(255, 255, 255, .34);
    --glass-blur: 16px;
    --glass-fallback: rgba(10, 47, 80, .55);
    --glass-input-bg: rgba(255, 255, 255, .14);
    --glass-input-edge: rgba(255, 255, 255, .30);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .35);

    /* Sidebar (the navy sidebar until the shell task) */
    --side-hover: rgba(255, 255, 255, .08);
    --side-active: rgba(255, 255, 255, .12);
    --side-active-edge: inset 0 0 0 1px rgba(255, 255, 255, .18);
    --side-divider: rgba(255, 255, 255, .08);

    /* KPI tile fills (the dashboard until the surfaces task) */
    --fill-blue: linear-gradient(135deg, #4A9CF6 0%, #1F5FBF 100%);
    --fill-green: linear-gradient(135deg, #3CC68A 0%, #1D8A5C 100%);
    --fill-red: linear-gradient(135deg, #EC6A7A 0%, #B4283C 100%);
    --fill-amber: linear-gradient(135deg, #F7B84B 0%, #DD7A12 100%);
    --fill-purple: linear-gradient(135deg, #9B7AF2 0%, #5B3CC4 100%);
    --fill-teal: linear-gradient(135deg, #3CC7D6 0%, #157F8F 100%);
    --fill-grey: linear-gradient(135deg, #95A1AD 0%, #5D6975 100%);
    --fill-text-soft: rgba(255, 255, 255, .85);
    --c-chip-count-bg: rgba(31, 116, 214, .12);
    --c-chip-count-on-active: rgba(255, 255, 255, .25);

    /* Type */
    --fs-title: 22px;
    --lh-title: 28px;
    --fs-card-title: 14px;
    --fs-body: 14px;
    --lh-body: 21px;
    --fs-small: 12px;
    --fs-label: 13px;
    --fs-kpi: 30px;
    --fs-kpi-list: 24px;
    --w-reg: 400;
    --w-med: 500;
    --w-semi: 600;
    --w-bold: 700;

    /* Space */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

    /* Corners */
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-ctl: 10px;
    --r-card: 14px;
    --r-tile: 18px;
    --r-pill: 999px;
    --r-round: 50%;

    /* Blur: only the shell, the dashboard tiles and the pops blur what is behind them */
    --blur-shell: 26px;
    --blur-tile: 22px;
    --blur-pop: 24px;

    /* Depth */
    --sh-glass: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 14px 36px rgba(12, 56, 94, .09);
    --sh-glass-hover: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 22px 48px rgba(12, 56, 94, .14);
    --sh-pop: 0 30px 80px rgba(0, 0, 0, .35);
    --sh-soft: 0 1px 2px rgba(12, 56, 94, .06);
    --sh-card: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 14px 36px rgba(12, 56, 94, .09);
    --sh-raised: 0 14px 36px rgba(12, 56, 94, .18);
    --sh-button: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 8px 20px rgba(31, 111, 209, .35);
    --sh-pill: 0 4px 14px rgba(8, 40, 80, .18);
    --ring-avatar: 0 0 0 2px var(--c-surface), 0 0 0 3px var(--c-line);
    --ring-avatar-lg: 0 0 0 4px var(--c-surface), 0 2px 10px rgba(12, 56, 94, .18);
    --ring-notify: 0 0 0 2px rgba(255, 255, 255, .6);
    --ring-live: 0 0 0 0 rgba(61, 220, 151, .55);
    --ring-live-out: 0 0 0 9px rgba(61, 220, 151, 0);
    --sh-side-active: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 6px 18px rgba(12, 56, 94, .10);

    /* Controls */
    --h-control: 40px;
    --h-compact: 32px;
    --h-large: 48px;
    --pad-row: 9px;
    --focus-ring: 0 0 0 3px rgba(31, 111, 209, .18);
    --focus-outline: rgba(37, 139, 245, .45);

    /* Motion */
    --t-fast: 120ms;
    --t-base: 180ms;
    --t-slow: 260ms;
    --t-rise: 520ms;
    --t-stagger: 70ms;
    --t-ring: 900ms;
    --t-exit: 180ms;
    --t-vt-out: 200ms;
    --t-vt-in: 320ms;
    --t-drift: 50s;
    --t-toast-life: 4s;
    --t-live: 1.8s;
    --ease: cubic-bezier(.2, .8, .2, 1);
    /* Chart series, in the order a chart hands them out */
    --chart-1: #1F6FD1; --chart-2: #16B4EC; --chart-3: #2FA77E; --chart-4: #E29A2E; --chart-5: #C2455F; --chart-6: #8A97A6;
}

/* ── Compact density: tighter controls, rows, cards and type; no colour changes ── */
:root[data-density="compact"] {
    --h-control: 34px;
    --h-compact: 28px;
    --h-large: 42px;
    --pad-row: 5px;
    --fs-title: 20px;
    --fs-card-title: 13px;
    --fs-body: 13px;
    --fs-label: 12.5px;
    --fs-kpi: 26px;
    --fs-kpi-list: 20px;
    --s-3: 10px; --s-4: 12px; --s-5: 16px; --s-6: 20px; --s-8: 26px; --s-10: 32px;
}

:root[data-mood="night"] {
    color-scheme: dark;

    /* Brand on dark: links lighten, the primary button keeps its blue under white text */
    --c-action: #5AB0FF;
    --c-action-hover: #7CC0FF;
    --c-primary: #1F6FD1;
    --c-primary-hover: #2A7FE0;
    --sh-primary: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 24px rgba(37, 139, 245, .45);

    /* Text */
    --c-ink: #E6EDF6;
    --c-muted: #8EA0B8;
    --c-faint: #6E7F96;
    --c-title: #FFFFFF;

    /* Page */
    --c-page: #0B1220;
    --c-wash: radial-gradient(900px 500px at 0% 0%, rgba(37, 139, 245, .22), transparent 60%), radial-gradient(700px 400px at 100% 10%, rgba(22, 180, 236, .12), transparent 55%), linear-gradient(180deg, #0B1220 0%, #0B1220 100%);
    --photo-wash: linear-gradient(180deg, rgba(11, 18, 32, .42) 0%, rgba(11, 18, 32, .72) 30%, rgba(11, 18, 32, .95) 56%, rgba(11, 18, 32, .99) 100%);
    --photo-filter: saturate(.75) brightness(.75);
    --photo-wash-soft: radial-gradient(900px 500px at 0% 0%, rgba(37, 139, 245, .20), transparent 60%), radial-gradient(700px 400px at 100% 10%, rgba(22, 180, 236, .10), transparent 55%), linear-gradient(180deg, rgba(11, 18, 32, .90) 0%, rgba(11, 18, 32, .95) 100%);
    --photo-wash-tv: linear-gradient(180deg, rgba(11, 21, 39, .66) 0%, rgba(11, 21, 39, .84) 55%, rgba(11, 21, 39, .94) 100%);
    --glow-accent: 0 0 12px rgba(61, 210, 255, .45); --glow-text: 0 0 28px rgba(61, 210, 255, .35); --glow-ok: 0 0 10px rgba(95, 211, 166, .65); --ring-logo: 0 0 0 4px rgba(94, 163, 255, .25); --glow-arc: drop-shadow(0 0 6px rgba(61, 210, 255, .55));

    /* Surfaces */
    --c-surface: #121C2E;
    --c-surface-flat: rgba(17, 27, 46, .78);
    --c-surface-solid: #111B2E;
    --c-surface-glass: rgba(16, 26, 44, .60);
    --c-surface-strong: rgba(24, 36, 58, .90);
    --c-subtle: #16233A;
    --c-edge: rgba(255, 255, 255, .10);
    --c-line: rgba(255, 255, 255, .08);
    --c-line-strong: rgba(255, 255, 255, .16);
    --c-hover: rgba(255, 255, 255, .06);
    --c-row-hover: #16233A;
    --c-input: rgba(255, 255, 255, .06);
    --c-kbd: rgba(255, 255, 255, .08);
    --c-side: rgba(9, 16, 29, .66);
    --c-topbar: rgba(11, 18, 32, .62);
    --c-active-bg: rgba(37, 139, 245, .18);
    --c-active-fg: #FFFFFF;
    --c-active-ic: #5AB0FF;
    --c-active-bar: #2F9BFF;
    --c-scrim: rgba(3, 8, 16, .5);
    --scrim: rgba(3, 8, 16, .5);
    --c-danger: #FF6B8A;
    --c-danger-soft: rgba(255, 107, 138, .14);
    --c-danger-line: rgba(255, 107, 138, .40);

    /* Status tones on the night surface */
    --tone-ok-fg: #3DDC97;   --tone-ok-bg: rgba(61, 220, 151, .14);
    --tone-bad-fg: #FF6B8A;  --tone-bad-bg: rgba(255, 107, 138, .16);
    --tone-wait-fg: #FFB547; --tone-wait-bg: rgba(255, 181, 71, .16);
    --tone-info-fg: #5AB0FF; --tone-info-bg: rgba(90, 176, 255, .16);
    --tone-idle-fg: #9AA8B8; --tone-idle-bg: rgba(255, 255, 255, .08);
    --c-yard: #FF7A45; --c-yard-bg: rgba(255, 122, 69, .16);
    --c-chip-count-bg: rgba(90, 176, 255, .18);

    /* Depth */
    --sh-glass: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 20px 40px rgba(0, 0, 0, .35);
    --sh-glass-hover: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 0 0 1px rgba(37, 139, 245, .2), 0 24px 48px rgba(0, 0, 0, .4);
    --sh-soft: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-card: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 20px 40px rgba(0, 0, 0, .35);
    --sh-raised: 0 20px 40px rgba(0, 0, 0, .45);
    --sh-pill: 0 4px 14px rgba(0, 0, 0, .35);
    --ring-avatar-lg: 0 0 0 4px var(--c-surface), 0 2px 10px rgba(0, 0, 0, .4);
    --sh-side-active: inset 2px 0 0 #2F9BFF, 0 0 24px rgba(37, 139, 245, .18);
    --focus-ring: 0 0 0 3px rgba(90, 176, 255, .25);
    --focus-outline: rgba(90, 176, 255, .6);
    /* Chart series, in the order a chart hands them out */
    --chart-1: #5EA3FF; --chart-2: #3DD2FF; --chart-3: #5FD3A6; --chart-4: #F2BE63; --chart-5: #F08AA0; --chart-6: #7C8CA0;
}
