:root {
  --sidebar-width: 230px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #fff;
  --topbar-height: 56px;
}

body {
  background: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.sidebar .nav-link.active {
  background: rgba(255,255,255,0.12);
  color: var(--sidebar-active);
  font-weight: 600;
}

.sidebar hr {
  border-color: rgba(255,255,255,0.1);
}

/* Topbar */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: var(--topbar-height);
}

/* Page content */
.page-content {
  min-height: 100vh;
  background: #f1f5f9;
}

/* Stat cards */
.stat-card {
  border-radius: 12px;
  background: #fff;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-icon {
  font-size: 2rem;
  opacity: 0.2;
}

/* Cards */
.card {
  border-radius: 12px;
}

.card-header {
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px 12px 0 0 !important;
}

/* Tables */
.table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.table td {
  font-size: 0.875rem;
  vertical-align: middle;
}

/* Tiny button */
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  border-radius: 4px;
}

/* Badge */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3em 0.6em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Dark Mode ─────────────────────────────────────────────────────────────── */
[data-bs-theme="dark"] body {
  background: #0f172a;
}

[data-bs-theme="dark"] .page-content {
  background: #0f172a;
}

[data-bs-theme="dark"] .topbar {
  background: #1e293b;
  border-bottom-color: #334155;
}

[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .card {
  background: #1e293b;
  border-color: #334155;
}

[data-bs-theme="dark"] .card-header {
  background: #1e293b !important;
  border-bottom-color: #334155;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .stat-label {
  color: #94a3b8;
}

[data-bs-theme="dark"] .table th {
  color: #94a3b8;
}

[data-bs-theme="dark"] .table td {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .list-group-item {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background: #0f172a;
  border-color: #3b82f6;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.25);
}

[data-bs-theme="dark"] .form-control[readonly] {
  background: #1e293b;
}

[data-bs-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
}
