/* =====================================================================
   Connectwell UI kit — design tokens (one Connectwell look; light and dark).
   Every kit rule reads these. Bootstrap, Syncfusion grid and the older page
   variables (--cis-grid-*) are pointed at them so existing pages follow.
   Theme: <html data-theme="light|dark"> (set before first paint in _Layout).
   ===================================================================== */
:root {
  color-scheme: light;
  --accent: #e31f24;
  --accent-hover: #bb2d3b;
  --accent-soft: #fde9ea;
  --accent-line: #f6b9bb;
  --accent-ink: #a3161a;
  --accent-ring: rgba(227, 31, 36, .16);

  --ink: #0e1526;
  --text: #1f2937;
  --text-2: #475569;
  --muted: #6b7280;
  --faint: #9aa3af;
  --line: #e5e7eb;
  --line-2: #eef1f4;
  --line-strong: #cbd2da;
  --bg: #f5f6f8;
  --card: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #fbfcfd;
  --hover: #f5f7f9;
  --row-hover: #fafbfd;
  --chip-bg: #eef1f5;
  --title: #2c3e50;
  --inverse: #0e1526;
  --on-inverse: #ffffff;
  --scrim: rgba(15, 23, 42, .45);

  --ok: #0e7a3b;   --ok-bg: #ecfdf5;   --ok-line: #a7f3d0;   --ok-hover: #0b5f2e;
  --wip: #b45309;  --wip-bg: #fffbeb;  --wip-line: #fcd34d;
  --crit: #c81e1e; --crit-bg: #fef2f2; --crit-line: #fecaca;
  --info: #1d4ed8; --info-bg: #e8eefc; --info-line: #bfd0f7;
  --idle: #64748b; --idle-bg: #f1f5f9; --idle-line: #cbd5e1;

  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 14px;
  --fs-h3: 15px; --fs-h2: 18px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --sh-2: 0 8px 24px rgba(15, 23, 42, .12);
  --sh-3: 0 24px 64px rgba(16, 24, 40, .28);
  --h-btn: 33px; --h-input: 35px; --h-top: 60px;
  --sb-w: 250px; --sb-rail: 60px;
  --fs-grid: 12px; --fs-grid-head: 11.5px; --fs-kpi: 24px;
  --mark: #fff2a8;
  --tip-bg: #0e1526; --tip-text: #ffffff;
  /* Chart series: fixed categorical order, never cycled */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --grid-line: #eceff3;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #ef4a4e;
  --accent-hover: #f26b6e;
  --accent-soft: #3a1d21;
  --accent-line: #6e2a2f;
  --accent-ink: #f7a5a7;
  --accent-ring: rgba(239, 74, 78, .32);

  --ink: #f1f3f7;
  --text: #d7dce4;
  --text-2: #aeb6c3;
  --muted: #8a93a2;
  --faint: #687180;
  --line: #2b313c;
  --line-2: #232831;
  --line-strong: #3b4351;
  --bg: #0e1116;
  --card: #161a21;
  --surface-2: #1b2028;
  --surface-3: #191d24;
  --hover: #20252e;
  --row-hover: #1c2129;
  --chip-bg: #262c36;
  --title: #e8ebf0;
  --inverse: #e8ebf0;
  --on-inverse: #0e1116;
  --scrim: rgba(0, 0, 0, .6);

  --ok: #3dbb72;  --ok-bg: rgba(61, 187, 114, .13);  --ok-line: rgba(61, 187, 114, .38);  --ok-hover: #2fa262;
  --wip: #e8a53a; --wip-bg: rgba(232, 165, 58, .13); --wip-line: rgba(232, 165, 58, .38);
  --crit: #f06a65; --crit-bg: rgba(240, 106, 101, .13); --crit-line: rgba(240, 106, 101, .38);
  --info: #6aa2ff; --info-bg: rgba(106, 162, 255, .13); --info-line: rgba(106, 162, 255, .38);
  --idle: #98a2b3; --idle-bg: rgba(152, 162, 179, .13); --idle-line: rgba(152, 162, 179, .32);

  --sh-1: 0 1px 2px rgba(0, 0, 0, .45);
  --sh-2: 0 8px 24px rgba(0, 0, 0, .5);
  --sh-3: 0 24px 64px rgba(0, 0, 0, .65);
  --mark: rgba(250, 204, 21, .32);
  --tip-bg: #e8ebf0; --tip-text: #0e1116;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  --grid-line: #262b34;
}

/* ---- Bootstrap 5.3 follows the kit (data-bs-theme is set alongside data-theme) ---- */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] {
  --bs-font-sans-serif: var(--font);
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--r-md);
  --bs-border-radius-sm: var(--r-sm);
  --bs-border-radius-lg: var(--r-lg);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 227, 31, 36;
  --bs-danger: var(--accent);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-hover);
  --bs-link-color-rgb: 227, 31, 36;
  --bs-link-hover-color-rgb: 187, 45, 59;
  --bs-focus-ring-color: var(--accent-ring);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--hover);
}
:root[data-theme="dark"] {
  --bs-primary-rgb: 239, 74, 78;
  --bs-link-color-rgb: 239, 74, 78;
  --bs-link-hover-color-rgb: 242, 107, 110;
}

/* ---- Grid variables used by grid-status-ux.css (same grid look, colours from the kit) ---- */
:root {
  --cis-grid-accent: var(--accent);
  --cis-grid-accent-soft: var(--accent-soft);
}
:root[data-theme="dark"] {
  --cis-grid-border: var(--line);
  --cis-grid-line: var(--line-2);
  --cis-grid-header-bg: #232a35;
  --cis-grid-header-bg-hover: #2a323f;
  --cis-grid-header-text: var(--ink);
  --cis-grid-toolbar-bg: var(--surface-2);
  --cis-grid-surface: var(--card);
  --cis-grid-text: var(--text);
  --cis-grid-muted: var(--muted);
  --cis-grid-row-hover: var(--row-hover);
}
