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

:root {
  --blue: #3B8FE8;
  --blue-dark: #1E6BC7;
  --blue-light: #EBF4FF;
  --blue-mid: #93C5FD;
  --coral: #E8524A;
  --coral-light: #FFF0EF;
  --teal: #0EA875;
  --teal-light: #E6FAF2;
  --teal-dark: #087A54;
  --amber: #F59E0B;
  --amber-light: #FFFBEB;
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --transition: 0.18s ease;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--gray-50); color: var(--gray-900); line-height: 1.6; min-height: 100vh; }

/* ── AUTH ─────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #EBF4FF 0%, #F9FAFB 50%, #E6FAF2 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.auth-logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.auth-sub { font-size: 14px; color: var(--gray-500); margin-bottom: 28px; }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-900);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,143,232,0.12);
  background: var(--white);
}

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(59,143,232,0.35);
}

.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 6px 20px rgba(59,143,232,0.45); }
.btn-primary:active { transform: scale(0.99); }

.btn-google {
  width: 100%;
  height: 46px;
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
}

.btn-google:hover { background: var(--gray-50); border-color: var(--gray-300); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray-400);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

.auth-switch { text-align: center; margin-top: 24px; font-size: 13px; color: var(--gray-500); }
.auth-switch a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.auth-error {
  background: var(--red-light);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #FECACA;
}

/* ── APP SHELL ─────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-footer-text,
.sidebar.collapsed .upgrade-btn-text,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-lock-badge { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 20px 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.sidebar.collapsed .sidebar-footer { padding: 12px 0; }
.sidebar.collapsed .user-chip { justify-content: center; }
.sidebar.collapsed .upgrade-sidebar-btn { justify-content: center; padding: 10px 0; border-radius: 0; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 68px;
  flex-shrink: 0;
}

.sidebar-logo img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  white-space: nowrap;
}

.sidebar-logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 10px;
  margin: 14px 0 4px;
  white-space: nowrap;
}
.nav-section-label:first-child { margin-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  font-family: var(--font-body);
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }

.nav-item.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 10px rgba(59,143,232,0.4);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-label { flex: 1; }

.upgrade-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 10px;
  padding: 11px 14px;
  background: linear-gradient(135deg, var(--blue), #6366F1);
  border-radius: var(--radius-md);
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  border: none;
  width: calc(100% - 20px);
  text-align: left;
  transition: opacity var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(59,143,232,0.35);
}

.upgrade-sidebar-btn:hover { opacity: 0.9; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.user-chip:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6366F1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.user-info { overflow: hidden; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
}

.user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapse toggle button */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: var(--sidebar-w);
  width: 24px;
  height: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  transition: left 0.22s ease;
  box-shadow: var(--shadow-sm);
  transform: translateX(-50%);
}

.sidebar-toggle:hover { background: var(--blue); color: white; border-color: var(--blue); }
.sidebar-toggle svg { width: 12px; height: 12px; }

body.sidebar-collapsed .sidebar-toggle { left: var(--sidebar-collapsed-w); }

/* ── MAIN ─────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease;
}

body.sidebar-collapsed .main { margin-left: var(--sidebar-collapsed-w); }

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.btn-sm {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
}

.btn-sm:hover { border-color: var(--gray-300); color: var(--gray-800); background: var(--gray-50); }

.btn-sm.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59,143,232,0.3);
}

.btn-sm.primary:hover { background: var(--blue-dark); }

.page-content { padding: 28px 32px; flex: 1; max-width: 1200px; }

/* ── CARDS ─────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-sm {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

/* ── STAT GRID ─────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--gray-400); font-weight: 400; }

/* ── HERO BAND ─────────────────────────────────── */
.hero-band {
  background: linear-gradient(135deg, var(--gray-900) 0%, #1a2744 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.hero-band::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59,143,232,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-greeting {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-week { font-size: 13px; color: rgba(255,255,255,0.5); }

.hero-quote {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-style: italic;
  margin-top: 10px;
  border-left: 2px solid rgba(59,143,232,0.5);
  padding-left: 12px;
  max-width: 380px;
}

.countdown-block { text-align: right; flex-shrink: 0; }

.countdown-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  color: white;
  line-height: 1;
}

.countdown-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── BODY GRID ─────────────────────────────────── */
.body-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.col-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ── SECTION TITLES ─────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.section-sub { font-size: 13px; color: var(--gray-400); margin-bottom: 20px; }

/* ── SESSION ITEMS ─────────────────────────────── */
.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}

.session-item:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,143,232,0.08); }
.session-item.done { opacity: 0.5; }
.session-item.done .session-title { text-decoration: line-through; }

.session-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--white);
}

.session-check.checked { background: var(--teal); border-color: var(--teal); }
.session-check svg { display: none; }
.session-check.checked svg { display: block; }

.session-info { flex: 1; min-width: 0; }
.session-title { font-size: 14px; font-weight: 500; color: var(--gray-800); margin-bottom: 2px; }
.session-meta { font-size: 11px; color: var(--gray-400); }

.session-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.badge-cp { background: #EFF6FF; color: #1D4ED8; }
.badge-cars { background: #FFFBEB; color: #92400E; }
.badge-bb { background: #ECFDF5; color: #065F46; }
.badge-ps { background: #F5F3FF; color: #5B21B6; }

/* ── PROGRESS BARS ─────────────────────────────── */
.prog-row { margin-bottom: 14px; }
.prog-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.prog-name { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.prog-pct { font-size: 12px; color: var(--gray-400); font-weight: 500; }

.prog-track {
  height: 7px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.prog-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

/* ── STREAK GRID ─────────────────────────────────── */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 16px;
}

.streak-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.streak-cell.on { background: var(--teal); border-color: var(--teal-dark); }
.streak-cell.partial { background: #86EFAC; border-color: var(--teal); }
.streak-cell.today { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ── WELLNESS ─────────────────────────────────── */
.wellness-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wellness-label { font-size: 12px; color: var(--gray-600); font-weight: 500; }
.dot-row { display: flex; gap: 5px; }

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}

.dot:hover { border-color: var(--blue); }
.dot.sel-energy { background: var(--teal); border-color: var(--teal-dark); }
.dot.sel-stress { background: var(--coral); border-color: #C0392B; }

/* ── QUICK LINKS ─────────────────────────────── */
.quicklinks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.qlink {
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  text-decoration: none;
}

.qlink:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,143,232,0.08); transform: translateY(-1px); }

.qlink-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qlink-label { font-size: 11px; color: var(--gray-500); font-weight: 600; letter-spacing: 0.02em; }

/* ── TRACKER ─────────────────────────────────── */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.topic-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
}

.topic-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }

.section-filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.filter-pill {
  height: 34px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--gray-500);
}

.filter-pill:hover { border-color: var(--blue); color: var(--blue); }
.filter-pill.active { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 2px 8px rgba(59,143,232,0.3); }

.mastery-select {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}

/* ── STUDY GUIDE ─────────────────────────────── */
.guide-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.guide-toc { position: sticky; top: 92px; height: fit-content; }

.toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-500);
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 500;
}

.toc-item:hover { background: var(--gray-100); color: var(--gray-800); }
.toc-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

.guide-section { margin-bottom: 48px; }
.guide-section h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.guide-section p { font-size: 15px; color: var(--gray-600); line-height: 1.75; margin-bottom: 16px; }
.guide-section h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--gray-800); margin: 24px 0 10px; }

.callout {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--blue-dark);
  line-height: 1.6;
}

.formula-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 16px 0; }
.formula-table th { background: var(--gray-100); padding: 10px 14px; text-align: left; font-weight: 600; color: var(--gray-500); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--gray-200); }
.formula-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-600); }
.formula-table td:first-child { color: var(--gray-800); font-weight: 500; }
.formula-table tr:last-child td { border-bottom: none; }

/* ── Q TABLE ─────────────────────────────────── */
.q-table { width: 100%; border-collapse: collapse; }
.q-table th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-400); letter-spacing: 0.05em; text-transform: uppercase; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.q-table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); font-size: 13px; color: var(--gray-600); vertical-align: top; }
.q-table tr:hover td { background: var(--gray-50); }
.q-table tr:last-child td { border-bottom: none; }

.error-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.tag-concept { background: var(--red-light); color: var(--red); }
.tag-careless { background: var(--amber-light); color: #92400E; }
.tag-time { background: var(--blue-light); color: var(--blue-dark); }
.tag-strategy { background: var(--purple-light); color: var(--purple); }

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(59,143,232,0.3);
}

.add-btn:hover { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(59,143,232,0.4); }

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 20px; }

.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .btn-sm { flex: 1; height: 42px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ── SCORE CHART ─────────────────────────────── */
.score-chart-wrap { height: 200px; margin-bottom: 24px; }

/* ── WELLNESS PAGE ─────────────────────────────── */
.wellness-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── MOTIVATION ─────────────────────────────────── */
.quote-card {
  background: linear-gradient(135deg, var(--gray-900) 0%, #1a2744 100%);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.quote-card::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 24px;
  font-size: 120px;
  color: rgba(255,255,255,0.04);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}

.quote-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: white;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 12px;
  position: relative;
}

.quote-attr { font-size: 13px; color: rgba(255,255,255,0.4); font-weight: 500; }

.evidence-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.evidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
}

/* ── SETUP BANNER ─────────────────────────────── */
.setup-banner {
  background: var(--amber-light);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: #92400E;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-weight: 500;
}

/* ── LOADING ─────────────────────────────────── */
.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── TIER GATE ─────────────────────────────────── */
.nav-locked { opacity: 0.45; }
.nav-lock-badge { margin-left: auto; font-size: 10px; opacity: 0.6; }

.upgrade-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 48px 24px;
}

.upgrade-gate-inner { max-width: 520px; width: 100%; text-align: center; }
.upgrade-icon { font-size: 44px; margin-bottom: 20px; }

.upgrade-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.upgrade-sub { font-size: 15px; color: var(--gray-500); line-height: 1.65; margin-bottom: 28px; }

.upgrade-features {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrade-feature { font-size: 14px; color: var(--gray-600); font-weight: 500; }

.upgrade-cta {
  display: inline-block;
  background: var(--blue);
  color: white;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(59,143,232,0.4);
}

.upgrade-cta:hover { background: var(--blue-dark); box-shadow: 0 6px 20px rgba(59,143,232,0.5); }
.upgrade-fine { font-size: 12px; color: var(--gray-400); }

.upgrade-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--blue-light);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.upgrade-nudge-text { font-size: 13px; color: var(--blue-dark); flex: 1; font-weight: 500; }

.upgrade-nudge-btn {
  display: inline-block;
  background: var(--blue);
  color: white;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(59,143,232,0.3);
}

.upgrade-nudge-btn:hover { background: var(--blue-dark); }

.tracker-locked-teaser {
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 100px;
}

.tracker-locked-teaser:hover { background: var(--blue-light); border-color: var(--blue); }
.tracker-locked-icon { font-size: 22px; margin-bottom: 4px; }
.tracker-locked-text { font-size: 14px; font-weight: 600; color: var(--gray-700); }
.tracker-locked-sub { font-size: 11px; color: var(--gray-400); line-height: 1.5; max-width: 200px; }
.tracker-locked-cta { font-size: 12px; font-weight: 600; color: var(--blue); margin-top: 6px; }

.tier-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; margin-top: 8px; }
.tier-free { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }
.tier-paid { background: var(--teal-light); color: var(--teal-dark); border: 1px solid #86EFAC; }

/* ── MOBILE OVERLAY ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── PAGE TRANSITIONS ─────────────────────────── */
.page { display: none; animation: fadeIn 0.18s ease; }
.page.active { display: block; }

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

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
    z-index: 200;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-overlay.show { display: block; }

  .sidebar-toggle { display: none; }

  .mobile-menu-btn { display: flex; }

  .main { margin-left: 0 !important; }

  .body-grid { grid-template-columns: 1fr; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { display: none; }
  .quicklinks { grid-template-columns: repeat(3, 1fr); }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .hero-band { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
  .countdown-block { text-align: left; }
  .countdown-num { font-size: 40px; }
  .wellness-page-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .tracker-grid { grid-template-columns: 1fr; }
  .quicklinks { grid-template-columns: repeat(3, 1fr); }
  .auth-card { padding: 32px 24px; }
  .hero-greeting { font-size: 22px; }
}
