/* STUDIA — Premium Academic Workspace Styles */

/* ============================================
   CSS Custom Properties — Theme: Cloud (default)
   ============================================ */
:root,
[data-theme="cloud"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-text: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --progress-bg: #e2e8f0;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --overlay: rgba(15, 23, 42, 0.4);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: 0.2s ease;
}

[data-theme="bloom"] {
  --bg-primary: #fef7f4;
  --bg-secondary: #fff9f7;
  --bg-tertiary: #fceee8;
  --bg-hover: #f9ddd4;
  --text-primary: #3d2020;
  --text-secondary: #744d4d;
  --text-muted: #9b7070;
  --accent: #be386b;
  --accent-hover: #9c2350;
  --accent-soft: rgba(190, 56, 107, 0.12);
  --accent-text: #ffffff;
  --border: #f5ddd4;
  --border-strong: #e8c4b8;
  --shadow-sm: 0 1px 2px rgba(61, 32, 32, 0.05);
  --shadow-md: 0 4px 12px rgba(61, 32, 32, 0.08);
  --shadow-lg: 0 8px 24px rgba(61, 32, 32, 0.1);
  --progress-bg: #f5ddd4;
  --sidebar-bg: #fff9f7;
  --input-bg: #fff9f7;
  --overlay: rgba(61, 32, 32, 0.35);
}

[data-theme="midnight"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #475569;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.15);
  --border: #334155;
  --border-strong: #475569;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --progress-bg: #334155;
  --sidebar-bg: #1e293b;
  --input-bg: #1e293b;
  --overlay: rgba(0, 0, 0, 0.6);
}

[data-theme="verdant"] {
  --bg-primary: #f4f9f4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8f5e9;
  --bg-hover: #c8e6c9;
  --text-primary: #1b3a1b;
  --text-secondary: #4a7c4a;
  --text-muted: #7aab7a;
  --accent: #2e7d32;
  --accent-hover: #1b5e20;
  --accent-soft: rgba(46, 125, 50, 0.12);
  --border: #c8e6c9;
  --border-strong: #a5d6a7;
  --shadow-sm: 0 1px 2px rgba(27, 58, 27, 0.05);
  --shadow-md: 0 4px 12px rgba(27, 58, 27, 0.08);
  --shadow-lg: 0 8px 24px rgba(27, 58, 27, 0.1);
  --progress-bg: #c8e6c9;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --overlay: rgba(27, 58, 27, 0.35);
}

[data-theme="lavender"] {
  --bg-primary: #faf8ff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3eeff;
  --bg-hover: #e9e0ff;
  --text-primary: #2d1f4e;
  --text-secondary: #6b5b8a;
  --text-muted: #9b8bb0;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.12);
  --border: #e9e0ff;
  --border-strong: #d4c4f0;
  --shadow-sm: 0 1px 2px rgba(45, 31, 78, 0.05);
  --shadow-md: 0 4px 12px rgba(45, 31, 78, 0.08);
  --shadow-lg: 0 8px 24px rgba(45, 31, 78, 0.1);
  --progress-bg: #e9e0ff;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --overlay: rgba(45, 31, 78, 0.35);
}

[data-theme="mono"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f0;
  --bg-hover: #e0e0e0;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  --accent: #111111;
  --accent-hover: #333333;
  --accent-soft: rgba(17, 17, 17, 0.08);
  --border: #e0e0e0;
  --border-strong: #cccccc;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --progress-bg: #e0e0e0;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --overlay: rgba(0, 0, 0, 0.45);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  background: var(--bg-tertiary); color: var(--text-primary);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; font-size: 1.25rem; }

/* ============================================
   Forms
   ============================================ */
.input, .select, .textarea {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--input-bg); color: var(--text-primary);
  font-family: inherit; font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 80px; resize: vertical; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-link { font-size: 0.8125rem; color: var(--accent); font-weight: 500; }
.card-danger { border-color: var(--danger-soft); }

/* ============================================
   Progress Bars
   ============================================ */
.progress-bar {
  height: 8px; background: var(--progress-bg);
  border-radius: 99px; overflow: hidden;
}
.progress-bar.large { height: 12px; }
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-item { margin-bottom: 14px; }
.progress-item:last-child { margin-bottom: 0; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.875rem; margin-bottom: 6px;
}
.progress-label span:last-child { color: var(--text-secondary); font-weight: 500; }

/* ============================================
   Status Indicators
   ============================================ */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 500; padding: 2px 8px;
  border-radius: 99px;
}
.status-not-started { color: var(--text-muted); background: var(--bg-tertiary); }
.status-in-progress { color: var(--warning); background: var(--warning-soft); }
.status-completed { color: var(--success); background: var(--success-soft); }

.status-icon::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 4px;
}
.status-not-started .status-icon::before { background: var(--text-muted); }
.status-in-progress .status-icon::before { background: var(--warning); }
.status-completed .status-icon::before { background: var(--success); }

.priority-high { color: var(--danger); }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--text-muted); }

/* ============================================
   Onboarding
   ============================================ */
.onboarding {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; position: relative;
}
.onboarding-inner { width: 100%; max-width: 520px; }
.onboarding-screen {
  display: none; text-align: center;
  animation: fadeIn 0.4s ease;
}
.onboarding-screen.active { display: block; }
.onboarding-screen h1, .onboarding-screen h2 {
  font-size: 1.75rem; font-weight: 700; margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.onboarding-sub {
  color: var(--text-secondary); margin-bottom: 32px; font-size: 1rem;
}
.onboarding-logo {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.logo-mark { width: 56px; height: 56px; color: var(--accent); }
.logo-text { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-primary); }
.onboarding-progress {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
}
.progress-dots { display: flex; gap: 8px; }
.progress-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-strong); transition: all var(--transition);
}
.progress-dots .dot.active { background: var(--accent); width: 24px; border-radius: 99px; }

.option-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 32px;
}
.option-grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.option-card {
  padding: 16px 20px; border: 2px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-secondary);
  font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); color: var(--text-primary);
}
.option-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.option-card.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.stream-options { text-align: left; margin-bottom: 32px; }
.stream-group { margin-bottom: 20px; }
.stream-group h3 {
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 8px;
}
.stream-group .option-grid { margin-bottom: 0; }

.subject-list {
  display: flex; flex-direction: column; gap: 8px;
  text-align: left; margin-bottom: 16px; max-height: 280px; overflow-y: auto;
}
.subject-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: all var(--transition); background: var(--bg-secondary);
}
.subject-item:hover { border-color: var(--accent); }
.subject-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.subject-item input { accent-color: var(--accent); width: 18px; height: 18px; }
.add-custom-row { display: flex; gap: 8px; margin-bottom: 24px; }
.btn-row { display: flex; gap: 12px; justify-content: center; }

/* Theme selection */
.theme-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-bottom: 32px;
}
.theme-grid-sm { grid-template-columns: repeat(3, 1fr); }
.theme-card {
  padding: 16px; border: 2px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-secondary);
  cursor: pointer; transition: all var(--transition); text-align: center;
  font-family: inherit; color: var(--text-primary);
}
.theme-card:hover { border-color: var(--accent); }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-preview {
  display: block; width: 100%; height: 48px; border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.theme-preview-bloom { background: linear-gradient(135deg, #fceee8, #be386b); }
.theme-preview-midnight { background: linear-gradient(135deg, #0f172a, #818cf8); }
.theme-preview-verdant { background: linear-gradient(135deg, #e8f5e9, #2e7d32); }
.theme-preview-cloud { background: linear-gradient(135deg, #f8fafc, #3b82f6); }
.theme-preview-lavender { background: linear-gradient(135deg, #f3eeff, #8b5cf6); }
.theme-preview-mono { background: linear-gradient(135deg, #fafafa, #111); }
.theme-name { display: block; font-weight: 600; font-size: 0.875rem; }
.theme-desc { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   App Layout
   ============================================ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  transition: background var(--transition);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 24px; font-weight: 700; font-size: 1.125rem;
  letter-spacing: 0.1em;
}
.sidebar-brand .logo-mark { width: 32px; height: 32px; color: var(--accent); }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }

.main-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.mobile-header {
  display: none; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.08em; }
.mobile-brand .logo-mark { width: 28px; height: 28px; color: var(--accent); }
.mobile-page-title { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }

.main-content {
  flex: 1; padding: 32px; max-width: 1200px;
  animation: fadeIn 0.3s ease;
}
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-secondary); margin-top: 4px; }
.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card-tasks, .card-upcoming { grid-column: span 1; }
.card-progress { grid-column: span 1; }
.card-focus-today { grid-column: span 1; }
.card-stats { grid-column: span 2; }

.task-list, .upcoming-list, .tasks-full-list, .revision-list {
  list-style: none;
}
.task-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 20px; height: 20px; border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); margin-top: 2px;
  background: transparent;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-check.checked::after { content: '✓'; font-size: 12px; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; font-size: 0.9375rem; }
.task-title.done { text-decoration: line-through; color: var(--text-muted); }
.task-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
.task-actions button {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; transition: color var(--transition);
}
.task-actions button:hover { color: var(--accent); }

.upcoming-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-date {
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  min-width: 48px;
}
.upcoming-type {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 4px; background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.focus-display { text-align: center; padding: 8px 0; }
.focus-text { font-size: 1.125rem; font-weight: 500; margin-bottom: 12px; color: var(--text-primary); }
.focus-actions { display: flex; gap: 8px; justify-content: center; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px;
}
.stat-item { text-align: center; padding: 12px; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }

.empty-state { color: var(--text-muted); font-size: 0.875rem; text-align: center; padding: 16px; }

/* ============================================
   Tasks Page
   ============================================ */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
}
.filters-bar .select { width: auto; min-width: 140px; }
.tasks-full-list .task-item {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 10px;
}

/* ============================================
   Syllabus
   ============================================ */
.syllabus-content { display: flex; flex-direction: column; gap: 24px; }
.syllabus-subject-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.syllabus-subject-header h2 { font-size: 1.125rem; }
.syllabus-overall { font-size: 0.875rem; color: var(--accent); font-weight: 600; }
.chapter-list { list-style: none; }
.chapter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px;
  cursor: pointer; transition: all var(--transition);
  background: var(--bg-secondary);
}
.chapter-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.chapter-name { font-weight: 500; font-size: 0.9375rem; }
.chapter-status { font-size: 0.8125rem; }

.topic-list { list-style: none; margin-top: 12px; }
.topic-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.topic-item:last-child { border-bottom: none; }
.topic-actions { display: flex; gap: 6px; }
.topic-actions select {
  padding: 4px 8px; font-size: 0.75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text-primary);
}

.chapter-detail { animation: fadeIn 0.3s ease; }
.chapter-detail-header { margin-bottom: 20px; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 12px;
  cursor: pointer; background: none; border: none; font-family: inherit;
}
.back-link:hover { color: var(--accent); }

/* ============================================
   Revision
   ============================================ */
.revision-sections { display: flex; flex-direction: column; gap: 20px; }
.revision-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.revision-item:last-child { border-bottom: none; }
.revision-info h3 { font-size: 0.9375rem; font-weight: 600; }
.revision-info p { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }
.revision-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ============================================
   Focus Timer
   ============================================ */
.focus-container {
  max-width: 420px; margin: 40px auto; text-align: center;
}
.focus-timer-display {
  font-size: 4.5rem; font-weight: 200; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; margin-bottom: 32px;
  color: var(--text-primary);
}
.focus-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.focus-select, .focus-input { text-align: center; }
.focus-duration-row {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 28px; font-size: 0.875rem; color: var(--text-secondary);
}
.focus-duration-row .select { width: auto; }
.focus-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ============================================
   Calendar
   ============================================ */
.calendar-wrapper { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; grid-column: 1 / -1;
}
.calendar-header h2 { font-size: 1.125rem; }
.calendar-year-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; grid-column: 1 / -1;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-day-name {
  text-align: center; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); padding: 8px 0;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); font-size: 0.875rem; cursor: pointer;
  transition: all var(--transition); position: relative;
  border: 1px solid transparent;
}
.cal-day:hover { background: var(--bg-tertiary); }
.cal-day.other-month { color: var(--text-muted); opacity: 0.5; }
.cal-day.today { border-color: var(--accent); font-weight: 700; }
.cal-day.selected { background: var(--accent); color: var(--accent-text); }
.cal-day.has-events::after {
  content: ''; position: absolute; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.cal-day.selected.has-events::after { background: var(--accent-text); }
.calendar-events {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.calendar-events h3 { font-size: 0.9375rem; margin-bottom: 12px; }
.cal-event-item {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.cal-event-item:last-child { border-bottom: none; }

/* ============================================
   Progress Page
   ============================================ */
.progress-page-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.card-highlight { grid-column: span 2; }
.overall-progress { text-align: center; padding: 16px 0; }
.overall-value { font-size: 3rem; font-weight: 700; color: var(--accent); display: block; margin-bottom: 16px; }

.weekly-chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  height: 160px; gap: 8px; padding-top: 16px;
}
.week-bar-group { flex: 1; text-align: center; }
.week-bar {
  width: 100%; background: var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 4px; transition: height 0.5s ease;
}
.week-label { font-size: 0.6875rem; color: var(--text-muted); margin-top: 6px; }
.week-value { font-size: 0.75rem; font-weight: 600; margin-top: 2px; }

.task-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: center; padding: 8px 0; }

/* ============================================
   Profile
   ============================================ */
.profile-card { max-width: 480px; text-align: center; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; margin: 0 auto 16px;
}
.profile-card h2 { font-size: 1.5rem; margin-bottom: 20px; }
.profile-details {
  text-align: left; margin-bottom: 24px;
  display: grid; grid-template-columns: auto 1fr; gap: 8px 16px;
}
.profile-details dt { font-weight: 600; font-size: 0.8125rem; color: var(--text-secondary); }
.profile-details dd { font-size: 0.9375rem; }
.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 24px; padding: 16px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}

/* ============================================
   Settings
   ============================================ */
.settings-sections { display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.settings-desc { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 16px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.backup-actions .btn { flex: 1; min-width: 160px; }
.danger-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.danger-actions .btn { flex: 1; min-width: 140px; }

/* ============================================
   Manage Syllabus
   ============================================ */
.manage-syllabus-container { padding: 8px 0; }
.manage-section { margin-top: 20px; }
.manage-section h3 { font-size: 0.9375rem; margin-bottom: 12px; color: var(--text-secondary); }
.manage-chapters-list { max-height: 300px; overflow-y: auto; }
.manage-chapter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px;
  background: var(--bg-secondary);
}
.manage-chapter-info { flex: 1; }
.manage-chapter-name { font-size: 0.875rem; font-weight: 500; }
.manage-chapter-actions { display: flex; gap: 6px; }
.manage-hidden-toggle { margin-top: 12px; }

/* ============================================
   Bottom Nav (Mobile)
   ============================================ */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  z-index: 100; justify-content: space-around;
}
.bottom-nav-link {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; color: var(--text-muted); font-size: 0.625rem;
  font-weight: 500; transition: color var(--transition);
}
.bottom-nav-link svg { width: 22px; height: 22px; }
.bottom-nav-link.active { color: var(--accent); }

.more-menu { position: fixed; inset: 0; z-index: 200; }
.more-menu-backdrop { position: absolute; inset: 0; background: var(--overlay); }
.more-menu-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px; animation: slideUp 0.3s ease;
}
.more-menu-nav { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; }
.more-menu-nav a {
  padding: 14px 16px; border-radius: var(--radius-md);
  color: var(--text-primary); font-weight: 500; font-size: 1rem;
}
.more-menu-nav a:hover { background: var(--bg-tertiary); }

/* ============================================
   Modal
   ============================================ */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); }
.modal-content {
  position: relative; background: var(--bg-secondary);
  border-radius: var(--radius-lg); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.125rem; }
.modal-body { padding: 24px; }
.modal-close { font-size: 1.5rem; line-height: 1; }

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: var(--bg-primary);
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500; z-index: 400;
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-stats { grid-column: span 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-page-grid { grid-template-columns: 1fr; }
  .card-highlight { grid-column: span 1; }
  .calendar-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  .main-content { padding: 20px 16px 80px; }
  .page-header h1 { font-size: 1.375rem; }
  .page-header-row { flex-direction: column; }
  .visually-hidden-mobile { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .focus-timer-display { font-size: 3.5rem; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .theme-grid-sm { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filters-bar .select { flex: 1; min-width: 0; }
  .onboarding-screen h1, .onboarding-screen h2 { font-size: 1.375rem; }
}

@media (max-width: 480px) {
  .option-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .task-stats { grid-template-columns: 1fr; }
}

/* Timetable */
.timetable-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.timetable-day { background: var(--bg-secondary); border-radius: 12px; padding: 16px; }
.timetable-day.today { border: 2px solid var(--accent); }
.timetable-day h3 { margin-bottom: 12px; font-size: 16px; color: var(--text-primary); }
.timetable-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.timetable-item { background: var(--bg-primary); border-radius: 8px; padding: 12px; border: 1px solid var(--border); position: relative; }
.timetable-item h4 { margin: 0 0 4px 0; font-size: 14px; color: var(--text-primary); }
.timetable-item p { margin: 0; font-size: 12px; color: var(--text-secondary); }
.timetable-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.timetable-actions button { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 4px; border-radius: 4px; }
.timetable-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }

