:root {
  --brand-primary: #1a3c5e;
  --brand-accent:  #2563eb;
  --sidebar-width: 240px;
  --topbar-height: 56px;
}

/* ── Auth pages ───────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, #1a3c5e 0%, #2563eb 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.brand-icon {
  width: 64px;
  height: 64px;
  background: var(--brand-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 28px;
  color: #fff;
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 4px;
}

/* ── Layout ───────────────────────────────────── */
body {
  background: #f0f4f8;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#wrapper {
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 20px 20px;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  min-height: var(--topbar-height);
}

.sidebar-brand i { font-size: 22px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

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

.sidebar-nav .nav-item.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-left-color: #60a5fa;
  font-weight: 600;
}

.sidebar-nav .nav-item i { font-size: 16px; min-width: 20px; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ── Main content ─────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin .25s ease;
}

.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.content-area {
  padding: 24px;
  flex: 1;
}

/* ── Cards & Stats ────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid transparent;
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }

.stat-card.blue   { border-left-color: #2563eb; }
.stat-card.blue   .stat-icon { background: #dbeafe; color: #2563eb; }
.stat-card.green  { border-left-color: #16a34a; }
.stat-card.green  .stat-icon { background: #dcfce7; color: #16a34a; }
.stat-card.yellow { border-left-color: #d97706; }
.stat-card.yellow .stat-icon { background: #fef3c7; color: #d97706; }
.stat-card.red    { border-left-color: #dc2626; }
.stat-card.red    .stat-icon { background: #fee2e2; color: #dc2626; }
.stat-card.purple { border-left-color: #7c3aed; }
.stat-card.purple .stat-icon { background: #ede9fe; color: #7c3aed; }

/* ── Page card ────────────────────────────────── */
.page-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
}

.page-card .card-header-custom {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.page-card .card-header-custom h5 {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-primary);
}

.page-card .card-body-custom { padding: 20px; }

/* ── Tables ───────────────────────────────────── */
.table th {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.table td { vertical-align: middle; font-size: 14px; }

/* ── Form ─────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; color: #374151; }
.section-title { font-size: 13px; font-weight: 700; color: var(--brand-primary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .content-area {
    padding: 16px;
  }
}

/* ── Utilities ────────────────────────────────── */
.text-brand { color: var(--brand-primary); }
.bg-brand { background: var(--brand-primary); }
.btn-brand { background: var(--brand-primary); color: #fff; border: none; }
.btn-brand:hover { background: #14304e; color: #fff; }
.page-title { font-size: 22px; font-weight: 700; color: var(--brand-primary); margin-bottom: 20px; }
