/* ============================================================
   public/css/style.css  –  Attendance Management System
   Theme: Clean Professional Light + Deep Navy Sidebar
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  /* Primary palette */
  --primary:        #1a56db;
  --primary-dark:   #1e429f;
  --primary-light:  #ebf5ff;
  --primary-glow:   rgba(26, 86, 219, 0.15);

  /* Sidebar */
  --sidebar-bg:     #0f172a;
  --sidebar-hover:  #1e293b;
  --sidebar-active: #1a56db;
  --sidebar-text:   #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-width:  260px;
  --sidebar-collapsed: 72px;

  /* Surface */
  --bg-body:        #f1f5f9;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8fafc;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-white:     #ffffff;

  /* Status colours */
  --success:        #10b981;
  --success-light:  #d1fae5;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --info:           #06b6d4;
  --info-light:     #cffafe;
  --late:           #f59e0b;
  --late-light:     #fef3c7;

  /* Misc */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
  --font:       'Plus Jakarta Sans', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --topbar-h:   64px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ── Layout Shell ─────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}

.sidebar-brand-name {
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.sidebar-brand-sub {
  font-size: .68rem;
  color: var(--sidebar-text);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

.nav-section-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #334155;
  padding: 14px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item { margin: 2px 10px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #cbd5e1;
}

.nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: 0 2px 8px rgba(26,86,219,.35);
}

.nav-link .nav-icon {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: default;
}

.sidebar-user:hover { background: var(--sidebar-hover); }

.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1e293b;
  flex-shrink: 0;
}

.sidebar-user-avatar-placeholder {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; white-space: nowrap; }
.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .68rem;
  color: var(--sidebar-text);
  text-transform: capitalize;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  line-height: 1;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.topbar-toggle:hover { background: var(--border-light); color: var(--primary); }

.topbar-breadcrumb {
  flex: 1;
  font-size: .82rem;
  color: var(--text-muted);
}
.topbar-breadcrumb strong { color: var(--text-primary); font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: .95rem;
  text-decoration: none;
  position: relative;
}
.topbar-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.topbar-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.topbar-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.topbar-avatar-btn:hover { background: var(--primary-light); border-color: var(--primary); }

.topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.topbar-avatar-placeholder {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
}

.topbar-username {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Dropdown */
.dropdown { position: relative; }

.dropdown-menu-custom {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 6px;
  z-index: 999;
  display: none;
  animation: dropIn .18s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-menu-custom.show { display: block; }

.dropdown-item-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-decoration: none;
}
.dropdown-item-custom:hover { background: var(--bg-body); color: var(--primary); }
.dropdown-item-custom.danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider-custom { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
  line-height: 1.25;
}

.page-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header-custom {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-custom {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body-custom { padding: 22px; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-accent, var(--primary));
  border-radius: 3px 3px 0 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: var(--stat-icon-bg, var(--primary-light));
  color: var(--stat-accent, var(--primary));
}

.stat-content { flex: 1; min-width: 0; }

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stat-change {
  font-size: .75rem;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Color variants */
.stat-card.success { --stat-accent: var(--success); --stat-icon-bg: var(--success-light); }
.stat-card.warning { --stat-accent: var(--warning); --stat-icon-bg: var(--warning-light); }
.stat-card.danger  { --stat-accent: var(--danger);  --stat-icon-bg: var(--danger-light); }
.stat-card.info    { --stat-accent: var(--info);    --stat-icon-bg: var(--info-light); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}

.data-table thead tr {
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 12px 16px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr:hover td { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger  { background: var(--danger-light);  color: #b91c1c; }
.badge-info    { background: var(--info-light);    color: #0891b2; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: var(--border-light); color: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,86,219,.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26,86,219,.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-body); border-color: var(--primary); color: var(--primary); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .77rem; border-radius: 5px; }
.btn-lg { padding: 13px 28px; font-size: .9rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-sm); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition);
  font-family: var(--font);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 36px; }

.form-hint { font-size: .73rem; color: var(--text-muted); margin-top: 5px; }

.form-error { font-size: .73rem; color: var(--danger); margin-top: 5px; }
.form-control.is-invalid { border-color: var(--danger); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: .83rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--info-light);    color: #164e63; border-left: 4px solid var(--info); }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-placeholder {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--primary);
}

.avatar-sm, .avatar-placeholder.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-md, .avatar-placeholder.md { width: 40px; height: 40px; font-size: .85rem; }
.avatar-lg, .avatar-placeholder.lg { width: 52px; height: 52px; font-size: 1rem; }

/* ── User Cell ────────────────────────────────────────────── */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-cell-name  { font-size: .85rem; font-weight: 600; color: var(--text-primary); }
.user-cell-email { font-size: .75rem; color: var(--text-muted); }

/* ── Login Page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-body);
}

.auth-left {
  flex: 1;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(26,86,219,.12);
  top: -150px; right: -100px;
  pointer-events: none;
}

.auth-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(26,86,219,.08);
  bottom: -80px; left: -80px;
  pointer-events: none;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 1;
  text-align: center;
}

.auth-brand-logo {
  width: 72px; height: 72px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 8px 32px rgba(26,86,219,.4);
}

.auth-brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}

.auth-brand-tagline {
  font-size: .88rem;
  color: #64748b;
  max-width: 300px;
  line-height: 1.6;
}

.auth-features {
  margin-top: 48px;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
}

.auth-feature-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(26,86,219,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.auth-feature-text { font-size: .8rem; color: #94a3b8; font-weight: 500; }
.auth-feature-title { font-size: .83rem; color: #e2e8f0; font-weight: 600; }

.auth-right {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: var(--bg-card);
}

.auth-form-wrapper { width: 100%; max-width: 380px; }

.auth-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.025em;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.auth-form .form-control {
  padding: 12px 16px;
  font-size: .87rem;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  font-size: .9rem;
  margin-top: 8px;
}

.auth-footer {
  margin-top: 28px;
  text-align: center;
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Overlay (mobile sidebar) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-state-text { font-size: .9rem; font-weight: 500; }

/* ── Utility ──────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .8rem; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .form-row   { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .stat-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }

  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .sidebar-overlay.show { opacity: 1; pointer-events: all; }

  .main-content { margin-left: 0 !important; }

  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 40px 28px; }

  .page-content { padding: 20px 16px 32px; }

  .stat-grid { grid-template-columns: 1fr 1fr; }

  .topbar { padding: 0 16px; }

  .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
}

/* ── Scrollbar global ─────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }