/*
 * Mizban UI contract — design tokens
 * ----------------------------------
 * Source of truth: Figma file "Mizban"
 *   https://www.figma.com/design/u2AnLMYEbahqNbuKNuxlb6/Mizban?node-id=0-1
 *   fileKey u2AnLMYEbahqNbuKNuxlb6, Page 1 (0:1)
 * Extracted 2026-11-10. Contract and usage rules: docs/UI.md
 *
 * IN USE: the Mizban shell landed (phase 2, 2026-11-10). This file is linked
 * before app.css in templates/fragments/layout.html, login.html and error.html.
 * app.css must only reference these variables.
 *
 * Sources:
 *   [var]  = formal Figma variable (collection "color"), read with get_variable_defs.
 *            Figma "color/bg-page" -> CSS "--color-bg-page".
 *   [m:ID] = measured from that Figma node via get_design_context (no Figma variable exists).
 * If you need a value that is not here, measure it from Figma and add it here first,
 * with its source. Never invent values in templates.
 */

:root {
  /* ===== Colour: surfaces [var] ===== */
  --color-bg-page:      #f4f4f5; /* [var] color/bg-page — app canvas behind panes/cards */
  --color-bg:           #ffffff; /* [var] color/bg — cards, panels, list panes, active nav item */
  --color-bg-subtle:    #fafafa; /* [var] color/bg-subtle — nav pane, pane/panel footers, icon tiles, example box */
  --color-field:        #f4f4f5; /* [var] color/field — inputs, search, segmented track, tags (same hex as bg-page) */
  --color-secondary:    #ebebed; /* [var] color/secondary — avatar circle, progress-bar track */

  /* ===== Colour: text [var] ===== */
  --color-text:         #121214; /* [var] color/text — primary text, titles, numbers */
  --color-text-2:       #48484d; /* [var] color/text-2 — secondary body, labels, inactive nav items */
  --color-text-muted:   #71717a; /* [var] color/text-muted — meta, captions, counts */
  --color-placeholder:  #a1a1aa; /* [var] color/placeholder — placeholders, section labels, empty hints */

  /* ===== Colour: borders [var] ===== */
  --color-border:        #e4e4e7; /* [var] color/border — 1px card/pane borders, dividers */
  --color-border-strong: #c7c7cc; /* [var] color/border-strong — unchecked checkbox outline */

  /* ===== Colour: actions [var] ===== */
  --color-primary:      #121214; /* [var] color/primary — primary button fill, active tab underline */
  --color-on-primary:   #ffffff; /* [var] color/on-primary — text/icon on primary or brand fill */
  --color-info:         #2563eb; /* [var] color/info — text links/actions ("نمایش", "دیدن منو"), info chip text */
  --color-info-soft:    #eef2ff; /* [var] color/info-soft — info chip bg, info icon tile */

  /* ===== Colour: brand (green accent) [var] ===== */
  --color-brand:        #1a7f5a; /* [var] color/brand — logo mark, checked checkbox, selected-row border, active-nav bar, progress fill */
  --color-brand-strong: #0f6845; /* [var] color/brand-strong — text on brand-soft (selected item name, active group) */
  --color-brand-soft:   #e6f3ec; /* [var] color/brand-soft — selected row / selected list item / "on" pill bg */

  /* ===== Colour: status [var] ===== */
  --color-success:      #1f8a4c; /* [var] color/success — "ثبت شد" chip text, company-share amount */
  --color-success-soft: #e8f5ed; /* [var] color/success-soft — success chip bg */
  --color-warning:      #b45309; /* [var] color/warning — deadline / "ثبت نشده" chip text, warning numbers */
  --color-warning-soft: #fef4e4; /* [var] color/warning-soft — warning chip bg, warning icon tile */
  --color-danger:       #d93025; /* [var] color/danger — destructive text ("حذف گروه") */
  --color-danger-soft:  #fdecec; /* [var] color/danger-soft — danger bg (seen on holiday 6:3109, requests 6:2953, locked day 6:706) */

  /* Overlay / modal dim: NOT YET MEASURED. Node "dim" e.g. 6:1800 / 6:7291.
     Measure and add --color-overlay before building modals. */

  /* ===== Typography ===== */
  /* Figma uses Vazirmatn everywhere (Regular / SemiBold / Bold) [m:6:1570, 6:1078, 6:6597, 6:5918].
     Vazirmatn is a web font; same family the current app already loads. */
  --font-family: "Vazirmatn", Tahoma, sans-serif;
  --font-weight-regular:  400; /* Vazirmatn:Regular */
  --font-weight-semibold: 600; /* Vazirmatn:SemiBold */
  --font-weight-bold:     700; /* Vazirmatn:Bold */
  --line-height: 1.55;         /* every text node measured uses leading 1.55 */
  --letter-spacing: 0;         /* no tracking set on any measured node */

  /* Font sizes (px) and their observed roles */
  --font-size-10: 10px; /* [m:6:1217] nav sub-lines: panel name, user role */
  --font-size-11: 11px; /* [m:6:1078] meta, chips, nav counts, section labels, field labels (groups) */
  --font-size-12: 12px; /* [m:6:1078] secondary body, nav items, field labels (login), text actions */
  --font-size-13: 13px; /* [m:6:1078] body: menu items, inputs, tabs, button labels, day names */
  --font-size-14: 14px; /* [m:6:5918] card titles (groups); [m:6:1570] login button label */
  --font-size-16: 16px; /* [m:6:6597] section card title ("سفارش امروز"); [m:6:5918] list-pane title */
  --font-size-17: 17px; /* [m:6:1570] login brand title; [m:6:1078] week-pane title "این هفته" */
  --font-size-19: 19px; /* [m:6:6597] stat tile value */
  --font-size-20: 20px; /* [m:6:1078] day panel title */
  --font-size-22: 22px; /* [m:6:6597, 6:5918] page title (h1) */

  /* ===== Radius ===== */
  --radius-xs:   6px;   /* [m:6:1078] checkbox */
  --radius-sm:   10px;  /* [m:6:1078] nav item, menu row, 28px icon tile, segmented item */
  --radius-md:   12px;  /* [m:6:1570] inputs/search, brand mark; [m:6:6597] shortcut & attention cards, 36px icon tile, user card; segmented track */
  --radius-lg:   18px;  /* [m:6:1570] login card; cards, stat tiles, day panel */
  --radius-pill: 999px; /* buttons, chips, pills, tags, avatar, progress bar */
  /* Variant: 11px on the 34px attention icon tile [m:6:6686]. */

  /* ===== Shadow ===== (most cards are border-only, no shadow) */
  --shadow-card-raised: 0 4px 16px 0 rgba(0, 0, 0, 0.05); /* [m:6:1080] day panel */
  --shadow-auth-card:   0 6px 24px 0 rgba(0, 0, 0, 0.06); /* [m:6:1571] login card */

  /* ===== Borders ===== */
  --border-width: 1px;            /* cards, panes, dividers */
  --border-width-checkbox: 1.4px; /* [m:6:1117] unchecked checkbox */
  --border-width-tab-active: 2px; /* [m:6:1097] active tab underline (color-primary) */
  --nav-active-bar-width: 3px;    /* [m:6:1230] brand bar on active nav item / selected list row */

  /* ===== Spacing scale (px values observed in gaps/padding) ===== */
  --space-2:  2px;
  --space-3:  3px;
  --space-4:  4px;
  --space-6:  6px;
  --space-7:  7px;
  --space-8:  8px;
  --space-9:  9px;
  --space-10: 10px;
  --space-11: 11px;
  --space-12: 12px;
  --space-13: 13px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-22: 22px;
  --space-26: 26px;
  --space-28: 28px;
  --space-30: 30px;
  --space-32: 32px;
  --space-36: 36px;

  /* ===== Icon and control sizes ===== */
  --icon-xs: 11px;  /* check mark inside checkbox [m:6:1116] */
  --icon-sm: 13px;  /* week prev/next arrows [m:6:1150] */
  --icon-md: 14px;  /* close icon in 28px tile [m:6:1084] */
  --icon-nav: 15px; /* nav items, org search [m:6:1233] */
  --icon-lg: 16px;  /* search, attention-card icons [m:6:1107, 6:6687] */
  --icon-xl: 17px;  /* shortcut-card icons [m:6:6649] */
  --checkbox-size: 17px;         /* [m:6:1116] */
  --switch-width: 34px;          /* [m:6:5955] switch is an SVG asset in Figma; colours not measured */
  --switch-height: 20px;
  --avatar-size: 28px;           /* [m:6:1252] */
  --icon-tile-sm: 28px;          /* [m:6:1083] close / add buttons */
  --icon-tile-md: 34px;          /* [m:6:6686] attention-card icon tile */
  --icon-tile-lg: 36px;          /* [m:6:6648] shortcut-card icon tile */
  --brand-mark-size: 38px;       /* [m:6:1576] login org mark */
  --legend-dot: 9px;             /* [m:6:6635] */
  --progress-height: 10px;       /* [m:6:6630] */

  /* ===== Layout ===== */
  --frame-width: 1440px;         /* every screen frame */
  --frame-height: 940px;
  --nav-width: 240px;            /* right sidebar [m:6:1217, 6:6716] */
  --content-width: 1200px;       /* frame minus nav */
  --list-pane-width: 392px;      /* week list / member list [m:6:1144] */
  --list-pane-narrow: 340px;     /* group list [m:6:6036]; side column of cards [m:6:5998, 6:6640] */
  --auth-card-width: 392px;      /* login card [m:6:1571] */
  --modal-width-sm: 520px;       /* reminder modal [m:6:1801] */
  --modal-width-md: 560px;       /* holiday / menu item / Excel import modals [m:6:3372, 6:3630, 6:4946] */
  --modal-width-lg: 600px;       /* add member modal [m:6:7292] */
  --wizard-width: 720px;         /* setup wizard [m:6:7935] */
  --page-pad-x: 30px;            /* main area [m:6:6598]; 28px on the groups detail column [m:6:5919] */
  --page-pad-y: 26px;
  --page-header-height: 55px;    /* header row (56px on some screens) */
  --page-gap: 16px;              /* gap between page sections */
}
