/* =====================================================
   FocusFlow — Global Design System
   ===================================================== */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.07);

  --purple: #a78bfa;
  --purple-light: #c4b5fd;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #10b981;

  --text-primary: #f1f1f3;
  --text-secondary: rgba(241, 241, 243, 0.55);
  --text-muted: rgba(241, 241, 243, 0.35);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(167, 139, 250, 0.15);

  --font-primary: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --focus-dur: 1500;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== ANIMATED BACKGROUND ORBS ===== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, transparent 70%);
  top: -150px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
  bottom: 0;
  right: -100px;
  animation-delay: -4s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.07) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.08); }
}

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 200px;
}

.header-right {
  justify-content: flex-end;
}

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

.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.nav-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-primary);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.nav-btn.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(6, 182, 212, 0.15));
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.1);
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  white-space: nowrap;
}

.settings-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.settings-btn:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
  transform: rotate(30deg);
}

/* ===== MAIN ===== */
.app-main {
  padding: 32px;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

/* ===== TIMER VIEW ===== */
.timer-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.timer-card {
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Mode Selector */
.mode-selector {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  width: 100%;
  max-width: 420px;
}

.mode-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-primary);
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(6, 182, 212, 0.2));
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.15);
}

/* Circular Timer */
.timer-ring-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
}

.timer-ring {
  position: absolute;
  top: 0;
  left: 0;
  filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.3));
}

.ring-progress {
  transition: stroke-dashoffset 1s linear;
}

.timer-display {
  text-align: center;
  z-index: 2;
}

.timer-time {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.timer-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.timer-session {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Controls */
.timer-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 50%;
  color: var(--text-primary);
}

.skip-btn, .reset-btn {
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.skip-btn:hover, .reset-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
  transform: scale(1.08);
}

.play-btn {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  box-shadow: 0 8px 32px rgba(167, 139, 250, 0.35);
  border: none;
}

.play-btn:hover {
  box-shadow: 0 12px 40px rgba(167, 139, 250, 0.5);
  transform: scale(1.06);
}

.play-btn.running {
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.hidden { display: none !important; }

/* Current Task Section */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: flex-start;
}

.current-task-section, .ambient-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.current-task-display {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.no-task-text {
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* Ambient Sounds */
.ambient-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ambient-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-primary);
}

.ambient-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.ambient-btn.active-ambient {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--purple-light);
}

/* Timer Sidebar */
.timer-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-card, .quick-tasks-card {
  padding: 24px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.daily-goal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.goal-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 4px;
  transition: width var(--transition-slow);
}

/* Quick Task List in Timer */
.quick-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.quick-task-list::-webkit-scrollbar {
  width: 4px;
}

.quick-task-list::-webkit-scrollbar-track {
  background: transparent;
}

.quick-task-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.empty-tasks {
  text-align: center;
  padding: 20px 0;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-tasks p {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.quick-task-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(167, 139, 250, 0.2);
}

.quick-task-item.selected-task {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.3);
}

.quick-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-high { background: var(--red); }
.dot-medium { background: var(--amber); }
.dot-low { background: var(--green); }

/* ===== TASKS VIEW ===== */
.tasks-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tasks-header-card {
  padding: 28px 32px;
}

.tasks-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tasks-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.tasks-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.task-overview-pills {
  display: flex;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.pill-active {
  background: rgba(167, 139, 250, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.pill-done {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Add Task Form */
.add-task-form {
  margin-top: 4px;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.task-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-primary);
  outline: none;
  transition: var(--transition);
}

.task-input::placeholder {
  color: var(--text-muted);
}

.task-input:focus {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.08);
  background: rgba(255,255,255,0.06);
}

.task-select, .task-pomodoros {
  padding: 14px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-primary);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.task-select:focus, .task-pomodoros:focus {
  border-color: rgba(167, 139, 250, 0.4);
}

.task-select option {
  background: #1a1a2e;
}

.task-pomodoros {
  width: 70px;
  text-align: center;
}

.add-task-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-primary);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.25);
}

.add-task-btn:hover {
  box-shadow: 0 8px 28px rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}

/* Filter Bar */
.task-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-primary);
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.filter-btn.active {
  color: var(--purple-light);
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
}

/* Task List */
.task-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.full-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-hero {
  font-size: 64px;
  margin-bottom: 16px;
  filter: grayscale(0.3);
}

.full-empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.full-empty-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Task Item */
.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.task-item:hover {
  background: var(--glass-hover);
  border-color: rgba(167, 139, 250, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.task-item.done {
  opacity: 0.5;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--glass-border);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-check:hover {
  border-color: var(--purple);
}

.task-check.checked {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-color: transparent;
}

.task-check.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.task-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.task-tags {
  display: flex;
  gap: 8px;
  align-items: center;
}

.priority-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.priority-high { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.priority-medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.priority-low { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.pom-count {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: var(--font-primary);
}

.task-action-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

.task-action-btn.focus-btn:hover {
  color: var(--purple-light);
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
}

.task-action-btn.delete-btn:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

/* ===== STATS VIEW ===== */
.stats-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stats-hero {
  padding: 36px;
  text-align: center;
}

.stats-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.stats-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
}

.hero-stat {
  padding: 0 48px;
}

.stat-divider {
  width: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.chart-card {
  padding: 24px;
  grid-row: 1;
}

.score-card {
  padding: 24px;
  grid-row: 1;
  grid-column: 2;
}

.insights-card {
  padding: 24px;
  grid-column: 2;
  grid-row: 2;
}

.history-card {
  padding: 24px;
  grid-row: 2;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
  margin-bottom: 10px;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.chart-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--purple), rgba(167, 139, 250, 0.3));
  transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 4px;
  position: relative;
  cursor: pointer;
}

.chart-bar:hover {
  background: linear-gradient(180deg, var(--cyan), rgba(6, 182, 212, 0.3));
}

.chart-bar-val {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.chart-days {
  display: flex;
  gap: 12px;
}

.chart-day-label {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-day-label.today {
  color: var(--purple-light);
  font-weight: 700;
}

/* Score Ring */
.score-ring-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 16px auto;
  width: 160px;
  height: 160px;
}

.score-ring {
  position: absolute;
}

.score-display {
  text-align: center;
  z-index: 2;
}

.score-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.breakdown-item span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.breakdown-bar {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Insights */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

.insight-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.insight-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.no-history {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: 9px;
  border: 1px solid var(--glass-border);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-dot-focus { background: var(--purple); }
.history-dot-short { background: var(--cyan); }
.history-dot-long { background: var(--green); }

.history-label {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.history-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== SETTINGS MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: min(480px, 90vw);
  padding: 0;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.setting-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  cursor: pointer;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}

.slider-value {
  font-size: 13px;
  color: var(--purple-light);
  font-weight: 700;
  align-self: flex-end;
}

/* Toggle */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
}

input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
}

.save-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.25);
}

.save-btn:hover {
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 30px rgba(167, 139, 250, 0.15);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  backdrop-filter: blur(16px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 18px;
}

.toast-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== TIMER RUNNING STATE ===== */
body.timer-running .timer-card {
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15), 0 8px 40px rgba(167, 139, 250, 0.1);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .timer-layout {
    grid-template-columns: 1fr;
  }

  .timer-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .score-card, .insights-card {
    grid-column: 1;
    grid-row: auto;
  }

  .hero-stats {
    flex-wrap: wrap;
  }

  .hero-stat {
    padding: 12px 24px;
  }
}

@media (max-width: 700px) {
  .app-main {
    padding: 16px;
  }

  .header {
    padding: 14px 20px;
  }

  .header-nav .nav-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .timer-sidebar {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-wrap: wrap;
  }

  .task-input {
    width: 100%;
  }

  .timer-time {
    font-size: 40px;
  }

  .hero-stats {
    gap: 0;
  }

  .stat-divider {
    display: none;
  }

  .hero-stat-value {
    font-size: 28px;
  }

  .stats-hero {
    padding: 24px;
  }

  .streak-badge {
    display: none;
  }
}
