:root {
  --bg-canvas: #090c11;
  --bg-surface: #10151f;
  --bg-elevated: #161d2b;
  --bg-input: #0b0f17;
  --border-subtle: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-cyan-dim: rgba(56, 189, 248, 0.14);
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.14);
  --accent-indigo: #818cf8;
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.14);
  --accent-rose: #f43f5e;
  --accent-rose-dim: rgba(244, 63, 94, 0.14);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, Menlo, "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }
.text-muted { color: var(--text-muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent-cyan);
  color: #06131f;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #67d0fc; }

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
  background: #1d2638;
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.btn-danger-soft {
  background: var(--accent-rose-dim);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fda4af;
}
.btn-danger-soft:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.24);
  color: #fff;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* ---- Login Screen ---- */
.login-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.login-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(640px 380px at 50% 18%, rgba(56, 189, 248, 0.1), transparent 70%),
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  padding: 32px 28px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(145deg, #162235, #0c121d);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.login-heading {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.login-desc {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--text-secondary);
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.field input, .field select, .select-input, .search-box input, .inline-search {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .select-input:focus, .search-box input:focus, .inline-search:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}
.field-row {
  display: flex;
  gap: 8px;
}
.field-row input { flex: 1; }
.form-error {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--accent-rose-dim);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
  font-size: 12px;
}
.login-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- App Shell ---- */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: #0c1018;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 30;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 14px;
}
.node-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.node-pill-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 12px;
}
.node-pill-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-live {
  background: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}
.dot-warn {
  background: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}
.dot-dead {
  background: var(--accent-rose);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.nav-item:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-cyan-dim);
  border-color: rgba(56, 189, 248, 0.24);
  color: var(--accent-cyan);
}
.nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
  font-size: 11px;
}
.nav-item.active .nav-badge {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.account-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.account-role { font-size: 11px; color: var(--text-muted); }
.account-actions {
  display: flex;
  gap: 6px;
}
.account-actions .btn { flex: 1; }

/* ---- Main Area ---- */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 64px;
  flex-shrink: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 12, 17, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.page-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}
.page-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 32px;
}

/* ---- KPI & Panels ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.rate-down { color: var(--accent-emerald); }
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sep { opacity: 0.4; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
}
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.panel-table { padding: 0; overflow: hidden; }
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 16px;
}
.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.panel-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Traffic Chart ---- */
.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  color: var(--text-secondary);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.swatch-down { background: var(--accent-emerald); }
.swatch-up { background: var(--accent-cyan); }
.legend-peak {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
.chart-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 6px 2px;
  height: 224px;
}
.traffic-chart {
  width: 100%;
  height: 100%;
  display: block;
}
.chart-grid line {
  stroke: rgba(148, 163, 184, 0.08);
  stroke-dasharray: 3 4;
}
.svc-control-strip {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.svc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.svc-meta strong { color: var(--text-primary); font-weight: 500; }
.svc-buttons { display: flex; gap: 6px; }

/* ---- Meters & Certs ---- */
.meter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meter-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.meter-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}
.fill-cyan { background: var(--accent-cyan); }
.fill-emerald { background: var(--accent-emerald); }
.fill-indigo { background: var(--accent-indigo); }
.load-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 2px;
}
.load-row strong { color: var(--text-primary); font-weight: 500; }
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cert-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cert-domain { font-size: 13px; font-weight: 600; }
.cert-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-emerald { background: var(--accent-emerald-dim); color: #34d399; }
.badge-amber { background: var(--accent-amber-dim); color: #fbbf24; }
.badge-rose { background: var(--accent-rose-dim); color: #fb7185; }
.badge-slate { background: rgba(148, 163, 184, 0.14); color: var(--text-secondary); }

/* ---- Toolbar & Tables ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar-info { font-size: 12px; color: var(--text-secondary); }
.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.search-box { flex: 1; min-width: 220px; max-width: 380px; }
.inline-search { width: 200px; height: 32px; }
.select-input { width: auto; height: 32px; padding-right: 26px; }
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(148, 163, 184, 0.04); }
.col-right { text-align: right !important; }
.empty-cell {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--text-muted);
}
.pw-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pw-mask {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}
.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ---- Config & Backups ---- */
.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 16px;
}
.cfg-status {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: pre-wrap;
}
.cfg-status.ok {
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
}
.cfg-status.err {
  background: var(--accent-rose-dim);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
}
.code-editor {
  width: 100%;
  min-height: 460px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}
.code-editor:focus { border-color: var(--accent-cyan); }
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}
.backup-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.backup-name {
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
}
.backup-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Logs ---- */
.panel-logs { padding: 0; overflow: hidden; }
.log-viewer {
  margin: 0;
  padding: 16px;
  min-height: 500px;
  max-height: calc(100vh - 200px);
  overflow: auto;
  background: #070a0f;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-line-err { color: #fb7185; }
.log-line-warn { color: #fbbf24; }
.log-line-ok { color: #34d399; }

/* ---- Drawer & Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 11, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
#drawer-backdrop { justify-content: flex-end; align-items: stretch; }
.drawer {
  width: 100%;
  max-width: 470px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer-header, .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.tab-btn {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
}
.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.qr-box {
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  line-height: 0;
}
.qr-caption {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.code-preview {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  margin: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-body {
  padding: 18px 20px 20px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ---- Toast ---- */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}
.toast {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  max-width: 360px;
}
.toast-ok { border-left: 3px solid var(--accent-emerald); }
.toast-err { border-left: 3px solid var(--accent-rose); }

/* ---- Responsive ---- */
.mobile-only { display: none; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 25;
}

@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid, .config-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar {
    min-height: 60px;
    height: auto;
    padding: 10px 14px;
  }
  .page-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }
  .content-scroll { padding: 16px 14px 28px; }
  .service-pill { display: none; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
