/* ================================================================
   NavoCloud Security Dashboard — Design System
   Dark-first. Professional. Clean.
   ================================================================ */

/* ── Design tokens ──────────────────────────────────────────────── */
:root {
  --bg-root:     #060c13;
  --bg-surface:  #0c1622;
  --bg-card:     #0f1d2c;
  --bg-card-alt: #111f30;
  --bg-elevated: #162438;
  --bg-input:    #0c1622;
  --bg-hover:    rgba(255,255,255,0.035);
  --bg-active:   rgba(58,123,213,0.11);

  --border-sub:  #162030;
  --border:      #1c2e42;
  --border-str:  #243c58;

  --text-pri:    #d8eaf5;
  --text-sec:    #7899b4;
  --text-mute:   #4e6a80;

  --accent:      #3a7bd5;
  --accent-h:    #4f8de8;
  --accent-bg:   rgba(58,123,213,0.10);
  --accent-bdr:  rgba(58,123,213,0.25);

  --ok:          #22c984;
  --ok-bg:       rgba(34,201,132,0.08);
  --ok-bdr:      rgba(34,201,132,0.20);
  --ok-text:     #34dfa0;

  --warn:        #e8894e;
  --warn-bg:     rgba(232,137,78,0.08);
  --warn-bdr:    rgba(232,137,78,0.20);
  --warn-text:   #f0a06a;

  --bad:         #e05454;
  --bad-bg:      rgba(224,84,84,0.08);
  --bad-bdr:     rgba(224,84,84,0.20);
  --bad-text:    #ee7070;

  --info:        #3a7bd5;
  --info-bg:     rgba(58,123,213,0.08);
  --info-bdr:    rgba(58,123,213,0.20);
  --info-text:   #5a99e8;

  --neutral-bg:  rgba(96,128,160,0.08);
  --neutral-bdr: rgba(96,128,160,0.18);
  --neutral-text:#8099b0;

  --sidebar-w:   248px;
  --topbar-h:    52px;

  --r-sm: 4px;
  --r:    8px;
  --r-md: 10px;
  --r-lg: 14px;

  --shadow:    0 2px 6px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.55);

  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;

  --tr: 0.14s ease;
  --tr-slow: 0.24s ease;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; overflow-x: hidden;
  font-family: var(--font); font-size: 14px;
  background: var(--bg-root); color: var(--text-pri); line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
h1,h2,h3,h4,h5 { margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0 0 1rem; }
ul,ol { margin: 0; padding: 0; list-style: none; }
button,input,select,textarea { font-family: inherit; }
img,svg { display: block; }
code,pre { font-family: var(--font-mono); }

/* ── Layout ─────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-sub);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  transition: transform var(--tr-slow);
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px 13px;
  border-bottom: 1px solid var(--border-sub);
  text-decoration: none;
}
.brand-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--accent); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-icon svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.2; }
.brand-text { display: flex; flex-direction: column; gap: 0; }
.brand-name {
  font-size: 13.5px; font-weight: 700; color: var(--text-pri);
  letter-spacing: -0.01em; line-height: 1.3;
}
.brand-sub {
  font-size: 9.5px; font-weight: 600; color: var(--text-mute);
  letter-spacing: 0.07em; text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 8px 7px; }

.nav-sep {
  font-size: 9.5px; font-weight: 700; color: var(--text-mute);
  letter-spacing: 0.09em; text-transform: uppercase;
  padding: 12px 10px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8.5px 10px; border-radius: var(--r-sm);
  color: var(--text-sec); font-size: 13.5px; font-weight: 500;
  transition: background var(--tr), color var(--tr);
  text-decoration: none; cursor: pointer; position: relative;
}
.nav-item svg {
  width: 15px; height: 15px; stroke: currentColor;
  fill: none; stroke-width: 1.8; flex-shrink: 0;
}
.nav-item:hover {
  background: var(--bg-hover); color: var(--text-pri); text-decoration: none;
}
.nav-item.active {
  background: var(--bg-active); color: var(--accent-h);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; border-radius: 0 2px 2px 0; background: var(--accent);
}

.nav-indent {
  margin: 2px 0 4px 30px;
  border-left: 1px solid var(--border-sub);
  padding-left: 2px;
}
.nav-sub {
  font-size: 13px; padding: 7px 8px; color: var(--text-mute);
}
.nav-sub.active { color: var(--accent-h); background: var(--bg-active); }

.sidebar-foot { padding: 6px 7px; border-top: 1px solid var(--border-sub); }
.nav-logout { color: var(--text-mute); }
.nav-logout:hover { color: var(--bad-text); background: var(--bad-bg); text-decoration: none; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-sub);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  display: none; background: none; border: none;
  color: var(--text-sec); cursor: pointer; padding: 6px;
  border-radius: var(--r-sm);
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-pri); }
.sidebar-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

.breadcrumbs {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-mute);
}
.breadcrumbs a { color: var(--text-sec); }
.breadcrumbs a:hover { color: var(--text-pri); text-decoration: none; }
.breadcrumbs .sep { color: var(--text-mute); user-select: none; font-size: 11px; }
.breadcrumbs .cur { color: var(--text-pri); font-weight: 500; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-chip {
  font-size: 11px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px;
  background: var(--bg-elevated); color: var(--text-mute);
  border: 1px solid var(--border);
}

/* ── Page content ───────────────────────────────────────────────── */
.page-content {
  flex: 1; padding: 24px 26px; max-width: 1120px; width: 100%; margin: 0 auto;
}
.toast-zone { pointer-events: none; }

.page-head { margin-bottom: 20px; }
.page-title { font-size: 19px; font-weight: 700; color: var(--text-pri); letter-spacing: -.02em; }
.page-desc  { font-size: 13px; color: var(--text-sec); margin-top: 3px; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px; margin-bottom: 14px;
}
.card-sm { padding: 12px 14px; }
.card-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px; margin-bottom: 14px;
}
.card-title {
  font-size: 11.5px; font-weight: 700; color: var(--text-pri);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.card-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.section-sep { font-size: 11px; font-weight: 700; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 18px 0 11px; }
.section-sep:first-child { margin-top: 0; }

/* ── Metric cards ───────────────────────────────────────────────── */
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px;
  display: flex; flex-direction: column; gap: 5px;
}
.metric-label { font-size: 10.5px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .07em; }
.metric-value { font-size: 24px; font-weight: 700; color: var(--text-pri); line-height: 1; }
.metric-sub   { font-size: 12px; color: var(--text-mute); }

/* ── Grid ───────────────────────────────────────────────────────── */
.grid-2    { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }

/* ── KV list ────────────────────────────────────────────────────── */
.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border-sub); gap: 10px;
}
.kv-row:last-child { border-bottom: none; }
.kv-key  { font-size: 13px; color: var(--text-sec); }
.kv-val  { font-size: 13px; color: var(--text-pri); text-align: right; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap; line-height: 1.5;
}
.b-ok      { background: var(--ok-bg);      color: var(--ok-text);      border: 1px solid var(--ok-bdr); }
.b-warn    { background: var(--warn-bg);    color: var(--warn-text);    border: 1px solid var(--warn-bdr); }
.b-bad     { background: var(--bad-bg);     color: var(--bad-text);     border: 1px solid var(--bad-bdr); }
.b-info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid var(--info-bdr); }
.b-neutral { background: var(--neutral-bg); color: var(--neutral-text); border: 1px solid var(--neutral-bdr); }

/* Event-type colour palette */
.b-spam     { background: rgba(232,137,78,.10); color: #f0a06a; border: 1px solid rgba(232,137,78,.2); }
.b-raid     { background: rgba(224,84,84,.10);  color: #ee7070; border: 1px solid rgba(224,84,84,.2); }
.b-nuke     { background: rgba(224,84,84,.10);  color: #ee7070; border: 1px solid rgba(224,84,84,.2); }
.b-beast    { background: rgba(200,60,60,.12);  color: #cc5050; border: 1px solid rgba(200,60,60,.2); }
.b-verify   { background: rgba(34,201,132,.10); color: #34dfa0; border: 1px solid rgba(34,201,132,.2); }
.b-mod      { background: rgba(58,123,213,.10); color: #5a99e8; border: 1px solid rgba(58,123,213,.2); }
.b-quar     { background: rgba(232,137,78,.10); color: #f0a06a; border: 1px solid rgba(232,137,78,.2); }
.b-fail     { background: rgba(220,180,50,.10); color: #e8c840; border: 1px solid rgba(220,180,50,.2); }

/* ── Module toggle cards ────────────────────────────────────────── */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.module-card {
  background: var(--bg-card-alt); border: 1px solid var(--border);
  border-radius: var(--r); padding: 13px 14px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  transition: border-color var(--tr);
}
.module-card.m-on { border-color: var(--accent-bdr); background: var(--accent-bg); }
.module-info { flex: 1; min-width: 0; }
.module-name { font-size: 13px; font-weight: 600; color: var(--text-pri); }
.module-desc { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; line-height: 1.4; }

.toggle-wrap { display: flex; align-items: center; flex-shrink: 0; }
.toggle-inp  { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-lbl  { position: relative; display: block; width: 36px; height: 20px; cursor: pointer; }
.toggle-lbl::before {
  content: ''; position: absolute; inset: 0;
  background: var(--border-str); border-radius: 999px;
  transition: background var(--tr);
}
.toggle-lbl::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; background: var(--text-mute); border-radius: 50%;
  transition: transform var(--tr), background var(--tr);
}
.toggle-inp:checked + .toggle-lbl::before { background: var(--accent); }
.toggle-inp:checked + .toggle-lbl::after  { transform: translateX(16px); background: #fff; }
.toggle-inp:focus-visible + .toggle-lbl  { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 3px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-sec); }
.form-desc  { font-size: 11.5px; color: var(--text-mute); line-height: 1.4; }
.form-hint  { font-size: 11px;   color: var(--text-mute); margin-top: 2px; }
.form-err   { font-size: 11px;   color: var(--bad-text);  margin-top: 2px; }

input[type="text"],
input[type="number"],
input[type="password"],
select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-pri);
  padding: 7px 9px; font-size: 13px; width: 100%;
  transition: border-color var(--tr); outline: none;
  -webkit-appearance: none; appearance: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(58,123,213,.15);
}
input::placeholder { color: var(--text-mute); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234e6a80' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
  cursor: pointer;
}
select option { background: var(--bg-surface); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; border: none;
  transition: background var(--tr), opacity var(--tr);
  text-decoration: none; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); text-decoration: none; color: #fff; }
.btn-danger  { background: var(--bad);    color: #fff; }
.btn-danger:hover  { background: var(--bad-text); text-decoration: none; color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-sec);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-pri); text-decoration: none; }
.btn-sm  { padding: 6px 11px; font-size: 12.5px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: none; border: none; cursor: pointer;
  color: var(--text-sec); transition: background var(--tr), color var(--tr);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-pri); }
.btn-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn.saving { pointer-events: none; opacity: .65; }
.btn.saving::after {
  content: ''; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .6s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt thead tr { border-bottom: 1px solid var(--border); }
.dt th {
  text-align: left; padding: 9px 12px;
  font-size: 10.5px; font-weight: 700; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
}
.dt td {
  padding: 11px 12px; border-bottom: 1px solid var(--border-sub);
  color: var(--text-sec); vertical-align: middle;
}
.dt tbody tr:last-child td { border-bottom: none; }
.dt tbody tr:hover td { background: var(--bg-hover); }
.dt .td-pri  { color: var(--text-pri); font-weight: 500; }
.dt .td-mono { font-family: var(--font-mono); font-size: 12px; }
.dt .td-mute { color: var(--text-mute); font-size: 12px; }

/* ── Incident cards ─────────────────────────────────────────────── */
.incident-list { display: flex; flex-direction: column; gap: 8px; }
.incident-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 13px 15px;
  transition: border-color var(--tr);
}
.incident-card:hover { border-color: var(--border-str); }
.incident-top {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 7px;
}
.incident-time { font-size: 11px; color: var(--text-mute); margin-left: auto; font-family: var(--font-mono); }
.incident-row  { display: flex; gap: 20px; flex-wrap: wrap; }
.inc-field     { display: flex; flex-direction: column; gap: 1px; min-width: 100px; }
.inc-flabel    { font-size: 10px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .05em; }
.inc-fval      { font-size: 12.5px; color: var(--text-pri); font-family: var(--font-mono); }
.incident-details { margin-top: 9px; }
.incident-details summary {
  font-size: 11.5px; color: var(--text-mute); cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 4px; list-style: none;
}
.incident-details summary::-webkit-details-marker { display: none; }
.incident-details summary .chev {
  width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2;
  transition: transform var(--tr);
}
details.incident-details[open] summary .chev { transform: rotate(90deg); }
.incident-json {
  margin-top: 7px; background: var(--bg-root);
  border: 1px solid var(--border-sub); border-radius: var(--r-sm);
  padding: 9px 11px; font-family: var(--font-mono); font-size: 11.5px;
  color: var(--text-sec); overflow-x: auto; white-space: pre-wrap;
  word-break: break-all; max-height: 220px; overflow-y: auto;
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--r); margin-bottom: 14px;
  font-size: 13.5px;
}
.alert svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; margin-top: 2px; }
.alert-ok   { background: var(--ok-bg);   color: var(--ok-text);   border: 1px solid var(--ok-bdr); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-bdr); }
.alert-bad  { background: var(--bad-bg);  color: var(--bad-text);  border: 1px solid var(--bad-bdr); }
.alert-info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-bdr); }
.alert ul { margin: 5px 0 0; }
.alert li { list-style: disc inside; padding: 2px 0; font-size: 13px; }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast-zone {
  position: fixed; bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px; border-radius: var(--r);
  background: var(--bg-elevated); border: 1px solid var(--border-str);
  box-shadow: var(--shadow-lg); min-width: 270px; max-width: 360px;
  font-size: 13px; pointer-events: all;
  animation: tIn .18s ease, tOut .25s ease 3.75s forwards;
}
.toast svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }
.t-ok   { border-left: 3px solid var(--ok);   color: var(--ok-text); }
.t-warn { border-left: 3px solid var(--warn);  color: var(--warn-text); }
.t-bad  { border-left: 3px solid var(--bad);   color: var(--bad-text); }
.t-info { border-left: 3px solid var(--accent); color: var(--info-text); }
.toast-msg { flex: 1; }
.toast-ttl { font-weight: 600; color: var(--text-pri); margin-bottom: 1px; }
.toast-sub { font-size: 12px; color: var(--text-sec); }
@keyframes tIn  { from { transform: translateX(22px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tOut { from { opacity: 1; } to { opacity: 0; transform: translateY(6px); } }

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity var(--tr-slow);
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border-str);
  border-radius: var(--r-lg); padding: 24px; max-width: 440px; width: 100%;
  box-shadow: var(--shadow-lg); transform: translateY(8px);
  transition: transform var(--tr-slow);
}
.modal-bg.open .modal { transform: none; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-hd h3 { font-size: 15px; color: var(--text-pri); }
.modal-body { font-size: 13.5px; color: var(--text-sec); line-height: 1.6; margin-bottom: 18px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Empty state ────────────────────────────────────────────────── */
.empty { text-align: center; padding: 36px 16px; color: var(--text-mute); }
.empty svg { margin: 0 auto 10px; opacity: .25; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-sec); margin-bottom: 4px; }

/* ── Misc utilities ─────────────────────────────────────────────── */
.divider  { height: 1px; background: var(--border-sub); margin: 16px 0; }
.t-mute   { color: var(--text-mute); }
.t-sec    { color: var(--text-sec); }
.t-pri    { color: var(--text-pri); }
.mono     { font-family: var(--font-mono); }
.trunc    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex     { display: flex; }
.items-c  { align-items: center; }
.jc-sb    { justify-content: space-between; }
.gap-1    { gap: 4px; }
.gap-2    { gap: 8px; }
.gap-3    { gap: 12px; }
.gap-4    { gap: 16px; }
.mt-1     { margin-top: 4px; }
.mt-2     { margin-top: 10px; }
.mt-3     { margin-top: 16px; }
.mb-1     { margin-bottom: 4px; }
.mb-2     { margin-bottom: 10px; }
.fw-600   { font-weight: 600; }
.fs-12    { font-size: 12px; }
.fs-11    { font-size: 11px; }

/* ── Login page ─────────────────────────────────────────────────── */
body.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 36px 32px;
  width: 100%; max-width: 400px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand .brand-icon { width: 38px; height: 38px; }
.login-brand .brand-name { font-size: 17px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 5px; }
.login-sub   { font-size: 13px; color: var(--text-mute); margin-bottom: 22px; }

/* ── Health page cards ──────────────────────────────────────────── */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 11px; }
.health-card {
  background: var(--bg-card-alt); border: 1px solid var(--border);
  border-radius: var(--r); padding: 13px;
}
.health-card.hc-ok   { border-color: var(--ok-bdr); }
.health-card.hc-bad  { border-color: var(--bad-bdr); }
.health-card.hc-warn { border-color: var(--warn-bdr); }
.health-label { font-size: 10.5px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; }
.health-val   { font-size: 15px; font-weight: 700; color: var(--text-pri); }
.health-sub   { font-size: 11px; color: var(--text-mute); margin-top: 3px; }

/* ── Degraded warning bar ───────────────────────────────────────── */
.degraded-bar {
  background: var(--bad-bg); border: 1px solid var(--bad-bdr);
  border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--bad-text);
}
.degraded-bar svg { flex-shrink: 0; width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.degraded-bar strong { font-weight: 700; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: 1fr; }
  .incident-row { gap: 12px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
