/* Mosha UI mockup kit — design tokens + components
   Brand source: style-guide/Black Modern Brand Guideline Presentation.pdf (colours p.9)
   Persian typeface: Vazirmatn (brand typeface Etna has no Persian glyphs). */

@font-face { font-family: "Vazirmatn"; font-weight: 100 900; font-display: swap;
  src: url(/fonts/vazirmatn-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Vazirmatn"; font-weight: 100 900; font-display: swap;
  src: url(/fonts/vazirmatn-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Vazirmatn"; font-weight: 100 900; font-display: swap;
  src: url(/fonts/vazirmatn-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Brand palette (exact values from the brand book) */
  --brand-green:  #013537;
  --brand-red:    #E83227;
  --brand-blue:   #AFC0E6;
  --brand-yellow: #E9E55C;
  --brand-white:  #F9F9F9;
  --brand-black:  #1B1B1B;

  /* Derived UI scale */
  --green-900: #012426;
  --green-800: #013537;   /* primary */
  --green-700: #0B4A4C;   /* primary hover */
  --green-100: #DCE8E7;
  --green-50:  #EEF4F3;

  --surface-page:   #F9F9F9;
  --surface-card:   #FFFFFF;
  --surface-sunken: #F1F2F1;
  --border:         #E3E5E4;
  --border-strong:  #C9CDCC;
  --text-primary:   #1B1B1B;
  --text-secondary: #5E6566;
  --text-muted:     #687070;   /* was #858B8B (3.3:1 on page); now 4.5:1 on every surface */
  --text-on-brand:  #F9F9F9;

  /* Semantic status: one meaning, one colour, everywhere (always with icon + label) */
  --st-overdue-fg: #B3261B;  --st-overdue-bg: #FDECEA;  --st-overdue-bd: #F5B9B3;  /* overdue, breached, arrears, rejected */
  --st-pending-fg: #5C5600;  --st-pending-bg: #FBFAE0;  --st-pending-bd: #E9E55C;  /* pending verification / approval */
  --st-paid-fg:    #17734A;  --st-paid-bg:    #E5F3EB;  --st-paid-bd:    #A9D6BD;  /* paid, approved, confirmed */
  --st-info-fg:    #2B4A8C;  --st-info-bg:    #EEF2FA;  --st-info-bd:    #AFC0E6;  /* scheduled, informational */
  --st-neutral-fg: #5E6566;  --st-neutral-bg: #F1F2F1;  --st-neutral-bd: #E3E5E4;  /* draft, vacant, closed */

  /* Type scale (Persian needs taller line-height than Latin) */
  --font-sans: "Vazirmatn", system-ui, sans-serif;
  --fs-display: 32px; --lh-display: 1.4;
  --fs-h1: 24px;      --lh-h1: 1.5;
  --fs-h2: 20px;      --lh-h2: 1.55;
  --fs-h3: 16px;      --lh-h3: 1.6;
  --fs-body: 14px;    --lh-body: 1.8;
  --fs-small: 12px;   --lh-small: 1.7;
  --fs-amount-xl: 28px;

  /* Spacing (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Radius & elevation — square-ish, architectural, echoing the stepped logo */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(1,53,55,.06), 0 1px 1px rgba(1,53,55,.04);
  --shadow-2: 0 4px 16px rgba(1,53,55,.08);

  --touch-min: 44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--text-primary); background: var(--surface-page); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { margin: 0; font-weight: 800; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3, h2.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; }
p { margin: 0; }
.muted { color: var(--text-secondary); }
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num, .money, td.n { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Icons */
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }

/* Money */
.money { white-space: nowrap; font-weight: 700; }
.money .u { font-weight: 400; font-size: .78em; color: var(--text-secondary); margin-inline-start: 4px; }
.money.xl { font-size: var(--fs-amount-xl); font-weight: 800; }

/* Status badge: icon + label + colour */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.badge svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
.badge.overdue { color: var(--st-overdue-fg); background: var(--st-overdue-bg); border-color: var(--st-overdue-bd); }
.badge.pending { color: var(--st-pending-fg); background: var(--st-pending-bg); border-color: var(--st-pending-bd); }
.badge.paid    { color: var(--st-paid-fg);    background: var(--st-paid-bg);    border-color: var(--st-paid-bd); }
.badge.info    { color: var(--st-info-fg);    background: var(--st-info-bg);    border-color: var(--st-info-bd); }
.badge.neutral { color: var(--st-neutral-fg); background: var(--st-neutral-bg); border-color: var(--st-neutral-bd); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch-min);
  padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent; font: inherit; font-weight: 700;
  cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--green-800); color: var(--text-on-brand); }
.btn.primary:hover { background: var(--green-700); }
.btn.secondary { background: var(--surface-card); color: var(--green-800); border-color: var(--border-strong); }
.btn.ghost { background: transparent; color: var(--green-800); }
.btn.danger { background: var(--surface-card); color: var(--st-overdue-fg); border-color: var(--st-overdue-bd); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }

/* Cards */
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: var(--sp-5); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border); }
.card-h h3, .card-h h2.h3 { display: flex; align-items: center; gap: 8px; }
.kpi .label { color: var(--text-secondary); font-size: 13px; }
.kpi .money { font-size: 22px; font-weight: 800; display: block; margin-top: 4px; }
.kpi .delta { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }

/* Alerts (top-of-screen "what's wrong") */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid; border-inline-start-width: 4px; }
.alert.overdue { background: var(--st-overdue-bg); border-color: var(--st-overdue-bd); border-inline-start-color: var(--st-overdue-fg); }
.alert.pending { background: var(--st-pending-bg); border-color: var(--st-pending-bd); border-inline-start-color: #B8B22A; }
.alert.info    { background: var(--st-info-bg); border-color: var(--st-info-bd); border-inline-start-color: var(--st-info-fg); }
.alert .t { font-weight: 700; }
.alert.overdue > svg { color: var(--st-overdue-fg); }
.alert.pending > svg { color: var(--st-pending-fg); }
.alert.info > svg { color: var(--st-info-fg); }

/* Tables (web, dense) */
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt th { text-align: start; padding: 10px 12px; font-weight: 600; color: var(--text-secondary); background: var(--surface-sunken);
  border-bottom: 1px solid var(--border); white-space: nowrap; }
table.dt td { padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.dt tr:last-child td { border-bottom: 0; }
table.dt td.n, table.dt th.n { text-align: end; }
table.dt tr.flag td { background: #FFF8F7; }
table.dt tr.sel td { background: var(--green-50); }

/* Inputs */
.field { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r-md); background: var(--surface-card); color: var(--text-secondary); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); background: var(--surface-card); font-size: 13px; color: var(--text-primary); white-space: nowrap; }
.chip.on { background: var(--green-800); border-color: var(--green-800); color: var(--text-on-brand); }

