/* عود — design tokens (shared with عود HR). Thmanyah Sans, RTL, Latin digits, light + dark.
   This file is the ONLY place where a colour, a text size, a corner radius or a shadow is written as a value. Every other stylesheet and
   every page uses the names below. The rules, the parts (button, card, table …) and when to use each: docs/DESIGN-SYSTEM.md.
   tests/design-system.test.mjs fails on a value that is not from here. */

:root {
  --font: 'Thmanyah', -apple-system, 'SF Arabic', 'Segoe UI', Tahoma, sans-serif;
  /* The copper-brown #965f2f on warm paper, dark-wood ink. The system has its own mark (owner 2026-11-18): /brand/acc-mark.svg, drawn by
     .acc-mark below; its app icons are /brand/acc-icon-*.png. The group's logo /brand/aud-logo.png (Arabic + "AUD COMMERCIAL GROUP") is for
     the establishment's papers only (reports, the print header). Entity colours (Cactus green, Cherry red) come from the data. */
  --bg: #f7f4ed;
  --surface: #ffffff;
  --surface-2: #f0ebe1;
  --ink: #2b2118;
  --ink-2: #5d5145;
  --muted: #6f6358;
  --line: #e2d9ca;
  --line-strong: #cfc2ad;
  --field-edge: color-mix(in srgb, var(--muted) 86%, var(--surface));
  --accent: #965f2f;        /* AUD logo copper */
  --accent-ink: #ffffff;
  --accent-soft: #f3e7da;
  --brass: #b08d57;
  --ok: #2f7a4b;   --ok-soft: #e3f1e8;
  --warn: #a8660b; --warn-soft: #fbefd9;
  --bad: #b3261e;  --bad-soft: #f9e3e1;
  --info: #2c5d8a; --info-soft: #e2edf7;
  --bad-ink: #ffffff;       /* text on a filled --bad (a badge, a danger button, the error toast) */
  --scrim: rgba(20, 14, 9, .45);  /* the dim behind a dialog, a sheet or the open menu */
  --side-w: clamp(264px, 21vw, 296px);

  /* ——— text sizes: ten, named by what they are for. Weights: 400 text, 500 labels and buttons, 700 titles and figures (no other). ——— */
  --fs-tiny: 11px;     /* a badge count, the weekday row of the calendar */
  --fs-small: 12px;    /* a pill, a hint under a field, a note under a figure */
  --fs-label: 13px;    /* the label of a field, a table heading, secondary text */
  --fs-text: 14px;     /* tables, buttons, menus, banners — the text of the interface */
  --fs-body: 15px;     /* the page's running text, what is typed in a field, the section tabs */
  --fs-lead: 16px;     /* the side menu, the title of a card, a field on a phone (iOS zooms under 16) */
  --fs-title: 18px;    /* the title of a section (h2) and of a dialog */
  --fs-figure: 20px;   /* a figure in a summary strip; the page title on a phone */
  --fs-page: 24px;     /* the page title (h1), the total of a document */
  --fs-hero: 28px;     /* the big figure of a counter card */

  /* ——— corners: six ——— */
  --radius-xs: 6px;    /* a small thing inside another: a code chip, a file button, the fold arrow */
  --radius-sm: 9px;    /* what is pressed or typed in: buttons, fields, menu rows */
  --radius-md: 12px;   /* a box inside a card: a banner, a table frame, the top-bar buttons */
  --radius-lg: 14px;   /* a card, a menu that opens, a dialog */
  --radius-xl: 20px;   /* the sheet that rises from the bottom of a phone */
  --radius-pill: 999px; /* pills, chips, the toast; a circle is 50% */

  /* ——— spacing: gap, padding and margin take only 0 1 2 4 6 8 10 12 14 16 20 24 28 32 40 48 64 px (written as numbers, checked by the test) ——— */

  /* ——— shadows: how far a thing stands off the page ——— */
  --shadow: 0 1px 2px rgba(43, 33, 24, .06), 0 6px 24px rgba(43, 33, 24, .06);          /* a card */
  --shadow-raise: 0 1px 2px rgba(43, 33, 24, .12);                                       /* the chosen half of a two-way switch */
  --shadow-pop: var(--shadow), 0 12px 40px rgba(0, 0, 0, .12);                           /* a menu, the calendar, a search list */
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, .25);                                        /* a dialog */
  --shadow-bar: 0 -4px 18px rgba(43, 33, 24, .06);                                       /* the bar at the bottom of a phone */
  --shadow-sheet: 0 -10px 40px rgba(20, 14, 9, .22);                                     /* the sheet that rises over the page */
  --focus: 0 0 0 3px var(--accent);
  color-scheme: light;
}
/* Dark (owner 2026-11-15: the brown one was gloomy): warm charcoal, the copper stays. An alert is a calm surface with a coloured edge and
   title, not a slab of colour: the --alert-* values exist only here, so light mode keeps its soft fills (app.css .banner). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1a19; --surface: #252322; --surface-2: #2e2c2a; --ink: #f1ede7; --ink-2: #cdc6bd; --muted: #9c958c;
    --line: #383533; --line-strong: #4a4643; --accent: #d6a06a; --accent-ink: #1b140f; --accent-soft: #3a2f25; --brass: #d0ab72;
    --ok: #7fcf9f; --ok-soft: #20302a; --warn: #e9b461; --warn-soft: #33291a; --bad: #f08a80; --bad-soft: #382321; --info: #86b7e3; --info-soft: #1f2b38; --bad-ink: #1b140f;
    --alert-bg: var(--surface); --alert-ink: var(--ink-2); --alert-edge: 4px; --alert-line: 1px; --line-warn: var(--line);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1a19; --surface: #252322; --surface-2: #2e2c2a; --ink: #f1ede7; --ink-2: #cdc6bd; --muted: #9c958c;
  --line: #383533; --line-strong: #4a4643; --accent: #d6a06a; --accent-ink: #1b140f; --accent-soft: #3a2f25; --brass: #d0ab72;
  --ok: #7fcf9f; --ok-soft: #20302a; --warn: #e9b461; --warn-soft: #33291a; --bad: #f08a80; --bad-soft: #382321; --info: #86b7e3; --info-soft: #1f2b38; --bad-ink: #1b140f;
  --alert-bg: var(--surface); --alert-ink: var(--ink-2); --alert-edge: 4px; --alert-line: 1px; --line-warn: var(--line);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35); color-scheme: dark;
}
* { box-sizing: border-box; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--fs-body); line-height: 1.6;
  -webkit-text-size-adjust: 100%; font-variant-numeric: lining-nums tabular-nums; }

/* One arrow for everything that folds (menus, filters, long notes, lists): a drawn chevron in the text's colour, not the letter «▾»,
   which every font draws at its own tiny size (owner 2026-11-17). `.up`, or a parent that says it is open, turns it. */
:root { --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.chev, .menu-caret, .export-caret { display: inline-block; flex: none; width: 14px; height: 14px; vertical-align: -2px; background: currentColor; opacity: .8;
  -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat; transition: transform .15s; }
.chev.up, .menu-caret.up, [aria-expanded="true"] > .menu-caret, [aria-expanded="true"] > .export-caret { transform: rotate(180deg); }
.pill .chev { width: 12px; height: 12px; }
@media screen and (max-width: 900px) { .chev, .menu-caret, .export-caret { width: 16px; height: 16px; vertical-align: -3px; } .pill .chev { width: 13px; height: 13px; vertical-align: -2px; } }

/* The mark of «نظام عود المحاسبي» — the system's own logo, not the group's (owner 2026-11-18). A mask, so it takes the theme's copper:
   <span class="acc-mark" role="img" aria-label="…"></span>, sized by its height. Beside it the name is set in the app's font, weight 500. */
.acc-mark { display: inline-block; flex: none; height: 48px; aspect-ratio: 1806 / 2277; background: var(--accent);
  -webkit-mask: url("/brand/acc-mark.svg") center / contain no-repeat; mask: url("/brand/acc-mark.svg") center / contain no-repeat; }
