/* ═══════════════════════════════════════════════════════════════════
   Fleet Manager — shared stylesheet
   Dark ops-style UI; no external dependencies.
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS variables ─────────────────────────────────────────────── */
:root {
  --bg:            #0e1117;
  --bg-card:       #161b22;
  --bg-hover:      #1c2128;
  --border:        #30363d;
  --text:          #e6edf3;
  --text-muted:    #8b949e;
  --accent:        #388bfd;
  --accent-hover:  #58a6ff;
  --ok:            #3fb950;
  --warning:       #d29922;
  --critical:      #f85149;
  --sidebar-w:     220px;
  --topbar-h:      52px;
  --radius:        6px;
  --font:          'Segoe UI', system-ui, sans-serif;
  --font-mono:     'Consolas', 'Menlo', monospace;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 12px; color: #a5d6ff; }
textarea, input, select { font-family: var(--font); }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  max-width: 140px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.brand-icon { font-size: 20px; }
.brand-name { font-size: 16px; font-weight: 600; }
.nav-list { list-style: none; padding: 12px 0; flex: 1; overflow-y: auto; }
.nav-item a {
  display: block;
  padding: 8px 20px;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
}
.nav-item a:hover {
  color: var(--text);
  background: var(--bg-hover);
  text-decoration: none;
}
.nav-item.active a {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--bg-hover);
}
.nav-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.ext-link { font-size: 12px; color: var(--text-muted); }
.ext-link:hover { color: var(--text); }

/* ── Top bar ────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 90;
}
.topbar-breadcrumb { color: var(--text-muted); font-size: 13px; }
.topbar-breadcrumb a { color: var(--text-muted); }
.topbar-breadcrumb a:hover { color: var(--text); }
.topbar-breadcrumb strong { color: var(--text); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-user { color: var(--text-muted); font-size: 13px; }

/* ── Main content ───────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px 32px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Flash messages ─────────────────────────────────────────────── */
.flash-container {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 0 32px;
}
.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 8px 0;
  font-size: 13px;
}
.flash-success  { background: #1a3a22; border: 1px solid var(--ok);       color: #7ee787; }
.flash-warning  { background: #2e2410; border: 1px solid var(--warning);   color: #e3b341; }
.flash-error    { background: #3a1a1a; border: 1px solid var(--critical);  color: #ff7b72; }
.flash-info     { background: #1a2740; border: 1px solid var(--accent);    color: #79c0ff; }
/* api_key flash: distinct amber with monospace token for easy copying */
.flash-api_key  { background: #2e2010; border: 1px solid #d29922; color: #e3b341; font-family: monospace; word-break: break-all; }

/* ── Common page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 18px; font-weight: 700; letter-spacing: .03em; }
.page-meta  { color: var(--text-muted); font-size: 13px; }
.page-refresh { color: var(--text-muted); font-size: 12px; }

/* ── Cards / sections ───────────────────────────────────────────── */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.float-right { margin-left: auto; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.empty-state { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.status-ok-text { color: var(--ok); }
.legend { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.mt { margin-top: 24px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  background: transparent;
  color: var(--text);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: #21262d; border-color: var(--border); }
.btn-secondary:hover { background: #30363d; border-color: #8b949e; }
.btn-danger { background: #6a1a1a; border-color: var(--critical); color: #ff7b72; }
.btn-danger:hover { background: #8a2020; }
.btn-success { background: #0d3120; border-color: var(--ok); color: #3fb950; }
.btn-success:hover { background: #144025; }
.btn-warning { background: #3a2a0a; border-color: var(--warning); color: #e3b341; }
.btn-warning:hover { background: #4a3a10; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 7px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; margin-bottom: 8px; }

/* ── Status badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #21262d;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.status-badge { font-size: 12px; }
.status-ok     .status-badge,
.status-badge.status-ok    { color: var(--ok); }
.status-warning .status-badge,
.status-badge.status-warning { color: var(--warning); }
.status-critical .status-badge,
.status-badge.status-critical { color: var(--critical); }

/* ── Role + status badge tints (users page) ─────────────────────── */
.badge-ok    { color: var(--ok); border-color: var(--ok); }
.badge-warn  { color: var(--warning); border-color: var(--warning); }
.badge-admin      { color: var(--critical); border-color: var(--critical); }
.badge-operator   { color: var(--accent); border-color: var(--accent); }
.badge-technician { color: var(--warning); border-color: var(--warning); }
.badge-viewer     { color: var(--text-muted); }
.badge-ci_bot     { color: #8b5cf6; border-color: #8b5cf6; }

/* ── Site grid (Overview) ───────────────────────────────────────── */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.site-card {
  display: block;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.site-card:hover { background: var(--bg-hover); border-color: var(--accent); text-decoration: none; }
.site-card.status-critical { border-left: 4px solid var(--critical); }
.site-card.status-warning  { border-left: 4px solid var(--warning); }
.site-card.status-ok       { border-left: 4px solid var(--ok); }
.site-card-status { font-size: 18px; margin-bottom: 6px; }
.site-card-name { font-size: 14px; font-weight: 700; color: var(--text); }
.site-card-detail { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Zone matrix (Site View) ────────────────────────────────────── */
.zone-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.zone-card {
  display: block;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.zone-card:hover { background: var(--bg-hover); border-color: var(--accent); text-decoration: none; }
.zone-card.status-critical { border-left: 4px solid var(--critical); }
.zone-card.status-warning  { border-left: 4px solid var(--warning); }
.zone-card.status-ok       { border-left: 4px solid var(--ok); }
.zone-card-name { font-weight: 600; color: var(--text); font-size: 13px; }
.zone-card-devices { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Zone layout (Zone View) ────────────────────────────────────── */
.zone-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}
.zone-actions { position: sticky; top: calc(var(--topbar-h) + 20px); }

/* ── Grafana panels ─────────────────────────────────────────────── */
.grafana-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}
.grafana-panels--stacked { grid-template-columns: 1fr; }
.grafana-panel { position: relative; }
.grafana-panel iframe {
  width: 100%;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
}
.panel-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.panel-link { float: right; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Device blocks (Zone/Device view) ──────────────────────────── */
.device-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.device-block:last-of-type { border-bottom: none; }
.device-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.device-name { font-weight: 600; }
.device-role { }
.svc-list { list-style: none; padding: 0; margin: 0; }
.svc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}
.svc-item.svc-active   { color: var(--ok); }
.svc-item.svc-failed   { color: var(--critical); }
.svc-item.svc-activating { color: var(--warning); }
.svc-item.svc-unknown  { color: var(--text-muted); }
.svc-name { min-width: 160px; }
.svc-version { color: var(--text-muted); font-size: 12px; }
.svc-empty { color: var(--text-muted); font-size: 12px; padding: 4px 0; }
.svc-list--detail .svc-item { flex-direction: column; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.svc-list--detail .svc-item:last-child { border-bottom: none; }
.svc-row { display: flex; align-items: center; gap: 8px; }
.svc-actions { display: flex; gap: 6px; margin-top: 4px; padding-left: 16px; }
.svc-footer { padding-top: 12px; }
.event-list { list-style: none; padding: 0; }
.event-item { font-size: 12px; color: var(--text-muted); padding: 3px 0; }
.event-time { font-family: var(--font-mono); margin-right: 8px; }
.event-action { color: var(--text); }
.alert-item { color: var(--critical) !important; }

/* ── Device view layout ─────────────────────────────────────────── */
.device-header { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; }
.device-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.device-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.device-metrics, .device-services { border-top-left-radius: 0; border-top-right-radius: 0; }
.metric-table { width: 100%; margin-top: 12px; border-collapse: collapse; }
.metric-table td { padding: 4px 8px 4px 0; font-size: 13px; vertical-align: middle; }
.bar { display: inline-block; width: 120px; height: 8px; background: #21262d; border-radius: 4px; vertical-align: middle; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }

/* ── Tables ─────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table--compact td, .data-table--compact th { padding: 5px 8px; }
.time-cell { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.detail-cell { max-width: 300px; word-break: break-word; color: var(--text-muted); }
.audit-table .audit-row:hover td { background: var(--bg-hover); }
.alert-row.severity-critical td { border-left: 3px solid var(--critical); }
.alert-row.severity-warning  td { border-left: 3px solid var(--warning); }

/* ── Deployment ring bars ───────────────────────────────────────── */
.rollout-banner, .rollout-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.rollout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.rollout-title { font-weight: 700; font-size: 15px; }
.rollout-name  { font-weight: 600; }
.rollout-ring  { font-size: 12px; color: var(--text-muted); }
.rollout-status { font-size: 12px; }
.badge-status-in_progress { color: var(--accent); }
.badge-status-pending { color: var(--text-muted); }
.ring-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ring-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ring-label { min-width: 130px; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.ring-bar-wrap {
  flex: 1;
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
}
.ring-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.ring-done    { background: var(--ok); }
.ring-active  { background: var(--accent); }
.ring-waiting { background: #21262d; }
.ring-pct { min-width: 130px; font-size: 12px; color: var(--text-muted); }
.rollout-actions { display: flex; gap: 10px; margin-top: 12px; }

/* Ring step bubbles (overview active rollout banner) */
.rollout-rings { display: inline-flex; gap: 4px; align-items: center; }
.ring-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700;
  border: 2px solid var(--border);
}
.ring-step.ring-done    { background: var(--ok);     border-color: var(--ok);     color: #fff; }
.ring-step.ring-active  { background: var(--accent); border-color: var(--accent); color: #fff; }
.ring-step.ring-pending { background: transparent;   border-color: var(--border); color: var(--text-muted); }

/* ── Hotfix cards ───────────────────────────────────────────────── */
.hotfix-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.hotfix-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.hotfix-id { font-weight: 700; font-family: var(--font-mono); }
.hotfix-device { color: var(--accent); }
.hotfix-detail { font-size: 13px; margin-bottom: 4px; }
.hotfix-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.hotfix-actions { display: flex; gap: 10px; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-grid { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-row--submit { flex-direction: row; align-items: center; gap: 10px; margin-top: 4px; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
}
input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}
select option { background: var(--bg-card); }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-group--vertical { flex-direction: column; gap: 8px; }
.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}
.page-indicator { font-size: 13px; color: var(--text-muted); }

/* ── Login page ─────────────────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-box {
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 36px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 28px;
  justify-content: center;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-form label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.login-form input { width: 100%; }

/* ── Nav section labels ─────────────────────────────────────────── */
.nav-section {
  padding: 10px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--border);
  font-weight: 600;
}
/* ── Utility ────────────────────────────────────────────────────── */
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.row-reconciled { opacity: 0.5; }

/* ── Modal dialogs ──────────────────────────────────────────────── */
dialog {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  width: min(520px, 92vw);
  box-shadow: 0 12px 40px rgba(0,0,0,.7);
}
dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-body { padding: 20px; }
.dialog-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; min-width: 0; }

/* ── Packages / repo browser ────────────────────────────────────── */
.env-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.env-tab {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.env-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: none; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.pkg-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
}
.pkg-badge.dev    { border-color: #388bfd; color: #388bfd; }
.pkg-badge.staging { border-color: #d29922; color: #d29922; }
.pkg-badge.prod   { border-color: #3fb950; color: #3fb950; }

/* ── Profile / JSON editor ──────────────────────────────────────── */
.json-editor {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #a5d6ff;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px;
  resize: vertical;
}
.json-editor:focus { outline: none; border-color: var(--accent); }
.profile-stack {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5d6ff;
  white-space: pre-wrap;
  margin: 0;
}

/* ── Overrides console ──────────────────────────────────────────── */
.scope-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
}
.scope-site   { border-color: var(--accent); color: var(--accent); }
.scope-zone   { border-color: var(--warning); color: var(--warning); }
.scope-device { border-color: var(--ok); color: var(--ok); }

/* ── Platform stat cards ────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  border-top: 3px solid var(--border);
}
.stat-card.stat-ok       { border-top-color: var(--ok); }
.stat-card.stat-warn     { border-top-color: var(--warning); }
.stat-card.stat-critical { border-top-color: var(--critical); }
.stat-card.stat-neutral  { border-top-color: var(--accent); }
.stat-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.stat-total {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 6px;
}
.stat-sub {
  font-size: 11px;
  color: var(--critical);
  margin-top: 3px;
}
.stat-sub2 {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Gauge bar (used in monitoring vitals) ──────────────────────── */
.gauge-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 3px;
}
.gauge-fill.ok       { background: var(--ok); }
.gauge-fill.warn     { background: var(--warning); }
.gauge-fill.critical { background: var(--critical); }

/* ── Prometheus target health badges ────────────────────────────── */
.health-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}
.health-up      { color: var(--ok);       border-color: var(--ok); }
.health-down    { color: var(--critical); border-color: var(--critical); }
.health-unknown { color: var(--warning);  border-color: var(--warning); }

/* ── SVG icon sprites (Heroicons mini 16×16, MIT licence) ────────────────── */
svg.icon {
  width: 14px; height: 14px;
  display: inline-block; vertical-align: -0.125em;
  fill: currentColor; flex-shrink: 0;
}
svg.icon.icon-lg { width: 18px; height: 18px; }
.icon-ok    { color: var(--ok); }
.icon-err   { color: var(--critical); }
.icon-warn  { color: var(--warning); }
.icon-muted { color: var(--text-muted); }
