:root {
  --brand: #4361ee;
  --brand-dark: #3a0ca3;
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

body {
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f4f6fb;
}

[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] body {
  background: #10131a;
}

.app-wrapper { min-height: 100vh; }

/* ---------- Topbar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  height: var(--topbar-height);
  z-index: 1030;
}
[data-bs-theme="dark"] .topbar { background: #161a23; border-color: rgba(255,255,255,.06); }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-height: calc(100vh - var(--topbar-height));
  background: #fff;
  border-right: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
  transition: transform .25s ease;
}
[data-bs-theme="dark"] .sidebar { background: #161a23; border-color: rgba(255,255,255,.06); }

.sidebar .nav-link {
  color: #495057;
  padding: .65rem 1.25rem;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .93rem;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; }
.sidebar .nav-link:hover { background: rgba(67,97,238,.08); color: var(--brand); }
.sidebar .nav-link.active {
  background: rgba(67,97,238,.12);
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}
[data-bs-theme="dark"] .sidebar .nav-link { color: #c8ccd6; }

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    transform: translateX(-100%);
    z-index: 1029;
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
  }
  .sidebar.show { transform: translateX(0); }
}

.content-area { min-width: 0; }

/* ---------- Cards ---------- */
.stat-card {
  border: none;
  border-radius: .9rem;
  color: #fff;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.stat-card i.bg-icon { position: absolute; right: -10px; bottom: -10px; font-size: 4.5rem; opacity: .18; }
.stat-card .stat-label { font-size: .8rem; opacity: .9; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }

.bg-grad-blue   { background: linear-gradient(135deg, #4361ee, #3a0ca3); }
.bg-grad-green  { background: linear-gradient(135deg, #2ec4b6, #06923e); }
.bg-grad-red    { background: linear-gradient(135deg, #f72585, #b5179e); }
.bg-grad-orange { background: linear-gradient(135deg, #f8961e, #f3722c); }
.bg-grad-purple { background: linear-gradient(135deg, #7209b7, #560bad); }
.bg-grad-teal   { background: linear-gradient(135deg, #0096c7, #0077b6); }

.card { border: none; border-radius: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
[data-bs-theme="dark"] .card { background: #161a23; box-shadow: 0 2px 10px rgba(0,0,0,.3); }

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
}
.auth-card { width: 100%; max-width: 400px; border-radius: 1rem; }

.badge-category { font-weight: 500; }

.table-responsive { border-radius: .6rem; overflow: hidden; }

.progress { height: .6rem; border-radius: 1rem; }

@media print {
  .no-print { display: none !important; }
}
