/* ==========================================================================
   Design tokens - Project: الالتزام الدائم للخدمات التموينية
   Based on approved color palette (green/gold) + light/dark-ready CSS
   variables. These feed all other stylesheets (public.css/admin.css/dark.css).
   ========================================================================== */

:root {
  /* Brand palette - approved */
  --color-primary:        #0f4a2a;
  --color-primary-light:  #14633a;
  --color-primary-dark:   #0a331f;
  --color-accent:         #d9ab47;
  --color-accent-light:   #b98a2c;
  --color-ivory:          #faf5e6;
  --color-ivory-alt:      #f1e9cf;

  /* Semantic states */
  --color-danger:         #b3261e;
  --color-danger-bg:      rgba(179, 38, 30, 0.08);
  --color-warning:        #f59e0b;
  --color-warning-bg:     rgba(245, 158, 11, 0.08);
  --color-success:        #0f7a3d;
  --color-success-bg:     rgba(15, 122, 61, 0.08);
  --color-info:           #3b82f6;
  --color-info-bg:        rgba(59, 130, 246, 0.08);

  /* Typography ---------------------------------------------------------------
     Cairo is the single family for the whole product, Arabic and Latin alike.
     The stack deliberately drops Tahoma/Arial/Segoe: Cairo ships as a local
     woff2 in assets/fonts/cairo/ for weights 400-800, so it is always
     available and there is no reason for a system font to win first. Keep
     system-ui only as a last resort if the woff2 fails to load. */
  --font-family-base:     'Cairo', system-ui, sans-serif;
  --font-family-heading:  'Cairo', system-ui, sans-serif;

  /* Type scale - one ramp, used by every heading, label and body size.
     Keeping the steps here is what stops each page from inventing its own
     font sizes and is the first half of the "unify sizes" requirement. */
  --fs-2xs:                11px;
  --fs-xs:                 12px;
  --fs-sm:                 13px;
  --fs-base:               14px;
  --fs-md:                 15px;
  --fs-lg:                 17px;
  --fs-xl:                 20px;
  --fs-2xl:                24px;
  --fs-3xl:                30px;

  --fw-normal:             400;
  --fw-medium:             500;
  --fw-semibold:           600;
  --fw-bold:               700;

  --lh-tight:              1.3;
  --lh-snug:               1.5;
  --lh-normal:             1.75;

  /* Spacing - a 4px-based ramp. Components must reference these steps instead
     of hand-written pixel padding, so vertical rhythm matches page to page. */
  --sp-0:                  0;
  --sp-1:                  4px;
  --sp-2:                  8px;
  --sp-3:                  12px;
  --sp-4:                  16px;
  --sp-5:                  20px;
  --sp-6:                  24px;
  --sp-7:                  32px;
  --sp-8:                  40px;

  /* Controls - every button, input, select and textarea shares these three
     numbers so forms line up across all 24 pages. 40px / 32px are the
     reference template's own --control-h and --control-h-sm. Only
     assets/css/admin-theme.css reads them, so the public pages are unaffected. */
  --control-h:             40px;
  --control-h-sm:          32px;
  --control-px:            14px;

  /* Logo - deliberately small and fixed. The mark is brand furniture, not the
     subject of any screen, so it gets one height, one cap, and the same value
     in the header and the sidebar. Fixed numbers matter here: the markup also
     carries width/height attributes, and if those disagree with the rendered
     size the bar reflows on first paint. The intrinsic mark is ~1.36:1. */
  --logo-h:                30px;
  --logo-max-w:            120px;

  /* Surfaces + text (light theme) */
  --bg-body:              var(--color-ivory);
  --bg-surface:           #ffffff;
  --bg-surface-alt:       var(--color-ivory-alt);
  --text-primary:         #1d2b22;
  --text-secondary:       #66705f;
  --text-muted:           #66705f;
  --text-on-primary:      #ffffff;
  --text-on-accent:       var(--color-primary-dark);

  /* Borders, radius, shadows, motion */
  --border-color:         rgba(15, 74, 42, 0.12);
  --border-color-alt:     #e3d3a4;
  --radius-sm:            8px;
  --radius-md:            14px;
  --radius-lg:            22px;
  --radius-pill:          999px;
  --shadow-sm:            0 1px 0 rgba(15, 74, 42, 0.08);
  --shadow-md:            0 14px 30px -18px rgba(15, 74, 42, 0.40);
  --shadow-lg:            0 24px 60px rgba(0, 0, 0, 0.45);
  --ease:                 cubic-bezier(0.22, 0.8, 0.26, 1);
  --header-height:        80px;
  --max-width:            1180px;
}

/* Dark theme: colors kept brand-consistent, surfaces inverted.
   Activation: set html[data-theme="dark"] or prefers-color-scheme (can be
   toggled from admin in Phase 2 if desired). */
html[data-theme="dark"],
:root[data-theme="dark"] {
  --bg-body:              var(--color-primary-dark);
  --bg-surface:           #102b1a;
  --bg-surface-alt:       #133a20;
  --text-primary:         #f5f7f5;
  --text-secondary:       #d9e5d6;
  --text-muted:           #c9d8c5;
  --text-on-primary:      #ffffff;
  --text-on-accent:       var(--color-primary-dark);
  --border-color:         rgba(217, 171, 71, 0.25);
  --border-color-alt:     rgba(255, 255, 255, 0.12);
  --shadow-sm:            0 1px 0 rgba(0, 0, 0, 0.25);
  --shadow-md:            0 14px 30px -18px rgba(0, 0, 0, 0.60);
  --shadow-lg:            0 24px 60px rgba(0, 0, 0, 0.65);
}