/* =========================================
   Derstina — English Tutoring Platform
   Global Styles
   ========================================= */

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

/* --- Variables --- */
:root {
  --primary:       #2563EB;
  --primary-dark:  #1E40AF;
  --primary-light: #DBEAFE;
  --accent:        #10B981;
  --accent-dark:   #059669;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --bg:            #F8FAFC;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --text:          #1A202C;
  --muted:         #718096;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.12);
  --sidebar-w:     240px;
  --topbar-h:      64px;
  --transition:    0.18s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- Utility --- */
.hidden { display: none !important; }
.text-muted { color: var(--muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-ghost { background: transparent; color: var(--primary); padding: 0.4rem 0.75rem; }
.btn-ghost:hover { background: var(--primary-light); box-shadow: none; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-trial    { background: #FEF3C7; color: #92400E; }
.badge-active   { background: #D1FAE5; color: #065F46; }
.badge-completed { background: #E0E7FF; color: #3730A3; }
.badge-paused   { background: #F3F4F6; color: #6B7280; }

/* --- Forms --- */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-control::placeholder { color: #A0AEC0; }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* --- Skill Sliders --- */
.skill-group { margin-bottom: 1.25rem; }
.skill-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.skill-value {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  min-width: 2rem;
  text-align: center;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* --- Checkbox / Checkpill --- */
.check-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.check-pill input[type="checkbox"] { display: none; }
.check-pill label {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.check-pill input:checked + label {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Alerts --- */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 4px solid transparent;
}
.alert-error   { background: #FEE2E2; border-color: var(--danger);  color: #991B1B; }
.alert-success { background: #D1FAE5; border-color: var(--accent);  color: #065F46; }
.alert-info    { background: #DBEAFE; border-color: var(--primary); color: #1E40AF; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* =========================================
   LANDING PAGE
   ========================================= */
.landing-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.logo span { color: var(--text); }

.hero {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 60%, #3B82F6 100%);
  color: #fff;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  letter-spacing: -0.5px;
}
.hero p {
  font-size: 1.125rem;
  opacity: 0.88;
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-hero { background: #fff; color: var(--primary); font-size: 1rem; font-weight: 700; padding: 0.85rem 2rem; }
.btn-hero:hover { background: #EFF6FF; }
.btn-hero-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.6); font-size: 1rem; font-weight: 700; padding: 0.85rem 2rem; }
.btn-hero-outline:hover { background: rgba(255,255,255,0.12); box-shadow: none; }

.section { padding: 5rem 1.5rem; }
.section-title { font-size: 1.75rem; font-weight: 700; text-align: center; margin-bottom: 0.75rem; letter-spacing: -0.3px; }
.section-subtitle { text-align: center; color: var(--muted); font-size: 1rem; margin-bottom: 3rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  display: block;
}
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.step { text-align: center; }
.step-num {
  width: 48px; height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.step h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; }
.step p { font-size: 0.85rem; color: var(--muted); }

.cta-section {
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  color: #fff;
  text-align: center;
  padding: 5rem 1.5rem;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.cta-section p { opacity: 0.85; margin-bottom: 2rem; font-size: 1.05rem; }

.landing-footer {
  background: #1A202C;
  color: #A0AEC0;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
}

/* =========================================
   AUTH PAGE
   ========================================= */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
}
.auth-left .logo { color: #fff; font-size: 1.6rem; margin-bottom: 2rem; }
.auth-left h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.3; }
.auth-left p { opacity: 0.82; font-size: 1rem; margin-bottom: 2rem; }
.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.auth-feature-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  background: var(--bg);
}
.auth-box { max-width: 400px; width: 100%; margin: 0 auto; }
.auth-box h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-box .text-muted { margin-bottom: 2rem; }
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.75rem;
  gap: 0;
}
.auth-tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* =========================================
   APP SHELL (Sidebar + Topbar)
   ========================================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #1E293B;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.25rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: -0.3px;
}
.sidebar-logo span { color: #60A5FA; }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-section { padding: 0.25rem 1rem 0.25rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #475569; margin-top: 0.5rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94A3B8;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.sidebar-link.active { background: rgba(37,99,235,0.25); color: #93C5FD; border-right: 3px solid #3B82F6; }
.sidebar-link .icon { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.sidebar-footer {
  padding: 1.25rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
}
.sidebar-teacher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  background: #3B82F6;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-teacher-info { overflow: hidden; }
.sidebar-teacher-name { font-weight: 600; color: #E2E8F0; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-teacher-role { color: #64748B; font-size: 0.72rem; }
.plan-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; letter-spacing: 0.03em; margin-top: 0.15rem; }
.plan-badge.lite { background: #DBEAFE; color: #1D4ED8; }
.plan-badge.standard { background: #D1FAE5; color: #047857; }
.plan-badge.pro { background: #FEF3C7; color: #B45309; }
.plan-badge.free { background: #F1F5F9; color: #64748B; }

/* --- Pro plan visual enhancements --- */
body.pro-plan .sidebar { background: linear-gradient(180deg, #1A1A2E 0%, #16213E 100%); }
body.pro-plan .sidebar-avatar { background: linear-gradient(135deg, #B45309, #F59E0B); }
body.pro-plan .sidebar-link:hover, body.pro-plan .sidebar-link.active { background: rgba(245,158,11,0.12); color: #F59E0B; }
body.pro-plan .topbar { border-bottom: 2px solid #FDE68A; }
body.pro-plan .stat-card { border: 1px solid #FDE68A; }
body.pro-plan .student-card { border: 1px solid #FDE68A; }
body.pro-plan .student-card:hover { box-shadow: 0 4px 16px rgba(217,119,6,0.15); }
body.pro-plan .student-avatar { background: linear-gradient(135deg, #B45309, #F59E0B); }
body.pro-plan .profile-avatar-lg { background: linear-gradient(135deg, #B45309, #F59E0B); }
body.pro-plan .card { border: 1px solid #FDE68A; }
body.pro-plan .lesson-item.planned { border-left-color: #D97706; }
body.pro-plan .skill-bar-fill { background: linear-gradient(90deg, #D97706, #F59E0B); }

/* Account modal */
.sidebar-teacher.clickable { cursor: pointer; border-radius: 8px; padding: 0.35rem; margin: -0.35rem; transition: background 0.2s; }
.sidebar-teacher.clickable:hover { background: rgba(255,255,255,0.08); }
.account-modal-content { max-width: 440px; }
.account-plan-header { text-align: center; margin-bottom: 1.25rem; }
.account-plan-badge { display: inline-block; font-size: 0.85rem; font-weight: 700; padding: 0.4rem 1.25rem; border-radius: 999px; letter-spacing: 0.03em; }
.account-plan-badge.free { background: #F1F5F9; color: #64748B; }
.account-plan-badge.lite { background: #DBEAFE; color: #1D4ED8; }
.account-plan-badge.standard { background: #D1FAE5; color: #047857; }
.account-plan-badge.pro { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #B45309; }
.account-info { margin-bottom: 1.25rem; }
.account-info-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.account-info-row:last-child { border-bottom: none; }
.account-info-label { color: var(--muted); font-weight: 500; }
.account-info-value { font-weight: 600; text-align: right; }
.account-features-section { background: var(--bg); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.account-features-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.75rem; }
.account-features { list-style: none; padding: 0; margin: 0; }
.account-features li { font-size: 0.85rem; padding: 0.3rem 0; display: flex; gap: 0.5rem; align-items: center; }
.account-features li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.account-upgrade { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); border: 1px solid #BFDBFE; border-radius: 10px; padding: 1rem 1.25rem; text-align: center; }
.account-upgrade-title { font-weight: 700; font-size: 0.95rem; color: #1E40AF; margin-bottom: 0.25rem; }
.account-upgrade p { font-size: 0.82rem; color: #3B82F6; margin: 0 0 0.75rem; }

/* Welcome banner */
.welcome-banner { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); border: 1px solid #BFDBFE; border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.welcome-banner.hidden { display: none; }
.welcome-banner-content h3 { margin: 0 0 0.25rem; font-size: 1.1rem; color: #1E40AF; }
.welcome-banner-content p { margin: 0; color: #3B82F6; font-size: 0.9rem; }
.welcome-banner-dismiss { background: none; border: none; font-size: 1.5rem; color: #93C5FD; cursor: pointer; padding: 0 0.25rem; line-height: 1; }
.welcome-banner-dismiss:hover { color: #1D4ED8; }

/* Onboarding tutorial */
.tutorial-overlay { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.tutorial-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9001; pointer-events: auto; transition: opacity 0.3s; }
.tutorial-spotlight { position: absolute; z-index: 9002; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.55); pointer-events: none; transition: all 0.4s ease; }
.tutorial-tooltip { position: absolute; z-index: 9003; background: #fff; border-radius: 14px; padding: 1.5rem; width: 320px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); pointer-events: auto; transition: all 0.4s ease; }
.tutorial-tooltip-step { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 0.4rem; }
.tutorial-tooltip-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.35rem; }
.tutorial-tooltip-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }
.tutorial-actions { display: flex; align-items: center; justify-content: space-between; }
.tutorial-dots { display: flex; gap: 0.35rem; }
.tutorial-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background 0.2s; }
.tutorial-dot.active { background: var(--primary); }
.tutorial-btn-skip { background: none; border: none; color: var(--muted); font-size: 0.82rem; cursor: pointer; padding: 0.4rem 0; }
.tutorial-btn-skip:hover { color: var(--text); }
.tutorial-btn-next { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 0.5rem 1.25rem; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.tutorial-btn-next:hover { background: var(--primary-dark); }

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title { font-size: 1.15rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.page-content { padding: 2rem; flex: 1; }

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  font-size: 1.75rem;
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #DBEAFE; }
.stat-icon.green  { background: #D1FAE5; }
.stat-icon.yellow { background: #FEF3C7; }
.stat-icon.purple { background: #EDE9FE; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; margin-top: 0.2rem; }

/* --- Students Grid --- */
.students-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.students-header h2 { font-size: 1.1rem; font-weight: 700; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.search-input {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  width: 220px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--primary); }
.filter-select {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
  cursor: pointer;
  outline: none;
}

.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.student-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.student-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.student-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.student-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.student-name { font-weight: 600; font-size: 0.975rem; }
.student-level { font-size: 0.78rem; color: var(--muted); }
.student-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.student-next-lesson { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }
.student-card-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
  grid-column: 1 / -1;
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; margin-bottom: 1.5rem; }

/* =========================================
   STUDENT PROFILE PAGE
   ========================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--muted); }

.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.profile-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.profile-avatar-block { text-align: center; padding: 1.75rem; }
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
  margin: 0 auto 1rem;
}
.profile-name { font-size: 1.15rem; font-weight: 700; }
.profile-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-label { color: var(--muted); font-weight: 500; }
.profile-info-value { font-weight: 500; }

.level-indicator {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}
.level-A1, .level-A2 { background: #FEE2E2; color: #991B1B; }
.level-B1, .level-B2 { background: #FEF3C7; color: #92400E; }
.level-C1, .level-C2 { background: #D1FAE5; color: #065F46; }

/* Skills Bar Chart */
.skills-chart { display: flex; flex-direction: column; gap: 0.85rem; }
.skill-bar-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; }
.skill-bar-label { width: 80px; font-weight: 500; flex-shrink: 0; }
.skill-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.5s ease; }
.skill-bar-num { width: 28px; text-align: right; font-weight: 600; color: var(--muted); }

/* Lesson Plan */
.lesson-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.lesson-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lesson-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: box-shadow var(--transition);
}
.lesson-item.completed { border-left: 4px solid var(--accent); }
.lesson-item.planned   { border-left: 4px solid var(--primary); }
.lesson-item.cancelled { border-left: 4px solid #E2E8F0; opacity: 0.7; }
.lesson-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.lesson-item-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lesson-num {
  width: 28px; height: 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.lesson-num.done { background: #D1FAE5; color: var(--accent-dark); }
.lesson-main-title { font-weight: 600; font-size: 0.9rem; }
.lesson-date { font-size: 0.78rem; color: var(--muted); }
.lesson-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color var(--transition);
}
.lesson-expand-btn:hover { color: var(--text); }
.lesson-details { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); display: none; }
.lesson-details.open { display: block; }
.lesson-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; font-size: 0.85rem; }
.lesson-detail-item dt { font-weight: 600; color: var(--muted); margin-bottom: 0.2rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.lesson-detail-item dd { color: var(--text); }
.lesson-detail-item.full { grid-column: 1 / -1; }
.lesson-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lesson-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
}

/* =========================================
   ASSESSMENT PAGE
   ========================================= */
.assessment-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.progress-step.done:not(:last-child)::after { background: var(--primary); }
.progress-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  position: relative; z-index: 1;
  transition: all var(--transition);
}
.progress-step.active .progress-dot { background: var(--primary); color: #fff; }
.progress-step.done .progress-dot { background: var(--accent); color: #fff; }
.progress-label { font-size: 0.72rem; margin-top: 0.4rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.progress-step.active .progress-label { color: var(--primary); }

.assessment-step { display: none; }
.assessment-step.active { display: block; }
.step-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.step-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.75rem; }

.cefr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}
.cefr-option input { display: none; }
.cefr-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.cefr-level { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.cefr-desc { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; }
.cefr-option input:checked + .cefr-label {
  border-color: var(--primary);
  background: var(--primary-light);
}
.cefr-option input:checked + .cefr-label .cefr-level { color: var(--primary); }

.assessment-nav { display: flex; gap: 1rem; justify-content: space-between; margin-top: 2rem; }

/* =========================================
   CALENDAR PAGE
   ========================================= */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calendar-day-header {
  background: var(--surface);
  padding: 0.6rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.calendar-cell {
  background: var(--surface);
  min-height: 110px;
  padding: 0.5rem;
  vertical-align: top;
}
.calendar-cell.outside {
  background: var(--bg);
  opacity: 0.4;
}
.calendar-cell.today {
  background: #EFF6FF;
}
.calendar-date {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.calendar-cell.today .calendar-date {
  color: var(--primary);
  font-weight: 700;
}
.calendar-lesson {
  display: block;
  padding: 0.2rem 0.4rem;
  font-size: 0.68rem;
  border-radius: 4px;
  margin-bottom: 0.2rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-lesson:hover { text-decoration: none; opacity: 0.85; }
.calendar-lesson.planned   { background: var(--primary-light); color: var(--primary-dark); }
.calendar-lesson.completed { background: #D1FAE5; color: #065F46; }
.calendar-lesson.cancelled { background: #F3F4F6; color: #6B7280; text-decoration: line-through; }
body.pro-plan .calendar-lesson.planned { background: #FEF3C7; color: #B45309; }
body.pro-plan .calendar-cell.today { background: #FFFBEB; }

/* =========================================
   ACCOUNT PAGE
   ========================================= */
.account-page-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.account-page-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.35rem;
  flex-shrink: 0;
}
.account-page-name { font-size: 1.2rem; font-weight: 700; }
.account-page-email { font-size: 0.85rem; color: var(--muted); margin-top: 0.1rem; }
body.pro-plan .account-page-avatar { background: linear-gradient(135deg, #B45309, #F59E0B); }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .assessment-progress { gap: 0; }
  .progress-step:not(:last-child)::after { width: 50px; }
}
