/* ─── CSS Variables (Dark Theme Default) ──────────────────────────────── */
:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #253452;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #1e3a5f;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-code: #7dd3fc;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.2);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.1);
  --sidebar-width: 240px;
  --header-height: 56px;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font-mono: 'Consolas', 'Courier New', monospace;
  --transition: all 0.2s ease;
  --grid-color: rgba(59, 130, 246, 0.05);
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --bg-input: #f8fafc;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-code: #0369a1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.08);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --info: #0891b2;
  --info-bg: rgba(8, 145, 178, 0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --grid-color: rgba(37, 99, 235, 0.04);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button { cursor: pointer; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Layout ────────────────────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}

.logo-text { font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.logo-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

.nav-section { padding: 8px 0; }
.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 16px 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
  font-size: 13px;
  user-select: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Main Content ──────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-breadcrumb { font-size: 12px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.cluster-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ─── Views ─────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.view-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.view-title i { color: var(--accent); }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 28px; font-weight: 700; font-family: var(--font-mono); }
.card-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Metric Grid ────────────────────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.metric-card.success::before { background: linear-gradient(90deg, var(--success), transparent); }
.metric-card.warning::before { background: linear-gradient(90deg, var(--warning), transparent); }
.metric-card.danger::before { background: linear-gradient(90deg, var(--danger), transparent); }
.metric-card.info::before { background: linear-gradient(90deg, var(--info), transparent); }

.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }
.metric-value { font-size: 32px; font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.metric-value.large { font-size: 36px; }
.metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.metric-icon {
  position: absolute; right: 14px; top: 14px;
  font-size: 20px; opacity: 0.15;
}

/* ─── Grid Layouts ───────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

.td-mono { font-family: var(--font-mono); font-size: 12px; }

/* ─── Status Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: var(--bg-hover);   color: var(--text-muted); }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.dot-success { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot-warning { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.dot-danger  { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }
.dot-muted   { background: var(--text-muted); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 12px var(--accent-glow); }

.btn-success {
  background: var(--success-bg); color: var(--success); border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: var(--success); color: #fff; }

.btn-danger {
  background: var(--danger-bg); color: var(--danger); border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }

.btn-warning {
  background: var(--warning-bg); color: var(--warning); border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) { background: var(--warning); color: #fff; }

.btn-outline {
  background: transparent; color: var(--text-secondary); border-color: var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); border-color: var(--text-secondary); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-icon { padding: 6px 8px; }

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-input { width: 100%; }
.form-hint { font-size: 11px; color: var(--text-muted); }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-section { margin-bottom: 20px; }
.form-section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
.progress-bar {
  height: 4px; background: var(--bg-hover); border-radius: 2px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* ─── Log Viewer ─────────────────────────────────────────────────────────── */
.log-viewer {
  background: #050a14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-y: auto;
  height: 500px;
  padding: 12px;
}
[data-theme="light"] .log-viewer { background: #1e293b; }

.log-line { display: flex; gap: 10px; padding: 1px 0; }
.log-line:hover { background: rgba(255,255,255,0.03); }
.log-node { color: var(--accent); min-width: 80px; flex-shrink: 0; }
.log-level-error { color: var(--danger); }
.log-level-warning { color: var(--warning); }
.log-level-info { color: #94a3b8; }
.log-msg { color: #d1d5db; word-break: break-all; }
[data-theme="light"] .log-msg { color: #e2e8f0; }

/* ─── Terminal Output ────────────────────────────────────────────────────── */
.terminal {
  background: #050a14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 14px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #a3e635;
}
[data-theme="light"] .terminal { background: #1e293b; }

/* ─── Step Result List ───────────────────────────────────────────────────── */
.step-list { display: flex; flex-direction: column; gap: 6px; }
.step-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.step-item.ok { border-left: 3px solid var(--success); }
.step-item.fail { border-left: 3px solid var(--danger); }
.step-item i { flex-shrink: 0; width: 14px; }
.step-label { flex: 1; }
.step-msg { color: var(--text-muted); font-size: 11px; font-family: var(--font-mono); }

/* ─── Topology ───────────────────────────────────────────────────────────── */
.topology-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.topology-svg {
  width: 100%;
  min-height: 400px;
  display: block;
}

/* ─── Heartbeat ──────────────────────────────────────────────────────────── */
.heartbeat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px 80px 80px 100px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}
.heartbeat-row:hover { background: var(--bg-hover); }
.latency-bar {
  height: 3px; background: var(--bg-hover); border-radius: 2px;
  margin-top: 4px; overflow: hidden;
}
.latency-fill { height: 100%; border-radius: 2px; background: var(--success); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal.modal-lg { max-width: 800px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; line-height: 1; padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─── Init Phase Labels ──────────────────────────────────────────────────── */
.phase-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 5px 0 5px 10px;
  margin: 12px 0 6px; border-left: 3px solid;
  display: flex; align-items: center; gap: 6px;
}
.phase-label-1 { border-color: var(--accent); color: var(--accent); }
.phase-label-2 { border-color: var(--success); color: var(--success); }

.phase-wait {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin: 8px 0;
  background: var(--info-bg); border: 1px solid var(--info);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--info);
}

/* ─── Alerts / Notifications ─────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 12px;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info); }

/* ─── Toast Notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
  border-left: 3px solid var(--accent);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.toast-msg { flex: 1; line-height: 1.5; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 14px; flex-shrink: 0; padding: 0 2px; }
.toast-close:hover { color: var(--text-primary); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Theme Toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─── Code / Pre ─────────────────────────────────────────────────────────── */
pre, code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
pre { padding: 12px; overflow-x: auto; white-space: pre; line-height: 1.7; }
code { padding: 1px 5px; }

.conf-editor {
  width: 100%;
  min-height: 280px;
  background: #050a14;
  color: #a3e635;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
}
[data-theme="light"] .conf-editor { background: #1e293b; color: #a3e635; }

/* ─── Node Detail Panel ──────────────────────────────────────────────────── */
.node-detail-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.node-avatar {
  width: 44px; height: 44px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--accent);
  flex-shrink: 0;
}
.node-name-large { font-size: 18px; font-weight: 700; }
.node-ip-large { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }

/* ─── Stats Row ──────────────────────────────────────────────────────────── */
.stat-row {
  display: flex; gap: 16px; margin-bottom: 16px;
  flex-wrap: wrap;
}
.stat-item {
  flex: 1; min-width: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
}
.stat-val { font-size: 22px; font-weight: 700; font-family: var(--font-mono); }
.stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
  min-height: 200px; color: var(--text-muted);
}

/* ─── Misc ───────────────────────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-muted   { color: var(--text-muted); }
.text-mono    { font-family: var(--font-mono); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 700; }
.fw-600       { font-weight: 600; }
.fs-12        { font-size: 12px; }
.fs-11        { font-size: 11px; }
.mb-8         { margin-bottom: 8px; }
.mb-12        { margin-bottom: 12px; }
.mb-16        { margin-bottom: 16px; }
.mb-20        { margin-bottom: 20px; }
.mt-12        { margin-top: 12px; }
.mt-16        { margin-top: 16px; }
.mt-20        { margin-top: 20px; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.flex-1       { flex: 1; }
.hidden       { display: none !important; }

.separator {
  height: 1px; background: var(--border);
  margin: 16px 0;
}

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; opacity: 0.3; }
.empty-state p { font-size: 14px; }

.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 1px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── Chart Container ────────────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 180px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-width: 56px; }
  .nav-item span, .nav-section-label, .logo-text, .logo-sub, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item i { width: auto; }
  .logo-icon { margin: 0 auto; }
  .sidebar-logo { justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .heartbeat-row { grid-template-columns: 1fr 1fr; }
}
