/*
 * Sentinel — hand-written CSS, no framework, no build step, no CDN, no webfont.
 *
 * Read under stress, often at night, often on a phone, often by someone who has
 * just been woken up. That drives every decision here:
 *
 *   * 17px base. A dashboard nobody can read at a glance is a dashboard nobody
 *     reads.
 *   * One hierarchy per screen: verdict, then numbers, then detail.
 *   * Colour is never the only signal — every coloured dot sits beside a word,
 *     so it survives colour blindness and printing.
 *   * Icons are inline SVG masks in data: URIs. The CSP allows `img-src data:`
 *     but nothing external, so this keeps `script-src 'self'` intact with no
 *     icon font and no sprite file to ship.
 *
 * Warm palette rather than the usual blue: amber reads as "attention" without
 * the alarm-red fatigue of a page where everything is urgent.
 */

:root {
  /* Dark first: incidents happen at night. */
  --bg:        #100d0b;
  --bg-raised: #191512;
  --bg-input:  #221c18;
  --bg-hover:  #2a231d;
  --border:    #2b2420;
  --border-lit:#3d332c;

  --fg:        #f2ede8;
  --fg-muted:  #a49689;
  --fg-dim:    #7a6d62;

  --accent:     #f26b1d;
  --accent-soft:#3a2115;
  --accent-dim: #7a3a12;

  --ok:   #35c98a;
  --warn: #f0a92e;
  --bad:  #f2564d;
  --off:  #7a6d62;

  --radius:    12px;
  --radius-sm: 8px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 6px 22px rgb(0 0 0 / .22);
  --sidebar-w: 236px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #f6f4f1;
    --bg-raised: #ffffff;
    --bg-input:  #ffffff;
    --bg-hover:  #f0ece7;
    --border:    #e3ddd6;
    --border-lit:#cabfb4;
    --fg:        #171310;
    --fg-muted:  #6b5f55;
    --fg-dim:    #8d8177;
    --accent:     #d4560c;
    --accent-soft:#fdf0e6;
    --accent-dim: #f0c3a0;
    --ok:   #12996a;
    --warn: #b57a12;
    --bad:  #cf3a31;
    --shadow: 0 1px 2px rgb(23 19 16 / .05), 0 5px 18px rgb(23 19 16 / .06);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================ shell */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.content {
  flex: 1;
  min-width: 0;              /* lets wide tables scroll instead of stretching */
  padding: 2rem 2.2rem 2rem;
  display: flex;
  flex-direction: column;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: .04em;
  color: var(--fg);
  text-decoration: none;
}
.brand-mark {
  width: 20px; height: 20px;
  border-radius: 6px;
  background: linear-gradient(140deg, var(--accent), #ffb066);
  flex: none;
}
.brand-mark-lg { width: 34px; height: 34px; border-radius: 10px; }

.sidenav { display: flex; flex-direction: column; gap: .15rem; }
.sidenav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}
.sidenav a:hover { background: var(--bg-hover); color: var(--fg); }
.sidenav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Icons: an SVG mask painted with currentColor, so they follow the link state
   and need no separate asset. */
.ico {
  width: 19px; height: 19px;
  flex: none;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center;  mask-position: center;
  -webkit-mask-size: contain;     mask-size: contain;
}
.ico-grid   { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.ico-alert  { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.ico-shield { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.ico-wrench { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0 5 5l-9.4 9.4a2.1 2.1 0 0 1-3-3z'/%3E%3Cpath d='M18.5 2.5 21.5 5.5'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0 5 5l-9.4 9.4a2.1 2.1 0 0 1-3-3z'/%3E%3Cpath d='M18.5 2.5 21.5 5.5'/%3E%3C/svg%3E"); }
.ico-ban    { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m5.6 5.6 12.8 12.8'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m5.6 5.6 12.8 12.8'/%3E%3C/svg%3E"); }
.ico-server { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='3' width='18' height='7' rx='2'/%3E%3Crect x='3' y='14' width='18' height='7' rx='2'/%3E%3Cpath d='M7 6.5h.01M7 17.5h.01'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='3' width='18' height='7' rx='2'/%3E%3Crect x='3' y='14' width='18' height='7' rx='2'/%3E%3Cpath d='M7 6.5h.01M7 17.5h.01'/%3E%3C/svg%3E"); }
.ico-list   { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
              mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; }

.userbox {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--border);
}
.userbox:hover, .userbox.active { background: var(--bg-hover); border-color: var(--border-lit); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #b8480d);
  color: #fff;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  flex: none;
}
.userbox-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.userbox-name { font-size: .95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.role {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  padding: .05rem .35rem; border-radius: 4px;
  border: 1px solid var(--border-lit); color: var(--fg-dim);
  align-self: flex-start;
}
.role-owner    { color: var(--accent); border-color: var(--accent-dim); }
.role-operator { color: var(--warn); border-color: var(--warn); }

form.inline { display: inline; margin: 0; }

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }

.footer {
  margin-top: auto;
  padding: 1.4rem 0 0;
  color: var(--fg-dim);
  font-size: .88rem;
  display: flex; gap: .55rem; flex-wrap: wrap;
}
.footer-plain { justify-content: center; padding: 1.2rem; }

/* ================================================================ type */
h1 { font-size: 1.9rem; font-weight: 700; margin: 0 0 .25rem; letter-spacing: -.025em; }
h2 { font-size: 1.22rem; font-weight: 640; margin: 2.2rem 0 .9rem; letter-spacing: -.012em; }
.page-sub { margin: 0 0 1.7rem; color: var(--fg-muted); font-size: 1.02rem; }

.card h2, .panel h2 {
  margin: 0 0 1rem;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--fg-muted);
}

/* ================================================================ verdict */
.verdict {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1.4rem 1.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 5px solid var(--off);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.verdict-good     { border-left-color: var(--ok); }
.verdict-warning  { border-left-color: var(--warn); }
.verdict-critical { border-left-color: var(--bad); }
.verdict-icon { font-size: 2rem; line-height: 1; flex: none; }
.verdict-body { flex: 1; min-width: 15rem; }
.verdict-title { font-size: 1.35rem; font-weight: 680; letter-spacing: -.016em; margin: 0 0 .2rem; }
.verdict-detail { margin: 0; color: var(--fg-muted); font-size: 1rem; }

/* ================================================================ KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.kpi {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .5rem;
}
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .95rem; color: var(--fg-muted); font-weight: 550; }
.kpi-main { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; }
.kpi-value {
  font-size: 2.35rem; font-weight: 720; line-height: 1;
  letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.kpi-note { font-size: .87rem; color: var(--fg-dim); }
.kpi-ok   .kpi-value { color: var(--ok); }
.kpi-warn .kpi-value { color: var(--warn); }
.kpi-bad  .kpi-value { color: var(--bad); }

/* Delta chip: direction is stated by the arrow glyph, not only by colour. */
.delta {
  font-size: .8rem; font-weight: 650;
  padding: .12rem .45rem; border-radius: 999px;
  border: 1px solid var(--border-lit); color: var(--fg-muted);
  white-space: nowrap;
}
.delta-up   { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.delta-down { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.delta-flat { color: var(--fg-dim); }

/* Bar sparkline inside a KPI: 12 columns, pure flex. */
.spark-mini { display: flex; align-items: flex-end; gap: 2px; height: 34px; flex: none; width: 90px; }
.spark-mini span { flex: 1; background: var(--accent); border-radius: 1px; min-height: 2px; opacity: .8; }
.spark-mini span:last-child { opacity: 1; }

/* ================================================================ insights */
.insight {
  display: flex; gap: 1rem;
  padding: 1.2rem 1.35rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--off);
  border-radius: var(--radius);
  margin-bottom: .85rem;
  box-shadow: var(--shadow);
}
.insight-critical { border-left-color: var(--bad); }
.insight-warning  { border-left-color: var(--warn); }
.insight-info     { border-left-color: var(--accent); }
.insight-good     { border-left-color: var(--ok); }
.insight-icon { font-size: 1.3rem; line-height: 1.35; flex: none; }
.insight-body { flex: 1; min-width: 0; }
.insight-title { font-size: 1.08rem; font-weight: 640; margin: 0 0 .3rem; letter-spacing: -.01em; }
.insight-detail { margin: 0; color: var(--fg-muted); font-size: .98rem; line-height: 1.55; }
.insight-action {
  margin: .75rem 0 0; font-size: .93rem; color: var(--fg);
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .55rem .75rem;
}
.insight-action b { color: var(--accent); font-weight: 650; }
.insight-evidence { margin: .6rem 0 0; padding-left: 1.1rem; font-size: .89rem; color: var(--fg-dim); }
.insight-evidence li { margin: .12rem 0; }

/* ================================================================ panels */
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.1rem; align-items: start; }
.grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.1rem; }

.card, .panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2 { margin: 0; }

/* Ranked horizontal bars — the honest version of a threat map: the length is
   the number, and the number is printed next to it. */
.geobar { display: flex; flex-direction: column; gap: .85rem; }
.geobar-row { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: .8rem; align-items: center; }
.geobar-key { font-weight: 700; font-size: .98rem; font-variant-numeric: tabular-nums; }
.geobar-track { background: var(--bg-input); border-radius: 999px; height: 9px; overflow: hidden; }
.geobar-fill { display: block; height: 100%; border-radius: 999px;
               background: linear-gradient(90deg, var(--accent), #ff9a4d); min-width: 4px; }
.geobar-val { font-size: .9rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: .8rem 0; border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-badge {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: .95rem;
  background: var(--bg-input); border: 1px solid var(--border);
}
.feed-badge-bad  { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.feed-badge-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.feed-badge-ok   { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.feed-body { min-width: 0; flex: 1; }
.feed-title { font-size: .97rem; font-weight: 560; margin: 0; }
.feed-title a { color: inherit; text-decoration: none; }
.feed-title a:hover { color: var(--accent); }
.feed-meta { margin: .1rem 0 0; font-size: .86rem; color: var(--fg-dim); }

/* ================================================================ forms */
label { display: block; font-size: .95rem; font-weight: 550; color: var(--fg-muted); margin: 1.1rem 0 .4rem; }

input[type="text"], input[type="password"], input[type="email"], select {
  width: 100%; padding: .7rem .8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius-sm);
  color: var(--fg); font: inherit; font-size: 1rem;
}
input:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);
}
.code-input { font: 700 1.7rem/1 var(--mono); letter-spacing: .38em; text-align: center; padding: .85rem .5rem; }

.btn {
  display: inline-block; padding: .65rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-lit);
  background: var(--bg-input); color: var(--fg);
  font: inherit; font-size: .98rem; font-weight: 560;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn:hover { border-color: var(--fg-dim); background: var(--bg-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-quiet { background: transparent; color: var(--fg-muted); }
.btn-quiet:hover { color: var(--fg); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: .38rem .7rem; font-size: .88rem; }

/* ================================================================ notices */
.notice {
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--radius); background: var(--bg-raised);
  padding: 1rem 1.2rem; margin-bottom: 1.1rem; font-size: 1rem;
}
.notice strong { display: block; margin-bottom: .3rem; font-size: 1.05rem; }
.notice p { margin: 0; color: var(--fg-muted); line-height: 1.55; }
.notice-info     { border-left-color: var(--accent); }
.notice-warn     { border-left-color: var(--warn); }
.notice-critical { border-left-color: var(--bad); }

.alert { padding: .75rem .9rem; border-radius: var(--radius-sm); font-size: .98rem; margin: 0 0 1.1rem; }
.alert-error {
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 42%, transparent);
  color: var(--fg);
}

/* ================================================================ auth */
.auth-card {
  width: 100%; max-width: 410px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; box-shadow: var(--shadow);
}
.auth-head { text-align: center; margin-bottom: 1.6rem; }
.auth-head h1 { margin: .7rem 0 .25rem; font-size: 1.5rem; }
.auth-head p { margin: 0; font-size: .95rem; color: var(--fg-muted); }
.auth-note { margin: 1.4rem 0 0; font-size: .88rem; color: var(--fg-dim); line-height: 1.55; }
.auth-alt { margin-top: .7rem; }

/* ================================================================ data */
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.2rem; }
.kv dt { color: var(--fg-muted); font-size: .98rem; }
.kv dd { margin: 0; font-size: .98rem; text-align: right; font-variant-numeric: tabular-nums; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .45rem; vertical-align: baseline; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); }
.dot-bad { background: var(--bad); } .dot-off { background: var(--off); }

.table-scroll {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-raised); box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
thead th {
  text-align: left; font-weight: 650; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted);
  padding: .8rem .95rem; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--bg-raised);
}
tbody td { padding: .72rem .95rem; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card table tbody td { padding: .55rem 0; }
.card table tbody tr:hover { background: transparent; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .7rem 0; border-bottom: 1px solid var(--border); font-size: .97rem; }
.list li:last-child { border-bottom: none; }

.badge {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  padding: .13rem .4rem; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
}

/* 24 hourly bars. */
.spark-hours { display: flex; align-items: flex-end; gap: 3px; height: 72px; margin: .4rem 0 .3rem; }
.spark-hours span {
  flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .8;
}
.spark-hours span.peak { background: var(--warn); opacity: 1; }

.statline { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: .6rem 0 1.2rem; }
.pill { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .92rem; font-weight: 650; border: 1px solid transparent; }
.pill-ok   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill-bad  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.pill-off  { color: var(--fg-muted); border-color: color-mix(in srgb, var(--off) 45%, transparent); }

/* ================================================================ utility */
.mono   { font-family: var(--mono); font-size: .94em; }
.muted  { color: var(--fg-muted); }
.small  { font-size: .89rem; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 640; }
.truncate { display: inline-block; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 5px; padding: .1em .4em; word-break: break-word;
}
a { color: var(--accent); }

/* ================================================================ services */
table.services td { vertical-align: top; }
.svc-name { font-weight: 640; }
.tag {
  display: inline-block; margin-left: .4rem; padding: .05rem .45rem; border-radius: 5px;
  font-size: .76rem; font-weight: 640; color: var(--fg-muted);
  border: 1px solid color-mix(in srgb, var(--off) 50%, transparent);
}
.tag-exposed { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* Secondary vulnerability references (Red Hat, CISA KEV) sitting next to a CVE.
   Quiet by default: the identifier itself is the link you want most of the
   time, and three equally-loud links in a table cell is three things to read
   instead of one. */
.reflinks { margin-left: .45rem; font-size: .78rem; white-space: nowrap; }
.reflinks a {
  color: var(--fg-muted);
  border-bottom: 1px dotted color-mix(in srgb, var(--fg-muted) 55%, transparent);
  text-decoration: none;
}
.reflinks a + a { margin-left: .4rem; }
.reflinks a:hover, .reflinks a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
.uptime { font-weight: 660; }
.uptime-ok { color: var(--ok); } .uptime-warn { color: var(--warn); } .uptime-bad { color: var(--bad); }
.spark { display: block; }
.spark-line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark-ok { stroke: var(--ok); } .spark-warn { stroke: var(--warn); }
.spark-bad { stroke: var(--bad); } .spark-off { stroke: var(--off); }
.spark-100 { stroke: color-mix(in srgb, var(--fg-dim) 40%, transparent); stroke-width: 1; stroke-dasharray: 2 3; }

/* ================================================================ filters */
.filterbar { display: flex; flex-wrap: wrap; gap: .9rem; align-items: end; margin: .6rem 0 1.2rem; }
.filterbar label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--fg-muted); margin: 0; }
.filterbar select { padding: .4rem .6rem; width: auto; }
table.events td.detail { max-width: 44ch; }
table.events .path { color: var(--fg); word-break: break-all; }
table.events td { vertical-align: top; }
.filterlinks { margin-left: auto; font-size: .95rem; }
.filterlinks a.active { color: var(--fg); font-weight: 650; }

/* ================================================================ motion */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ================================================================ narrow */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
}

/* The sidebar becomes a horizontal strip rather than a hamburger: a menu you
   have to open costs a tap during an incident, and six links fit across. */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; flex-wrap: wrap;
    gap: .8rem; padding: .8rem 1rem;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .sidenav { flex-direction: row; flex-wrap: wrap; gap: .2rem; flex: 1; }
  .sidenav a { padding: .45rem .6rem; font-size: .93rem; }
  .sidenav a span:not(.ico) { display: none; }   /* icons only when tight */
  .sidebar-foot { margin-top: 0; flex-direction: row; align-items: center; gap: .5rem; }
  .sidebar-foot .btn { width: auto; }
  .userbox { border: none; padding: .3rem; }
  .userbox-text { display: none; }
  .content { padding: 1.3rem 1rem 1.5rem; }
  h1 { font-size: 1.55rem; }
  .kpi-value { font-size: 2rem; }
  .kv { grid-template-columns: 1fr; gap: .2rem; }
  .kv dd { text-align: left; margin-bottom: .6rem; }
  .truncate { max-width: 16ch; }
}

@media (min-width: 560px) and (max-width: 820px) {
  .sidenav a span:not(.ico) { display: inline; }  /* labels fit again */
}

/* ================================================================ print */
@media print {
  .sidebar, .footer, .btn { display: none; }
  .app { display: block; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .card, .panel, .table-scroll, .insight, .verdict, .kpi { border-color: #ccc; box-shadow: none; }
}
