/* GamingGear ERP — sizes, the text hierarchy and the parts (design system, owner's tasks of 20–21.10.2026; docs/dizain.md).
   The colours of every theme (level 2: page, card, field, raised; text 1–3; lines; accent; overdue, waiting, done; focus;
   shadows; the side menu) are computed from 4 seeds per theme in core/theme_template.py → static/themes.css (1.24).
   Level 3: names of the parts (button, field, menu, dialog, tag, top bar, toast) — they point to level 2.
   Screens and parts use only levels 2 and 3. A raw colour lives only here and in the generated themes.css (the guard). */
@layer legacy, base, components, screens;

/* ── Fixed, never themed: print is black on white ───────────────────────────────────────────────────────────── */
:root{--print-ink:#000000;--print-paper:#FFFFFF;--print-line:#000000}
/* the courier's logo sits on a white tile in every theme — a logo keeps its own colours (25.10.2026) */
:root{--logo-tile:#FFFFFF}

/* ── Level 3 · the parts ───────────────────────────────────────────────────────────────────────────────────── */
:root,[data-theme="gg"]{
  --button-primary-bg:var(--accent-fill);--button-primary-bg-hover:var(--accent-hover);--button-primary-text:var(--on-accent);
  --button-secondary-bg:var(--bg-card);--button-secondary-bg-hover:var(--bg-subtle);--button-secondary-line:var(--line-field);--button-secondary-text:var(--text);
  --button-quiet-text:var(--text-2);--button-quiet-bg-hover:var(--bg-subtle);
  --button-danger-text:var(--danger);--button-danger-line:var(--danger-line);--button-danger-bg:var(--bg-card);--button-danger-bg-hover:var(--danger-bg);
  --field-bg:var(--bg-field);--field-line:var(--line-field);--field-line-hover:var(--text-2);--field-text:var(--text);--field-placeholder:var(--text-3);
  --menu-bg:var(--bg-raised);--menu-line:var(--line-field);--menu-shadow:var(--shadow-2);
  --dialog-bg:var(--bg-raised);--dialog-line:var(--line);--dialog-shadow:var(--shadow-2);--dialog-backdrop:var(--overlay);
  --tag-bg:var(--bg-muted);--tag-text:var(--text-2);
  --topbar-bg:var(--bg-card);--topbar-line:var(--line);
  --toast-bg:var(--bg-inverse);--toast-text:var(--on-inverse);--toast-mark:var(--ok-mark);
  --shadow-1:0 1px 2px var(--shade);--shadow-2:0 12px 32px var(--shade-2);
  /* the visual package (owner, 22.10.2026; docs/dizain.md, „Визуален пакет“) */
  --button-primary-shadow:0 2px 4px var(--shade-2),0 8px 22px var(--shade-2);--button-primary-weight:700;
  /* round 2 (owner, 22.10.2026): cards with an edge and a shadow; the counters a dark round badge */
  --card-line:var(--line-card);--card-shadow:0 1px 2px var(--shade),0 6px 18px var(--shade);
  --count-bg:var(--bg-inverse);--count-text:var(--on-inverse);
  --row-hover-bg:var(--bg-row-hover);--row-hover-mark:var(--line-strong);
  --zone-bg:var(--bg-zone);
  /* the colour of a sum — one rule for the whole ERP (owner, 25.10.2026): red — the customer owes us; amber — we owe
     the customer (a return, a refund); green — settled. The same levels as overdue / waiting / done (the guards). */
  --money-owes:var(--danger);--money-owes-bg:var(--tint-red);--money-owes-line:var(--danger-line);
  --money-refund:var(--wait);--money-refund-bg:var(--tint-amber);--money-refund-line:var(--wait-line);
  --money-settled:var(--ok);--money-settled-bg:var(--ok-bg);--money-settled-line:var(--ok-line);
  /* direction B (owner, 27.10.2026; docs/dizain.md, „Посока B“): the status labels — solid, an icon and a word; red overdue,
     dark solid „Чака нас“ (never the accent), grey with an outline „Чака друг“, green done; neutral for a date or a state */
  --state-late-bg:var(--button-danger-solid-bg);--state-other-text:var(--text-2);--state-other-line:var(--line-field);
  --state-neutral-bg:var(--bg-muted);--state-neutral-text:var(--text-2);
  --mcard-line:var(--line-card);--mcard-shadow:var(--card-shadow);--mcard-neutral:var(--line-field);
}

/* ── Sizes ─────────────────────────────────────────────────────────────────────────────────────────────────── */
:root{
  --font-sans:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,'Cascadia Mono',Consolas,monospace;
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;
  /* the text hierarchy (1.24, owner 21.10.2026) — the same in every theme: page > zone > block > text > secondary */
  --type-page:28px;--type-page-weight:700;--type-page-line:1.2;
  --type-zone:24px;--type-zone-weight:700;--type-zone-line:1.3;--type-zone-space:var(--space-5);
  --type-block:18px;--type-block-weight:600;--type-block-line:1.35;--type-block-space:var(--space-2);
  --type-text:16px;--type-text-weight:400;--type-text-line:1.5;
  --type-meta:13px;--type-meta-weight:400;--type-meta-line:1.45;
  --font-page:var(--type-page);--font-section:var(--type-block);--font-body:var(--type-text);--font-meta:var(--type-meta);
  --radius-control:8px;--radius-card:12px;--radius-pill:999px;
  /* air between blocks and the row icon (visual package, 22.10.2026) */
  --gap-block:28px;--gap-zone:56px;--row-icon-box:28px;--row-icon-size:16px;--row-pad-y:14px;--zone-icon-box:40px;
  --control-h:44px;--control-h-sm:32px;
  /* the phone's bottom bar: links 48 px + 2 × 6 px + the line (1.37.1); every page keeps this space below on a phone */
  --bottom-bar-h:61px;--icon-menu-w:72px;
  --width-list:1200px;--width-record:1080px;--width-form:880px;--width-field:640px;--width-full:1720px;
  --z-base:0;--z-sticky:10;--z-nav:20;--z-menu:30;--z-overlay:40;--z-dialog:50;--z-toast:60;
}
@media(max-width:767px){:root{--type-page:24px;--type-zone:21px;--type-block:17px;--control-h:48px;--control-h-sm:40px;--gap-block:24px;--gap-zone:40px;--zone-icon-box:36px}}
/* Вид A (owner, 24.10.2026; docs/dizain.md, „Вид A“): the band's title, the large value of a card (the name, „Дължи …“,
   the shelf), the big button, the status — sizes of their own, never smaller than the page levels they stand for */
:root{--type-hero:38px;--type-value:32px;--type-money:44px;--type-shelf:52px;--type-lead:20px;--type-status:18px;--type-eyebrow:14px;
  --band-radius:20px;--info-radius:18px;--band-pad:28px;--info-pad:24px;--info-icon-box:44px;--band-button-h:64px;--topbar-h:64px}
@media(max-width:767px){:root{--type-hero:28px;--type-value:28px;--type-money:40px;--type-shelf:44px;--type-lead:19px;--type-status:16px;
  --band-radius:16px;--info-radius:16px;--band-pad:16px;--info-pad:18px;--band-button-h:60px;--topbar-h:56px}}
/* the compact list (owner, 25.10.2026): 15–20 rows on a computer screen — a row of 32 px, its text 15 px */
:root{--type-row:15px;--line-h:32px;--line-pad-y:2px;--line-button-h:26px;--tile-count:22px}
/* direction B (owner, 27.10.2026): the block's title 20 + its number 32, a row 15 bold, a number (task, case, waybill) 12 mono */
:root{--type-mcard-title:20px;--type-mcard-count:32px;--type-mrow:15px;--type-code:12px;--mcard-rail:6px;--mcard-radius:14px;
  --state-h:26px;--mrow-state-w:172px;--mrow-when-w:84px;--mrow-pad-y:10px;--src-box:22px}
@media(max-width:767px){:root{--tile-count:21px}}
/* the system's base (owner, night queue 28/29.10.2026, item 1.3; docs/design/system.md): the „Днес“ lane — the approved
   mockup of 28.10 (round 2), a part of the base only, no screen uses it yet — and the page type „Списък с детайл“ (like
   Поддръжка: the list | the record | the side panel). The radius and the shadow of a card are the ones of direction B. */
:root{--today-rail:6px;--today-pad:var(--space-5);--today-button-h:56px;--today-gap:var(--space-4);
  --split-list-w:320px;--split-side-w:280px;--split-gap:var(--space-4)}
@media(max-width:767px){:root{--today-pad:var(--space-4);--today-gap:var(--space-3)}}

/* ── Widths a theme may change (Ясна: 2 px lines, a 3 px focus, tags with a line) ──────────────────────────── */
:root,[data-theme="gg"]{--field-line-width:1px;--card-line-width:1px;--focus-width:2px;--tag-line-width:0px}

/* ── What a theme sets besides its 4 colours: Ясна's widths; Топла and Мека синя — a colour per module (1.17:
   an icon in the menu and the dashboard block titles, a thin bar on the left of the module's cards; ≥ 3:1 on cards and
   the menu — core/test_themes.py). From 27.10.2026 (owner) Задачи, Сервиз and Куриери take the colours of direction B
   (--module-*: Задачи green, Случаи violet, Пратки blue), so the menu and the cards agree. ─────────────────────────── */
[data-theme="clear"]{--focus-width:3px;--field-line-width:2px;--card-line-width:2px;--tag-line-width:1px}
[data-theme="warm"],[data-theme="soft-blue"]{--mod-service:var(--module-service);--mod-work:var(--module-work);--mod-couriers:var(--module-couriers);--mod-stock:#A21CAF;--mod-admin:#475569;--mod-bar:3px}
