/* ── Card ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-rest);
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card-title .hint { color: var(--ink-3); font-weight: 400; font-size: 12px; cursor: help; }
.card-link { font-size: 12.5px; color: #9A6613; font-weight: 600; background: none; border: 0; }
.card-link:hover { text-decoration: underline; }

/* ── Buttons ───────────────────────────────── */
.btn {
  border-radius: var(--r-s);
  border: 1px solid var(--border-strong);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink);
  transition: filter 160ms ease-out, background 160ms ease-out;
}
.btn:hover { background: var(--surface-warm); }
.btn-primary {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.06); background: var(--brand-grad); }
.btn-ghost { background: var(--surface); color: var(--ink-2); }
.btn-sm { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.btn-green { background: var(--alive); border-color: transparent; color: #fff; }
.btn-green:hover { filter: brightness(1.06); background: var(--alive); }

/* ── Status pills ──────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-idle { background: var(--idle-bg); color: #5F6B79; }
.pill-wake { background: var(--wake-bg); color: #9A6613; }
.pill-alive { background: var(--alive-bg); color: #2E6B44; }
.pill-danger { background: var(--danger-bg); color: #A03327; }
.pill-plain::before { display: none; }

.delta { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--alive); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--ink-3); }

/* ── Stat cards ────────────────────────────── */
.stat-row {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-rest);
  padding: 14px 16px 12px;
  min-width: 0;
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.stat-ico {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 12px;
  flex: 0 0 24px;
}
.stat-ico.idle { background: var(--idle-bg); color: #5F6B79; }
.stat-ico.wake { background: var(--wake-bg); color: #9A6613; }
.stat-ico.alive { background: var(--alive-bg); color: #2E6B44; }
.stat-value {
  font-size: 27px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-top: 6px;
  line-height: 1.15;
  white-space: nowrap;
}
.stat-value small { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.stat-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  min-height: 26px;
}
.stat-foot .delta {
  font-size: 11.5px;
  min-width: 0;
  line-height: 1.3;
}
.stat-foot .spark { flex: 0 0 auto; }

/* ── Sparkline / arcs ─────────────────────── */
.spark svg { display: block; }
.arc-wrap { position: relative; display: inline-grid; place-items: center; }
.arc-wrap svg { display: block; }
.arc-label {
  position: absolute;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.arc-label strong { font-size: 20px; font-weight: 800; }
.arc-label small { display: block; font-size: 10px; color: var(--ink-3); font-weight: 600; }

/* ── Spectrum bar ─────────────────────────── */
.sbar {
  height: 6px;
  border-radius: 999px;
  background: var(--idle-bg);
  overflow: hidden;
  min-width: 54px;
}
.sbar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 700ms var(--ease-bloom);
}

/* ── Dense table ──────────────────────────── */
.dense-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dense-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 8px 10px;
  background: var(--surface-warm);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.dense-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.dense-table tbody tr { transition: background 160ms ease-out; cursor: default; }
.dense-table tbody tr:hover { background: var(--surface-warm); }
.dense-table tbody tr.selectable { cursor: pointer; }
.dense-table tbody tr.selected { background: var(--wake-bg); }
.dense-table .t-num { text-align: right; }
.dense-table .t-id { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }

/* ── Filters / chips ──────────────────────── */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 160ms ease-out;
}
.chip:hover { border-color: var(--wake); color: #9A6613; }
.chip.on { background: var(--wake-bg); border-color: var(--wake); color: #9A6613; font-weight: 600; }
.select-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-s);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-s);
  padding: 0 10px;
  flex: 1;
  min-width: 160px;
}
.search-box input { border: 0; outline: none; background: transparent; padding: 7px 0; flex: 1; font-size: 12.5px; }

/* ── Timeline ─────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 16px 22px;
  border-left: 1px solid var(--border);
  margin-left: 6px;
}
.timeline li:last-child { padding-bottom: 2px; border-left-color: transparent; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--idle));
  box-shadow: 0 0 0 3px var(--surface);
}
.timeline .tl-time { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.timeline .tl-body { font-size: 12.5px; margin-top: 1px; }
.timeline .tl-body strong { font-weight: 600; }
.timeline .tl-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  color: var(--ink-3);
  margin-left: 6px;
}

/* ── Dim treatment (dimness is data) ──────── */
.thumb {
  border-radius: var(--r-s);
  background: linear-gradient(145deg, #C6CCD4, #9BA5B1);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb:not(:has(img))::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 62%, rgba(20, 27, 41, 0.28) 62%),
    repeating-linear-gradient(90deg, transparent 0 14%, rgba(255, 255, 255, 0.22) 14% 17%);
}
.thumb.dim-idle { border: 1px dashed var(--idle); }
.thumb.dim-idle img { filter: saturate(0.35) brightness(0.92); }
.thumb.dim-wake { border-left: 3px solid var(--wake); }
.thumb.dim-wake img { filter: saturate(0.7); }
.thumb.dim-alive { border-left: 3px solid var(--alive); background: var(--alive-bg); }

/* ── Empty state ──────────────────────────── */
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}
.empty::before { content: "◌"; display: block; font-size: 22px; margin-bottom: 6px; opacity: 0.6; }

/* ── Pagination ───────────────────────────── */
.pager { display: flex; align-items: center; gap: 5px; padding-top: 12px; }
.pager button {
  min-width: 27px;
  height: 27px;
  border-radius: var(--r-s);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pager button.on { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 700; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .pager-info { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* ── Chart shells ─────────────────────────── */
.chart { width: 100%; }
.chart-sm { height: 150px; }
.chart-md { height: 240px; }
.chart-lg { height: 380px; }

/* ── Layout helpers ───────────────────────── */
.grid { display: grid; gap: 16px; }
.mt { margin-top: 16px; }
.row-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta-line { font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.meta-line b { color: var(--ink); font-weight: 600; }

/* ── Alert / list rows ────────────────────── */
.alert-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.alert-row:last-child { border-bottom: 0; }
.alert-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
  flex: 0 0 32px;
}
.alert-ico.wake { background: var(--wake-bg); color: #9A6613; }
.alert-ico.danger { background: var(--danger-bg); color: var(--danger); }
.alert-ico.idle { background: var(--idle-bg); color: #5F6B79; }
.alert-main { flex: 1; min-width: 0; }
.alert-main strong { font-size: 13px; display: block; }
.alert-main small { font-size: 11.5px; color: var(--ink-3); }
.alert-count {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.alert-count small { font-size: 11px; color: var(--ink-3); font-weight: 500; }
