/* ═══════════════════════════════════════════════════════════════
   ICPC ACADEMY — Codeforces-Inspired Light Theme
   HNU · FE · ICPC Identity — Navy + Red + Gold
   ═══════════════════════════════════════════════════════════════ */

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

/* ══════════════════════════════════════════════════════════════
   1. DESIGN TOKENS — Codeforces Light Palette
   ══════════════════════════════════════════════════════════════ */
:root {
  /* ── Core backgrounds (Light) ── */
  --bg-deep:        #f0f4f8;
  --bg-base:        #f7f9fc;
  --bg-card:        #ffffff;
  --bg-card2:       #f4f7fb;
  --bg-card-hover:  #eef2f8;
  --bg-glass:       rgba(255,255,255,0.75);
  --bg-elevated:    #ffffff;
  --bg-mid:         #edf1f7;
  --bg-input:       #ffffff;

  /* ── Primary — HNU Navy Blue ── */
  --primary:        #1a3a6b;
  --primary-light:  #2651a0;
  --primary-dim:    rgba(26,58,107,0.1);
  --primary-border: rgba(26,58,107,0.25);
  --primary-glow:   0 0 20px rgba(26,58,107,0.15);

  /* ── Accent — HNU Red ── */
  --accent:         #c0392b;
  --accent-bright:  #e74c3c;
  --accent-dim:     rgba(192,57,43,0.1);
  --accent-border:  rgba(192,57,43,0.3);
  --accent-glow:    0 0 20px rgba(192,57,43,0.2);
  --accent-glow-lg: 0 0 50px rgba(192,57,43,0.25);

  /* ── Gold highlight — from logo ── */
  --gold:           #d4a017;
  --gold-dim:       rgba(212,160,23,0.12);
  --gold-border:    rgba(212,160,23,0.35);

  /* ── Keep compat vars ── */
  --cyan:           var(--primary-light);
  --blue:           var(--primary);
  --neon-cyan:      var(--primary-light);
  --cyan-glow:      var(--primary-glow);
  --cyan-glow-lg:   0 0 50px rgba(26,58,107,0.2);
  --cyan-dim:       var(--primary-dim);

  /* ── Semantic colors ── */
  --success:        #27ae60;
  --success-dim:    rgba(39,174,96,0.12);
  --danger:         #c0392b;
  --warning:        #d4a017;
  --info:           #2980b9;

  --purple-dim:     rgba(142,68,173,0.12);

  /* ── Text ── */
  --text-primary:   #1a1f2e;
  --text-secondary: #3d4a5c;
  --text-muted:     #7a8799;
  --text-dim:       #b0bac8;

  /* ── Borders ── */
  --border:         rgba(26,58,107,0.12);
  --border-hover:   rgba(26,58,107,0.22);
  --border-accent:  rgba(192,57,43,0.3);

  /* ── Radius ── */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      18px;
  --radius-2xl:     24px;
  --radius-full:    9999px;

  /* ── Typography ── */
  --font-main:      'IBM Plex Sans', system-ui, sans-serif;
  --font-sans:      'IBM Plex Sans', system-ui, sans-serif;
  --font-display:   'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

  /* ── Shadows (light-mode adapted) ── */
  --shadow-sm:      0 1px 3px rgba(26,58,107,0.08), 0 1px 2px rgba(26,58,107,0.05);
  --shadow-md:      0 4px 16px rgba(26,58,107,0.1), 0 2px 8px rgba(26,58,107,0.06);
  --shadow-lg:      0 8px 32px rgba(26,58,107,0.12), 0 4px 16px rgba(26,58,107,0.08);

  /* ── Transitions ── */
  --transition:      all 0.18s ease;
  --transition-slow: all 0.35s ease;
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Navbar height ── */
  --navbar-h:       56px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Subtle dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(26,58,107,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: -1;
  pointer-events: none;
}

@keyframes gridMove { from {} to {} }

/* ── Ambient glows — navy blue ── */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
}
.bg-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(26,58,107,0.08) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.bg-glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(192,57,43,0.06) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

/* ══════════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

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

code, pre, .font-mono { font-family: var(--font-mono); }

.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.fs-sm         { font-size: 0.82rem; }
.fs-xs         { font-size: 0.72rem; }

/* ══════════════════════════════════════════════════════════════
   4. NAVBAR
   ══════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--navbar-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.navbar-brand .brand-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(192,57,43,0.5);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.navbar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.navbar-link:hover {
  color: var(--primary);
  background: var(--primary-dim);
}
.navbar-link.active { color: var(--primary); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   5. BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26,58,107,0.25);
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(26,58,107,0.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-border);
}
.btn-outline:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-mid);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(192,57,43,0.3);
}
.btn-danger:hover { background: var(--accent-dim); }

.btn-sm  { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.75rem 1.6rem; font-size: 1rem; }
.btn-xl  { padding: 0.9rem 2rem; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 0.5rem; aspect-ratio: 1; }

/* ══════════════════════════════════════════════════════════════
   6. CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-glow:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md), var(--primary-glow);
}

.card-sm { padding: 1rem; border-radius: var(--radius-lg); }

/* ── Stat cards ── */
.stat-card { text-align: center; }
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}
.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.skeleton-card .stat-value { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   7. FORM CONTROLS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26,58,107,0.1);
}
.form-control::placeholder { color: var(--text-dim); }

textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.6; }
select.form-control { cursor: pointer; }

/* ══════════════════════════════════════════════════════════════
   8. BADGES & PILLS
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-accent  { background: var(--primary-dim);  color: var(--primary);  border: 1px solid var(--primary-border); }
.badge-cyan    { background: var(--primary-dim);  color: var(--primary);  border: 1px solid var(--primary-border); }
.badge-success { background: var(--success-dim);  color: var(--success);  border: 1px solid rgba(39,174,96,0.3); }
.badge-danger  { background: var(--accent-dim);   color: var(--accent);   border: 1px solid rgba(192,57,43,0.25); }
.badge-warn    { background: var(--gold-dim);      color: var(--gold);     border: 1px solid var(--gold-border); }
.badge-muted   { background: var(--bg-mid);        color: var(--text-muted); border: 1px solid var(--border); }
.badge-chip    { border-radius: 4px; }

.diff-easy   { color: var(--success); }
.diff-medium { color: var(--gold); }
.diff-hard   { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   9. TABLES
   ══════════════════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead th {
  background: var(--bg-mid);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.data-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody tr:hover td {
  background: var(--bg-mid);
  color: var(--text-primary);
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   10. MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,58,107,0.25);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  transition: var(--transition);
}
.modal-close:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   11. TABS
   ══════════════════════════════════════════════════════════════ */
.tab-nav {
  display: flex;
  gap: 0.15rem;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   12. TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  animation: toastIn 0.2s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--primary); }
.toast-warning { border-left: 3px solid var(--gold); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   13. PROGRESS BARS
   ══════════════════════════════════════════════════════════════ */
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.progress-bar-wrap {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 9999px;
  height: 7px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* ══════════════════════════════════════════════════════════════
   14. LAYOUT
   ══════════════════════════════════════════════════════════════ */
.page-wrapper {
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
  margin-top: var(--navbar-h);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
}

.main-content {
  flex: 1;
  padding: 2rem 2rem;
  overflow-y: auto;
  min-width: 0;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.page-header p  { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.35rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 640px)  {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: 1.25rem 1rem; }
}

.flex          { display: flex; align-items: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.25rem; }
.mb-lg { margin-bottom: 2rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }

/* ══════════════════════════════════════════════════════════════
   15. SIDEBAR ITEMS
   ══════════════════════════════════════════════════════════════ */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.1rem;
  margin: 0.1rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}
.sidebar-item:hover {
  color: var(--primary);
  background: var(--primary-dim);
}
.sidebar-item.active {
  color: var(--primary);
  background: var(--primary-dim);
  border-color: var(--primary-border);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   16. LEADERBOARD
   ══════════════════════════════════════════════════════════════ */
.leaderboard-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.4rem;
  background: var(--bg-card);
  transition: var(--transition);
}
.leaderboard-row:hover {
  border-color: var(--primary-border);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

.rank-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.rank-badge.gold   { background: linear-gradient(135deg,#f6d365,#fda085); color: #7a3e00; box-shadow: 0 2px 8px rgba(253,160,133,0.4); }
.rank-badge.silver { background: linear-gradient(135deg,#e0e0e0,#bdbdbd); color: #424242; }
.rank-badge.bronze { background: linear-gradient(135deg,#d7966b,#bf7e5a); color: #4e2600; }
.rank-badge.other  { background: var(--bg-mid); color: var(--text-muted); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   17. NOTIFICATION PANEL
   ══════════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed;
  top: calc(var(--navbar-h) + 0.5rem);
  right: 1rem;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 400;
  display: none;
}
.notif-panel.open { display: block; }
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.notif-panel-list { padding: 0.5rem; max-height: 380px; overflow-y: auto; }

/* ══════════════════════════════════════════════════════════════
   18. SKELETON LOADING
   ══════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-mid) 25%, var(--bg-card-hover) 50%, var(--bg-mid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════════════════════
   19. ADMIN PANEL
   ══════════════════════════════════════════════════════════════ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--navbar-h));
  margin-top: var(--navbar-h);
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
}

.admin-content { padding: 2rem 1.75rem; overflow-y: auto; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

.admin-nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 1.1rem;
  margin: 0.12rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500; font-size: 0.87rem;
  cursor: pointer; transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}
.admin-nav-item:hover {
  color: var(--primary);
  background: var(--primary-dim);
}
.admin-nav-item.active {
  color: var(--primary);
  background: var(--primary-dim);
  border-color: var(--primary-border);
  font-weight: 700;
}
.admin-nav-item.active::before {
  content: '';
  position: absolute; left: 0.6rem; top: 28%; bottom: 28%;
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeIn 0.2s ease; }

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 1100px) { .admin-stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .admin-stats-row { grid-template-columns: 1fr; } }

.admin-mini-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 0.9rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.admin-mini-stat:hover {
  border-color: var(--primary-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.admin-mini-stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.admin-mini-stat-icon.cyan   { background: var(--primary-dim);  border: 1px solid var(--primary-border); }
.admin-mini-stat-icon.green  { background: var(--success-dim);  border: 1px solid rgba(39,174,96,0.2); }
.admin-mini-stat-icon.gold   { background: var(--gold-dim);     border: 1px solid var(--gold-border); }
.admin-mini-stat-icon.purple { background: var(--purple-dim);   border: 1px solid rgba(142,68,173,0.2); }

.admin-mini-stat-val {
  font-size: 1.45rem; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  line-height: 1;
}
.admin-mini-stat-label {
  font-size: 0.72rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; margin-top: 0.2rem;
}

.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.admin-search-wrap { position: relative; flex: 1; max-width: 280px; }
.admin-search-wrap input {
  width: 100%; padding: 0.55rem 1rem 0.55rem 2.25rem;
  background: var(--bg-mid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main); font-size: 0.87rem;
  outline: none; transition: var(--transition);
}
.admin-search-wrap input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background: var(--bg-card);
}
.admin-search-wrap input::placeholder { color: var(--text-dim); }
.admin-search-icon {
  position: absolute; left: 0.75rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.85rem; pointer-events: none;
}

.analytics-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 0.75rem; padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm); transition: background 0.15s;
}
.analytics-bar:hover { background: var(--bg-mid); }
.analytics-bar-label {
  width: 130px; font-size: 0.8rem; color: var(--text-secondary);
  flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.analytics-bar-track {
  flex: 1; height: 6px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-full); overflow: hidden;
}
.analytics-bar-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.analytics-bar-value {
  width: 42px; text-align: right;
  font-size: 0.8rem; color: var(--primary);
  font-weight: 700; font-family: var(--font-mono);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.chart-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--gold));
  opacity: 0.6;
}
.chart-title {
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 1.1rem;
}

.sortable-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.4rem;
  cursor: grab;
  display: flex; align-items: center; gap: 0.7rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.sortable-item:hover { border-color: var(--primary-border); box-shadow: var(--shadow-md); }
.sortable-item.dragging {
  opacity: 0.6; border-color: var(--primary);
  box-shadow: var(--primary-glow), var(--shadow-md);
  transform: scale(1.02);
}
.drag-handle { color: var(--text-dim); cursor: grab; transition: color 0.2s; }
.drag-handle:hover { color: var(--primary); }
.drag-handle::before { content: '⠿'; font-size: 1.1rem; }

.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 0.4rem; }
.status-dot.active  { background: var(--success); box-shadow: 0 0 5px rgba(39,174,96,0.5); }
.status-dot.pending { background: var(--gold);    box-shadow: 0 0 5px rgba(212,160,23,0.5); }
.status-dot.banned  { background: var(--danger);  box-shadow: 0 0 5px rgba(192,57,43,0.5); }

.admin-form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.admin-form-section-header {
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--bg-mid);
  font-weight: 700; font-size: 0.9rem;
}
.admin-form-section-body { padding: 1.5rem; }

.user-row-expanded {
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1rem 1.2rem;
  display: none;
  animation: slideDown 0.2s ease;
}
.user-row-expanded.open { display: block; }

/* ══════════════════════════════════════════════════════════════
   20. AUTH PAGES
   ══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg-base);
  position: relative; overflow: hidden;
}

.auth-page::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(26,58,107,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,58,107,0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  z-index: 0;
}

.auth-page::after {
  content: '';
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(26,58,107,0.06) 0%, transparent 70%);
  z-index: 0; pointer-events: none;
}

.auth-container {
  width: 100%; max-width: 460px;
  position: relative; z-index: 1;
  animation: authEntrance 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authEntrance {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo .logo-circle img { width: 70%; height: 70%; object-fit: contain; }
.auth-logo .logo-circle {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 32px rgba(26,58,107,0.3);
  animation: logoFloat 4s ease-in-out infinite;
  position: relative; overflow: hidden;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--primary);
}
.auth-logo h1 span { color: var(--accent); }
.auth-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--gold));
}

.auth-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.3rem; color: var(--primary); }
.auth-card .auth-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.75rem; }

.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { color: var(--accent); }

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: 1rem;
  display: none;
  align-items: flex-start; gap: 0.6rem;
  animation: alertSlide 0.2s ease;
}
@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert.show    { display: flex; }
.alert.error   { background: rgba(192,57,43,0.07);  border: 1px solid rgba(192,57,43,0.25); color: var(--danger); }
.alert.success { background: rgba(39,174,96,0.08);  border: 1px solid rgba(39,174,96,0.25); color: var(--success); }
.alert.info    { background: var(--primary-dim);    border: 1px solid var(--primary-border); color: var(--primary); }

.verification-banner {
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  text-align: center; margin-bottom: 1.5rem;
  display: none; animation: fadeIn 0.3s ease;
}
.verification-banner.show { display: block; }
.verification-banner p { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.6; }
.verification-banner strong { color: var(--primary); }

.pwd-strength { margin-top: 0.5rem; display: flex; gap: 4px; }
.pwd-strength-bar {
  flex: 1; height: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-mid);
  transition: var(--transition-slow);
}
.pwd-strength-bar.active.weak   { background: var(--danger); }
.pwd-strength-bar.active.medium { background: var(--gold); }
.pwd-strength-bar.active.strong { background: var(--success); }

/* ══════════════════════════════════════════════════════════════
   21. HERO PAGE
   ══════════════════════════════════════════════════════════════ */
.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.hero-logo {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  box-shadow: 0 0 60px rgba(26,58,107,0.3) !important;
}

.hero-badge {
  background: var(--primary-dim) !important;
  border-color: var(--primary-border) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 20px rgba(26,58,107,0.1) !important;
}

.trainer-highlight {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-md) !important;
}
.trainer-highlight h2 { color: var(--primary) !important; }

.trainer-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}
.trainer-card:hover {
  border-color: var(--primary-border) !important;
  box-shadow: var(--shadow-md), var(--primary-glow) !important;
}
.trainer-photo-wrap {
  background: var(--primary-dim) !important;
  border-color: var(--primary-border) !important;
}
.trainer-role { color: var(--primary-light) !important; }

.feature-card:hover {
  border-color: var(--primary-border) !important;
  box-shadow: var(--shadow-md), var(--primary-glow) !important;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(26,58,107,0.2); }
  50%       { box-shadow: 0 0 80px rgba(26,58,107,0.35); }
}

/* ══════════════════════════════════════════════════════════════
   22. COURSE PAGE
   ══════════════════════════════════════════════════════════════ */
.section-nav-item.active {
  background: var(--primary-dim) !important;
  border-color: var(--primary-border) !important;
  color: var(--primary) !important;
}
.section-nav-item.active .snav-num {
  background: rgba(26,58,107,0.15) !important;
  color: var(--primary) !important;
}
.section-nav-item:hover {
  background: var(--primary-dim) !important;
  color: var(--primary) !important;
}
.sections-toggle-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  color: #fff !important;
}
.week-card:hover { border-color: var(--primary-border) !important; }

.verdict-banner { padding: 0.75rem 1rem; border-radius: var(--radius-md); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.verdict-ac  { background: rgba(39,174,96,0.08);  color: var(--success); border: 1px solid rgba(39,174,96,0.25); }
.verdict-wa  { background: rgba(192,57,43,0.08);  color: var(--danger);  border: 1px solid rgba(192,57,43,0.2); }
.verdict-err { background: var(--gold-dim);        color: var(--gold);    border: 1px solid var(--gold-border); }

/* ══════════════════════════════════════════════════════════════
   23. SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-mid); }
::-webkit-scrollbar-thumb {
  background: rgba(26,58,107,0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(26,58,107,0.35); }

/* ══════════════════════════════════════════════════════════════
   24. SELECTION & MISC
   ══════════════════════════════════════════════════════════════ */
::selection { background: rgba(26,58,107,0.15); color: var(--primary); }

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

#loading-screen { background: var(--bg-base) !important; }

.streak-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  border-radius: 9999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem; font-weight: 700;
  color: var(--primary);
}

.admin-tabs-bar {
  background: var(--bg-card) !important;
  border-bottom: 2px solid var(--border) !important;
}
.admin-tab-btn.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}
.admin-tab-btn:hover { color: var(--primary) !important; }

.CodeMirror {
  font-family: var(--font-mono) !important;
  font-size: 0.88rem !important;
  border-radius: var(--radius-lg) !important;
}
