:root {
  color-scheme: light;
  --bg: #d8e0ea;
  --bg-deep: #cbd5e1;
  --surface: rgb(255 255 255 / .78);
  --surface-solid: #f8fafc;
  --surface-2: rgb(241 245 249 / .92);
  --surface-3: #ffffff;
  --border: rgb(100 116 139 / .28);
  --border-strong: rgb(71 85 105 / .42);
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --primary: #2563eb;
  --cyan: #0891b2;
  --emerald: #059669;
  --green: #10b981;
  --amber: #d97706;
  --red: #dc2626;
  --violet: #7c3aed;
  --ok-bg: rgb(16 185 129 / .13);
  --warn-bg: rgb(217 119 6 / .15);
  --crit-bg: rgb(220 38 38 / .13);
  --info-bg: rgb(37 99 235 / .12);
  --shadow: 0 24px 70px rgb(15 23 42 / .14);
  --shadow-soft: 0 12px 30px rgb(15 23 42 / .10);
  --grid-line: rgb(100 116 139 / .13);
  --chart-empty: rgb(255 255 255 / .48);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #030712;
  --surface: rgb(15 23 42 / .72);
  --surface-solid: #0f172a;
  --surface-2: rgb(30 41 59 / .68);
  --surface-3: #111c31;
  --border: rgb(148 163 184 / .18);
  --border-strong: rgb(148 163 184 / .32);
  --text: #e5edf7;
  --muted: #94a3b8;
  --faint: #64748b;
  --primary: #60a5fa;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --violet: #a78bfa;
  --ok-bg: rgb(52 211 153 / .13);
  --warn-bg: rgb(251 191 36 / .13);
  --crit-bg: rgb(251 113 133 / .13);
  --info-bg: rgb(96 165 250 / .14);
  --shadow: 0 26px 90px rgb(0 0 0 / .42);
  --shadow-soft: 0 16px 42px rgb(0 0 0 / .30);
  --grid-line: rgb(148 163 184 / .13);
  --chart-empty: rgb(15 23 42 / .52);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 32rem),
    radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--violet) 20%, transparent), transparent 28rem),
    linear-gradient(145deg, var(--bg), var(--bg-deep));
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / .7), transparent 72%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(18px);
  opacity: .42;
}
.ambient-a {
  top: -16rem;
  right: -8rem;
  background: radial-gradient(circle, rgb(14 165 233 / .22), transparent 64%);
}
.ambient-b {
  bottom: -18rem;
  left: -10rem;
  background: radial-gradient(circle, rgb(16 185 129 / .18), transparent 64%);
}

.app-shell {
  position: relative;
  width: min(1760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 260px;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 42px rgb(14 165 233 / .24);
}
.brand-mark svg { width: 52px; height: 52px; display: block; }

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin: 0; }
h1 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: .98;
  letter-spacing: -.045em;
}
h2 {
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -.025em;
}
h3 { font-size: 15px; }

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.updated { font-size: 12px; margin-inline: 4px 6px; }

.live-pill,
.count-badge,
.status-pill,
.probe-status,
.service-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.live-pill { padding: 8px 12px; }
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--faint);
  box-shadow: 0 0 0 0 rgb(148 163 184 / .35);
}
.live-pill.ok { color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 34%, transparent); background: var(--ok-bg); }
.live-pill.ok .pulse { background: var(--emerald); animation: pulse 1.8s infinite; }
.live-pill.warning { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 38%, transparent); background: var(--warn-bg); }
.live-pill.warning .pulse { background: var(--amber); }
.live-pill.critical { color: var(--red); border-color: color-mix(in srgb, var(--red) 38%, transparent); background: var(--crit-bg); }
.live-pill.critical .pulse { background: var(--red); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(52 211 153 / .35); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 13px;
  padding: 8px 14px;
  font-weight: 760;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.primary-button {
  border: 0;
  color: white;
  background: linear-gradient(135deg, #059669, #0891b2 58%, #2563eb);
  box-shadow: 0 13px 30px rgb(8 145 178 / .26);
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 17px 34px rgb(8 145 178 / .34); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.ghost-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}
.ghost-button:hover { border-color: var(--border-strong); background: var(--surface-2); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 82%, transparent));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}
.metric-card {
  position: relative;
  min-height: 128px;
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 16px 0 16px;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--accent, linear-gradient(90deg, var(--emerald), var(--cyan)));
  opacity: .8;
}
.metric-card .metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.metric-card .metric-value {
  margin-top: 11px;
  font-size: clamp(25px, 2.5vw, 36px);
  font-weight: 820;
  line-height: 1;
  letter-spacing: -.045em;
}
.metric-card .metric-detail {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.metric-card .metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--icon-color, var(--emerald));
  background: color-mix(in srgb, var(--icon-color, var(--emerald)) 13%, transparent);
}
.metric-card .metric-icon svg { width: 19px; height: 19px; }
.metric-card.skeleton {
  overflow: hidden;
}
.metric-card.skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / .12) 48%, transparent 72%);
  animation: shimmer 1.8s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "hosts side"
    "network side"
    "services side";
  gap: 14px;
  align-items: start;
}
.panel {
  border-radius: var(--radius-xl);
  padding: 20px;
  min-width: 0;
}
.hosts-panel { grid-area: hosts; }
.network-panel { grid-area: network; }
.services-panel { grid-area: services; }
.side-column {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}
.panel-note {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  padding-top: 3px;
}
.count-badge {
  min-width: 32px;
  height: 28px;
  justify-content: center;
  padding: 0 9px;
  color: var(--text);
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.host-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-3) 88%, transparent), color-mix(in srgb, var(--surface-2) 78%, transparent));
  overflow: hidden;
}
.host-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--status-color, var(--emerald)), transparent 72%);
}
.host-card.status-ok { --status-color: var(--emerald); }
.host-card.status-warning { --status-color: var(--amber); }
.host-card.status-critical,
.host-card.status-down { --status-color: var(--red); }
.host-card.status-planned { --status-color: color-mix(in srgb, var(--faint) 72%, transparent); }
.host-card.storage-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 15px 18px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--border) 72%, transparent);
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
  box-shadow: none;
}
.storage-card .host-name { color: var(--muted); }
.storage-card .host-ip { color: var(--faint); }
.storage-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.storage-avatar {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 48%, var(--surface-2)), color-mix(in srgb, var(--violet) 38%, var(--surface-2)));
  box-shadow: none;
  filter: saturate(.45);
  opacity: .72;
}
.storage-copy {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
}
.storage-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
}
.storage-metric {
  min-width: 82px;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 7px 9px;
  background: color-mix(in srgb, var(--surface-2) 38%, transparent);
  text-align: center;
  opacity: .78;
}
.storage-metric span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.storage-metric b {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}
.status-pill.planned {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 11%, transparent);
  border-color: color-mix(in srgb, var(--muted) 20%, transparent);
}
.host-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
}
.host-title {
  display: flex;
  align-items: center;
  gap: 11px;
}
.host-avatar {
  width: 43px;
  height: 43px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 850;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  box-shadow: 0 10px 26px rgb(8 145 178 / .24);
}
.host-card:nth-child(2) .host-avatar { background: linear-gradient(135deg, var(--amber), var(--violet)); }
.host-name { font-size: 17px; font-weight: 820; letter-spacing: -.025em; }
.host-ip { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.status-pill { padding: 6px 9px; text-transform: lowercase; }
.status-pill.ok { color: var(--emerald); background: var(--ok-bg); border-color: color-mix(in srgb, var(--emerald) 30%, transparent); }
.status-pill.warning { color: var(--amber); background: var(--warn-bg); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.status-pill.critical,
.status-pill.down { color: var(--red); background: var(--crit-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.host-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.host-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gauge-card {
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 11px;
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  text-align: center;
}
.gauge {
  --value: 0;
  --tone: var(--emerald);
  width: 74px;
  height: 74px;
  margin: 0 auto 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--surface-solid) 72%, transparent 73% 100%),
    conic-gradient(var(--tone) calc(var(--value) * 1%), color-mix(in srgb, var(--muted) 17%, transparent) 0);
}
.gauge b { font-size: 17px; letter-spacing: -.04em; }
.gauge-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gauge-sub {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
  min-height: 14px;
}
.host-network {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}
.net-tile {
  border-radius: 15px;
  padding: 10px 11px;
  background: color-mix(in srgb, var(--surface-2) 64%, transparent);
  border: 1px solid var(--border);
}
.net-tile span { display: block; color: var(--muted); font-size: 11px; }
.net-tile b { display: block; margin-top: 3px; font-size: 15px; letter-spacing: -.02em; }
.net-tile small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.25;
}
.traffic-quota {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 10px 11px;
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}
.traffic-quota-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.traffic-quota-head span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.traffic-quota-head b {
  color: var(--quota-tone, var(--emerald));
  font-size: 13px;
  white-space: nowrap;
}
.traffic-quota-bar {
  height: 7px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 17%, transparent);
}
.traffic-quota-bar i {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
}
.traffic-quota.estimated .traffic-quota-bar i { background: linear-gradient(90deg, var(--amber), var(--cyan)); }
.traffic-lanes {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}
.traffic-lane {
  display: grid;
  grid-template-columns: 82px 74px minmax(44px, 1fr) 42px;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
}
.traffic-lane-label {
  color: var(--muted);
  white-space: nowrap;
}
.traffic-lane b {
  color: var(--text);
  font-size: 10.5px;
  white-space: nowrap;
}
.traffic-lane-bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 17%, transparent);
}
.traffic-lane-bar i {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
}
.traffic-lane.rx .traffic-lane-bar i { background: var(--cyan); }
.traffic-lane.tx .traffic-lane-bar i { background: var(--violet); }
.traffic-lane.rx .traffic-lane-percent { color: var(--cyan); }
.traffic-lane.tx .traffic-lane-percent { color: var(--violet); }
.traffic-lane-percent {
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .traffic-lane {
    grid-template-columns: 72px 66px minmax(30px, 1fr) 38px;
    gap: 5px;
    font-size: 9.5px;
  }
  .traffic-lane b { font-size: 9.5px; }
}
.traffic-quota-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
}
.traffic-quota-split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
}
.traffic-quota-split b { color: var(--text); font-weight: 750; }
.traffic-quota-split em {
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.traffic-quota-note {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.host-error {
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  border-radius: 15px;
  background: var(--crit-bg);
  color: var(--red);
  padding: 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.network-panel { overflow: hidden; }
.time-series-heading { align-items: center; }
.range-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.range-btn {
  min-width: 43px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.range-btn:hover { color: var(--text); background: color-mix(in srgb, var(--surface-3) 70%, transparent); }
.range-btn.active {
  color: white;
  background: linear-gradient(135deg, #059669, #0891b2 62%, #2563eb);
  box-shadow: 0 8px 18px rgb(8 145 178 / .22);
}
.chart-block + .chart-block { margin-top: 14px; }
.chart-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 9px;
}
.chart-block-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 820;
  letter-spacing: -.01em;
}
.availability-chart-block {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.metrics-store-note {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  max-width: 560px;
  color: var(--muted);
  font-size: 11px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.legend-swatch {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 12px color-mix(in srgb, var(--swatch) 40%, transparent);
}
.network-chart-wrap {
  position: relative;
  height: 242px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 66%, transparent), color-mix(in srgb, var(--surface-3) 60%, transparent));
  overflow: hidden;
}
#network-chart,
#availability-chart {
  width: 100%;
  height: 100%;
  display: block;
}
.availability-chart-wrap { height: 302px; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--chart-empty);
  font-size: 12px;
  pointer-events: none;
}
.chart-empty.hidden { display: none; }

.services-heading { align-items: center; }
.service-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.service-controls input,
.service-controls select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}
.service-controls input {
  width: 210px;
  padding: 0 12px;
}
.service-controls select { padding: 0 34px 0 10px; }
.service-controls input:focus,
.service-controls select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

.service-group + .service-group { margin-top: 16px; }
.service-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.service-group-title span:last-child {
  color: var(--faint);
  letter-spacing: .02em;
  text-transform: none;
}
.service-table {
  border: 1px solid var(--border);
  border-radius: 19px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-3) 66%, transparent);
}
.service-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.7fr) 108px 92px minmax(130px, .8fr) minmax(122px, .8fr) minmax(86px, .45fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: 0; }
.service-row:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.service-row.status-critical { background: color-mix(in srgb, var(--red) 5%, transparent); }
.service-row.status-warning { background: color-mix(in srgb, var(--amber) 5%, transparent); }
.service-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}
.service-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--service-color, var(--cyan));
  background: color-mix(in srgb, var(--service-color, var(--cyan)) 12%, transparent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.service-title {
  flex: 1;
  min-width: 0;
}
.service-name {
  display: block;
  font-size: 13.5px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
  overflow-wrap: break-word;
  white-space: normal;
}
.service-status {
  justify-content: center;
  padding: 5px 7px;
  font-size: 11px;
}
.service-status.ok { color: var(--emerald); background: var(--ok-bg); border-color: color-mix(in srgb, var(--emerald) 26%, transparent); }
.service-status.warning { color: var(--amber); background: var(--warn-bg); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.service-status.critical { color: var(--red); background: var(--crit-bg); border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.service-metric {
  min-width: 0;
}
.service-metric .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.service-metric .value {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 730;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meter {
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 15%, transparent);
}
.meter i {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--meter-color, linear-gradient(90deg, var(--emerald), var(--cyan)));
}
.service-uptime {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}
.service-empty,
.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.alerts-list,
.probe-list,
.source-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.alert-item {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 11px;
  background: color-mix(in srgb, var(--surface-2) 66%, transparent);
}
.alert-strip {
  width: 8px;
  border-radius: 999px;
  background: var(--alert-color, var(--amber));
}
.alert-item.critical { --alert-color: var(--red); }
.alert-item.warning { --alert-color: var(--amber); }
.alert-item.info { --alert-color: var(--primary); }
.alert-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.alert-title { font-size: 12.5px; font-weight: 800; }
.alert-source {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.alert-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.alert-time {
  margin-top: 6px;
  color: var(--faint);
  font-size: 10.5px;
}
.good-state {
  border: 1px solid color-mix(in srgb, var(--emerald) 22%, transparent);
  border-radius: 16px;
  padding: 13px;
  background: var(--ok-bg);
  color: var(--emerald);
  font-size: 12.5px;
  font-weight: 700;
}

.probe-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 9px 1px;
}
.probe-item:last-child { border-bottom: 0; }
.probe-name { font-size: 12.5px; font-weight: 760; }
.probe-url {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.probe-status { padding: 4px 7px; font-size: 10.5px; }
.probe-status.ok { color: var(--emerald); background: var(--ok-bg); }
.probe-status.critical,
.probe-status.warning { color: var(--red); background: var(--crit-bg); }
.probe-latency {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.quota-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}
.quota-ring {
  --value: 0;
  width: 94px;
  height: 94px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(closest-side, var(--surface-solid) 72%, transparent 73%),
    conic-gradient(var(--cyan) calc(var(--value) * 1%), color-mix(in srgb, var(--muted) 16%, transparent) 0);
}
.quota-ring b { font-size: 19px; }
.quota-copy { min-width: 0; }
.quota-copy strong { display: block; font-size: 15px; }
.quota-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.systemd-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}
.systemd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
}
.systemd-row b { color: var(--text); font-weight: 720; }
.systemd-state { font-weight: 800; }
.systemd-state.active { color: var(--emerald); }
.systemd-state.inactive,
.systemd-state.failed { color: var(--red); }

.source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 8px 1px;
  font-size: 12px;
}
.source-row:last-child { border-bottom: 0; }
.source-row .muted { grid-column: 1 / -1; font-size: 10.5px; overflow-wrap: anywhere; }
.source-ok { color: var(--emerald); font-weight: 800; }
.source-fail { color: var(--red); font-weight: 800; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }

@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hosts"
      "network"
      "services"
      "side";
  }
  .side-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .host-grid { grid-template-columns: 1fr; }
  .service-row {
    grid-template-columns: minmax(190px, 1.5fr) 100px 82px minmax(110px, .8fr);
  }
  .service-row .service-net,
  .service-row .service-uptime { display: none; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 22px, 1760px); padding-top: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .summary-grid { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr; }
  .panel { padding: 15px; border-radius: 22px; }
  .host-stats { grid-template-columns: 1fr; }
  .host-card.storage-card { grid-template-columns: 1fr; align-items: start; }
  .storage-metrics { flex-wrap: wrap; }
  .service-controls { width: 100%; flex-direction: column; align-items: stretch; }
  .service-controls input { width: 100%; }
  .services-heading { align-items: stretch; flex-direction: column; }
  .service-row {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
  }
  .service-row .service-cpu,
  .service-row .service-memory { display: none; }
}
