:root {
  --bg: #0a0f14;
  --surface: #121a24;
  --surface2: #1c2836;
  --text: #e8eef5;
  --muted: #8a9bb3;
  --accent: #14b8a6;
  --accent2: #6366f1;
  --danger: #f43f5e;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid #243044;
  padding: 1rem 0;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: 0 1.25rem 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}
.nav-item {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--muted);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.nav-item.active, .nav-item:hover { color: var(--text); background: var(--surface2); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #243044;
  background: var(--surface);
}
.header .meta { color: var(--muted); font-size: 0.85rem; }

.content { padding: 1.25rem 1.5rem; flex: 1; overflow: auto; }

.login-box {
  max-width: 400px;
  margin: 10vh auto;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid #243044;
}
.login-box h1 { margin: 0 0 0.35rem; font-size: 1.5rem; color: var(--accent); }
.muted { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.login-box label { display: block; margin-top: 1rem; font-size: 0.85rem; }
.login-box input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #334155;
  background: var(--surface2);
  color: var(--text);
}
button, .btn-link {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  border: 1px solid #334155;
}
button.primary {
  background: linear-gradient(135deg, var(--accent), #0d9488);
  border-color: transparent;
  color: #042f2e;
  font-weight: 600;
}
button.secondary { background: var(--surface2); color: var(--text); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.metric-card {
  background: var(--surface);
  border: 1px solid #243044;
  border-radius: var(--radius);
  padding: 1rem;
}
.metric-card .val { font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.metric-card .lbl { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.panel {
  background: var(--surface);
  border: 1px solid #243044;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.panel h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #243044;
  font-size: 0.85rem;
}
.list-row:last-child { border-bottom: none; }

.external-links { margin-top: 1.5rem; font-size: 0.85rem; }
.external-links a { color: var(--accent); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 1px solid #334155;
  border-radius: 8px;
  z-index: 100;
}
.toast.error { border-color: var(--danger); color: #fecdd3; }

@media (max-width: 768px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; padding: 0.5rem; }
  .sidebar .brand { width: 100%; }
}
