@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Syne:wght@700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --c-primary: #6366f1;
  --c-primary-dark: #4f46e5;
  --c-accent: #f59e0b;
  --c-success: #10b981;
  --c-danger: #ef4444;
  --c-warning: #f97316;

  /* Dark mode (default) */
  --bg-main: #0a0a18;
  --bg-surface: rgba(255,255,255,.07);
  --bg-card: rgba(255,255,255,.04);
  --border-color: rgba(255,255,255,.08);
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --input-bg: rgba(255,255,255,.05);
  --glass-bg: rgba(255,255,255,.07);
  --glass-border: rgba(255,255,255,.12);
  --nav-bg: rgba(10,10,24,.85);
  --nav-border: rgba(255,255,255,.06);
}

body.light-mode {
  --bg-main: #f8fafc;
  --bg-surface: rgba(0,0,0,.04);
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #8ba0b2;
  --input-bg: #f1f5f9;
  --glass-bg: rgba(255,255,255,.8);
  --glass-border: #e2e8f0;
  --nav-bg: rgba(255,255,255,.95);
  --nav-border: #e2e8f0;
}

body { font-family: 'Outfit', sans-serif; background: var(--bg-main); color: var(--text-primary); transition: background .3s, color .3s; }
h1, h2, h3, .font-display { font-family: 'Syne', sans-serif; }

/* ── Theme Utility Classes ──────────────────── */
.text-primary { color: var(--text-primary); transition: color .3s; }
.text-secondary { color: var(--text-secondary); transition: color .3s; }
.text-muted { color: var(--text-muted); transition: color .3s; }
.bg-main { background-color: var(--bg-main); transition: background-color .3s; }
.bg-surface { background-color: var(--bg-surface); transition: background-color .3s; }
.bg-card { background-color: var(--bg-card); transition: background-color .3s; }
.border-theme { border-color: var(--border-color); transition: border-color .3s; }
.border-border-color { border-color: var(--border-color); transition: border-color .3s; }

/* Cleaned up light mode overrides as variables handle it now */

/* ── Animations ─────────────────────────────── */
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideInRight { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideInDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse-ring { 0%,100% { transform:scale(1); opacity:.6; } 50% { transform:scale(1.15); opacity:1; } }
@keyframes float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-12px); } }
@keyframes spin-slow { to { transform:rotate(360deg); } }
@keyframes streak-fire { 0%,100%{transform:scale(1) rotate(-5deg);} 50%{transform:scale(1.1) rotate(5deg);} }
@keyframes gradient-shift { 0%{background-position:0% 50%;} 50%{background-position:100% 50%;} 100%{background-position:0% 50%;} }
@keyframes shimmer { 0%{background-position:-200% center;} 100%{background-position:200% center;} }
@keyframes countdown-tick { 0%{transform:scale(1.1);} 100%{transform:scale(1);} }
@keyframes bar-grow { from{height:0;} to{height:var(--bar-h);} }
@keyframes xp-fill { from{width:0%;} to{width:var(--xp-w);} }
@keyframes ping-once { 0%{transform:scale(1);opacity:1;} 80%,100%{transform:scale(2);opacity:0;} }
@keyframes blob { 0%,100%{border-radius:60% 40% 30% 70%/60% 30% 70% 40%;} 50%{border-radius:30% 60% 70% 40%/50% 60% 30% 60%;} }
@keyframes bannerSlide { from{opacity:0;transform:translateY(-10px) scale(.98);} to{opacity:1;transform:translateY(0) scale(1);} }
@keyframes vsGlow { 0%,100%{box-shadow:0 0 20px rgba(99,102,241,.3);} 50%{box-shadow:0 0 40px rgba(99,102,241,.6);} }
@keyframes popIn { 0%{transform:scale(.8);opacity:0;} 70%{transform:scale(1.05);} 100%{transform:scale(1);opacity:1;} }
@keyframes scaleIn { from { opacity:0; transform:scale(.9); } to { opacity:1; transform:scale(1); } }
/* Slide out animation for notifications */
@keyframes bannerSlideOut { from{opacity:1;transform:translateY(0) scale(1);} to{opacity:0;transform:translateY(-20px) scale(.95);} }
@keyframes waveBar { 0%,100%{transform:scaleY(1);} 50%{transform:scaleY(1.8);} }
@keyframes soft-pulse { 
    0%, 100% { filter: brightness(1); border-color: var(--border-color); }
    50% { filter: brightness(1.1); box-shadow: 0 0 15px 2px rgba(99, 102, 241, 0.25); border-color: rgba(99, 102, 241, 0.4); }
}
.animate-banner-out { animation: bannerSlideOut .4s cubic-bezier(.22,1,.36,1) forwards; }

.animate-fade-up { animation: fadeUp .5s ease-out both; }
.animate-fade-in { animation: fadeIn .4s ease-out both; }
.animate-slide-right { animation: slideInRight .4s ease-out both; }
.animate-slide-down { animation: slideInDown .3s ease-out both; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-streak { animation: streak-fire 1.2s ease-in-out infinite; }
.animate-blob { animation: blob 8s ease-in-out infinite; }
.animate-pop { animation: popIn .4s cubic-bezier(.22,1,.36,1) both; }
.animate-banner { animation: bannerSlide .4s cubic-bezier(.22,1,.36,1) both; }
.animate-scale-in { animation: scaleIn .3s cubic-bezier(.22,1,.36,1) both; }
.animate-soft-pulse { animation: soft-pulse 4s ease-in-out infinite !important; }

/* ── Staggered delays ────────────────────────── */
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }
.delay-5 { animation-delay: .5s; }
.delay-6 { animation-delay: .6s; }

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#4f46e5; border-radius:999px; }
::-webkit-scrollbar-thumb:hover { background:#6366f1; }

/* ── Glass ───────────────────────────────────── */
.glass { background: var(--glass-bg); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); border:1px solid var(--glass-border); transition: background .3s, border-color .3s; }
.glass-light { background:rgba(255,255,255,.9); backdrop-filter:blur(16px); border:1px solid rgba(255,255,255,.6); }
.glass-dark { background:rgba(10,10,24,.85); backdrop-filter:blur(20px); border:1px solid rgba(255,255,255,.06); }

/* ── Gradient text ───────────────────────────── */
.text-gradient { background:linear-gradient(135deg,#818cf8,#34d399); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.text-gradient-warm { background:linear-gradient(135deg,#f59e0b,#ef4444); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

.text-3d-pro {
  color: #fff;
  font-weight: 800;
  text-shadow: 
    0 1px 0 #cbd5e1,
    0 2px 0 #94a3b8,
    0 3px 0 #64748b,
    0 4px 6px rgba(0,0,0,0.4),
    0 1px 1px rgba(0,0,0,0.1);
  letter-spacing: 0.05em;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.25));
}

/* ── XP Bar ──────────────────────────────────── */
.xp-bar-track { background:rgba(255,255,255,.1); border-radius:999px; overflow:hidden; }
.xp-bar-fill { height:100%; background:linear-gradient(90deg,#6366f1,#818cf8,#34d399); background-size:200% auto; animation:shimmer 2s linear infinite; border-radius:999px; transition:width .8s cubic-bezier(.22,1,.36,1); }

/* ── Subject Input Cards ─────────────────────── */
.subject-card-dark { transition:transform .2s, box-shadow .2s; border-radius: 12px; }
.subject-card-dark:hover { transform:translateY(-1px); box-shadow:0 4px 15px rgba(99,102,241,0.1); }
.subject-card-dark.above-avg { border: 1.5px solid #10b981 !important; background:rgba(16,185,129,0.08) !important; }
.subject-card-dark.below-avg { border: 1.5px solid #ef4444 !important; background:rgba(239,68,68,0.08) !important; }

/* ── Progress Ring ───────────────────────────── */
.progress-ring-circle { transition:stroke-dashoffset .6s cubic-bezier(.22,1,.36,1); transform:rotate(-90deg); transform-origin:50% 50%; }

/* ── Tab indicator ───────────────────────────── */
.tab-active { position:relative; }
.tab-active::after { content:''; position:absolute; bottom:-1px; left:0; right:0; height:2px; background:linear-gradient(90deg,#6366f1,#34d399); border-radius:2px; }

/* ── Risk badge pulse ────────────────────────── */
.risk-pulse::before { content:''; position:absolute; inset:0; border-radius:inherit; background:inherit; animation:ping-once 1.5s ease-out infinite; }

/* ── Student row hover ───────────────────────── */
.student-row { transition:background .15s; cursor:pointer; }
.student-row:hover td { background:rgba(99,102,241,.06) !important; }

/* ── Pomodoro ────────────────────────────────── */
.pomodoro-ring { transform:rotate(-90deg); transform-origin:50% 50%; transition:stroke-dashoffset 1s linear; }

/* ── Login animated bg ───────────────────────── */
.login-bg { background:linear-gradient(-45deg,#0f0f2e,#1a1a3e,#0d2137,#0f2244,#1a0933); background-size:400% 400%; animation:gradient-shift 12s ease infinite; }
.login-blob { position:absolute; border-radius:50%; filter:blur(80px); opacity:.35; animation:blob 10s ease-in-out infinite; }

/* ── Teacher KPI card ────────────────────────── */
.kpi-card { transition:transform .2s, box-shadow .2s; }
.kpi-card:hover { transform:translateY(-4px); box-shadow:0 20px 40px rgba(0,0,0,.1); }

/* ── Modal backdrop ──────────────────────────── */
.modal-backdrop { background:rgba(0,0,0,.6); backdrop-filter:blur(4px); }

/* ── Countdown box ───────────────────────────── */
.countdown-box { animation:countdown-tick .5s ease; }
.midnight-countdown {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    font-variant-numeric: tabular-nums;
}

.notif-btn-glow {
    position: relative;
}
.notif-btn-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}
.notif-btn-glow:hover::after {
    opacity: 1;
}

/* ── Ultimate Brand Styling ─────────────────── */
.text-ultimate {
    background: linear-gradient(to right, #fff 20%, #818cf8 40%, #818cf8 60%, #fff 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    font-weight: 900;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.3));
}

.text-gold {
    background: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
    font-weight: 900;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.sub-title-mini {
    font-size: 8px;
    font-weight: 800;
    color: rgba(129, 140, 248, 0.6);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-top: -2px;
}

/* ── Custom select ───────────────────────────── */
.custom-select { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 6 5-6' stroke='%236366f1' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; }

/* ── Notification dot ────────────────────────── */
.notif-dot { width:8px; height:8px; background:#ef4444; border-radius:50%; box-shadow:0 0 0 2px #fff; animation:ping-once 2s ease-out infinite; }

/* ── Risk bar ────────────────────────────────── */
.risk-bar { height:4px; border-radius:999px; transition:width .8s cubic-bezier(.22,1,.36,1); }

/* ── Daily Reminder Banner ───────────────────── */
.reminder-banner {
  background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(239,68,68,.15));
  border: 1.5px solid rgba(245,158,11,.3);
  border-radius: 12px;
  animation: bannerSlide .5s cubic-bezier(.22,1,.36,1) both;
  z-index: 100;
}
.reminder-banner.hiding { animation: bannerSlideOut .5s cubic-bezier(.22,1,.36,1) forwards; }
.reminder-banner-success {
  background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(99,102,241,.15));
  border: 1.5px solid rgba(16,185,129,.3);
  border-radius: 12px;
}
.reminder-banner-success.hiding { animation: bannerSlideOut .5s cubic-bezier(.22,1,.36,1) forwards; }

/* ── Weekly Summary ──────────────────────────── */
.weekly-card {
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.08));
  border: 1.5px solid rgba(99,102,241,.2);
  border-radius: 20px;
}
.weekly-stat-box {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  text-align: center;
  padding: 16px;
  transition: transform .2s;
}
.weekly-stat-box:hover { transform: translateY(-3px); }

/* ── Subject Goals Modal ─────────────────────── */
.goal-input-wrap {
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color .2s;
}
.goal-input-wrap:focus-within {
  border-color: #6366f1;
  background: rgba(99,102,241,.08);
}
.goal-input {
  background: transparent;
  color: white;
  width: 80px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
}
.goal-input::placeholder { color: #475569; }

/* ── Daily Note ──────────────────────────────── */
.note-field {
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: #cbd5e1;
  resize: none;
  transition: all .2s;
  font-family: 'Outfit', sans-serif;
}
.note-field:focus {
  outline: none;
  border-color: #818cf8;
  background: rgba(99,102,241,.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.note-field::placeholder { color: #334155; }

/* ── Note history item ───────────────────────── */
.note-chip {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .8rem;
  color: #94a3b8;
  cursor: pointer;
  transition: all .15s;
}
.note-chip:hover { background: rgba(255,255,255,.08); }

/* ── Class Competition ───────────────────────── */
.vs-card {
  background: white;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.vs-badge {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: white; font-size: .8rem;
  animation: vsGlow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(99,102,241,.4);
}
.comp-bar-track { height: 10px; border-radius: 999px; overflow: hidden; background: #f1f5f9; }
.comp-bar-fill { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(.22,1,.36,1); }

/* ── Message Template Modal ──────────────────── */
.msg-template-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  font-size: .875rem;
  line-height: 1.8;
  color: #374151;
  cursor: text;
  white-space: pre-wrap;
}
.msg-copy-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: .875rem;
  transition: all .2s;
}
.msg-copy-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99,102,241,.4); }
.msg-copy-btn.copied { background: linear-gradient(135deg, #10b981, #059669); }

/* ── Absentee Alert ──────────────────────────── */
.absent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ── Sound toggle ────────────────────────────── */
.sound-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  transition: all .2s;
  cursor: pointer;
  border: none;
  outline: none;
}
.sound-btn.on { background: rgba(99,102,241,.2); color: #818cf8; border: 1px solid rgba(99,102,241,.3); }
.sound-btn.off { background: rgba(255,255,255,.05); color: #475569; border: 1px solid rgba(255,255,255,.08); }

/* ── Theme toggle ────────────────────────────── */
.theme-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
  outline: none;
}
.theme-btn:hover { background: rgba(255,255,255,.1); color: white; }


/* ── Light Mode: Student Dashboard ──────────────────────────────────────────── */
body.light-mode .nav-dark {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #e2e8f0;
}
body.light-mode .nav-dark * { color: #1e293b; }
body.light-mode .nav-dark .text-gray-400 { color: #64748b !important; }
body.light-mode .nav-dark .text-gray-500 { color: #64748b !important; }
body.light-mode .nav-dark .text-white { color: #1e293b !important; }
body.light-mode .nav-dark .text-indigo-400 { color: #4f46e5 !important; }
body.light-mode .nav-dark .text-indigo-300 { color: #4f46e5 !important; }
body.light-mode .nav-dark .text-rose-400 { color: #e11d48 !important; }
body.light-mode .nav-dark .text-rose-300 { color: #e11d48 !important; }
body.light-mode .nav-dark .bg-indigo-500\/10 { background: rgba(99,102,241,.12) !important; }
body.light-mode .nav-dark .border-indigo-500\/20 { border-color: rgba(99,102,241,.3) !important; }
body.light-mode .nav-dark .bg-rose-500\/10 { background: rgba(225,29,72,.1) !important; }
body.light-mode .nav-dark .border-rose-500\/20 { border-color: rgba(225,29,72,.25) !important; }

/* XP section */
body.light-mode #xp-section .text-white { color: #1e293b !important; }
body.light-mode #xp-section .text-indigo-300 { color: #4f46e5 !important; }
body.light-mode #xp-section .text-indigo-400 { color: #4f46e5 !important; }
body.light-mode #xp-section .bg-surface { background: #f1f5f9 !important; }
body.light-mode #xp-section .border-border-color { border-color: #e2e8f0 !important; }

/* KPI cards */
body.light-mode #kpi-cards .text-white { color: #1e293b !important; }
body.light-mode #kpi-cards .text-indigo-300 { color: #4f46e5 !important; }
body.light-mode #kpi-cards .text-gray-400 { color: #64748b !important; }
body.light-mode #kpi-cards .glass {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Subject cards */
body.light-mode .subject-card-dark {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
body.light-mode .subject-card-dark.above-avg {
  background: rgba(16,185,129,.08) !important;
  border-color: #10b981 !important;
}
body.light-mode .subject-card-dark.below-avg {
  background: rgba(239,68,68,.08) !important;
  border-color: #ef4444 !important;
}
body.light-mode .subject-input {
  color: #4f46e5 !important;
}
body.light-mode .subject-input::placeholder { color: #94a3b8 !important; }
body.light-mode .subject-card-dark .text-white {
  color: #1e293b !important;
}
body.light-mode .subject-card-dark .sub-val-label.text-indigo-400 { color: #4f46e5 !important; }
body.light-mode .subject-card-dark .bg-black\/30 { background: rgba(0,0,0,.06) !important; }
body.light-mode .subject-card-dark .text-white { color: #374151 !important; }
body.light-mode .subject-card-dark .bg-white\/5 { background: #e2e8f0 !important; }

/* Tab bar */
body.light-mode .tab-btn { color: #64748b; }
body.light-mode .tab-btn:hover { color: #1e293b; }
body.light-mode .tab-btn.tab-active { color: #4f46e5; }
body.light-mode .border-white\/6 { border-color: #e2e8f0 !important; }

/* Card-dark in light mode */
body.light-mode .card-dark {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
body.light-mode .card-dark .text-white { color: #1e293b !important; }
body.light-mode .card-dark .text-gray-500 { color: #64748b !important; }
body.light-mode .card-dark .text-gray-600 { color: #475569 !important; }
body.light-mode .card-dark .text-gray-400 { color: #64748b !important; }
body.light-mode .card-dark .text-gray-300 { color: #374151 !important; }
body.light-mode .card-dark .text-indigo-300 { color: #4f46e5 !important; }
body.light-mode .card-dark .text-indigo-400 { color: #4f46e5 !important; }
body.light-mode .card-dark .text-indigo-200 { color: #4f46e5 !important; }
body.light-mode .card-dark .text-emerald-300 { color: #059669 !important; }
body.light-mode .card-dark .text-emerald-400 { color: #059669 !important; }
body.light-mode .card-dark .text-rose-400 { color: #e11d48 !important; }
body.light-mode .card-dark .text-amber-400 { color: #b45309 !important; }
body.light-mode .card-dark .bg-white\/4 { background: #f8fafc !important; }
body.light-mode .card-dark .bg-white\/3 { background: #f8fafc !important; }
body.light-mode .card-dark .bg-white\/5 { background: #f1f5f9 !important; }
body.light-mode .card-dark .border-white\/6 { border-color: #e2e8f0 !important; }
body.light-mode .card-dark .border-white\/10 { border-color: #e2e8f0 !important; }
body.light-mode .card-dark .border-white\/5 { border-color: #f1f5f9 !important; }
body.light-mode .card-dark .bg-indigo-500\/10 { background: rgba(99,102,241,.1) !important; }
body.light-mode .card-dark .bg-indigo-500\/20 { background: rgba(99,102,241,.12) !important; }
body.light-mode .card-dark .border-indigo-500\/20 { border-color: rgba(99,102,241,.3) !important; }
body.light-mode .card-dark .text-indigo-300\/60 { color: rgba(79,70,229,.5) !important; }
body.light-mode .card-dark .text-emerald-300\/60 { color: rgba(5,150,105,.5) !important; }
body.light-mode .card-dark .text-amber-400\/60 { color: rgba(180,83,9,.5) !important; }

/* History table sticky cells — overrides hardcoded bg-[#...] */
body.light-mode #historyTableHeader,
body.light-mode #historyTableHeader th { background: #f8fafc !important; color: #374151 !important; }
body.light-mode #historyTableHeader .text-indigo-400 { color: #4f46e5 !important; }
body.light-mode #historyTableHeader .text-amber-400 { color: #b45309 !important; }
body.light-mode #historyTableHeader .text-gray-400 { color: #64748b !important; }
body.light-mode #historyTableBody td { background: #ffffff !important; color: #374151 !important; }
body.light-mode #historyTableBody tr:nth-child(even) td { background: #f8fafc !important; }
body.light-mode #historyTableBody tr:hover td { background: #eef2ff !important; }
body.light-mode #historyTableBody .text-white { color: #1e293b !important; }
body.light-mode #historyTableBody .text-gray-400 { color: #64748b !important; }
body.light-mode #historyTableBody .text-gray-700 { color: #374151 !important; }
body.light-mode #historyTableBody .text-emerald-400 { color: #059669 !important; }
body.light-mode #historyTableBody .text-red-400 { color: #dc2626 !important; }
body.light-mode #historyTableBody .border-white\/10 { border-color: #e2e8f0 !important; }
body.light-mode #historyTableBody .border-white\/5 { border-color: #f1f5f9 !important; }

/* Goals modal */
body.light-mode .goal-input-wrap { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.light-mode .goal-input-wrap:focus-within { background: #eef2ff !important; border-color: #6366f1 !important; }
body.light-mode .goal-input { color: #1e293b !important; }

/* Weekly summary modal */
body.light-mode #weeklySummaryModal .modal-box-lg { background: #ffffff !important; border-color: #e2e8f0 !important; }
body.light-mode #weeklySummaryModal .text-white { color: #1e293b !important; }
body.light-mode #weeklySummaryModal .text-gray-500 { color: #64748b !important; }
body.light-mode #weeklySummaryModal .text-gray-700 { color: #374151 !important; }
body.light-mode #weeklySummaryModal .text-gray-600 { color: #475569 !important; }
body.light-mode #weeklySummaryModal .bg-white\/5 { background: #f1f5f9 !important; }
body.light-mode .weekly-stat-box { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.light-mode .weekly-stat-box .text-white { color: #1e293b !important; }

/* Modals (goals, pomodoro) */
body.light-mode .modal-box,
body.light-mode .modal-box-lg {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light-mode .modal-box .text-white { color: #1e293b !important; }
body.light-mode .modal-box .text-gray-600 { color: #475569 !important; }
body.light-mode .modal-box .bg-white\/4 { background: #f8fafc !important; }
body.light-mode .modal-box .bg-white\/5 { background: #f1f5f9 !important; }
body.light-mode .modal-box .text-gray-400 { color: #64748b !important; }
body.light-mode .modal-box .bg-white\/8 { background: #f1f5f9 !important; }
body.light-mode .modal-box .border-white\/8 { border-color: #e2e8f0 !important; }
body.light-mode .modal-box .text-gray-700 { color: #374151 !important; }

/* AI output area */
body.light-mode #aiOutput { background: #f8fafc !important; border-color: #e2e8f0 !important; color: #374151 !important; }
body.light-mode #aiOutput .text-gray-600 { color: #475569 !important; }
body.light-mode #aiOutput .text-gray-700 { color: #374151 !important; }

/* Glass in light mode - student dashboard specific */
body.light-mode .glass {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

/* Section label */
body.light-mode .section-label { color: #64748b !important; }

/* Reminder banner */
body.light-mode .reminder-card { background: #fef9ec !important; border-color: #fcd34d !important; }
body.light-mode .reminder-card.success { background: #f0fdf4 !important; border-color: #86efac !important; }
body.light-mode .reminder-card.info { background: #eff6ff !important; border-color: #bfdbfe !important; }

/* ── Print styles ────────────────────────────── */
@media print {
  nav, .no-print, button, .modal-backdrop { display: none !important; }
  body { background: white !important; color: black !important; font-size: 11pt; }
  .card-dark, .glass { background: white !important; border: 1px solid #e2e8f0 !important; color: black !important; }
  .text-white { color: black !important; }
  .text-gray-400, .text-gray-500, .text-gray-600 { color: #666 !important; }
  .text-indigo-400 { color: #4f46e5 !important; }
  .text-emerald-400 { color: #059669 !important; }
  .text-red-400 { color: #dc2626 !important; }
  main { max-width: 100% !important; }
  @page { margin: 1.5cm; }
  .print-section { break-inside: avoid; }
  .print-title { font-size: 16pt; font-weight: bold; margin-bottom: 12pt; }
  .print-header { border-bottom: 2px solid #4f46e5; padding-bottom: 8pt; margin-bottom: 16pt; }
}

/* ── Waving sound indicator ──────────────────── */
.sound-wave {
  display: flex; align-items: center; gap: 2px; height: 16px;
}
.sound-wave span {
  display: block; width: 3px; border-radius: 999px;
  background: #818cf8;
}
.sound-wave span:nth-child(1) { height: 8px; animation: waveBar .6s ease-in-out infinite; }
.sound-wave span:nth-child(2) { height: 14px; animation: waveBar .6s ease-in-out infinite .15s; }
.sound-wave span:nth-child(3) { height: 10px; animation: waveBar .6s ease-in-out infinite .3s; }

/* ── Tooltip ─────────────────────────────────── */
.tooltip-wrap { position: relative; }
.tooltip-wrap .tooltip {
  position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
  background: #1e1b4b; color: white; font-size: .7rem; white-space: nowrap;
  padding: 4px 10px; border-radius: 8px; pointer-events: none; opacity: 0;
  transition: opacity .2s; z-index: 50;
}
.tooltip-wrap:hover .tooltip { opacity: 1; }

/* ── Separator with label ────────────────────── */
.sep-label {
  display: flex; align-items: center; gap: 12px;
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #475569;
}
.sep-label::before, .sep-label::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.06);
}

/* ── Streak flame effect ─────────────────────── */
.streak-glow { text-shadow: 0 0 20px rgba(251,146,60,.8); }

/* ── Competition winner badge ────────────────── */
.winner-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Dark mode teacher panel ─────────────────── */
body.teacher-dark {
  background: #0a0a18;
}
body.teacher-dark .bg-white { background: #12121e !important; }
body.teacher-dark .bg-slate-50 { background: #0a0a18 !important; }
body.teacher-dark .text-gray-900, body.teacher-dark .text-gray-800, body.teacher-dark .text-gray-700 { color: #e2e8f0 !important; }
body.teacher-dark .text-gray-500, body.teacher-dark .text-gray-600 { color: #64748b !important; }
body.teacher-dark .border-gray-100, body.teacher-dark .border-gray-200 { border-color: rgba(255,255,255,.08) !important; }
body.teacher-dark .bg-gray-50 { background: rgba(255,255,255,.04) !important; }
body.teacher-dark .bg-indigo-50 { background: rgba(99,102,241,.15) !important; }
body.teacher-dark .bg-red-50 { background: rgba(239,68,68,.1) !important; }
body.teacher-dark .bg-amber-50 { background: rgba(245,158,11,.1) !important; }
body.teacher-dark .bg-emerald-50 { background: rgba(16,185,129,.1) !important; }
body.teacher-dark .bg-blue-50 { background: rgba(59,130,246,.1) !important; }
body.teacher-dark .shadow-sm { box-shadow: none !important; }
body.teacher-dark .filter-input { background: rgba(255,255,255,.05) !important; border-color: rgba(255,255,255,.1) !important; color: #e2e8f0 !important; }
body.teacher-dark .filter-select { background: rgba(255,255,255,.05) !important; border-color: rgba(255,255,255,.1) !important; color: #e2e8f0 !important; }
body.teacher-dark .ai-output-teacher { background: rgba(255,255,255,.04) !important; border-color: rgba(255,255,255,.1) !important; color: #cbd5e1 !important; }

/* ── Animated progress bar fill ──────────────── */
.bar-animated {
  transition: width 1.2s cubic-bezier(.22,1,.36,1);
}

/* ── Goal progress circle ────────────────────── */
.goal-ring { transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .8s cubic-bezier(.22,1,.36,1); }

/* ── Excel Grid Table Extensions ──────────────── */
.excel-grid-table th, .excel-grid-table td {
  padding: 0 !important;
  border: 1px solid #e2e8f0;
}

.grid-name-col {
  left: 0;
  min-width: 140px;
  max-width: 140px;
  z-index: 20;
  box-shadow: 2px 0 5px -2px rgba(0,0,0,0.05);
}

.excel-scroll::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.excel-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.excel-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Vertical Text Header Enhancement */
.vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  padding: 12px 4px !important;
  text-align: center;
  font-size: 10px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  line-height: 1 !important;
}

/* Teacher Dark Mode Adjustments for Grid */
body.teacher-dark .excel-grid-table th, 
body.teacher-dark .excel-grid-table td {
  border-color: rgba(255,255,255,0.08);
}

body.teacher-dark .grid-name-col {
  background-color: #12121e !important;
}

body.teacher-dark .grid-name-col .bg-white {
  background-color: #12121e !important;
}

body.teacher-dark .excel-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
}

body.teacher-dark .excel-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ── Grid Period Buttons ─────────────────────── */
.grid-period-btn {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all .2s;
  text-transform: uppercase;
}

.grid-period-btn:hover {
  background: #e2e8f0;
  color: #475569;
}

.grid-period-btn.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.3);
}

/* ── Grid Multi-Column Sticky ────────────────── */
.grid-name-col { left: 0; min-width: 40px; max-width: 40px; }
.grid-class-col { left: 40px; min-width: 140px; max-width: 140px; border-right: 2px solid #f1f5f9; }

/* Student History Modal Sticky Dates */
.shm-date-col {
  position: sticky;
  left: 0;
  z-index: 10;
  background: white;
  min-width: 80px;
  border-right: 2px solid #f1f5f9;
}

body.teacher-dark .grid-period-btn {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}

body.teacher-dark .grid-period-btn.active {
  background: #4f46e5;
  color: white;
}

body.teacher-dark .shm-date-col {
  background: #12121e;
  border-right-color: rgba(255,255,255,0.08);
}
