:root {
  --bg:      #0b0f1a;
  --surface: #161b2e;
  --border:  #1e2537;
  --primary: #89b4fa;
  --text:    #cdd6f4;
  --muted:   #6c7086;
  --green:   #a6e3a1;
  --red:     #f38ba8;
  --yellow:  #f9e2af;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Layout ── */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #11151f;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
}

.brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar nav {
  flex: 1;
  padding: 16px 10px;
}

.nav-section {
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px;
  margin: 16px 0 6px;
}

.nav-section:first-child { margin-top: 0; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  margin-bottom: 1px;
  transition: background 0.12s, color 0.12s;
}

.sidebar nav a:hover {
  background: rgba(137, 180, 250, 0.08);
  color: var(--text);
}

.sidebar nav a.active {
  background: rgba(137, 180, 250, 0.12);
  color: var(--primary);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
}

.sidebar-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
}

.sidebar-footer a:hover { color: var(--text); }

/* ── Main area ── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 54px;
  border-bottom: 1px solid var(--border);
  background: #11151f;
  display: flex;
  align-items: center;
  padding: 0 24px;
  flex-shrink: 0;
  justify-content: space-between;
}

.page-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-right {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
}

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

/* ── Stat cards ── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.card-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.card-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Status indicators ── */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.dot-green  { background: var(--green); }
.dot-red    { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-muted  { background: var(--muted); }

/* ── Section title ── */

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  font-size: 0.83rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.empty-state p { margin-top: 8px; font-size: 0.75rem; }

/* ── Table ── */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: rgba(137, 180, 250, 0.03); }

/* ── Badges ── */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
}

.badge-green  { background: rgba(166,227,161,0.15); color: var(--green); }
.badge-red    { background: rgba(243,139,168,0.15); color: var(--red); }
.badge-yellow { background: rgba(249,226,175,0.15); color: var(--yellow); }
.badge-blue   { background: rgba(137,180,250,0.15); color: var(--primary); }
.badge-muted  { background: rgba(108,112,134,0.15); color: var(--muted); }

/* ── Alerts ── */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.alert-success { background: rgba(166,227,161,0.10); border: 1px solid rgba(166,227,161,0.25); color: var(--green); }
.alert-warning { background: rgba(249,226,175,0.10); border: 1px solid rgba(249,226,175,0.25); color: var(--yellow); }
.alert-danger  { background: rgba(243,139,168,0.10); border: 1px solid rgba(243,139,168,0.25); color: var(--red); }

/* ── Forms ── */

.form-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  max-width: 520px;
}

.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.83rem;
}

input:focus { outline: none; border-color: var(--primary); }

.btn {
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s;
}

.btn:hover { opacity: 0.84; }

.btn-primary { background: var(--primary); color: #0b0f1a; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* ── Utility ── */

.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.text-muted   { color: var(--muted); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-primary { color: var(--primary); }
