:root {
  --bg0: #e8eef8;
  --bg1: #f4f7fc;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-soft: rgba(255, 255, 255, 0.38);
  --stroke: rgba(255, 255, 255, 0.65);
  --stroke-2: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #007aff;
  --accent-2: #34c759;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --ok: #34c759;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, 0.16);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.14);
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255,255,255,.6) inset;
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.06);
  --radius: 22px;
  --radius-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --blur: 28px;
  --dur: .45s;
  --dur-fast: .28s;
}

/* 跨页丝滑过渡（Chrome / Edge） */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .42s;
  animation-timing-function: var(--ease-out);
}
::view-transition-old(root) {
  animation-name: vtOut;
}
::view-transition-new(root) {
  animation-name: vtIn;
}
@keyframes vtOut {
  to { opacity: 0; filter: blur(6px); transform: scale(.985); }
}
@keyframes vtIn {
  from { opacity: 0; filter: blur(6px); transform: translateY(10px) scale(.99); }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg1);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}
body::before {
  width: 52vw; height: 52vw; max-width: 680px; max-height: 680px;
  left: -12vw; top: -18vw;
  background: radial-gradient(circle at 30% 30%, #9ecbff 0%, #c7b8ff 45%, transparent 70%);
  opacity: .55;
  animation: orbA 18s var(--ease) infinite alternate;
}
body::after {
  width: 48vw; height: 48vw; max-width: 620px; max-height: 620px;
  right: -10vw; bottom: -16vw;
  background: radial-gradient(circle at 60% 40%, #a8f0d0 0%, #8ec5ff 50%, transparent 70%);
  opacity: .5;
  animation: orbB 22s var(--ease) infinite alternate;
}
@keyframes orbA {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6vw, 4vh) scale(1.08); }
}
@keyframes orbB {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-5vw, -3vh) scale(1.1); }
}

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #0062cc; }
.dim { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  gap: 14px;
  padding: 14px;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.35);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.side {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  border-radius: 28px;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow: hidden;
  animation: sideIn .55s var(--ease-out) both;
}
.side::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.55), transparent 42%, rgba(255,255,255,.08));
  pointer-events: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  padding: 8px 10px 18px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #4da3ff, #007aff 55%, #0056d6);
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 18px rgba(0, 122, 255, .28), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-text { font-size: 22px; font-weight: 740; letter-spacing: -.01em; }
.brand-text em, .login-brand h1 em {
  font-style: normal; color: var(--accent); margin-left: 2px;
}

@keyframes sideIn {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}
.side nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
.side nav .nav-pill {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,122,255,.16), rgba(52,199,89,.1));
  box-shadow: inset 0 0 0 1px rgba(0,122,255,.12), 0 6px 16px rgba(0,122,255,.08);
  pointer-events: none;
  z-index: 0;
  transition: transform .45s var(--ease-out), height .35s var(--ease-out), opacity .3s;
  will-change: transform, height;
}
.side nav a {
  position: relative;
  z-index: 1;
  color: #475569;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 560;
  transition: color .3s var(--ease), transform .3s var(--ease-out), background .3s var(--ease);
}
.side nav a:hover {
  background: rgba(255,255,255,.45);
  color: var(--text);
  transform: translateX(3px);
}
.side nav a.on {
  background: transparent;
  color: #0056d6;
  box-shadow: none;
}

.side-foot { position: relative; margin-top: auto; display: grid; gap: 8px; padding: 8px; }
.side-tag {
  font-size: 12px; color: var(--muted);
  padding: 6px 10px; width: fit-content;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.5);
}
.logout { color: var(--muted); font-size: 13px; padding: 4px 4px; transition: color .2s; }
.logout:hover { color: var(--danger); }

.main {
  min-width: 0;
  padding: 8px 10px 28px;
  animation: pageIn .6s var(--ease-out) both;
}
.main.is-leaving {
  opacity: 0;
  transform: translateY(10px) scale(.992);
  filter: blur(4px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), filter .22s var(--ease);
  pointer-events: none;
}
.main.soft-enter {
  animation: pageIn .48s var(--ease-out) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

.top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.top h1 {
  margin: 0; font-size: 28px; font-weight: 720; letter-spacing: -.03em;
}
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chip {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--stroke);
  color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn {
  border: 0; border-radius: 14px; padding: 9px 15px; cursor: pointer;
  background: linear-gradient(180deg, #3d9bff, #007aff);
  color: #fff; font-weight: 650; font-family: inherit; font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,122,255,.25), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .22s var(--ease-spring), box-shadow .22s var(--ease), filter .22s;
}
.btn:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.04); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn.ghost {
  background: var(--glass-strong);
  color: #334155;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn.ghost:hover { color: var(--accent); border-color: rgba(0,122,255,.25); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 11px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

select, input[type="number"], input[type="text"], input[type="password"],
.form-ctrl input, .form-ctrl select, .add-user-row input, .rt-filter select {
  background: rgba(255,255,255,.7);
  color: var(--text);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  backdrop-filter: blur(10px);
}
select:focus, input:focus {
  outline: none;
  border-color: rgba(0,122,255,.45);
  box-shadow: 0 0 0 4px rgba(0,122,255,.12);
  background: rgba(255,255,255,.92);
}
.inline-field {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px;
}
.inline-field input { width: 64px; }

.overview-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  align-items: stretch;
}
.overview-disks { display: contents; }

.ov-tile {
  min-width: 0;
  padding: 12px 14px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.ov-tile::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.5), transparent 42%);
  pointer-events: none;
}
.ov-tile.metric.has-tip { overflow: visible; }
.ov-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(15,23,42,.1);
}
.ov-tile.metric.has-tip:hover { transform: none; }

.ov-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
.ov-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}
.ov-val {
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color .35s var(--ease), transform .35s var(--ease-spring);
}
.ov-val.is-tick { transform: scale(1.04); color: var(--accent); }
.ov-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(15,23,42,.07);
  overflow: hidden;
}
.ov-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #34c759, #007aff);
  transition: width .85s var(--ease-out);
}
.ov-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.ov-lines p,
.ov-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-meta { color: var(--muted); font-size: 11.5px; }
.ov-lines p.dim,
.ov-lines .dim { color: var(--muted); font-size: 11px; }
.ov-lines strong { font-weight: 700; }
.ov-lines a,
.ov-meta a { color: var(--accent, #007aff); text-decoration: none; }
.ov-lines a:hover,
.ov-meta a:hover { text-decoration: underline; }

/* CPU：细均衡器，替代灰块核心条 */
.ov-cpu { gap: 7px; }
.cpu-eq {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  height: 36px;
  padding: 0 1px;
  position: relative;
}
.cpu-eq i {
  display: block;
  flex: 1 1 0;
  max-width: 8px;
  min-width: 4px;
  min-height: 3px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, #5ac8fa 0%, #007aff 55%, #34c759 100%);
  transition: height .35s var(--ease), background .35s ease;
}
.cpu-eq i.hot {
  background: linear-gradient(180deg, #ffd60a 0%, #ff9f0a 45%, #ff375f 100%);
}
.ov-cpu .ov-bar { height: 4px; opacity: .9; }

.overview-row > .ov-tile,
.overview-row > .overview-disks .ov-tile {
  animation: tileIn .55s var(--ease-out) both;
}
.overview-row > .ov-tile:nth-child(1) { animation-delay: .04s; }
.overview-row > .ov-tile:nth-child(2) { animation-delay: .09s; }
.overview-row > .ov-tile:nth-child(3) { animation-delay: .14s; }
.overview-row > .overview-disks .ov-tile:nth-child(1) { animation-delay: .19s; }
.overview-row > .overview-disks .ov-tile:nth-child(2) { animation-delay: .24s; }
.overview-row > .overview-disks .ov-tile:nth-child(3) { animation-delay: .29s; }
@keyframes tileIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.hero-health {
  display: grid; grid-template-columns: 320px 1fr; gap: 14px; margin-bottom: 14px;
}

.health-score, .metric:not(.ov-tile), .panel, .svc-card, .mon-card, .rt-card, .rt-panel,
.ssh-status-card, .ssh-stats-card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.mon-card, .metric.has-tip { overflow: visible; }
.overview-row,
.hero-health,
.metric-grid,
.disk-section,
.disk-grid {
  position: relative;
  z-index: 5;
}
.main > .grid-2,
.main > .section,
.main > .panel,
.main > .svc-grid {
  position: relative;
  z-index: 1;
}
.overview-row:has(.has-tip:hover),
.hero-health:has(.has-tip:hover),
.metric-grid:has(.has-tip:hover),
.disk-section:has(.has-tip:hover),
.disk-grid:has(.has-tip:hover) {
  z-index: 500;
}
.metric.has-tip { z-index: 2; }
.metric.has-tip:hover {
  z-index: 520;
  transform: none; /* 避免 transform 新建层叠上下文导致气泡被盖 */
}
.health-score::before, .panel::before, .metric::before, .svc-card::before, .rt-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.5), transparent 40%);
  pointer-events: none;
}
.svc-card:hover, .metric:hover, .rt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(15,23,42,.1);
}

.health-score {
  padding: 20px 18px;
  display: flex; gap: 18px; align-items: center;
}

.ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex: 0 0 120px;
}
.ring-svg { display: block; width: 120px; height: 120px; }
.ring-track, .ring-value { fill: none; stroke-width: 10; }
.ring-track { stroke: rgba(15,23,42,.08); }
.ring-value {
  stroke: url(#ringGrad);
  stroke: #007aff;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset .7s var(--ease);
  filter: drop-shadow(0 0 6px rgba(0,122,255,.35));
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.ring-center strong { font-size: 32px; font-weight: 740; line-height: 1; letter-spacing: -.03em; }
.ring-center span { margin-top: 4px; font-size: 12px; color: var(--muted); }
.health-meta h2 { margin: 0 0 8px; font-size: 24px; font-weight: 720; letter-spacing: -.02em; }
.health-meta p { margin: 0 0 4px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.disk-section { margin-bottom: 14px; }
.disk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.disk-card .bar { margin-bottom: 8px; }
.metric-grid.lg { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.metric { padding: 16px; position: relative; }
.metric-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; position: relative; }
.metric-head span { color: var(--muted); font-size: 13px; font-weight: 600; }
.metric-head b { font-size: 22px; font-weight: 740; letter-spacing: -.02em; }
.dim.tiny, .metric .dim.tiny { font-size: 11px; margin-top: 4px; opacity: .85; }
.core-bars {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 4px; margin-top: 10px;
}
.core-bars .core-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.core-bars .core-item em {
  font-style: normal; font-size: 10px; color: var(--muted); line-height: 1;
}
.core-bars .core-track {
  width: 100%; height: 28px; border-radius: 6px;
  background: rgba(15,23,42,.06); overflow: hidden;
  display: flex; align-items: flex-end;
}
.core-bars .core-track i {
  display: block; width: 100%; min-height: 2px;
  background: linear-gradient(180deg, #34c759, #30d158);
  border-radius: 4px 4px 0 0;
  transition: height .35s ease;
}
.core-bars .core-track i.hot { background: linear-gradient(180deg, #ff9f0a, #ff375f); }
.metric.has-tip { cursor: default; }
.metric-tip {
  position: absolute; left: 8px; right: 8px;
  top: calc(100% + 6px); bottom: auto;
  z-index: 600; padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 16px 48px rgba(15,23,42,.22);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.98);
  transition: opacity .28s var(--ease-out), transform .32s var(--ease-out), visibility .28s;
}
.metric.has-tip:hover .metric-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.metric-tip .tip-title {
  font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 6px;
}
.metric-tip .tip-title:first-child { margin-top: 0; }
.metric-tip ul { list-style: none; margin: 0; padding: 0; }
.metric-tip li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; padding: 4px 0; border-bottom: 1px solid rgba(15,23,42,.05);
}
.metric-tip li:last-child { border-bottom: 0; }
.metric-tip li span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-tip li b { font-weight: 700; white-space: nowrap; color: #20a53a; }
.tip-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; margin-bottom: 4px; }
.tip-kv div { color: var(--muted); }
.tip-kv b { color: var(--text); font-weight: 650; }
.bar {
  height: 8px; border-radius: 999px; background: rgba(15,23,42,.06); overflow: hidden; margin-bottom: 8px;
}
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #34c759, #007aff);
  border-radius: inherit;
  transition: width .7s var(--ease);
}
.bar.warn i { background: linear-gradient(90deg, #ff9f0a, #ff3b30); }

.section { margin-bottom: 16px; }
.section-head, .panel-head, .mon-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 12px; position: relative;
}
.section-head h2, .panel-head h2, .mon-head h2 {
  margin: 0; font-size: 16px; font-weight: 720; letter-spacing: -.01em;
}
.panel { padding: 16px; margin-bottom: 14px; }

.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.svc-card { padding: 16px; }
.svc-card.is-on { border-color: rgba(52,199,89,.35); }
.svc-card.is-off { border-color: rgba(255,59,48,.28); }
.svc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; position: relative; }
.svc-top h3 { margin: 0; font-size: 15px; font-weight: 700; }
.pill {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--ok-soft); color: #1f8f3a;
}
.svc-card.is-off .pill, .pill.off { background: var(--danger-soft); color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-2 > .panel { padding: 12px 14px; margin-bottom: 0; }
.grid-2 > .panel .panel-head { margin-bottom: 8px; }
.grid-2 > .panel .panel-head h2 { font-size: 15px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; }
.mini-stats.bar { grid-template-columns: repeat(6, 1fr); margin-bottom: 14px; }
.mini-stats > div, .info-strip > div {
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 16px; padding: 12px;
  backdrop-filter: blur(12px);
}
.grid-2 .mini-stats { gap: 6px; }
.grid-2 .mini-stats > div {
  border-radius: 12px; padding: 8px 10px;
}
.mini-stats b { display: block; font-size: 22px; font-weight: 740; letter-spacing: -.02em; }
.grid-2 .mini-stats b { font-size: 18px; line-height: 1.15; }
.mini-stats span { color: var(--muted); font-size: 12px; font-weight: 600; }
.grid-2 .mini-stats span { font-size: 11px; }

.info-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
@media (min-width: 1100px) {
  .info-strip { grid-template-columns: repeat(6, 1fr); }
}
.info-strip span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; font-weight: 600; }
.info-strip b { font-size: 13px; font-weight: 650; word-break: break-all; }

.extra-svc { display: flex; flex-wrap: wrap; gap: 8px; }
.extra-item {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 7px 13px; display: flex; gap: 8px; align-items: center;
  font-size: 13px; font-weight: 600;
  backdrop-filter: blur(14px);
  transition: transform .25s var(--ease);
}
.extra-item:hover { transform: translateY(-2px); }
.extra-item em { font-style: normal; color: var(--ok); font-size: 12px; }
.extra-item.is-off em { color: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; position: relative; }
.table th, .table td {
  text-align: left; padding: 11px 8px; border-bottom: 1px solid rgba(15,23,42,.06); vertical-align: top;
}
.table th { color: var(--muted); font-weight: 700; font-size: 12px; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255,255,255,.45); }
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 14px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(15,23,42,.06);
  font-size: 13px; color: var(--muted);
}
.pager[hidden] { display: none !important; }
.pager-left b { color: var(--text); font-weight: 700; }
.pager-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager-btn, .pager-page {
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.7);
  color: var(--text);
  border-radius: 10px;
  min-width: 34px; height: 32px; padding: 0 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.pager-btn:hover:not(:disabled), .pager-page:hover {
  background: rgba(0,122,255,.08); border-color: rgba(0,122,255,.25);
}
.pager-page.on {
  background: #007aff; border-color: #007aff; color: #fff;
}
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-ellipsis { padding: 0 4px; color: var(--muted); }
.pager-jump {
  display: flex; align-items: center; gap: 6px;
}
.pager-input {
  width: 64px; height: 32px; border-radius: 10px;
  border: 1px solid rgba(15,23,42,.1);
  background: rgba(255,255,255,.85);
  padding: 0 8px; text-align: center; font-size: 13px;
}

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(15,23,42,.06); color: #475569;
}
.tag.completed, .tag.pending { background: var(--ok-soft); color: #1f8f3a; }
.tag.processing, .tag.awaiting_edit { background: var(--warn-soft); color: #c77700; }
.tag.failed { background: var(--danger-soft); color: var(--danger); }
.err { color: var(--danger); max-width: 180px; }

.logbox {
  margin: 0; padding: 14px;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  border-radius: 18px; font-family: var(--mono); font-size: 12px;
  white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.logbox.tall { max-height: 70vh; min-height: 420px; }

.disk-row { margin-bottom: 12px; }
.load-line { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.range-bar {
  display: flex; gap: 0; margin-bottom: 14px;
  border-radius: 14px; overflow: hidden; width: fit-content;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}
.range-btn {
  border: 0; background: transparent; color: #64748b;
  padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  transition: color .2s, background .25s var(--ease);
}
.range-btn.on, .range-btn:hover {
  color: var(--accent);
  background: rgba(0,122,255,.1);
}

.mon-stack { display: grid; gap: 14px; }
.mon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mon-card { padding: 14px 16px 12px; }
.mon-card.mon-wide { grid-column: 1 / -1; }
.mon-head-right {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end;
}
.mon-live { color: var(--muted); font-size: 13px; font-family: var(--mono); font-weight: 650; }
.mon-range { margin: 0; }
.mon-subhead {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 650;
}
.mon-subhead em { font-style: normal; color: var(--text); font-family: var(--mono); }
.mon-charts-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mon-chart-col { min-width: 0; }
.chart-box {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 14px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.55);
  padding: 6px 4px 2px;
}
.mon-wide .chart-box { height: 300px; }
.chart-box.tall { height: 320px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }
.mon-card canvas { width: 100% !important; }

/* Realtime */
.rt-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rt-panel { padding: 0 0 8px; }
.rt-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px 8px; border-bottom: 1px solid rgba(15,23,42,.06);
}
.rt-head h3 { margin: 0; font-size: 15px; font-weight: 720; }
.rt-tabs { margin-bottom: 0; border-bottom: 0; }
.rt-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.rt-pane { display: none; padding: 14px; }
.rt-pane.on { display: block; }
.rt-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.rt-split .rt-cards { gap: 8px; margin-bottom: 10px; }
.rt-card { padding: 12px 10px; border-radius: 14px; }
.rt-split .rt-card { padding: 10px 8px; border-radius: 12px; }
.rt-card-label {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12px; margin-bottom: 4px; font-weight: 600; position: relative;
}
.rt-card b { font-size: 18px; font-weight: 740; letter-spacing: -.02em; position: relative; }
.rt-split .rt-card b { font-size: 16px; }
.rt-card b.ok-text { color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }
.dot.green { background: #34c759; color: #34c759; }
.dot.orange { background: #ff9f0a; color: #ff9f0a; }
.dot.pink { background: #ff375f; color: #ff375f; }
.dot.cyan { background: #64d2ff; color: #64d2ff; }
.rt-chart-wrap {
  height: 260px; position: relative;
  border-radius: 18px; padding: 10px;
  background: rgba(255,255,255,.4);
  border: 1px solid rgba(255,255,255,.55);
}

/* SSH */
.ssh-top {
  display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 14px; margin-bottom: 14px;
}
.ssh-status-row h2 { margin: 0 0 10px; font-size: 16px; }
.ssh-status-row > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ssh-stats-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: center; padding: 16px; }
.ssh-stat-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ok-box, .fail-box {
  border-radius: 16px; padding: 14px 12px; text-align: center;
  border: 1px solid rgba(255,255,255,.5);
}
.ok-box { background: var(--ok-soft); }
.fail-box { background: var(--danger-soft); }
.ok-box b, .fail-box b { display: block; font-size: 28px; font-weight: 740; }
button.ssh-stat-link {
  display: block; width: 100%; cursor: pointer;
  font: inherit; color: inherit; appearance: none;
  transition: transform .2s var(--ease), box-shadow .2s;
}
button.ssh-stat-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,23,42,.1);
}
button.ok-box.ssh-stat-link:hover { border-color: rgba(52,199,89,.45); }
button.fail-box.ssh-stat-link:hover { border-color: rgba(255,59,48,.4); }
.btn.log-filter.on {
  background: #007aff; border-color: #007aff; color: #fff;
}
.ok-box span, .fail-box span { color: var(--muted); font-size: 12px; }
.ok-box b { color: var(--ok); }
.fail-box b { color: var(--danger); }
.ssh-bars { display: grid; gap: 10px; }
.ssh-bar-row {
  display: grid; grid-template-columns: 36px 1fr 28px; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted);
}
.ssh-bar-row i {
  display: block; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #34c759, #007aff);
  min-width: 4px;
}

.tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  padding: 4px; width: fit-content;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(16px);
}
.tab {
  border: 0; background: transparent; color: #64748b;
  padding: 9px 16px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 650;
  border-radius: 12px;
  transition: background .25s var(--ease), color .25s, transform .25s var(--ease-spring);
}
.tab.on {
  color: #0056d6;
  background: rgba(255,255,255,.75);
  box-shadow: 0 4px 14px rgba(0,122,255,.1);
}
.tab:hover { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.on { display: block; animation: fadeSlide .48s var(--ease-out) both; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}

.form-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(15,23,42,.05);
  position: relative;
}
.form-row:last-child { border-bottom: 0; }
.form-label strong { display: block; font-size: 14px; margin-bottom: 4px; }
.form-ctrl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-ctrl input[type="number"],
.form-ctrl input[type="text"],
.form-ctrl select,
.add-user-row input { min-width: 160px; }
.warn-tip {
  display: inline-block; margin-top: 6px; padding: 3px 9px;
  background: var(--warn-soft); color: #c77700; border-radius: 999px; font-size: 12px; font-weight: 650;
}
.add-user-row { justify-content: flex-start; }

.switch {
  position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 48px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(15,23,42,.12); border-radius: 999px;
  transition: .28s var(--ease);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.slider:before {
  position: absolute; content: ""; height: 22px; width: 22px; left: 3px; top: 3px;
  background: linear-gradient(180deg, #fff, #f2f4f8);
  border-radius: 50%;
  transition: .28s var(--ease-spring);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.switch input:checked + .slider { background: linear-gradient(180deg, #34c759, #248a3d); }
.switch input:checked + .slider:before { transform: translateX(20px); }

#toast-host {
  position: fixed; right: 18px; bottom: 18px; z-index: 99;
  display: grid; gap: 8px;
}
.toast {
  min-width: 170px; padding: 12px 16px; border-radius: 16px; font-size: 13px; font-weight: 650;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow);
  animation: toastIn .4s var(--ease-spring);
}
.toast.ok { color: #1f8f3a; }
.toast.bad { color: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* login */
.login-body {
  min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #eaf2ff, #f5f8fc 40%, #e8f8f1);
}
.login-body::before, .login-body::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(0); z-index: 0; pointer-events: none;
}
.login-body::before {
  width: 420px; height: 420px; left: 12%; top: 10%;
  background: radial-gradient(circle, rgba(0,122,255,.35), transparent 65%);
  animation: orbA 14s var(--ease) infinite alternate;
}
.login-body::after {
  width: 380px; height: 380px; right: 10%; bottom: 8%;
  background: radial-gradient(circle, rgba(52,199,89,.3), transparent 65%);
  animation: orbB 16s var(--ease) infinite alternate;
}
.login-bg { display: none; }
.login-card {
  position: relative; z-index: 1;
  width: min(400px, 92vw); padding: 30px 26px;
  border-radius: 28px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px) saturate(1.45);
  -webkit-backdrop-filter: blur(30px) saturate(1.45);
  display: flex; flex-direction: column; gap: 14px;
  animation: pageIn .6s var(--ease);
}
.login-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(150deg, rgba(255,255,255,.55), transparent 45%);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; position: relative; }
.login-brand h1 { margin: 0; font-size: 30px; font-weight: 740; letter-spacing: -.02em; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; position: relative;
}
.login-card input {
  border: 1px solid rgba(15,23,42,.08); background: rgba(255,255,255,.75); color: var(--text);
  border-radius: 14px; padding: 12px; font-size: 15px; font-family: inherit;
}
.login-card .btn { width: 100%; padding: 12px; border-radius: 16px; font-size: 15px; position: relative; }
.alert {
  background: var(--danger-soft); color: #c0392b; padding: 10px 12px;
  border-radius: 14px; font-size: 13px; font-weight: 650; position: relative;
}

/* stagger helpers */
.main > .top,
.main > .overview-row,
.main > .hero-health,
.main > .section,
.main > .grid-2,
.main > .panel,
.main > .ssh-top,
.main > .tabs,
.main > .tab-pane,
.main > .range-bar,
.main > .mon-grid,
.main > .rt-panel,
.main > .mini-stats,
.main > .info-strip,
.main > .metric-grid {
  animation: rise .55s var(--ease) both;
}
.main > *:nth-child(1) { animation-delay: .03s; }
.main > *:nth-child(2) { animation-delay: .08s; }
.main > *:nth-child(3) { animation-delay: .13s; }
.main > *:nth-child(4) { animation-delay: .18s; }
.main > *:nth-child(5) { animation-delay: .23s; }
.main > *:nth-child(6) { animation-delay: .28s; }
.main > *:nth-child(7) { animation-delay: .33s; }
.main > *:nth-child(8) { animation-delay: .38s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}

.svc-grid .svc-card {
  animation: tileIn .5s var(--ease-out) both;
}
.svc-grid .svc-card:nth-child(1) { animation-delay: .06s; }
.svc-grid .svc-card:nth-child(2) { animation-delay: .11s; }
.svc-grid .svc-card:nth-child(3) { animation-delay: .16s; }
.svc-grid .svc-card:nth-child(4) { animation-delay: .21s; }

.pill, .tag {
  transition: background .3s var(--ease), color .3s var(--ease), transform .25s var(--ease-spring);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  @view-transition { navigation: none; }
}

@media (max-width: 1400px) {
  .overview-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .hero-health, .grid-2, .metric-grid, .metric-grid.lg, .svc-grid, .ssh-top, .ssh-stats-card {
    grid-template-columns: 1fr 1fr;
  }
  .overview-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mon-grid, .mon-charts-2, .rt-split { grid-template-columns: 1fr; }
  .mini-stats.bar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .side {
    position: relative; top: 0; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px;
    border-radius: 22px;
  }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; margin-left: auto; }
  .main { padding: 4px 2px 20px; }
  .top h1 { font-size: 22px; }
  .overview-row, .hero-health, .grid-2, .metric-grid, .metric-grid.lg, .svc-grid, .info-strip, .mini-stats, .mini-stats.bar, .mon-grid, .mon-charts-2, .ssh-top, .ssh-stats-card, .rt-split {
    grid-template-columns: 1fr;
  }
  .rt-cards { grid-template-columns: repeat(2, 1fr); }
  .chart-box, .mon-wide .chart-box { height: 240px; }
  .form-row { flex-direction: column; align-items: flex-start; }
  .rt-head { flex-wrap: wrap; padding-top: 8px; }
  .rt-chart-wrap { height: 220px; }
}
