/* cottagio — Plasma palette UI (operator-only) */

:root {
  --bg: #040214;
  --bg-deep: #02010a;
  --surface: #0c0820;
  --surface-raised: #11092e;
  --border: #1f1340;
  --border-bright: #2c1a55;
  --fg: #e8eae3;
  --fg-dim: #b4b6ad;
  --muted: #8b938a;
  --cyan: #00f0ff;
  --cyan-deep: #1a8aff;
  --pink: #ff2b8a;
  --grad: linear-gradient(135deg, var(--cyan) 0%, var(--pink) 100%);
  --ok: #22c55e;
  --warn: #f59e0b;
  --fail: #ef4444;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 240, 255, 0.06);
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
*::selection { background: rgba(0, 240, 255, 0.25); color: #fff; }

html, body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0, 240, 255, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 43, 138, 0.06), transparent 70%);
  pointer-events: none;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--pink); }

header, main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}
header {
  padding-top: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
header h1 a {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
header h1 img {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.4));
}
header .sub {
  color: var(--muted);
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  margin-top: 64px;
  padding: 20px 28px;
  text-align: center;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

main { padding-bottom: 40px; }

/* Desktop dashboard layout — single-column on mobile (default),
   12-col grid on wider viewports. Other pages (login/register/etc.)
   are unaffected because they don't use .dashboard-main. */
@media (min-width: 1100px) {
  main.dashboard-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px 40px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
  }
  main.dashboard-main > .card {
    max-width: none;
    margin: 24px 0 0;
    grid-column: span 12;
  }
  main.dashboard-main > .card.span-4 { grid-column: span 4; }
  main.dashboard-main > .card.span-6 { grid-column: span 6; }
  main.dashboard-main > .card.span-8 { grid-column: span 8; }
  main.dashboard-main > .card.span-12 { grid-column: span 12; }
}

/* Host detail page — wider single column on desktop so the
   reinstall command and recent-commands tables aren't cramped. */
@media (min-width: 900px) {
  main.host-main {
    max-width: 1100px;
  }
  main.host-main > .card {
    max-width: none;
    margin: 24px 0 0;
    min-width: 0;
  }
  main.host-main > .card:first-child {
    margin-top: 60px;
  }
}

/* Anything pre-formatted inside a card (reinstall command, JSON
   details, agent logs) must stay inside the card and wrap so the
   layout doesn't blow out horizontally on long tokens. */
.card pre {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 28px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 460px;
  margin: 60px auto 0;
}

.card h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 22px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.card .lead {
  color: var(--fg-dim);
  margin: 6px 0 24px;
  font-size: 13px;
}

label {
  display: block;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"] {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-deep) inset;
  caret-color: var(--fg);
  transition: background-color 9999s ease-in-out 0s;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.18);
}

input[name="code"] {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.4em;
  text-align: center;
}

button {
  width: 100%;
  padding: 12px 16px;
  background: var(--grad);
  color: #02010a;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
button:hover {
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.3);
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Secondary buttons — outline / muted variant. Used in dense action
   rows (host card right cluster, reinstall panel) where the primary
   orange gradient would compete with itself across 5+ buttons.
   Width is auto so the button hugs its label instead of stretching
   to fill the parent — the global `button { width: 100% }` default
   only suits single-action forms. */
button.secondary {
  width: auto;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #e4e4e7);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.18));
  font-weight: 500;
}
button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.err {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 13px;
}
.err:empty { display: none; }

.ok {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  color: #86efac;
  font-size: 13px;
}

dl {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}
dl div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
dt { color: var(--muted); }
dd { margin: 0; color: var(--fg); }

.actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}
.actions button {
  width: auto;
  flex: 0 0 auto;
  padding: 12px 22px;
}
.actions button.secondary {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--border-bright);
}

/* Inventory & health card */
.inv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) {
  .inv-grid { grid-template-columns: 1fr 1fr; }
  .inv-grid .inv-wide { grid-column: 1 / -1; }
}
.inv-block h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.inv-block dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.inv-block dt { color: var(--muted); }
.inv-block dd { margin: 0; color: var(--fg); word-break: break-word; }
.inv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.inv-row:first-child { border-top: 0; }
.inv-row .inv-name { color: var(--cyan); }
.inv-row .inv-meta { color: var(--muted); text-align: right; }
.inv-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.inv-bar > span {
  display: block;
  height: 100%;
  background: var(--grad);
}
.cmd-error {
  margin-top: 4px;
  color: #fca5a5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.command-row {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.command-row:first-child { border-top: 0; }
.cmd-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--fg);
}
.cmd-pill {
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.3;
}
.cmd-waiting { color: #fde68a; border-color: rgba(253, 230, 138, 0.45); }
.cmd-running { color: var(--cyan); border-color: rgba(0, 240, 255, 0.55); }
.cmd-done { color: #86efac; border-color: rgba(134, 239, 172, 0.45); }
.cmd-failed { color: #fca5a5; border-color: rgba(252, 165, 165, 0.5); }
.cmd-refused { color: var(--muted); border-color: var(--border); opacity: 0.75; }
.cmd-expired { color: var(--muted); border-color: var(--border); }
.cmd-target,
.cmd-sub {
  color: var(--muted);
}
.cmd-sub { margin-top: 4px; }
.actions button.secondary:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.12);
}

/* MFA setup */
.qr-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  min-height: 200px;
}
.qr-frame svg { max-width: 220px; height: auto; }
.recovery {
  background: #0b0f15;
  border: 1px solid var(--border-bright);
  padding: 12px 16px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  user-select: all;
}

/* Host rows on dashboard */
.host-row {
  padding: 12px;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.host-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.host-row-head strong {
  color: var(--fg);
  font-family: var(--font-sans);
}
.host-row-meta {
  color: var(--muted);
  margin-top: 4px;
}
/* Compact load/mem/disk rollup under the host row. Color shifts
   warn (orange) → crit (red) so saturated hosts pop out of the
   list at a glance. */
.host-row-sys {
  font-variant-numeric: tabular-nums;
}
.host-row-sys.is-warn {
  color: var(--warn);
}
.host-row-sys.is-crit {
  color: var(--fail);
  font-weight: 600;
}
/* Capability chip strip — one chip per package class scanned in
   the last 7 days. Green = ok, red = error. Refused chips are
   filtered out client-side so the row stays scannable. */
.host-row-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.host-cap-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  line-height: 1.4;
  border: 1px solid transparent;
  background: rgba(127, 127, 127, 0.12);
  color: var(--muted);
}
.host-cap-chip.is-ok {
  background: rgba(0, 160, 80, 0.14);
  color: var(--ok);
  border-color: rgba(0, 160, 80, 0.35);
}
.host-cap-chip.is-error {
  background: rgba(220, 60, 60, 0.14);
  color: var(--fail);
  border-color: rgba(220, 60, 60, 0.35);
}
.host-cap-chip.is-empty {
  font-style: italic;
}
.host-row-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.host-row-actions-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.host-row-actions button {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
}
/* Inline manual-reinstall fallback panel. Shown after the operator
   clicks "Reinstall agent" so the install one-liner is one copy
   away if the queued reinstall doesn't actually run. */
.reinstall-panel {
  flex-basis: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.03);
}
.reinstall-panel-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}
.reinstall-panel-hint {
  color: var(--muted, rgba(255, 255, 255, 0.55));
  font-weight: normal;
}
.reinstall-panel-dismiss {
  margin-left: auto;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  color: var(--muted, rgba(255, 255, 255, 0.55));
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.reinstall-panel-cmd {
  margin: 0 0 8px 0;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  max-height: 160px;
  overflow: auto;
}
/* Reinstall panel actions: keep the copy/reveal buttons inline and
   sized to their labels. Without this they inherit `button {
   width: 100% }` and stack as two giant orange bars. */
.reinstall-panel button {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
}
/* Updates badge in the host card's left action group. Always rendered
   for approved hosts so layout stays stable; grayed-out variant when
   there's nothing to apply. Anchor variant is clickable. */
.host-row-updates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  color: var(--ok, #4ade80);
  background: rgba(74, 222, 128, 0.08);
  text-decoration: none;
}
.host-row-updates.has-security {
  color: var(--warn, #fbbf24);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}
.host-row-updates.is-empty {
  color: var(--muted, #6b7280);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.06);
  cursor: default;
}
.host-row-updates-icon { font-size: 13px; line-height: 1; }
button.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
button.danger:hover {
  background: rgba(239, 68, 68, 0.18);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

/* ── Install tabs (host enrollment) ───────────────────────── */
.install-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 12px;
  border-bottom: 1px solid var(--border);
}
.install-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-dim);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}
.install-tab:hover { color: var(--fg); background: transparent; }
.install-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: transparent;
}
.install-pane[hidden] { display: none; }
.install-pane { padding: 4px 0 8px; }
.install-steps {
  margin: 6px 0 14px 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--fg);
}
.install-steps code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
}
.install-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--fg-dim);
}

/* ─────────────────────────────────────────────────────────────
   Host-detail dashboard layout (F.4)
   ─────────────────────────────────────────────────────────────
   Mobile: stacked single column (default .host-main rules apply).
   Desktop: 12-col grid like dashboard.html, with per-card spans
   declared via .span-* classes in host.html.
*/
@media (min-width: 1100px) {
  main.host-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px 40px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
  }
  main.host-dashboard > .card {
    max-width: none;
    margin: 24px 0 0;
    grid-column: span 12;
    min-width: 0;
  }
  main.host-dashboard > .card.span-4  { grid-column: span 4;  }
  main.host-dashboard > .card.span-6  { grid-column: span 6;  }
  main.host-dashboard > .card.span-8  { grid-column: span 8;  }
  main.host-dashboard > .card.span-12 { grid-column: span 12; }
  main.host-dashboard > .card:first-child { margin-top: 60px; }
}

/* KPI strip — small at-a-glance stat row at top of the host card. */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}
.kpi {
  background: var(--bg-deep, #02010a);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 0;
}
.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  word-break: break-word;
}
.kpi-value.ok    { color: var(--ok); }
.kpi-value.warn  { color: var(--warn); }
.kpi-value.err   { color: #ef4444; }
.kpi-sub {
  font-size: 11px;
  color: var(--fg-dim);
  margin-top: 3px;
}

/* Scrollable box, modeled on bcat's logs-wrap.
   Use as:
     <div class="scroll-wrap">
       <div class="scroll-header">
         <div class="scroll-dot"></div>
         <span class="scroll-label">Title</span>
         <span class="scroll-count" id="x-count">0</span>
         <div class="scroll-toolbar">…buttons…</div>
       </div>
       <div class="scroll-body" id="x-list"></div>
     </div>
*/
.scroll-wrap {
  background: var(--bg-deep, #02010a);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}
.scroll-wrap.tall .scroll-body  { max-height: 480px; }
.scroll-wrap.short .scroll-body { max-height: 240px; }
.scroll-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.scroll-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.scroll-dot.live { background: var(--ok); animation: scrollpulse 2s ease-in-out infinite; }
.scroll-dot.warn { background: var(--warn); }
.scroll-dot.err  { background: #ef4444; }
@keyframes scrollpulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}
.scroll-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.scroll-count {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  color: var(--muted);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.scroll-toolbar {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}
.scroll-toolbar button {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.15s;
  margin: 0;
  width: auto;
}
.scroll-toolbar button:hover {
  border-color: var(--border-bright);
  color: var(--fg);
}
.scroll-toolbar button.active {
  background: rgba(124, 154, 255, 0.12);
  border-color: var(--border-bright);
  color: var(--fg);
}
.scroll-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 12px 14px;
}
.scroll-body.compact { padding: 6px 10px; }
.scroll-body::-webkit-scrollbar       { width: 6px; }
.scroll-body::-webkit-scrollbar-track { background: transparent; }
.scroll-body::-webkit-scrollbar-thumb {
  background: var(--border-bright, #2c1a55);
  border-radius: 3px;
}
.scroll-body p:first-child,
.scroll-body > .lead:first-child {
  margin-top: 0;
}
.scroll-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
  margin: 0;
}

/* Section headings inside host-dashboard cards: tighter than the
   global h2 since cards are narrower in a multi-column layout. */
main.host-dashboard .card h2 {
  font-size: 16px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--fg);
  margin-top: 0;
  margin-bottom: 4px;
  padding-bottom: 0;
  border-bottom: none;
  display: block;
}
main.host-dashboard .card .lead {
  margin: 4px 0 10px;
  font-size: 12px;
}

/* ─────────────────────────────────────────────────────────────
   Collapsible cards & sub-blocks
   ─────────────────────────────────────────────────────────────
   Top-level: <details class="card collapsible span-X" open>
     <summary><h2>Title</h2><span class="card-meta">…</span></summary>
     …body…
   </details>
   Sub-block (inside Inventory): <details class="inv-block collapsible-sub" open>
     <summary><h3>Title</h3></summary>
     …body…
   </details>

   We use the native <details>/<summary> element so collapse/expand
   needs no JavaScript and survives full-page reloads gracefully.
*/
details.collapsible,
details.collapsible-sub { display: block; }

details.collapsible > summary,
details.collapsible-sub > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  outline: none;
}
details.collapsible > summary::-webkit-details-marker,
details.collapsible-sub > summary::-webkit-details-marker { display: none; }

/* Chevron — animates 0→90deg as the section opens. Drawn with
   border-only triangle so we don't ship an icon font. */
details.collapsible > summary::before,
details.collapsible-sub > summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: 4px;
  opacity: 0.55;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
details.collapsible[open] > summary::before,
details.collapsible-sub[open] > summary::before {
  transform: rotate(90deg);
}
details.collapsible > summary:hover::before,
details.collapsible-sub > summary:hover::before { opacity: 1; }

/* Top-level summary inherits .card h2 styling — keep visual rhythm
   with the non-collapsible hero card. */
details.collapsible > summary > h2 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 16px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--fg);
  border-bottom: none;
  padding-bottom: 0;
}
details.collapsible > summary .card-meta {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  margin-left: auto;
  flex-shrink: 0;
}
details.collapsible[open] > summary {
  margin-bottom: 8px;
}

/* Sub-block summary — smaller, used inside Inventory. */
details.collapsible-sub > summary > h3 {
  margin: 0;
  flex: 1 1 auto;
}
details.collapsible-sub > summary .sub-meta {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  flex-shrink: 0;
}
details.collapsible-sub > summary {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
details.collapsible-sub[open] > summary {
  margin-bottom: 8px;
}

/* Highlighted "active NIC" block — sits above the collapsed
   "other interfaces" details. */
.nic-primary {
  background: linear-gradient(180deg, rgba(124, 154, 255, 0.08), rgba(124, 154, 255, 0.02));
  border: 1px solid var(--border-bright, #2c1a55);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 6px;
}
.nic-primary .nic-primary-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.nic-primary .inv-row { padding: 0; border: none; }
.nic-primary .inv-row + .inv-row { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 8px; }

/* ─────────────────────────────────────────────────────────────
   Top nav (signed-in pages)
   ─────────────────────────────────────────────────────────────
   Lives in <nav class="topnav"> next to the logo. Mobile-friendly:
   wraps under the title when narrow.
*/
header.with-nav {
  flex-wrap: wrap;
  row-gap: 10px;
}
nav.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
nav.topnav a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
nav.topnav a:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
}
nav.topnav a.active {
  color: var(--fg);
  border-color: var(--border-bright, #2c1a55);
  background: rgba(124, 154, 255, 0.08);
}
nav.topnav .nav-sep {
  color: var(--muted);
  opacity: 0.4;
  user-select: none;
}
nav.topnav button {
  margin: 0;
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
nav.topnav button:hover { color: var(--fg); border-color: var(--border-bright); }
nav.topnav button.nav-quiet {
  border-color: transparent;
  color: var(--muted);
}
nav.topnav button.nav-quiet:hover {
  color: var(--fg-dim);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}
nav.topnav button.nav-danger:hover {
  color: var(--warn, #ffb84d);
  border-color: var(--warn, #ffb84d);
  background: rgba(255, 184, 77, 0.06);
}

/* Bigger nav header — give logged-in pages more horizontal room. */
header.with-nav { max-width: none; padding-left: 28px; padding-right: 28px; }
@media (min-width: 1100px) {
  header.with-nav { max-width: 1400px; }
}

/* ─────────────────────────────────────────────────────────────
   Drag-to-reorder (layout.js)
   ─────────────────────────────────────────────────────────────
   Cards with .layout-card get a small drag handle in the corner.
   The handle is the only mouse target that arms `draggable=true`,
   so clicking elsewhere (including <summary> chevrons) keeps its
   normal behaviour.
*/
.layout-card { position: relative; }
.layout-card > summary { position: relative; }
.layout-card .drag-handle {
  position: absolute;
  top: 10px;
  right: 12px;
  width: auto;
  margin: 0;
  padding: 4px 7px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: grab;
  opacity: 0.18;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -2px;
  z-index: 4;
}
.layout-card:hover .drag-handle { opacity: 0.7; }
.layout-card .drag-handle:hover {
  opacity: 1;
  color: var(--fg);
  border-color: var(--border-bright, #2c1a55);
  background: rgba(255, 255, 255, 0.03);
}
.layout-card .drag-handle:active { cursor: grabbing; }
.layout-card.drag-source {
  opacity: 0.45;
  outline: 1px dashed var(--border-bright, #2c1a55);
}
.layout-card.drag-over {
  outline: 2px solid rgba(124, 154, 255, 0.55);
  outline-offset: -2px;
}

/* Don't let the handle collide with the <summary> chevron+title in
   collapsible cards — push the summary right margin so the title
   never sits beneath the handle. */
details.collapsible.layout-card > summary {
  padding-right: 36px;
}

/* ── Trusted devices list (profile) ───────────────────────── */
.td-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.td-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.td-row-left {
  flex: 1;
  min-width: 0;
}
.td-row-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  word-break: break-word;
}
.td-row-current {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.td-row-meta {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.td-row-meta dt {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: var(--fg-dim);
  margin: 0;
}
.td-row-meta dd {
  margin: 0;
  color: var(--fg);
  word-break: break-word;
}
.td-row-revoke {
  width: auto;
  padding: 6px 14px;
  font-size: 12px;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .td-row {
    flex-direction: column;
  }
  .td-row-revoke {
    align-self: flex-start;
  }
}

/* ── Rollback plan card on apply runs ─────────────────────── */
.rollback-block {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border-bright);
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.04);
  font-size: 12px;
}
.rollback-block-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 6px;
}
.rollback-row {
  padding: 4px 0;
  border-top: 1px dashed var(--border);
}
.rollback-row:first-of-type { border-top: none; }
.rollback-row code {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 4px;
}
.rollback-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rollback-actions button {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
}

/* ── Host row link + details affordance ───────────────────── */
.host-row-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s, color 0.15s;
}
.host-row-link:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.host-row-head strong .host-row-link {
  color: var(--fg);
  font-weight: 600;
}
.host-row-head strong .host-row-link:hover {
  color: var(--cyan);
}
a.primary.host-row-details {
  display: inline-block;
  background: var(--grad);
  color: #02010a !important;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  border-bottom: none;
}
a.primary.host-row-details:hover {
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
  color: #02010a !important;
}

/* ─── Themes ────────────────────────────────────────────────
 * Plasma is the default and lives in :root above. The variants
 * below come from cottagio.com/docs/brand/logo-design-reference.md
 * (v4 logo palette explorations). Each theme overrides only the
 * tokens that change — everything else inherits from :root, so
 * gradients/shadows that don't reference these vars stay stable.
 */
[data-theme="cryo"] {
  --bg:             #070d14;
  --bg-deep:        #03060a;
  --surface:        #0e1a26;
  --surface-raised: #142537;
  --border:         #1a3556;
  --border-bright:  #2a5180;
  --fg:             #d8f4ff;
  --fg-dim:         #aef0ff;
  --muted:          #6f8ca6;
  --cyan:           #7ee0ff;
  --cyan-deep:      #5cb8ff;
  --pink:           #aef0ff;
  --grad: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-deep) 100%);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(126, 224, 255, 0.08);
}
[data-theme="aurora"] {
  --bg:             #0a0820;
  --bg-deep:        #04030f;
  --surface:        #1a1235;
  --surface-raised: #221a47;
  --border:         #2c1f5a;
  --border-bright:  #3d2c80;
  --fg:             #f1ecff;
  --fg-dim:         #c8b9ff;
  --muted:          #8b7fb8;
  --cyan:           #3df0d7;
  --cyan-deep:      #7b61ff;
  --pink:           #ff5cb1;
  --grad: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-deep) 50%, var(--pink) 100%);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(123, 97, 255, 0.10);
}
[data-theme="solstice"] {
  --bg:             #070b12;
  --bg-deep:        #03060a;
  --surface:        #0e1620;
  --surface-raised: #182338;
  --border:         #2a3a55;
  --border-bright:  #3a5878;
  --fg:             #fff5d6;
  --fg-dim:         #cfe2ff;
  --muted:          #7b9cc7;
  --cyan:           #ffb84a;
  --cyan-deep:      #ff7a30;
  --pink:           #5878a0;
  --grad: linear-gradient(135deg, var(--cyan-deep) 0%, var(--cyan) 100%);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 184, 74, 0.10);
}

/* ─── Theme picker (in topnav) ──────────────────────────────── */
.nav-theme {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin-right: 4px;
}
.nav-theme:hover,
.nav-theme:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
  outline: none;
}
.nav-theme::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4) inset;
}

/* Auto-collapsed empty cards: dim the summary so the operator can
   tell at a glance that the card has nothing in it without losing
   the click-to-expand affordance. */
details.card.card-empty {
  opacity: 0.55;
}
details.card.card-empty > summary h2 {
  font-weight: 500;
}
details.card.card-empty > summary::after {
  content: " · empty";
  font-size: 11px;
  color: var(--fg-dim);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   Phase 2 UI surfaces — v0.7.3
   ═══════════════════════════════════════════════════════════════ */

/* ── Global pause pill (dashboard header) ────────────────────── */
.pause-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--fg-dim);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  width: auto;
  margin: 0;
}
.pause-pill::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}
.pause-pill.paused::before { background: var(--fail); }
.pause-pill.running::before { background: var(--ok); }
.pause-pill.paused {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}
.pause-pill:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--cyan);
  color: var(--fg);
}

/* ── Global pause banner ─────────────────────────────────────── */
.pause-banner {
  max-width: 1400px;
  margin: -12px auto 20px;
  padding: 10px 28px;
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.pause-banner:hover { background: rgba(239, 68, 68, 0.16); }

/* ── Snooze badge (per-package row) ─────────────────────────── */
.snooze-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Maintenance windows card form ────────────────────────────── */
form.maint-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 10px;
}
form.maint-form select,
form.maint-form input[type="time"],
form.maint-form input[type="text"] {
  margin: 0;
  padding: 8px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
form.maint-form select { min-width: 110px; }
form.maint-form input[type="time"] { width: 110px; }
form.maint-form input[type="text"] { width: auto; flex: 1 1 120px; }
form.maint-form select:focus,
form.maint-form input[type="time"]:focus,
form.maint-form input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.15);
}
form.maint-form button[type="submit"] {
  width: auto;
  padding: 8px 14px;
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Query card ───────────────────────────────────────────────── */
form.query-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
form.query-form select {
  flex: 1 1 180px;
  padding: 8px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}
form.query-form select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.15);
}
form.query-form button {
  width: auto;
  padding: 8px 16px;
  font-size: 12px;
  flex-shrink: 0;
}
.query-invoc-row { cursor: pointer; }
.query-invoc-row:hover { background: rgba(255, 255, 255, 0.02); }
.query-invoc-detail { padding: 6px 0 4px; }
.query-output-pre {
  margin: 4px 0 0;
  padding: 8px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}
.query-output-err {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Bulk apply page ─────────────────────────────────────────── */
.bulk-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bulk-filter-bar input[type="search"] {
  flex: 1 1 200px;
  margin: 0;
}
.bulk-filter-bar button {
  width: auto;
  padding: 8px 14px;
  font-size: 12px;
  flex-shrink: 0;
}
.bulk-config-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bulk-config-row select,
.bulk-config-row input[type="number"] {
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}
.bulk-config-row select { min-width: 100px; }
.bulk-config-row input[type="number"] { width: 80px; }
.bulk-config-row select:focus,
.bulk-config-row input[type="number"]:focus {
  outline: none;
  border-color: var(--cyan);
}
.bulk-config-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-dim);
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
.bulk-config-row input[type="checkbox"] { margin: 0; }
.bulk-run-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  font-size: 14px;
}
.bulk-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 700px) {
  .bulk-results { grid-template-columns: 1fr; }
}
.bulk-results-col h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.bulk-results-col .enqueued-head { color: var(--ok); }
.bulk-results-col .skipped-head  { color: var(--warn); }
.bulk-result-row {
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.bulk-result-row:first-child { border-top: none; }

/* F.4 Ask bcat card */
form.recommend-form { display: flex; flex-direction: column; gap: 10px; }
.recommend-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-dim); }
.recommend-label textarea {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-mono); font-size: 13px;
  padding: 8px 10px; resize: vertical; min-height: 60px;
  background: var(--bg-2); color: var(--fg); border: 1px solid var(--border);
  border-radius: 6px;
}
.recommend-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.recommend-output {
  margin-top: 12px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  max-height: 480px; overflow-y: auto;
}

/* ─── F.13 monitors page ─────────────────────────────────── */
.monitors-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.mon-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 100px 90px 110px auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
@media (max-width: 720px) {
  .mon-row { grid-template-columns: 1fr; }
}
.mon-name { font-weight: 600; }
.mon-name a { color: var(--cyan); }
.mon-target { color: var(--muted, #9aa0a6); font-size: 13px; word-break: break-all; }
.mon-state {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.mon-state.up       { color: #4ade80; }
.mon-state.down     { color: #f87171; }
.mon-state.degraded { color: #fbbf24; }
.mon-state.pending  { color: #9aa0a6; }
.mon-meta { font-size: 12px; color: var(--muted, #9aa0a6); }
.mon-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mon-actions button { font-size: 12px; padding: 4px 10px; }

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.form-grid label { display: block; font-size: 13px; }
.form-grid input,
.form-grid select { width: 100%; box-sizing: border-box; }

.incident-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 140px 1fr;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  align-items: center;
  font-size: 13px;
}
.incident-row:last-child { border-bottom: none; }
.incident-row .label { color: var(--muted, #9aa0a6); font-size: 12px; }

.helper-note {
  font-size: 12px;
  color: var(--muted, #9aa0a6);
  line-height: 1.5;
}
.helper-note code {
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 6px;
  border-radius: 4px;
}
