/* ============================================================
   NewCo Executive Command Center - concept mockups
   Shared token system + skin overlays + shell components
   Skins: inframark (default) | newco | dataripple
   Sample data only. Built by DataRipple for concept review.
   ============================================================ */

/* ---------- Base tokens (Inframark skin = default) ---------- */
:root {
  --font: 'Mulish', 'Segoe UI', system-ui, sans-serif;

  --bg: #f2f7fa;
  --surface: #ffffff;
  --surface-2: #e9f2f7;
  --surface-3: #dcebf3;

  --ink: #101733;
  --ink-2: #3c456b;
  --ink-3: #5d6689;

  --border: #d7e3ec;
  --border-strong: #b6cbd8;

  --brand: #0d004c;            /* primary identity, active nav, selection */
  --brand-ink: #ffffff;
  --brand-soft: #ece9f8;       /* selected background tint */
  --accent: #008fd5;           /* informational accent (non-text) */
  --link: #0071ab;             /* passes 4.5:1 on white */

  --cta-bg: #afe327;           /* Inframark lime button */
  --cta-ink: #0d004c;
  --cta-hover: #9ccf1d;

  --focus: #008fd5;

  /* Status (chip = tinted bg + dark ink; never color alone) */
  --good-ink: #13612e;  --good-bg: #e3f2e8;  --good-dot: #1d8a44;
  --warn-ink: #7a4d00;  --warn-bg: #fcf0d7;  --warn-dot: #eaa317;
  --serious-ink: #a34400; --serious-bg: #fdeadd; --serious-dot: #f7630c;
  --crit-ink: #a81e04;  --crit-bg: #fbe7e2;  --crit-dot: #cf2607;
  --neutral-ink: #46507a; --neutral-bg: #edf0f6; --neutral-dot: #8b94b8;

  /* Charts - validated categorical set (shared across skins) */
  --chart-1: #008fd5;
  --chart-2: #6153cc;
  --chart-3: #7fae12;
  --chart-4: #00939b;

  /* Sequential (magnitude / aging), light -> dark, one hue */
  --seq-1: #cfe8f6; --seq-2: #8ec9ea; --seq-3: #4aa5da;
  --seq-4: #0f7fc0; --seq-5: #0b5c94; --seq-6: #123a66;

  --up: #13612e;
  --down: #a81e04;

  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --shadow-1: 0 1px 2px rgba(16, 23, 51, .06);
  --shadow-2: 0 4px 16px rgba(16, 23, 51, .10);
  --shadow-3: 0 12px 40px rgba(16, 23, 51, .18);

  --z-sticky: 20; --z-backdrop: 50; --z-drawer: 60; --z-modal: 70; --z-toast: 80;
}

/* ---------- NewCo skin (neutral placeholder brand) ---------- */
[data-skin="newco"] {
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #eef0f2;
  --surface-3: #e3e6ea;
  --ink: #16181d;
  --ink-2: #3f434c;
  --ink-3: #626871;
  --border: #dde1e6;
  --border-strong: #c2c8d0;
  --brand: #1f2937;
  --brand-ink: #ffffff;
  --brand-soft: #e8ecef;
  --accent: #0e8265;
  --link: #0c6e56;
  --cta-bg: #0e8265;
  --cta-ink: #ffffff;
  --cta-hover: #0a6b53;
  --focus: #0e8265;
}

/* ---------- DataRipple skin ---------- */
[data-skin="dataripple"] {
  --font: 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e2e7ee;
  --ink: #18293B;
  --ink-2: #3e4f63;
  --ink-3: #5f7085;
  --border: #dbe2ea;
  --border-strong: #bcc9d6;
  --brand: #1B2433;
  --brand-ink: #ffffff;
  --brand-soft: #e9edf3;
  --accent: #CC0C1F;
  --link: #1159af;
  --cta-bg: #CC0C1F;
  --cta-ink: #ffffff;
  --cta-hover: #A80917;
  --focus: #1159af;
  --crit-ink: #A80917; --crit-bg: #fae5e7; --crit-dot: #CC0C1F;
}

/* ---------- Reset-ish base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 16px;
  height: 58px; padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.lockup { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.lockup .mark { flex: 0 0 auto; }
.lockup .wordmark { font-weight: 800; font-size: 16px; letter-spacing: .02em; color: var(--brand); white-space: nowrap; }
.lockup .wordsub { font-size: 10px; color: var(--ink-3); letter-spacing: .04em; margin-top: -2px; white-space: nowrap; }
.topbar .vrule { width: 1px; height: 26px; background: var(--border-strong); }
.prodname { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.prodname .concept-tag { font-weight: 600; color: var(--ink-3); font-size: 12px; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.asof { font-size: 12px; color: var(--ink-3); white-space: nowrap; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.userchip {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
}
.userchip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}

/* Skin switcher */
.skin-switch {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.skin-switch button {
  font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.skin-switch button:hover { color: var(--ink); }
.skin-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  padding: 8px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2);
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--cta-bg); color: var(--cta-ink); border-color: transparent; }
.btn-primary:hover { background: var(--cta-hover); }
.btn-quiet { border-color: transparent; color: var(--link); }
.btn-quiet:hover { background: var(--surface-2); }

/* ---------- Status chips + RAG ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-ink);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--neutral-dot); }
.chip.good    { background: var(--good-bg);    color: var(--good-ink); }
.chip.good::before { background: var(--good-dot); }
.chip.warn    { background: var(--warn-bg);    color: var(--warn-ink); }
.chip.warn::before { background: var(--warn-dot); }
.chip.serious { background: var(--serious-bg); color: var(--serious-ink); }
.chip.serious::before { background: var(--serious-dot); }
.chip.crit    { background: var(--crit-bg);    color: var(--crit-ink); }
.chip.crit::before { background: var(--crit-dot); }
.chip.plain::before { display: none; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 7px; border-radius: 4px; white-space: nowrap;
  border: 1px solid var(--border-strong); color: var(--ink-3); background: var(--surface);
}

/* ---------- Drillable numbers ---------- */
.drill { cursor: pointer; border-radius: 4px; }
button.drill { text-align: inherit; }
.drill:hover { background: var(--brand-soft); }
.drill .v, .v { font-variant-numeric: tabular-nums; }
.drill-hint {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-3);
  border: 1px dashed var(--border-strong); border-radius: 999px; padding: 4px 12px;
  background: var(--surface);
}

/* ---------- KPI blocks ---------- */
.kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi .label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.kpi .sub { font-size: 11px; color: var(--ink-3); }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .delta { font-size: 11.5px; font-weight: 700; }
.delta.pos { color: var(--up); }
.delta.neg { color: var(--down); }
.delta.flat { color: var(--ink-3); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ink-3);
  padding: 7px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr.rowlink { cursor: pointer; }

/* ---------- Meters ---------- */
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--seq-4); }
.meter.good > i { background: var(--good-dot); }
.meter.warn > i { background: var(--warn-dot); }
.meter.crit > i { background: var(--crit-dot); }

/* ---------- Panels / sections ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.panel-h {
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 16px 0;
}
.panel-h h3 { font-size: 14px; font-weight: 800; }
.panel-h .formal { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.panel-b { padding: 12px 16px 16px; }

/* ---------- Drawer (drill-down) ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(16, 23, 51, .34);
  z-index: var(--z-backdrop); opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw;
  background: var(--surface); z-index: var(--z-drawer);
  box-shadow: var(--shadow-3);
  transform: translateX(102%);
  transition: transform .24s cubic-bezier(.165, .84, .44, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-h {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.drawer-h .t { flex: 1; min-width: 0; }
.drawer-h h3 { font-size: 15px; font-weight: 800; }
.drawer-h .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.drawer-close {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--r-md);
  display: grid; place-items: center; color: var(--ink-3); font-size: 16px;
}
.drawer-close:hover { background: var(--surface-2); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.drawer-item {
  width: 100%; display: block; text-align: left;
  padding: 10px 10px; border-radius: var(--r-md);
  border-bottom: 1px solid var(--border);
}
.drawer-item:hover { background: var(--surface-2); }
.drawer-item .row1 { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.drawer-item .p { font-size: 13px; font-weight: 700; color: var(--ink); }
.drawer-item .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.drawer-item .amt { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drawer-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--link);
  padding: 6px 8px; border-radius: var(--r-md); margin: 6px 0 2px;
}
.drawer-back:hover { background: var(--surface-2); }
.rec { padding: 6px 8px 20px; }
.rec h4 { font-size: 16px; font-weight: 800; margin: 6px 0 2px; }
.rec .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.rec dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 12px 0; font-size: 12.5px; }
.rec dt { color: var(--ink-3); font-weight: 600; }
.rec dd { color: var(--ink); font-weight: 600; }
.rec .tl-h { font-size: 11.5px; font-weight: 800; color: var(--ink-3); margin: 14px 0 6px; }
.tl { list-style: none; }
.tl li { position: relative; padding: 0 0 14px 20px; }
.tl li::before {
  content: ""; position: absolute; left: 5px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.tl li::after {
  content: ""; position: absolute; left: 8px; top: 16px; bottom: -2px;
  width: 1px; background: var(--border-strong);
}
.tl li:last-child::after { display: none; }
.tl .when { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.tl .what { font-size: 12.5px; color: var(--ink); margin-top: 1px; }
.tl .who { font-size: 11.5px; color: var(--ink-3); }

/* ---------- Modal (daily briefing) ---------- */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 680px; max-width: 100%; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: 22px 24px;
}
.modal-card h3 { font-size: 17px; font-weight: 800; }
.modal-card .meta { font-size: 12px; color: var(--ink-3); margin: 2px 0 12px; }
.modal-card p { font-size: 13.5px; color: var(--ink-2); margin: 0 0 10px; max-width: 68ch; }
.modal-card p strong { color: var(--ink); }

/* ---------- Integration footer strip ---------- */
.intstrip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  padding: 10px 20px; border-top: 1px solid var(--border);
  background: var(--surface); font-size: 11.5px; color: var(--ink-3);
}
.intstrip .sys { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.intstrip .sys:hover { background: var(--surface-2); }
.intstrip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good-dot); }
.intstrip .dot.warn { background: var(--warn-dot); }
.intstrip .dot.off { background: var(--neutral-dot); }

/* ---------- Source-capture tags (combined concepts) ---------- */
.via {
  font-style: italic; font-size: 11px; font-weight: 600;
  color: var(--ink-3); white-space: nowrap;
}
.capline {
  font-style: italic; font-size: 12px; font-weight: 600; color: var(--ink-3);
  padding: 2px 4px; border-radius: 4px; text-align: left;
}
.capline:hover { background: var(--surface-2); color: var(--ink-2); }
.capline .capword { font-style: normal; font-weight: 700; }

/* ---------- Gate cards (critical path, lineage) ---------- */
.gate { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; text-align: left; background: var(--surface); }
.gate:hover { background: var(--surface-2); }
.gate .gd { display: block; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.gate .gt { display: block; font-size: 13px; font-weight: 800; margin: 2px 0; color: var(--ink); }
.gate .gs { display: block; font-size: 11px; color: var(--ink-3); }

/* ---------- Sample data note ---------- */
.samplenote {
  font-size: 11.5px; color: var(--ink-3);
  padding: 14px 20px 22px; text-align: center;
}

/* ---------- Sparks ---------- */
.spark { display: inline-block; vertical-align: middle; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .fillarea { fill: var(--accent); opacity: .12; stroke: none; }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
