/*
  Direct Service Transportation — design tokens (step 7).
  Source: the approved step 6 board (docs/step6/index.html), direction A · Ledger with C's saved views, filter row, Ctrl+K bar and density switch.
  Brand per PRD UX-06 / UX-07: primary teal, Cairo + Inter (owner decision of 12 Nov 2026). Every colour pair used for text meets WCAG 2.1 AA (4.5:1) on
  its background; see docs/step7/Design_System.md for the contrast table.
  Themes (DT-244): light (below) and dark ([data-theme="dark"], at the end), both from the company website's palette (directservicetech.com:
  light = its light theme, the same values as before; dark = its dark theme, petrol lightened for text and darkened for filled buttons to
  reach AA). Pages and components use these tokens only — never a colour of their own. Printing always uses the light tokens.
*/
:root {
  color-scheme: light;

  /* ---- colour: brand */
  --primary: #0F4C5C;          /* links, active tabs, focus, accents */
  --primary-dark: #0A3540;
  --primary-hover: #0C3F4D;
  --primary-fill: var(--primary);   /* filled buttons and switches, with --on-primary text */
  --on-primary: #FFFFFF;
  --tint: #E4EDEE;
  --on-tint: var(--primary-dark);   /* text of selected chips and brand badges on --tint */
  --focus-ring: rgba(15, 76, 92, .22);

  /* ---- colour: neutrals */
  --text: #171A1C;
  --muted: #5B6570;
  --placeholder: #6B757D;      /* 4.7:1 on white (the board's #8A949C was 3.1:1) */
  --page: #F6F8F7;
  --surface: #FFFFFF;
  --surface-sunk: #F4F6F6;     /* read-only inputs */
  --surface-head: #F1F5F5;     /* table headers */
  --surface-foot: #F8FAFA;     /* table totals */
  --surface-filter: #FBFCFC;   /* filter row, command bar */
  --surface-group: #F6F9F9;    /* grouped table rows */
  --surface-mute: #EEF1F0;     /* muted badges, bars, lock banner */
  --border: #E3E7E6;
  --border-control: #CDD5D3;   /* buttons, chips, command bar (identified by their text) */
  --border-input: #8A9592;     /* text fields, selects, toggles off: 3.09:1 on white (WCAG 1.4.11; the board's #CDD5D3 was 1.5:1) */
  --line-strong: #CBD3D1;
  --skeleton-a: #ECF0EF;
  --skeleton-b: #F5F7F7;
  --live-row: #FFF9E8;         /* a row changed by another user (UX-20) */

  /* ---- colour: semantic (text / background / border) */
  --ok: #1D6B45;   --ok-bg: #E3F2EA;   --ok-line: #B9DCC8;
  --warn: #8A5300; --warn-bg: #FFF2D6; --warn-line: #F1D9A6;
  --err: #B42318;  --err-bg: #FDECEA;  --err-line: #F0B8B1; --err-input: #FFFBFA; --danger-line: #E7B4AE;
  --info: #1D5C9E; --info-bg: #E7F0FA; --info-line: #C3D7EE;
  --err-fill: var(--err);      /* filled danger buttons, error toasts, unread count — white text */
  --chart-amber: #B26A10;      /* expenses / warnings in the dashboard charts (bars, not text) */
  --stamp: rgba(180, 35, 24, .18);
  --doc-bg: #FFFFFF;           /* always white in both themes: printed documents and their previews, QR codes */

  /* ---- colour: side menu (dark in both themes) */
  --side-bg: var(--primary-dark);
  --side-bg-provider: #1E2A2E;
  --side-text: #DCE7E9;
  --side-group: #C3D5D9;
  --side-foot: #9FB8BD;
  --side-strong: #FFFFFF;      /* open section, current entry, brand */
  --side-mark: #FFFFFF;        /* the current entry's inline-start bar */
  --side-line: rgba(255, 255, 255, .12);
  --side-current: rgba(255, 255, 255, .12);
  --side-hover: rgba(255, 255, 255, .06);
  --side-press: rgba(255, 255, 255, .08);
  --side-scroll: rgba(255, 255, 255, .25);

  /* ---- colour: toasts and the account pages' brand panel */
  --toast-bg: var(--primary-dark);
  --toast-text: #FFFFFF;
  --toast-link: #BFE0E6;
  --brand-panel: var(--primary-dark);
  --brand-panel-text: #DCE7E9;

  /* ---- typography */
  --font-ar: "Cairo", "Inter", "Segoe UI", Tahoma, system-ui, sans-serif;   /* the ONE place of the Arabic family for every screen */
  --font-en: "Inter", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-num: "Inter", "Segoe UI", Tahoma, system-ui, sans-serif;
  --fs-xs: 11.5px;   /* sources, footnotes */
  --fs-sm: 12.5px;   /* labels, table headers, crumbs, badges */
  --fs-md: 13.5px;   /* controls, table cells, body of boxes */
  --fs-base: 14px;   /* body */
  --fs-lg: 15px;     /* dialog titles, grand totals */
  --fs-xl: 16px;     /* empty-state titles */
  --fs-title: 18px;  /* page titles */
  --fs-fig: 17px;    /* figure values */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh: 1.5;

  /* ---- spacing (4 px base; the board's 6/10/14 steps kept where the layout needs them) */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 6px;
  --sp-4: 8px;
  --sp-5: 10px;
  --sp-6: 12px;
  --sp-7: 14px;
  --sp-8: 16px;
  --sp-10: 20px;
  --sp-12: 24px;

  /* ---- shape */
  --r: 3px;          /* controls, boxes, badges (Ledger: square-ish) */
  --r-lg: 4px;       /* dialogs, toasts */
  --r-pill: 10px;    /* toggles */
  --bw: 1px;

  /* ---- elevation (only floating layers have shadows) */
  --shadow-dropdown: 0 8px 24px rgba(10, 53, 64, .16);
  --shadow-panel: -6px 0 24px rgba(10, 53, 64, .12);
  --shadow-toast: 0 6px 20px rgba(10, 53, 64, .25);
  --shadow-dialog: 0 12px 40px rgba(10, 30, 36, .3);
  --shadow-panel-ltr: 6px 0 24px rgba(10, 53, 64, .12);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .25);
  --scrim: rgba(10, 30, 36, .32);

  /* ---- motion */
  --dur-fast: .15s;
  --dur-live: 1s;
  --dur-skeleton: 1.4s;
  --ease: ease;

  /* ---- layers */
  --z-sticky: 1;
  --z-input-expanded: 6;
  --z-dropdown: 7;
  --z-panel: 12;
  --z-scrim: 15;
  --z-toast: 20;

  /* ---- layout */
  --side-w: 224px;
  --side-w-mini: 60px;   /* collapsed side menu: icons only (DT-236) */
  --top-h: 46px;
  --cmdk-w: 360px;
  --dialog-w: 480px;
  --panel-w: 360px;

  /* ---- rows and controls (DT-244: the former "comfortable" density is the only one) */
  --row: 40px;
  --ctl: 36px;
  --fs: 14.5px;
  --ic: 17px;
}

/*
  Dark theme (DT-244). <html data-theme> is "light" or "dark": "Follow device" is resolved by ui.js (and the inline script in App.razor
  before the first paint) from prefers-color-scheme. Base from the website's dark theme: --bg #0B1416 → page, --paper #101B1E → surfaces
  and side menu, --ink #EEF3F3 → text, --muted #A6B4B6 → muted, --line #223034 → borders, --petrol #17869B → lightened to #4FB8CC for
  text and accents (the site's petrol is 4.1–4.4:1 on its dark backgrounds) and darkened to #147A8C for filled buttons (white 5.0:1).
  Screen only: printing and print previews stay light.
*/
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;

    --primary: #4FB8CC;
    --primary-dark: #0A3540;
    --primary-hover: #0F6475;
    --primary-fill: #147A8C;
    --on-primary: #FFFFFF;
    --tint: #123940;
    --on-tint: #A8DFE8;
    --focus-ring: rgba(79, 184, 204, .4);

    --text: #EEF3F3;
    --muted: #A6B4B6;
    --placeholder: #849598;
    --page: #0B1416;
    --surface: #101B1E;
    --surface-sunk: #0D171A;
    --surface-head: #142225;
    --surface-foot: #132124;
    --surface-filter: #17282C;
    --surface-group: #15262A;
    --surface-mute: #1C2E32;
    --border: #223034;
    --border-control: #3A5056;
    --border-input: #6A8086;
    --line-strong: #2E4146;
    --skeleton-a: #16252A;
    --skeleton-b: #1D3034;
    --live-row: #2B2614;

    --ok: #5DCB91;   --ok-bg: #0F2A1E;   --ok-line: #1F5138;
    --warn: #E9B455; --warn-bg: #2B2110; --warn-line: #5A4419;
    --err: #F4877D;  --err-bg: #2E1614;  --err-line: #5F2A25; --err-input: #1E1413; --danger-line: #6B302A;
    --info: #86BCF0; --info-bg: #0F2238; --info-line: #234A73;
    --err-fill: #B42318;
    --chart-amber: #E09A3A;
    --stamp: rgba(244, 135, 125, .22);

    --side-bg: #101B1E;
    --side-bg-provider: #161E21;
    --side-line: #223034;
    --side-current: #17343B;
    --side-mark: #4FB8CC;

    --toast-bg: #1F3A41;
    --toast-link: #A8DFE8;

    --shadow-dropdown: 0 8px 24px rgba(0, 0, 0, .5);
    --shadow-panel: -6px 0 24px rgba(0, 0, 0, .45);
    --shadow-panel-ltr: 6px 0 24px rgba(0, 0, 0, .45);
    --shadow-toast: 0 6px 20px rgba(0, 0, 0, .55);
    --shadow-dialog: 0 12px 40px rgba(0, 0, 0, .6);
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, .6);
    --scrim: rgba(0, 0, 0, .6);
  }
}
