/* ============================================================
   tokens.css — design tokens (single source of truth)
   Every color, radius, space, shadow, and font lives here as a
   CSS variable. Brand colors (--primary/--accent) may be overridden
   from Admin > Settings (theme_primary / theme_accent).
   Logical properties are used throughout for RTL support.
   ============================================================ */
:root{
  /* ---- Brand ---- */
  --primary:#1e293b;
  --accent:#0f766e;
  --accent-ink:#ffffff;
  --accent-soft:rgba(15,118,110,.10);
  --accent-softer:rgba(15,118,110,.06);

  /* ---- Surfaces & text (light) ---- */
  --bg:#f8fafc;
  --surface:#ffffff;
  --surface-2:#f1f5f9;
  --text:#0f172a;
  --muted:#64748b;
  --border:#cbd5e1;
  --border-strong:#94a3b8;

  /* ---- Feedback ---- */
  --success:#059669;
  --success-bg:#ecfdf5;
  --success-bd:#a7f3d0;
  --error:#b91c1c;
  --error-bg:#fef2f2;
  --error-bd:#fecaca;
  --warn:#d97706;
  --warn-bg:#fffbeb;
  --warn-bd:#fde68a;
  --info:#1d4ed8;
  --info-bg:#eff6ff;
  --info-bd:#bfdbfe;

  /* ---- Shape ---- */
  --radius-sm:8px;
  --radius:12px;
  --radius-lg:16px;
  --radius-pill:999px;

  /* ---- Elevation ---- */
  --shadow-sm:0 1px 2px rgba(2,6,23,.06);
  --shadow:0 1px 2px rgba(2,6,23,.05),0 1px 8px rgba(2,6,23,.07);
  --shadow-lg:0 12px 32px rgba(2,6,23,.14);
  --shadow-menu:0 25px 50px rgba(2,6,23,.15);

  /* ---- Type ---- */
  --font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-mono:ui-monospace,"Cascadia Mono",Consolas,monospace;
  --fs-xs:.75rem;
  --fs-sm:.85rem;
  --fs-md:1rem;
  --fs-lg:1.15rem;
  --fs-xl:1.4rem;
  --fs-2xl:clamp(1.8rem,4vw,2.6rem);
  --lh-tight:1.2;
  --lh-body:1.6;

  /* ---- Space scale (4px base) ---- */
  --sp-1:.25rem;
  --sp-2:.5rem;
  --sp-3:.75rem;
  --sp-4:1rem;
  --sp-5:1.25rem;
  --sp-6:1.5rem;
  --sp-8:2rem;
  --sp-10:2.5rem;

  /* ---- Layout ---- */
  --max:1200px;
  --max-narrow:640px;
  --max-form:560px;
  --tap:44px;                 /* minimum touch target */
  --topbar-h:64px;
  --sidebar-w:240px;
  --z-topbar:50;
  --z-menu:60;
  --z-modal:80;
  --z-toast:90;

  /* ---- Motion ---- */
  --dur-fast:.15s;
  --dur:.2s;
  --ease:ease;
  --transition:var(--dur) var(--ease);
  --focus:0 0 0 3px rgba(15,118,110,.35);
}

/* ---- Dark theme ---- */
[data-theme="dark"]{
  --bg:#0f172a;
  --surface:#1e293b;
  --surface-2:#0b1220;
  --text:#f1f5f9;
  --muted:#94a3b8;
  --border:#334155;
  --border-strong:#475569;
  --accent-soft:rgba(45,212,191,.12);
  --accent-softer:rgba(45,212,191,.07);
  --shadow:0 1px 2px rgba(0,0,0,.4),0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:0 12px 32px rgba(0,0,0,.5);
  --shadow-menu:0 25px 50px rgba(0,0,0,.55);
  --success-bg:#064e3b;
  --success-bd:#10b981;
  --error-bg:#3b0a0a;
  --error-bd:#f87171;
  --warn-bg:#3f2507;
  --warn-bd:#f6ad55;
  --info-bg:#172554;
  --info-bd:#3b82f6;
}
