/* MWEC design tokens and themes.
   Palette carried over from the MWEC Executive Panel (see FRONTEND_REUSE_AUDIT.md).
   Components use only these variables. Themes override them via [data-theme].
   Company and user overrides are applied at runtime by js/lib/theme.js. */

:root,
[data-theme="mwec-offshore"] {
  color-scheme: light;
  /* Brand */
  --brand-abyss: #071c2b;
  --brand-navy: #0d2b42;
  --brand-deep: #0b2a40;
  --brand-tide: #0f4a63;
  --brand-signal: #00a8df;

  /* Surfaces */
  --bg: #e6edf1;
  --bg-top: #d6e2e9;
  --surface: #ffffff;
  --surface-2: #f4f7f9;
  --surface-3: #eaf1f4;
  --line: #d7e1e8;
  --line-strong: #c3d2dc;

  /* Text */
  --ink: #12324a;
  --ink-strong: #0a2236;
  --muted: #546e80;
  --link-ink: #07598a;
  --status-info-ink: #07598a;
  --status-good-ink: #176044;
  --status-warning-ink: #774907;
  --status-bad-ink: #9c292b;
  --on-dark: #ffffff;
  --on-dark-muted: #9fb8c9;

  /* Accent and status */
  --accent: #0b8fca;
  --accent-2: #0a808a;
  --accent-soft: #e6f4fa;
  --ok: #1f8760;
  --ok-soft: #e8f4ee;
  --warn: #c9820b;
  --warn-soft: #fff3dd;
  --bad: #cd3d39;
  --bad-soft: #fceceb;
  --danger: #a91e25;
  --danger-band: #a51f25;
  --warning: #8e5204;
  --quality: #6a4f82;
  --ok-signal: #48cfaa;
  --executive-contour: rgba(101, 190, 221, .13);
  --executive-chart-plum: #9771ab;
  --executive-chart-olive: #668a46;
  --executive-chart-indigo: #566baf;
  --due-overdue-bar: #B52424;
  --due-overdue-tint: #FDECEC;
  --due-overdue-ink: #861B1B;
  --due-covered-bar: #1E63C6;
  --due-covered-tint: #EAF2FD;
  --due-covered-ink: #17428A;
  --due-soon-bar: #9A5600;
  --due-soon-tint: #FFF4E0;
  --due-soon-ink: #714100;
  --crit-a-ink: #fff;
  --crit-a-bg: #124759;
  --crit-b-ink: #16424c;
  --crit-b-bg: #b6e2e2;
  --crit-c-ink: #26434c;
  --crit-c-bg: #dce9eb;
  --info-soft: #eaf4fc;

  /* Chrome */
  --sidebar-bg: radial-gradient(90% 45% at 0 100%, rgba(0,168,223,.15), transparent 70%),
                linear-gradient(180deg, #102b43 0, #071c2b 100%);
  --sidebar-ink: #c7d7e2;
  --sidebar-group: #7ea3b8;
  --sidebar-active: #1b4a62;
  --header-bg: linear-gradient(105deg, #0d2b42 0, #0f4a63 100%);
  --table-head: #183f56;
  --table-head-ink: #ffffff;
  --table-zebra: #f7fafb;
  --focus: #00a8df;

  /* Type */
  --font-body: "Barlow", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", "Segoe UI", system-ui, Arial, sans-serif;
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 14px; --fs-lg: 18px; --fs-xl: 24px; --fs-kpi: 30px;

  /* Shape and density */
  --radius: 7px;
  --radius-sm: 4px;
  --gap: 14px;
  --pad: 14px;
  --row-pad: 9px;
  --sidebar-w: 232px;
  --shadow-1: 0 1px 2px rgba(9,36,56,.07);
  --shadow-2: 0 1px 2px rgba(9,36,56,.05), 0 12px 26px -16px rgba(9,36,56,.30);

  /* Chart palette (categorical, colour-blind aware order) */
  --chart-1: #0b8fca; --chart-2: #0a808a; --chart-3: #c9820b; --chart-4: #7b5ea7; --chart-5: #cd3d39; --chart-6: #5d7a8c;
}

[data-theme="mwec-night"] {
  color-scheme: dark;
  --bg: #08141e;
  --bg-top: #0b1c2a;
  --surface: #0f2231;
  --surface-2: #132a3b;
  --surface-3: #173246;
  --line: #21384a;
  --line-strong: #2d4a60;
  --ink: #dbe7ef;
  --ink-strong: #ffffff;
  --muted: #8ea7b8;
  --link-ink: #8bd4fa;
  --status-info-ink: #a0d9fc;
  --status-good-ink: #89dfb8;
  --status-warning-ink: #ffd17a;
  --status-bad-ink: #ffaba7;
  --accent: #33b8ea;
  --accent-2: #2fb3a6;
  --accent-soft: #0f3347;
  --ok: #3cbf8a; --ok-soft: #0f3326;
  --warn: #f0a93a; --warn-soft: #3a2a0d;
  --bad: #ff6b63; --bad-soft: #3d1615;
  --danger: #ff8b83;
  --warning: #f6b34b;
  --quality: #c2a9eb;
  --due-overdue-bar: #F26B6B;
  --due-overdue-tint: #352632;
  --due-overdue-ink: #FFB4B4;
  --due-covered-bar: #6EA8FE;
  --due-covered-tint: #1D354C;
  --due-covered-ink: #BBD6FF;
  --due-soon-bar: #F0B444;
  --due-soon-tint: #3C3429;
  --due-soon-ink: #FFD98A;
  --crit-a-ink: #ecfcff;
  --crit-a-bg: #17546b;
  --crit-b-ink: #c0f1ef;
  --crit-b-bg: #214949;
  --crit-c-ink: #d0e3e6;
  --crit-c-bg: #2c424a;
  --info-soft: #10314a;
  --sidebar-bg: linear-gradient(180deg, #06121b 0, #030a10 100%);
  --sidebar-active: #123247;
  --header-bg: linear-gradient(105deg, #06121b 0, #0d2b42 100%);
  --table-head: #132a3b;
  --table-zebra: #112637;
  --shadow-1: none;
  --shadow-2: 0 10px 30px -18px rgba(0,0,0,.8);
}

[data-theme="mwec-high-contrast"] {
  --bg: #ffffff; --bg-top: #ffffff; --surface: #ffffff; --surface-2: #f2f2f2; --surface-3: #e8e8e8;
  --line: #5a5a5a; --line-strong: #000000;
  --ink: #000000; --ink-strong: #000000; --muted: #2b2b2b;
  --accent: #0050a0; --accent-2: #00606a; --accent-soft: #dceaff;
  --ok: #006b3c; --warn: #8a4b00; --bad: #b00000;
  --table-head: #000000; --table-zebra: #f2f2f2; --focus: #ff9900;
}

/* Density */
[data-density="compact"] { --gap: 10px; --pad: 10px; --row-pad: 5px; --fs-kpi: 26px; }

@media (prefers-reduced-motion: reduce) { :root { --motion: 0; } }
[data-reduce-motion="true"] * { transition: none !important; animation: none !important; }
