/* ============================================================
   Amlak — design tokens (DESIGN.md §4 — supersedes PLAN-E §E0-E5)
   "Nothing outside this file contains a hex value." Every colour,
   size and spacing value in the app comes from here.

   DESIGN.md's own palette/type/space variable names (--navy,
   --paper, --rule, --serif, --t-title, --s4, etc.) are the
   canonical set below. The older PLAN-E names (--brand-navy,
   --bg-page, --font-display, --text-xl, --space-4, etc.) are kept
   as aliases onto the SAME values so earlier work (report-owner-
   statement.php, the global .num/.kpi rules) keeps resolving
   correctly without a second palette existing — see DESIGN-NOTES.md.

   One deviation confirmed with Omar in the previous pass, still
   true here since the underlying files didn't change:
   Source Serif 4 and Noto Naskh Arabic are variable fonts — Google
   serves ONE file covering the whole weight range, so each has a
   single @font-face with `font-weight: 400 700` rather than three
   separate static-weight files.
   ============================================================ */

/* ---------- Self-hosted fonts (no CDN) ---------- */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/source-serif-4-variable-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/noto-naskh-arabic-variable-arabic.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-600-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-arabic-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-600-latin.woff2') format('woff2');
}

:root {
  /* ---- DESIGN.md §4 palette (final-edit revision). Capped. No additions. ---- */
  --navy:          #14213D;   /* primary text, rules, primary button, SIDEBAR */
  --navy-soft:     #3A4762;   /* secondary text */
  --navy-raised:   #1E2E52;   /* active nav item background */
  --grey:          #6E7688;   /* muted text, labels */
  --grey-light:    #9AA1B0;   /* disabled, placeholder */
  --gold:          #A67C13;   /* accent: active nav, focus ring, heading rules */

  --page:          #FAF9F6;   /* page canvas — warm, not white */
  --surface:       #FFFFFF;   /* content blocks sit on white against the warm page */
  --inset:         #F4F2ED;   /* table headers, filter strips, totals rows */
  --rule:          #E2E0DA;   /* hairline, 1px */
  --rule-heavy:    #14213D;   /* structural rule, 2px */

  --on-navy:       #FFFFFF;   /* text on the sidebar */
  --on-navy-muted: #B8BCC6;   /* inactive nav items */

  /* Legacy alias: pre-revision code referred to the single page-background
     colour as --paper. It now means "white surface" (DESIGN.md's --surface)
     since the page itself is warm and content blocks sit on white against
     it — see DESIGN-NOTES.md "§4/§5.11 revision" for the full rationale. */
  --paper:   var(--surface);

  --ok:      #2F6F4E;   /* active, cleared, paid */
  --warn:    #A9741A;   /* due soon, expiring */
  --danger:  #A33A31;   /* overdue, bounced, expired */

  /* ---- Type ---- */
  --serif: 'Source Serif 4', 'Noto Naskh Arabic', Georgia, serif;
  --sans:  'IBM Plex Sans Arabic', system-ui, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, monospace;

  --t-micro: 11px;   /* column headers, meta */
  --t-small: 13px;   /* table body — the default */
  --t-body:  15px;   /* prose, form labels */
  --t-head:  17px;   /* section headings */
  --t-title: 24px;   /* page title */
  --t-fig:   26px;   /* KPI figures */

  /* ---- Space: 4px base ---- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;

  --radius: 2px;

  /* ---- Compatibility bridge: PLAN-E (E1) names alias onto the
     DESIGN.md values above so earlier work keeps resolving. Not a
     second palette — every one of these resolves to a var() above. ---- */
  --brand-navy: var(--navy);
  --brand-gold: var(--gold);
  /* STALE AS OF THE §4/§5.11 ROLLOUT (see DESIGN-NOTES.md): this comment
     used to explain why --bg-page stayed white while the warm-page rollout
     was deferred. That rollout is done now — style.css's `body` selector
     reads --page directly (not through this alias), and .shell-container
     carries its own explicit --surface + --rule border, so every page
     already has the warm-canvas/white-content split regardless of what
     --bg-page itself resolves to. --bg-page is kept at --surface (white)
     only because report-owner-statement.php's `.statement-doc` wrapper
     still reads it directly, and that wrapper is a content block — it's
     supposed to be white. */
  --bg-page: var(--surface);
  --bg-inset: var(--inset);
  --bg-surface: var(--surface);
  --border-subtle: var(--rule);
  --border-strong: var(--grey-light);
  --rule-strong: var(--rule-heavy);
  --text-primary: var(--navy);
  --text-secondary: var(--navy-soft);
  --text-muted: var(--grey);
  --status-ok: var(--ok);
  --status-warn: var(--warn);
  --status-danger: var(--danger);
  --status-neutral: var(--grey);
  --font-ui: var(--sans);
  --font-display: var(--serif);
  --font-mono: var(--mono);
  --text-xs: var(--t-micro);
  --text-sm: var(--t-small);
  --text-base: var(--t-body);
  --text-lg: var(--t-head);
  --text-xl: var(--t-title);
  --text-kpi: var(--t-fig);
  --space-1: var(--s1); --space-2: var(--s2); --space-3: var(--s3);
  --space-4: var(--s4); --space-6: var(--s6); --space-8: var(--s8);
  --radius-sm: var(--radius);
  --radius-md: var(--radius);
  --shadow-card: none;   /* DESIGN.md §2: shadows are forbidden, not just reduced */
}
