/* QCF Monitor — aquamarine → slate-grey design system */

:root {
  --bg: #edf2f1;
  --surface: #ffffff;
  --surface-2: #f6f9f8;
  --surface-3: #e9f0ee;
  --border: #dbe4e2;
  --border-strong: #c3cfcd;
  --text: #1a2625;
  --text-2: #3b4a49;
  --muted: #687876;
  --faint: #97a4a2;

  --primary: #1f9e86;
  --primary-strong: #157564;
  --primary-soft: #d8f2eb;
  --aqua-1: #ecf8f5;
  --aqua-2: #bfeadf;
  --aqua-3: #7fd9c3;
  --aqua-4: #43c1a5;
  --slate-1: #eef1f1;
  --slate-3: #b3bfbd;
  --slate-4: #8d9a98;
  --slate-5: #687675;
  --slate-6: #4b5857;

  --ok: #1f9e86;      --ok-soft: #d8f2eb;
  --idle: #8d9a98;    --idle-soft: #eaeeee;
  --warn: #b97a12;    --warn-soft: #fbefd9;
  --err: #bb4f47;     --err-soft: #f7e1de;
  --info: #3f7590;    --info-soft: #dfedf3;

  --hero: linear-gradient(115deg, #2db79b 0%, #36a08f 30%, #4f8682 62%, #5b6a6f 100%);
  --shadow-1: 0 1px 2px rgba(23, 45, 42, .06), 0 1px 1px rgba(23, 45, 42, .04);
  --shadow-2: 0 6px 22px rgba(23, 52, 48, .09), 0 2px 6px rgba(23, 52, 48, .05);
  --shadow-3: 0 18px 48px rgba(18, 40, 37, .22);
  --radius: 14px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111817;
  --surface: #172120;
  --surface-2: #1b2625;
  --surface-3: #22302e;
  --border: #283533;
  --border-strong: #354543;
  --text: #e1ebe9;
  --text-2: #c2d0ce;
  --muted: #8b9c99;
  --faint: #66777475;
  --primary: #5ccfb4;
  --primary-strong: #84dfca;
  --primary-soft: #183a33;
  --aqua-1: #16302b;
  --aqua-2: #1f4a41;
  --aqua-3: #3a8f7d;
  --aqua-4: #4fb79f;
  --slate-1: #1d2726;
  --slate-3: #4b5a58;
  --slate-4: #6f7f7d;
  --slate-5: #92a2a0;
  --slate-6: #b4c2c0;
  --ok: #5ccfb4;      --ok-soft: #173a33;
  --idle: #7f908e;    --idle-soft: #232e2d;
  --warn: #e0a84a;    --warn-soft: #3a2f19;
  --err: #e3847b;     --err-soft: #3d2220;
  --info: #7eb6d1;    --info-soft: #1b3240;
  --hero: linear-gradient(115deg, #1d6f61 0%, #255f57 35%, #33504f 70%, #383f44 100%);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 62px; display: flex; align-items: center; gap: 18px;
  padding: 0 20px; color: #fff; background: var(--hero);
  box-shadow: 0 2px 14px rgba(20, 60, 54, .25);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 18px; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.brand-text strong { font-weight: 800; }
.server-switch {
  display: flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.server-switch button {
  border: 0; background: transparent; color: rgba(255,255,255,.88); font: inherit; font-weight: 600;
  padding: 6px 12px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 7px;
}
.server-switch button:hover { background: rgba(255,255,255,.12); color: #fff; }
.server-switch button[aria-selected="true"] { background: #fff; color: #1d5f54; box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .server-switch button[aria-selected="true"] { background: #e6f3f0; color: #164c43; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: rgba(255,255,255,.92);
  background: rgba(0,0,0,.12); padding: 5px 10px; border-radius: 999px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ff3dc; box-shadow: 0 0 0 0 rgba(159,243,220,.7);
  animation: pulse 2s infinite; }
.live.stale .live-dot { background: #f3c77a; animation: none; }
.live.down .live-dot { background: #ff9b91; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(159,243,220,.7); } 70% { box-shadow: 0 0 0 8px rgba(159,243,220,0); } 100% { box-shadow: 0 0 0 0 rgba(159,243,220,0); } }
.icon-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 34px; height: 34px; border-radius: 10px;
  cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255,255,255,.24); }
.icon-btn svg { width: 17px; height: 17px; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-menu form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.95); color: #1d6f61; font-weight: 800; font-size: 12px; }

/* ---------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: calc(100vh - 62px); }
.sidebar { position: sticky; top: 62px; align-self: start; height: calc(100vh - 62px); padding: 18px 12px;
  border-right: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2);
  font-weight: 600; cursor: pointer; }
.nav-item svg { width: 18px; height: 18px; color: var(--slate-4); flex: none; }
.nav-item:hover { background: var(--surface-3); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); }
.nav-item.active svg { color: var(--primary); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); }
.nav-sep { height: 1px; background: var(--border); margin: 12px 6px; }
.nav-foot { margin-top: auto; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.content { padding: 26px 30px 60px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 750; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.section { margin-top: 26px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h2 { font-size: 16px; font-weight: 700; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 16px 20px; }

.server-card { overflow: hidden; position: relative; }
.server-card .band { height: 5px; background: var(--hero); }
.server-card.down .band { background: linear-gradient(90deg, var(--err), #8a5f5b); }
.server-top { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 6px; }
.server-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--aqua-2), var(--slate-1)); color: var(--primary-strong); }
.server-icon svg { width: 22px; height: 22px; }
.server-top h3 { font-size: 17px; font-weight: 750; }
.server-top .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.server-top .right-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.connect { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px;
  background: var(--surface-3); color: var(--text-2); padding: 3px 4px 3px 9px; border-radius: 7px; }
.connect button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.connect button:hover { color: var(--primary-strong); background: var(--primary-soft); }
.connect svg { width: 13px; height: 13px; display: block; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 20px 4px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; min-width: 0; }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 24px; font-weight: 780; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.accent { background: linear-gradient(140deg, var(--aqua-1), var(--surface-2)); border-color: var(--aqua-2); }
.kpi.accent .kpi-value { color: var(--primary-strong); }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi.err .kpi-value { color: var(--err); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi-row .kpi { background: var(--surface); box-shadow: var(--shadow-1); padding: 14px 16px; }

.spark-wrap { padding: 6px 20px 2px; height: 92px; position: relative; }
.spark-legend { display: flex; gap: 14px; padding: 0 20px; font-size: 12px; color: var(--muted); }
.legend-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw-run { background: var(--primary); }
.sw-wait { background: var(--slate-3); }
.spark-empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 0 16px; color: var(--muted);
  font-size: 12.5px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.sw-short { display: none; }

/* managers grouped by compute tag */
.tag-group { margin-bottom: 28px; }
.tag-group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); }
.tag-big { font-size: 13.5px; padding: 4px 12px; }
.tg-meta { font-size: 13.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.tg-working { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-strong); font-weight: 650; }
.tg-note { font-size: 12px; color: var(--muted); font-style: italic; }
.tg-queue { margin-left: auto; font-size: 13px; color: var(--muted); }
.tg-queue b { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* dataset-type tiles on the statistics page */
.type-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.type-tile { padding: 16px 18px; background: linear-gradient(150deg, var(--aqua-1), var(--surface) 60%); }
.tt-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.tt-value { font-size: 28px; font-weight: 780; margin-top: 4px; color: var(--primary-strong); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tt-value span { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tt-sub { font-size: 13px; color: var(--text-2); margin: 2px 0 10px; }
.so-icon { width: 15px; height: 15px; display: none; }
.btn-ghost-light { display: inline-flex; align-items: center; gap: 6px; }
.grid-top { align-items: start; }
tr.row-stale td:first-child { box-shadow: inset 3px 0 0 var(--slate-3); }
tr.row-stale td { color: var(--muted); }
.connect { white-space: nowrap; }
.server-top > div:nth-child(2) { min-width: 0; flex: 1; }
.server-top .right-side { flex: none; }
.pill { white-space: nowrap; }
.login-points .dot-ok { background: #c3f7e9; }
.login-points .dot-warn { background: #ffd58f; }
.login-points .dot-idle { background: #e3e9e8; }
.card-foot { display: flex; gap: 8px; padding: 12px 20px 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- controls */
.btn { font: inherit; font-weight: 650; border-radius: 10px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(135deg, #2bb398, #1f8f7b); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(31, 158, 134, .28); }
.btn-primary:hover { background: linear-gradient(135deg, #27a58c, #19806d); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-strong); }
.btn-soft:hover { background: var(--aqua-2); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-ghost-light { font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28); border-radius: 9px; padding: 6px 11px; cursor: pointer; }
.btn-ghost-light:hover { background: rgba(255,255,255,.24); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; }
.search input:focus, select:focus, .field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
select { font: inherit; padding: 8px 30px 8px 11px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 650; color: var(--muted);
  padding: 6px 11px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-1); }
.seg .n { font-size: 11px; background: var(--slate-1); color: var(--muted); padding: 0 6px; border-radius: 999px; }
.seg button.on .n { background: var(--primary-soft); color: var(--primary-strong); }

/* ---------------------------------------------------------------- badges & status */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 8px;
  border-radius: 999px; background: var(--slate-1); color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.mono { font-family: var(--mono); font-weight: 550; font-size: 11.5px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-idle { background: var(--idle-soft); color: var(--idle); }
.badge-tag { background: var(--aqua-1); color: var(--primary-strong); border: 1px solid var(--aqua-2); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); }
.dot-work { background: var(--ok); box-shadow: 0 0 0 0 rgba(31,158,134,.55); animation: pulse-work 1.8s infinite; }
.dot-idle { background: var(--slate-3); }
.dot-warn { background: var(--warn); }
.dot-err { background: var(--err); }
@keyframes pulse-work { 0% { box-shadow: 0 0 0 0 rgba(31,158,134,.55); } 70% { box-shadow: 0 0 0 7px rgba(31,158,134,0); } 100% { box-shadow: 0 0 0 0 rgba(31,158,134,0); } }
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-err { background: var(--err-soft); color: var(--err); }
.pill-wait { background: var(--slate-1); color: var(--muted); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.row-err td:first-child { box-shadow: inset 3px 0 0 var(--err); }
td .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.table-note { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------------------------------------------------------------- manager cards */
.mgr { position: relative; padding: 16px 18px 14px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; overflow: hidden; }
.mgr::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--slate-3); }
.mgr.working::before { background: linear-gradient(180deg, var(--aqua-3), var(--primary)); }
.mgr.late::before { background: var(--warn); }
.mgr.lost::before { background: var(--err); }
.mgr:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.mgr-head { display: flex; align-items: flex-start; gap: 10px; }
.mgr-head .dot { margin-top: 6px; }
.mgr-name { font-weight: 750; font-size: 15px; word-break: break-word; }
.mgr-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.mgr-state { margin-left: auto; }
.mgr .chips { margin-top: 10px; }
.mgr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.mgr-stat { background: var(--surface-2); border-radius: 9px; padding: 7px 9px; }
.mgr-stat b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.mgr-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.mgr-stat.hot b { color: var(--primary-strong); }
.bar { height: 6px; border-radius: 999px; background: var(--slate-1); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.bar .b-ok { background: linear-gradient(90deg, var(--aqua-3), var(--primary)); }
.bar .b-err { background: var(--err); opacity: .8; }
.bar .b-wait { background: var(--slate-3); }
.bar .b-run { background: var(--info); }
.mgr-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.mgr-foot .bar { flex: 1; }
.mgr-foot svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------------------------------------------------------------- attention */
.alerts { display: flex; flex-direction: column; }
.alert-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.alert-item:last-child { border-bottom: 0; }
.alert-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-ic svg { width: 16px; height: 16px; }
.lv-warn .alert-ic { background: var(--warn-soft); color: var(--warn); }
.lv-error .alert-ic { background: var(--err-soft); color: var(--err); }
.lv-info .alert-ic { background: var(--info-soft); color: var(--info); }
.alert-text { font-weight: 600; }
.alert-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--aqua-3); display: block; margin: 0 auto 8px; }
.empty strong { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 2px; }
.callout { display: flex; gap: 12px; padding: 13px 16px; border-radius: 12px; background: var(--aqua-1);
  border: 1px solid var(--aqua-2); color: var(--text-2); margin-bottom: 16px; font-size: 13.5px; }
.callout svg { width: 18px; height: 18px; color: var(--primary); flex: none; margin-top: 1px; }
.alert { padding: 10px 13px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.alert-error { background: var(--err-soft); color: var(--err); font-weight: 600; }

/* ---------------------------------------------------------------- drawer & modal */
.scrim { position: fixed; inset: 0; background: rgba(15, 30, 28, .38); backdrop-filter: blur(2px); opacity: 0; pointer-events: none;
  transition: opacity .18s; z-index: 40; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); z-index: 50;
  box-shadow: var(--shadow-3); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { padding: 0; position: relative; color: #fff; background: var(--hero); }
.drawer-head .inner { padding: 20px 24px 18px; }
.drawer-head h2 { font-size: 20px; font-weight: 750; word-break: break-word; padding-right: 40px; }
.drawer-head .meta { opacity: .9; font-size: 13px; margin-top: 4px; }
.drawer-close { position: absolute; right: 16px; top: 16px; }
.drawer-body { padding: 20px 24px 40px; overflow: auto; flex: 1; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; word-break: break-word; }
.modal { position: fixed; inset: 0; display: none; place-items: center; z-index: 60; padding: 20px; }
.modal.on { display: grid; }
.modal-card { width: min(920px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 18px; word-break: break-word; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 18px 22px 24px; }
.close-btn { border: 0; background: var(--surface-3); color: var(--text-2); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; flex: none; }
.close-btn:hover { background: var(--border); }
.drawer-head .close-btn { background: rgba(255,255,255,.18); color: #fff; }
.close-btn svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- charts */
.chart-card .chart-box { position: relative; height: 270px; padding: 6px 16px 14px; }
.chart-card .card-head .seg { margin-left: auto; }

/* ---------------------------------------------------------------- misc */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #24302f; color: #eaf3f1;
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-3); opacity: 0; pointer-events: none;
  transition: all .2s; z-index: 80; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%;
  animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-card { height: 340px; }
.sk-row { height: 54px; margin-bottom: 10px; }
pre.code { background: #1d2a29; color: #d6ece6; padding: 14px 16px; border-radius: 12px; overflow: auto; font-size: 13px; line-height: 1.5; }
pre.code .c { color: #7fa39b; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.glossary dt { font-weight: 700; margin-top: 12px; }
.glossary dd { margin: 3px 0 0; color: var(--text-2); }
.legend-list { display: grid; gap: 9px; }
.legend-list div { display: flex; align-items: center; gap: 10px; }
.kv-inline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.kv-inline b { color: var(--text); font-variant-numeric: tabular-nums; }
.statusbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--slate-1); min-width: 120px; }
.statusbar > i { display: block; height: 100%; }
.s-complete { background: var(--primary); }
.s-running { background: var(--info); }
.s-waiting { background: var(--slate-3); }
.s-error { background: var(--err); }
.s-cancelled, .s-invalid, .s-deleted { background: var(--warn); opacity: .7; }

/* ---------------------------------------------------------------- login */
.login-body { background: var(--bg); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: var(--hero); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px;
  background: radial-gradient(circle, rgba(255,255,255,.16), rgba(255,255,255,0) 70%); }
.login-brand-inner { max-width: 440px; position: relative; z-index: 1; }
.login-logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.login-brand h1 { font-size: 34px; font-weight: 800; margin-top: 22px; }
.login-lead { font-size: 16px; opacity: .92; margin-top: 12px; }
.login-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 11px; align-items: center; font-size: 14.5px; }
.login-points .dot { box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 30px 28px; box-shadow: var(--shadow-2); }
.login-card h2 { font-size: 23px; font-weight: 750; }
.login-card > .muted { margin: 6px 0 20px; }
.field { display: block; margin-bottom: 15px; }
.field span { display: block; font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.field input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.login-foot { font-size: 12.5px; margin: 16px 0 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 62px; z-index: 20; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 10px;
    border-right: 0; border-bottom: 1px solid var(--border); gap: 4px; }
  .nav-item { white-space: nowrap; padding: 7px 11px; }
  .nav-sep, .nav-foot { display: none; }
  .content { padding: 18px 16px 50px; }
  .grid-3 { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-text, .live #live-text, .user-chip .uname { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 36px 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .server-switch button { padding: 6px 8px; font-size: 13px; }
  .server-switch .sw-label { display: none; }
  .server-switch .sw-short { display: inline; }
  .live, .brand-logo + .brand-text { display: none; }
  .so-text { display: none; }
  .so-icon { display: block; }
  .server-top { flex-wrap: wrap; }
  .server-top .right-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; margin-left: 0; }
  .mgr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
