/* DC Manager panel. Own design: calm neutrals, one accent, dense tables. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #1d2530; --muted: #667085; --line: #e3e6eb;
  --accent: #1f6feb; --accent-ink: #ffffff; --side: #111827; --side-ink: #cbd5e1; --side-on: #ffffff;
  --ok: #157347; --ok-bg: #e3f4ea; --warn: #9a6700; --warn-bg: #fdf3d7; --bad: #b42318; --bad-bg: #fde8e6;
  --radius: 8px; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --panel: #171b23; --ink: #e6e9ef; --muted: #98a2b3; --line: #2a303b;
    --side: #0b0e13; --ok-bg: #12301f; --warn-bg: #33290d; --bad-bg: #3a1714; --ok: #5fd08f; --warn: #f0c24f; --bad: #ff8a7a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 600; } h2 { font-size: 16px; margin: 0 0 12px; }
body.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 16px 12px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.side a { color: var(--side-ink); padding: 7px 10px; border-radius: 6px; }
.side a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side a.on { background: rgba(255,255,255,.12); color: var(--side-on); }
.navhead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7c8796; margin: 14px 10px 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--side-on) !important; font-size: 15px; }
.brand.big { color: var(--ink) !important; font-size: 18px; margin-bottom: 8px; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), #12b886); display: inline-block; }
.me { border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; display: flex; justify-content: space-between; align-items: center; }
.me .link { color: var(--side-ink); }
main.content { padding: 24px 28px; max-width: 1400px; width: 100%; min-width: 0; }
main.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { width: 100%; max-width: 420px; } .card.left { margin-left: 0; }
table { width: 100%; border-collapse: collapse; }
table.card { padding: 0; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--panel) 92%, var(--line)); }
tr:last-child td { border-bottom: 0; }
table.dense td { padding: 6px 10px; font-size: 13px; }
label { display: block; margin-bottom: 12px; font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
button, .button { display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
button:hover, .button:hover { border-color: var(--accent); text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.wide { width: 100%; text-align: center; } .small { padding: 3px 9px; font-size: 12px; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; max-width: 900px; width: 100%; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.warn { background: var(--warn-bg); color: var(--warn); } .flash.error { background: var(--bad-bg); color: var(--bad); }
main.center .flash { max-width: 420px; }
.muted { color: var(--muted); } .mono { font-family: var(--mono); font-size: 12.5px; } .right { text-align: right; } .ua { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: color-mix(in srgb, var(--line) 70%, transparent); margin: 1px 4px 1px 0; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); } .tag.bad { background: var(--bad-bg); color: var(--bad); }
.ok-text { color: var(--ok); font-weight: 600; } .bad-text { color: var(--bad); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; } .toolbar h1 { margin: 0; flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 12px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; } .row input, .row select { width: auto; flex: 1; margin: 0; min-width: 140px; }
.inline { display: inline; } .actions { display: flex; gap: 8px; margin-top: 14px; }
.secret { font-family: var(--mono); font-size: 18px; letter-spacing: .08em; padding: 10px; background: var(--bg); border-radius: 6px; margin: 8px 0 4px; cursor: copy; word-break: break-all; }
.secret.copied { outline: 2px solid var(--ok); }
.steps { padding-left: 18px; } .steps li { margin-bottom: 10px; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 15px; } .codes li { padding: 4px 0; }
.center-link { margin-top: 8px; }
@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  main.content { padding: 16px; } .kv { grid-template-columns: 1fr; }
}
.navsearch input { background: rgba(255,255,255,.08); border-color: transparent; color: var(--side-on); margin: 4px 0 6px; }
.navsearch input::placeholder { color: #8b96a5; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { padding: 3px 10px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); font-size: 13px; background: var(--panel); }
.chip.on { border-color: var(--accent); color: var(--accent); } .chip b { font-weight: 600; margin-left: 2px; }
.st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; background: var(--line); }
.st-free { background: var(--ok-bg); color: var(--ok); } .st-assigned { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.st-installing, .st-cleanup, .st-reserved { background: var(--warn-bg); color: var(--warn); } .st-maintenance, .st-retired { background: var(--bad-bg); color: var(--bad); }
.pw { font-weight: 600; font-size: 12px; text-transform: uppercase; } .pw-on { color: var(--ok); } .pw-off { color: var(--bad); } .pw-unknown { color: var(--muted); }
label.check { display: flex; align-items: center; gap: 6px; font-weight: 400; } label.check input { width: auto; margin: 0; display: inline; }
.grow { flex: 1; } .row label { margin-bottom: 0; } .row.tight { margin: 0; flex-wrap: nowrap; }
.pre { white-space: pre-wrap; } pre.config { background: var(--bg); padding: 12px; border-radius: 6px; overflow: auto; font-family: var(--mono); font-size: 12.5px; cursor: copy; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 90px; } .bar > span { display: block; height: 100%; background: var(--accent); }
.bar.high > span { background: var(--warn); } .bar.full > span { background: var(--bad); }
details.card summary { cursor: pointer; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); }
.stat:hover { text-decoration: none; border-color: var(--accent); } .stat b { display: block; font-size: 24px; } .stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.opsrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .ops details { margin-top: 10px; }
.job-active { margin: 12px 0 0; padding: 8px 10px; background: var(--warn-bg); border-radius: 6px; }
.chart { position: relative; height: 280px; }
meter { width: 120px; vertical-align: middle; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 12px; } legend { padding: 0 6px; color: var(--muted); }
.badge { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; text-align: center; }
.sev-critical { color: var(--bad); font-weight: 600; } .sev-warning { color: var(--warn); font-weight: 600; }
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Wide tables scroll inside their card; the page itself never scrolls sideways (UI-1). */
.tablecard { padding: 0; overflow-x: auto; }
.tablescroll { overflow-x: auto; max-width: 100%; }
.tablecard > table, .tablescroll > table { min-width: 100%; }
/* Labels, addresses and MACs never wrap (UI-3). */
.mono, td.nowrap, .nowrap { white-space: nowrap; }
.kv dd.mono { white-space: normal; } /* lists of NICs wrap between entries; a MAC has no spaces, so it stays whole */
.grid2 > * { min-width: 0; }
/* Server list toolbar (UI-2). */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; align-items: center; flex: 1 1 520px; min-width: 0; }
.filters input { flex: 1 1 auto; min-width: 160px; margin: 0; } .filters select { width: auto; margin: 0; }
.views { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.views .chip form { margin-left: 4px; }
details.saveview { position: relative; } details.saveview > summary { list-style: none; } details.saveview > summary::-webkit-details-marker { display: none; }
details.saveview form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 280px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.bulkbar { position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius); padding: 8px 12px; }
.bulkbar select, .bulkbar input { width: auto; margin: 0; }
.bulkbar[hidden], [data-for][hidden] { display: none; }
/* Audit detail as key: value pairs (UI-6). */
.kvlist { margin: 0; padding: 0; list-style: none; font-size: 12.5px; } .kvlist li { max-width: 560px; overflow-wrap: anywhere; } .kvlist b { font-weight: 600; color: var(--muted); }
/* Labelled form grids (UI-4). */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.fields .span2 { grid-column: span 2; }
.fields[hidden] { display: none; }
td.traffic span { display: block; font-size: 12px; line-height: 1.35; } th.hw { min-width: 170px; }
table.dense th { padding: 7px 8px; } table.dense td { padding: 6px 8px; }
td.stack > * { display: block; width: max-content; margin: 1px 0; }
@media (max-width: 1360px) { .c-loc { display: none; } }

/* ======================================================================
   "Midnight" theme: tokens, sidebar with icons, top bar, dashboard tiles.
   It overrides the base rules above.
   ====================================================================== */
:root {
  --bg: #f5f6fb; --panel: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e6e8f0;
  --accent: #5b5bf6; --accent-2: #8b5cf6; --accent-ink: #ffffff;
  --side: #0b1020; --side-2: #121a33; --side-ink: #a9b4cc; --side-on: #ffffff;
  --ok: #059669; --ok-bg: #e7f8f1; --warn: #b45309; --warn-bg: #fff4e0; --bad: #e11d48; --bad-bg: #ffe9ee;
  --info: #2563eb; --info-bg: #e8f0ff;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 30px -18px rgba(16,24,40,.25);
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #070b16; --panel: #0f1526; --ink: #e8ecf6; --muted: #8a96b0; --line: #1e2740;
    --side: #060912; --side-2: #0c1224; --ok: #34d399; --ok-bg: rgba(52,211,153,.12); --warn: #fbbf24; --warn-bg: rgba(251,191,36,.12);
    --bad: #fb7185; --bad-bg: rgba(251,113,133,.12); --info: #60a5fa; --info-bg: rgba(96,165,250,.12);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -20px rgba(0,0,0,.8); }
}
html, body { font: 14px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; letter-spacing: -.005em; }
body.app { grid-template-columns: 248px minmax(0, 1fr);
  background: radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
              radial-gradient(900px 400px at 20% 110%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 60%), var(--bg); }
.shell { min-width: 0; display: flex; flex-direction: column; }
/* Sidebar */
.side { background: linear-gradient(180deg, var(--side-2), var(--side)); padding: 18px 14px; gap: 18px; border-right: 1px solid rgba(255,255,255,.04); }
.brand { gap: 10px; font-size: 15px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.brand .mark svg { width: 20px; height: 20px; fill: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; } .brand-text small { font-weight: 500; font-size: 11px; color: #7f8aa8; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 10px; font-weight: 500; position: relative; }
.side nav a .i { width: 18px; height: 18px; opacity: .85; }
.side nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side nav a.on { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 28%, transparent), rgba(255,255,255,.03)); color: #fff; }
.side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--accent), var(--accent-2)); }
.side nav a .badge { margin-left: auto; background: var(--bad); }
.navhead { color: #56617d; font-weight: 600; margin: 18px 11px 6px; }
.side-foot { font-size: 12px; color: #7f8aa8; display: flex; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 10px; background: rgba(255,255,255,.03); flex-wrap: wrap; }
.side-foot small { margin-left: auto; color: #56617d; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.topsearch { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 40px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--muted); }
.topsearch input { border: 0; background: transparent; padding: 0; margin: 0; height: 100%; box-shadow: none; outline: none; }
.topsearch input:focus { outline: none; box-shadow: none; }
.topsearch kbd { font: 600 11px var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-actions form { margin: 0; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); padding: 0; box-shadow: var(--shadow); }
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.dotcount { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; border: 2px solid var(--bg); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.me:hover { text-decoration: none; border-color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(135deg, #f59e0b, #ec4899); }
.me-text { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 13px; } .me-text small { color: var(--muted); font-weight: 400; font-size: 11px; }
/* Content */
main.content { padding: 28px 32px 48px; max-width: 1480px; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pagehead h1 { margin: 0; } .sub { margin: 4px 0 0; color: var(--muted); }
.toolbar h1 { font-size: 26px; }
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); padding: 20px 22px; }
.cardhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; } .cardhead h2 { margin: 0; }
.link-more { font-size: 13px; font-weight: 600; }
/* Buttons and inputs */
button, .button { border-radius: 10px; font-weight: 600; padding: 8px 15px; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: border-color .15s, box-shadow .15s, transform .05s; }
button:active, .button:active { transform: translateY(1px); }
.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.primary:hover { filter: brightness(1.06); }
.danger { background: var(--bad-bg); border-color: transparent; }
input, select, textarea { border-radius: 10px; padding: 9px 12px; background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
/* Tables */
.tablecard { padding: 0; }
th { background: transparent; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); }
table.dense th { padding: 11px 12px; } table.dense td { padding: 10px 12px; }
td { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
tbody tr { transition: background .12s; } tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tablecard thead { position: sticky; top: 0; }
/* Status pills with a dot */
.st { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; padding: 3px 10px 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-assigned { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.tag { border-radius: 7px; padding: 2px 8px; font-weight: 500; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.chip { border-radius: 999px; padding: 5px 12px; font-weight: 500; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); } .chip.on b { color: inherit; }
.pw-on { color: var(--ok); } .pw-off { color: var(--bad); }
.flash { border-radius: 12px; border: 1px solid transparent; box-shadow: var(--shadow); }
.bulkbar { border-radius: 12px; box-shadow: var(--shadow); }
/* Dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 14px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); overflow: hidden; }
.kpi:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), transparent); }
.kpi-ic { grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.kpi-ic .i { width: 22px; height: 22px; }
.ic-blue { background: var(--info-bg); color: var(--info); } .ic-green { background: var(--ok-bg); color: var(--ok); }
.ic-violet { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); } .ic-red { background: var(--bad-bg); color: var(--bad); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { font-size: 32px; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; }
.kpi-foot { color: var(--muted); font-size: 12.5px; }
.stackbar { width: 100%; height: 14px; border-radius: 7px; overflow: hidden; display: block; background: var(--line); }
.seg-free { fill: #10b981; background: #10b981; } .seg-assigned { fill: #6366f1; background: #6366f1; } .seg-reserved { fill: #f59e0b; background: #f59e0b; }
.seg-installing { fill: #0ea5e9; background: #0ea5e9; } .seg-cleanup { fill: #a855f7; background: #a855f7; } .seg-maintenance { fill: #f43f5e; background: #f43f5e; } .seg-retired { fill: #94a3b8; background: #94a3b8; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.legend a { color: var(--ink); font-size: 13px; display: inline-flex; align-items: center; gap: 7px; } .legend b { color: var(--muted); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.agentlist, .attention { list-style: none; margin: 0; padding: 0; }
.agentlist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .agentlist li:last-child { border-bottom: 0; }
.agentlist small, .attention small { display: block; color: var(--muted); font-size: 12.5px; }
.agentlist li > div { flex: 1; min-width: 0; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; } .pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.attention li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); } .attention li:last-child { border-bottom: 0; }
.attention li > div { flex: 1; min-width: 0; } .attention small { overflow: hidden; text-overflow: ellipsis; }
.sevbar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--warn); } .sev-critical .sevbar { background: var(--bad); }
.attention .clear { color: var(--ok); align-items: center; }
.subnets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.subnet { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); background: color-mix(in srgb, var(--panel) 60%, var(--bg)); }
.subnet:hover { text-decoration: none; border-color: var(--accent); } .subnet small { color: var(--muted); grid-column: 1; }
.subnet meter { grid-column: 1; width: 100%; height: 8px; } .subnet b { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-size: 18px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .me-text { display: none; } }
/* Sign-in page */
body.bare { background: radial-gradient(900px 500px at 15% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(800px 500px at 100% 100%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 60%), var(--side); color: var(--ink); }
body.bare .card { box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); padding: 28px 30px; border: 0; }
/* Midnight: table and dashboard details */
td.stack > .st { display: inline-flex; }
.tag { white-space: nowrap; }
td:has(> .tag) { min-width: 150px; }
.attention li { color: var(--ink); font-weight: 400; }
.attention li b { color: var(--ink); font-weight: 650; }
.attention .clear { color: var(--ok); }
.side-foot:hover { text-decoration: none; background: rgba(255,255,255,.06); }
table.dense th { padding: 11px 10px; } table.dense td { padding: 10px 10px; }
td:has(> .tag) { min-width: 128px; } th.hw { min-width: 160px; }
@media (max-width: 1560px) { .c-loc { display: none; } }
/* Midnight: small screens */
@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; position: static; } .topsearch kbd { display: none; }
  main.content { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: 1fr; } .pagehead { flex-direction: column; align-items: flex-start; }
}
/* Midnight: medium widths keep the server list within the card (not phones:
   the 760 px rule above puts the sidebar on top there) */
@media (max-width: 1440px) and (min-width: 761px) {
  body.app { grid-template-columns: 224px minmax(0, 1fr); }
  main.content { padding: 24px 24px 44px; } .topbar { padding: 12px 24px; }
  table.dense th { padding: 10px 8px; } table.dense td { padding: 9px 8px; }
  td:has(> .tag) { min-width: 112px; } th.hw { min-width: 150px; }
}
/* Midnight: icon-only sidebar below 1100 px (labels stay readable to screen readers) */
@media (max-width: 1100px) and (min-width: 761px) {
  body.app { grid-template-columns: 72px minmax(0, 1fr); }
  .side { padding: 16px 10px; align-items: center; }
  .brand-text, .navhead, .side-foot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side nav { width: 100%; }
  .side nav a { justify-content: center; padding: 10px 0; }
  .side nav a > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side nav a .badge { position: absolute; top: 2px; right: 6px; font-size: 10px; min-width: 16px; padding: 0 4px; }
  .side nav a.on::before { left: -10px; }
  .side nav a .i { width: 20px; height: 20px; }
}

/* Passkeys */
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted, #7a8394); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line, #d9dde5); }
.passkey-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.passkey-btn .i { width: 16px; height: 16px; }
td > .i { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
p.small { padding: 0; }
[hidden] { display: none !important; }
.choice h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 18px 0 6px; }
.choice h2 .i { width: 18px; height: 18px; }
/* Integrations */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.crumb { margin: 0 0 4px; font-size: 13px; } .crumb a { color: var(--muted); } .crumb a::after { content: " /"; }
.pagehead h1 .pill { font-size: 12px; vertical-align: middle; margin-left: 6px; }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.sens { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); font-family: var(--mono); font-weight: 600; font-size: 11.5px; }
.button .i, button .i { width: 16px; height: 16px; vertical-align: -3px; }
.button.primary, a.primary { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-ink); }
.button.primary:hover { text-decoration: none; }
.apibase { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; }
.apibase code { font-size: 13px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.copybtn { display: inline-flex; align-items: center; gap: 6px; }
.copybtn.copied, .iconcopy.copied { color: var(--ok); border-color: var(--ok); }
.iconcopy { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 8px; background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--muted); }
.iconcopy:hover { border-color: var(--line); color: var(--accent); } .iconcopy .i { width: 15px; height: 15px; vertical-align: 0; }
:is(button, a, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.keys td { vertical-align: middle; } table.keys th, table.keys td { padding: 14px 16px; }
.keyname { display: block; font-weight: 650; color: var(--ink); } .keyname:hover { color: var(--accent); }
.keyid { display: inline-flex; align-items: center; gap: 4px; } .keyid code { font-size: 12px; color: var(--muted); }
.permsum { font-weight: 600; margin-right: 6px; white-space: nowrap; }
table.keys td .pill { white-space: nowrap; display: inline-block; margin: 2px 2px 2px 0; }
.empty { text-align: center; padding: 40px 22px; } .empty p { max-width: 460px; margin: 6px auto 18px; }
.empty-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.empty-ic .i { width: 26px; height: 26px; }
.keyform > .card { margin-bottom: 16px; } .keyform h2 { margin: 0 0 4px; }
.keyform input#keyname { max-width: 520px; margin-top: 8px; }
.permgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.permgroup { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 0; min-width: 0; }
.permgroup legend { font-weight: 650; font-size: 13px; padding: 0 6px; display: inline-flex; align-items: center; gap: 6px; }
.permgroup.sensitive { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.permgroup.sensitive legend { color: var(--warn); } .permgroup.sensitive legend .i { width: 15px; height: 15px; }
.sens-note { margin: 2px 0 6px; color: var(--warn); }
.perm { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; margin: 0; cursor: pointer; font-weight: 400; }
.perm input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.perm > span { display: flex; flex-direction: column; min-width: 0; } .perm-label { color: var(--ink); }
.perm-name { font-size: 11.5px; color: var(--muted); }
.iplist { border: 0; padding: 0; margin: 0; min-width: 0; } .iplist legend { font-size: 15px; font-weight: 650; padding: 0; margin-bottom: 2px; color: var(--ink); }
.iphelp { margin: 0 0 12px; }
.iprows { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.iprow { display: flex; gap: 8px; align-items: center; } .iprow input { flex: 1; min-width: 0; margin: 0; font-family: var(--mono); font-size: 13px; }
.iprow input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.iprm { flex: none; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--muted); }
.iprm:hover { color: var(--bad); border-color: var(--bad); }
.ipadd { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }
.iperr { color: var(--bad); font-size: 13px; margin: 8px 0 0; }
.ipany { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13px; max-width: 560px; }
.ipany .i { width: 17px; height: 17px; margin-top: 1px; }
.formactions { display: flex; justify-content: flex-end; gap: 10px; margin: 4px 0 20px; }
.danger-zone h2 { color: var(--bad); margin: 0 0 6px; }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.dz-row:first-of-type { border-top: 0; } .dz-row p { margin: 2px 0 0; } .dz-row form { margin: 0; flex: none; }
.secretcard .kv dd { overflow-wrap: anywhere; } .secretcard .secret { margin: 0 0 10px; user-select: all; }
@media (max-width: 760px) {
  table.keys thead { display: none; } table.keys, table.keys tbody, table.keys tr, table.keys td { display: block; width: 100%; }
  table.keys tr { padding: 12px 16px; border-bottom: 1px solid var(--line); } table.keys td { padding: 3px 0; border: 0; min-width: 0; }
  .dz-row { flex-direction: column; align-items: flex-start; } .formactions { justify-content: stretch; } .formactions > * { flex: 1; text-align: center; }
  .permgroups { grid-template-columns: 1fr; }
  .pagehead .button.primary { align-self: stretch; justify-content: center; }
  .apibase code { flex-basis: 100%; }
}
/* Sign-in cards (second factor, WHMCS handoff) */
.authcard { padding: 30px 30px 22px; }
.authmark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 22px; color: var(--ink); }
.authmark .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.authmark .mark svg { width: 20px; height: 20px; fill: #fff; }
.authstep { margin: 0 0 4px; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.authcard h1 { font-size: 24px; margin: 0 0 16px; }
.whoami { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 60%, var(--bg)); margin-bottom: 18px; }
.whoami-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; } .whoami-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autherr { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 16px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 13.5px; }
.autherr .i { width: 17px; height: 17px; margin-top: 1px; }
.authbtn { height: 44px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.authpanes.switch { display: grid; } .authpanes.switch > .pane { grid-area: 1 / 1; transition: opacity .18s ease; }
.authpanes.switch > .pane.off { visibility: hidden; opacity: 0; pointer-events: none; }
.authpanes:not(.switch) > .pane + .pane { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pane { text-align: center; } .pane form { margin: 0; text-align: left; } .pane p { margin: 0 0 14px; color: var(--muted); }
.paneic { width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.paneic .i { width: 28px; height: 28px; }
.pane label { display: block; font-weight: 500; margin-bottom: 10px; color: var(--ink); text-align: center; }
.linkbtn { background: none; border: 0; box-shadow: none; padding: 6px 4px; margin-top: 10px; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.linkbtn:hover { text-decoration: underline; }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.otp-box { height: 52px; padding: 0; text-align: center; font: 600 22px var(--mono); border-radius: 12px; caret-color: var(--accent); }
.otp.full .otp-box { border-color: var(--accent); } .otp.sending { opacity: .6; }
.recovery { margin-top: 14px; text-align: left; } .recovery summary { cursor: pointer; color: var(--muted); font-size: 13px; text-align: center; }
.recovery form { margin-top: 10px; } .recovery label { text-align: left; }
.authfoot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: 13.5px; }
.authfoot .linkbtn { margin: 0; color: var(--muted); font-weight: 500; }
.authok { width: 56px; height: 56px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); animation: pop .35s ease-out; }
.authok .i { width: 28px; height: 28px; stroke-width: 2.4; }
.authcard.done { text-align: center; } .authcard.done h1 { margin-bottom: 6px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .authok { animation: none; } .authpanes.switch > .pane { transition: none; } }
@media (max-width: 420px) { .authcard { padding: 24px 18px 18px; } .otp { gap: 6px; } .otp-box { height: 46px; font-size: 20px; } }
/* Hardware parts (server form and page) */
.hwsub { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.hwsub:first-of-type { margin-top: 4px; } .hwsub .small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hwgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.hwgrid label, .hwrow label { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.hwgrid input, .hwrow input, .hwrow select { margin-top: 4px; color: var(--ink); }
.span2 { grid-column: span 2; }
.hwrows .rows { display: flex; flex-direction: column; gap: 10px; }
.hwrow { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; padding: 12px 52px 12px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 60%, var(--bg)); }
.hwrow .iprm { position: absolute; top: 12px; right: 10px; }
.hwrow input[aria-invalid="true"], .hwgrid input:user-invalid, .hwrow input:user-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.ramfield { display: block; max-width: 260px; margin-top: 12px; }
.hwform textarea { margin-top: 4px; }
.hwsum { font-weight: 650; font-size: 15px; margin: 0 0 12px; }
.sn { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.hwclash { display: flex; gap: 10px; align-items: flex-start; max-width: none; } .hwclash .i { flex: none; margin-top: 2px; }
.hwclash ul { margin: 4px 0 0; padding-left: 18px; } .hwclash a { color: inherit; text-decoration: underline; }
.comps .cardhead { padding: 18px 22px 0; margin-bottom: 8px; } .comps .cardhead h2 { display: flex; gap: 10px; align-items: baseline; }
.comps .tablescroll + .cardhead { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 18px; }
@media (max-width: 760px) {
  .span2 { grid-column: auto; }
  .hwrow { grid-template-columns: 1fr 1fr; }
  .hwrow label:has(input[name$="serial"]), .hwrow label:has(input[name="disk_model"]), .hwrow label:has(input[name="mem_part"]),
  .hwrow label:has(input[name="disk_path"]) { grid-column: 1 / -1; }
  .hwrow input, .hwrow select { width: 100%; }
  table.comptable thead { display: none; } table.comptable, table.comptable tbody, table.comptable tr { display: block; width: 100%; }
  table.comptable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.comptable td { border: 0; padding: 2px 0; min-width: 0; overflow-wrap: anywhere; }
  table.comptable td::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-family: inherit; }
}
.srvid { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; color: var(--muted); }
.srvid b { color: var(--ink); font-size: 15px; } .tag.linked { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12px; } .tag.linked .i { width: 14px; height: 14px; }
.partdiff { margin: 2px 0 0; padding-left: 16px; } .partdiff li { overflow-wrap: anywhere; }
.bmcread { display: inline-flex; align-items: center; gap: 7px; } .bmcread .i { width: 16px; height: 16px; }
.bmcread-msg { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--info-bg); color: var(--info); }
.bmcread-msg.ok { background: var(--ok-bg); color: var(--ok); } .bmcread-msg.error { background: var(--bad-bg); color: var(--bad); }
input.from-bmc { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.bmc-suggest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 0; font-size: 12.5px; color: var(--warn); }
.bmc-suggest code { color: var(--ink); overflow-wrap: anywhere; }
