/* =========================================================
   NEXORA Design System — Design tokens  v1.0
   Source of truth for colour, type, space, shape, elevation
   and motion. Import before any component styles.
   Naming: --{category}-{role|scale}
   ========================================================= */

:root {
  /* ---------- Colour · Brand (indigo) ---------- */
  --primary-50:  #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary:     #4f46e5;   /* 600 — default brand / primary action */
  --primary-700: #4338ca;   /* hover / pressed */
  --primary-800: #3730a3;

  /* ---------- Colour · Neutrals ---------- */
  --navy-950: #0b1220;
  --navy-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  /* ---------- Colour · Semantic (use these in components) ---------- */
  --bg:            #f6f7fb;              /* app background */
  --surface:       var(--white);         /* cards, panels */
  --surface-muted: var(--slate-50);      /* table header, wells */
  --border:        #e6e8ef;              /* default dividers */
  --border-strong: var(--slate-300);     /* hover / emphasis */
  --text:          var(--navy-900);      /* primary text   — 17.1:1 on white */
  --text-2:        var(--slate-600);     /* secondary text —  7.6:1 on white */
  --text-muted:    var(--slate-500);     /* captions       —  4.8:1 on white */

  /* ---------- Colour · Status (text tone + 50 background) ---------- */
  --good-50: #ecfdf5;  --good: #047857;  --good-500: #10b981;
  --warn-50: #fffbeb;  --warn: #b45309;  --warn-500: #f59e0b;
  --bad-50:  #fef2f2;  --bad:  #b91c1c;
  --info-50: #f0f9ff;  --info: #0369a1;

  /* ---------- Colour · Data visualisation (categorical, in order) ---------- */
  --c1: #4f46e5;  /* indigo  */
  --c2: #eb6834;  /* orange  */
  --c3: #1baf7a;  /* green   */
  --c4: #eda100;  /* amber   */
  --c5: #e87ba4;  /* pink    */

  /* ---------- Typography ---------- */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs:   .75rem;     /* 12 — captions, table meta  */
  --fs-sm:   .8125rem;   /* 13 — labels, secondary     */
  --fs-base: .875rem;    /* 14 — body, table cells     */
  --fs-md:   1rem;       /* 16 — card titles           */
  --fs-lg:   1.125rem;   /* 18 — section titles        */
  --fs-xl:   clamp(1.25rem, 1.1rem + .5vw, 1.5rem);   /* 20–24 — page title */
  --fs-kpi:  clamp(1.5rem, 1rem + .9vw, 1.75rem);     /* 24–28 — KPI values */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-base: 1.5;

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

  /* ---------- Shape ---------- */
  --radius-sm: 6px;     /* badges, small inputs */
  --radius-md: 8px;     /* buttons, inputs      */
  --radius-lg: 12px;    /* menus, popovers      */
  --radius-xl: 16px;    /* cards                */
  --radius-full: 999px; /* pills, avatars       */

  /* ---------- Elevation ---------- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 16px 40px -8px rgba(15, 23, 42, .18), 0 4px 12px -4px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(79, 70, 229, .35);   /* focus-visible */

  /* ---------- Layout ---------- */
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 72px;
  --container-max: 1600px;
  /* breakpoints (reference — use in media queries): sm 640 · md 768 · lg 1200 · xl 1280 */

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .18s;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0s; }
}
