/* ═══════════════════════════════════════════════════════════════════════════
   SysOps — components
   Glass panels, neon controls, status indicators, gauges, charts, tables.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────── glass panel ─────────────────────────────── */

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* Flat cards: the old accent hairline and glass blur are gone. */
.panel::before {
  display: none;
}

.panel.hoverable:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(14px, 0.8vw, 18px) clamp(16px, 1vw, 22px);
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.panel-title-icon {
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.panel-sub {
  font-size: 12px;
  color: var(--text-mute);
}

.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: clamp(16px, 1vw, 22px); }
.panel-body.flush { padding: 0; }
.panel-body.tight { padding: 12px; }
.panel-foot {
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.panel.danger { border-color: rgba(var(--crit-rgb), 0.35); }
.panel.danger::before { background: linear-gradient(90deg, transparent, rgba(var(--crit-rgb), 0.6), transparent); }

/* ──────────────────────────────── buttons ──────────────────────────────── */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn[disabled], .btn.is-loading { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  --btn-bg: var(--accent);
  --btn-fg: #ffffff;
  --btn-border: transparent;
  font-weight: 600;
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent); filter: brightness(0.92); }

.btn-danger { --btn-bg: rgba(var(--crit-rgb), 0.14); --btn-fg: var(--crit); --btn-border: rgba(var(--crit-rgb), 0.42); }
.btn-danger:hover { background: rgba(var(--crit-rgb), 0.22); border-color: rgba(var(--crit-rgb), 0.7); box-shadow: none; }

.btn-ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.btn-sm { min-height: 29px; padding: 4px 10px; font-size: 12px; }
.btn-icon { min-height: 34px; width: 34px; padding: 0; }
.btn-block { width: 100%; }

.btn.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────── chips ──────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  white-space: nowrap;
}

.chip.ok { background: rgba(var(--ok-rgb), 0.13); border-color: rgba(var(--ok-rgb), 0.42); color: var(--ok); }
.chip.warn { background: rgba(var(--warn-rgb), 0.13); border-color: rgba(var(--warn-rgb), 0.42); color: var(--warn); }
.chip.crit { background: rgba(var(--crit-rgb), 0.14); border-color: rgba(var(--crit-rgb), 0.45); color: var(--crit); }
.chip.info { background: rgba(var(--info-rgb), 0.13); border-color: rgba(var(--info-rgb), 0.42); color: var(--info); }
.chip.accent { background: rgba(var(--accent-rgb), 0.13); border-color: rgba(var(--accent-rgb), 0.45); color: var(--accent); }
.chip.mute { opacity: 0.7; }

/* Chips double as jump links (e.g. registry card → module dashboard). */
a.chip {
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

a.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.7);
}

/* ───────────────────────────── status dots ───────────────────────────── */

.dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--idle);
}

.dot.ok { background: var(--ok); box-shadow: var(--glow-ok); }
.dot.warn { background: var(--warn); box-shadow: var(--glow-warn); }
.dot.crit { background: var(--crit); box-shadow: var(--glow-crit); }
.dot.info { background: var(--info); box-shadow: 0 0 12px rgba(var(--info-rgb), 0.55); }
.dot.pending { background: var(--warn); box-shadow: var(--glow-warn); }

.dot.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: inherit;
  animation: ping 1.9s var(--ease) infinite;
}

.dot.ok.pulse::after { color: var(--ok); }
.dot.crit.pulse::after { color: var(--crit); }
.dot.warn.pulse::after { color: var(--warn); }
.dot.info.pulse::after { color: var(--info); }

@keyframes ping {
  0% { transform: scale(0.7); opacity: 0.85; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ───────────────────────────── metric tiles ───────────────────────────── */

.metric {
  padding: clamp(16px, 1vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 0.7vw, 16px);
  min-width: 0;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(11px, 0.25vw + 9px, 13px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: clamp(28px, 0.9vw + 18px, 44px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.metric-value .unit { font-size: 13px; color: var(--text-mute); font-weight: 500; }
.metric-value.warn { color: var(--warn); text-shadow: none; }
.metric-value.crit { color: var(--crit); text-shadow: none; }
.metric-value.ok { color: var(--ok); }

.metric-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mute);
}

.metric-delta.up { color: var(--crit); }
.metric-delta.down { color: var(--ok); }

/* ─────────────────────────────── meters ─────────────────────────────── */

.meter {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  box-shadow: none;
  transition: width var(--dur-slow) var(--ease), background var(--dur) var(--ease);
}

.meter-fill.warn { background: var(--warn); box-shadow: none; }
.meter-fill.crit { background: var(--crit); box-shadow: none; }
.meter-fill.ok { background: var(--ok); box-shadow: none; }

.meter.thin { height: 4px; }
.meter.thick { height: 10px; }

/* ──────────────────────────── gauge (health) ──────────────────────────── */

.gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin: 0 auto;
}

.gauge svg { transform: rotate(-90deg); }

.gauge-track { stroke: rgba(148, 163, 184, 0.14); }
.gauge-value {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-slow) var(--ease), stroke var(--dur) var(--ease);
}
.gauge-value.ok { stroke: var(--ok); }
.gauge-value.warn { stroke: var(--warn); }
.gauge-value.crit { stroke: var(--crit); }

.gauge-center {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gauge-number {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.gauge-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}

/* ─────────────────────────────── sparklines ─────────────────────────────── */

.spark { display: block; width: 100%; height: 54px; overflow: visible; }
.spark path.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.5));
  transition: d var(--dur) linear;
}
.spark path.area { fill: url(#sparkFill); stroke: none; opacity: 0.9; }
.spark.ok path.line { stroke: var(--ok); }
.spark.warn path.line { stroke: var(--warn); }
.spark.crit path.line { stroke: var(--crit); }
.spark .threshold {
  stroke: rgba(var(--crit-rgb), 0.45);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.bars { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.bars span {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), 0.2));
  transition: height var(--dur) var(--ease);
}

/* ──────────────────────────────── tables ──────────────────────────────── */

.table-wrap { width: 100%; overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  background: rgba(7, 12, 24, 0.92);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

:root[data-theme="light"] table.data th { background: rgba(244, 247, 252, 0.95); }

table.data td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: middle;
}

table.data tbody tr { transition: background var(--dur-fast) var(--ease); }
table.data tbody tr:hover { background: rgba(var(--accent-rgb), 0.055); }
table.data tbody tr:last-child td { border-bottom: none; }

table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.data .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ─────────────────────────────── forms ─────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-hint { font-size: 11.5px; color: var(--text-faint); }
.field-error { font-size: 11.5px; color: var(--crit); display: flex; align-items: center; gap: 5px; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--panel-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

textarea { min-height: 88px; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; }

input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:hover, select:hover, textarea:hover { border-color: rgba(var(--accent-rgb), 0.35); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.75);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16), 0 0 18px rgba(var(--accent-rgb), 0.14);
  background: rgba(var(--accent-rgb), 0.04);
}

input.invalid, select.invalid, textarea.invalid { border-color: rgba(var(--crit-rgb), 0.7); }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-mute) 50%),
    linear-gradient(135deg, var(--text-mute) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

select option { background: var(--panel-solid); color: var(--text); }

.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group > input { flex: 1 1 auto; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  appearance: none;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--panel-sunken);
  cursor: pointer;
  position: relative;
  transition: all var(--dur-fast) var(--ease);
}

.checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: transparent;
  box-shadow: none;
}

.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #04121a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength i {
  flex: 1 1 0;
  height: 3px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.18);
  transition: background var(--dur) var(--ease);
}
.strength[data-score="1"] i:nth-child(-n + 1) { background: var(--crit); }
.strength[data-score="2"] i:nth-child(-n + 2) { background: var(--warn); }
.strength[data-score="3"] i:nth-child(-n + 3) { background: var(--accent); }
.strength[data-score="4"] i { background: var(--ok); }

/* ─────────────────────────────── tabs ─────────────────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--panel-sunken);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}

.tab:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.08); }

.tab.active {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.3);
}

/* ─────────────────────────────── modals ─────────────────────────────── */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 10, 0.68);
  backdrop-filter: blur(6px);
  animation: fade-in var(--dur) var(--ease);
}

.modal {
  width: min(620px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(13, 20, 38, 0.98), rgba(9, 14, 26, 0.98));
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3), 0 0 60px rgba(var(--accent-rgb), 0.12);
  animation: modal-in var(--dur) var(--ease);
  overflow: hidden;
}

:root[data-theme="light"] .modal { background: linear-gradient(180deg, #ffffff, #f4f7fc); }

.modal.wide { width: min(880px, 100%); }

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-title { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: rgba(4, 7, 14, 0.4);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─────────────────────────────── toasts ─────────────────────────────── */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(140deg, rgba(13, 20, 38, 0.97), rgba(9, 14, 26, 0.97));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-3);
  animation: toast-in var(--dur) var(--ease);
  font-size: 12.5px;
}

.toast.ok { border-color: rgba(var(--ok-rgb), 0.45); box-shadow: var(--shadow-3), 0 0 24px rgba(var(--ok-rgb), 0.16); }
.toast.error { border-color: rgba(var(--crit-rgb), 0.5); box-shadow: var(--shadow-3), 0 0 24px rgba(var(--crit-rgb), 0.18); }
.toast.warn { border-color: rgba(var(--warn-rgb), 0.45); }
.toast.info { border-color: rgba(var(--info-rgb), 0.4); }

.toast-icon { font-family: var(--font-mono); font-weight: 700; }
.toast.ok .toast-icon { color: var(--ok); }
.toast.error .toast-icon { color: var(--crit); }
.toast.warn .toast-icon { color: var(--warn); }
.toast.info .toast-icon { color: var(--info); }

.toast-body { flex: 1 1 auto; min-width: 0; }
.toast-title { font-weight: 650; margin-bottom: 2px; }
.toast-text { color: var(--text-mute); overflow-wrap: anywhere; }

.toast-close {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  align-self: flex-start;
}
.toast-close:hover { color: var(--text); }

.toast.out { animation: toast-out var(--dur) var(--ease) forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ────────────────────────────── skeletons ────────────────────────────── */

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.1);
  min-height: 14px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.16), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

/* ──────────────────────────── empty / errors ──────────────────────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 38px 20px;
  text-align: center;
  color: var(--text-mute);
}

.empty-icon {
  font-family: var(--font-mono);
  font-size: 30px;
  color: rgba(var(--accent-rgb), 0.5);
  text-shadow: 0 0 22px rgba(var(--accent-rgb), 0.3);
}

.empty-title { font-weight: 600; color: var(--text-dim); }
.empty-text { font-size: 12.5px; max-width: 46ch; }

.callout {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-sunken);
  font-size: 12.5px;
  color: var(--text-dim);
  border-left-width: 3px;
}

.callout.ok { border-left-color: var(--ok); background: rgba(var(--ok-rgb), 0.06); }
.callout.warn { border-left-color: var(--warn); background: rgba(var(--warn-rgb), 0.06); }
.callout.crit { border-left-color: var(--crit); background: rgba(var(--crit-rgb), 0.07); }
.callout.info { border-left-color: var(--info); background: rgba(var(--info-rgb), 0.06); }
.callout-accent { border-left-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); }

.callout-icon { font-family: var(--font-mono); font-weight: 700; }
.callout-title { font-weight: 650; color: var(--text); margin-bottom: 2px; }

/* ─────────────────────────────── kv list ─────────────────────────────── */

.kv { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 8px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; padding-top: 2px; }
.kv dd { margin: 0; font-family: var(--font-mono); color: var(--text-dim); overflow-wrap: anywhere; }

/* ────────────────────────────── log viewer ────────────────────────────── */

.log-stream {
  font-family: var(--font-mono);
  font-size: 11.75px;
  line-height: 1.65;
  background: var(--panel-sunken);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 11px 13px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
}

.log-line { display: flex; gap: 10px; padding: 1px 0; }
.log-line .t { color: var(--text-faint); flex: 0 0 auto; }
.log-line .lv { flex: 0 0 34px; font-weight: 700; }
.log-line.debug .lv { color: var(--text-faint); }
.log-line.info .lv { color: var(--info); }
.log-line.warn .lv { color: var(--warn); }
.log-line.error .lv { color: var(--crit); }
.log-line .m { color: var(--text-dim); overflow-wrap: anywhere; }
.log-line.error .m { color: #ffd7de; }

/* ──────────────── sparkline strip / mini bar chart wrapper ──────────────── */

.strip {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 34px;
  padding: 0 2px;
}

.strip i {
  flex: 1 1 0;
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  background: rgba(var(--accent-rgb), 0.55);
  transition: height var(--dur) var(--ease), background var(--dur) var(--ease);
}

.strip i.hot { background: var(--warn); }
.strip i.critical { background: var(--crit); }

/* ───────────────────────────── accent divider ───────────────────────────── */

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin: 4px 0;
}

/* ───────────────────────────── progress ring ───────────────────────────── */

.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
}

/* ─────────────────────────── user menu (topbar) ─────────────────────────── */

.user-anchor {
  position: relative;
  display: flex;
  align-items: center;
}

.user-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: 238px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
}

.user-popover-head {
  padding: 7px 10px 9px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

/* Role and level sit on one line but in different weights, so neither wraps. */
.user-popover-role {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--text-mute);
  white-space: nowrap;
}

.user-popover-role #pop-role { color: var(--text-dim); }
.user-popover-sep { color: var(--text-faint); }

.user-popover-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
  text-decoration: none;
}

.user-menu-item.danger { color: var(--crit); }
.user-menu-item.danger:hover,
.user-menu-item.danger:focus-visible {
  background: rgba(var(--crit-rgb), 0.12);
  border-color: rgba(var(--crit-rgb), 0.34);
  color: var(--crit);
}

/* Build identity moved here from the old sidebar footer. */
.user-popover-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  padding: 7px 10px 3px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
}

/* ───────────────────── notifications (topbar envelope) ───────────────────── */

.notify-anchor {
  position: relative;
  display: flex;
  align-items: center;
}

.notify-popover {
  width: 320px;
  max-width: calc(100vw - 24px);
}

.notify-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(60vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}

.notify-section {
  padding: 7px 10px 3px;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.notify-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.notify-row:hover,
.notify-row:focus-visible {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.notify-row-main {
  min-width: 0;
  flex: 1 1 auto;
}

.notify-row-title {
  font-size: 12.5px;
  font-weight: 550;
}

.notify-row-sub {
  font-size: 11px;
  color: var(--text-mute);
}

.notify-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
}

.notify-foot {
  display: flex;
  gap: 1px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.notify-foot .user-menu-item {
  text-align: center;
}

/* ────────────────────── topbar user chip / apps launcher ────────────────────── */

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  font-size: 13px;
  font-weight: 700;
}

.user-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  text-align: left;
}

.user-chip-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-role {
  font-size: 10.5px;
  text-transform: capitalize;
  color: var(--text-mute);
}

.apps-anchor {
  position: relative;
  display: flex;
  align-items: center;
}

.apps-popover {
  width: 300px;
}

.apps-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: min(62vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}

.apps-group {
  padding: 8px 10px 3px;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.apps-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.apps-link:hover,
.apps-link:focus-visible {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.apps-link .nav-icon {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  font-family: var(--font-mono);
  opacity: 0.9;
}

/* ───────────────────────────── metric tile icon ───────────────────────────── */

/* Inline SVG, not a Unicode geometric glyph: the label renders in the monospace
   stack, which has no U+25A4, so a `▤` there painted a missing-glyph box and the
   CPU tile read as "BCPU". SVG has no font-coverage dependency. */
.metric-icon {
  flex: 0 0 auto;
  color: var(--text-mute);
}

/* ──────────────────────────── link affordance ──────────────────────────── */

/* Controls never underline — the darkening is the affordance, and an underline
   is a cue for a link inside prose. Anything rendered as prose opts back in. */
a { text-decoration: none; }
a:hover { text-decoration: none; }
.prose a,
.view-desc a,
.callout a { text-decoration: underline; }

/* ─────────────────────────────── home dashboard ─────────────────────────────── */

/* Each chosen widget is a card; the toolbar (drag handle, remove) appears on
   hover so the dashboard reads as widgets, not chrome. */
.home-card {
  position: relative;
  border-radius: var(--radius);
  transition: outline-color var(--dur-fast) var(--ease);
}
.home-card.dragging { opacity: 0.55; }
.home-card.drop-target { outline: 2px dashed var(--accent); outline-offset: 3px; }
.home-card .home-tools {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.home-card:hover .home-tools,
.home-card:focus-within .home-tools { opacity: 1; }
.home-handle {
  cursor: grab;
  color: var(--text-faint);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  user-select: none;
}
.home-handle:active { cursor: grabbing; }

