/* ===========================================================================
   PPPoE Insight — login + admin console styles (self-contained).
   Shares the dashboard's visual language (same tokens) but is independent of
   style.css so the dashboard app-shell body rules never leak in here.
   ========================================================================= */
:root {
  color-scheme: dark;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --bg: #0b0f18; --bg-elev: #121a29; --bg-elev2: #172032; --surface-head: #17202f;
  --hover: rgba(120,160,220,.07); --zebra: rgba(120,160,220,.028);
  --border: #253044; --border-strong: #35435e;
  --text: #e9eef7; --text-muted: #9fb0c9; --text-faint: #74849e;
  --primary: #56a0ff; --primary-ink: #05192f; --primary-soft: rgba(86,160,255,.14);
  --green: #35d6a0; --green-soft: rgba(53,214,160,.14);
  --amber: #f4b63f; --amber-soft: rgba(244,182,63,.15);
  --red: #ff6472; --red-soft: rgba(255,100,114,.15);
  --violet: #b492ff; --violet-soft: rgba(180,146,255,.16);
  --r-sm: 6px; --r: 9px; --r-lg: 13px; --r-pill: 999px;
  --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 22px; --sp-6: 30px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.28);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8; --bg-elev: #ffffff; --bg-elev2: #ffffff; --surface-head: #f2f6fc;
  --hover: rgba(30,80,160,.05); --zebra: rgba(30,80,160,.022);
  --border: #dbe3ef; --border-strong: #c2cee0;
  --text: #16202e; --text-muted: #56657b; --text-faint: #8493a8;
  --primary: #1e50c8; --primary-ink: #ffffff; --primary-soft: rgba(30,80,200,.10);
  --green: #0f9d6b; --green-soft: rgba(15,157,107,.12);
  --amber: #b7791f; --amber-soft: rgba(183,121,31,.14);
  --red: #d92d3f; --red-soft: rgba(217,45,63,.10);
  --violet: #6f45cf; --violet-soft: rgba(111,69,207,.12);
  --shadow: 0 1px 2px rgba(20,40,80,.08), 0 12px 30px rgba(20,40,80,.10);
  --shadow-sm: 0 1px 2px rgba(20,40,80,.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -0.13em; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--text-muted); }
.link { color: var(--primary); font-size: 13px; font-weight: 600; }
.hide-sm { display: inline; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--bg-elev2); color: var(--text); transition: filter .15s, background .15s, border-color .15s; min-height: 40px; white-space: nowrap; }
.btn .ic { width: 16px; height: 16px; }
.btn:hover { border-color: var(--primary); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-icon { padding: 9px; }
.btn-icon .ic { width: 18px; height: 18px; }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none; color: #fff; background: linear-gradient(140deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--violet))); box-shadow: var(--shadow-sm); }
.brand-mark .ic { width: 20px; height: 20px; }
.brand-mark-sm { width: 30px; height: 30px; border-radius: 8px; }
.brand-mark-sm .ic { width: 17px; height: 17px; }
.brand-mark-lg { width: 54px; height: 54px; border-radius: 14px; }
.brand-mark-lg .ic { width: 28px; height: 28px; }

/* =========================== LOGIN / auth pages =========================== */
.auth-body { min-height: 100dvh; }
.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100dvh; }
.auth-hero { position: relative; overflow: hidden; padding: 48px; display: flex; align-items: center;
  background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--primary) 30%, var(--bg)), var(--bg)); color: var(--text); border-right: 1px solid var(--border); }
.auth-hero-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 40px 40px; opacity: .25; mask-image: radial-gradient(circle at 30% 30%, #000, transparent 75%); }
.auth-hero-inner { position: relative; max-width: 440px; }
.auth-hero-inner h2 { font-size: 30px; margin: 20px 0 10px; letter-spacing: .3px; }
.auth-hero-inner p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.auth-hero-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.auth-hero-points li { position: relative; padding-left: 26px; color: var(--text); font-size: 13.5px; }
.auth-hero-points li::before { content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 22px; }
.auth-center { min-height: 100dvh; }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow); }
.auth-card.errorcard { text-align: center; }
.auth-card.errorcard .brand-mark { margin: 0 auto 6px; background: linear-gradient(140deg, var(--red), color-mix(in srgb, var(--red) 60%, var(--amber))); }
.auth-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.auth-card h1 { font-size: 21px; margin: 0; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin: 2px 0 0; }
.auth-error { display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin-bottom: 16px; border-radius: var(--r); background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); font-size: 13px; font-weight: 600; }
.auth-error .ic { width: 18px; height: 18px; flex: none; }
.auth-foot { color: var(--text-faint); font-size: 12px; margin-top: 20px; }

/* Fields (shared with account form) */
.field { display: block; margin-bottom: 15px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 11px 12px; font-family: inherit; font-size: 14px; background: var(--bg-elev2); border: 1px solid var(--border-strong); border-radius: var(--r); color: var(--text); }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-pw { position: relative; display: block; }
.field-pw input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-faint); cursor: pointer; border-radius: 7px; }
.pw-toggle:hover { color: var(--text); background: var(--hover); }
.pw-toggle .ic { width: 18px; height: 18px; }
.hint { color: var(--text-faint); font-weight: 400; }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* =========================== ADMIN console =========================== */
.admin-body { min-height: 100dvh; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--sp-3); padding: 10px clamp(12px,2vw,20px); min-height: 58px; background: color-mix(in srgb, var(--bg-elev) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.admin-topbar .brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); background: var(--primary-soft); padding: 1px 6px; border-radius: 5px; margin-left: 4px; vertical-align: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.usermenu { display: flex; align-items: center; gap: var(--sp-2); }
.user-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-elev2); font-size: 13px; font-weight: 600; }
.role-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 2px 7px; border-radius: var(--r-pill); }
.role-admin { background: var(--primary-soft); color: var(--primary); }
.role-user { background: var(--violet-soft); color: var(--violet); }
.logout-form { display: inline; }
.nav-toggle { display: none; }

.admin-shell { flex: 1; display: flex; align-items: flex-start; }
.admin-nav { position: sticky; top: 58px; flex: none; width: 232px; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--border); min-height: calc(100dvh - 58px); }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r); color: var(--text-muted); font-weight: 600; font-size: 13.5px; }
.nav-item .ic { width: 18px; height: 18px; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.admin-content { flex: 1; min-width: 0; padding: clamp(16px,2.5vw,28px); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-title { font-size: 22px; margin: 0; }
.page-sub { color: var(--text-muted); font-size: 13px; margin: 3px 0 0; }
.page-actions { display: flex; gap: var(--sp-2); }

/* Stat cards / overview */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.stat-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; }
.stat-label { display: block; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.stat-num { display: block; font-family: var(--font-mono); font-size: 30px; font-weight: 700; margin-top: 4px; }
.overview-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-4); }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; margin: 0; }
.form-card { max-width: 460px; }
.mini-audit { display: flex; flex-direction: column; gap: 8px; }
.mini-audit .row { display: flex; gap: 10px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.mini-audit .row:last-child { border-bottom: none; }
.mini-audit .t { color: var(--text-faint); font-family: var(--font-mono); white-space: nowrap; }
.quick-actions { display: grid; gap: 8px; }
.qa { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-weight: 600; font-size: 13.5px; }
.qa:hover { border-color: var(--primary); background: var(--hover); }
.qa .ic { width: 18px; height: 18px; color: var(--primary); }

/* Tables */
.table-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; position: relative; }
.table-scroll { overflow-x: auto; }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 720px; }
.dtable thead th { position: sticky; top: 0; text-align: left; background: var(--surface-head); padding: 11px 14px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.dtable tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.dtable tbody tr:nth-child(even) td { background: var(--zebra); }
.dtable tbody tr:hover td { background: var(--hover); }
.dtable tbody tr:last-child td { border-bottom: none; }
.col-actions { text-align: right; }
.cell-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); background: var(--bg-elev2); color: var(--text-muted); border-radius: var(--r-sm); cursor: pointer; }
.iconbtn:hover { color: var(--text); border-color: var(--primary); }
.iconbtn.danger:hover { color: var(--red); border-color: var(--red); }
.iconbtn .ic { width: 16px; height: 16px; }
.mono { font-family: var(--font-mono); }
.username-cell { font-weight: 600; font-family: var(--font-mono); }
.table-empty, .table-loading { padding: 40px; text-align: center; color: var(--text-muted); }
.cards-list { display: none; flex-direction: column; gap: 10px; padding: 12px; }

/* Pills / toggles */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-warn { background: var(--amber-soft); color: var(--amber); }
.pill-bad { background: var(--red-soft); color: var(--red); }
.pill-muted { background: var(--hover); color: var(--text-muted); }
/* Toggle switch */
.tgl { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; flex: none; }
.tgl input { position: absolute; opacity: 0; width: 0; height: 0; }
.tgl .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--r-pill); transition: background .16s; }
.tgl .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .16s; box-shadow: var(--shadow-sm); }
.tgl input:checked + .track { background: var(--green); }
.tgl input:checked + .track + .knob, .tgl input:checked ~ .knob { transform: translateX(18px); }
.tgl input:focus-visible + .track { box-shadow: var(--ring); }

/* Forms (modal + account) */
.stack-form .field { margin-bottom: 15px; }
.form-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: 6px; }
.form-actions.center { justify-content: center; flex-wrap: wrap; }
.form-note { font-size: 12px; color: var(--text-muted); background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); border-radius: var(--r); padding: 9px 11px; margin: 4px 0 14px; }
.form-error { color: var(--red); font-size: 12.5px; font-weight: 600; margin: 2px 0 12px; min-height: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(3,7,14,.62); display: grid; place-items: center; padding: 18px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); max-height: 92dvh; overflow: auto; animation: pop .16s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; margin: 0; }
.modal-close { display: grid; place-items: center; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-muted); border-radius: 7px; cursor: pointer; }
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: var(--sp-2); justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); }
.modal .field-label .hint { font-size: 11px; }

/* Toasts */
.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 380px); }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-elev2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; animation: pop .16s ease; }
.toast.ok { border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--green); }
.toast.error { border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }
.toast .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ---- Responsive: nav collapses, tables become cards ---- */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .overview-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-topbar { flex-wrap: wrap; row-gap: 6px; }
  .brand { min-width: 0; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; }
  .nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border-strong); background: var(--bg-elev2); color: var(--text); border-radius: var(--r); cursor: pointer; }
  .nav-toggle .ic { width: 20px; height: 20px; }
  .admin-shell { flex-direction: column; }
  .admin-nav { position: static; width: 100%; min-height: 0; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 8px 10px; display: none; }
  body.nav-open .admin-nav { display: flex; }
  .nav-item { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .hide-sm { display: none; }
  .btn, .iconbtn, .btn-icon { min-height: 44px; }
  .iconbtn { width: 44px; height: 44px; }
  .table-scroll { display: none; }
  .cards-list { display: flex; }
  .field-row { grid-template-columns: 1fr; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* Admin data card (mobile) */
.dcard { border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-elev2); padding: 12px 13px; }
.dcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dcard-title { font-weight: 700; font-family: var(--font-mono); font-size: 14px; }
.dcard dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0 0 10px; font-size: 12.5px; }
.dcard dt { color: var(--text-faint); }
.dcard dd { margin: 0; text-align: right; word-break: break-word; }
.dcard-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dcard-actions .btn { flex: 1; justify-content: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg-elev); }

/* ===== Admin monitoring (ADR-0039) — reuses the existing tokens/identity ===== */
.mon-section { margin-bottom: 22px; }
.mon-section .card-head { margin-bottom: 10px; }
.mon-section .card-head h2 { display: flex; align-items: center; gap: 8px; }
.mon-section .card-head .ic { width: 17px; height: 17px; color: var(--text-muted); }
.mon-hidden { display: none !important; }
.stat-sub { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 5px; line-height: 1.4; }
.mon-refresh { font-size: 12px; }
/* status accents on stat cards + capacity cards */
.stat-card.s-ok { border-left: 3px solid var(--green); }
.stat-card.s-warn { border-left: 3px solid var(--amber); }
.stat-card.s-crit { border-left: 3px solid var(--red); }
.stat-card.s-unknown { border-left: 3px solid var(--border-strong); }
/* overall status banner */
.mon-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--bg-elev); font-weight: 600; margin-bottom: 18px; }
.mon-banner .mon-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); flex: none; }
.mon-banner[data-status="ok"] { background: var(--green-soft); border-color: var(--green); }
.mon-banner[data-status="ok"] .mon-dot { background: var(--green); }
.mon-banner[data-status="warn"] { background: var(--amber-soft); border-color: var(--amber); }
.mon-banner[data-status="warn"] .mon-dot { background: var(--amber); }
.mon-banner[data-status="crit"] { background: var(--red-soft); border-color: var(--red); }
.mon-banner[data-status="crit"] .mon-dot { background: var(--red); }
/* small status badge */
.mon-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 2px 7px;
  border-radius: var(--r-pill); background: var(--border); color: var(--text); }
.mon-badge.s-ok { background: var(--green-soft); color: var(--green); }
.mon-badge.s-warn { background: var(--amber-soft); color: var(--amber); }
.mon-badge.s-crit { background: var(--red-soft); color: var(--red); }
.mon-badge.s-unknown { background: var(--border); color: var(--text-muted); }
.mon-state { margin-left: 7px; color: var(--text-muted); font-size: 12px; }
/* usage bar (disk) */
.mon-bar { display: inline-block; width: 60px; height: 6px; border-radius: 4px; background: var(--border);
  vertical-align: middle; margin-left: 6px; overflow: hidden; }
.mon-bar i { display: block; height: 100%; background: var(--primary); }
/* capacity grid */
.mon-cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.mon-cap { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px;
  border-left: 3px solid var(--border-strong); }
.mon-cap.s-ok { border-left-color: var(--green); }
.mon-cap.s-warn { border-left-color: var(--amber); }
.mon-cap.s-crit { border-left-color: var(--red); }
.mon-cap-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mon-cap-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.mon-cap-val { font-family: var(--font-mono); font-size: 24px; font-weight: 700; margin: 6px 0 2px; }
.mon-cap-unit { font-size: 13px; color: var(--text-faint); margin-left: 4px; font-weight: 600; }
.mon-cap-th { font-size: 11px; line-height: 1.4; }
.mon-cap-note { font-size: 11.5px; }
/* tables */
.mon-tablewrap { padding: 0; overflow-x: auto; margin-top: 12px; }
.mon-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mon-table th, .mon-table td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mon-table thead th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; background: var(--surface-head); }
.mon-table td.num, .mon-table th.num { text-align: right; font-family: var(--font-mono); }
.mon-table td.s-crit { color: var(--red); font-weight: 700; }
.mon-table tbody tr:hover, .mon-table tbody tr:hover { background: var(--hover); }
.mon-foot { margin-top: 10px; font-size: 12px; }
