/* Next Gen Dashboards — estilos compartidos por todos los dashboards.
   Estructura: menú lateral oscuro (marca) + contenido claro con tarjetas redondeadas,
   banner principal oscuro, KPIs con ícono y pastilla de variación.
   Paleta de datos: referencia validada (dataviz). Acento = azul #2a78d6 del logo. */

:root {
  color-scheme: light;
  --page: #eaf1fa;
  --page-2: #f6f9fd;
  --surface-1: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #eceef3;
  --text-primary: #0f1222;
  --text-secondary: #545869;
  --text-muted: #7a7e8c;
  --grid: #e6e7ec;
  --axis: #c9cbd3;
  --border: #e6e7ec;
  --brand-navy: #070b2a;
  --brand-navy-2: #111a48;
  --brand-ink: #e6eaf2;
  --brand-ink-2: rgba(230, 234, 242, .62);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --accent-soft-2: rgba(42, 120, 214, 0.18);
  --de-emphasis: #bcc0cb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100; --series-5: #e87ba4;
  --seq-100: #cde2fb; --seq-200: #9ec5f4; --seq-300: #6da7ec; --seq-400: #3987e5;
  --seq-500: #256abf; --seq-600: #184f95; --seq-700: #0d366b;
  --div-neg: #d03b3b; --div-mid: #eeeff2; --div-pos: #2a78d6;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #0b7a2e; --good-bg: #e6f6ea;
  --light-off: rgba(110, 120, 140, .22); --light-case: #1d2433;
  --bad-text: #b42323; --bad-bg: #fdecec;
  --warn-text: #8a5a00; --warn-bg: #fff4dc;
  --shadow: 0 1px 2px rgba(15, 18, 34, 0.04);
  --radius: 14px;
  --side-w: 240px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Barlow Condensed", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  --timebar-bg: var(--surface-1);
  --page-2: #0b0d14;
    --page: #0b0d14; --surface-1: #151823; --surface-2: #1b1f2c; --surface-3: #232838;
    --text-primary: #eef0f5; --text-secondary: #b7bbc8; --text-muted: #8c90a0;
    --grid: #262a38; --axis: #343949; --border: #252a38;
    --accent: #3987e5; --accent-soft: rgba(57, 135, 229, 0.16); --accent-soft-2: rgba(57, 135, 229, 0.26);
    --de-emphasis: #4a4f60;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
    --seq-100: #13284a; --seq-200: #184f95; --seq-300: #1c5cab; --seq-400: #256abf;
    --seq-500: #3987e5; --seq-600: #6da7ec; --seq-700: #b7d3f6;
    --div-neg: #e66767; --div-mid: #2a2f3e; --div-pos: #3987e5;
    --good-text: #3ccf6a; --good-bg: rgba(12, 163, 12, .16); --light-off: rgba(255, 255, 255, .14); --light-case: #05070c; --kpi-badge-bg: rgba(6, 9, 20, .72);
    --bad-text: #ff8a8a; --bad-bg: rgba(208, 59, 59, .18);
    --warn-text: #f5c25a; --warn-bg: rgba(250, 178, 25, .14);
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --timebar-bg: var(--surface-1);
  --page-2: #0b0d14;
  --page: #0b0d14; --surface-1: #151823; --surface-2: #1b1f2c; --surface-3: #232838;
  --text-primary: #eef0f5; --text-secondary: #b7bbc8; --text-muted: #8c90a0;
  --grid: #262a38; --axis: #343949; --border: #252a38;
  --accent: #3987e5; --accent-soft: rgba(57, 135, 229, 0.16); --accent-soft-2: rgba(57, 135, 229, 0.26);
  --de-emphasis: #4a4f60;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
  --seq-100: #13284a; --seq-200: #184f95; --seq-300: #1c5cab; --seq-400: #256abf;
  --seq-500: #3987e5; --seq-600: #6da7ec; --seq-700: #b7d3f6;
  --div-neg: #e66767; --div-mid: #2a2f3e; --div-pos: #3987e5;
  --good-text: #3ccf6a; --good-bg: rgba(12, 163, 12, .16); --light-off: rgba(255, 255, 255, .14); --light-case: #05070c; --kpi-badge-bg: rgba(6, 9, 20, .72);
  --bad-text: #ff8a8a; --bad-bg: rgba(208, 59, 59, .18);
  --warn-text: #f5c25a; --warn-bg: rgba(250, 178, 25, .14);
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: linear-gradient(180deg, var(--page) 0%, var(--page-2, var(--page)) 100%) fixed;
  color: var(--text-primary);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
svg.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ══════════ Estructura: menú lateral + contenido ══════════ */
.ngd-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.ngd-side {
  background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
  color: var(--brand-ink); padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.ngd-logo {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; padding: 0 10px 16px;
  font-family: var(--font-brand); font-weight: 600; letter-spacing: .02em; line-height: 1;
}
.ngd-logo__small { display: flex; flex-direction: column; font-size: 12.5px; text-align: right; }
.ngd-logo__big { font-size: 28px; }
.ngd-logo { flex-wrap: wrap; }
.ngd-logo__by { flex-basis: 100%; font-family: var(--font); font-size: 11.5px; font-weight: 500; letter-spacing: .04em; color: var(--brand-ink-2); margin-top: 6px; padding-left: 2px; }
.ngd-side__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-ink-2); padding: 14px 12px 6px; }
.ngd-nav { display: flex; flex-direction: column; gap: 2px; }
.ngd-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--brand-ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.ngd-nav a:hover { background: rgba(230, 234, 242, .07); color: var(--brand-ink); }
.ngd-nav a.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.ngd-nav a .soon { margin-left: auto; font-size: 10.5px; color: var(--brand-ink-2); border: 1px solid rgba(230,234,242,.18); border-radius: 999px; padding: 0 7px; }
.ngd-side__spacer { flex: 1; }
.ngd-switch {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 0;
  background: transparent; color: var(--brand-ink-2); cursor: pointer; font-size: 13.5px; width: 100%; text-align: left;
}
.ngd-switch:hover { background: rgba(230, 234, 242, .07); color: var(--brand-ink); }
.ngd-switch__track { margin-left: auto; width: 34px; height: 20px; border-radius: 999px; background: rgba(230,234,242,.22); position: relative; transition: background .2s; }
.ngd-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ngd-switch[aria-checked="true"] .ngd-switch__track { background: var(--accent); }
.ngd-switch[aria-checked="true"] .ngd-switch__track::after { transform: translateX(14px); }

.ngd-content { min-width: 0; }

/* ══════════ Encabezado: título, pestañas a la izquierda, filtros a la derecha ══════════ */
.ngd-head { background: var(--surface-1); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.ngd-head__row { display: flex; align-items: center; gap: 16px; padding: 16px 28px 0; }
.ngd-head__title { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.ngd-head__crumb { font-size: 12.5px; color: var(--text-muted); }
.ngd-head__spacer { flex: 1; }
.ngd-head__bar { display: flex; align-items: flex-end; gap: 12px; padding: 4px 28px 0; flex-wrap: wrap; }
.ngd-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ngd-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px 11px; cursor: pointer;
  color: var(--text-secondary); font-weight: 500; margin-bottom: -1px;
}
.ngd-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ngd-tab:hover { color: var(--text-primary); }
.ngd-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; padding-bottom: 8px; }
.ngd-pick {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-1);
  border-radius: 10px; padding: 0 0 0 10px; color: var(--text-secondary); font-size: 12.5px; height: 34px;
}
.ngd-pick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ngd-pick select {
  appearance: none; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a7e8c' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding: 0 28px 0 0; height: 32px; cursor: pointer; color: var(--text-primary); font-weight: 500; font-size: 12.5px; max-width: 190px;
}
.ngd-pick select:focus { outline: none; }
.ngd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; border: 1px solid var(--border); background: var(--surface-1);
  border-radius: 10px; padding: 0 12px; cursor: pointer; font-size: 12.5px; color: var(--text-secondary); font-weight: 500;
}
.ngd-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.ngd-btn:focus-visible, .ngd-tab:focus-visible, .ngd-nav a:focus-visible, .ngd-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ══════════ Blue header (title, tabs, filters, time bar) ══════════ */
.ngd-head {
  background: radial-gradient(70% 140% at 90% -10%, rgba(80, 150, 255, .45) 0%, transparent 60%), linear-gradient(110deg, #0a1f5c 0%, #1747a6 58%, #1f63d6 100%);
  border-bottom: 0; color: var(--brand-ink); border-bottom-right-radius: 56px; box-shadow: 0 10px 30px rgba(10, 31, 92, .18);
}
.ngd-head .ngd-head__crumb { color: var(--brand-ink-2); }
.ngd-head .ngd-head__title { color: #fff; }
.ngd-head .ngd-tab { color: var(--brand-ink-2); border-bottom-width: 4px; padding-bottom: 9px; }   /* same height active or not */
.ngd-head .ngd-tab:hover { color: #fff; }
/* active tab: gold, thick, with a soft glow — the one gold accent of the header (Zoe, 17-oct) */
.ngd-head .ngd-tab[aria-selected="true"] { color: #fff; font-weight: 600; border-bottom: 4px solid #f2c14e; box-shadow: 0 6px 12px -8px rgba(242, 193, 78, .9); }
.ngd-head .ngd-pick, .ngd-head .ngd-btn, .ngd-head .ngd-chip { background: rgba(12, 38, 104, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-color: rgba(230, 234, 242, .18); color: var(--brand-ink-2); }
.ngd-head .ngd-btn:hover, .ngd-head .ngd-chip:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ngd-head .ngd-chip[aria-pressed="true"] { background: rgba(57, 135, 229, .30); border-color: #6da7ec; color: #fff; }
.ngd-head .ngd-ms__val { color: #fff; }
.ngd-head .ngd-ms__chev { color: var(--brand-ink-2); }
.ngd-head .ngd-ms.is-filtered .ngd-ms__btn { background: rgba(57, 135, 229, .28); border-color: #6da7ec; }
.ngd-head .ngd-ms.is-filtered .ngd-ms__val { color: #fff; }
.ngd-head .ngd-pick:focus-within { border-color: #6da7ec; box-shadow: 0 0 0 3px rgba(109, 167, 236, .25); }
.ngd-head .ngd-ms__pop { color: var(--text-primary); }
[hidden] { display: none !important; }    /* component display rules must never un-hide an element */
.ngd-head .ngd-selchip { background: rgba(57, 135, 229, .38); border-color: #6da7ec; color: #fff; }
.ngd-head .ngd-selchip:hover { background: rgba(57, 135, 229, .55); }
/* sector pattern + sector tag on the right of the blue header */
.ngd-head__blue { position: relative; }
.ngd-head__blue > *:not(.ngd-head__art) { position: relative; z-index: 1; }
.ngd-head__art {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: .15;
  background-repeat: repeat; background-size: 176px 120px; background-position: left top;
  -webkit-mask-image: linear-gradient(to right, #000 30%, transparent 62%); mask-image: linear-gradient(to right, #000 30%, transparent 62%);
}
.ngd-head__sector { display: flex; align-items: center; gap: 10px; color: var(--brand-ink); text-align: right; }
.ngd-head__sector svg { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; order: 2; }
.ngd-head__sector span { display: flex; flex-direction: column; line-height: 1.25; }
.ngd-head__sector b { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.ngd-head__sector small { font-size: 12px; color: var(--brand-ink-2); }
@media (max-width: 640px) { .ngd-head__sector { display: none; } .ngd-head__art { width: 100%; opacity: .1; } }

/* the time bar sits on a light strip under the blue header: blue only on the accents */
.ngd-head .ngd-timebar {
  background: var(--timebar-bg, linear-gradient(90deg, #f8fbff 0%, #eef4fd 100%)); color: var(--text-primary);
  border-top: 0; border-bottom-right-radius: 56px; border-bottom: 1px solid var(--border);
}
.ngd-head .ngd-timebar .ngd-chip { background: var(--surface-1); border-color: var(--border); color: var(--text-secondary); }
.ngd-head .ngd-timebar .ngd-chip:hover { background: var(--surface-2); color: var(--text-primary); }
.ngd-head .ngd-timebar .ngd-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ngd-range { --spark-line: var(--de-emphasis); --spark-fill: var(--surface-3); }
/* dropdown filters on the light time strip (17-oct): light controls, left-aligned, so a new selection chip never moves anything */
.ngd-head .ngd-filters--strip { margin: 0 0 8px; padding: 0; justify-content: flex-start; }
.ngd-head .ngd-filters--strip .ngd-pick, .ngd-head .ngd-filters--strip .ngd-btn { background: var(--surface-1); border-color: var(--border); color: var(--text-secondary); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ngd-head .ngd-filters--strip .ngd-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.ngd-head .ngd-filters--strip .ngd-ms__val { color: var(--text-primary); }
.ngd-head .ngd-filters--strip .ngd-ms__chev { color: var(--text-muted); }
.ngd-head .ngd-filters--strip .ngd-ms.is-filtered .ngd-ms__btn { background: var(--accent-soft); border-color: var(--accent); }
.ngd-head .ngd-filters--strip .ngd-ms.is-filtered .ngd-ms__val { color: var(--accent); }
.ngd-head .ngd-filters--strip .ngd-pick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ngd-head .ngd-timebar .ngd-selchip { background: var(--accent); border-color: var(--accent); color: #fff; height: 28px; margin-left: 12px; font-size: 12px; }
.ngd-head .ngd-timebar .ngd-selchip:hover { background: var(--accent); filter: brightness(1.08); }
.ngd-head .ngd-filters--strip .ngd-ms__pop { left: 0; right: auto; }
.ngd-head .ngd-filters--strip .ngd-ms__btn { width: 188px; justify-content: space-between; }   /* fixed width: picking a value never pushes the next filter */
.ngd-head .ngd-filters--strip .ngd-ms__val { flex: 1; min-width: 0; max-width: none; text-align: left; }
@media (max-width: 640px) { .ngd-head .ngd-filters--strip .ngd-ms__btn { width: 100%; } }
.ngd-head .ngd-head__bar { padding-bottom: 0; }

/* ══════════ Multi-select dropdown ══════════ */
.ngd-ms { position: relative; }
.ngd-ms__btn { cursor: pointer; padding: 0 10px; gap: 6px; }
.ngd-ms__val { color: var(--text-primary); font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ngd-ms__chev { width: 14px; height: 14px; color: var(--text-muted); }
.ngd-ms.is-filtered .ngd-ms__btn { border-color: var(--accent); background: var(--accent-soft); }
.ngd-ms.is-filtered .ngd-ms__val { color: var(--accent); }
.ngd-ms__pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 240px; max-width: 320px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 8px;
  box-shadow: 0 12px 32px rgba(15, 18, 34, .16);
}
.ngd-ms__search { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--surface-2); margin-bottom: 6px; }
.ngd-ms__acts { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 6px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--grid); margin-bottom: 4px; }
.ngd-ms__all { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.ngd-ms__list { max-height: 300px; overflow-y: auto; }
.ngd-ms__opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.ngd-ms__opt:hover { background: var(--surface-2); }
.ngd-ms__opt input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; }
.ngd-ms__opt small { margin-left: auto; color: var(--text-muted); font-size: 11.5px; }

/* ══════════ Time range slider ══════════ */
.ngd-timebar { padding: 10px 28px 8px; border-top: 1px solid var(--border); }
.ngd-range__top { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 6px; }
.ngd-range__label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.ngd-range__label svg { color: var(--accent); }
.ngd-range__presets { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ngd-range__body { position: relative; height: 52px; }
.ngd-range__spark { position: absolute; left: 0; right: 0; top: 0; bottom: 16px; }
.ngd-range__sel {
  position: absolute; top: 0; bottom: 16px; background: var(--accent-soft-2); border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent); border-radius: 4px; pointer-events: none;
}
.ngd-range__track { position: absolute; left: 0; right: 0; bottom: 6px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.ngd-range__fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }
.ngd-range__in {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 16px; margin: 0; padding: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.ngd-range__in::-webkit-slider-runnable-track { background: transparent; height: 16px; }
.ngd-range__in::-moz-range-track { background: transparent; }
.ngd-range__in::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: -1px; border-radius: 50%;
  background: var(--surface-1); border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: grab;
}
.ngd-range__in::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-1);
  border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: grab;
}
.ngd-range__in:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.1); }
.ngd-range__in:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent-soft-2); outline-offset: 2px; }
.ngd-range__in:focus-visible::-moz-range-thumb { outline: 3px solid var(--accent-soft-2); outline-offset: 2px; }
.ngd-range__ticks { position: relative; height: 16px; font-size: 11px; color: var(--text-muted); }
.ngd-range__ticks span { position: absolute; top: 0; }

.ngd-main { padding: 24px 28px 64px; max-width: 1560px; }

/* ══════════ Banner principal (claro; tokens → también sirve en modo oscuro) ══════════ */
.ngd-hero {
  background: radial-gradient(90% 160% at 100% 0%, var(--accent-soft) 0%, transparent 60%), var(--surface-1);
  color: var(--text-primary); border: 1px solid var(--border); border-radius: 20px; padding: 26px 28px; margin-bottom: 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; position: relative; overflow: hidden;
  box-shadow: 0 6px 24px rgba(10, 31, 92, .06);
}
.ngd-hero__eyebrow { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.ngd-hero__eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); border-radius: 2px; }
.ngd-hero__q { font-size: 27px; line-height: 1.22; font-weight: 700; margin: 10px 0 8px; letter-spacing: -.015em; max-width: 760px; }
.ngd-hero__sub { color: var(--text-secondary); margin: 0 0 16px; max-width: 720px; }
.ngd-stories { display: flex; flex-wrap: wrap; gap: 8px; }
.ngd-story {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary);
  border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: 12.5px; text-align: left; display: flex; gap: 8px; align-items: center;
}
.ngd-story:hover { background: var(--accent-soft); border-color: var(--accent); }
.ngd-story[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.ngd-story__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.ngd-story[aria-pressed="true"] .ngd-story__dot { background: #fff; }
.ngd-story__d { display: none; }
.ngd-hero__nums { display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--border); padding-left: 24px; min-width: 220px; gap: 16px; }
.ngd-hero__num b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; color: var(--text-primary); }
.ngd-hero__num span { font-size: 12px; color: var(--text-secondary); }
.ngd-hero__num em { font-style: normal; font-size: 12px; font-weight: 600; margin-left: 6px; }
.ngd-hero__num em.up { color: var(--good-text); } .ngd-hero__num em.down { color: var(--bad-text); }

/* ══════════ Tarjetas KPI ══════════ */
.ngd-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.ngd-kpi {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 16px 12px; min-width: 0; position: relative;
}
.ngd-kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ngd-kpi__icon { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ngd-kpi__label { font-size: 13px; color: var(--text-secondary); margin-top: 12px; }
.ngd-kpi__value { font-size: 27px; font-weight: 700; letter-spacing: -.015em; margin: 2px 0 6px; white-space: nowrap; }
.ngd-kpi__delta { font-size: 12px; color: var(--text-muted); min-height: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ngd-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.ngd-pill--good { color: var(--good-text); background: var(--good-bg); }
.ngd-pill--bad { color: var(--bad-text); background: var(--bad-bg); }
.ngd-pill--warn { color: var(--warn-text); background: var(--warn-bg); }
.ngd-pill--neutral { color: var(--text-secondary); background: var(--surface-2); }
/* goals: traffic light + word, trend arrow + value */
.ngd-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; 
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .2), 0 1px 2px rgba(0, 0, 0, .18); }
.ngd-dot--good { background: radial-gradient(circle at 35% 30%, #a6f5b6 0%, #3cc45c 42%, #16893a 100%); }
.ngd-dot--warn { background: radial-gradient(circle at 35% 30%, #ffe6a0 0%, #f6b62c 42%, #c78700 100%); }
.ngd-dot--bad { background: radial-gradient(circle at 35% 30%, #ffb0b0 0%, #e34d4d 42%, #a52222 100%); }
.ngd-goal { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ngd-goal--good { color: var(--good-text); } .ngd-goal--warn { color: var(--warn-text); } .ngd-goal--bad { color: var(--bad-text); }
.ngd-trend { width: 17px; height: 17px; flex: none; }
.ngd-pill .ngd-trend { width: 13px; height: 13px; }
.ngd-tr { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 600; }
.ngd-tr--good { color: var(--good-text); } .ngd-tr--bad { color: var(--bad-text); } .ngd-tr--neutral { color: var(--text-secondary); }
td.num .ngd-goal, td.num .ngd-tr { justify-content: flex-end; }
.ngd-kpi__spark { height: 34px; margin-top: 8px; }
.ngd-meter { height: 8px; border-radius: 4px; background: var(--accent-soft-2); margin-top: 14px; overflow: hidden; }
.ngd-meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

/* KPI tiles as solid color blocks (white text). Darker stops sit under the text for contrast. */
.ngd-kpis > .ngd-kpi { color: #fff; border: 0; box-shadow: 0 8px 22px rgba(15, 35, 90, .14);
  --kpi-spark: rgba(255, 255, 255, .38); --kpi-spark-last: #fff; }
.ngd-kpis > .ngd-kpi:nth-child(5n+1) { background: linear-gradient(135deg, #0f3a8a 0%, #2368d4 100%); }
.ngd-kpis > .ngd-kpi:nth-child(5n+2) { background: linear-gradient(135deg, #075f98 0%, #1494d6 100%); }
.ngd-kpis > .ngd-kpi:nth-child(5n+3) { background: linear-gradient(135deg, #06684f 0%, #0f9a72 100%); }
.ngd-kpis > .ngd-kpi:nth-child(5n+4) { background: linear-gradient(135deg, #4a2a91 0%, #7d4fc4 100%); }
.ngd-kpis > .ngd-kpi:nth-child(5n+5) { background: linear-gradient(135deg, #22307e 0%, #4659c8 100%); }
.ngd-kpis > .ngd-kpi .ngd-kpi__icon { background: rgba(255, 255, 255, .18); color: #fff; }
.ngd-kpis > .ngd-kpi .ngd-kpi__label { color: rgba(255, 255, 255, .85); }
.ngd-kpis > .ngd-kpi .ngd-kpi__delta { color: rgba(255, 255, 255, .78); }
.ngd-kpis > .ngd-kpi .ngd-kpi__delta .ngd-pill { background: rgba(255, 255, 255, .2); color: #fff; }
.ngd-kpis > .ngd-kpi .ngd-kpi__badge.ngd-goal { background: var(--kpi-badge-bg, #fff); border-radius: 8px; padding: 3px 9px 3px 6px; }
.ngd-kpis > .ngd-kpi .ngd-meter { background: rgba(255, 255, 255, .25); }
.ngd-kpis > .ngd-kpi .ngd-meter > i { background: #fff; }

/* ══════════ Rejilla de tarjetas ══════════ */
.ngd-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.ngd-card {
  grid-column: span 6; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 14px; min-width: 0;
  display: flex; flex-direction: column;
}
.ngd-card--wide { grid-column: span 12; }
.ngd-card--third { grid-column: span 4; }
.ngd-card--third .ngd-card__head { flex-direction: column; gap: 8px; }
.ngd-card--two-thirds { grid-column: span 8; }
.ngd-card__head { display: flex; align-items: flex-start; gap: 12px; }
.ngd-card__titles { flex: 1; min-width: 0; }
.ngd-card__title { font-size: 16.5px; font-weight: 700; margin: 0; letter-spacing: -.005em; }
.ngd-card__sub { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 0; }
.ngd-card__tools { display: flex; gap: 6px; flex: none; }
.ngd-chip {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; font-weight: 500;
}
.ngd-chip:hover, .ngd-chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.ngd-why {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border-left: 3px solid var(--accent);
  font-size: 13px; color: var(--text-primary); display: none;
}
.ngd-why.is-open { display: block; }
.ngd-hint { margin: 4px 0 0; font-size: 12px; color: var(--accent); font-weight: 500; }
.ngd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.ngd-crumbs button { border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.ngd-crumbs button:hover { background: var(--accent-soft-2); }
.ngd-crumbs .sep { color: var(--text-muted); }
.ngd-crumbs .cur { font-weight: 600; color: var(--text-primary); }
.ngd-why b { font-weight: 700; }
.ngd-chart { width: 100%; height: 300px; margin-top: 10px; }
.ngd-chart--tall { height: 420px; }
.ngd-card__note { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }
.ngd-tablewrap { display: none; margin-top: 12px; max-height: 380px; overflow: auto; }
.ngd-card.is-table .ngd-tablewrap { display: block; }
.ngd-card.is-table .ngd-chart { display: none; }
.ngd-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); }
.ngd-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ngd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ngd-legend i.line { height: 3px; width: 16px; border-radius: 2px; }

/* tarjeta de meta grande */
.ngd-goal__big { font-size: 46px; font-weight: 700; letter-spacing: -.02em; line-height: 1; margin: 12px 0 2px; }
.ngd-goal__sub { font-size: 12.5px; color: var(--text-muted); }

/* ══════════ Tablas ══════════ */
table.ngd-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ngd-table th, .ngd-table td { padding: 10px 12px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; }
.ngd-table th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-secondary); font-weight: 600; font-size: 12px; border-bottom: 0; }
.ngd-table th:first-child { border-radius: 8px 0 0 8px; }
.ngd-table th:last-child { border-radius: 0 8px 8px 0; }
.ngd-table td.num, .ngd-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ngd-table td.ctr, .ngd-table th.ctr { text-align: center; }
.ngd-table td.ctr .ngd-goal, .ngd-table td.ctr .ngd-tr { justify-content: center; }
/* scorecard head: overall progress (value · target · light · slope) */
.ngd-sc { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.ngd-sc__item { display: flex; flex-direction: column; gap: 2px; }
.ngd-sc__item small { font-size: 11.5px; color: var(--text-muted); }
.ngd-sc__item span { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ngd-sc__item span .ngd-tr--good, .ngd-sc__item span .ngd-tr--bad { display: inline-flex; }
.ngd-table tr:hover td { background: var(--surface-2); }

.ngd-foot { color: var(--text-muted); font-size: 12px; margin-top: 28px; border-top: 1px solid var(--border); padding-top: 12px; }

/* tooltip de ECharts */
.ngd-tt { font: 12.5px/1.45 var(--font); }
.ngd-tt__h { color: var(--text-secondary); margin-bottom: 4px; }
.ngd-tt__r { display: flex; align-items: center; gap: 8px; }
.ngd-tt__r i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.ngd-tt__r b { font-weight: 700; color: var(--text-primary); }
.ngd-tt__r span { color: var(--text-secondary); }

/* ══════════ Adaptable ══════════ */
@media (max-width: 1280px) {
  .ngd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ngd-card--third { grid-column: span 6; }
  .ngd-card--two-thirds { grid-column: span 12; }
}
@media (max-width: 1024px) {
  .ngd-app { grid-template-columns: minmax(0, 1fr); }
  .ngd-side { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; gap: 12px; overflow-x: auto; }
  .ngd-logo { padding: 0; }
  .ngd-side__label, .ngd-side__spacer, .ngd-nav--sectors a:not(.is-active), .ngd-nav--more { display: none; }
  .ngd-nav { flex-direction: row; }
  .ngd-switch { width: auto; margin-left: auto; }
  .ngd-switch span.txt { display: none; }
  .ngd-head { position: static; }
  .ngd-card, .ngd-card--third, .ngd-card--two-thirds { grid-column: span 12; }
  .ngd-kpis, .ngd-kpis[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ngd-hero { grid-template-columns: minmax(0, 1fr); }
  .ngd-hero__nums { border-left: 0; padding-left: 0; flex-direction: row; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; }
  .ngd-filters { margin-left: 0; }
}
@media (max-width: 640px) {
  .ngd-head__row, .ngd-head__bar, .ngd-timebar { padding-left: 16px; padding-right: 16px; }
  .ngd-range__presets { margin-left: 0; }
  .ngd-main { padding: 16px 16px 48px; }
  .ngd-hero { padding: 20px; }
  .ngd-hero__q { font-size: 21px; }
  .ngd-kpis { gap: 10px; }
  .ngd-kpi__value { font-size: 21px; }
  .ngd-card__head { flex-direction: column; gap: 8px; }
  .ngd-chart { height: 260px; }
  .ngd-pick select { max-width: 130px; }
  .ngd-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .ngd-tab { white-space: nowrap; }
  .ngd-filters { width: 100%; }
  .ngd-pick, .ngd-ms { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .ngd-ms__btn { width: 100%; }
  .ngd-ms__pop { left: 0; right: auto; }
  .ngd-pick select { flex: 1; min-width: 0; max-width: none; }
  .ngd-hero__nums { gap: 12px 20px; }
  .ngd-hero__num b { font-size: 20px; }
}
@media print {
  .ngd-side, .ngd-filters, .ngd-tabs, .ngd-card__tools, .ngd-stories { display: none; }
  .ngd-app { grid-template-columns: minmax(0, 1fr); }
  body { background: #fff; }
}

/* right-click menu on charts (drill down / up / filter / table) */
.ngd-ctx { position: fixed; z-index: 100; min-width: 220px; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(10, 20, 50, .18); padding: 5px; display: flex; flex-direction: column; }
.ngd-ctx button { display: flex; align-items: center; gap: 9px; border: 0; background: none; color: inherit; font: inherit; font-size: 13px;
  text-align: left; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.ngd-ctx button:hover, .ngd-ctx button:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.ngd-ctx svg { width: 15px; height: 15px; flex: none; }

/* board components: domain scorecards, gauge caption, 4-up KPI row (used by mining and the sectors after it) */
.ngd-kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ngd-card--domain { border-top: 3px solid var(--dom, var(--accent)); }
.ngd-card--domain .ngd-card__title { display: flex; align-items: center; gap: 8px; }
.ngd-card--domain .ngd-card__title svg { width: 18px; height: 18px; color: var(--dom, var(--accent)); flex: none; }
.ngd-score td:first-child { white-space: normal; min-width: 150px; }
.ngd-score th, .ngd-score td { padding: 8px 8px; }
.ngd-gauge__cap { font-size: 12.5px; color: var(--text-secondary); text-align: center; margin: -6px 12px 0; }
@media (max-width: 1024px) { .ngd-kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* segmented control (e.g. Current values | Financial simulation) */
.ngd-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-1); margin: 0 0 16px; }
.ngd-seg button { border: 0; background: none; padding: 8px 18px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; }
.ngd-seg button + button { border-left: 1px solid var(--border); }
.ngd-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.ngd-kpis--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ngd-card--rows2 { grid-row: span 2; }
.ngd-tablewrap--free { max-height: none; }
@media (max-width: 1280px) { .ngd-kpis--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* tabs stay on one line (Zoe, 17-oct: with 7 tabs the last one dropped to a second row around 1,100 px): tighter tabs, then a sideways scroll */
.ngd-head .ngd-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 6px; margin-bottom: -6px; }
.ngd-head .ngd-tabs::-webkit-scrollbar { display: none; }
.ngd-head .ngd-tab { white-space: nowrap; flex: none; }
@media (max-width: 1360px) { .ngd-head .ngd-tab { padding-left: 10px; padding-right: 10px; font-size: 13.5px; } }
@media (max-width: 1180px) { .ngd-head .ngd-tab { padding-left: 7px; padding-right: 7px; font-size: 13px; } }

/* compliance stat cards: big number over a faint sparkline (click one to show it on the map) */
.ngd-cstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.ngd-cstat { position: relative; overflow: hidden; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px;
  text-align: left; cursor: pointer; min-height: 128px; font: inherit; color: var(--text-primary); display: flex; flex-direction: column; gap: 4px; }
.ngd-cstat > svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; pointer-events: none; }
.ngd-cstat > svg path { fill: var(--surface-3); }
.ngd-cstat > * { position: relative; }
.ngd-cstat__l { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); }
.ngd-cstat__v { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.ngd-cstat__d { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.ngd-cstat[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft-2); }
.ngd-cstat[aria-pressed="true"] > svg path { fill: var(--accent-soft); }
@media (max-width: 1024px) { .ngd-cstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* income statement: subtotals tinted (identity of the line, not status) */
.ngd-pl td:first-child { white-space: nowrap; font-weight: 500; }
.ngd-pl tr.is-sub td { font-weight: 700; }
.ngd-pl tr.ngd-pl--gp td { background: rgba(27, 175, 122, .10); }
.ngd-pl tr.ngd-pl--ebit td { background: var(--surface-2); }
.ngd-pl tr.ngd-pl--ebt td { background: rgba(98, 80, 214, .09); }
.ngd-pl tr.ngd-pl--ebitda td { background: var(--accent-soft-2); }
.ngd-pl td.neg { color: var(--bad-text); }

/* what-if controls */
.ngd-sims { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.ngd-simk { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.ngd-simk label { font-size: 13px; font-weight: 600; color: var(--text-primary); min-height: 34px; line-height: 1.3; }
.ngd-simk__in { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 4px 10px 4px 4px; background: var(--surface-2); }
.ngd-simk__in span { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.ngd-simk input[type="number"] { width: 56px; font: inherit; font-size: 18px; font-weight: 700; padding: 4px 6px; border: 0; background: transparent; color: var(--text-primary); text-align: right; -moz-appearance: textfield; }
.ngd-simk input[type="number"]::-webkit-inner-spin-button, .ngd-simk input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ngd-simk input[type="number"]:focus { outline: none; }
.ngd-simk__in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ngd-simk__d { font-size: 12px; color: var(--text-muted); }
.ngd-simk.is-changed .ngd-simk__d { color: var(--accent); font-weight: 600; }
.ngd-simk input[type="range"] { width: 100%; accent-color: var(--accent); }
.ngd-simk.is-changed { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ngd-sim__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 1280px) { .ngd-sims { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ngd-sims { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* map (Leaflet) */
.ngd-map { height: 360px; border-radius: 10px; overflow: hidden; z-index: 0; }
.ngd-map .leaflet-tooltip.ngd-maplabel { background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); font: 600 11.5px var(--font); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ngd-mapseg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ngd-map.is-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }   /* OSM has no dark style */

/* gauges rows (efficiency) */
.ngd-gauges4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 8px; }   /* 2 × 2: fills the card next to the what-if */
.ngd-gauges2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ngd-gauges4__t { text-align: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ngd-gauges4__c { height: 190px; }
.ngd-card.is-table .ngd-gauges4, .ngd-card.is-table .ngd-gauges2 { display: none; }
@media (max-width: 640px) { .ngd-gauges4 { grid-template-columns: minmax(0, 1fr); } }
/* what-if box */
.ngd-what { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ngd-what__in { display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 12px; }
.ngd-what__in label { font-size: 13px; font-weight: 600; }
.ngd-what__in input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.ngd-what .ngd-simk__in input[type="number"] { width: 48px; font: inherit; font-size: 17px; font-weight: 700; border: 0; background: transparent; color: var(--text-primary); text-align: right; }
.ngd-what__msg { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text-primary); font-size: 13px; line-height: 1.45; }
/* equipment matrix */
.ngd-mx th.is-sort { cursor: pointer; user-select: none; }
.ngd-mx th, .ngd-mx td { padding: 7px 9px; font-size: 12.5px; }
.ngd-mx td:first-child { white-space: nowrap; }
.ngd-mx td:first-child small { color: var(--text-muted); font-size: 11.5px; }
.ngd-mx__g td { font-weight: 700; background: var(--surface-2); }
.ngd-mx__t td { font-weight: 700; border-top: 2px solid var(--border); }
.ngd-mx__r td:first-child { padding-left: 34px; }
.ngd-mx__tog { border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--text-secondary); padding: 0 6px 0 0; }
.ngd-mx__pick { cursor: pointer; }
.ngd-mx__pick:hover { color: var(--accent); text-decoration: underline; }
.ngd-mx tr.is-dim td { opacity: .35; }
.ngd-mx td .ngd-dot { width: 13px; height: 13px; margin-left: 6px; vertical-align: -2px; }
.ngd-mx__v { font-variant-numeric: tabular-nums; }
.ngd-mx__sp { width: 96px; }
.ngd-mx__spark { width: 90px; height: 20px; display: block; }
.ngd-mx__spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.ngd-mx__bar { position: relative; min-width: 86px; }
.ngd-mx__bar i { position: absolute; left: 0; top: 4px; bottom: 4px; border-radius: 0 4px 4px 0; opacity: .3; }
.ngd-mx__bar span { position: relative; }
.ngd-mx__bar--bar i { background: var(--series-1); }
.ngd-mx__bar--barmoney i { background: var(--accent); }
.ngd-mx__bar--barplan i { background: var(--series-7, #6250d6); }
.ngd-mx__bar--barunpl i { background: var(--critical); }

/* emergency-care simulation (healthcare › capacity) */
.ngd-simctl { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr 2fr; gap: 16px; align-items: start; margin-top: 8px; }
.ngd-simctl__f { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.ngd-simctl .ngd-simk label { min-height: 0; }
.ngd-simres { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 3fr 1.3fr; gap: 16px; }
.ngd-simres__g { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.ngd-simres__g h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.ngd-simres__g > div { display: flex; gap: 18px; flex-wrap: wrap; }
.ngd-simres__t { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 6px; }
.ngd-simres__t span { font-size: 12.5px; color: var(--text-secondary); line-height: 1.3; min-height: 32px; }
.ngd-simres__t b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.ngd-simres__g.is-fc { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface-1) 70%); }
.ngd-simres__g.is-risk { border-color: var(--critical); background: linear-gradient(180deg, var(--bad-bg) 0%, var(--surface-1) 70%); }
.ngd-simexp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 10px 0 14px; }
.ngd-simexp__p { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.5; color: var(--text-primary); }
.ngd-simexp__p b { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.ngd-simexp__p:nth-child(3) { background: var(--bad-bg); } .ngd-simexp__p:nth-child(3) b { color: var(--bad-text); }
.ngd-simexp__p:nth-child(4) { background: var(--good-bg); } .ngd-simexp__p:nth-child(4) b { color: var(--good-text); }
@media (max-width: 1100px) { .ngd-simexp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ngd-simctl, .ngd-simres { grid-template-columns: minmax(0, 1fr); } }

/* Citi patterns: tri-view tabs, measure switch, row popover */
.ngd-tri { display: inline-flex; gap: 2px; margin: 4px 0 8px; border-bottom: 1px solid var(--border); }
.ngd-tri button { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 6px 12px; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ngd-tri button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: var(--accent-soft); border-radius: 6px 6px 0 0; }
.ngd-measure { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 16px; }
.ngd-measure__l { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-right: 6px; }
.ngd-measure button { border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.ngd-measure button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.ngd-pop { position: fixed; z-index: 120; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 14px 34px rgba(10, 20, 50, .2); width: 268px; pointer-events: none; }
.ngd-pop__t { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.ngd-pop__k { display: flex; gap: 18px; margin-bottom: 8px; }
.ngd-pop__k span { display: flex; flex-direction: column; }
.ngd-pop__k small { font-size: 11px; color: var(--text-muted); }
.ngd-pop__k b { font-size: 18px; color: var(--accent); }
.ngd-pop__c { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
/* client 360 */
.ngd-c360 { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; align-items: start; }
.ngd-c360__search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.ngd-c360__search input { flex: 1; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); color: var(--text-primary); }
.ngd-c360__prof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.ngd-c360__prof div { display: flex; flex-direction: column; gap: 2px; }
.ngd-c360__prof small { font-size: 11.5px; color: var(--accent); }
.ngd-c360__prof b { font-size: 13.5px; font-weight: 600; }
.ngd-c360__nums { display: flex; flex-direction: column; gap: 6px; }
.ngd-c360__nums div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ngd-c360__nums b { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.ngd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ngd-chips span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ngd-chips span.is-off { background: var(--surface-2); color: var(--text-muted); font-weight: 400; text-decoration: line-through; }
.ngd-xtab th.grp { text-align: center; border-bottom: 1px solid var(--border); }
@media (max-width: 1024px) { .ngd-c360, .ngd-c360__prof { grid-template-columns: minmax(0, 1fr); } }

/* two-line table cell (value + small note, e.g. target · cited benchmark) */
.ngd-table td small { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ngd-score .ngd-table th, .ngd-score .ngd-table td { padding: 8px 6px; }

/* Leaflet maps stay under the sticky header: confine their panes (z-index 400-1000) to the map box */
.leaflet-container { z-index: 0; isolation: isolate; }

/* sidebar: logo, back link and bottom block stay fixed; only the industry list scrolls */
.ngd-side:has(.ngd-nav--sectors) { overflow: hidden; }
.ngd-side .ngd-nav--sectors { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgba(230, 234, 242, .22) transparent; }
.ngd-side .ngd-nav--sectors::-webkit-scrollbar { width: 6px; }
.ngd-side .ngd-nav--sectors::-webkit-scrollbar-thumb { background: rgba(230, 234, 242, .22); border-radius: 6px; }
.ngd-side:has(.ngd-nav--sectors) .ngd-side__spacer { flex: 0 0 8px; }
.ngd-back { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 600;
  color: var(--brand-ink); background: rgba(230, 234, 242, .08); border: 1px solid rgba(230, 234, 242, .12); }
.ngd-back:hover { background: rgba(230, 234, 242, .14); }
.ngd-back svg { width: 16px; height: 16px; }
