/* ==========================================================================
   THEME — BCDF Enterprise  (MIS / ERP platforms)
   --------------------------------------------------------------------------
   Institutional-finance language: ink navy, graphite, white, cool neutral
   surfaces, ONE controlled accent (cobalt) for action and selection.
   Green / amber / red are semantic only. No gradients, no glass, no shadows
   deeper than a hairline — hierarchy is carried by rules, weight and density.

   Applied via:  <html class="theme-enterprise">
   Dark mode:    <html class="theme-enterprise" data-theme="dark">   (designed)
   Density:      <body data-density="compact">   (tables 32px rows; default 40px)

   Reskin for a client: override the five brand tokens (Standard §2) and the
   lockup. Nothing else in the layer changes.
   ========================================================================== */
.theme-enterprise {
  /* ---- 1. Brand scale — ink navy (chrome, headings, strong text) --------- */
  --bc-brand-50:  #EEF1F6;
  --bc-brand-100: #D7DDE7;
  --bc-brand-200: #AEB9CB;
  --bc-brand-300: #7F8DA5;
  --bc-brand-400: #4E5D77;
  --bc-brand-500: #2A3442;   /* graphite — body text, secondary chrome */
  --bc-brand-600: #0F1B2D;   /* ink navy — sidebar, headings, primary text */
  --bc-brand-700: #0B1524;
  --bc-brand-800: #08101B;
  --bc-brand-900: #050A12;

  /* ---- 2. Accent scale — cobalt (action, selection, focus, links) -------- */
  --bc-accent-50:  #EDF2FE;
  --bc-accent-100: #D4E0FC;
  --bc-accent-200: #A9C1F8;
  --bc-accent-300: #7BA0F2;
  --bc-accent-400: #4F7FEA;
  --bc-accent-500: #2563EB;  /* links, active nav, selected row rule — 5.2:1 on white */
  --bc-accent-600: #1D4ED8;  /* primary button fill — white text 6.7:1 */
  --bc-accent-700: #1A3FB0;
  --bc-accent-800: #163289;
  --bc-accent-900: #10245F;

  /* ---- 3. Support scale — positive money / progress ---------------------- */
  --bc-support-50:  #E9F7EF;
  --bc-support-100: #CDECDA;
  --bc-support-200: #9DD9B7;
  --bc-support-300: #4DBF85;
  --bc-support-400: #22A366;
  --bc-support-500: #16824F;

  /* ---- 4. Neutrals — cool, low-chroma ------------------------------------ */
  --bc-white:    #FFFFFF;
  --bc-grey-25:  #FAFBFC;
  --bc-grey-50:  #F4F6F9;   /* application background */
  --bc-grey-100: #EBEFF4;   /* sunken, table header */
  --bc-grey-200: #DCE2EA;   /* borders, dividers */
  --bc-grey-300: #C3CBD6;
  --bc-grey-400: #94A0B0;
  --bc-grey-500: #5B6675;   /* muted text — 5.8:1 on white */
  --bc-grey-600: #46505E;
  --bc-grey-700: #2A3442;   /* body text — 12.6:1 */
  --bc-grey-800: #1C2431;
  --bc-grey-900: #0F1B2D;

  --bc-warm-50:  #F7F8FA;   /* warm is not used on enterprise surfaces; kept neutral */
  --bc-warm-100: #F4F6F9;
  --bc-warm-200: #EBEFF4;

  /* ---- 5. Semantic — success / warning / danger / info ------------------- */
  --bc-success:     #16A34A;   /* icon, dot, chart mark */
  --bc-success-bg:  #E7F6EE;
  --bc-success-fg:  #136A3F;   /* text — 6.6:1 on white */

  --bc-warning:     #D97706;
  --bc-warning-bg:  #FDF2E1;
  --bc-warning-fg:  #8A5A00;

  --bc-danger:      #DC2626;
  --bc-danger-bg:   #FDECEC;
  --bc-danger-fg:   #B42318;

  --bc-info:        #0E7490;
  --bc-info-bg:     #E4F3F7;
  --bc-info-fg:     #0C5A70;

  --bc-neutral-bg:  #EBEFF4;
  --bc-neutral-fg:  #46505E;

  --bc-purple:      #6D5BD0;
  --bc-purple-bg:   #EEEBFA;
  --bc-purple-fg:   #4A3C9C;

  /* ---- 6. Role aliases ---------------------------------------------------- */
  --bc-bg-app:      var(--bc-grey-50);
  --bc-bg-surface:  var(--bc-white);
  --bc-bg-raised:   var(--bc-white);
  --bc-bg-sunken:   var(--bc-grey-100);
  --bc-bg-inverse:  var(--bc-brand-600);
  --bc-bg-warm:     var(--bc-grey-25);

  --bc-text-strong: var(--bc-brand-600);
  --bc-text-body:   var(--bc-grey-700);
  --bc-text-muted:  var(--bc-grey-500);
  --bc-text-subtle: var(--bc-grey-400);
  --bc-text-inverse:var(--bc-white);
  --bc-text-accent: var(--bc-accent-600);

  --bc-border:        var(--bc-grey-200);
  --bc-border-strong: var(--bc-grey-300);
  --bc-border-subtle: var(--bc-grey-100);

  --bc-focus-ring: 0 0 0 3px rgba(37,99,235,.30);

  /* ---- 7. Typography — Inter for everything; identifiers in mono --------- */
  --bc-font-display: "Inter", "Segoe UI", system-ui, sans-serif;
  --bc-font-body:    "Inter", "Segoe UI", system-ui, sans-serif;
  --bc-font-mono:    ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

  --bc-fs-display: 2rem;      /* 32 — the largest type on any enterprise screen */
  --bc-fs-h1:      1.5rem;    /* 24 — page title */
  --bc-fs-h2:      1.125rem;  /* 18 — section / card title */
  --bc-fs-h3:      1rem;      /* 16 */
  --bc-fs-h4:      .875rem;   /* 14 — table caption, drawer title */
  --bc-fs-lg:      .9375rem;  /* 15 */
  --bc-fs-base:    .875rem;   /* 14 — body */
  --bc-fs-sm:      .8125rem;  /* 13 — table cells, labels */
  --bc-fs-xs:      .75rem;    /* 12 — captions, meta */
  --bc-fs-2xs:     .6875rem;  /* 11 — eyebrows, badges */

  /* ---- 8. Shape & elevation — structured, flat, ruled -------------------- */
  --bc-r-xs:   3px;
  --bc-r-sm:   4px;
  --bc-r-ctrl: 6px;
  --bc-r-btn:  6px;
  --bc-r-card: 8px;
  --bc-r-lg:   10px;
  --bc-sh-xs:  0 0 0 1px rgba(15,27,45,.06);
  --bc-sh-sm:  0 1px 2px rgba(15,27,45,.06), 0 0 0 1px rgba(15,27,45,.05);
  --bc-sh-md:  0 4px 12px rgba(15,27,45,.08), 0 0 0 1px rgba(15,27,45,.05);
  --bc-sh-lg:  0 12px 32px rgba(15,27,45,.12), 0 0 0 1px rgba(15,27,45,.06);
  --bc-sh-xl:  0 24px 56px rgba(15,27,45,.16), 0 0 0 1px rgba(15,27,45,.06);

  --bc-container-wide: 1600px;
  --bc-sidebar-w: 248px;
  --bc-sidebar-w-collapsed: 64px;
  --bc-topbar-h: 56px;

  /* ======================================================================
     ENTERPRISE SEMANTIC TOKENS  (--bce-*)
     ====================================================================== */
  /* Environment indicators — chrome-level, never decorative elsewhere */
  --bce-env-dev:        #6D5BD0;
  --bce-env-uat:        #D97706;
  --bce-env-prod:       #16A34A;
  --bce-env-prod-warn:  #B42318;

  /* Money */
  --bce-money-credit:   var(--bc-success-fg);
  --bce-money-debit:    var(--bc-text-strong);
  --bce-money-negative: var(--bc-danger-fg);
  --bce-money-masked:   var(--bc-text-subtle);

  /* Data-viz — one categorical family, ordered by emphasis (Standard §14 chart rules) */
  --bce-viz-1: #1D4ED8;   /* primary series */
  --bce-viz-2: #0F1B2D;   /* comparison / previous period */
  --bce-viz-3: #0E7490;
  --bce-viz-4: #6D5BD0;
  --bce-viz-5: #94A0B0;   /* other / remainder */
  --bce-viz-grid: #EBEFF4;
  --bce-viz-axis: #94A0B0;
  --bce-viz-prev: rgba(15,27,45,.28);   /* previous-period line */
  --bce-viz-seq-1: #D4E0FC; --bce-viz-seq-2: #A9C1F8; --bce-viz-seq-3: #4F7FEA; --bce-viz-seq-4: #1D4ED8; --bce-viz-seq-5: #10245F;

  /* Density */
  --bce-row-h: 40px;
  --bce-row-h-compact: 32px;
  --bce-cell-px: 12px;

  /* Layers */
  --bce-z-shell: 200;
  --bce-z-palette: 700;

  /* Motion — fast and purposeful */
  --bce-motion-fast: 100ms;
  --bce-motion-base: 160ms;
  --bce-motion-slow: 240ms;
  --bce-ease: cubic-bezier(.4,0,.2,1);
}

/* ==========================================================================
   DARK MODE — designed for operations rooms and night shifts.
   Surfaces are blue-black, not black; text is cool-white, not pure; the
   accent lifts to #7AA2FF; semantic colours lift for contrast; borders are
   hairlines at 12% white. Charts swap to the dark viz set.
   ========================================================================== */
.theme-enterprise[data-theme="dark"] {
  --bc-bg-app:      #10161F;
  --bc-bg-surface:  #141B26;
  --bc-bg-raised:   #1B2432;
  --bc-bg-sunken:   #0D121A;
  --bc-bg-inverse:  #F4F6F9;
  --bc-bg-warm:     #141B26;

  --bc-text-strong: #E8ECF2;
  --bc-text-body:   #C9D1DC;
  --bc-text-muted:  #9AA6B5;
  --bc-text-subtle: #6B7684;
  --bc-text-inverse:#0F1B2D;
  --bc-text-accent: #7AA2FF;

  --bc-border:        rgba(232,236,242,.12);
  --bc-border-strong: rgba(232,236,242,.22);
  --bc-border-subtle: rgba(232,236,242,.07);

  --bc-grey-25:  #1B2432;   /* row hover in dark */
  --bc-grey-100: #1B2432;   /* table header / sunken in dark */
  --bc-grey-200: rgba(232,236,242,.12);

  --bc-accent-500: #7AA2FF;
  --bc-accent-600: #2563EB;   /* button fill stays saturated; white text 5.2:1 */
  --bc-accent-700: #A9C1F8;
  --bc-accent-50:  rgba(122,162,255,.12);
  --bc-accent-100: rgba(122,162,255,.20);
  --bc-focus-ring: 0 0 0 3px rgba(122,162,255,.40);

  --bc-success: #3FCB74; --bc-success-bg: rgba(63,203,116,.14); --bc-success-fg: #6FE0A0;
  --bc-warning: #FBBF24; --bc-warning-bg: rgba(251,191,36,.14); --bc-warning-fg: #FBD26A;
  --bc-danger:  #F87171; --bc-danger-bg:  rgba(248,113,113,.14); --bc-danger-fg:  #FCA5A5;
  --bc-info:    #38BDF8; --bc-info-bg:    rgba(56,189,248,.14);  --bc-info-fg:    #7DD3FC;
  --bc-neutral-bg: rgba(232,236,242,.08); --bc-neutral-fg: #C9D1DC;
  --bc-purple: #A899F5; --bc-purple-bg: rgba(168,153,245,.14); --bc-purple-fg: #C4B9FA;

  --bc-sh-xs: 0 0 0 1px rgba(232,236,242,.06);
  --bc-sh-sm: 0 1px 2px rgba(0,0,0,.5), 0 0 0 1px rgba(232,236,242,.06);
  --bc-sh-md: 0 4px 12px rgba(0,0,0,.5), 0 0 0 1px rgba(232,236,242,.08);
  --bc-sh-lg: 0 12px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(232,236,242,.08);
  --bc-sh-xl: 0 24px 56px rgba(0,0,0,.7), 0 0 0 1px rgba(232,236,242,.08);

  --bce-money-credit:   #6FE0A0;
  --bce-money-debit:    #E8ECF2;
  --bce-money-negative: #FCA5A5;
  --bce-viz-1: #7AA2FF; --bce-viz-2: #C9D1DC; --bce-viz-3: #38BDF8; --bce-viz-4: #A899F5; --bce-viz-5: #6B7684;
  --bce-viz-grid: rgba(232,236,242,.08); --bce-viz-axis: #6B7684; --bce-viz-prev: rgba(232,236,242,.35);
  --bce-viz-seq-1: #1E2E52; --bce-viz-seq-2: #2A4685; --bce-viz-seq-3: #3E68C4; --bce-viz-seq-4: #7AA2FF; --bce-viz-seq-5: #C4D4FF;
}
