/* =========================================================================
   EduGame Teacher — Premium Design System v2.0
   Modern, vibrant, glassmorphism, animated, professional.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand Colors */
  --primary:        #7c3aed;
  --primary-light:  #a78bfa;
  --primary-dark:   #5b21b6;
  --primary-glow:   rgba(124, 58, 237, 0.25);

  --secondary:      #06b6d4;
  --secondary-dark: #0891b2;

  --accent:         #f59e0b;
  --accent-dark:    #d97706;

  --success:        #10b981;
  --success-dark:   #059669;
  --success-bg:     #d1fae5;
  --success-text:   #065f46;

  --danger:         #ef4444;
  --danger-dark:    #dc2626;
  --danger-bg:      #fee2e2;
  --danger-text:    #991b1b;

  --warning:        #f59e0b;
  --warning-dark:   #d97706;
  --warning-bg:     #fef3c7;
  --warning-text:   #92400e;

  --info:           #3b82f6;
  --info-bg:        #dbeafe;
  --info-text:      #1e40af;

  /* Surfaces */
  --bg:             #f5f3ff;
  --bg-dark:        #ede9fe;
  --surface:        #ffffff;
  --surface-2:      #faf9ff;
  --glass:          rgba(255,255,255,0.75);
  --glass-border:   rgba(255,255,255,0.5);

  /* Text */
  --text:           #1e1b2e;
  --text-secondary: #4b5563;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;

  /* Borders */
  --border:         #e5e7eb;
  --border-focus:   #a78bfa;

  /* Radii */
  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --radius-xl:  30px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(17, 12, 46, 0.04);
  --shadow-sm:  0 2px 8px rgba(76, 29, 149, 0.06);
  --shadow-md:  0 8px 24px rgba(76, 29, 149, 0.12);
  --shadow-lg:  0 16px 48px rgba(76, 29, 149, 0.18);
  --shadow-xl:  0 24px 64px rgba(76, 29, 149, 0.22);
  --shadow-glow: 0 0 0 4px var(--primary-glow);

  /* Gradients */
  --grad-brand:   linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #0ea5e9 100%);
  --grad-warm:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-cool:    linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-green:   linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-purple:  linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --grad-pink:    linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  --grad-sunset:  linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --grad-bg:      linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #dbeafe 100%);

  /* Sidebar */
  --sidebar-width: 268px;
  --sidebar-bg:    #13102a;
  --sidebar-text:  #c4b5fd;
  --sidebar-muted: #7c6aaa;

  /* Topbar */
  --topbar-h: 66px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 350ms;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--dur-base) var(--ease); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; line-height: 1.3; color: var(--text); }
p { color: var(--text-secondary); }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ─── Page heading ───────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-header h1, .page-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-base) var(--ease),
    background var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease);
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.10); }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45); color: #fff; }

.btn-secondary { background: #eef2ff; color: var(--primary-dark); }
.btn-secondary:hover { background: #e0e7ff; color: var(--primary-dark); }

.btn-success { background: var(--grad-green); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(16,185,129,.4); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--danger-dark); box-shadow: 0 6px 20px rgba(239,68,68,.4); color: #fff; }

.btn-warning { background: var(--grad-warm); color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,.3); }
.btn-warning:hover { box-shadow: 0 6px 20px rgba(245,158,11,.4); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary); background: rgba(124,58,237,0.05); }

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger-dark);
  color: var(--danger-dark);
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: rgba(0,0,0,.05); color: var(--text); }

.btn-sm   { padding: 7px 14px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-lg   { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: var(--radius-full); }
.btn-icon-sm { padding: 6px; border-radius: var(--radius-full); }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px;
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 16px; font-weight: 700; margin: 0; }

/* Stat Cards */
.stat-card {
  border-radius: var(--radius-md);
  padding: 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; left: 10px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.stat-card.c0 { background: var(--grad-brand); }
.stat-card.c1 { background: var(--grad-cool); }
.stat-card.c2 { background: var(--grad-warm); }
.stat-card.c3 { background: var(--grad-green); }
.stat-card.c4 { background: var(--grad-pink); }
.stat-card.c5 { background: var(--grad-sunset); }

/* legacy aliases */
.stat-card.alt-1 { background: var(--grad-cool); }
.stat-card.alt-2 { background: var(--grad-warm); }
.stat-card.alt-3 { background: var(--grad-green); }

.stat-label { font-size: 12.5px; opacity: .85; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.stat-sub   { font-size: 12px; opacity: .75; margin-top: 4px; }
.stat-icon  { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 36px; opacity: .3; }

/* Game type cards */
.game-type-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
  cursor: pointer;
}
.game-type-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.game-type-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.game-type-header {
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.game-type-icon { font-size: 46px; display: block; margin-bottom: 10px; line-height: 1; }
.game-type-name { font-size: 14px; font-weight: 700; color: #fff; }
.game-type-body { padding: 14px 16px; }
.game-type-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 20px; }
.form-label   { display: block; font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--text); letter-spacing: 0.01em; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea.form-control  { resize: vertical; min-height: 100px; }
.form-hint             { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error            { font-size: 12px; color: var(--danger); margin-top: 5px; font-weight: 600; }

.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-group .input-addon {
  position: absolute; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; padding: 0 14px;
}
.input-group .toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  cursor: pointer; background: none; border: none; color: var(--text-muted);
  font-size: 12.5px; font-weight: 600; transition: color var(--dur-base);
}
.input-group .toggle-password:hover { color: var(--primary); }

.checkbox-line { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.checkbox-line input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Custom Radio/Check cards */
.radio-card { display: none; }
.radio-card-label {
  display: block;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur-base), background var(--dur-base);
  font-weight: 600;
  font-size: 13px;
}
.radio-card:checked + .radio-card-label { border-color: var(--primary); background: rgba(124,58,237,0.06); color: var(--primary-dark); }

/* ─── Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text);    }
.badge-muted   { background: #f3f4f6;           color: #4b5563;             }
.badge-primary { background: #ede9fe;           color: var(--primary-dark); }

/* ─── Alert banners ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
}
.alert-success { background: var(--success-bg); border-color: #6ee7b7; color: var(--success-text); }
.alert-danger  { background: var(--danger-bg);  border-color: #fca5a5; color: var(--danger-text); }
.alert-warning { background: var(--warning-bg); border-color: #fcd34d; color: var(--warning-text); }
.alert-info    { background: var(--info-bg);    border-color: #93c5fd; color: var(--info-text); }

/* ─── Toast notifications ────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 22px; right: 22px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  animation: toast-in .25s var(--ease-bounce);
  backdrop-filter: blur(12px);
  min-width: 260px;
}
.toast.success { background: linear-gradient(135deg,#064e3b,#065f46); color:#fff; }
.toast.error   { background: linear-gradient(135deg,#7f1d1d,#991b1b); color:#fff; }
.toast.warning { background: linear-gradient(135deg,#78350f,#92400e); color:#fff; }
.toast.info    { background: linear-gradient(135deg,#1e3a8a,#1e40af); color:#fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0)    scale(1);    }
}

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 12, 46, .55);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 9998; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 480px; width: 100%;
  padding: 30px;
  animation: modal-in .2s var(--ease-bounce);
}
.modal-box .modal-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.modal-box .modal-body  { color: var(--text-secondary); font-size: 14px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
@keyframes modal-in { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ─── Cheerful & Vibrant EduGame Auth Design System (Joyful, Playful & Bright) ────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4ff;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(99, 102, 241, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 90% 18%, rgba(236, 72, 153, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 50% 88%, rgba(6, 182, 212, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.15) 0%, transparent 45%),
    radial-gradient(rgba(99, 102, 241, 0.07) 1.5px, transparent 1.5px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 26px 26px;
  padding: 30px 20px;
  position: relative;
  overflow: hidden;
}

/* Vibrant Playful Game Orbs */
.auth-page::before {
  content: '';
  position: absolute;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, rgba(244, 114, 182, 0.22) 40%, transparent 70%);
  top: -180px;
  left: -140px;
  filter: blur(60px);
  animation: authAurora 10s ease-in-out infinite alternate;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.32) 0%, rgba(52, 211, 153, 0.22) 40%, transparent 70%);
  bottom: -160px;
  right: -120px;
  filter: blur(60px);
  animation: authAurora 12s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}

@keyframes authAurora {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(35px, -25px) scale(1.1); }
  100% { transform: translate(-25px, 35px) scale(0.95); }
}

/* Floating Game Badges in Background */
.auth-floating-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 
    0 12px 32px rgba(99, 102, 241, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  z-index: 0;
  animation: floatBadge 6s ease-in-out infinite alternate;
}
.auth-badge-1 {
  top: 13%; left: 8%;
  animation-delay: 0s;
  border-left: 4px solid #7c3aed;
}
.auth-badge-2 {
  top: 20%; right: 8%;
  animation-delay: 1.5s;
  border-left: 4px solid #f59e0b;
}
.auth-badge-3 {
  bottom: 18%; left: 7%;
  animation-delay: 3s;
  border-left: 4px solid #10b981;
}
.auth-badge-4 {
  bottom: 14%; right: 9%;
  animation-delay: 2.2s;
  border-left: 4px solid #ec4899;
}

@media (max-width: 1080px) {
  .auth-floating-badge { display: none !important; }
}

@keyframes floatBadge {
  0%   { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-16px) rotate(2deg); }
}

/* Cheerful Glassmorphic Game Card */
.auth-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  box-shadow: 
    0 25px 70px -10px rgba(99, 102, 241, 0.22),
    0 12px 30px -8px rgba(236, 72, 153, 0.14),
    0 0 0 1px rgba(124, 58, 237, 0.06);
  width: 100%;
  max-width: 440px;
  padding: 42px 38px;
  position: relative;
  z-index: 1;
  animation: card-appear .6s cubic-bezier(0.16, 1, 0.3, 1);
  color: #1e293b;
}
@keyframes card-appear { from { opacity: 0; transform: translateY(28px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* EduGame Portal Top Pill Tag */
.auth-edu-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.12) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #6366f1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 auto 20px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
}
.auth-edu-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

/* Logo Presentation */
.auth-brand-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand-glow {
  position: absolute;
  inset: -6px;
  border-radius: 28px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899, #f59e0b);
  filter: blur(14px);
  opacity: 0.65;
  animation: glowPulse 4s ease-in-out infinite alternate;
}
@keyframes glowPulse {
  0%   { opacity: 0.4; filter: blur(10px); transform: scale(0.96); }
  100% { opacity: 0.8; filter: blur(16px); transform: scale(1.04); }
}
.auth-brand {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.22), 0 2px 6px rgba(0,0,0,0.04);
  padding: 8px;
  overflow: hidden;
  margin: 0;
  animation: logo-pop .6s var(--ease-bounce) .2s both;
}
@keyframes logo-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Title & Subtitle */
.auth-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.25;
}
.auth-subtitle {
  text-align: center;
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 26px;
  font-weight: 600;
  line-height: 1.4;
}

/* Form Controls */
.auth-form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.auth-form-label .label-ico {
  font-size: 14px;
}
.auth-card .form-control {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 500;
  padding: 13px 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.auth-card .form-control::placeholder {
  color: #94a3b8;
}
.auth-card .form-control:focus {
  background: #ffffff;
  border-color: #7c3aed;
  box-shadow: 
    0 0 0 4px rgba(124, 58, 237, 0.16),
    0 4px 14px rgba(124, 58, 237, 0.1);
  outline: none;
}
.auth-card .input-group .toggle-password {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-left: none;
  border-radius: 0 14px 14px 0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-card .input-group .toggle-password:hover {
  background: #e2e8f0;
  color: #7c3aed;
}
.auth-card .input-group .toggle-password svg {
  display: block;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-card .input-group .toggle-password:hover svg {
  transform: scale(1.15);
  stroke: #7c3aed;
}
.auth-card .input-group .form-control {
  border-radius: 14px 0 0 14px;
}

/* Checkbox & Portal Tag */
.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  margin-bottom: 24px;
  font-size: 13px;
}
.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.auth-checkbox-label input[type="checkbox"] {
  accent-color: #7c3aed;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  cursor: pointer;
}
.auth-portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Cheerful Gaming Submit Button */
.btn-auth-submit {
  position: relative;
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 48%, #ec4899 100%);
  box-shadow: 
    0 10px 24px -2px rgba(124, 58, 237, 0.4),
    0 4px 0 #4f46e5;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-auth-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-25deg);
  transition: all 0.75s ease;
}
.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 14px 30px -2px rgba(124, 58, 237, 0.5),
    0 4px 0 #4f46e5;
}
.btn-auth-submit:hover::before {
  left: 140%;
}
.btn-auth-submit:active {
  transform: translateY(2px);
  box-shadow: 
    0 4px 12px rgba(124, 58, 237, 0.3),
    0 1px 0 #4f46e5;
}

/* Teacher Registration Banner */
.auth-register-box {
  margin-top: 22px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1.5px dashed rgba(16, 185, 129, 0.4);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.06);
}
.auth-register-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 10px;
}
.btn-auth-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 
    0 6px 16px rgba(16, 185, 129, 0.35),
    0 3px 0 #047857;
  transition: all 0.2s ease;
}
.btn-auth-register:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 
    0 8px 22px rgba(16, 185, 129, 0.45),
    0 3px 0 #047857;
  transform: translateY(-1px);
}
.btn-auth-register:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 6px rgba(16, 185, 129, 0.3),
    0 1px 0 #047857;
}

/* Auth Footer */
.auth-footer-text {
  text-align: center;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 24px;
  letter-spacing: 0.02em;
}

/* ─── App shell: sidebar + topbar ────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 0;
  position: sticky; top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  transition: transform var(--dur-slow) var(--ease);
  scrollbar-width: none;
  z-index: 100;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 20px;
  font-weight: 800; font-size: 16.5px; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.07);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.sidebar-brand .brand-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124,58,237,.4);
}
.sidebar-brand .brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--sidebar-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-section {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-muted);
  padding: 16px 10px 6px;
  font-weight: 700;
}
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 600;
  transition: background var(--dur-base), color var(--dur-base), transform var(--dur-fast);
}
.sidebar-link .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(3px); }
.sidebar-link.active { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.3); }

.sidebar-footer {
  flex-shrink: 0;
  padding: 12px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 12px));
  border-top: 1px solid rgba(255,255,255,.08);
  background: #0f0c24;
}
.sidebar-footer .sidebar-link {
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #fca5a5 !important;
  font-weight: 700;
  padding: 10px 14px;
}
.sidebar-footer .sidebar-link:hover,
.sidebar-footer .sidebar-link:active {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ffffff !important;
  transform: translateX(2px);
}

/* Main area */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(76,29,149,.05);
}
.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger {
  display: none;
  background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--text);
  padding: 6px; border-radius: var(--radius-xs);
  transition: background var(--dur-fast);
}
.hamburger:hover { background: var(--bg-dark); }

.topbar-title { font-size: 15px; font-weight: 700; color: var(--text); }

.content { flex: 1; padding: 28px; }

/* User Profile Dropdown in Topbar */
.user-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all var(--dur-fast) var(--ease);
  outline: none;
  user-select: none;
}

.user-chip:hover,
.user-dropdown.open .user-chip {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.18);
}

.user-chip:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(124,58,237,.3);
  flex-shrink: 0;
  transition: transform var(--dur-fast);
}

.user-chip:hover .user-avatar {
  transform: scale(1.04);
}

.user-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.user-role {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-top: 2px;
}

.user-dropdown-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease), color var(--dur-fast);
  margin-left: -2px;
}

.user-dropdown.open .user-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  max-width: min(320px, calc(100vw - 28px));
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.16);
  box-shadow: 0 16px 40px -8px rgba(17, 12, 46, 0.18), 0 0 1px rgba(0, 0, 0, 0.1);
  padding: 8px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility var(--dur-fast);
  pointer-events: none;
}

.user-dropdown.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.07) 0%, rgba(6, 182, 212, 0.07) 100%);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.user-dropdown-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
  flex-shrink: 0;
}

.user-dropdown-header-info {
  flex: 1;
  min-width: 0;
}

.user-dropdown-header-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.user-dropdown-header-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  margin-bottom: 4px;
}

.user-dropdown-header-role .badge {
  font-size: 10px;
  padding: 2px 7px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--dur-fast), transform var(--dur-fast), color var(--dur-fast);
}

.user-dropdown-item:hover {
  background: #f5f3ff;
  color: var(--primary-dark);
  transform: translateX(2px);
}

.user-dropdown-item-icon {
  font-size: 16px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-dropdown-item-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.user-dropdown-item-title {
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  line-height: 1.2;
}

.user-dropdown-item-desc {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
}

.user-dropdown-item.user-dropdown-logout {
  color: #dc2626;
}

.user-dropdown-item.user-dropdown-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.user-dropdown-item.user-dropdown-logout .user-dropdown-item-desc {
  color: #ef4444;
  opacity: 0.8;
}

/* Notification dot */
.notif-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: background var(--dur-fast);
  color: var(--text-muted);
}
.notif-btn:hover { background: var(--bg-dark); color: var(--text); }

/* ─── Tables ─────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; background: #fff;
}
table.data-table th {
  text-align: left; padding: 13px 16px;
  background: linear-gradient(to bottom, #faf9ff, #f5f3ff);
  color: var(--text-muted);
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background var(--dur-fast); }
table.data-table tbody tr:hover td { background: #faf8ff; }

.table-action-btns { display: flex; align-items: center; gap: 6px; }

/* ─── Dashboard Responsive Mobile Items ──────────────────────────────── */
.dash-mobile-list { display: none; }
.dash-item-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.dash-item-card:hover {
  background: #faf9ff;
  border-color: rgba(124, 58, 237, 0.25);
}
.dash-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* ─── Pagination ─────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin-top: 20px;
}
.page-btn {
  min-width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--dur-fast);
  text-decoration: none;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Empty state ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 72px 24px;
  color: var(--text-muted);
}
.empty-state .es-icon { font-size: 56px; margin-bottom: 16px; opacity: .7; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; font-size: 18px; }
.empty-state p  { max-width: 380px; margin: 0 auto 20px; font-size: 13.5px; }

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  position: relative;
  transition: color var(--dur-base);
  white-space: nowrap;
}
.tab-btn::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0; height: 2px;
  background: var(--primary); border-radius: 2px 2px 0 0;
  transform: scaleX(0); transition: transform var(--dur-base);
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); }
.tab-btn.active::after { transform: scaleX(1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Progress bars ──────────────────────────────────────────────────── */
.progress { background: var(--border); border-radius: var(--radius-full); overflow: hidden; height: 8px; }
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: var(--grad-brand);
  transition: width .6s var(--ease);
}

/* ─── Code / pre ─────────────────────────────────────────────────────── */
pre.code-block {
  background: #1a1130; color: #e9e4f9;
  padding: 18px 20px; border-radius: var(--radius-md);
  font-size: 13px; overflow-x: auto; font-family: 'Fira Code', monospace;
}

/* ─── Divider ────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-top: 1px solid var(--border); }

/* ─── Section headings ───────────────────────────────────────────────── */
.section-title {
  font-size: 17px; font-weight: 800;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
}
.section-sub {
  font-size: 13px; color: var(--text-muted); margin-bottom: 20px;
}

/* ─── List group ─────────────────────────────────────────────────────── */
.list-group { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-fast);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

/* ─── Toggle / Switch ────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-flex; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: var(--radius-full);
  cursor: pointer; transition: background var(--dur-base);
}
.toggle-slider::after {
  content: '';
  position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform var(--dur-base) var(--ease-bounce);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }

/* ─── Copy link / share ──────────────────────────────────────────────── */
.share-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.share-url { flex: 1; font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Utilities ──────────────────────────────────────────────────────── */
.grid   { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-1          { flex: 1; }

.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 12.5px; }
.text-xs      { font-size: 11.5px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.font-bold    { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.mt-0 { margin-top: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.w-full { width: 100%; }

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded-full { border-radius: var(--radius-full); }

/* Gradient text */
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Teacher Games Grid & Cards ─────────────────────────────────────── */
.teacher-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.teacher-game-card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  overflow: hidden;
}
.teacher-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.teacher-actions-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.teacher-actions-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
.hide-mobile { display: inline-block; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .content { padding: 16px 14px; }
  .card { padding: 18px 14px; }
  .card-header { margin-bottom: 14px; padding-bottom: 12px; }
  .card-header h3 { font-size: 15px; }
  .dash-table-view { display: none !important; }
  .dash-mobile-list { display: flex !important; flex-direction: column; gap: 10px; }
  table.data-table th,
  table.data-table td {
    padding: 10px 10px;
    font-size: 12px;
  }
  .topbar { padding: 0 14px; gap: 8px; justify-content: space-between; }
  .topbar-left { min-width: 0; flex: 1; gap: 8px; overflow: hidden; }
  .topbar-title {
    font-size: 14.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  .topbar-btn-create { padding: 6px 10px !important; }
  .user-chip {
    padding: 3px 6px 3px 3px;
    gap: 4px;
  }
  .user-dropdown-arrow {
    display: inline-flex;
    margin-left: 0;
  }
  .user-dropdown-menu {
    right: 0;
    top: calc(100% + 8px);
    width: 275px;
    max-width: calc(100vw - 20px);
  }
  .auth-card { padding: 26px 18px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .teacher-games-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .teacher-game-card {
    padding: 16px 14px;
  }
  .teacher-actions-primary .btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .teacher-actions-secondary .btn {
    padding: 6px 8px !important;
  }
}
@media (max-width: 480px) {
  .btn-block-mobile { width: 100%; }
  .modal-box { padding: 20px 16px; }
  .content { padding: 14px 10px; }
  .teacher-actions-primary {
    gap: 6px;
    width: 100%;
  }
  .teacher-actions-primary .btn {
    flex: 1;
    text-align: center;
    padding: 6px 6px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  .teacher-actions-secondary {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
  }
  .dashboard-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .dashboard-stat-grid .stat-card {
    padding: 14px 12px !important;
  }
  .dashboard-stat-grid .stat-value {
    font-size: 22px !important;
  }
  .dashboard-stat-grid .stat-label {
    font-size: 11.5px !important;
  }
  .dashboard-stat-grid .stat-sub {
    font-size: 10.5px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dashboard-stat-grid .stat-icon {
    font-size: 26px !important;
    right: 8px !important;
    bottom: 8px !important;
    opacity: 0.25 !important;
  }
}

/* ─── Sidebar overlay (mobile) ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ─── Animations ─────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up .35s var(--ease) both; }
.fade-up-2 { animation: fade-up .35s var(--ease) .1s both; }
.fade-up-3 { animation: fade-up .35s var(--ease) .2s both; }
.fade-up-4 { animation: fade-up .35s var(--ease) .3s both; }

/* ─── Scrollbar styling ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }
