/* ============================================
   AI DAILY PLANNER v3 — Polished Design System
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============ DARK THEME (default) ============ */
:root {
  --bg-primary: #030308;
  --bg-secondary: #0a0a14;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.08);
  --bg-surface-active: rgba(255, 255, 255, 0.12);
  --text-primary: #f8f8fc;
  --text-secondary: #9a9ab8;
  --text-tertiary: #65658e;
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --gradient-primary: linear-gradient(135deg, #6366f1, #d946ef, #8b5cf6);
  --gradient-accent: linear-gradient(135deg, #06b6d4, #10b981);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-rose: linear-gradient(135deg, #f43f5e, #ec4899);
  --gradient-emerald: linear-gradient(135deg, #10b981, #059669);
  --cyan: #22d3ee;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --cat-work: #6366f1;
  --cat-health: #10b981;
  --cat-personal: #d946ef;
  --cat-learning: #f59e0b;
  --priority-high: #ef4444;
  --priority-medium: #f59e0b;
  --priority-low: #10b981;
  --sidebar-width: 260px;
  --header-height: clamp(56px, 8vh, 64px);
  --mobile-nav-height: 72px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --glass-bg: rgba(15, 15, 25, 0.4);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(40px);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 60px var(--primary-glow);
  --transition-fast: 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-base: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-slow: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-bg: rgba(3, 3, 8, 0.6);
  --sidebar-bg: rgba(3, 3, 8, 0.5);
  
  /* Fluid Spacing & Typography */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1rem);
  --space-md: clamp(1rem, 2vw, 1.5rem);
  --space-lg: clamp(1.5rem, 3vw, 2.5rem);
  
  --font-xs: clamp(0.65rem, 0.8vw, 0.75rem);
  --font-sm: clamp(0.8rem, 1vw, 0.9rem);
  --font-base: clamp(0.9rem, 1.1vw, 1rem);
  --font-md: clamp(1rem, 1.3vw, 1.25rem);
  --font-lg: clamp(1.25rem, 1.8vw, 1.75rem);
  --font-xl: clamp(1.5rem, 2.5vw, 2.5rem);
}

/* ============ LIGHT THEME ============ */
[data-theme="light"] {
  --bg-primary: #f4f4f8;
  --bg-secondary: #ebebf2;
  --bg-surface: rgba(255, 255, 255, 0.6);
  --bg-surface-hover: rgba(255, 255, 255, 0.9);
  --bg-surface-active: rgba(255, 255, 255, 1);
  --text-primary: #18182b;
  --text-secondary: #5f5f7a;
  --text-tertiary: #9292a8;
  --primary-glow: rgba(139, 92, 246, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12);
  --header-bg: rgba(244, 244, 248, 0.6);
  --sidebar-bg: rgba(244, 244, 248, 0.4);
}

[data-theme="light"] body {
  background: var(--bg-primary)
}

[data-theme="light"] .stat-card:nth-child(1) .stat-value { color: #6366f1 }
[data-theme="light"] .stat-card:nth-child(2) .stat-value { color: #10b981 }
[data-theme="light"] .stat-card:nth-child(3) .stat-value { color: #f59e0b }
[data-theme="light"] .stat-card:nth-child(4) .stat-value { color: #06b6d4 }

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md)
}

[data-theme="light"] .motivational {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06)) !important
}

[data-theme="light"] .nav-item.active {
  color: #fff
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12)
}

[data-theme="light"] .progress-bar-track {
  background: rgba(0, 0, 0, 0.06)
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  letter-spacing: -0.01em;
  transition: background .35s ease, color .35s ease;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 0;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 15% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(ellipse at 85% 70%, rgba(217, 70, 239, 0.12) 0%, transparent 40%),
              radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
  animation: ambientFloat 25s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
}

[data-theme="light"] body::before {
  background: radial-gradient(ellipse at 15% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
              radial-gradient(ellipse at 85% 70%, rgba(217, 70, 239, 0.08) 0%, transparent 40%),
              radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.05) 0%, transparent 50%);
}

@keyframes ambientFloat {
  0% { transform: scale(1) translate(0, 0) rotate(0deg); }
  33% { transform: scale(1.05) translate(2%, -2%) rotate(2deg); }
  66% { transform: scale(0.95) translate(-1%, 3%) rotate(-1deg); }
  100% { transform: scale(1.02) translate(1%, 1%) rotate(1deg); }
}

::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2)
}

/* ============ SIDEBAR ============ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-base), background .35s
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border)
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
  flex-shrink: 0
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text
}

.nav-menu {
  list-style: none;
  padding: 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  user-select: none
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover)
}

.nav-item.active {
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow)
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0
}

.nav-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 5px 14px
}

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #06060f;
  flex-shrink: 0
}

.sidebar-footer span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500
}

/* ============ MAIN ============ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
  transition: margin var(--transition-base)
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--header-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  transition: background .35s
}

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

.header-left h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px
}

.header-left p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px
}

/* Header Action Buttons */
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap
}

.header-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15)
}

.header-btn:active {
  transform: scale(0.97)
}

.header-btn.theme-toggle-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border-color: rgba(124, 92, 252, 0.2)
}

.header-btn.theme-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2))
}

[data-theme="light"] .header-btn {
  border-color: rgba(0, 0, 0, 0.1)
}

[data-theme="light"] .header-btn:hover {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(0, 0, 0, 0.06)
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 6px 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s ease;
}

.btn-primary:hover::after {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.96) !important;
}

.btn:active, .header-btn:active, .nav-item:active, .mobile-nav-item:active {
  transform: scale(0.96);
}

.btn-glow {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 0 30px var(--primary-glow);
  animation: glowPulse 2s ease-in-out infinite
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--primary-glow)
  }

  50% {
    box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(124, 92, 252, 0.15)
  }
}

.btn-glow:hover {
  transform: translateY(-2px) scale(1.02)
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border)
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.15)
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast)
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary)
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm)
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2)
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25)
}

/* ============ CARDS ============ */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* ============ FORMS ============ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1
}

.form-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary)
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: all var(--transition-fast);
  outline: none
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow)
}

select {
  cursor: pointer;
  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='%238888a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px
}

textarea {
  resize: vertical;
  min-height: 50px
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border)
}

.priority-selector {
  display: flex;
  gap: 4px
}

.priority-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  transition: all var(--transition-fast)
}

.priority-btn:hover {
  background: var(--bg-surface-hover)
}

.priority-btn.active.high {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--priority-high);
  color: var(--priority-high)
}

.priority-btn.active.medium {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--priority-medium);
  color: var(--priority-medium)
}

.priority-btn.active.low {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--priority-low);
  color: var(--priority-low)
}

/* ============ VIEWS ============ */
.view {
  display: none;
  padding: 18px 24px;
  animation: fadeIn 0.4s ease forwards;
}

.view.active {
  display: block;
}

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

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px
}

.view-header h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px
}

.view-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

/* ============ BADGES ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary)
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 10px
}

.empty-state h3 {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 5px
}

.empty-state p {
  font-size: 12px;
  max-width: 300px;
  margin: 0 auto
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px
}

.badge-priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--priority-high)
}

.badge-priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--priority-medium)
}

.badge-priority-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--priority-low)
}

.badge-work {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8
}

.badge-health {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399
}

.badge-personal {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc
}

.badge-learning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24
}

.badge-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 9px
}

/* ============ DASHBOARD ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0
}

.stat-card:nth-child(1)::before {
  background: var(--gradient-primary)
}

.stat-card:nth-child(2)::before {
  background: var(--gradient-emerald)
}

.stat-card:nth-child(3)::before {
  background: var(--gradient-warm)
}

.stat-card:nth-child(4)::before {
  background: var(--gradient-accent)
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg)
}

.stat-icon {
  font-size: 20px;
  margin-bottom: 4px
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 2px
}

.stat-card:nth-child(1) .stat-value {
  color: #a5b4fc
}

.stat-card:nth-child(2) .stat-value {
  color: #6ee7b7
}

.stat-card:nth-child(3) .stat-value {
  color: #fde68a
}

.stat-card:nth-child(4) .stat-value {
  color: #67e8f9
}

.stat-label {
  font-size: 9px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px
}

/* Progress Bar (compact) */
.progress-bar-section {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md)
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary)
}

.progress-pct {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-light)
}

.progress-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width .6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: barShimmer 2s infinite
}

@keyframes barShimmer {
  0% {
    transform: translateX(-100%)
  }

  100% {
    transform: translateX(100%)
  }
}

/* Weather */
.weather-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px
}

.weather-icon {
  font-size: 28px
}

.weather-info .weather-temp {
  font-size: 18px;
  font-weight: 700
}

.weather-info .weather-desc {
  font-size: 11px;
  color: var(--text-secondary)
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px
}

.today-schedule-preview .mini-timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px
}

.mini-timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: 11px;
  transition: all var(--transition-fast)
}

.mini-timeline-item:hover {
  background: var(--bg-surface-hover)
}

.mini-timeline-item.break {
  border-left-color: var(--text-tertiary);
  opacity: .55
}

.mini-timeline-item .time {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 10px;
  min-width: 48px;
  font-variant-numeric: tabular-nums
}

.mini-timeline-item .task-name {
  flex: 1;
  font-weight: 500
}

.mini-timeline-item.completed .task-name {
  text-decoration: line-through;
  opacity: .5
}

.motivational {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: background 0.5s ease;
}

.motivational::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.8));
  z-index: 1;
}

.motivational > * {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.motivational .quote-icon {
  font-size: 32px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.motivational blockquote {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  font-style: italic;
  max-width: 90%;
  color: #fff;
  letter-spacing: -0.01em;
}

.motivational cite {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quick-add-section {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 12px
}

.quick-add-section h3 {
  font-size: 14px;
  margin-bottom: 8px
}

.quick-add-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap
}

.quick-add-form input[type="text"] {
  flex: 2;
  min-width: 160px
}

.quick-add-form select {
  flex: 0.5;
  min-width: 85px
}

/* ============ GOALS ============ */
.add-goal-form,
.add-habit-form {
  margin-bottom: 14px;
  animation: slideDown var(--transition-base) ease
}

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

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.goal-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  animation: fadeSlideIn var(--transition-slow) ease
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

.goal-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(3px)
}

.goal-card.completed {
  opacity: .4
}

.goal-card.completed .goal-title {
  text-decoration: line-through
}

.goal-card.dragging {
  opacity: .4;
  transform: scale(.95)
}

.goal-check {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 10px
}

.goal-check:hover {
  border-color: var(--primary);
  background: var(--primary-glow)
}

.goal-check.checked {
  background: var(--gradient-primary);
  border-color: var(--primary)
}

.goal-info {
  flex: 1;
  min-width: 0
}

.goal-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap
}

.goal-duration {
  font-size: 10px;
  color: var(--text-secondary)
}

.goal-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast)
}

.goal-card:hover .goal-actions {
  opacity: 1
}

.subtasks-list {
  margin-top: 6px;
  padding-left: 30px;
  display: flex;
  flex-direction: column;
  gap: 3px
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary)
}

.subtask-item input[type="checkbox"] {
  accent-color: var(--primary)
}

.subtask-item.done {
  text-decoration: line-through;
  opacity: .5
}

.add-subtask-inline {
  display: flex;
  gap: 5px;
  margin-top: 3px;
  padding-left: 30px
}

.add-subtask-inline input {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px
}

.goal-expand-btn {
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 10px;
  transition: all var(--transition-fast)
}

.goal-expand-btn:hover {
  color: var(--text-primary)
}

.goals-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 300px
}

.board-column {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column
}

.board-column.drag-over {
  border-color: var(--primary);
  background: rgba(124, 92, 252, 0.06)
}

.column-header {
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  text-align: center
}

.column-header.high {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5
}

.column-header.medium {
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a
}

.column-header.low {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7
}

.column-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 60px
}

.board-card {
  padding: 10px;
  background: var(--bg-surface-hover);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: grab;
  transition: all var(--transition-fast);
  font-size: 12px
}

.board-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-md)
}

.board-card .card-title {
  font-weight: 600;
  margin-bottom: 4px
}

.board-card .card-meta {
  display: flex;
  gap: 4px;
  align-items: center
}

.eisenhower-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px
}

.matrix-quadrant {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  min-height: 150px
}

.matrix-quadrant h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border)
}

.matrix-q1 {
  background: rgba(239, 68, 68, 0.05)
}

.matrix-q1 h4 {
  color: #fca5a5
}

.matrix-q2 {
  background: rgba(99, 102, 241, 0.05)
}

.matrix-q2 h4 {
  color: #a5b4fc
}

.matrix-q3 {
  background: rgba(245, 158, 11, 0.05)
}

.matrix-q3 h4 {
  color: #fde68a
}

.matrix-q4 {
  background: rgba(255, 255, 255, 0.02)
}

.matrix-q4 h4 {
  color: var(--text-tertiary)
}

.matrix-item {
  padding: 7px 9px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 500
}

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 100px
}

.timeline::before {
  content: '';
  position: absolute;
  left: 88px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark), transparent)
}

.timeline-item {
  position: relative;
  margin-bottom: 4px;
  animation: timelineFadeIn var(--transition-slow) ease;
  animation-fill-mode: backwards
}

@keyframes timelineFadeIn {
  from {
    opacity: 0;
    transform: translateX(14px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

.timeline-time {
  position: absolute;
  left: -100px;
  top: 10px;
  width: 78px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums
}

.timeline-dot {
  position: absolute;
  left: -13px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px var(--primary-glow);
  z-index: 2
}

.timeline-content {
  padding: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-left: 4px;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 12px
}

.timeline-content:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(3px)
}

.timeline-content.is-break {
  opacity: .45;
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed
}

.timeline-content .task-info {
  flex: 1
}

.timeline-content .task-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px
}

.timeline-content .task-duration {
  font-size: 10px;
  color: var(--text-secondary)
}

.timeline-done-check {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 12px;
  background: transparent;
  color: transparent
}

.timeline-done-check:hover {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1)
}

.timeline-done-check.checked {
  background: var(--gradient-emerald);
  border-color: var(--success);
  color: #fff
}

.timeline-content.task-completed {
  opacity: .3
}

.timeline-content.task-completed .task-title {
  text-decoration: line-through
}

.timeline-content.cat-work {
  border-left: 3px solid var(--cat-work)
}

.timeline-content.cat-health {
  border-left: 3px solid var(--cat-health)
}

.timeline-content.cat-personal {
  border-left: 3px solid var(--cat-personal)
}

.timeline-content.cat-learning {
  border-left: 3px solid var(--cat-learning)
}

/* ============ POMODORO ============ */
.pomodoro-container {
  max-width: 440px;
  margin: 0 auto;
  text-align: center
}

.pomodoro-modes {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px
}

.pomo-mode-btn {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast)
}

.pomo-mode-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow)
}

.pomo-timer-ring {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px
}

.pomo-timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg)
}

.pomo-timer-ring circle {
  fill: none;
  stroke-linecap: round
}

.pomo-timer-ring .pomo-bg {
  stroke: var(--bg-surface);
  stroke-width: 7
}

.pomo-timer-ring .pomo-fill {
  stroke: var(--primary);
  stroke-width: 7;
  transition: stroke-dashoffset .5s ease
}

.pomo-timer-ring .pomo-fill.on-break {
  stroke: var(--success)
}

.pomo-time-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px
}

.pomo-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px
}

.pomo-controls .btn {
  min-width: 90px
}

.pomo-task-select {
  max-width: 300px;
  margin: 0 auto 14px
}

.pomo-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 8px
}

.pomo-stat {
  text-align: center
}

.pomo-stat .pomo-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-light)
}

.pomo-stat .pomo-stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 2px
}

/* ============ HABITS ============ */
.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px
}

.habit-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-base);
  position: relative
}

.habit-card:hover {
  border-color: rgba(255, 255, 255, 0.12)
}

.habit-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  flex-shrink: 0
}

.habit-info {
  flex: 1;
  min-width: 0
}

.habit-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px
}

.habit-streak {
  font-size: 11px;
  color: var(--text-secondary)
}

.habit-streak .streak-fire {
  color: var(--warning);
  font-weight: 700
}

.habit-check-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--glass-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  color: transparent
}

.habit-check-btn:hover {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  color: var(--success)
}

.habit-check-btn.checked {
  background: var(--gradient-emerald);
  border-color: var(--success);
  color: #fff;
  animation: checkPop .4s ease
}

@keyframes checkPop {
  0% {
    transform: scale(1)
  }

  30% {
    transform: scale(1.25)
  }

  60% {
    transform: scale(.9)
  }

  100% {
    transform: scale(1)
  }
}

.habit-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  opacity: 0;
  font-size: 9px;
  padding: 2px 6px
}

.habit-card:hover .habit-delete {
  opacity: 1
}

.weekly-heatmap {
  margin-top: 6px
}

.heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: 5px
}

.heatmap-label {
  width: 100px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0
}

.heatmap-cells {
  display: flex;
  gap: 3px;
  flex: 1
}

.heatmap-cell {
  flex: 1;
  height: 24px;
  border-radius: 4px;
  background: var(--bg-surface);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent
}

.heatmap-cell.filled {
  background: rgba(16, 185, 129, 0.25);
  color: var(--success)
}

.heatmap-cell.today {
  border: 1px solid var(--primary)
}

.heatmap-day-labels {
  display: flex;
  gap: 3px;
  margin-left: 106px;
  margin-bottom: 4px
}

.heatmap-day-labels span {
  flex: 1;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase
}

/* ============ CALENDAR ============ */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px
}

.calendar-nav #calendarMonthLabel {
  font-size: 14px;
  font-weight: 700;
  min-width: 130px;
  text-align: center
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 14px
}

.calendar-day-header {
  text-align: center;
  padding: 8px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px
}

.calendar-day {
  aspect-ratio: 1;
  max-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: 2px;
  padding: 4px
}

.calendar-day:hover {
  background: var(--bg-surface-hover);
  border-color: var(--glass-border)
}

.calendar-day .day-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary)
}

.calendar-day.today {
  border-color: var(--primary);
  background: rgba(124, 92, 252, 0.1)
}

.calendar-day.today .day-number {
  color: var(--primary-light);
  font-weight: 700
}

.calendar-day.selected {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08)
}

.calendar-day.other-month .day-number {
  color: var(--text-tertiary);
  opacity: .4
}

.calendar-day .day-dots {
  display: flex;
  gap: 2px
}

.calendar-day .day-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--primary)
}

.day-detail h3 {
  margin-bottom: 10px
}

.day-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.day-schedule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary)
}

.day-schedule-item .item-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px
}

.day-schedule-item .item-title {
  font-size: 12px;
  font-weight: 500
}

/* ============ ANALYTICS ============ */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px
}

.chart-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px
}

.chart-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px
}

.chart-card canvas {
  width: 100% !important;
  height: 180px !important;
  border-radius: var(--radius-sm)
}

.analytics-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px
}

.analytics-stat {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: center
}

.analytics-stat .a-stat-val {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 2px
}

.analytics-stat .a-stat-label {
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .4px
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 5px
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s;
  animation-fill-mode: forwards;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 320px
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

@keyframes toastOut {
  from {
    opacity: 1
  }

  to {
    opacity: 0;
    transform: translateX(30px)
  }
}

.toast.success {
  border-left: 3px solid var(--success)
}

.toast.raid {
  border-left: 3px solid var(--danger);
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.raid-boss-icon {
  animation: raid-boss-idle 4s infinite ease-in-out;
}

@keyframes raid-boss-idle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.05); }
}

.raid-boss-icon.hit {
  animation: raid-boss-hit 0.3s ease-out;
}

@keyframes raid-boss-hit {
  0% { transform: scale(1); filter: brightness(2); }
  50% { transform: scale(0.9) translateX(10px); filter: brightness(3) sepia(100%) hue-rotate(-50deg); }
  100% { transform: scale(1); filter: brightness(1); }
}

.hp-bar-fill {
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.hp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: hp-shine 2s infinite;
}

@keyframes hp-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============ CONFETTI & MODAL ============ */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: none
}

.report-modal {
  max-width: 500px;
}

.ai-loading {
  text-align: center;
  padding: 40px 20px;
}

.ai-sparkle {
  font-size: 40px;
  margin-bottom: 15px;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.8; text-shadow: 0 0 10px var(--primary); }
  50% { transform: scale(1.2); opacity: 1; text-shadow: 0 0 20px var(--primary); }
}

.ai-data-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.report-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.master-ai-badge {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.report-text {
  line-height: 1.6;
  font-size: 14px;
}

.report-text strong {
  color: var(--primary);
  font-weight: 700;
}

.report-text h3 {
  margin-top: 25px;
  font-size: 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 5px;
}

.sentient-modal {
  border: 1px solid rgba(124, 92, 252, 0.4) !important;
  box-shadow: 0 0 30px rgba(124, 92, 252, 0.15) !important;
}

.sentient-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.ai-orb {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at 30% 30%, #a855f7, var(--primary));
  border-radius: 50%;
  box-shadow: 0 0 20px var(--primary), inset 0 0 15px rgba(255,255,255,0.3);
  animation: orb-float 3s infinite ease-in-out, orb-glow 2s infinite alternate;
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes orb-glow {
  0% { box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary); }
  100% { box-shadow: 0 0 25px var(--primary), 0 0 50px var(--primary); }
}

.ai-draft-blueprint {
  margin-top: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(124,58,237,0.1));
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.ai-draft-blueprint::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: radial-gradient(var(--primary) 0.5px, transparent 0.5px);
  background-size: 10px 10px;
  opacity: 0.1;
  pointer-events: none;
}

.blueprint-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.blueprint-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.blueprint-steps li {
  margin-bottom: 5px;
  padding-left: 15px;
  position: relative;
}

.blueprint-steps li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--primary);
}

.blueprint-tip {
  margin-top: 10px;
  font-size: 11px;
  font-style: italic;
  opacity: 0.8;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 8px;
}

.badge-draft-active {
  background: var(--primary);
  color: white;
  animation: pulse-glow 2s infinite;
}

.goal-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}

.btn-draft {
  font-size: 10px;
  height: 24px;
  padding: 0 8px;
  color: var(--primary);
}

/* Gear Stats */
.gear-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(251,191,36,0.2);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center
}

.modal-overlay.show {
  display: flex
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 440px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: fadeIn .3s ease
}

.modal h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm)
}

.shortcut-row span:first-child {
  font-size: 12px;
  color: var(--text-secondary)
}

.shortcut-key {
  padding: 2px 9px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', monospace;
  color: var(--text-primary)
}

/* ============ NLP PREVIEW ============ */
.nlp-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06));
  border: 1px solid rgba(124, 92, 252, 0.2);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  animation: fadeIn .25s ease
}

.nlp-sparkle {
  font-size: 16px;
  animation: sparkleFloat 1.5s ease-in-out infinite
}

@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0) scale(1) }
  50% { transform: translateY(-3px) scale(1.15) }
}

.nlp-preview strong {
  color: var(--text-primary)
}

/* ============ XP & LEVELING ============ */
.xp-section {
  width: 100%;
  padding: 4px 0
}

.xp-level-badge {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text
}

.xp-bar-track {
  height: 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px
}

.sidebar-footer .xp-bar-track {
  height: 6px
}

.xp-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width .6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: barShimmer 2s infinite
}

.xp-label {
  font-size: 9px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-align: right
}

.xp-float {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  color: #a855f7;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
  pointer-events: none;
  z-index: 9998;
  animation: xpFloatUp 1.4s ease-out forwards
}

@keyframes xpFloatUp {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5) }
  30% { opacity: 1; transform: translate(-50%, -70%) scale(1.2) }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(0.8) }
}

/* ============ NOTIFICATION BELL ============ */
.notif-bell-btn {
  position: relative
}

.notif-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 5px;
  display: none
}

.notif-dot.active {
  display: block;
  animation: notifPulse 2s infinite
}

@keyframes notifPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4) }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0) }
}

.focus-mode-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.12)) !important;
  border-color: rgba(168, 85, 247, 0.25) !important
}

.focus-mode-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.22)) !important
}

/* ============ PRODUCTIVITY SCORE ============ */
.productivity-score-section {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px
}

.score-gauge {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0
}

.score-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg)
}

.score-gauge circle {
  fill: none;
  stroke-linecap: round
}

.score-bg-ring {
  stroke: var(--bg-surface);
  stroke-width: 8
}

.score-fill-ring {
  stroke: var(--success);
  stroke-width: 8;
  transition: stroke-dashoffset .8s cubic-bezier(0.4, 0, 0.2, 1), stroke .4s ease
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px
}

.score-details {
  flex: 1
}

.score-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px
}

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.score-breakdown .score-chip {
  padding: 2px 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500
}

/* ============ FOCUS MODE ============ */
.focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #06060f 0%, #0c0c28 50%, #110c22 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: focusFadeIn .5s ease
}

[data-theme="light"] .focus-overlay {
  background: linear-gradient(135deg, #e8e8f8 0%, #ddd8f0 50%, #e0daf2 100%)
}

@keyframes focusFadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}

.focus-exit-btn {
  position: absolute;
  top: 24px;
  right: 32px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  z-index: 10
}

.focus-exit-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-primary)
}

.focus-content {
  text-align: center;
  max-width: 500px;
  width: 90%
}

.focus-task-label {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.5px
}

.focus-timer-display {
  font-size: 96px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
  margin-bottom: 24px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1
}

.focus-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px
}

.btn-lg {
  padding: 12px 28px;
  font-size: 15px;
  border-radius: var(--radius-lg)
}

.focus-ambient {
  margin-bottom: 32px
}

.ambient-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px
}

.ambient-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap
}

.ambient-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast)
}

.ambient-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2)
}

.ambient-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px var(--primary-glow);
  animation: ambientBtnPulse 2s ease-in-out infinite
}

@keyframes ambientBtnPulse {
  0%, 100% { box-shadow: 0 0 15px var(--primary-glow) }
  50% { box-shadow: 0 0 30px var(--primary-glow) }
}

.focus-quote {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-style: italic;
  color: var(--text-tertiary);
  max-width: 500px;
  text-align: center;
  line-height: 1.5
}

/* ============ AUTH OVERLAY ============ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.auth-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 40px;
  border-radius: var(--radius-xl);
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: authFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-logo {
  font-size: clamp(24px, 8vw, 32px);
  font-weight: 800;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 30px 20px;
  }
  .auth-card h2 {
    font-size: 20px;
  }
  .auth-card p {
    font-size: 13px;
  }
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 14px 24px;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  transition: all var(--transition-medium);
}

.auth-btn:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

[data-theme="dark"] .auth-btn {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .auth-btn:hover {
  background: rgba(255,255,255,0.1);
}

@keyframes authFadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

  .dashboard-grid,
  .analytics-grid {
    grid-template-columns: 1fr
  }

  .goals-board,
  .eisenhower-matrix {
    grid-template-columns: 1fr
  }

  .analytics-stats-row {
    grid-template-columns: 1fr 1fr
  }

  .header-btn-text {
    display: none
  }
}

@media(max-width:768px) {
  .sidebar {
    transform: translateX(-100%)
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg)
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none
  }

  .sidebar-overlay.show {
    display: block
  }

  .main-content {
    margin-left: 0
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
  }

  .view {
    padding: 14px 12px
  }

  .main-header {
    padding: 0 12px;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .header-left h1 {
    font-size: 16px;
  }

  #dateDisplay {
    display: none;
  }

  .hide-on-mobile {
    display: none !important;
  }

  .header-btn {
    padding: 8px;
    width: 32px;
    height: 32px;
    justify-content: center;
  }

  .quick-add-form {
    flex-direction: column
  }

  .form-row {
    flex-direction: column
  }

  .timeline {
    padding-left: 70px
  }

  .timeline::before {
    left: 58px
  }

  .timeline-time {
    left: -70px;
    width: 50px;
    font-size: 9px
  }

  .habits-grid {
    grid-template-columns: 1fr
  }

  .heatmap-day-labels {
    margin-left: 70px
  }

  .heatmap-label {
    width: 60px;
    font-size: 9px
  }

  .analytics-stats-row {
    grid-template-columns: 1fr
  }
}

@media(max-width:480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px
  }

  .stat-card {
    padding: 10px 6px
  }

  .stat-value {
    font-size: 20px
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start
  }

  .view-actions {
    width: 100%
  }

  .view-actions .btn {
    flex: 1;
    font-size: 11px;
    padding: 7px 8px
  }

  .header-btn-text {
    display: none
  }
}

/* ============ DYNAMIC CURSOR GLOW ============ */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--primary-glow), transparent);
  transform: translate(calc(var(--mouse-x, 0px) - 300px), calc(var(--mouse-y, 0px) - 300px));
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  transition: opacity 0.5s ease;
  will-change: transform;
}
[data-theme="light"] .cursor-glow {
  opacity: 0.05;
}

/* Keep cards above the glow */
.card, .stat-card {
  position: relative;
  z-index: 10;
}

/* ============ SPRING PHYSICS ANIMATIONS ============ */
@keyframes popInSpring {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.goal-card, .board-card, .stat-card, .timeline-item {
  animation: popInSpring 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ============ COMMAND PALETTE (Cmd+K) ============ */
#commandPalette .modal {
  transform: translateY(-20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
}
#commandPalette.show .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 20px;
  padding: 16px;
  outline: none;
  border-radius: 0;
}
.cmd-input:focus {
  box-shadow: none;
  border-bottom-color: var(--primary);
}
.cmd-input::placeholder {
  color: var(--text-tertiary);
}

.cmd-results {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.cmd-item {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.1s, color 0.1s;
}
.cmd-item:hover, .cmd-item.selected {
  background: var(--bg-surface-active);
  color: var(--text-primary);
}
.cmd-item-icon {
  font-size: 16px;
}
.cmd-item-label {
  font-weight: 600;
  font-size: 14px;
}
.cmd-item-shortcut {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-tertiary);
}

/* ============ RESCHEDULED BADGE ============ */
.badge-rescheduled {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.3px;
  animation: reschedPulse 2s ease-in-out infinite;
  margin-left: 6px;
  vertical-align: middle;
}
@keyframes reschedPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============ TIMELINE ACTIONS (Focus + Check) ============ */
.timeline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ============ PER-TASK FOCUS BUTTON ============ */
.btn-focus-task {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
  color: var(--primary-light);
  border: 1px solid rgba(139, 92, 246, 0.25);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-focus-task:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.3));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}
.btn-focus-task:active {
  transform: scale(0.96);
}

/* ============ SCHEDULE DRAG & DROP ============ */
.timeline-item[draggable="true"] {
  cursor: grab;
}
.timeline-item[draggable="true"]:active {
  cursor: grabbing;
}
.timeline-item.dragging {
  opacity: 0.3;
  transform: scale(0.95);
}
.timeline-item.drag-over-above {
  border-top: 2px solid var(--primary);
  padding-top: 2px;
}
.timeline-item.drag-over-above::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--primary-glow);
  z-index: 5;
}
.timeline-item.drag-over-below {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 2px;
}
.timeline-item.drag-over-below::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--primary-glow);
  z-index: 5;
}

/* ============ PER-TASK FOCUS TIMER OVERLAY ============ */
.task-focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(3, 3, 8, 0.92);
  backdrop-filter: blur(30px);
  animation: focusFadeIn 0.4s ease;
}
@keyframes focusFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.task-focus-content {
  text-align: center;
  animation: focusSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes focusSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.task-focus-label {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 30px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.task-focus-ring {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 30px;
}
.task-focus-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.task-focus-ring circle {
  fill: none;
  stroke-linecap: round;
}
.task-focus-fill {
  stroke: url(#taskFocusGrad);
  stroke-width: 8;
  transition: stroke-dashoffset 0.3s ease;
  stroke: var(--primary);
}
.task-focus-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.task-focus-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.task-focus-controls .btn {
  min-width: 120px;
}

/* Light theme adjustments for task focus overlay */
[data-theme="light"] .task-focus-overlay {
  background: rgba(244, 244, 248, 0.94);
}

/* ============ RESPONSIVE FIXES FOR NEW FEATURES ============ */
@media (max-width: 768px) {
  .timeline-actions {
    flex-direction: column;
    gap: 4px;
  }
  .btn-focus-task {
    font-size: 9px;
    padding: 3px 8px;
  }
  .task-focus-label {
    font-size: 16px;
    padding: 0 16px;
  }
  .task-focus-ring {
    width: 200px;
    height: 200px;
  }
  .task-focus-time {
    font-size: 40px;
  }
}

/* ============ DIFFICULTY SELECTOR ============ */
.difficulty-selector {
  display: flex;
  gap: 4px;
}
.difficulty-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.difficulty-btn:hover {
  background: var(--bg-surface-hover);
}
.difficulty-btn.active.easy {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--priority-low);
  color: var(--priority-low);
}
.difficulty-btn.active.medium {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--priority-medium);
  color: var(--priority-medium);
}
.difficulty-btn.active.hard {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--priority-high);
  color: var(--priority-high);
}
.difficulty-hint {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 500;
}

/* Difficulty badges */
.badge-difficulty-easy {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}
.badge-difficulty-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}
.badge-difficulty-hard {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

/* ============ ANALYTICS MINI-PANEL ============ */
.analytics-mini-panel {
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.04)) !important;
  border: 1px solid rgba(124, 92, 252, 0.12) !important;
}
.analytics-mini-panel h3 {
  margin-bottom: 14px;
}
.analytics-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.analytics-mini-item {
  text-align: center;
  padding: 10px 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}
.analytics-mini-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}
.analytics-mini-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.analytics-mini-item:nth-child(1) .analytics-mini-value { color: #a5b4fc; }
.analytics-mini-item:nth-child(2) .analytics-mini-value { color: #c084fc; }
.analytics-mini-item:nth-child(3) .analytics-mini-value { color: #67e8f9; }
.analytics-mini-item:nth-child(4) .analytics-mini-value { color: #6ee7b7; }
.analytics-mini-label {
  font-size: 9px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============ SUGGESTIONS PANEL ============ */
.suggestions-panel {
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.04), rgba(245, 158, 11, 0.03)) !important;
  border: 1px solid rgba(251, 191, 36, 0.1) !important;
}
.suggestions-panel h3 {
  margin-bottom: 10px;
}
.suggestion-item {
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 5px;
  border-left: 3px solid rgba(251, 191, 36, 0.4);
  transition: all var(--transition-fast);
  animation: suggestionIn 0.4s ease backwards;
}
.suggestion-item:nth-child(1) { animation-delay: 0s; }
.suggestion-item:nth-child(2) { animation-delay: 0.1s; }
.suggestion-item:nth-child(3) { animation-delay: 0.2s; }
.suggestion-item:nth-child(4) { animation-delay: 0.3s; }
@keyframes suggestionIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.suggestion-item:hover {
  background: var(--bg-surface-hover);
  border-left-color: rgba(251, 191, 36, 0.7);
  transform: translateX(3px);
}

/* ============ PEAK HOURS SELECT ============ */
.peak-hours-select {
  padding: 8px 28px 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  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='%238888a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.peak-hours-select:hover {
  background-color: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}
.peak-hours-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* Light theme adjustments */
[data-theme="light"] .analytics-mini-panel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(168, 85, 247, 0.03)) !important;
}
[data-theme="light"] .suggestions-panel {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(245, 158, 11, 0.03)) !important;
}
[data-theme="light"] .analytics-mini-item:nth-child(1) .analytics-mini-value { color: #6366f1; }
[data-theme="light"] .analytics-mini-item:nth-child(2) .analytics-mini-value { color: #a855f7; }
[data-theme="light"] .analytics-mini-item:nth-child(3) .analytics-mini-value { color: #06b6d4; }
[data-theme="light"] .analytics-mini-item:nth-child(4) .analytics-mini-value { color: #10b981; }

/* Responsive */
@media (max-width: 768px) {
  .analytics-mini-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .difficulty-selector {
    flex-wrap: wrap;
  }
}

/* ============================================
   NEXT-LEVEL PREMIUM UI ENHANCEMENTS
   ============================================ */

/* Global Smoothness */
*, *::before, *::after {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Animated Gradient Keyframes --- */
@keyframes gradientPan {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes rgbBorderGlow {
  0% { border-color: #ff2a85; box-shadow: 0 0 15px rgba(255, 42, 133, 0.4); }
  33% { border-color: #8a2be2; box-shadow: 0 0 15px rgba(138, 43, 226, 0.4); }
  66% { border-color: #00e5ff; box-shadow: 0 0 15px rgba(0, 229, 255, 0.4); }
  100% { border-color: #ff2a85; box-shadow: 0 0 15px rgba(255, 42, 133, 0.4); }
}

/* --- Card Interactions --- */
.card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  z-index: 1;
}

/* Interactive colorful border overlay for cards */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 42, 133, 0), rgba(0, 229, 255, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 10px 20px rgba(138, 43, 226, 0.15); /* Purple tint shadow */
  border-color: transparent;
}
.card:hover::before {
  opacity: 1;
  background: linear-gradient(45deg, #ff2a85, #8a2be2, #00e5ff, #00ff87);
  background-size: 300% 300%;
  animation: gradientPan 4s ease infinite;
}

/* Light mode card exceptions */
[data-theme="light"] .card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(138, 43, 226, 0.1);
}

/* --- Dynamic Colorful Buttons --- */
.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, letter-spacing 0.25s ease;
}

.btn-primary {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  background-size: 200% auto;
  border: none;
}

.btn-primary:hover {
  background-position: right center;
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.5); /* Violet glow */
  letter-spacing: 0.5px;
}

.btn-outline:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: #a855f7;
  color: #a855f7;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3) inset;
  transform: scale(1.03);
}

.btn-glow:hover {
  animation: rgbBorderGlow 3s infinite alternate;
  transform: scale(1.05);
}

/* --- Interactive List Items (Goals, Habits, Schedule) --- */
[class*="item"] {
  position: relative;
  border-left: 3px solid transparent;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, border-left-color 0.3s ease;
}

[class*="item"]:hover {
  transform: translateX(8px);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), transparent) !important;
  border-left-color: #00e5ff;
}

[data-theme="light"] [class*="item"]:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.05), transparent) !important;
}

/* --- Specific Timeline Item Glow --- */
.timeline-item {
  transition: all 0.3s ease;
}
.timeline-item:hover {
  border-left-color: #ff2a85;
  background: linear-gradient(90deg, rgba(255, 42, 133, 0.08), transparent);
  box-shadow: -4px 0 15px rgba(255, 42, 133, 0.3);
}

/* --- Stat Cards Rainbow Pulse --- */
.stat-card {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.stat-card:hover {
  transform: translateY(-6px) scale(1.03);
  background: var(--bg-surface);
}

.stat-card:nth-child(1):hover { box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2); border-color: #6366f1; }
.stat-card:nth-child(2):hover { box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2); border-color: #10b981; }
.stat-card:nth-child(3):hover { box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2); border-color: #f59e0b; }
.stat-card:nth-child(4):hover { box-shadow: 0 10px 20px rgba(236, 72, 153, 0.2); border-color: #ec4899; }

.stat-card:hover .stat-icon {
  animation: bounceRotate 1s cubic-bezier(0.28, 0.84, 0.42, 1);
}
@keyframes bounceRotate {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) scale(1.2) rotate(10deg); }
}

/* --- Input Fields Premium Glow --- */
input[type="text"], input[type="number"], select, textarea {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  transform: translateY(-2px);
  border-color: #00e5ff;
  box-shadow: 0 6px 15px rgba(0, 229, 255, 0.15), 0 0 0 1px #00e5ff;
  background: var(--bg-primary);
}

/* --- Badges Color Pop --- */
.badge {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.goal-meta:hover .badge {
  filter: saturate(2) brightness(1.2);
  transform: scale(1.05);
}

/* --- Active Sidebar Item Animated Gradient --- */
.nav-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
  border-left: 3px solid #a855f7;
  color: #fff;
  background-size: 200% 200%;
  animation: gradientPan 3s ease infinite;
}
[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.1), rgba(99, 102, 241, 0.1));
  color: var(--primary);
}

/* ============================================
   PREMIUM FLOATING LIGHT EFFECT 
   ============================================ */
.premium-card {
  position: relative;
  overflow: hidden;
}

.premium-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
  transition: transform 0.1s ease;
  transform: translate(calc(var(--x, -500px) - 200px), calc(var(--y, -500px) - 200px));
  z-index: 10;
  opacity: 0;
}
.premium-card:hover::before {
  opacity: 1;
}

[data-theme="light"] .premium-card::before {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 60%);
}

/* ============================================
   ANIMATED GRADIENT BORDER
   ============================================ */
@keyframes borderFlow {
  0% { background-position: 0% 50% }
  100% { background-position: 200% 50% }
}

.gradient-border {
  position: relative;
  border-radius: var(--radius-lg);
  isolation: isolate; /* Create stacking context for z-index: -1 */
}

.gradient-border::before {
  content: "";
  position: absolute;
  inset: -2px; /* Slight overflow to create border */
  border-radius: inherit;
  background: linear-gradient(270deg, #7c3aed, #06b6d4, #f59e0b, #7c3aed);
  background-size: 300% 300%;
  z-index: -1;
  animation: borderFlow 6s linear infinite;
  opacity: 0.8;
}

/* Ensures card background covers inner gradient */
.gradient-border {
  background: var(--bg-primary); /* Overrides generic transparent glass for inner area */
}
[data-theme="light"] .gradient-border {
  background: #ffffff;
}

/* ============ BURNOUT ALERT ============ */
.burnout-alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  animation: slideDown 0.3s ease-out;
}
.burnout-alert.burnout-high {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.burnout-alert.burnout-moderate {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.burnout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.burnout-icon { font-size: 16px; }
.burnout-title {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
}
.burnout-high .burnout-title { color: #fca5a5; }
.burnout-moderate .burnout-title { color: #fcd34d; }
.burnout-dismiss {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
}
.burnout-dismiss:hover { color: var(--text-primary); }
.burnout-body {
  font-size: 11px;
  color: var(--text-secondary);
}
.burnout-warning { margin-bottom: 4px; }
.burnout-suggestion {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--glass-border);
  color: var(--text-primary);
  font-weight: 500;
}

/* ============ ENHANCED STREAK ============ */
.streak-visual {
  text-align: center;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.streak-flame {
  font-size: 24px;
  margin-bottom: 2px;
  filter: grayscale(1);
  transition: all 0.5s ease;
}
.streak-hot .streak-flame {
  filter: grayscale(0) drop-shadow(0 0 12px rgba(245, 158, 11, 0.6));
  animation: float 2s ease-in-out infinite;
}
.streak-count {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.streak-hot .streak-count {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.streak-label {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.streak-bar {
  width: 80%;
  height: 4px;
  background: var(--bg-surface-active);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.streak-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.streak-hot .streak-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.streak-next {
  font-size: 9px;
  color: var(--text-tertiary);
}

/* ============ AI COACH CHATBOX ============ */
.coach-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.coach-toggle {
  background: var(--gradient-primary);
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: all var(--transition-fast);
}
.coach-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}
.coach-window {
  display: none;
  width: 350px;
  height: 450px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  margin-bottom: 12px;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.coach-open .coach-window {
  display: flex;
}
.coach-open .coach-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: none;
}
.coach-header {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}
.coach-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 14px;
}
.coach-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
  border-color: rgba(239, 68, 68, 1);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}
.coach-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coach-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
}
.coach-msg-user {
  align-self: flex-end;
}
.coach-msg-bot {
  align-self: flex-start;
}
.coach-avatar {
  font-size: 20px;
  flex-shrink: 0;
}
.coach-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.4;
}
.coach-bubble-user {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.coach-bubble-bot {
  background: var(--bg-surface-active);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.coach-input-area {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 8px;
}
.coach-input-area input {
  flex: 1;
  background: var(--bg-surface-active);
  border: 2px solid var(--glass-border);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text-primary);
  outline: none;
  font-size: 13px;
  transition: all 0.3s ease;
}
.coach-input-area input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
  background: var(--bg-surface);
}
.coach-input-area button {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.coach-input-area button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
}

@media (max-width: 400px) {
  .coach-window {
    width: calc(100vw - 40px);
  }
}

/* ============================================
   REQUESTED UI ENHANCEMENTS (OVERWRITES)
   ============================================ */

/* Enhance button interaction */
.btn:active {
  transform: scale(0.96) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

/* Enhance page transition animation */
.view {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  animation: none !important; /* Disabling old keyframes */
  display: flex; /* Allow transition to work correctly */
  visibility: hidden;
  position: absolute;
  width: 100%;
}
.view:not(.active) {
  pointer-events: none;
}

.view.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  position: relative;
  display: block;
}

/* Enhance sidebar hover */
.nav-item:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.25)) !important;
  box-shadow: 0 0 15px rgba(124,58,237,0.4) !important;
}

/* ============================================
   MOBILE NAVIGATION BAR
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  z-index: 1000;
  padding: 0 10px;
  padding-bottom: env(safe-area-inset-bottom);
  justify-content: space-around;
  align-items: center;
  transition: transform var(--transition-base);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-nav-item.active {
  color: var(--primary-light);
}

.mobile-nav-icon {
  font-size: 20px;
  transition: transform var(--transition-fast);
}

.mobile-nav-item:active .mobile-nav-icon {
  transform: scale(0.8);
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   MOBILE RESPONSIVENESS & FLUID LAYOUT
   ============================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  body {
    padding-bottom: var(--mobile-nav-height);
  }

  .mobile-nav {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }

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

  .main-content {
    margin-left: 0;
  }

  .main-header {
    padding: 0 12px;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
  }

  .header-left {
    max-width: 30%;
    overflow: hidden;
  }

  .header-left h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-left p {
    display: none;
  }

  .header-right {
    gap: 3px;
    flex: 1;
    justify-content: flex-end;
  }

  .sidebar-overlay.show {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
  }

  /* Grid Adjustments */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Compact Cards */
  .card, .stat-card {
    padding: var(--space-md);
  }

  .view {
    padding: var(--space-md) var(--space-sm);
  }

  .header-btn-text, .hide-on-mobile {
    display: none;
  }

  .header-btn {
    padding: 8px;
    min-width: 38px;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Form Scaling */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  /* Eisenhower Matrix Mobile */
  .eisenhower-matrix {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .matrix-quadrant {
    padding: 16px;
  }

  /* AI Coach Mobile */
  .coach-container {
    right: 16px;
    bottom: calc(var(--mobile-nav-height) + 16px);
  }
  
  .coach-window {
    width: calc(100vw - 32px);
    height: 60vh;
  }

  /* Pomodoro Mobile */
  .pomo-timer-ring {
    width: 200px;
    height: 200px;
  }
  
  .pomo-time-display {
    font-size: 40px;
  }
  
  .focus-timer-display {
    font-size: clamp(60px, 15vw, 80px);
  }
  
  /* Habits Mobile */
  .habits-grid {
    grid-template-columns: 1fr;
  }
  
  .heatmap-label {
    width: 70px;
  }
  
  .heatmap-day-labels {
    margin-left: 76px;
  }
  
  /* Calendar Mobile */
  .calendar-day .day-number {
    font-size: 11px;
  }
  
  .calendar-day-header {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .view-actions {
    width: 100%;
  }

  .view-actions .btn {
    flex: 1;
  }

  .stat-card .stat-value {
    font-size: 20px;
  }
}

/* ============ PRODUCTIVITY GARDEN ============ */
.productivity-garden-container {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(34, 211, 238, 0.03));
}

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

.garden-stats {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-full);
}

.garden-plot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 120px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--glass-border);
  justify-content: center;
  align-items: flex-end;
  position: relative;
}

[data-theme="light"] .garden-plot {
  background: rgba(255, 255, 255, 0.4);
}

.garden-slot {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: plantSway 4s ease-in-out infinite alternate;
}

.garden-slot.new-plant {
  animation: plantPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes plantSway {
  from { transform: rotate(-2deg) translateY(0); }
  to { transform: rotate(2deg) translateY(-2px); }
}

@keyframes plantPop {
  0% { transform: scale(0) translateY(20px); opacity: 0; }
  70% { transform: scale(1.2) translateY(-5px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.garden-slot::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 20px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  filter: blur(2px);
  z-index: -1;
}

.garden-footer {
  margin-top: 15px;
  text-align: center;
}

#gardenMotto {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
}

.garden-bloom {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ============ RPG & QUEST SYSTEM ============ */
.gold-bump {
  animation: goldBump 0.5s ease-out;
}
@keyframes goldBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); text-shadow: 0 0 10px #ffd700; }
  100% { transform: scale(1); }
}

.goal-card .quest-reward {
  font-size: 10px;
  color: #ffd700;
  font-weight: 700;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============ ACHIEVEMENTS ============ */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  padding: 10px 0;
}

.achievement-badge {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-badge.locked {
  filter: grayscale(1);
  opacity: 0.5;
}

.achievement-badge:not(.locked) {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

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

.achievement-name {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.achievement-popup {
  animation: achievementPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes achievementPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============ ZEN BREATHWORK ============ */
.zen-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at center, #0a0a14 0%, #030308 100%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: fadeIn 0.5s ease;
}

.zen-exit-btn {
  position: absolute;
  top: 30px; right: 30px;
  background: none; border: 1px solid rgba(255,255,255,0.2);
  color: #fff; padding: 8px 16px; border-radius: 20px;
  cursor: pointer;
}

.zen-content {
  text-align: center;
  max-width: 500px;
}

.zen-timer {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 40px;
}

.zen-circle-container {
  position: relative;
  width: 300px; height: 300px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 40px;
}

.zen-circle {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #22d3ee 0%, rgba(34,211,238,0.2) 100%);
  box-shadow: 0 0 50px rgba(34,211,238,0.4);
  transition: all 4s linear;
}

.zen-circle.phase-0 { transform: scale(1.8); background: radial-gradient(circle, #22d3ee 0%, rgba(34,211,238,0.3) 100%); }
.zen-circle.phase-1 { transform: scale(1.8); opacity: 0.8; }
.zen-circle.phase-2 { transform: scale(1); background: radial-gradient(circle, #818cf8 0%, rgba(129,140,248,0.2) 100%); }
.zen-circle.phase-3 { transform: scale(1); opacity: 0.6; }

.zen-phase {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px; font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.zen-instruction {
  font-size: 16px; color: rgba(255,255,255,0.7);
  height: 24px; margin-bottom: 40px;
}

/* ============ GOLD SHOP STYLES ============ */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.shop-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.shop-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.shop-card.owned { border-color: #10b981; background: rgba(16, 185, 129, 0.05); }
.shop-item-icon { font-size: 48px; margin-bottom: 15px; }
.shop-item-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.shop-item-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.4; }
.shop-item-price { font-weight: 700; color: #ffd700; margin-bottom: 15px; }

/* ============ FOCUS SCENES ============ */
.focus-scenes-selector { margin-top: 25px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.scenes-grid { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.scene-btn { 
  flex: 0 0 80px; height: 80px; border-radius: 12px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; transition: 0.3s;
}
.scene-btn:hover { background: rgba(255,255,255,0.1); }
.scene-btn.active { border-color: var(--primary); background: rgba(124, 92, 252, 0.2); }
.scene-btn .scene-icon { font-size: 24px; }
.scene-btn .scene-label { font-size: 10px; margin-top: 5px; color: rgba(255,255,255,0.6); }

/* Scene Overlays */
.scene-cafe::before { content: ''; position: absolute; inset: 0; background: rgba(69, 39, 0, 0.2); pointer-events: none; }
.scene-rain::before { content: ''; position: absolute; inset: 0; background: rgba(0, 31, 63, 0.3); pointer-events: none; }
.scene-space::before { 
  content: ''; position: absolute; inset: 0; 
  background: radial-gradient(circle, rgba(124, 92, 252, 0.1) 0%, transparent 100%);
  pointer-events: none; 
}
.scene-forest::before { content: ''; position: absolute; inset: 0; background: rgba(6, 46, 0, 0.2); pointer-events: none; }
.scene-neon::before { 
  content: ''; position: absolute; inset: 0; 
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 255, 0.1));
  pointer-events: none;
}

/* ============ WEEKLY REVIEW ============ */
.report-modal { max-width: 700px; max-height: 85vh; overflow-y: auto; }
.report-text { line-height: 1.6; text-align: left; padding: 10px; }
.report-text h1, .report-text h2, .report-text h3 { color: var(--primary); margin-top: 20px; }
.report-text p { margin-bottom: 15px; }
.report-text ul { padding-left: 20px; }
.report-text li { margin-bottom: 10px; }



/* Quest Vault & History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-date-group {
  margin-top: 15px;
}

.history-date-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 1px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(124, 92, 252, 0.2);
  margin-bottom: 10px;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(5px);
}

.history-item-main {
  display: flex;
  flex-direction: column;
}

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

.history-item-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.history-item-xp {
  font-size: 11px;
  font-weight: 700;
  color: var(--xp-color);
  background: rgba(168, 85, 247, 0.1);
  padding: 1px 6px;
  border-radius: 8px;
}
