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

:root {
  --sidebar-w: 230px;
  --bg-base: #0d1117;
  --bg-card: #161b22;
  --bg-hover: #1f2937;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-muted: #8b949e;
  --accent: #1f6feb;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --blue: #79c0ff;
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ── */
body { display: flex; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #010409;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 24px 28px;
  overflow-x: hidden;
}

/* ── Sidebar brand ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.brand-icon { font-size: 1.3rem; }

/* ── Navigation ── */
.nav-list { list-style: none; padding: 10px 0; flex: 1; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s;
  font-size: 0.9rem;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active {
  color: var(--blue);
  border-left-color: var(--accent);
  background: rgba(31,111,235,0.08);
}
.nav-icon { font-size: 1rem; }

/* ── Sidebar footer (connection status) ── */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.conn-dot { font-size: 1rem; }
.conn-dot.connected { color: var(--green); }
.conn-dot.disconnected { color: var(--red); }
.conn-dot.connecting { color: var(--yellow); }

/* ── Page header ── */
.page-header { margin-bottom: 20px; }
.page-title { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.page-caption { color: var(--text-muted); margin-top: 4px; font-size: 0.875rem; }
.page-caption code {
  background: rgba(110,118,129,0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--blue);
  font-size: 0.85em;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.warn { background: rgba(210,153,34,0.2); color: var(--yellow); }
.badge.error { background: rgba(248,81,73,0.2); color: var(--red); }

/* ── Section title ── */
.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ── Stat cards (mini metrics) ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-top: 4px; font-family: monospace; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead {
  background: var(--bg-card);
  position: sticky; top: 0; z-index: 1;
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-hover); }
.data-table td.loading { color: var(--text-muted); text-align: center; padding: 24px; }
.data-table code { font-family: monospace; font-size: 0.82em; color: var(--blue); }

/* ── Misc ── */
.muted-text { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 12px; }
