/* Kuntur · dirección "Cordillera": barra lateral azul noche, acento cobalto, superficies frías */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  color-scheme: light;
  --page: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --ink: #1a2333;
  --ink-2: #4a5568;
  --muted: #6b7686;
  --grid: #dde3ec;
  --axis: #c3ccd9;
  --border: rgba(15, 27, 45, 0.11);
  --accent: #2f6feb;
  --accent-ink: #1d4fbf;
  --accent-wash: #e6eefc;
  --series-1: #2f6feb;
  --good: #1a9a3c;
  --good-ink: #146c2e;
  --warning: #e8a317;
  --serious: #e8743b;
  --critical: #c4322b;
  --info: #8a94a3;
  --sev-low: #86b6ef;
  --side: #0f1b2d;
  --side-fg: #dbe4f3;
  --side-muted: #8b9bb4;
  --side-hover: #18294a;
  --side-active: #1e3354;
  --shadow: 0 1px 2px rgba(15,27,45,.05), 0 4px 16px rgba(15,27,45,.06);
  --radius: 8px;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-family: var(--font-body);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0a111c; --surface: #111a27; --surface-2: #182334; --ink: #e8edf5; --ink-2: #b3bfcf; --muted: #8592a5;
    --grid: #223047; --axis: #2d3d57; --border: rgba(219,228,243,0.10); --accent: #5b8ff5; --accent-ink: #8fb3ff;
    --accent-wash: #16264a; --series-1: #5b8ff5; --good-ink: #3fc06a; --side: #070d17; --side-hover: #121f36; --side-active: #182c4c;
    --sev-low: #5598e7; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0a111c; --surface: #111a27; --surface-2: #182334; --ink: #e8edf5; --ink-2: #b3bfcf; --muted: #8592a5;
  --grid: #223047; --axis: #2d3d57; --border: rgba(219,228,243,0.10); --accent: #5b8ff5; --accent-ink: #8fb3ff;
  --accent-wash: #16264a; --series-1: #5b8ff5; --good-ink: #3fc06a; --side: #070d17; --side-hover: #121f36; --side-active: #182c4c;
  --sev-low: #5598e7; --shadow: 0 1px 2px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.err { color: var(--critical); min-height: 1.2em; margin: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-fg); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; }
.brand b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.brand span { display: block; font-size: 11px; color: var(--side-muted); letter-spacing: .04em; }
.brand.big b { font-size: 26px; color: var(--ink); }
.login-card .brand span { color: var(--muted); }
nav { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; }
nav a { color: var(--side-fg); opacity: .86; padding: 7px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
nav a:hover { background: var(--side-hover); text-decoration: none; opacity: 1; }
nav a.active { background: var(--side-active); color: #ffffff; font-weight: 600; opacity: 1; box-shadow: inset 3px 0 0 var(--accent); }
.ico { width: 18px; text-align: center; opacity: .8; }
.nav-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 10px 4px; }
.side-foot { margin-top: auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.side-foot .muted { width: 100%; color: var(--side-muted); }
.side-foot .btn { color: var(--side-fg); border-color: rgba(219,228,243,.18); }
.side-foot .btn:hover { background: var(--side-hover); }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top h1 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.top-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
.view { padding: 22px 28px 60px; max-width: 1500px; }

/* buttons & inputs */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.good { color: var(--good-ink); }
.btn.bad { color: var(--critical); }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card .brand { padding: 0 0 6px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }

/* cards & grids */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card h2 { font-family: var(--font-display); font-size: 15px; margin: 0 0 2px; font-weight: 700; letter-spacing: -.005em; }
.card .sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.card-head { display: flex; align-items: baseline; gap: 10px; }
.card-head a { margin-left: auto; font-size: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--ink-2); font-size: 12.5px; }
.kpi .value { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-ink); }
.kpi .hint { color: var(--muted); font-size: 12px; }
.kpi.alert .value { color: var(--critical); }
.kpi a.value:hover { text-decoration: none; opacity: .85; }
.section-title { font-size: 13px; color: var(--ink-2); margin: 22px 0 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* bars (hbar chart) */
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; cursor: default; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
.hbar.clickable { cursor: pointer; }
.hbar:hover { background: var(--surface-2); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbar .lbl small { color: var(--muted); margin-left: 6px; }
.hbar .track { height: 10px; position: relative; border-left: 1px solid var(--axis); }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 32px; text-align: right; }

/* stacked status bar */
.stack { display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.stack span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.status-rows { display: flex; flex-direction: column; gap: 12px; }
.status-row .top-line { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }

/* severity */
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); white-space: nowrap; color: var(--ink); }
.sev::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.sev.critical::before { background: var(--critical); }
.sev.high::before { background: var(--serious); }
.sev.medium::before { background: var(--warning); }
.sev.low::before { background: var(--sev-low); }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st.approved { color: var(--good-ink); }
.st.blocked { color: var(--critical); }
.st.unreviewed { color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--good); }
.dot.off { background: var(--axis); }
.chip { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; margin: 1px 3px 1px 0; white-space: nowrap; }
.chip.warn { color: var(--critical); }

/* tables */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { min-width: 240px; flex: 1 1 240px; max-width: 420px; }
.toolbar .count { color: var(--muted); font-size: 12px; margin-left: auto; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; cursor: pointer; user-select: none; }
th.nosort { cursor: default; }
th .arrow { color: var(--muted); font-size: 10px; margin-left: 3px; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
td .t-main { font-weight: 550; }
td:first-child .t-main { white-space: nowrap; }
td .t-sub { color: var(--muted); font-size: 12px; word-break: break-all; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 6px 0 14px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 12px; font: inherit; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 30; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; padding: 22px 24px; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
.drawer-panel h2 { margin: 0 0 4px; font-size: 18px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13px; margin: 14px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

/* deploy */
pre.code { font-family: var(--font-mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; margin: 8px 0; white-space: pre-wrap; word-break: break-all; }
.code-wrap { position: relative; }
.code-wrap .btn { position: absolute; top: 8px; right: 8px; }

/* events */
.timeline { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 110px 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: start; }
.ev:last-child { border-bottom: 0; }
.ev .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ev .badge { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; background: var(--surface-2); color: var(--ink-2); }
.ev .badge.added { color: var(--accent-ink); }
.ev .badge.removed { color: var(--muted); }
.ev .badge.finding { color: var(--critical); }
.ev .badge.enrolled { color: var(--good-ink); }

.tip { position: fixed; pointer-events: none; z-index: 50; background: var(--ink); color: var(--surface); padding: 6px 9px; border-radius: 6px; font-size: 12px; max-width: 300px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 8px; z-index: 60; font-size: 13px; }
.banner { background: var(--accent-wash); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.banner b { display: block; margin-bottom: 4px; }

@media (max-width: 1100px) { .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: inline-block; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .top { padding: 12px 16px; }
  .kv { grid-template-columns: 1fr; }
}
@media (forced-colors: active) { .hbar .fill, .stack span { forced-color-adjust: none; } }
.code-wrap pre.code { font-family: var(--font-mono); padding-right: 76px; }
