/* ============================================================================
   DESIGN SYSTEM — VARIABLES  (Stage 1)
   ----------------------------------------------------------------------------
   Single source of truth for the entire application's visual language.
   Change a value here and it cascades to every page automatically.

   This layer is ADDITIVE: it declares tokens and is consumed by the other
   theme files (base / components / animations / utilities). It does not
   modify AdminLTE or Bootstrap — those load first; this wins the cascade
   because it is linked last in base.html / baseLTR.html.

   Direction: Enterprise Neutral — calm blue/slate accent, gold reserved for
   small highlights (KPIs, badges, active markers).
   ========================================================================= */

:root {

  /* --- Brand / primary accent ------------------------------------------- */
  --primary: #2563eb;            /* enterprise blue */
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-contrast: #ffffff;
  --primary-soft: rgba(37, 99, 235, 0.10);   /* tints, focus rings, hovers */
  --primary-soft-strong: rgba(37, 99, 235, 0.18);

  /* --- Secondary (slate) ------------------------------------------------ */
  --secondary: #64748b;
  --secondary-hover: #475569;
  --secondary-contrast: #ffffff;

  /* --- Gold highlight (jewelry accent — used sparingly) ----------------- */
  --gold: #c8a24a;
  --gold-light: #e2c878;
  --gold-dark: #a07c2c;
  --gold-soft: rgba(200, 162, 74, 0.14);

  /* --- Semantic state colors -------------------------------------------- */
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --info: #0ea5b7;
  --info-soft: rgba(14, 165, 183, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);

  /* --- Surfaces / backgrounds ------------------------------------------- */
  --background: #f3f5f9;         /* app canvas (content-wrapper / body) */
  --surface: #ffffff;            /* cards, modals, dropdowns */
  --surface-2: #f8fafc;          /* subtle raised areas, table headers */
  --surface-hover: #f1f5f9;      /* row / item hover */

  /* --- Text ------------------------------------------------------------- */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;
  --link-color: var(--primary);
  --link-hover: var(--primary-hover);

  /* --- Borders / dividers ----------------------------------------------- */
  --border-color: #e5e9f0;
  --border-color-strong: #cbd5e1;
  --border-width: 1px;

  /* --- Radius scale ----------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* --- Elevation / shadows ---------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06),
               0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.06),
               0 6px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.10),
               0 16px 40px rgba(16, 24, 40, 0.12);
  --shadow-focus: 0 0 0 3px var(--primary-soft);

  /* --- Spacing scale (4px base) ----------------------------------------- */
  --space-1: 0.25rem;   /*  4px */
  --space-2: 0.5rem;    /*  8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */

  /* --- Typography ------------------------------------------------------- */
  /* Source Sans Pro is already loaded; system fonts cover Arabic (RTL). */
  --font-sans: "Source Sans Pro", "Segoe UI", "Tahoma", "Cairo",
               system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;

  --font-size-base: 1rem;        /* kept at AdminLTE base to avoid reflow */
  --font-size-sm: 0.8125rem;
  --font-size-lg: 1.125rem;
  --line-height-base: 1.55;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* --- Motion ----------------------------------------------------------- */
  --animation-speed: 200ms;                          /* master speed dial */
  --animation-speed-fast: 120ms;
  --animation-speed-slow: 320ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: all var(--animation-speed) var(--ease);
  --transition-colors: background-color var(--animation-speed) var(--ease),
                       border-color var(--animation-speed) var(--ease),
                       color var(--animation-speed) var(--ease),
                       box-shadow var(--animation-speed) var(--ease);

  /* --- Layout ----------------------------------------------------------- */
  --sidebar-width: 280px;        /* matches existing custom.css */
  --header-height: 57px;
}

/* ----------------------------------------------------------------------------
   DARK MODE HOOK (future-ready — no toggle wired yet).
   Activate by adding  data-theme="dark"  to <html> or <body>.
   Only neutrals/surfaces are remapped; brand + semantic hues stay stable.
   ------------------------------------------------------------------------- */
:root[data-theme="dark"],
[data-theme="dark"] {
  --background: #0f172a;
  --surface: #1e293b;
  --surface-2: #172033;
  --surface-hover: #24324a;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: #2b394f;
  --border-color-strong: #3b4b66;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.6);
}
