:root {
  --sidebar-w: 240px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #fff;
  --topbar-h: 56px;
  --primary: #3b82f6;
}

* { box-sizing: border-box; }

body { margin: 0; font-family: 'Segoe UI', sans-serif; background: #f1f5f9; }

/* ── SIDEBAR ─────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  overflow-y: auto; z-index: 100;
  transition: transform .25s;
  display: flex; flex-direction: column;
}
.sidebar-header {
  padding: 18px 20px;
  font-size: 1.1rem; font-weight: 700;
  color: #fff; border-bottom: 1px solid #334155;
  display: flex; align-items: center;
}
.sidebar-menu { list-style: none; margin: 0; padding: 8px 0; }
.sidebar-menu li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: var(--sidebar-text);
  text-decoration: none; font-size: .875rem;
  transition: all .15s; border-left: 3px solid transparent;
}
.sidebar-menu li a:hover { color: #fff; background: #334155; }
.sidebar-menu li a.active { color: #fff; background: #334155; border-left-color: var(--primary); }
.sidebar-menu li a i { font-size: 1rem; width: 20px; }
.menu-section {
  padding: 14px 20px 4px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #475569;
}

/* ── MAIN CONTENT ────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── TOPBAR ──────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar h5 { color: #1e293b; font-weight: 600; font-size: .95rem; }
.sidebar-toggle { background: none; border: none; cursor: pointer; display: none; }

/* ── CONTENT AREA ────────────────── */
.content-area { flex: 1; }

/* ── STAT CARDS ──────────────────── */
.stat-card {
  border-radius: 12px; padding: 20px;
  color: #fff; position: relative; overflow: hidden;
}
.stat-card.blue   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-card.green  { background: linear-gradient(135deg, #10b981, #047857); }
.stat-card.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.teal   { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.stat-card.red    { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.stat-icon { font-size: 1.8rem; opacity: .7; margin-bottom: 8px; display: block; }
.stat-val  { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label{ font-size: .8rem; opacity: .85; margin-top: 4px; }

/* ── CARDS ───────────────────────── */
.card { border: none; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.card-header {
  background: #fff; border-bottom: 1px solid #f1f5f9;
  font-weight: 600; font-size: .9rem;
  border-radius: 12px 12px 0 0 !important; padding: 14px 18px;
}
.card-footer { background: #f8fafc; border-top: 1px solid #f1f5f9; padding: 10px 18px; }

/* ── TABLE ───────────────────────── */
.table thead th { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.table td { font-size: .875rem; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── AVATAR ──────────────────────── */
.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar-circle.small { width: 30px; height: 30px; font-size: .75rem; }

/* ── NO IMAGE ────────────────────── */
.no-img-sm {
  width: 45px; height: 45px; border-radius: 8px;
  background: #e2e8f0; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
}

/* ── LOGIN PAGE ──────────────────── */
.login-page { background: linear-gradient(135deg, #1e293b 0%, #334155 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-header { text-align: center; margin-bottom: 28px; }
.login-header i { font-size: 2.5rem; color: var(--primary); display: block; margin-bottom: 8px; }
.login-header h4 { margin: 0; font-weight: 700; color: #1e293b; }

/* ── FORM ────────────────────────── */
.form-label { font-size: .875rem; color: #374151; }
.form-control, .form-select { border-color: #e2e8f0; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.btn-primary { background: var(--primary); border-color: var(--primary); border-radius: 8px; font-weight: 500; }
.btn-primary:hover { background: #2563eb; border-color: #2563eb; }

/* ── ALERTS ──────────────────────── */
.alert { border: none; border-radius: 10px; font-size: .875rem; }

/* ── RESPONSIVE ──────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
}
