/* AryaTech brand v2 — the ONE place colours, type, spacing, radius and shadow are defined for the portal.
   Source (read-only): Arya Website/brand/BRAND_V2/BRAND.md «متغيرات CSS» + tokens.json (light theme). See docs/BRAND_V2.md.
   Section 1 is copied letter for letter from the guide. Section 2 is derived from section 1 (the recipe is in each
   comment and tests/test_brand_v2.py recomputes it). Nothing else in the portal writes a colour. */
:root {
  /* 1 ── brand tokens, verbatim ─────────────────────────────────────── */
  --navy: #1F2A4B;
  --mint: #54BAA7;
  --charcoal: #1E1E1E;
  --mint-ink: #167565;
  --mint-soft: #E0F2EE;
  --surface: #F1F2F2;
  --surface-post: #DCDCDE;
  --surface-raised: #FFFFFF;
  --surface-navy: #1F2A4B;
  --ink: #1F2A4B;
  --ink-muted: #455068;       /* owner decision 2026-10-25: darker than the guide's #4F5A73 (6.2:1 → 7.2:1 on --surface; 5.9:1 on --surface-post); synced into BRAND_V2/tokens.json 2026-11-29 */
  --on-mint: #1F2A4B;
  --on-navy: #FFFFFF;
  --line: #DDE1E6;
  --border-strong: #7A8499;
  --focus: #167565;
  --gray-shape: #CBCBCB;
  --offer: #CF5555;
  --offer-ink: #B23F3F;
  --danger: #B42318;
  --warning: #A15C07;
  --dot-grey-1: #E0E0E2;
  --dot-grey-2: #E3E3E5;
  --dot-grey-3: #E6E6E8;
  --dot-navy-1: #25315A;
  --dot-navy-2: #29355F;
  --dot-navy-3: #2D3A65;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Families as tokens.json defines them: Montserrat first, so digits and Latin letters inside Arabic text are drawn
     with Montserrat (its files are limited to the Latin range), and Arabic falls through to Alexandria / Noto Kufi. */
  --font-heading: "Montserrat", "Alexandria", system-ui, sans-serif;
  --font-body: "Montserrat", "Noto Kufi Arabic", system-ui, sans-serif;
  --font-latin: "Montserrat", system-ui, sans-serif;
  --font-accent: "Arya Dots 2", "Montserrat", sans-serif;

  /* Type styles (tokens.json → type.groups): size / line height / weight */
  --t-h1: 700 28px/38px var(--font-heading);
  --t-h2: 600 22px/32px var(--font-heading);
  --t-body: 400 17px/28px var(--font-body);
  --t-label: 500 15px/22px var(--font-heading);
  --t-caption: 400 13px/20px var(--font-body);
  --t-number-xl: 700 64px/68px var(--font-latin);
  --t-number-md: 600 24px/32px var(--font-latin);

  /* 2 ── derived from section 1 ─────────────────────────────────────── */
  --danger-soft: #F9EDED;    /* danger 8% over white  */
  --danger-line: #E5B2AE;    /* danger 35% over white */
  --warning-soft: #F7F2EB;   /* warning 8% over white  */
  --warning-line: #DEC6A8;   /* warning 35% over white */
  --mint-line: #B2E0D7;      /* mint 45% over white: decorative border of mint-soft boxes */
  --mint-hover: #4EA99C;     /* mint 88% + navy 12%: hover of the primary button (navy text stays ≥ 4.5:1) */
  --navy-hover: var(--dot-navy-3);
  --mint-ink-hover: #176A61; /* mint-ink 85% + navy 15%: hover of the office primary button (white text stays ≥ 4.5:1) */
  /* Owner's request (2026-11-24), the second approved exception: the three STATUS DOTS of a device mark (the drawing screen, the
     client's page, the PDF): red = an open missing item, yellow = an open question, green = all good. A traffic light has to be
     red, yellow and green, and no brand token is. Used only by the dot (.sv-dot in css/supervision.css, supervision/pdf.py). */
  --status-missing: #D92D20;
  --status-question: #F5B800;
  --status-ok: #188A3E;
  /* The ONE approved exception to «three fonts» (owner's decision, 2026-10-10): a monospace for sensitive literal values
     only — password, username, serial, MAC, one-time codes and keys — because Montserrat draws l, I and | alike.
     Used by a single rule (.mono in css/app.css) and by Page.literal(mono=True) in the PDF. Never for IP, dates, phone
     numbers, amounts or any other text. */
  --font-literal: "IBM Plex Mono", "Montserrat", "Noto Kufi Arabic", system-ui, monospace;
  --scrim: rgba(31, 42, 75, .45);                       /* navy at 45% behind sheets and the menu */
  --shadow-card: 0 2px 12px rgba(31, 42, 75, .08);      /* the single shadow of the guide, on v2 navy */

  /* 3 ── the app shell (docs/SHELL_PARITY.md; owner-approved «portal-app-shell-v1»): the header and the bottom bar of the
     three portals. `--bar` is the header's colour AND the colour of <html> (so the area under the status bar / Dynamic Island
     is the header's own colour), `--bar-bottom` the bottom bar's: navy header and white bar in the light scheme, one deep
     navy for both in the dark scheme. They are redefined in the dark block below. ── */
  color-scheme: light;
  --bar: var(--surface-navy);
  --bar-bottom: var(--surface-raised);
  --on-bar: #FFFFFF;
  --bar-hover: var(--dot-navy-3);
  --bar-hover-2: var(--dot-navy-2);
  --on-bar-soft: #E0F2EE;            /* secondary text on the bar (the mint-soft of the light scheme) */
  --on-bar-line: #DDE1E6;            /* placeholders and hints on the bar (the line colour of the light scheme) */
  /* Roles that must not follow the colour scheme (NOT redefined in the dark block below) */
  --pad-paper: #FFFFFF;              /* the signature pad: black ink on white paper in both schemes (it is saved as a picture) */
  --pad-ink: #1E1E1E;
  --logo-plate: #FFFFFF;             /* the logo files are navy on transparent: on dark pages they sit on this plate, never recoloured */
  /* A QR code and the printed site sticker are never inverted (docs/DESIGN_RULES_AR.md §6, audit ع11): black modules on a
     white plate with a 16px white margin, in the light scheme, the dark scheme and on paper. Not redefined in the dark block. */
  --qr-paper: #FFFFFF;
  --qr-ink: #000000;
  --sticker-ink: #1F2A4B;            /* the text of the printed sticker (navy on white paper) */
  /* Google's «G» mark on the «Continue with Google» button: the four colours of Google's own branding guidelines. They are a
     third party's, not the brand's: fixed in every scheme (the mark is never recoloured) and NOT redefined in the dark block. */
  --google-blue: #4285F4;
  --google-green: #34A853;
  --google-yellow: #FBBC05;
  --google-red: #EA4335;
}

/* Right-to-left pages (Arabic, Urdu): the order of BRAND.md («متغيرات CSS»): the Arabic font first, so the space
   between Arabic words comes from it and Montserrat is fetched only for real Latin letters and digits. Digits and
   Latin are Montserrat in both orders, because the Arabic faces are limited to the Arabic range (css/app.css). */
:root[dir="rtl"] {
  --font-heading: "Alexandria", "Montserrat", system-ui, sans-serif;
  --font-body: "Noto Kufi Arabic", "Montserrat", system-ui, sans-serif;
}

/* Dark scheme. SOURCE since 2026-11-29: the dark theme of BRAND_V2/tokens.json (My Drive/Ai/Arya Website/brand/BRAND_V2/),
   shared with the website's /manage panel; change a value there first and re-sync here. Owner decisions: 2026-10-25 dark follows the system; 2026-10-26 (app shell) a person may also choose
   «Automatic / Light / Dark» in «My settings» — the choice is saved on the account and written by the server as
   <html data-theme="light|dark">. Values are the token table of the shell's NOTES (portal-app-shell-v1): page #0F1527,
   header and bottom bar #141C33, cards #182038, border #263050, text #E6EAF2 (headings white), secondary #9AA5C0, mint text
   #6FD3BF, red #F2756B (dark text on it); «--navy» is the strong ink (it is also the fill of solid controls, whose text is
   «--on-navy»). The same declarations are written twice because CSS cannot share them between a media query and an
   attribute selector: tests/test_shell_theme.py keeps the two copies identical. The LIGHT scheme's shell values (navy
   header #1F2A4B, white bottom bar, page #F1F2F2, cards white, red) are the first block above; the designer may refine
   them there, in this one file. Contrast is computed from these values by tests/test_brand_v2.py (text >= 4.5:1,
   controls >= 3:1), exactly as for the light scheme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #0F1527;
    --surface-raised: #182038;
    --surface-post: #1F2946;
    --ink: #E6EAF2;
    --ink-muted: #9AA5C0;
    --navy: #FFFFFF;
    --on-navy: #0F1527;
    --navy-hover: #CDD5E8;
    --line: #263050;
    --border-strong: #7D88A8;
    --focus: #6FD3BF;
    --mint-ink: #6FD3BF;
    --mint-ink-hover: #5CC2AE;
    --mint-soft: #203648;
    --mint-line: #2A6A60;
    --gray-shape: #3A4466;
    --offer: #E58A8A;
    --offer-ink: #F2A0A0;
    --danger: #F2756B;
    --danger-soft: #3A1D24;
    --danger-line: #7B3B42;
    --warning: #F2B35E;
    --warning-soft: #35291A;
    --warning-line: #7C5A2B;
    --dot-grey-1: #1B2440;
    --dot-grey-2: #1E2744;
    --dot-grey-3: #212A48;
    --scrim: rgba(5, 8, 18, .65);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, .35);
    --bar: #141C33;
    --bar-bottom: #141C33;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #0F1527;
  --surface-raised: #182038;
  --surface-post: #1F2946;
  --ink: #E6EAF2;
  --ink-muted: #9AA5C0;
  --navy: #FFFFFF;
  --on-navy: #0F1527;
  --navy-hover: #CDD5E8;
  --line: #263050;
  --border-strong: #7D88A8;
  --focus: #6FD3BF;
  --mint-ink: #6FD3BF;
  --mint-ink-hover: #5CC2AE;
  --mint-soft: #203648;
  --mint-line: #2A6A60;
  --gray-shape: #3A4466;
  --offer: #E58A8A;
  --offer-ink: #F2A0A0;
  --danger: #F2756B;
  --danger-soft: #3A1D24;
  --danger-line: #7B3B42;
  --warning: #F2B35E;
  --warning-soft: #35291A;
  --warning-line: #7C5A2B;
  --dot-grey-1: #1B2440;
  --dot-grey-2: #1E2744;
  --dot-grey-3: #212A48;
  --scrim: rgba(5, 8, 18, .65);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, .35);
  --bar: #141C33;
  --bar-bottom: #141C33;
}
