/* ═══════════════════════════════════════════════════════════════════════════
   4Naple Academy — Admin Panel Premium Design System
   Dark/Light Theme via CSS Custom Properties
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Theme: Dark Mode (default) ─────────────────────────────────────────── */
:root {
  --bg-page: #080c1a;
  --bg-sidebar: #0b1023;
  --bg-navbar: #0b1023;
  --bg-card: #111827;
  --bg-card-hover: #161f35;
  --bg-input: #1a2340;
  --bg-input-hover: #1f2b4d;
  --bg-table: #111827;
  --bg-table-hover: #161f35;
  --bg-table-stripe: #0f1628;
  --bg-modal: #111827;
  --bg-badge: #1a2340;
  --bg-tooltip: #1a2340;
  --bg-alert-success: rgba(0, 201, 141, 0.12);
  --bg-alert-error: rgba(255, 94, 156, 0.12);
  --bg-alert-warning: rgba(249, 168, 38, 0.12);
  --bg-glass: rgba(17, 24, 39, 0.7);

  --text-primary: #e8edf5;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #080c1a;

  --border: #1e2a4a;
  --border-light: #1a2340;
  --border-accent: #d62828;

  --accent: #d62828;
  --accent-hover: #b71c1c;
  --accent-subtle: rgba(214, 40, 40, 0.1);
  --accent-glow: rgba(214, 40, 40, 0.25);
  --accent-cyan: #00d4ff;
  --accent-violet: #7c5cfc;
  --accent-green: #2f9e44;
  --accent-orange: #f9a826;
  --accent-magenta: #ff5e9c;
  --accent-red: #ff4757;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(214, 40, 40, 0.15);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

  --sidebar-width: 260px;
  --navbar-height: 64px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ── Theme: Light Mode ──────────────────────────────────────────────────── */
html.light {
  --bg-page: #f1f4f9;
  --bg-sidebar: #ffffff;
  --bg-navbar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faff;
  --bg-input: #f1f4f9;
  --bg-input-hover: #e8ecf3;
  --bg-table: #ffffff;
  --bg-table-hover: #f0f4ff;
  --bg-table-stripe: #f8faff;
  --bg-modal: #ffffff;
  --bg-badge: #e8ecf3;
  --bg-tooltip: #1a1a2e;
  --bg-alert-success: #e8faf3;
  --bg-alert-error: #fff0f3;
  --bg-alert-warning: #fff8ed;
  --bg-glass: rgba(255, 255, 255, 0.8);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f4f9;
  --border-accent: #4f7cff;

  --accent: #d62828;
  --accent-hover: #b71c1c;
  --accent-subtle: rgba(214, 40, 40, 0.08);
  --accent-glow: rgba(214, 40, 40, 0.12);
  --accent-cyan: #00b8d4;
  --accent-violet: #7c5cfc;
  --accent-green: #2f9e44;
  --accent-orange: #e8961a;
  --accent-magenta: #e84a8a;
  --accent-red: #e63946;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(214, 40, 40, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  transition: background var(--transition-base), color var(--transition-base);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); text-decoration: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Premium Desktop & Mobile Drawer
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), background var(--transition-base);
  overflow: hidden;
}

/* ── Fix sidebar scroll — only nav scrolls, brand/footer stay ────────── */
.sidebar { overflow: hidden; }
.sidebar-nav { overflow-y: auto; overflow-x: hidden; }

/* ── Brand / Logo ─────────────────────────────────────────────────────── */
.sidebar-brand {
  flex-shrink: 0;
  padding: 1.1rem 1.15rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.sidebar-logo:hover { text-decoration: none; }
.sidebar-logo-icon {
  display: flex;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  border-radius: var(--radius-sm);
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1;
}
.sidebar-logo-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  line-height: 1.2;
  margin-left: auto;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.65rem 0.75rem;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }

.nav-group-label {
  padding: 0.7rem 0.7rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
  text-decoration: none;
}
.nav-item.active {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.65rem;
  top: 50%; transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.nav-item svg { flex-shrink: 0; }
.nav-item .notif-badge { margin-left: auto; }

/* ── Profile Footer ────────────────────────────────────────────────────── */
.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.7rem 0.85rem;
  background: var(--bg-sidebar);
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.sidebar-profile-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-sidebar), 0 0 0 3px var(--border);
}
.sidebar-profile-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.sidebar-profile-initial {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.sidebar-profile-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-profile-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-role {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 0.08rem 0.4rem;
  border-radius: var(--radius-xs);
  width: fit-content;
}
.sidebar-profile-logout {
  color: var(--text-muted);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.sidebar-profile-logout:hover {
  color: var(--accent-red);
  background: rgba(255, 71, 87, 0.08);
  text-decoration: none;
}

/* ── Sidebar theme toggle button ────────────────────────────────────────── */
.sidebar-profile-theme {
  color: var(--text-muted);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.sidebar-profile-theme:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ── Sidebar Backdrop (mobile) ──────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 299;
  backdrop-filter: blur(2px);
}
html.light .sidebar-backdrop { background: rgba(0, 0, 0, 0.35); }

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR — Premium Top Header
   ═══════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  transition: left var(--transition-base), background var(--transition-base);
}
.navbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 1.5rem;
  gap: 0.75rem;
}

/* ── Left section ─────────────────────────────────────────────────────── */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.navbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.navbar-hamburger:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}
.navbar-title-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
}
.navbar-title-link:hover {
  text-decoration: none;
}
.navbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

/* ── Center: search ───────────────────────────────────────────────────── */
.navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
}
.navbar-search {
  position: relative;
  width: 100%;
  max-width: 360px;
}
.navbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.navbar-search-input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  outline: none;
}
.navbar-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-input-hover);
}
.navbar-search-input::placeholder { color: var(--text-muted); }

/* ── Right section ────────────────────────────────────────────────────── */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.navbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}
.navbar-icon-btn:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
  text-decoration: none;
}

.navbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--accent-red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Admin Avatar in navbar ─────────────────────────────────────────────── */
.navbar-avatar-link {
  text-decoration: none;
  margin-left: 0.25rem;
}
.navbar-avatar-link:hover { text-decoration: none; }

.navbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
  flex-shrink: 0;
}
.navbar-avatar:hover {
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.navbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.navbar-avatar span {
  font-size: 0.8rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THEME SWITCHER
   ═══════════════════════════════════════════════════════════════════════════ */
.theme-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.theme-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.theme-switcher-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.theme-switcher-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT WRAPPER
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  padding: 1.5rem;
  width: 100%;
  min-height: calc(100vh - var(--navbar-height));
  transition: margin-left var(--transition-base), padding var(--transition-base),
              background var(--transition-base), color var(--transition-base);
}
.main-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.3px;
}
.main-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.container { max-width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-header h2 { margin-bottom: 0; }
.page-header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════
   HERO / WELCOME SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-left { display: flex; flex-direction: column; gap: 0.25rem; }
.hero-greeting {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.hero-greeting span { color: var(--accent); }
.hero-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 400;
}
.hero-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero-date-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.hero-date-badge svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM KPI CARD GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

/* 10 cards → default to 5 columns */
.kpi-grid.cols-10 {
  grid-template-columns: repeat(5, 1fr);
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kpi-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

/* Subtle gradient glow bar at top */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Icon row at top */
.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg {
  width: 18px;
  height: 18px;
}
.kpi-trend {
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.kpi-trend.up { color: var(--accent-green); background: rgba(0, 201, 141, 0.12); }
.kpi-trend.down { color: var(--accent-red); background: rgba(255, 71, 87, 0.12); }
.kpi-trend.neutral { color: var(--text-muted); background: var(--bg-badge); }

/* Value */
.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

/* Label */
.kpi-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.6px;
}

/* ── KPI accent colour variants ───────────────────────────────────────── */
.kpi-blue::before    { background: linear-gradient(90deg, var(--accent), var(--accent-cyan)); }
.kpi-blue .kpi-icon  { background: rgba(214, 40, 40, 0.12); color: var(--accent); }

.kpi-violet::before  { background: linear-gradient(90deg, var(--accent-violet), var(--accent-magenta)); }
.kpi-violet .kpi-icon { background: rgba(124, 92, 252, 0.12); color: var(--accent-violet); }

.kpi-green::before   { background: linear-gradient(90deg, var(--accent-green), #00f0a0); }
.kpi-green .kpi-icon { background: rgba(0, 201, 141, 0.12); color: var(--accent-green); }

.kpi-orange::before  { background: linear-gradient(90deg, var(--accent-orange), #ff6b35); }
.kpi-orange .kpi-icon { background: rgba(249, 168, 38, 0.12); color: var(--accent-orange); }

.kpi-magenta::before { background: linear-gradient(90deg, var(--accent-magenta), var(--accent-red)); }
.kpi-magenta .kpi-icon { background: rgba(255, 94, 156, 0.12); color: var(--accent-magenta); }

.kpi-cyan::before    { background: linear-gradient(90deg, var(--accent-cyan), var(--accent)); }
.kpi-cyan .kpi-icon  { background: rgba(0, 212, 255, 0.12); color: var(--accent-cyan); }

.kpi-amber::before   { background: linear-gradient(90deg, #ff9f43, var(--accent-orange)); }
.kpi-amber .kpi-icon { background: rgba(255, 159, 67, 0.12); color: #ff9f43; }

.kpi-purple::before  { background: linear-gradient(90deg, var(--accent-violet), #a855f7); }
.kpi-purple .kpi-icon { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

.kpi-teal::before    { background: linear-gradient(90deg, #14b8a6, var(--accent-green)); }
.kpi-teal .kpi-icon  { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }

.kpi-slate::before   { background: linear-gradient(90deg, var(--text-muted), #94a3b8); }
.kpi-slate .kpi-icon { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }

/* ── Legacy stat-card aliases (still used on other pages) ───────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}
.stat-number {
  display: block; font-size: 1.75rem; font-weight: 800; line-height: 1.2;
  color: var(--text-primary); letter-spacing: -0.5px;
}
.stat-label {
  display: block; font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-top: 0.15rem; font-weight: 600;
}
.stat-total::before    { background: linear-gradient(90deg, var(--accent), var(--accent-cyan)); }
.stat-pending::before  { background: linear-gradient(90deg, var(--accent-orange), #ff6b35); }
.stat-approved::before { background: linear-gradient(90deg, var(--accent-green), #00f0a0); }
.stat-rejected::before { background: linear-gradient(90deg, var(--accent-red), var(--accent-magenta)); }
.stat-premium::before  { background: linear-gradient(90deg, var(--accent-violet), var(--accent-magenta)); }
.stat-free::before     { background: linear-gradient(90deg, var(--accent-cyan), var(--accent)); }

/* ═══════════════════════════════════════════════════════════════════════════
   ANALYTICS / CHART CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Main analytics card (wide) ─────────────────────────────────────────── */
.analytics-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  width: 100%;
  transition: background var(--transition-base), border var(--transition-base);
}
.analytics-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.analytics-card-title-group { display: flex; flex-direction: column; gap: 0.15rem; }
.analytics-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.analytics-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Time filter pill group ─────────────────────────────────────────────── */
.time-filter {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.time-filter-btn {
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.time-filter-btn:hover { color: var(--text-primary); }
.time-filter-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px var(--accent-glow);
}

.analytics-chart-wrapper {
  position: relative;
  width: 100%;
}
.analytics-chart-wrapper canvas {
  width: 100% !important;
  max-height: 300px;
}

/* ── Supporting grid (smaller chart cards) ──────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.analytics-card-sm {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}
.analytics-card-sm:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}
.analytics-card-sm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.analytics-card-sm-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}
.analytics-card-sm .kpi-icon {
  width: 30px;
  height: 30px;
}
.analytics-card-sm .kpi-icon svg { width: 15px; height: 15px; }
.analytics-card-sm canvas {
  max-height: 180px;
  width: 100% !important;
}

/* ── Ranked list inside small card ──────────────────────────────────────── */
.ranked-list { display: flex; flex-direction: column; gap: 0.55rem; }
.ranked-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ranked-item-rank {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  background: var(--bg-badge);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ranked-item-rank.top-1 { background: rgba(255, 159, 67, 0.2); color: var(--accent-orange); }
.ranked-item-rank.top-2 { background: rgba(148, 163, 184, 0.2); color: var(--text-muted); }
.ranked-item-rank.top-3 { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.ranked-item-body { flex: 1; min-width: 0; }
.ranked-item-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranked-item-bar-track {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  margin-top: 3px;
  overflow: hidden;
}
.ranked-item-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  transition: width var(--transition-base);
}
.ranked-item-value {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* ── Empty state for analytics cards ────────────────────────────────────── */
.analytics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.5rem;
  text-align: center;
  gap: 0.5rem;
}
.analytics-empty-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-badge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.analytics-empty-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Legacy dash-card alias ─────────────────────────────────────────────── */
.dash-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  width: 100%;
}
.dash-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.dash-card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.dash-card-header h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.dash-card canvas { max-height: 280px; width: 100% !important; }

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* ── Section (reusable) ──────────────────────────────────────────────────── */
.section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  width: 100%;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.section-header h2, .section-header h3 { margin-bottom: 0; font-size: 1.05rem; font-weight: 700; }

.count-badge {
  background: var(--bg-badge);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.alert-error { background: var(--bg-alert-error); color: var(--accent-red); border: 1px solid rgba(255, 71, 87, 0.2); }
.alert-success { background: var(--bg-alert-success); color: var(--accent-green); border: 1px solid rgba(0, 201, 141, 0.2); }
.alert-warning { background: var(--bg-alert-warning); color: var(--accent-orange); border: 1px solid rgba(249, 168, 38, 0.2); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #080c1a 0%, #0d1225 50%, #111827 100%);
}
html.light .login-page { background: linear-gradient(135deg, #f1f4f9 0%, #e2e8f0 50%, #f1f4f9 100%); }
.login-page.theme-aware { display: flex; }

.login-container { width: 100%; max-width: 420px; padding: 1.5rem; }
.login-card {
  background: var(--bg-card); border-radius: var(--radius-xl);
  padding: 2.5rem 2rem; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header .login-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; font-weight: 700;
  margin: 0 auto 1rem;
}
.login-header h1 { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 0.25rem; font-weight: 800; letter-spacing: -0.5px; }
.login-header p { color: var(--text-secondary); font-size: 0.9rem; }
.login-form .form-group { margin-bottom: 1.25rem; }
.login-form label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--text-secondary); }
.login-form input {
  width: 100%; padding: 0.75rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 0.95rem; background: var(--bg-input); color: var(--text-primary);
  transition: all var(--transition-fast); font-family: var(--font-sans);
}
.login-form input:focus {
  outline: none; border-color: var(--accent); background: var(--bg-input-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-form input::placeholder { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.55rem 1.2rem; border: none;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition-fast);
  text-decoration: none; line-height: 1.4; font-family: var(--font-sans); white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 4px 16px var(--accent-glow); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-xs { padding: 0.28rem 0.6rem; font-size: 0.72rem; border-radius: var(--radius-xs); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary);
}
.btn-outline:hover { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #00a87a);
  color: #fff; box-shadow: 0 2px 8px rgba(0, 201, 141, 0.25);
}
.btn-success:hover { color: #fff; box-shadow: 0 4px 16px rgba(0, 201, 141, 0.3); }
.btn-warning {
  background: linear-gradient(135deg, var(--accent-orange), #e07e0a);
  color: #fff; box-shadow: 0 2px 8px rgba(249, 168, 38, 0.25);
}
.btn-warning:hover { color: #fff; }
.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #d63031);
  color: #fff; box-shadow: 0 2px 8px rgba(255, 71, 87, 0.25);
}
.btn-danger:hover { color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--accent-subtle); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════════════════ */
.table-responsive {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0;
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.table-responsive table { margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table th, .table td {
  padding: 0.7rem 0.85rem; text-align: left;
  border-bottom: 1px solid var(--border-light); white-space: nowrap;
}
.table th {
  background: var(--bg-table-stripe); font-weight: 600;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); position: sticky; top: 0;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-table-hover); }
.table tbody tr:nth-child(even) { background: var(--bg-table-stripe); }
.table tbody tr:nth-child(even):hover { background: var(--bg-table-hover); }
.actions-cell { display: flex; gap: 0.3rem; flex-wrap: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM REGISTRATIONS TABLE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Desktop premium table ─────────────────────────────────────────────── */
.reg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 680px;
}
.reg-table th {
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--bg-table-stripe);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.reg-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.reg-table tbody tr {
  transition: background var(--transition-fast);
}
.reg-table tbody tr:hover {
  background: var(--bg-table-hover);
}
.reg-table tbody tr:last-child td {
  border-bottom: none;
}

/* Student cell with avatar */
.reg-student-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.reg-student-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  color: #fff;
}
.reg-student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reg-student-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.reg-student-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reg-student-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reg-student-email a {
  color: var(--text-muted);
}
.reg-student-email a:hover {
  color: var(--accent);
}

/* Cell styling */
.reg-cell-default {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.reg-cell-muted {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Premium status badges */
.reg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.reg-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.reg-badge-approved {
  background: rgba(0, 201, 141, 0.12);
  color: var(--accent-green);
}
.reg-badge-approved::before { background: var(--accent-green); }
.reg-badge-pending {
  background: rgba(249, 168, 38, 0.12);
  color: var(--accent-orange);
}
.reg-badge-pending::before { background: var(--accent-orange); }
.reg-badge-rejected {
  background: rgba(255, 71, 87, 0.12);
  color: var(--accent-red);
}
.reg-badge-rejected::before { background: var(--accent-red); }

/* Premium dot for premium users */
.reg-premium-dot {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--accent-green);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 4px;
  vertical-align: middle;
}

/* View All link area */
.reg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.reg-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.reg-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.reg-header-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM DASHBOARD WIDGETS
   ═══════════════════════════════════════════════════════════════════════════ */

.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

/* ── Mini stat widget ───────────────────────────────────────────────────── */
.widget-mini {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.85rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-base);
}
.widget-mini:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.widget-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.widget-mini-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.widget-mini-icon svg { width: 16px; height: 16px; }
.widget-mini-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.widget-mini-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1;
}

/* Widget colour variants */
.widget-blue  .widget-mini-icon { background: rgba(214, 40, 40, 0.12); color: var(--accent); }
.widget-green .widget-mini-icon { background: rgba(0,201,141,0.12); color: var(--accent-green); }
.widget-amber .widget-mini-icon { background: rgba(249,168,38,0.12); color: var(--accent-orange); }
.widget-violet .widget-mini-icon { background: rgba(124,92,252,0.12); color: var(--accent-violet); }
.widget-cyan  .widget-mini-icon { background: rgba(0,212,255,0.12); color: var(--accent-cyan); }
.widget-magenta .widget-mini-icon { background: rgba(255,94,156,0.12); color: var(--accent-magenta); }
.widget-orange .widget-mini-icon { background: rgba(249,168,38,0.12); color: var(--accent-orange); }
.widget-teal  .widget-mini-icon { background: rgba(20,184,166,0.12); color: #14b8a6; }

/* ── Action widget ──────────────────────────────────────────────────────── */
.widget-actions {
  grid-column: span 1;
}
.widget-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.3rem;
}
.widget-action-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.widget-action-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent);
  text-decoration: none;
}
.widget-action-btn svg { flex-shrink: 0; }

/* ── Message preview widget ────────────────────────────────────────────── */
.widget-messages {
  grid-column: span 2;
}
.widget-message-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.widget-message-item:last-child { border-bottom: none; padding-bottom: 0; }
.widget-message-item:first-child { padding-top: 0; }
.widget-message-avatar {
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.widget-message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.widget-message-body { flex: 1; min-width: 0; }
.widget-message-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.widget-message-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.widget-message-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Revenue / snapshot widget ──────────────────────────────────────────── */
.widget-revenue .revenue-bar {
  margin-top: 0.4rem;
}
.revenue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.revenue-row:last-child { margin-bottom: 0; }
.revenue-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.revenue-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Widget empty state ─────────────────────────────────────────────────── */
.widget-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.25rem;
  gap: 0.3rem;
  text-align: center;
}
.widget-empty-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-badge);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.widget-empty-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Widget subtitle ────────────────────────────────────────────────────── */
.widget-mini-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: -0.2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE REGISTRATION CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.reg-mobile-list {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.reg-mobile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.reg-mobile-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.reg-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.reg-mobile-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}
.reg-mobile-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  color: #fff;
}
.reg-mobile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reg-mobile-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reg-mobile-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
}
.reg-mobile-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.reg-mobile-detail-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.reg-mobile-detail-value {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Show mobile cards, hide table on small screens */
@media (max-width: 768px) {
  .reg-table-wrapper { display: none; }
  .reg-mobile-list { display: flex; }
}

/* On desktop show table, hide mobile cards */
@media (min-width: 769px) {
  .reg-table-wrapper { display: block; }
  .reg-mobile-list { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.35rem; margin-top: 1rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 0.5rem;
  border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary); border: 1px solid var(--border);
  text-decoration: none; transition: all var(--transition-fast);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); text-decoration: none; }
.pagination .current { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: #fff; border-color: transparent; box-shadow: 0 2px 8px var(--accent-glow); }
.pagination .ellipsis { border: none; color: var(--text-muted); min-width: 20px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600; text-transform: capitalize; gap: 3px;
}
.badge-pending  { background: rgba(249, 168, 38, 0.15); color: var(--accent-orange); }
.badge-approved { background: rgba(0, 201, 141, 0.15); color: var(--accent-green); }
.badge-rejected { background: rgba(255, 71, 87, 0.15); color: var(--accent-red); }
.badge-free     { background: rgba(214, 40, 40, 0.15); color: var(--accent); }
.badge-premium  { background: rgba(214, 40, 40, 0.12); color: #a80f1a; }
.badge-super_admin { background: rgba(0, 201, 141, 0.15); color: var(--accent-green); }

.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full); background: var(--accent-red); color: #fff;
  font-size: 0.6rem; font-weight: 700; line-height: 1; flex-shrink: 0;
}

.notif-dropdown { position: relative; }
.notif-panel {
  display: none; position: absolute; top: 100%; right: 0;
  width: 360px; background: var(--bg-card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); z-index: 400;
  margin-top: 10px; overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 0.9rem; color: var(--text-primary);
}
.notif-mark-all { font-size: 0.75rem; font-weight: 500; color: var(--accent); cursor: pointer; background: none; border: none; font-family: inherit; }
.notif-mark-all:hover { color: var(--accent-hover); text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--bg-table-hover); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-body strong { display: block; font-size: 0.82rem; color: var(--text-primary); }
.notif-item-body span { display: block; font-size: 0.78rem; color: var(--text-secondary); }
.notif-item-body small { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.notif-dismiss { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0.2rem; border-radius: var(--radius-xs); flex-shrink: 0; }
.notif-dismiss:hover { color: var(--accent-red); background: var(--bg-alert-error); }
.notif-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH FORM
   ═══════════════════════════════════════════════════════════════════════════ */
.search-form {
  display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.search-form input[type="text"] {
  flex: 1; min-width: 200px; padding: 0.55rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; background: var(--bg-input); color: var(--text-primary);
  transition: all var(--transition-fast); font-family: var(--font-sans);
}
.search-form input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-form input[type="text"]::placeholder { color: var(--text-muted); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 0.9rem; }
.text-muted { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group-full { grid-column: 1 / -1; }
.form-group { margin-bottom: 0.5rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; background: var(--bg-input); color: var(--text-primary);
  transition: all var(--transition-fast); font-family: var(--font-sans);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--bg-input-hover);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.modal { display: none; position: fixed; inset: 0; z-index: 500; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.modal-content {
  position: relative; background: var(--bg-modal); border-radius: var(--radius-xl);
  padding: 1.75rem; max-width: 600px; width: 92%; max-height: 85vh;
  overflow-y: auto; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.modal-content h3 { margin-bottom: 1rem; font-size: 1.15rem; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHART SETTINGS
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-settings-toggle-wrapper { display: flex; gap: 0.5rem; align-items: center; }
.chart-settings-toggle {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem;
  color: var(--text-secondary); cursor: pointer; background: var(--bg-input);
  border: 1px solid var(--border); font-family: inherit;
  padding: 0.35rem 0.7rem; border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.chart-settings-toggle:hover { color: var(--text-primary); background: var(--bg-input-hover); border-color: var(--accent); }
.chart-settings-panel {
  display: none; background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 1.25rem; margin-bottom: 1.25rem; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.chart-settings-panel.open { display: block; }
.chart-settings-panel label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.5rem; cursor: pointer; color: var(--text-primary); }
.chart-settings-panel input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.settings-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.settings-form { max-width: 520px; }
.settings-form .form-group { margin-bottom: 1rem; }
.settings-form label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; color: var(--text-secondary); }
.settings-form input[type="text"], .settings-form input[type="password"], .settings-form input[type="file"], .settings-form input[type="color"], .settings-form textarea {
  width: 100%; padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; background: var(--bg-input); color: var(--text-primary);
  transition: all var(--transition-fast);
}
.settings-form input[type="color"] { height: 42px; padding: 3px; cursor: pointer; }
.settings-form input:focus, .settings-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.settings-form .form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.profile-card { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.profile-card .profile-avatar img, .profile-card .avatar-placeholder { width: 64px; height: 64px; border-radius: var(--radius-full); object-fit: cover; }
.avatar-placeholder-xs { display: inline-flex; width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--bg-badge); color: var(--text-muted); align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }
.profile-card .avatar-placeholder { background: linear-gradient(135deg, var(--accent), var(--accent-violet)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; }
.profile-card strong { display: block; font-size: 1rem; color: var(--text-primary); }
.profile-card span { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.logo-preview { margin-top: 0.5rem; }
.logo-preview img { max-height: 40px; border-radius: var(--radius-xs); }
.section-full { width: 100%; }

.feature-toggles { display: flex; flex-direction: column; gap: 0.6rem; }
.feature-toggle { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; cursor: pointer; color: var(--text-primary); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); transition: background var(--transition-fast); }
.feature-toggle:hover { background: var(--accent-subtle); }
.feature-toggle input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.profile-upload-area { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-upload-area .btn { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.glass-card { background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.section-divider { height: 1px; background: var(--border); margin: 1.25rem 0; border: none; }
.premium-dot { display: inline-flex; width: 16px; height: 16px; border-radius: var(--radius-full); background: var(--accent); color: #fff; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; flex-shrink: 0; }

input[type="color"] { -webkit-appearance: none; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 3px; cursor: pointer; background: var(--bg-input); }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: var(--radius-xs); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet: 769–1024px */
@media (max-width: 1024px) {
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.65rem; }
  .navbar-center { display: none; }
  .kpi-grid.cols-10 { grid-template-columns: repeat(4, 1fr); }
  .widget-grid { grid-template-columns: repeat(2, 1fr); }
  .widget-messages { grid-column: span 2; }
  .reg-table-wrapper { overflow-x: auto; }
  .analytics-card { padding: 1.1rem; }
}

/* Mobile: ≤768px — sidebar becomes off-canvas drawer */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); will-change: transform; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }

  .navbar-hamburger { display: flex; }

  .navbar { left: 0; }
  .navbar-center { display: none; }
  .navbar-inner { padding: 0 1rem; }

  .main-content { margin-left: 0; padding: 1rem; }

  .kpi-grid.cols-10 { grid-template-columns: repeat(3, 1fr); }
  .kpi-card { padding: 0.9rem 0.85rem; }
  .kpi-value { font-size: 1.3rem; }
  .analytics-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .stat-card { padding: 0.9rem 0.85rem; }
  .stat-number { font-size: 1.3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .dash-card { padding: 1rem; }
  .section { padding: 1rem; }
  .modal-content { width: 95%; padding: 1.25rem; }
  .notif-panel { width: 300px; right: -60px; z-index: 500; }
  .widget-messages { grid-column: span 1; }
  .widget-actions { grid-column: span 1; }
  .analytics-card { padding: 1rem; }
  .analytics-card-sm { padding: 0.85rem; }
}

/* Small mobile: ≤480px */
@media (max-width: 480px) {
  .kpi-grid.cols-10 { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { padding: 0.8rem 0.75rem; }
  .kpi-value { font-size: 1.15rem; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-card { padding: 1rem; }
  .analytics-card-sm { padding: 0.85rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .stat-card { padding: 0.8rem 0.75rem; }
  .stat-number { font-size: 1.15rem; }
  .main-content { padding: 0.75rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .search-form input[type="text"] { min-width: 140px; }
  .table-responsive { border-radius: var(--radius-sm); }
  .table th, .table td { padding: 0.5rem 0.6rem; }
  .navbar-inner { padding: 0 0.75rem; }
  .navbar-right { gap: 0.15rem; }
  .theme-switcher { display: flex; transform: scale(0.8); transform-origin: right center; }
  .widget-grid { grid-template-columns: 1fr; }
  .hero-greeting { font-size: 1.2rem; }
  .hero-section { margin-bottom: 1.25rem; }
  .analytics-card-sm { padding: 0.75rem; }
  .notif-panel { right: -20px; width: 280px; }
}

/* Desktop: ≥769px */
@media (min-width: 769px) {
  .navbar-hamburger { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* Wide desktop: ≥1200px */
@media (min-width: 1200px) {
  .main-content { padding: 2rem; }
  .kpi-grid.cols-10 { grid-template-columns: repeat(5, 1fr); }
  .stats-row { grid-template-columns: repeat(6, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FINAL POLISH — Spacing, Consistency, Empty States
   ═══════════════════════════════════════════════════════════════════════════ */

/* Section bottom breathing room */
.main-content > .container > *:last-child {
  margin-bottom: 0;
}
.main-content > .container {
  padding-bottom: 1rem;
}

/* Card height consistency */
@media (min-width: 769px) {
  .analytics-card-sm { min-height: 260px; display: flex; flex-direction: column; }
  .analytics-card-sm canvas { flex: 1; max-height: 170px; }
  .analytics-card-sm .ranked-list { flex: 1; }
  .kpi-card { min-height: 110px; }
  .widget-mini { min-height: 100px; }
}

/* Ensure mobile cards at 480px have proper padding */
@media (max-width: 480px) {
  .reg-mobile-card { padding: 0.75rem 0.85rem; }
  .reg-mobile-details { gap: 0.25rem 0.5rem; }
  .reg-cell-muted, .reg-cell-default { font-size: 0.74rem; }
  .analytics-chart-wrapper canvas { max-height: 220px; }
}

/* Thin horizontal spacer between major sections */
.section-spacer {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0 1.5rem;
  border: none;
}

/* Extra wrapper for section content padding */
.section-body {
  padding: 0 1.25rem 1.25rem;
}
