/* =====================================================================
   BioMedico Design System — Tokens  (v1.0)
   Single source of truth for colour, type, spacing, radius, elevation.
   Every other stylesheet consumes these variables; never hard-code
   colours or sizes in pages.
   ===================================================================== */

:root {
  /* ---- Brand: blue scale (v2 — "blue degrees") ------------------- */
  --bm-primary-25:  #f5f9ff;
  --bm-primary-50:  #eaf2ff;
  --bm-primary-100: #d6e6ff;
  --bm-primary-200: #b3d0ff;
  --bm-primary-300: #84b3fb;
  --bm-primary-400: #5592f2;
  --bm-primary-500: #2f74e6;
  --bm-primary-600: #1d5fd1;   /* default action colour (AA on white: 5.4:1) */
  --bm-primary-700: #174cae;   /* hover / pressed */
  --bm-primary-800: #153f8d;
  --bm-primary-900: #12336f;
  --bm-navy-800:    #13306a;
  --bm-navy-900:    #0c2150;   /* sidebar base */

  /* Secondary blues for colourful accents (sections, KPI tiles, icons) */
  --bm-sky-400:    #38bdf8;
  --bm-sky-500:    #0ea5e9;
  --bm-sky-600:    #0284c7;
  --bm-cyan-500:   #06b6d4;
  --bm-indigo-500: #6366f1;
  --bm-indigo-600: #4f46e5;

  --bm-grad-brand:   linear-gradient(135deg, #1d5fd1 0%, #0ea5e9 100%);
  --bm-grad-sidebar: #1d5fd1;   /* v6: solid blue sidebar, white text */
  --bm-nav-active-bg: #ffd43b;  /* v6: current page = yellow */
  --bm-nav-active-fg: #0c2150;  /* v6: current page text = dark blue */
  --bm-grad-header:  linear-gradient(90deg, #174cae 0%, #1d5fd1 55%, #2f74e6 100%);
  --bm-grad-soft:    linear-gradient(180deg, #eaf2ff 0%, #f5f9ff 100%);

  --bm-accent-500:  #f59e0b;   /* sparing highlight only */

  /* ---- Neutrals ---------------------------------------------------- */
  --bm-gray-0:   #ffffff;
  --bm-gray-25:  #f7f9fd;
  --bm-gray-50:  #eef3fb;
  --bm-gray-100: #e3eaf5;
  --bm-gray-200: #cfdbee;
  --bm-gray-300: #a9bad6;
  --bm-gray-500: #6b7b88;
  --bm-gray-600: #4b5a73;   /* secondary text (AA on white: 6.4:1) */
  --bm-gray-800: #1f2d47;
  --bm-gray-900: #111a2e;   /* primary text */

  /* ---- Status ------------------------------------------------------ */
  --bm-success-50: #ecf7f0;  --bm-success-600: #1e7a46;  --bm-success-700: #17603a;
  --bm-warning-50: #fdf5e7;  --bm-warning-600: #9a5b00;  --bm-warning-700: #7a4800;
  --bm-danger-50:  #fcefee;  --bm-danger-600:  #b42318;  --bm-danger-700:  #912018;
  --bm-info-50:    #edf3fc;  --bm-info-600:    #1d5fb4;  --bm-info-700:    #174b8f;

  /* ---- Semantic aliases (use these in components) ------------------ */
  --bm-bg:            #ffffff;   /* V8-27: white page background (was gray-50) */
  --bm-surface:       var(--bm-gray-0);
  --bm-surface-muted: var(--bm-gray-25);
  --bm-border:        var(--bm-gray-200);
  --bm-border-strong: var(--bm-gray-300);
  --bm-text:          var(--bm-gray-900);
  --bm-text-muted:    var(--bm-gray-600);
  --bm-text-inverse:  #ffffff;
  --bm-link:          var(--bm-primary-600);
  --bm-focus:         #1d5fd1;
  --bm-selected-row:  var(--bm-primary-100);
  --bm-label:         var(--bm-primary-900);

  /* ---- Typography -------------------------------------------------- */
  /* IBM Plex Sans Arabic carries both Arabic and Latin glyphs with one
     consistent rhythm; system fallbacks keep the app usable offline. */
  --bm-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  --bm-font-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;

  --bm-fs-xs:  0.75rem;   /* 12 */
  --bm-fs-sm:  0.8125rem; /* 13 */
  --bm-fs-md:  0.875rem;  /* 14  body (v3: one step smaller to fit content) */
  --bm-fs-lg:  1rem;      /* 16 */
  --bm-fs-xl:  1.25rem;   /* 20  page title */
  --bm-fs-2xl: 1.625rem;  /* 26  KPI value */

  --bm-fw-regular: 400;
  --bm-fw-medium:  500;
  --bm-fw-bold:    600;

  --bm-lh-tight: 1.3;
  --bm-lh-body:  1.6;     /* Arabic needs generous line-height */

  /* ---- Spacing (4-pt scale) ---------------------------------------- */
  --bm-sp-1: 4px;  --bm-sp-2: 8px;  --bm-sp-3: 12px; --bm-sp-4: 16px;
  --bm-sp-5: 20px; --bm-sp-6: 24px; --bm-sp-8: 32px; --bm-sp-10: 40px;

  /* ---- Sizing ------------------------------------------------------ */
  --bm-control-h:    36px;   /* inputs, buttons */
  --bm-control-h-sm: 30px;
  --bm-touch:        44px;   /* minimum touch target on coarse pointers */
  --bm-sidebar-w:    233px;   /* v6: 218px + 15px */
  --bm-topbar-h:     72px;
  --bm-content-max:  1440px;

  /* ---- Shape & elevation ------------------------------------------- */
  --bm-radius-sm: 4px;
  --bm-radius:    6px;
  --bm-radius-lg: 10px;
  --bm-shadow-1: 0 1px 3px rgba(18, 51, 111, .08);
  --bm-shadow-2: 0 6px 16px rgba(18, 51, 111, .12);
  --bm-shadow-3: 0 12px 32px rgba(20, 28, 34, .18);

  /* ---- Motion ------------------------------------------------------ */
  --bm-dur-fast: 120ms;
  --bm-dur:      180ms;
  --bm-ease:     cubic-bezier(.2, .6, .2, 1);

  /* ---- Layers ------------------------------------------------------ */
  --bm-z-sidebar: 40;
  --bm-z-topbar:  30;
  --bm-z-overlay: 90;
  --bm-z-modal:   100;
}

@media (prefers-reduced-motion: reduce) {
  :root { --bm-dur-fast: 0ms; --bm-dur: 0ms; }
}
