/* CWP Datacenter — one stylesheet, no external assets. Light by default, dark via prefers-color-scheme. */

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #f5f6f8; --card: #ffffff; --card-2: #f9fafb; --text: #111827; --text-2: #374151; --muted: #6b7280; --line: #e5e7eb; --line-2: #eef0f3;
  --brand: #2563eb; --brand-2: #1d4ed8; --brand-ink: #ffffff; --brand-soft: #eaf1ff;
  --side: #0c1322; --side-2: #131c2e; --side-ink: #c4cddc; --side-dim: #7d889c; --side-line: rgba(255,255,255,.07);
  --ok: #15803d; --ok-bg: #e5f6ea; --warn: #a15c07; --warn-bg: #fdf3dc; --bad: #c62828; --bad-bg: #fde8e7; --info: #1d4ed8; --info-bg: #e7efff;
  --radius: 10px; --radius-s: 7px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --side-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f16; --card: #121822; --card-2: #0f141d; --text: #e7ebf1; --text-2: #c3cad6; --muted: #8b95a7; --line: #222b39; --line-2: #1a2230;
    --brand: #5b8cff; --brand-2: #7aa2ff; --brand-soft: #16233f;
    --side: #080c13; --side-2: #101722;
    --ok: #4cc472; --ok-bg: #12291b; --warn: #e5b04a; --warn-bg: #2f240c; --bad: #ff6b6b; --bad-bg: #351515; --info: #7aa2ff; --info-bg: #142242;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 30px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
h1 { font-size: 21px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
h1 small { font-size: 14px; font-weight: 500; }
h3 { margin: 0 0 12px; font-size: 14.5px; font-weight: 650; }
h4 { margin: 18px 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card form + h3, .card form + h4 { margin-top: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.right { text-align: right; } .nowrap { white-space: nowrap; } .break { word-break: break-word; max-width: 520px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- left menu */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 30;
  padding-top: env(safe-area-inset-top, 0px); border-right: 1px solid var(--side-line); }
.side a { color: var(--side-ink); }
.side a:hover { text-decoration: none; }
.side-top { padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff !important; letter-spacing: -.01em; padding: 2px 4px; }
.logo { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #3b82f6, #6366f1); position: relative; flex: none; }
.logo::before, .logo::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.9); }
.logo::before { top: 7px; } .logo::after { bottom: 7px; }
.side-add { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff !important; border-radius: var(--radius-s);
  padding: 8px 10px; font-weight: 600; font-size: 13.5px; transition: background .15s; }
.side-add span { font-size: 17px; line-height: 1; }
.side-add:hover { background: var(--brand-2); }
.side-search { position: relative; display: block; margin: 0; }
.side-search input { width: 100%; background: var(--side-2); border: 1px solid var(--side-line); color: #fff; border-radius: var(--radius-s); padding: 7px 30px 7px 10px; font-size: 13px; }
.side-search input::placeholder { color: var(--side-dim); }
.side-search input:focus { outline: none; border-color: var(--brand); box-shadow: none; }
.side-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--side-dim); border: 1px solid var(--side-line); border-radius: 4px; padding: 0 5px; background: transparent; }
.side-search input:focus + kbd { display: none; }
.menu { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: var(--side-2) transparent; }
.menu-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-dim); margin: 18px 10px 6px; font-weight: 600; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-s); font-size: 13.5px; line-height: 1.35; transition: background .12s; }
.menu a:hover { background: rgba(255,255,255,.05); }
.menu a.on { background: rgba(91,140,255,.16); color: #fff; }
.menu .ico { width: 16px; text-align: center; color: var(--side-dim); font-size: 13px; }
.menu a.on .ico { color: #9db8ff; }
.count { margin-left: auto; min-width: 22px; text-align: center; background: var(--side-2); color: var(--side-dim); border-radius: 99px; font-size: 11px; font-weight: 600; padding: 0 7px; }
.count.bad { background: #b42318; color: #fff; } .count.info { background: #2f4fa8; color: #fff; }
.side-servers a { font-size: 13px; padding: 5px 10px; }
.side-servers .sname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-servers .up { margin-left: auto; color: #8fb0ff; font-weight: 700; font-size: 12px; }
.side-empty { color: var(--side-dim); font-size: 12.5px; margin: 6px 10px; }
.side-foot { border-top: 1px solid var(--side-line); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.side-foot .me { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; color: #fff; }
.who small { color: var(--side-dim); font-size: 11.5px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.btn.ghost { background: transparent; color: var(--side-ink); border-color: var(--side-line); box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.06); }

/* ---------------------------------------------------------------- page frame */
.page { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
body.no-side .page { margin-left: 0; }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px;
  background: var(--bg); border-bottom: 1px solid var(--line); }
.bar .search { flex: 1; max-width: 520px; }
.bar .search input { width: 100%; background: var(--card); padding-left: 12px; }
.bar .menu-btn { display: none; }
.live-ind { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.live-ind.busy .pulse { animation: pulse 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.55); } 100% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } }
main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px 28px 48px; flex: 1; }
.scrim { display: none; }
@media (max-width: 960px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5,10,20,.45); z-index: 25; }
  .page { margin-left: 0; }
  .bar { padding: 10px 16px; }
  .bar .menu-btn { display: inline-flex; }
  main { padding: 18px 16px 36px; }
}

/* ---------------------------------------------------------------- building blocks */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head .sub { margin: 4px 0 0; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 760px; }
.card.flush { padding: 0; overflow: hidden; }
.card.empty, .empty { text-align: center; color: var(--muted); padding: 36px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cols > .card { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row label { margin: 0; }
.scroll { overflow-x: auto; }
.login-box { max-width: 380px; margin: 12vh auto 0; padding: 28px; }
.login-box h1 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 19px; }
.help ol { margin: 0; padding-left: 20px; color: var(--text-2); }
.help li { margin-bottom: 6px; }
.empty-view { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-view strong { color: var(--ok); display: block; font-size: 15px; margin-bottom: 2px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.tile.ok::before { background: var(--ok); } .tile.warn::before { background: var(--warn); } .tile.bad::before { background: var(--bad); } .tile.info::before { background: var(--info); }
.tile .num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .lbl { color: var(--muted); font-size: 12px; line-height: 1.3; }
a.tile { color: var(--text); transition: border-color .12s, box-shadow .12s; }
a.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); box-shadow: var(--shadow-lg); }
details.help > summary { list-style: none; cursor: pointer; }
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary h3 { display: inline; margin: 0; }
details.help > summary::after { content: " ▾"; color: var(--muted); }
details.help[open] > summary { margin-bottom: 12px; }

/* tables */
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--card-2); border-bottom-color: var(--line); }
.grid tbody tr { transition: background .1s; }
.grid tbody tr:hover { background: var(--card-2); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tr.dim { opacity: .5; } .grid tr.sel, .grid tr.sel:hover { background: var(--brand-soft); }
.grid tr.bad-row td { background: var(--bad-bg); }
.grid.live td { vertical-align: middle; }
.grid tr.is-loading td { opacity: .72; }
.grid.live td:nth-child(2) strong { white-space: nowrap; }
.cb { width: 34px; }
td.ver { white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.mcell { min-width: 120px; }
.mcell svg.spark { display: block; margin-top: 4px; width: 100%; height: 22px; }
.attn { min-width: 150px; }
.attn .chip { margin: 1px 0; }
.task { min-width: 140px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* forms */
label { display: block; margin-bottom: 12px; font-weight: 500; font-size: 13px; color: var(--text-2); }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 5px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--text); }
label.check input { width: auto; margin: 0; }
label.check select { width: auto; margin: 0 4px; }
label .row { margin: 5px 0 0; flex-wrap: nowrap; } label .row input { flex: 1; margin: 0; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 10px; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 15px; height: 15px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px 4px; margin: 0 0 12px; }
legend { font-weight: 500; font-size: 13px; padding: 0 4px; color: var(--text-2); }
.pick { display: flex; flex-wrap: wrap; gap: 2px 16px; padding-left: 24px; }
.pick label.check { margin-bottom: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 7px 14px; border-radius: var(--radius-s); white-space: nowrap; line-height: 1.3; transition: background .12s, border-color .12s; box-shadow: var(--shadow); }
.btn:hover { text-decoration: none; background: var(--card-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.btn.small { padding: 3px 10px; font-size: 12.5px; }
.btn.busy, .btn:disabled { opacity: .6; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; box-shadow: none; }
.btn.link { box-shadow: none; border-color: transparent; background: none; }
form.inline { display: inline; }
details.inline-edit { display: inline-block; position: relative; }
details.inline-edit > summary { list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
details.inline-edit[open] > form { position: absolute; right: 0; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; width: 290px; text-align: left; box-shadow: var(--shadow-lg); }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; box-shadow: none; }
.seg .btn:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); } .seg .btn:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.seg .btn.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); position: relative; }

/* badges, chips, tags, dots */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--line-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--text-2);
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.run { background: var(--info-bg); color: var(--info); } .chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); white-space: normal; } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.muted { color: var(--muted); }
.tag { display: inline-block; background: var(--line-2); color: var(--text-2); padding: 0 7px; border-radius: 5px; font-size: 11.5px; margin: 2px 3px 0 0; }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok, .dot.st-ok { background: #22c55e; } .dot.st-warn { background: #f59e0b; } .dot.bad, .dot.st-down, .dot.st-error { background: #ef4444; }
.dot.st-ok { box-shadow: 0 0 0 3px rgba(34,197,94,.15); } .dot.st-down, .dot.st-error { box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.svc { white-space: nowrap; display: inline-flex; gap: 4px; }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tagchip { font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); border-radius: 99px; padding: 3px 12px; cursor: pointer; transition: background .12s; }
.tagchip:hover { background: var(--card-2); }
.tagchip small { color: var(--muted); }
.tagchip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tagchip.on small { color: inherit; opacity: .85; }

/* meters */
progress.meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 80px; height: 6px; border: 0; border-radius: 4px; background: var(--line-2); overflow: hidden; margin: 4px 0 2px; }
progress.meter::-webkit-progress-bar { background: var(--line-2); border-radius: 4px; }
progress.meter.ok::-webkit-progress-value { background: var(--ok); } progress.meter.ok::-moz-progress-bar { background: var(--ok); }
progress.meter.warn::-webkit-progress-value { background: var(--warn); } progress.meter.warn::-moz-progress-bar { background: var(--warn); }
progress.meter.bad::-webkit-progress-value { background: var(--bad); } progress.meter.bad::-moz-progress-bar { background: var(--bad); }
progress.meter.muted::-webkit-progress-value { background: var(--line); }
.m-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.m-val { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.m-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* flashes, toasts */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid transparent; font-size: 13.5px; transition: opacity 1s; }
.flash.success { background: var(--ok-bg); color: var(--ok); } .flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); } .flash.info { background: var(--info-bg); color: var(--info); }
.flash.fade { opacity: 0; }
.toasts { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 11px 14px; border-radius: var(--radius); background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-left: 4px solid var(--info);
  font-size: 13.5px; transition: opacity .4s, transform .4s; animation: toast-in .2s ease; }
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* tabs, pager */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; font-weight: 500; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.pager a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; }
.pager a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
ul.checks { list-style: none; padding: 0; } ul.checks li.ok { color: var(--ok); } ul.checks li.bad { color: var(--bad); }
pre.code { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 11px; overflow-x: auto; white-space: pre; }

/* ---------------------------------------------------------------- dashboard server cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.scard { display: flex; flex-direction: column; gap: 11px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
  color: var(--text); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s, border-color .15s; position: relative; }
.scard::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.scard.st-ok::before { background: var(--ok); } .scard.st-warn::before { background: var(--warn); } .scard.st-down::before, .scard.st-error::before { background: var(--bad); }
.scard:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.scard.is-loading .scard-m { opacity: .6; }
.scard-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.scard-h strong { font-size: 15px; letter-spacing: -.01em; }
.scard-st { display: flex; align-items: center; gap: 6px; }
.scard-err { color: var(--bad); font-size: 12.5px; background: var(--bad-bg); padding: 6px 9px; border-radius: var(--radius-s); word-break: break-word; }
.scard-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.scard-m { display: flex; flex-direction: column; gap: 9px; transition: opacity .2s; }
.gauge-row { display: flex; align-items: flex-end; gap: 12px; }
.gauge-row .m { flex: 1; min-width: 0; }
.scard-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.scard-f .badge { margin-left: 6px; }
.scard-sw { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12px; color: var(--muted); }
.scard-sw b { color: var(--text-2); font-weight: 600; }
.scard-meta { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 9px; }
.scard-meta .right { white-space: nowrap; }
.forecast { font-size: 12px; font-weight: 600; }
svg.spark { flex: none; }
.spark-line { stroke: var(--brand); stroke-width: 1.5; }
.spark-fill { fill: var(--brand-soft); stroke: none; }

/* bulk bar */
.bulk { position: sticky; top: 62px; z-index: 15; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); padding: 10px 14px; }
.inline-row { margin: 0; }

/* spinner */
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; color: var(--brand); vertical-align: middle; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-log { margin-top: 12px; }
[data-server-updates] + .actions { margin-top: 14px; }

/* history charts */
.hist-bar { justify-content: space-between; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 22px; margin: 10px 0 14px; }
.chart-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.chart-wrap { position: relative; }
.chart-svg { display: block; overflow: visible; touch-action: pan-y; }
.grid-line { stroke: var(--line-2); stroke-width: 1; }
.axis-t { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.chart-line { stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--brand-soft); opacity: .8; }
.chart-dot { fill: var(--brand); stroke: var(--card); stroke-width: 2; }
.crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 4px; left: var(--x, 0); transform: translateX(10px); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 5px 9px; font-size: 12px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); }
.chart-tip.flip { transform: translateX(calc(-100% - 10px)); }
.table-view .grid { font-size: 12.5px; }
.table-view [data-hist-table] { max-height: 320px; overflow: auto; }

/* tasks, 2FA */
.progress-cell { min-width: 220px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.qr svg { display: block; border-radius: var(--radius-s); margin: 8px 0; }
pre.codes { columns: 2; font-size: 14px; }
code.secret { font-size: 13px; letter-spacing: .05em; }
ol.steps { padding-left: 18px; margin: 0; display: block; }

@media (max-width: 700px) {
  dl.kv { grid-template-columns: 1fr; } dl.kv dt { margin-top: 6px; }
  .head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .spin, .live-ind.busy .pulse { animation: none; }
  .scard, .toast { transition: none; animation: none; }
}

/* add server */
.steps-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.steps-add .card { margin-bottom: 0; }
.step { position: relative; padding-left: 58px; }
.step-n { position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; }
.cmd { display: flex; align-items: center; gap: 8px; background: var(--side); color: #e5ecf7; border-radius: var(--radius-s); padding: 10px 10px 10px 14px; margin: 4px 0 10px; }
.cmd code { flex: 1; word-break: break-all; font-size: 13px; color: inherit; }
.cmd .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); color: #fff; box-shadow: none; }
textarea.mono { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; margin-bottom: 10px; resize: vertical; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h3 { display: inline; margin: 0; }
details.card > summary::after { content: " ▾"; color: var(--muted); }
details.card[open] > summary { margin-bottom: 12px; }
pre.code.digest { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.6; }
.tags-form { margin: 0; flex-wrap: nowrap; } .tags-form input { width: 120px; }
