/* ============================================================
   TimeFlow — Design System
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ------------------------------------------------------------ */

:root {
  /* Sidebar / Layout */
  --sidebar-w: 248px;
  --header-h: 68px;

  /* Border Radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs:   0.70rem;
  --text-sm:   0.8125rem;
  --text-base: 0.9375rem;
  --text-md:   1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.25rem;

  /* Transitions */
  --ease: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Light Theme (default) ── */
:root,
[data-theme="light"] {
  --bg:           #F3EFFB;
  --surface:      #FFFFFF;
  --surface-2:    #F7F4FD;
  --surface-3:    #EFE9FA;
  --surface-hover:#EAE3F8;
  --overlay:      rgba(30, 10, 60, 0.42);

  --primary:      #7C3AED;
  --primary-h:    #6D28D9;
  --primary-s:    #EDE9FE;
  --primary-text: #FFFFFF;

  --accent:       #A855F7;
  --accent-s:     rgba(168, 85, 247, 0.12);

  --teal:         #0EA5A0;
  --teal-s:       rgba(14, 165, 160, 0.10);

  --success:      #10B981;
  --success-s:    rgba(16, 185, 129, 0.10);
  --success-text: #065F46;

  --warning:      #F59E0B;
  --warning-s:    rgba(245, 158, 11, 0.10);
  --warning-text: #78350F;

  --danger:       #EF4444;
  --danger-s:     rgba(239, 68, 68, 0.10);
  --danger-text:  #7F1D1D;

  --purple:       #8B5CF6;
  --purple-s:     rgba(139, 92, 246, 0.12);

  --orange:       #F97316;
  --orange-s:     rgba(249, 115, 22, 0.10);

  --text-1:       #1A0A30;
  --text-2:       #4C3873;
  --text-3:       #8B78AB;
  --text-4:       #C2B5D8;

  --border:       #DDD5F0;
  --border-s:     #EEE9FA;

  --shadow-sm:    0 1px 3px rgba(80,30,150,0.07), 0 1px 2px rgba(80,30,150,0.05);
  --shadow-md:    0 4px 12px rgba(80,30,150,0.09), 0 2px 4px rgba(80,30,150,0.06);
  --shadow-lg:    0 12px 28px rgba(80,30,150,0.11), 0 4px 8px rgba(80,30,150,0.07);
  --shadow-xl:    0 24px 48px rgba(80,30,150,0.14), 0 8px 16px rgba(80,30,150,0.09);

  /* Calendar colors */
  --cal-work:     #7C3AED;
  --cal-health:   #10B981;
  --cal-personal: #A855F7;
  --cal-finance:  #F59E0B;
  --cal-home:     #F97316;
  --cal-other:    #64748B;

  /* Sidebar */
  --sidebar-bg:   #150A2E;
  --sidebar-text: rgba(255,255,255,0.60);
  --sidebar-text-active: #FFFFFF;
  --sidebar-item-hover: rgba(139,92,246,0.12);
  --sidebar-item-active: rgba(139,92,246,0.28);
  --sidebar-label: rgba(255,255,255,0.28);
  --sidebar-border: rgba(139,92,246,0.10);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg:           #060D1C;
  --surface:      #0B1628;
  --surface-2:    #0F1E35;
  --surface-3:    #132440;
  --surface-hover:#172B4A;
  --overlay:      rgba(0, 0, 8, 0.65);

  --primary:      #4A7BF7;
  --primary-h:    #5A88FF;
  --primary-s:    rgba(74, 123, 247, 0.16);
  --primary-text: #FFFFFF;

  --accent:       #7B8FFF;
  --accent-s:     rgba(123, 143, 255, 0.12);

  --teal:         #2DD4BF;
  --teal-s:       rgba(45, 212, 191, 0.12);

  --success:      #34D399;
  --success-s:    rgba(52, 211, 153, 0.12);
  --success-text: #A7F3D0;

  --warning:      #FBBF24;
  --warning-s:    rgba(251, 191, 36, 0.12);
  --warning-text: #FDE68A;

  --danger:       #F87171;
  --danger-s:     rgba(248, 113, 113, 0.12);
  --danger-text:  #FECACA;

  --purple:       #A78BFA;
  --purple-s:     rgba(167, 139, 250, 0.12);

  --orange:       #FB923C;
  --orange-s:     rgba(251, 146, 60, 0.12);

  --text-1:       #EDF2FF;
  --text-2:       #8FA4C4;
  --text-3:       #4D6180;
  --text-4:       #2A3F58;

  --border:       #1A2E4A;
  --border-s:     #0F1E32;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.30);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 28px rgba(0,0,0,0.45);
  --shadow-xl:    0 24px 48px rgba(0,0,0,0.55);

  --cal-work:     #5B73FF;
  --cal-health:   #34D399;
  --cal-personal: #A78BFA;
  --cal-finance:  #FBBF24;
  --cal-home:     #FB923C;
  --cal-other:    #94A3B8;

  --sidebar-bg:   #050C17;
  --sidebar-text: rgba(255,255,255,0.50);
  --sidebar-text-active: #FFFFFF;
  --sidebar-item-hover: rgba(255,255,255,0.06);
  --sidebar-item-active: rgba(74,123,247,0.22);
  --sidebar-label: rgba(255,255,255,0.22);
  --sidebar-border: rgba(255,255,255,0.05);
}

/* ── Midnight Purple Theme ── */
[data-theme="purple"] {
  --bg:           #07050F;
  --surface:      rgba(18, 12, 38, 0.85);
  --surface-2:    rgba(26, 17, 55, 0.80);
  --surface-3:    rgba(34, 22, 70, 0.75);
  --surface-hover:rgba(44, 30, 88, 0.90);
  --overlay:      rgba(4, 2, 12, 0.72);

  --primary:      #8B5CF6;
  --primary-h:    #9F73FA;
  --primary-s:    rgba(139, 92, 246, 0.20);
  --primary-text: #FFFFFF;

  --accent:       #C084FC;
  --accent-s:     rgba(192, 132, 252, 0.15);

  --teal:         #34D399;
  --teal-s:       rgba(52, 211, 153, 0.12);

  --success:      #4ADE80;
  --success-s:    rgba(74, 222, 128, 0.12);
  --success-text: #BBF7D0;

  --warning:      #FBBF24;
  --warning-s:    rgba(251, 191, 36, 0.12);
  --warning-text: #FDE68A;

  --danger:       #F87171;
  --danger-s:     rgba(248, 113, 113, 0.12);
  --danger-text:  #FECACA;

  --purple:       #E879F9;
  --purple-s:     rgba(232, 121, 249, 0.14);

  --orange:       #FB923C;
  --orange-s:     rgba(251, 146, 60, 0.12);

  --text-1:       #F0EAFF;
  --text-2:       #A89BC8;
  --text-3:       #5E4E80;
  --text-4:       #2E2248;

  --border:       rgba(139, 92, 246, 0.18);
  --border-s:     rgba(139, 92, 246, 0.08);

  --shadow-sm:    0 1px 4px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.55), 0 0 0 1px rgba(139,92,246,0.08);
  --shadow-lg:    0 12px 32px rgba(0,0,0,0.65), 0 0 24px rgba(109,40,217,0.12);
  --shadow-xl:    0 24px 56px rgba(0,0,0,0.75), 0 0 48px rgba(109,40,217,0.18);

  --cal-work:     #818CF8;
  --cal-health:   #4ADE80;
  --cal-personal: #E879F9;
  --cal-finance:  #FBBF24;
  --cal-home:     #FB923C;
  --cal-other:    #94A3B8;

  --sidebar-bg:   #060310;
  --sidebar-text: rgba(200, 180, 255, 0.55);
  --sidebar-text-active: #FFFFFF;
  --sidebar-item-hover: rgba(139,92,246,0.12);
  --sidebar-item-active: rgba(139,92,246,0.28);
  --sidebar-label: rgba(200,180,255,0.25);
  --sidebar-border: rgba(139,92,246,0.10);
}

/* Purple theme — glassmorphism cards + glow accents */
[data-theme="purple"] body {
  background: radial-gradient(ellipse 80% 60% at 20% 0%, rgba(109,40,217,0.18) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 100%, rgba(168,85,247,0.12) 0%, transparent 55%),
              #07050F;
}

[data-theme="purple"] .card {
  background: rgba(18, 12, 38, 0.70);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(139, 92, 246, 0.16);
  box-shadow: 0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(139,92,246,0.06);
}

[data-theme="purple"] .sidebar {
  background: linear-gradient(180deg, rgba(8,4,20,0.98) 0%, rgba(6,3,16,0.98) 100%);
  border-right: 1px solid rgba(139,92,246,0.10);
  backdrop-filter: blur(24px);
}

[data-theme="purple"] .top-header {
  background: rgba(7, 5, 15, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139,92,246,0.12);
}

[data-theme="purple"] .btn-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  box-shadow: 0 0 16px rgba(139,92,246,0.40), 0 2px 8px rgba(0,0,0,0.3);
  border: none;
}
[data-theme="purple"] .btn-primary:hover {
  background: linear-gradient(135deg, #8B4CF7 0%, #B465FF 100%);
  box-shadow: 0 0 24px rgba(139,92,246,0.55), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

[data-theme="purple"] .nav-item.active {
  background: linear-gradient(90deg, rgba(139,92,246,0.28) 0%, rgba(139,92,246,0.08) 100%);
  border-left: 3px solid #A78BFA;
}

[data-theme="purple"] .nav-item.active .nav-icon,
[data-theme="purple"] .nav-item.active span {
  color: #C4B5FD;
}

[data-theme="purple"] .sidebar-brand .brand-icon {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  box-shadow: 0 0 16px rgba(139,92,246,0.45);
}

[data-theme="purple"] .header-avatar {
  background: linear-gradient(135deg, #7C3AED, #C084FC);
  box-shadow: 0 0 12px rgba(139,92,246,0.45);
}

[data-theme="purple"] .dash-stats-row .stat-card {
  background: rgba(26, 16, 52, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(139,92,246,0.16);
}

[data-theme="purple"] .progress-bar-wrap {
  background: rgba(139,92,246,0.12);
}

[data-theme="purple"] .progress-bar-fill {
  background: linear-gradient(90deg, #7C3AED, #C084FC);
  box-shadow: 0 0 8px rgba(139,92,246,0.50);
}

[data-theme="purple"] .badge-primary,
[data-theme="purple"] .badge-accent {
  background: rgba(139,92,246,0.22);
  color: #C4B5FD;
  border: 1px solid rgba(139,92,246,0.25);
}

[data-theme="purple"] .modal {
  background: rgba(14, 9, 32, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(139,92,246,0.20);
  box-shadow: 0 24px 64px rgba(0,0,0,0.70), 0 0 48px rgba(109,40,217,0.20);
}

[data-theme="purple"] .modal-overlay {
  background: rgba(4, 2, 14, 0.80);
  backdrop-filter: blur(6px);
}

[data-theme="purple"] .form-input,
[data-theme="purple"] .form-select,
[data-theme="purple"] .form-textarea {
  background: rgba(26,16,52,0.70);
  border-color: rgba(139,92,246,0.22);
  color: #F0EAFF;
}
[data-theme="purple"] .form-input:focus,
[data-theme="purple"] .form-select:focus,
[data-theme="purple"] .form-textarea:focus {
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.20);
}

[data-theme="purple"] .header-date-chip {
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.22);
  color: #C4B5FD;
}

[data-theme="purple"] .toast {
  background: rgba(20,12,44,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(139,92,246,0.22);
}

[data-theme="purple"] .dash-task-tab.active {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  box-shadow: 0 0 12px rgba(139,92,246,0.40);
}

[data-theme="purple"] .sort-toggle button.active {
  background: rgba(139,92,246,0.25);
  color: #C4B5FD;
  border-color: rgba(139,92,246,0.35);
}

[data-theme="purple"] .onboarding-overlay {
  background: radial-gradient(ellipse at top, rgba(109,40,217,0.25) 0%, rgba(7,5,15,0.98) 60%);
}

[data-theme="purple"] .onboarding-card {
  background: rgba(14,9,32,0.92);
  backdrop-filter: blur(32px);
  border: 1px solid rgba(139,92,246,0.22);
  box-shadow: 0 32px 80px rgba(0,0,0,0.70), 0 0 64px rgba(109,40,217,0.22);
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */

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

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

body {
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--text-1);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--ease), color var(--ease);
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, textarea, select { font-family: var(--font); }
ul, ol { list-style: none; }
svg { display: block; flex-shrink: 0; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}


/* ------------------------------------------------------------
   3. SCROLLBAR
   ------------------------------------------------------------ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }


/* ------------------------------------------------------------
   4. LAYOUT — SHELL
   ------------------------------------------------------------ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  transition: transform var(--ease);
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--ease);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 190;
  backdrop-filter: blur(2px);
}


/* ------------------------------------------------------------
   5. SIDEBAR
   ------------------------------------------------------------ */

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 22px var(--sp-5);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--r-sm);
  display: block;
}

.brand-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--sp-3);
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sidebar-label);
  text-transform: uppercase;
  padding: 0 var(--sp-3);
  margin-bottom: var(--sp-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-active);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

[data-theme="dark"]   .nav-item.active::before { background: var(--accent); }
[data-theme="light"]  .nav-item.active::before { background: #C084FC; }
[data-theme="purple"] .nav-item.active::before { background: #C084FC; }

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 9px var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
}

.theme-toggle:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-active);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-sun, .icon-moon, .theme-label-light, .theme-label-dark { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .theme-label-dark { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .theme-label-light { display: block; }

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background var(--ease);
  flex-shrink: 0;
}

.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle svg { width: 20px; height: 20px; }


/* ------------------------------------------------------------
   6. TOP HEADER
   ------------------------------------------------------------ */

.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-8);
  gap: var(--sp-4);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .top-header { background: rgba(11, 22, 40, 0.92); }

.header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-width: 0;
}

.header-title-group { min-width: 0; }

.page-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.header-date-chip {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  padding: 4px 4px 4px var(--sp-2);
  border-radius: var(--r-full);
  transition: background var(--ease);
}

.header-user:hover { background: var(--surface-2); }

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: white;
  font-size: var(--text-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--primary-s);
}

.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-username {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
}


/* ------------------------------------------------------------
   7. PAGE CONTAINER & PAGES
   ------------------------------------------------------------ */

.page-container {
  flex: 1;
  padding: var(--sp-8);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page { display: none; }
.page.active { display: block; animation: pageFadeIn 0.25s ease forwards; }

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


/* ------------------------------------------------------------
   8. CARD COMPONENT
   ------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease), border-color var(--ease);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-s);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.2px;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin-top: 2px;
}

.card-body {
  padding: var(--sp-6);
}

.card-body.p0 { padding: 0; }


/* ------------------------------------------------------------
   9. BUTTONS
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px var(--sp-5);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  transition: all var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(29, 61, 143, 0.25);
}

.btn-primary:hover {
  background: var(--primary-h);
  box-shadow: 0 4px 14px rgba(29, 61, 143, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 7px var(--sp-3);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-danger {
  background: var(--danger-s);
  color: var(--danger);
}

.btn-danger:hover { background: var(--danger); color: white; }

.btn-success {
  background: var(--success-s);
  color: var(--success);
}

.btn-success:hover { background: var(--success); color: white; }

.btn-sm {
  padding: 6px 10px;
  font-size: var(--text-xs);
}

.btn-sm svg { width: 14px; height: 14px; }

.btn-icon {
  padding: 7px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-icon:hover { background: var(--surface-hover); color: var(--text-1); }
.btn-icon svg { width: 16px; height: 16px; }

.btn-icon-danger:hover { background: var(--danger); color: white; border-color: var(--danger); }


/* ------------------------------------------------------------
   10. FORM ELEMENTS
   ------------------------------------------------------------ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: var(--text-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-s);
}

.form-input::placeholder { color: var(--text-4); }
.form-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-3);
}


/* ------------------------------------------------------------
   11. BADGES / TAGS
   ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-primary  { background: var(--primary-s); color: var(--primary); }
.badge-success  { background: var(--success-s); color: var(--success); }
.badge-warning  { background: var(--warning-s); color: var(--warning); }
.badge-danger   { background: var(--danger-s);  color: var(--danger);  }
.badge-purple   { background: var(--purple-s);  color: var(--purple);  }
.badge-teal     { background: var(--teal-s);    color: var(--teal);    }
.badge-orange   { background: var(--orange-s);  color: var(--orange);  }
.badge-neutral  { background: var(--surface-2); color: var(--text-2);  border: 1px solid var(--border); }

/* Priority badges */
.priority-high   { background: var(--danger-s);  color: var(--danger);  }
.priority-medium { background: var(--warning-s); color: var(--warning); }
.priority-low    { background: var(--success-s); color: var(--success); }

/* Category colors */
.cat-work     { background: var(--accent-s);   color: var(--accent); }
.cat-health   { background: var(--success-s);  color: var(--success); }
.cat-personal { background: var(--purple-s);   color: var(--purple); }
.cat-finances { background: var(--warning-s);  color: var(--warning); }
.cat-home     { background: var(--orange-s);   color: var(--orange); }
.cat-other    { background: var(--surface-2);  color: var(--text-2); border: 1px solid var(--border); }


/* ------------------------------------------------------------
   12. PROGRESS BARS
   ------------------------------------------------------------ */

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.progress-bar-fill.success { background: linear-gradient(90deg, var(--success), var(--teal)); }
.progress-bar-fill.warning { background: linear-gradient(90deg, var(--warning), var(--orange)); }

.progress-thin .progress-bar-wrap { height: 5px; }
.progress-thick .progress-bar-wrap { height: 12px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.progress-label-text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
}

.progress-label-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-1);
}


/* ------------------------------------------------------------
   13. MODAL
   ------------------------------------------------------------ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 900;
  backdrop-filter: blur(3px);
}

.modal-overlay.active { display: block; animation: fadeIn 0.2s ease; }

.modal-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 910;
  overflow-y: auto;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.modal-wrapper.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  padding: 0;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lg { max-width: 680px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-s);
}

.modal-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: all var(--ease);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--surface-2); color: var(--text-1); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 32px;
  font-size: 1rem;
  line-height: 1.7;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-s);
}

/* ── Resume Day option buttons ── */
.resume-day-option {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all var(--ease);
}
.resume-day-option-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1.2; }
.resume-day-option-body { display: flex; flex-direction: column; gap: 4px; }
.resume-day-option-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}
.resume-day-option-desc {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.5;
}
.btn-primary-soft {
  background: var(--primary-s, rgba(79,99,232,.08));
  border-color: var(--primary-s, rgba(79,99,232,.15));
}
.btn-primary-soft:hover { background: var(--primary-s); border-color: var(--primary); }
.btn-primary-soft .resume-day-option-title { color: var(--primary); }
.btn-ghost-soft {
  background: var(--surface-2);
  border-color: var(--border);
}
.btn-ghost-soft:hover { background: var(--surface-3); border-color: var(--border-s); }

/* ── Inbox completed-date label ── */
.inbox-completed-date {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--ease);
}
.dash-task-row:hover .inbox-completed-date { opacity: 0; }


/* ------------------------------------------------------------
   14. TOAST NOTIFICATIONS
   ------------------------------------------------------------ */

.toast-stack {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-1);
  pointer-events: all;
  max-width: 340px;
  animation: toastIn 0.3s var(--ease-spring);
}

.toast.removing { animation: toastOut 0.2s ease forwards; }

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success-s); color: var(--success); }
.toast-error   .toast-icon { background: var(--danger-s);  color: var(--danger);  }
.toast-info    .toast-icon { background: var(--primary-s); color: var(--primary); }
.toast-icon svg { width: 12px; height: 12px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  to   { opacity: 0; transform: translateX(20px) scale(0.96); }
}


/* ------------------------------------------------------------
   15. STAT CARDS (DASHBOARD)
   ------------------------------------------------------------ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
}

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

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

.stat-card.c-primary::before   { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.stat-card.c-success::before   { background: linear-gradient(90deg, var(--success), var(--teal)); }
.stat-card.c-warning::before   { background: linear-gradient(90deg, var(--warning), var(--orange)); }
.stat-card.c-purple::before    { background: linear-gradient(90deg, var(--purple), var(--accent)); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}

.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.c-primary { background: var(--primary-s); color: var(--primary); }
.stat-icon.c-success { background: var(--success-s); color: var(--success); }
.stat-icon.c-warning { background: var(--warning-s); color: var(--warning); }
.stat-icon.c-purple  { background: var(--purple-s);  color: var(--purple);  }

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-3);
  font-weight: 500;
}

.stat-sub {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: var(--sp-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend-up   { color: var(--success); }
.stat-trend-down { color: var(--danger); }


/* ------------------------------------------------------------
   16. DASHBOARD LAYOUT
   ------------------------------------------------------------ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--sp-6);
}

.dashboard-main { display: flex; flex-direction: column; gap: var(--sp-6); }
.dashboard-side { display: flex; flex-direction: column; gap: var(--sp-6); }

/* Achievement Banner */
.achievements-row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.achievement-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}

.achievement-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.achievement-chip .chip-emoji {
  font-size: 14px;
  line-height: 1;
}

/* Next event card on dashboard */
/* Old block kept for backwards compat (other pages may reference these) */
.next-event-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  color: white;
  position: relative;
  overflow: hidden;
}
.next-event-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.next-event-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: var(--sp-2);
}
.next-event-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.next-event-time {
  font-size: var(--text-sm);
  opacity: 0.80;
}

/* ── Compact single-line Up Next strip (dashboard) ── */
.next-event-strip {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-5);
  margin-bottom: var(--sp-4);
  color: #fff;
  min-height: 36px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.next-event-strip::after {
  content: '';
  position: absolute;
  right: -10px; top: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
}
.next-event-strip-clear {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-s);
}
.next-event-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  opacity: .80;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  flex-shrink: 0;
}
.next-event-strip-clear .next-event-tag { opacity: 1; color: var(--text-3); }
.next-event-strip-title {
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 80px;
}
.next-event-strip-sep {
  opacity: .5;
  flex-shrink: 0;
}
.next-event-strip-time {
  font-size: var(--text-xs);
  opacity: .85;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Quick tasks list */
.quick-task-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-s);
}

.quick-task-item:last-child { border-bottom: none; }

.quick-task-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}

.quick-task-check.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.quick-task-check.done svg { display: block; }
.quick-task-check svg { display: none; width: 11px; height: 11px; }

.quick-task-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-1);
  min-width: 0;
}

.quick-task-text.done {
  text-decoration: line-through;
  color: var(--text-3);
}

/* Weekly bars chart */
.week-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  height: 80px;
  padding-top: var(--sp-3);
}

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

.week-bar-fill-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.week-bar-fill {
  width: 100%;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  background: var(--primary-s);
  transition: height 0.5s ease;
  min-height: 4px;
}

.week-bar-col.today .week-bar-fill {
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
}

.week-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
}

/* Upcoming events list (sidebar) */
.event-list-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-s);
  align-items: flex-start;
}

.event-list-item:last-child { border-bottom: none; }

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.event-list-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.event-list-meta {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 2px;
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.section-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
}


/* ------------------------------------------------------------
   17. CALENDAR PAGE
   ------------------------------------------------------------ */

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.cal-current-label {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-1);
  min-width: 180px;
  text-align: center;
  letter-spacing: -0.2px;
}

.view-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 6px 14px;
  border-radius: 5px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--ease);
}

.view-btn.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

/* Month grid */
.cal-month-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.cal-day-name {
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 100px;
  padding: var(--sp-2);
  border-right: 1px solid var(--border-s);
  border-bottom: 1px solid var(--border-s);
  cursor: pointer;
  transition: background var(--ease);
  overflow: hidden;
}

.cal-cell:hover { background: var(--surface-hover); }
.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell.other-month { background: var(--surface-3); }
.cal-cell.other-month .cal-cell-date { color: var(--text-4); }

.cal-cell.today { background: var(--primary-s); }
.cal-cell.today .cal-cell-date {
  background: var(--primary);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cal-cell-date {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
  line-height: 1;
}

.cal-event-pill {
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--ease);
}

.cal-event-pill:hover { opacity: 0.8; }
.cal-event-pill.work     { background: rgba(79,99,232,0.15);  color: var(--cal-work); }
.cal-event-pill.health   { background: rgba(16,185,129,0.15); color: var(--cal-health); }
.cal-event-pill.personal { background: rgba(139,92,246,0.15); color: var(--cal-personal); }
.cal-event-pill.finances { background: rgba(245,158,11,0.15); color: var(--cal-finance); }
.cal-event-pill.home     { background: rgba(249,115,22,0.15); color: var(--cal-home); }
.cal-event-pill.other    { background: var(--surface-2);      color: var(--cal-other); }

.cal-more-pill {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  padding: 1px 4px;
}

/* Week / Day view */
.cal-time-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-time-header {
  display: grid;
  border-bottom: 1px solid var(--border);
}

.cal-time-header-cell {
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  border-right: 1px solid var(--border-s);
}

.cal-time-header-cell:first-child { border-right: 1px solid var(--border); }
.cal-time-header-day { font-size: var(--text-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.cal-time-header-date {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-2);
  margin-top: 2px;
}

.cal-time-header-date.today {
  background: var(--primary);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 0;
}

.cal-time-body {
  display: flex;
  overflow-y: auto;
  max-height: 580px;
  position: relative;
}

.cal-time-labels {
  width: 56px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.cal-hour-label {
  height: 64px;
  padding: 0 var(--sp-2);
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-align: right;
  justify-content: flex-end;
  flex-shrink: 0;
}

.cal-time-cols {
  flex: 1;
  display: grid;
  position: relative;
}

.cal-day-col {
  position: relative;
  border-right: 1px solid var(--border-s);
}

.cal-day-col:last-child { border-right: none; }

.cal-hour-row {
  height: 64px;
  border-bottom: 1px solid var(--border-s);
  position: relative;
}

.cal-hour-row:last-child { border-bottom: none; }

.cal-hour-row.half-hour::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  border-top: 1px dashed var(--border-s);
}

.cal-time-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: var(--r-xs);
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
  z-index: 10;
  transition: opacity var(--ease), transform var(--ease);
}

.cal-time-event:hover { opacity: 0.88; transform: scale(1.01); }

.cal-time-event.work     { background: var(--cal-work);     color: white; }
.cal-time-event.health   { background: var(--cal-health);   color: white; }
.cal-time-event.personal { background: var(--cal-personal); color: white; }
.cal-time-event.finances { background: var(--cal-finance);  color: white; }
.cal-time-event.home     { background: var(--cal-home);     color: white; }
.cal-time-event.other    { background: var(--cal-other);    color: white; }

/* Calendar right panel — event details */
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--sp-6);
  align-items: start;
}

.cal-events-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cal-event-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-s);
  align-items: flex-start;
  transition: background var(--ease);
  cursor: pointer;
}

.cal-event-item:last-child { border-bottom: none; }
.cal-event-item:hover { background: var(--surface-2); }

.cal-event-color-bar {
  width: 4px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  align-self: stretch;
  min-height: 40px;
}

.cal-event-info { flex: 1; min-width: 0; }
.cal-event-info-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}

.cal-event-info-meta {
  font-size: var(--text-xs);
  color: var(--text-3);
}

.cal-event-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
}

.cal-event-item:hover .cal-event-actions { opacity: 1; }


/* ------------------------------------------------------------
   18. TASKS PAGE
   ------------------------------------------------------------ */

.tasks-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-6);
  align-items: start;
}

.tasks-filters {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--ease);
}

.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-s);
  transition: background var(--ease);
  group: task;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--surface-2); border-radius: var(--r-sm); }

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  margin-top: 1px;
}

.task-checkbox:hover { border-color: var(--success); }
.task-checkbox.checked { background: var(--success); border-color: var(--success); color: white; }
.task-checkbox svg { display: none; width: 11px; height: 11px; }
.task-checkbox.checked svg { display: block; }

.task-content { flex: 1; min-width: 0; }

.task-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  transition: color var(--ease);
}

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

.task-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 4px;
  flex-wrap: wrap;
}

.task-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
  flex-shrink: 0;
}

.task-item:hover .task-actions { opacity: 1; }

/* Priority indicator */
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.priority-dot.high   { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low    { background: var(--success); }

/* Tasks stats sidebar */
.tasks-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-s);
  font-size: var(--text-sm);
}

.tasks-stat-row:last-child { border-bottom: none; }
.tasks-stat-key { color: var(--text-2); font-weight: 500; }
.tasks-stat-val { font-weight: 700; color: var(--text-1); }

/* Add task inline */
.add-task-row {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-s);
  align-items: center;
}

.add-task-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--text-1);
  padding: 0;
}

.add-task-input:focus { outline: none; }
.add-task-input::placeholder { color: var(--text-4); }


/* ------------------------------------------------------------
   19. GOALS PAGE
   ------------------------------------------------------------ */

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-5);
}

.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
}

.goal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.goal-card-header {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  position: relative;
}

.goal-card-category {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.goal-timeframe-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--r-full);
}

.timeframe-quarterly { background: var(--primary-s); color: var(--primary); }
.timeframe-yearly    { background: var(--purple-s);  color: var(--purple); }
.timeframe-fiveYear  { background: var(--teal-s);    color: var(--teal); }

.goal-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.goal-card-desc {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}

.goal-progress-section {
  padding: 0 var(--sp-5) var(--sp-5);
}

.goal-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.goal-progress-pct {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.3px;
  line-height: 1;
}

.goal-deadline {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-weight: 500;
}

.goal-milestones {
  border-top: 1px solid var(--border-s);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.goal-milestones.open { max-height: 600px; }

.goal-milestones-inner {
  padding: var(--sp-4) var(--sp-5);
}

.goal-milestones-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-s);
}

.milestone-item:last-child { border-bottom: none; }

.milestone-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  margin-top: 1px;
}

.milestone-check:hover { border-color: var(--success); }
.milestone-check.done  { background: var(--success); border-color: var(--success); color: white; }
.milestone-check svg   { display: none; width: 10px; height: 10px; }
.milestone-check.done svg { display: block; }

.milestone-content { flex: 1; min-width: 0; }
.milestone-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.milestone-title.done { text-decoration: line-through; color: var(--text-3); }
.milestone-deadline { font-size: var(--text-xs); color: var(--text-3); margin-top: 2px; }

.milestone-status {
  flex-shrink: 0;
}

.goal-toggle-btn {
  width: 100%;
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface-2);
  border-top: 1px solid var(--border-s);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background var(--ease), color var(--ease);
}

.goal-toggle-btn:hover { background: var(--surface-3); color: var(--text-1); }
.goal-toggle-btn svg { width: 14px; height: 14px; transition: transform var(--ease); }
.goal-toggle-btn.open svg { transform: rotate(180deg); }

.goal-card-actions {
  display: flex;
  gap: var(--sp-2);
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  opacity: 0;
  transition: opacity var(--ease);
}

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

.goals-filters {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

/* ── Goals Page (redesign) ── */
.goals-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

/* Overview bar */
.goals-overview-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.goals-overview-bar::-webkit-scrollbar { height: 4px; }
.goals-overview-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.goals-overview-tiles {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  min-width: max-content;
}

.goals-overview-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-3) var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-width: 110px;
  max-width: 165px;
  cursor: pointer;
  transition: box-shadow var(--ease), transform var(--ease);
  position: relative;
}
.goals-overview-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.goals-tile-done { opacity: .5; }

.goals-tile-img {
  width: 100%;
  height: 68px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.goals-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.goals-tile-icon {
  font-size: 1.9rem;
  line-height: 1;
  margin-top: var(--sp-1);
}

.goals-tile-title {
  font-size: .73rem;
  font-weight: 600;
  color: var(--text-1);
  text-align: center;
  line-height: 1.38;
  word-break: break-word;
  max-width: 145px;
  white-space: normal;
}

.goals-overview-add {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  font-size: 1.4rem;
  color: var(--text-3);
  cursor: pointer;
  align-self: center;
  transition: border-color var(--ease), color var(--ease);
}
.goals-overview-add:hover { border-color: var(--accent); color: var(--accent); }

.goals-pin-wrap { position: relative; align-self: center; }

.goals-pin-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 6px 0;
}

.goals-pin-option {
  padding: 9px 16px;
  font-size: var(--text-sm);
  color: var(--text-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--ease);
}
.goals-pin-option:hover { background: var(--surface-2); }
.goals-pin-option-new {
  color: var(--primary);
  font-weight: 600;
}
.goals-pin-option-new:hover { background: var(--primary-10, rgba(99,102,241,.08)); }
.goals-pin-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.goals-tile-unpin {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.18);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.goals-overview-tile { position: relative; }
.goals-overview-tile:hover .goals-tile-unpin { display: flex; }

/* View tabs */
.goals-view-tabs {
  display: flex;
  gap: var(--sp-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  width: fit-content;
}

.goals-view-tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.goals-view-tab:hover { color: var(--text-1); }
.goals-view-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Year navigation */
.goals-year-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.goals-year-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  min-width: 48px;
  text-align: center;
}

/* Period grids */
.goals-period-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.goals-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

@media (max-width: 900px) {
  .goals-period-grid { grid-template-columns: 1fr; }
  .goals-month-grid  { grid-template-columns: repeat(2, 1fr); }
}

.goals-period-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.goals-period-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.goals-period-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-1);
}
.goals-period-range {
  font-size: .72rem;
  color: var(--text-3);
}
.goals-period-empty {
  padding: var(--sp-3) var(--sp-4);
  font-size: .8rem;
  color: var(--text-4);
  font-style: italic;
}

/* Weekly blocks */
.goals-week-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.goals-week-current {
  border-color: var(--accent);
}
.goals-current-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: var(--sp-2);
  vertical-align: middle;
}

/* Goal rows */
.goal-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
  cursor: default;
}
.goal-row:last-child { border-bottom: none; }
.goal-row:hover { background: var(--surface-2); }
.goal-row-done { opacity: .6; }
.goal-row-done .goal-row-title { text-decoration: line-through; }

.goal-row-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color var(--ease), background var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.goal-row-check:hover { border-color: var(--accent); }
.goal-row-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.goal-row-check.checked svg { display: block; }
.goal-row-check svg { display: none; width: 10px; height: 10px; color: #fff; }

.goal-row-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.goal-row-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-row-meta {
  display: flex;
  gap: var(--sp-2);
  margin-top: 2px;
  flex-wrap: wrap;
}
.goal-row-year {
  font-size: .70rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(99,102,241,.10);
  border-radius: var(--r-full);
  padding: 1px 7px;
  letter-spacing: .02em;
}
.goal-row-deadline {
  font-size: .72rem;
  color: var(--text-3);
}
.goal-row-milestones {
  font-size: .72rem;
  color: var(--accent);
  font-weight: 500;
}

.goal-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 60px;
}
.goal-row-pct {
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
}
.goal-row-bar {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.goal-row-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
}
.goal-row-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
}
.goal-row:hover .goal-row-actions { opacity: 1; }

/* Milestones modal internals */
.ms-goal-header {
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.ms-goal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.ms-goal-meta {
  font-size: .78rem;
  color: var(--text-3);
}
.ms-progress-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.ms-progress-pct {
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 40px;
}
.ms-progress-label {
  font-size: .78rem;
  color: var(--text-3);
  flex: 1;
}

.ms-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--sp-4);
  max-height: 340px;
  overflow-y: auto;
}
.ms-empty {
  font-size: .85rem;
  color: var(--text-4);
  font-style: italic;
  padding: var(--sp-3) 0;
}
.ms-add-row {
  padding-top: var(--sp-2);
}

.ms-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  transition: background var(--ease);
}
.ms-row:hover { background: var(--surface-2); }
.ms-row-done .ms-row-title { text-decoration: line-through; opacity: .55; }

.ms-check {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--ease), background var(--ease);
}
.ms-check:hover { border-color: var(--accent); }
.ms-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.ms-check.checked svg { display: block; }
.ms-check svg { display: none; width: 9px; height: 9px; color: #fff; }

.ms-row-body { flex: 1; min-width: 0; }
.ms-row-title {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-1);
}
.ms-row-date {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 2px;
}
.ms-row-actions {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--ease);
}
.ms-row:hover .ms-row-actions { opacity: 1; }

.ms-action-cal,
.ms-action-task {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.ms-action-cal:hover  { border-color: var(--accent); color: var(--accent); }
.ms-action-task:hover { border-color: var(--green,#22c55e); color: var(--green,#22c55e); }

/* Pin manager */
.pin-manager-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}
.pin-manager-row:last-child { border-bottom: none; }
.pin-manager-cb { cursor: pointer; width: 16px; height: 16px; accent-color: var(--accent); }
.pin-manager-title {
  font-size: .875rem;
  color: var(--text-1);
}


/* ── Milestone labels (tasks, habits, dashboard) ── */
.milestone-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 3px;
  flex-wrap: wrap;
}
.milestone-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  white-space: nowrap;
}
.milestone-goal-ref {
  font-size: .68rem;
  color: var(--text-3);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ── ms-action-habit button ── */
.ms-action-habit {
  font-size: .8rem;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
  transition: border-color var(--ease), color var(--ease);
}
.ms-action-habit:hover { border-color: var(--accent); color: var(--accent); }

/* ── Year Goal blocks ── */
.year-goal-block {
  border-bottom: 1px solid var(--border);
}
.year-goal-block:last-child { border-bottom: none; }

.year-goal-hdr {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  transition: background var(--ease);
  cursor: default;
}
.year-goal-hdr:hover { background: var(--surface-2); }

.year-goal-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.year-goal-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.year-goal-title.done { text-decoration: line-through; opacity: .6; }
.year-goal-meta {
  display: flex;
  gap: var(--sp-2);
  margin-top: 3px;
  flex-wrap: wrap;
}
.year-goal-sub-count {
  font-size: .72rem;
  color: var(--accent);
  font-weight: 500;
}

.year-goal-breakdown {
  background: var(--surface-2);
  border-top: 1px solid var(--border-s);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
}

.year-breakdown-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-4);
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--r-md);
  width: fit-content;
}
.year-breakdown-tab {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.year-breakdown-tab:hover { color: var(--text-1); }
.year-breakdown-tab.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ── Quarterly goal block (inside year breakdown Q panel) ── */
.quarter-goal-block {
  border: 1px solid var(--border-s);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
  background: var(--surface);
  overflow: hidden;
}
.quarter-goal-hdr {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3);
  transition: background var(--ease);
}
.quarter-goal-hdr:hover { background: var(--surface-2); }
.quarter-goal-info { flex: 1; min-width: 0; cursor: pointer; }

.quarter-mode-choice {
  padding: var(--sp-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border-s);
}

.quarter-breakdown-simple,
.quarter-breakdown-detailed {
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border-s);
}
.quarter-month-block {
  margin-bottom: var(--sp-4);
}
.quarter-month-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-s);
  margin-bottom: var(--sp-2);
  font-size: var(--text-sm);
}
.quarter-weekly-section {
  margin-top: var(--sp-2);
  border-top: 1px dashed var(--border-s);
  padding-top: var(--sp-2);
}
.quarter-week-block {
  margin-left: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.quarter-week-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-1) 0;
  font-size: .75rem;
  color: var(--text-3);
}

/* ── 5-Year Goal expanded breakdown ── */
.fiveyear-breakdown {
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
}
.fiveyear-year-block {
  border: 1px solid var(--border-s);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  overflow: hidden;
}
.fiveyear-general-block {
  border-color: var(--primary);
  border-opacity: 0.3;
  border: 1px solid rgba(99,102,241,.25);
}
.fiveyear-general-block .fiveyear-year-hdr {
  background: rgba(99,102,241,.06);
  cursor: default;
}
.fiveyear-general-block .fiveyear-year-hdr:hover {
  background: rgba(99,102,241,.10);
}
.fiveyear-year-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  cursor: pointer;
  font-size: var(--text-sm);
  user-select: none;
  transition: background .15s;
}
.fiveyear-year-hdr:hover { background: var(--surface-3); }
.fiveyear-year-content {
  padding: var(--sp-3) var(--sp-3);
}

/* ── Plan mode chooser (5-Year Goal creation) ── */
.plan-mode-choice {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.plan-mode-option {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.plan-mode-option:hover { border-color: var(--primary); background: var(--surface-2); }
.plan-mode-option.selected { border-color: var(--primary); background: var(--primary-light, #e0e7ff); }
.plan-mode-option input[type="radio"] { flex-shrink: 0; margin-top: 3px; accent-color: var(--primary); }
.plan-mode-body strong { display: block; font-size: var(--text-sm); font-weight: 700; color: var(--text-1); }
.plan-mode-desc { font-size: .72rem; color: var(--text-3); margin-top: 2px; }

/* ── Sub-goal labels on calendar/agenda items ── */
.cal-event-ms-tag {
  font-size: .7rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 1px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event-item-ms .cal-event-color-bar { background: var(--primary) !important; }
.cal-time-event-ms { border-left: 3px solid var(--primary); }
.cal-event-pill-ms { font-style: italic; }
.agenda-event-goal {
  font-size: .68rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 1px;
  opacity: .9;
}
.agenda-event-milestone { border-left: 3px solid var(--primary) !important; }

/* ── Habit per-day times ── */
.habit-day-times-section {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-s);
}
.habit-day-time-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-s);
}
.habit-day-time-row:last-child { border-bottom: none; }
.habit-day-time-label {
  min-width: 90px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
}
.habit-day-time-sep {
  color: var(--text-4);
  font-size: .9rem;
}
.form-input-sm {
  max-width: 110px;
  font-size: .82rem;
  padding: var(--sp-1) var(--sp-2);
}

/* ------------------------------------------------------------
   20. WISHLIST PAGE
   ------------------------------------------------------------ */

/* ── Two-column layout ── */
/* ── Wishlist: horizontal list bar ── */
.wl-list-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-wrap: nowrap;
}
.wl-list-bar::-webkit-scrollbar { height: 3px; }
.wl-list-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.wl-list-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 6px var(--sp-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.wl-list-tab:hover {
  background: var(--surface-2);
  color: var(--text-1);
  border-color: var(--border);
}
.wl-list-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.wl-list-count {
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(0,0,0,.08);
  color: inherit;
}
.wl-list-tab.active .wl-list-count { background: rgba(255,255,255,.25); }

/* No hover dropdown — list management moved to content header */

.wl-list-add-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px var(--sp-3);
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: border-color var(--ease), color var(--ease);
}
.wl-list-add-tab:hover { border-color: var(--accent); color: var(--accent); }
.wl-list-add-tab svg { width: 13px; height: 13px; }

/* ── Wishlist body: filter col | separator | content ── */
.wl-body {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.wl-filter-col {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: var(--sp-4);
}

.wl-fc-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-4);
  padding: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-1);
}

.wl-filter-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px var(--sp-3);
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.wl-filter-btn:hover { background: var(--surface-2); color: var(--text-1); }
.wl-filter-btn.active {
  background: var(--primary-light, #e0e7ff);
  color: var(--primary);
  font-weight: 600;
}

.wl-fc-actions {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-s);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.wl-fc-addbtn { font-size: .78rem !important; }

.wl-vsep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 var(--sp-4);
}

.wl-content { flex: 1; min-width: 0; }

.wl-content-hdr {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.wl-content-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
}
.wl-content-count {
  font-size: var(--text-xs);
  color: var(--text-3);
}
.wl-content-mgmt {
  display: flex;
  gap: 2px;
  margin-left: auto;
  opacity: 0.5;
  transition: opacity var(--ease);
}
.wl-content-hdr:hover .wl-content-mgmt { opacity: 1; }

@media (max-width: 640px) {
  .wl-body { flex-direction: column; }
  .wl-filter-col { width: 100%; flex-direction: row; flex-wrap: wrap; padding-right: 0; padding-bottom: var(--sp-3); }
  .wl-vsep { width: 100%; height: 1px; margin: 0 0 var(--sp-3); }
  .wl-fc-actions { margin-top: 0; padding-top: 0; border-top: none; flex-direction: row; }
}

/* ── List tag on card (shown in "All" view) ── */
.wish-card-list-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 8px;
  margin-bottom: var(--sp-2);
  border: 1px solid var(--border);
}

/* ── Price display ── */
.wish-card-price {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

/* ── Shared view banner ── */
.wish-share-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.wish-share-banner-icon { font-size: 2rem; flex-shrink: 0; }
.wish-share-banner-info { flex: 1; min-width: 0; }
.wish-share-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
}
.wish-share-banner-meta {
  font-size: .8rem;
  color: var(--text-3);
  margin-top: 2px;
}
.wish-share-badge { flex-shrink: 0; }

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-5);
}

.wish-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
  display: flex;
  flex-direction: column;
}

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

.wish-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  overflow: hidden;
  position: relative;
}

.wish-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.wish-card:hover .wish-card-img img { transform: scale(1.04); }

.wish-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  background: var(--surface-2);
}

.wish-card-img-placeholder svg { width: 36px; height: 36px; }

.wish-card-body {
  padding: var(--sp-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wish-card-category {
  margin-bottom: var(--sp-2);
}

.wish-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.wish-card-desc {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--sp-3);
}

.wish-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-s);
}

.wish-card-status { }

.wish-card-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
}

.wish-card:hover .wish-card-actions { opacity: 1; }

.wish-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  transition: opacity var(--ease);
}

.wish-link:hover { opacity: 0.75; }
.wish-link svg { width: 12px; height: 12px; }

.wishlist-toolbar {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
  align-items: center;
}

.wishlist-toolbar .spacer { flex: 1; }

/* Status badge for wishlist */
.status-active   { background: var(--primary-s); color: var(--primary); }
.status-acquired { background: var(--success-s); color: var(--success); }
.status-removed  { background: var(--surface-2); color: var(--text-3); }


/* ------------------------------------------------------------
   21. VISION BOARD PAGE
   ------------------------------------------------------------ */

/* Vision Board mode toggle bar */
.vb-mode-bar {
  display: flex;
  gap: 3px;
  margin-bottom: var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  width: fit-content;
}

.vb-mode-btn {
  padding: var(--sp-2) var(--sp-5);
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
  white-space: nowrap;
}
.vb-mode-btn.active {
  background: var(--surface);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ── Structured mode toolbar ── */
.vb-toolbar {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
  align-items: center;
}

.vb-toolbar .spacer { flex: 1; }

.vb-grid {
  columns: 3;
  column-gap: var(--sp-5);
}

@media (max-width: 1100px) { .vb-grid { columns: 2; } }
@media (max-width: 600px)  { .vb-grid { columns: 1; } }

.vb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  break-inside: avoid;
  margin-bottom: var(--sp-5);
  transition: box-shadow var(--ease), transform var(--ease);
  cursor: pointer;
  display: block;
}

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

.vb-card-img {
  width: 100%;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vb-card-img img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.vb-card:hover .vb-card-img img { transform: scale(1.04); }

.vb-card-img-placeholder {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
}

.vb-card-img-placeholder svg { width: 40px; height: 40px; }

.vb-card-body { padding: var(--sp-4); }

.vb-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
  line-height: 1.3;
  margin-bottom: var(--sp-2);
}

.vb-card-affirmation {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 600;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: var(--sp-2);
  border-left: 3px solid var(--primary-s);
  padding-left: var(--sp-3);
}

.vb-card-desc {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.5;
}

.vb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-3);
  margin-top: var(--sp-3);
  border-top: 1px solid var(--border-s);
}

.vb-card-goal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
}

.vb-card-goal-link svg { width: 12px; height: 12px; }

.vb-card-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
}

.vb-card:hover .vb-card-actions { opacity: 1; }

.vb-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--text-3);
}

.vb-empty svg { width: 48px; height: 48px; margin: 0 auto var(--sp-4); opacity: 0.5; }
.vb-empty h3 { font-size: var(--text-lg); font-weight: 700; color: var(--text-2); margin-bottom: var(--sp-2); }
.vb-empty p  { font-size: var(--text-sm); }

/* ── Creative Canvas mode ── */
.vbc-toolbar {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.vbc-hint {
  font-size: var(--text-xs);
  color: var(--text-4);
  font-style: italic;
}

.vbc-canvas {
  position: relative;
  min-height: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background-image: radial-gradient(var(--border-s,rgba(0,0,0,.06)) 1px, transparent 1px);
  background-size: 24px 24px;
}

.vbc-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.vbc-item {
  position: absolute;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 80px;
  min-height: 60px;
  cursor: grab;
  transition: box-shadow .15s ease, border-color .15s ease;
  user-select: none;
}
.vbc-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-s, rgba(99,102,241,.35));
  z-index: 10;
}

/* Body fills full item — no header bar needed */
.vbc-item-body {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 14px;
  overflow: hidden;
  border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
  pointer-events: none; /* let clicks pass through to vbc-item for dragging */
}
/* Re-enable pointer events for img so onerror fires */
.vbc-item-body img { pointer-events: none; }

.vbc-text-content {
  width: 100%;
  height: 100%;
  padding: 10px 12px;
  box-sizing: border-box;
  word-break: break-word;
  overflow: hidden;
  user-select: none;
  line-height: 1.45;
}

.vbc-item-actions {
  position: absolute;
  top: -10px;
  right: -8px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity var(--ease);
  z-index: 20;
  pointer-events: auto; /* override body's pointer-events:none */
}
.vbc-item:hover .vbc-item-actions { opacity: 1; }

.vbc-act-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .62rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  line-height: 1;
  padding: 0;
}
.vbc-act-del {
  background: var(--danger-bg, #fee2e2);
  color: var(--danger, #dc2626);
  border-color: #fca5a5;
}

.vbc-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: var(--border);
  border-radius: var(--r-sm) 0 calc(var(--r-md) - 1px) 0;
  opacity: 0;
  transition: opacity var(--ease);
  z-index: 15;
  pointer-events: auto;
}
.vbc-item:hover .vbc-resize-handle { opacity: 1; }

/* ── Image items: frameless — just the raw image on canvas ── */
.vbc-item-image {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.vbc-item-image:hover {
  box-shadow: 0 0 0 2px var(--primary-s, rgba(99,102,241,.4)) !important;
}
.vbc-item-image .vbc-item-body {
  bottom: 0;
  border-radius: var(--r-md);
}
.vbc-item-image .vbc-resize-handle {
  background: rgba(255,255,255,.6);
  border: none;
}

/* ── Text items: subtle shadow ── */
.vbc-item-text {
  box-shadow: var(--shadow-sm);
}

/* ── Multi-select: selected item highlight ── */
.vbc-item-selected {
  border-color: var(--primary, #6366f1) !important;
  box-shadow: 0 0 0 2.5px rgba(99,102,241,.28), var(--shadow-sm) !important;
  z-index: 5;
}
.vbc-item-image.vbc-item-selected {
  box-shadow: 0 0 0 3px var(--primary, #6366f1) !important;
}

/* ── Selection count badge in toolbar ── */
.vbc-sel-count {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 12px;
  padding: 3px 10px;
  margin-right: var(--sp-3);
}
.vbc-sel-count::before { content: '✦'; font-size: .6rem; }


/* ------------------------------------------------------------
   22. PROFILE PAGE
   ------------------------------------------------------------ */

.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  color: white;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.profile-hero::after {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.profile-avatar-large {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  color: white;
  font-size: var(--text-2xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.profile-hero-info { flex: 1; min-width: 0; position: relative; z-index: 1; }

.profile-hero-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.profile-hero-motto {
  font-size: var(--text-base);
  opacity: 0.80;
  font-style: italic;
  margin-bottom: var(--sp-4);
}

.profile-hero-edit {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
  backdrop-filter: blur(4px);
  transition: background var(--ease);
  cursor: pointer;
}

.profile-hero-edit:hover { background: rgba(255,255,255,0.25); }
.profile-hero-edit svg { width: 14px; height: 14px; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.profile-stat {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  text-align: center;
}

.profile-stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.profile-stat-label {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-weight: 500;
}

/* Achievement badges */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-4);
}

.achievement-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  text-align: center;
  transition: all var(--ease);
  position: relative;
  overflow: hidden;
}

.achievement-badge:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.achievement-badge.locked {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.achievement-badge.unlocked {
  border-color: var(--warning);
  background: linear-gradient(135deg, var(--warning-s) 0%, transparent 100%);
}

.badge-emoji {
  font-size: 28px;
  line-height: 1;
  margin-bottom: var(--sp-2);
  display: block;
}

.badge-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
  line-height: 1.3;
}

.badge-desc {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.4;
}

.badge-unlocked-mark {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  width: 16px;
  height: 16px;
  background: var(--warning);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.profile-day-progress {
  padding: var(--sp-5) var(--sp-6);
}

.profile-day-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.profile-day-label {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin-bottom: var(--sp-4);
}


/* ------------------------------------------------------------
   23. EMPTY STATES
   ------------------------------------------------------------ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--text-3);
}

.empty-state svg {
  width: 52px;
  height: 52px;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.empty-state h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--text-3);
  max-width: 300px;
  line-height: 1.6;
  margin-bottom: var(--sp-5);
}


/* ------------------------------------------------------------
   24. UTILITY / HELPERS
   ------------------------------------------------------------ */

.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2      { gap: var(--sp-2); }
.gap-3      { gap: var(--sp-3); }
.gap-4      { gap: var(--sp-4); }
.gap-5      { gap: var(--sp-5); }
.gap-6      { gap: var(--sp-6); }
.w-full     { width: 100%; }
.flex-1     { flex: 1; }
.min-w-0    { min-width: 0; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-sm    { font-size: var(--text-sm); }
.text-xs    { font-size: var(--text-xs); }
.text-2     { color: var(--text-2); }
.text-3     { color: var(--text-3); }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.mb-1       { margin-bottom: var(--sp-1); }
.mb-2       { margin-bottom: var(--sp-2); }
.mb-3       { margin-bottom: var(--sp-3); }
.mb-4       { margin-bottom: var(--sp-4); }
.mb-5       { margin-bottom: var(--sp-5); }
.mb-6       { margin-bottom: var(--sp-6); }
.mt-3       { margin-top: var(--sp-3); }
.mt-4       { margin-top: var(--sp-4); }
.mt-auto    { margin-top: auto; }
.p-4        { padding: var(--sp-4); }
.p-5        { padding: var(--sp-5); }
.p-6        { padding: var(--sp-6); }
.hidden     { display: none; }


/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border-s);
  margin: var(--sp-4) 0;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

.spin { animation: spin 1s linear infinite; }

/* Separator dot */
.sep { color: var(--text-4); }


/* ------------------------------------------------------------
   25. RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { flex-direction: row; flex-wrap: wrap; }
  .dashboard-side > * { flex: 1; min-width: 280px; }
  .cal-layout { grid-template-columns: 1fr; }
  .tasks-layout { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-248px);
    width: 248px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar-overlay.active { display: block; }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .top-header { padding: 0 var(--sp-5); }
  .page-container { padding: var(--sp-5); }
  .header-username { display: none; }
}

@media (max-width: 680px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .goals-grid { grid-template-columns: 1fr; }
  .wishlist-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .badges-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .profile-hero { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .header-date-chip { display: none; }
  .cal-layout { gap: var(--sp-4); }
  .wishlist-grid { grid-template-columns: 1fr; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal-wrapper { align-items: flex-end; padding: 0; }
}


/* ============================================================
   TASKS REDESIGN — Inbox + Day Groups
   ============================================================ */

/* ── Top control bar ── */
.tasks-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.tasks-view-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
}

.tasks-view-tab {
  padding: var(--sp-2) var(--sp-4);
  border: none;
  border-radius: calc(var(--r-lg) - 2px);
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}

.tasks-view-tab:hover {
  color: var(--text-1);
  background: var(--surface-3);
}

.tasks-view-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ── Empty state ── */
.tasks-empty-state {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  color: var(--text-3);
  font-size: var(--text-sm);
}

/* ── Past day card ── */
.past-day-card {
  border-bottom: 1px solid var(--border-s);
  padding-bottom: var(--sp-1);
  margin-bottom: var(--sp-1);
}

.past-day-card:last-child {
  border-bottom: none;
}

.past-day-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5) var(--sp-2);
  gap: var(--sp-3);
}

.past-day-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}

.past-day-ago {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 2px;
}

/* Two-column page grid (main + sidebar) */
.tasks-page-grid {
  display: grid;
  grid-template-columns: 1fr 292px;
  gap: var(--sp-6);
  align-items: start;
}

@media (max-width: 960px) {
  .tasks-page-grid { grid-template-columns: 1fr; }
}

/* ── Inbox ── */
.inbox-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-s);
}

.inbox-plus-icon {
  color: var(--text-4);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.inbox-quick-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-base);
  color: var(--text-1);
  font-weight: 500;
  padding: 0;
  line-height: 1.5;
}

.inbox-quick-input:focus { outline: none; }
.inbox-quick-input::placeholder { color: var(--text-4); font-weight: 400; }

.inbox-add-btn {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  background: var(--primary-s);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
  transition: all var(--ease);
}

.inbox-add-btn:hover {
  background: var(--primary);
  color: white;
}

/* Inbox task row */
.inbox-task {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-5);
  border-bottom: 1px solid var(--border-s);
  transition: background var(--ease);
}

.inbox-task:last-child { border-bottom: none; }
.inbox-task:hover { background: var(--surface-2); }

.inbox-task .task-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
  flex-shrink: 0;
}

.inbox-task:hover .task-actions { opacity: 1; }

.inbox-empty-msg {
  padding: var(--sp-6) var(--sp-5);
  font-size: var(--text-sm);
  color: var(--text-3);
  text-align: center;
  font-style: italic;
  line-height: 1.6;
}

/* ── Day Groups ── */
/* Day groups — each day now rendered as a standalone card */
.day-groups {
  display: flex;
  flex-direction: column;
}

/* ── Calendar button (on each dated task) ── */
.task-cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.task-cal-btn:hover {
  background: var(--primary-s);
  color: var(--primary);
  border-color: var(--primary);
}

.task-cal-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Schedule button (inbox items only) ── */
.task-sched-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.task-sched-btn:hover {
  background: var(--warning-s);
  color: var(--warning);
  border-color: var(--warning);
}

.task-sched-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Tasks sidebar ── */
.tasks-sidebar-col {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-6));
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.tasks-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-s);
  font-size: var(--text-sm);
}

.tasks-stat-row:last-child { border-bottom: none; }
.tasks-stat-key { color: var(--text-2); font-weight: 500; }
.tasks-stat-val { font-weight: 700; color: var(--text-1); }


/* Kbd hint */
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  font-family: monospace;
  line-height: 1.4;
}

/* ── Inbox 3-field quick-capture form ── */
.inbox-form-wrap {
  padding: var(--sp-4) var(--sp-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.inbox-form-name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Fields row: category + priority selects + Add button */
.inbox-form-fields-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-left: calc(20px + var(--sp-3)); /* visually aligned with the text input */
}

.inbox-form-select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ease);
}

.inbox-form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

/* Priority color states */
.inbox-form-select.sel-pri-high   { background: rgba(239,68,68,.13);  color: var(--danger);  border-color: rgba(239,68,68,.35); }
.inbox-form-select.sel-pri-medium { background: rgba(234,179,8,.13);  color: var(--warning); border-color: rgba(234,179,8,.35); }
.inbox-form-select.sel-pri-low    { background: rgba(34,197,94,.13);  color: var(--success); border-color: rgba(34,197,94,.35); }

/* Category color states */
.inbox-form-select.sel-cat-work      { background: rgba(99,102,241,.13);  color: #6366f1; border-color: rgba(99,102,241,.35); }
.inbox-form-select.sel-cat-health    { background: rgba(34,197,94,.13);   color: var(--success); border-color: rgba(34,197,94,.35); }
.inbox-form-select.sel-cat-finances  { background: rgba(234,179,8,.13);   color: var(--warning); border-color: rgba(234,179,8,.35); }
.inbox-form-select.sel-cat-personal  { background: rgba(168,85,247,.13);  color: #a855f7; border-color: rgba(168,85,247,.35); }
.inbox-form-select.sel-cat-home      { background: rgba(249,115,22,.13);  color: #f97316; border-color: rgba(249,115,22,.35); }
.inbox-form-select.sel-cat-other     { background: var(--surface-2); color: var(--text-2); }

/* Inline title + badges row inside inbox tasks */
.inbox-task-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  min-width: 0;
}

/* Custom category badge — neutral teal */
.cat-custom {
  background: rgba(6,182,212,.13);
  color: #06B6D4;
  border: 1px solid rgba(6,182,212,.3);
}

/* Custom category text input in inbox form */
.inbox-custom-cat-input { flex: 1.4; }

/* Color for 'custom' select state */
.inbox-form-select.sel-cat-custom {
  background: rgba(6,182,212,.13);
  color: #06B6D4;
  border-color: rgba(6,182,212,.3);
}

/* ── Time Spent — Donut chart ── */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.donut-svg {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.08));
}

.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-cat {
  flex: 1;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-pct {
  font-weight: 700;
  color: var(--text-1);
  flex-shrink: 0;
}

.donut-empty {
  text-align: center;
  padding: var(--sp-4) 0 var(--sp-2);
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ── Past Tasks collapsible section ── */
.past-tasks-section {
  margin-top: var(--sp-6);
}

.past-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ease);
}

.past-toggle-btn:hover {
  background: var(--surface-3);
  color: var(--text-1);
  border-color: var(--primary);
}

.past-toggle-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.past-toggle-btn.expanded .past-toggle-chevron {
  transform: rotate(180deg);
}

.past-tasks-body {
  margin-top: var(--sp-4);
}

/* ── End-of-Day trigger button (in sidebar) ── */
.eod-trigger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--ease), transform var(--ease);
  letter-spacing: .01em;
}

.eod-trigger-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* ── End-of-Day review modal ── */
.eod-intro {
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--sp-5);
  padding: var(--sp-4);
  background: var(--surface-2);
  border-radius: var(--r-md);
  border-left: 3px solid var(--primary);
}

.eod-task-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.eod-task {
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--ease);
}

.eod-task:hover { border-color: var(--primary); }

.eod-task-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.eod-task-title {
  font-weight: 600;
  color: var(--text-1);
  font-size: var(--text-sm);
  flex: 1;
  min-width: 120px;
}

.eod-task-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.eod-option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  user-select: none;
  white-space: nowrap;
}

.eod-option-label input[type="radio"] { display: none; }

/* Reschedule option */
.eod-option-reschedule { color: var(--primary); }
.eod-option-reschedule:has(input:checked) {
  background: var(--primary-s);
  border-color: var(--primary);
}
.eod-option-reschedule:hover { background: var(--primary-s); border-color: var(--primary); }

/* Inbox option */
.eod-option-inbox { color: var(--text-2); }
.eod-option-inbox:has(input:checked) {
  background: var(--surface-3);
  border-color: var(--text-3);
  color: var(--text-1);
}
.eod-option-inbox:hover { background: var(--surface-3); border-color: var(--text-3); }

/* Delete option */
.eod-option-delete { color: var(--danger); }
.eod-option-delete:has(input:checked) {
  background: rgba(239,68,68,.1);
  border-color: var(--danger);
}
.eod-option-delete:hover { background: rgba(239,68,68,.08); border-color: var(--danger); }

/* Inline date picker for reschedule */
.eod-date-input {
  padding: 4px 8px !important;
  font-size: var(--text-xs) !important;
  height: auto !important;
  width: auto !important;
  min-width: 130px;
  border-radius: var(--r-xs) !important;
}

/* ============================================================
   DASHBOARD REDESIGN — New classes
   ============================================================ */

/* ── Stats row ── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
@media (max-width: 860px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Stat card: label on top, big number below */
.dash-stat {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-s);
  border-left-width: 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: box-shadow var(--ease);
}
.dash-stat:hover { box-shadow: var(--shadow-md); }

.dash-stat.c-success { border-left-color: var(--success); }
.dash-stat.c-primary  { border-left-color: var(--primary); }
.dash-stat.c-warning  { border-left-color: var(--warning); }
.dash-stat.c-purple   { border-left-color: var(--purple);  }

.dash-stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .03em;
}
.dash-stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.1;
  margin-top: 1px;
}
.dash-stat-sub {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Achievements + EOD row ── */
.dash-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.dash-badges-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  flex: 1;
}
.dash-badges-lbl {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}
.dash-no-badges {
  font-size: var(--text-xs);
  color: var(--text-4);
  font-style: italic;
}

/* ── End My Day button ── */
.dash-eod-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  background: linear-gradient(135deg, #1D3D8F 0%, #4F63E8 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--ease), transform var(--ease);
}
.dash-eod-btn:hover { opacity: .85; transform: translateY(-1px); }

/* ── Two-column layout ── */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-4);
  align-items: start;
  margin-bottom: var(--sp-4);
}
@media (max-width: 1100px) {
  .dash-two-col { grid-template-columns: 1fr; }
}

/* ── Task list card (left) ── */
.dash-tasks-card {
  display: flex;
  flex-direction: column;
}
.dash-tasks-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
  border-bottom: 1px solid var(--border-s);
  flex-wrap: wrap;
}
.dash-hdr-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── Sort toggle ── */
.sort-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.sort-toggle button {
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: calc(var(--r-sm) - 2px);
  color: var(--text-3);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}
.sort-toggle button:hover { color: var(--text-1); }
.sort-toggle button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── Task list ── */
.dash-task-list {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
}
.dash-task-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
  border-bottom: 1px solid var(--border-s);
  transition: background var(--ease);
  min-height: 40px;
}
.dash-task-row:last-child { border-bottom: none; }
.dash-task-row:hover { background: var(--surface-2); }
.dash-task-row.done { opacity: .5; }

/* Actions area on the right of every unified task row */
.tasks-row-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}
/* All action buttons hidden until hover */
.tasks-row-actions .task-sched-btn { opacity: 0; transition: opacity var(--ease); }
.tasks-row-actions .task-actions   { opacity: 0; transition: opacity var(--ease); }
.dash-task-row:hover .tasks-row-actions .task-sched-btn { opacity: 1; }
.dash-task-row:hover .tasks-row-actions .task-actions   { opacity: 1; }

.dash-task-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.dash-task-title {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-task-title.done {
  text-decoration: line-through;
  color: var(--text-3);
}
.dash-task-meta { display: flex; gap: var(--sp-2); flex-shrink: 0; }

/* ── Extra-small badge ── */
.badge.badge-xs, .badge-xs {
  font-size: 10px !important;
  padding: 1px 6px !important;
  line-height: 1.5;
}

/* ── Right column ── */
.dash-right-col { display: flex; flex-direction: column; }

/* ── Agenda card ── */
.agenda-card { display: flex; flex-direction: column; }

.agenda-slots {
  height: 430px; /* ~12 visible slots at 36px each = 6 am – 6 pm */
  overflow-y: auto;
  scroll-behavior: smooth;
}

.agenda-slot {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 36px;
  border-bottom: 1px solid var(--border-s);
  transition: background var(--ease);
  position: relative;
}
.agenda-slot:last-child { border-bottom: none; }
.agenda-slot.is-now { background: var(--primary-s); }
.agenda-slot.has-event { background: var(--surface-2); }
.agenda-slot.agenda-slot-drop-target { background: var(--accent-s); outline: 2px dashed var(--accent); outline-offset: -2px; }

.agenda-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-4);
  width: 36px;
  flex-shrink: 0;
  padding: 6px var(--sp-2) 0 var(--sp-3);
  line-height: 1;
}
.agenda-slot.is-now .agenda-time { color: var(--primary); font-weight: 800; }

.agenda-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px var(--sp-3) 4px var(--sp-2);
  min-height: 36px;
  border-radius: var(--r-xs);
  transition: background var(--ease);
}
.agenda-content:hover { background: rgba(79,99,232,.05); }

.agenda-now-line {
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  opacity: .7;
  margin-top: 4px;
}

/* Events inside agenda */
.agenda-event {
  border-left: 3px solid var(--evt-color, var(--accent));
  padding: 3px 8px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--surface-2);
  cursor: grab;
  user-select: none;
  transition: opacity var(--ease), transform var(--ease);
}
.agenda-event:active { cursor: grabbing; }
.agenda-event:hover { transform: translateX(2px); opacity: .9; }
.agenda-event.agenda-event-dragging { opacity: .35; transform: scale(.98); }

/* Habit blocks in the agenda — dashed border, checkable on click */
.agenda-event-habit {
  border-left-style: dashed;
  background: color-mix(in srgb, var(--evt-color, var(--accent)) 6%, var(--surface-2));
  cursor: pointer;
  draggable: false;
}
.agenda-event-habit:hover { opacity: .85; transform: translateX(2px); }
.agenda-event-habit-done .agenda-event-title {
  text-decoration: line-through;
  opacity: .55;
}
.agenda-event-habit-done { opacity: .7; }

.agenda-event-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-event-time {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
}

/* ── EOD banner (persistent) ── */
.eod-dash-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: linear-gradient(135deg, rgba(29,61,143,.10), rgba(79,99,232,.06));
  border: 1px solid rgba(79,99,232,.22);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-5);
  margin-bottom: var(--sp-4);
}
.eod-banner-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.eod-banner-body { flex: 1; }
.eod-banner-title { font-size: var(--text-sm); font-weight: 700; color: var(--text-1); margin-bottom: 1px; }
.eod-banner-sub   { font-size: var(--text-xs); color: var(--text-2); }

/* ── Task grouping labels ── */
.dash-task-group-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: var(--sp-2) var(--sp-5) var(--sp-1);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-s);
}

.dash-task-section-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--surface-3);
  border-top: 1px solid var(--border-s);
  border-bottom: 1px solid var(--border-s);
}

/* ── Bottom row: Goals (compact) + Donut (large, equal halves) ── */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  align-items: stretch; /* equal heights */
}
@media (max-width: 860px) {
  .dash-bottom-row { grid-template-columns: 1fr; }
}

.dash-goals-card { display: flex; flex-direction: column; }
.dash-donut-card  { display: flex; flex-direction: column; }

/* Goals body — compact spacing */
.dash-goals-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}
.dash-goal-row { display: flex; flex-direction: column; gap: var(--sp-1); }
.dash-goal-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-1);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Donut body — centred vertically */
.dash-donut-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-5) var(--sp-5);
}

/* Large donut for bottom row */
.donut-wrap-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
}
.donut-svg-lg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.10));
}
.donut-legend-lg {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============================================================
   PROFILE — Activity Chart
   ============================================================ */

/* Period tab row */
.activity-period-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.activity-period-tabs button {
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: calc(var(--r-sm) - 2px);
  color: var(--text-3);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--ease);
}
.activity-period-tabs button:hover { color: var(--text-1); }
.activity-period-tabs button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Bars container */
.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-bottom: var(--sp-1);
}

.activity-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.activity-bar-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  height: 14px;
  line-height: 14px;
}

.activity-bar-track {
  flex: 1;
  width: 100%;
  background: var(--surface-3);
  border-radius: var(--r-xs);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.activity-bar-fill {
  width: 100%;
  background: var(--accent-s);
  border-radius: var(--r-xs);
  transition: height .5s cubic-bezier(0.4,0,0.2,1);
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
  opacity: .55;
  min-height: 2px;
}
.activity-bar-fill:empty { display: none; }

.activity-bar-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-4);
  text-align: center;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.activity-bar-label.today {
  color: var(--primary);
  font-weight: 800;
}

/* ============================================================
   PROFILE — Settings
   ============================================================ */

.settings-group-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-s);
  margin-bottom: var(--sp-1);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-s);
}
.setting-row:last-child { border-bottom: none; }

.setting-info { flex: 1; }
.setting-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.setting-desc {
  font-size: var(--text-xs);
  color: var(--text-3);
}

.setting-time-input {
  width: auto !important;
  min-width: 110px;
  padding: 6px 10px !important;
  font-size: var(--text-sm) !important;
}

/* ── Toggle switch ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--r-full);
  transition: background var(--ease);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */

.settings-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  max-width: 680px;
}

.settings-card { display: flex; flex-direction: column; }

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Theme toggle inside Settings */
.settings-theme-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.settings-theme-btn {
  padding: 6px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: calc(var(--r-sm) - 2px);
  color: var(--text-3);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}
.settings-theme-btn:hover { color: var(--text-1); }
.settings-theme-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.settings-theme-btn-purple.active {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff;
  box-shadow: 0 0 12px rgba(139,92,246,0.45);
}
[data-theme="purple"] .settings-theme-btn-purple.active {
  background: linear-gradient(135deg, #7C3AED, #C084FC);
  color: #fff;
  box-shadow: 0 0 16px rgba(139,92,246,0.55);
}

/* EOD back button variant */
.dash-eod-btn-back {
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2)) !important;
  color: var(--text-2) !important;
  border: 1px solid var(--border) !important;
}

/* ============================================================
   NOTES
   ============================================================ */

.notes-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.notes-search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.notes-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  color: var(--text-1);
  font-family: inherit;
  transition: all var(--ease);
  box-sizing: border-box;
}
.notes-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79,99,232,.1);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4);
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 120px;
}
.note-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.note-pinned {
  border-color: var(--warning);
  background: var(--warning-s, rgba(245,158,11,.04));
}

.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}
.note-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  flex: 1;
}
.note-pin-badge {
  font-size: 14px;
  flex-shrink: 0;
}
.note-card-preview {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.6;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.note-card-date {
  font-size: 11px;
  color: var(--text-4);
  font-weight: 500;
}
.note-card-actions {
  display: flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--ease);
}
.note-card:hover .note-card-actions { opacity: 1; }

.notes-textarea {
  min-height: 200px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.7;
}
.notes-empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--text-3);
  font-size: var(--text-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

/* ============================================================
   HABITS & DAY PICKER
   ============================================================ */

.day-picker {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.day-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-s, rgba(79,99,232,.08));
}
.day-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,99,232,.35);
}

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--primary) 0%, #6c47ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: obFadeIn .35s ease;
}
@keyframes obFadeIn { from { opacity: 0; } to { opacity: 1; } }
.onboarding-overlay.onboarding-fade-out { animation: obFadeOut .4s ease forwards; }
@keyframes obFadeOut { to { opacity: 0; transform: scale(.96); } }

.onboarding-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--sp-10) 48px;
  max-width: 480px;
  width: 100%;
  margin: var(--sp-5);
  box-shadow: 0 32px 80px rgba(0,0,0,.25);
  animation: obSlideUp .4s ease;
}
@keyframes obSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.onboarding-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-5);
}
.onboarding-step-tag {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: var(--sp-2);
}
.onboarding-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-1);
  margin: 0 0 var(--sp-2);
  text-align: center;
}
.onboarding-desc {
  font-size: var(--text-sm);
  color: var(--text-3);
  text-align: center;
  margin-bottom: 0;
  line-height: 1.6;
}
.onboarding-input {
  font-size: 1rem;
  padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-2);
}
.onboarding-input.input-error {
  border-color: var(--danger);
  outline-color: var(--danger);
}
.onboarding-btn {
  width: 100%;
  margin-top: var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  font-size: 1rem;
  font-weight: 600;
}
.onboarding-btn-back {
  width: auto;
  flex: 0 0 auto;
  margin-top: var(--sp-5);
}

/* ============================================================
   AVATAR HOVER & TOOLTIP
   ============================================================ */
.header-user {
  position: relative;
}
.header-user:hover .header-avatar {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-s);
}
.header-user::after {
  content: attr(title);
  position: absolute;
  bottom: -32px;
  right: 0;
  background: var(--text-1);
  color: var(--surface);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}
.header-user:hover::after { opacity: 1; }

/* ============================================================
   DASHBOARD — END MY DAY STRIP
   ============================================================ */
.dash-eod-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  color: #fff;
}
.eod-strip-done {
  background: linear-gradient(135deg, rgba(124,58,237,0.25) 0%, rgba(109,40,217,0.35) 100%);
  border: 1px solid rgba(124,58,237,0.3);
}
.dash-eod-strip-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.dash-eod-strip-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.dash-eod-strip-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.dash-eod-strip-sub {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.75);
  line-height: 1.4;
}
.dash-eod-strip-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  padding: var(--sp-2) var(--sp-5);
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.dash-eod-strip-btn:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.6);
}

/* ============================================================
   DASHBOARD — TODAY / THIS WEEK TABS
   ============================================================ */
.dash-task-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 3px;
}
.dash-task-tab {
  padding: 5px 16px;
  border-radius: var(--r-full);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ease);
}
.dash-task-tab.active {
  background: var(--surface);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: var(--shadow-xs, 0 1px 3px rgba(0,0,0,.1));
}
.dash-task-view-meta {
  padding: var(--sp-2) var(--sp-5) 0;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.dash-task-view-label { font-weight: 500; }

.dash-week-day { border-bottom: 1px solid var(--border-s); }
.dash-week-day:last-child { border-bottom: none; }
.dash-week-day-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-5);
  background: var(--surface-2);
}
.dash-week-day-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dash-week-day-count {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-weight: 500;
}
.dash-week-today .dash-week-day-hdr {
  background: var(--primary-s, rgba(79,99,232,.08));
}
.dash-week-today .dash-week-day-label { color: var(--primary); }

.dash-empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
}
.dash-empty-icon { font-size: 2rem; margin-bottom: var(--sp-3); }
.dash-empty-msg {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin-bottom: var(--sp-4);
}

/* ============================================================
   GOALS — HIERARCHY HINT
   ============================================================ */
.goals-hierarchy-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--primary-s, rgba(79,99,232,.07));
  border-left: 3px solid var(--primary);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.5;
}
.goals-hint-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.goals-hint-text { flex: 1; }
.goals-hint-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
.goals-hint-close:hover { color: var(--text-1); }

/* ============================================================
   GOALS — EMPTY STATE
   ============================================================ */
.goals-empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
}
.goals-empty-icon { font-size: 2.5rem; margin-bottom: var(--sp-3); }
.goals-empty-msg {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin-bottom: var(--sp-4);
}

/* ============================================================
   GOALS — COMPLETED SECTION AT BOTTOM
   ============================================================ */
.goals-completed-section {
  border-top: 1px solid var(--border-s);
  margin-top: var(--sp-3);
}
.goals-completed-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-3) var(--sp-5);
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  text-align: left;
  gap: var(--sp-3);
  transition: color var(--ease);
}
.goals-completed-toggle:hover { color: var(--text-1); }
.goals-completed-chevron { font-size: .75rem; }

/* ============================================================
   GOALS — PARENT GOAL TAG ON SUB-GOALS
   ============================================================ */
.goal-parent-tag {
  font-size: .7rem;
  color: var(--primary);
  background: var(--primary-s, rgba(79,99,232,.08));
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-weight: 500;
  margin-right: var(--sp-1);
}

/* ============================================================
   SETTINGS — DANGER ROW
   ============================================================ */
.setting-row-danger {
  border-top: 1px solid var(--border-s);
  padding-top: var(--sp-4);
  margin-top: var(--sp-2);
}
.btn-danger {
  background: var(--danger, #ef4444);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #dc2626; }

/* ============================================================
   TASKS — control bar right-side group
   ============================================================ */
.tasks-control-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ============================================================
   DASHBOARD — week task list
   ============================================================ */
.dash-week-day {
  border-bottom: 1px solid var(--border-s);
}
.dash-week-day:last-child { border-bottom: none; }

.dash-week-day-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-5);
  background: var(--surface-2);
  gap: var(--sp-3);
}
.dash-week-day-hdr-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}
.dash-week-day-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.dash-week-day-count {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
.dash-week-add-btn {
  flex-shrink: 0;
  font-size: var(--text-xs);
  padding: 3px 10px;
  opacity: .6;
  transition: opacity var(--ease);
}
.dash-week-day:hover .dash-week-add-btn,
.dash-week-today .dash-week-add-btn { opacity: 1; }

.dash-week-today .dash-week-day-hdr {
  background: var(--primary-s, rgba(79,99,232,.07));
}
.dash-week-today .dash-week-day-label { color: var(--primary); }

.dash-week-past .dash-week-day-label { opacity: .55; }
.dash-week-past { opacity: .8; }

.dash-week-empty {
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--text-xs);
  color: var(--text-3);
  font-style: italic;
}

/* Task row in week view (with edit/delete actions) */
.dash-task-row-week {
  padding-right: var(--sp-3);
}
.dash-week-task-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.dash-task-row-week:hover .dash-week-task-actions { display: flex; }

/* ============================================================
   DASHBOARD — weekly calendar (right panel)
   ============================================================ */
.wkcal-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.wkcal-grid {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 520px;
}
.wkcal-gutter {
  width: 44px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-s);
  overflow: hidden;
}
.wkcal-gutter-row {
  height: 48px;
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
  justify-content: flex-end;
  padding-right: var(--sp-2);
}
.wkcal-gutter-lbl {
  font-size: .62rem;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
.wkcal-cols {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
}
.wkcal-col {
  flex: 1;
  min-width: 80px;
  border-right: 1px solid var(--border-s);
}
.wkcal-col:last-child { border-right: none; }

.wkcal-col-hdr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) var(--sp-1);
  border-bottom: 1px solid var(--border-s);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  gap: 2px;
}
.wkcal-col-wd {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.wkcal-col-day {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
}
.wkcal-col-day-today {
  background: var(--primary);
  color: #fff;
}
.wkcal-col-today { background: var(--primary-s, rgba(79,99,232,.04)); }

.wkcal-col-slots { display: flex; flex-direction: column; }
.wkcal-slot {
  height: 48px;
  border-bottom: 1px solid var(--border-s);
  padding: 2px 3px;
  cursor: pointer;
  transition: background var(--ease);
  overflow: hidden;
  position: relative;
}
.wkcal-slot:hover { background: var(--surface-2); }

.wkcal-event {
  background: color-mix(in srgb, var(--evt-color) 18%, transparent);
  border-left: 2px solid var(--evt-color);
  border-radius: 3px;
  padding: 1px 4px;
  margin-bottom: 1px;
  cursor: pointer;
  overflow: hidden;
}
.wkcal-event:hover { background: color-mix(in srgb, var(--evt-color) 30%, transparent); }
.wkcal-event-title {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-1);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkcal-event-time {
  font-size: .58rem;
  color: var(--text-3);
}

/* ── Auth Gate ── */
.auth-gate {
  position: fixed; inset: 0; z-index: 9000;
  display: flex;
  background: var(--bg);
  animation: authFadeIn 0.35s ease;
}
@keyframes authFadeIn { from { opacity:0; } to { opacity:1; } }
.auth-gate-out { animation: authFadeOut 0.35s ease forwards; }
@keyframes authFadeOut { to { opacity:0; transform: scale(0.98); } }

.auth-left {
  width: 42%;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 52px;
  gap: var(--sp-8);
}
@media (max-width: 720px) { .auth-left { display: none; } }

.auth-brand { display: flex; align-items: center; gap: var(--sp-3); }
.auth-brand-logo { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: contain; }
.auth-brand-name { font-size: var(--text-lg); font-weight: 700; color: #fff; }
.auth-headline { font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 40px; }
.auth-sub { color: rgba(255,255,255,0.55); font-size: var(--text-sm); margin-top: var(--sp-2); }
.auth-features { display: flex; flex-direction: column; margin-top: 0; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.auth-feature:last-child { border-bottom: none; }
.auth-feature svg { flex-shrink: 0; opacity: 0.9; }

.auth-right {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-6);
  overflow-y: auto;
}

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.auth-tab {
  flex: 1; padding: var(--sp-4) var(--sp-5);
  font-size: var(--text-sm); font-weight: 600;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); transition: all var(--ease);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }
.auth-tab:hover:not(.active) { color: var(--text-1); }

.auth-card-body { padding: 40px; }
.auth-card-title { font-size: 2rem; font-weight: 800; color: var(--text-1); margin-bottom: 8px; }
.auth-card-sub { font-size: 1rem; color: var(--text-3); margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-form .form-group { margin-bottom: 20px; }
.auth-submit-btn { width: 100%; margin-top: var(--sp-2); padding-top: 16px; padding-bottom: 16px; }

.auth-password-wrap { position: relative; }
.auth-password-wrap .form-input { padding-right: 44px; }
.auth-toggle-pass {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--text-3); padding: 4px; line-height: 1;
}
.auth-toggle-pass:hover { color: var(--text-1); }

.auth-error {
  background: var(--danger-s); border: 1px solid var(--danger);
  color: var(--danger); border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4); font-size: var(--text-sm);
}

.auth-switch { text-align: center; font-size: var(--text-sm); color: var(--text-3); }
.auth-switch a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-plan-note { text-align: center; font-size: var(--text-xs); color: var(--text-4); }

[data-theme="purple"] .auth-left {
  background: linear-gradient(160deg, #0c0618 0%, #130b2e 100%);
  border-right: 1px solid rgba(139,92,246,0.12);
}
[data-theme="purple"] .auth-card {
  background: rgba(18,12,38,0.90);
  backdrop-filter: blur(20px);
  border-color: rgba(139,92,246,0.20);
}

/* Header logout button */
.header-logout-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-3); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--ease);
}
.header-logout-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-s); }
.header-logout-btn svg { width: 16px; height: 16px; }

/* ── Onboarding Tour ── */
.tour-overlay {
  position: fixed; inset: 0; z-index: 8500;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: tourFadeIn 0.3s ease;
}
@keyframes tourFadeIn { from { opacity:0; } to { opacity:1; } }

.tour-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-10) var(--sp-8);
  max-width: 480px; width: 90%;
  text-align: center;
  animation: tourSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes tourSlideIn { from { opacity:0; transform: translateY(24px) scale(0.96); } to { opacity:1; transform: none; } }

.tour-step-tag {
  display: inline-block; background: var(--primary-s); color: var(--primary);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 12px; border-radius: var(--r-full); margin-bottom: var(--sp-5);
}
.tour-icon { font-size: 3rem; margin-bottom: var(--sp-4); line-height: 1; }
.tour-title { font-size: var(--text-xl); font-weight: 700; color: var(--text-1); margin-bottom: var(--sp-3); }
.tour-desc { font-size: var(--text-sm); color: var(--text-2); line-height: 1.7; margin-bottom: var(--sp-6); }

.tour-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: var(--sp-7); }
.tour-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: all var(--ease);
}
.tour-dot.active { background: var(--primary); transform: scale(1.3); }

.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }

.nav-item.tour-highlight {
  background: var(--sidebar-item-active) !important;
  box-shadow: 0 0 0 2px var(--primary), 0 0 16px rgba(139,92,246,0.25);
  border-radius: var(--r-sm);
}
.nav-item.tour-highlight .nav-icon,
.nav-item.tour-highlight span { color: var(--sidebar-text-active) !important; }

[data-theme="purple"] .tour-card {
  background: rgba(18,12,38,0.95);
  backdrop-filter: blur(24px);
  border-color: rgba(139,92,246,0.22);
}
.btn-danger:hover { background: #dc2626; }

/* ── Task deadline badge — always-visible on far right ── */
.task-deadline-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .70rem;
  font-weight: 600;
  border-radius: var(--r-full);
  padding: 2px 10px;
  white-space: nowrap;
}
.task-deadline--overdue  { background: rgba(220,38,38,.12);  color: var(--danger);  }
.task-deadline--today    { background: rgba(220,38,38,.12);  color: var(--danger);  }
.task-deadline--soon     { background: rgba(234,179,8,.12);  color: #b45309;        }
.task-deadline--week     { background: rgba(99,102,241,.10); color: var(--primary); }
.task-deadline--normal   { background: var(--surface-2);     color: var(--text-3);  }

/* ── Reminder modal ── */
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 2px;
}
.reminder-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  background: var(--surface);
}
.reminder-item--urgent  { border-color: rgba(220,38,38,.35);  background: rgba(220,38,38,.04);  }
.reminder-item--soon    { border-color: rgba(234,179,8,.35);  background: rgba(234,179,8,.04);  }
.reminder-item--upcoming{ border-color: rgba(99,102,241,.25); background: rgba(99,102,241,.04); }

.reminder-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-1);
}
.reminder-urgency-badge {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-2);
}
.reminder-item--urgent   .reminder-urgency-badge { color: var(--danger); }
.reminder-item--soon     .reminder-urgency-badge { color: #b45309; }
.reminder-item--upcoming .reminder-urgency-badge { color: var(--primary); }

.reminder-type-tag {
  font-size: .68rem;
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 1px 8px;
}
.reminder-item-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.reminder-item-date {
  font-size: .72rem;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
}
.reminder-item-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.reminder-todo-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
}
.reminder-date-input {
  max-width: 150px;
  font-size: .82rem !important;
  padding: 5px 10px !important;
}
.reminder-ok-btn {
  flex-shrink: 0;
}
.reminders-footer {
  margin-top: var(--sp-4);
  text-align: right;
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}

/* ── Legal Footer (static, at end of page, theme-aware, delicate) ── */
#legal-footer {
  /* display toggled to flex in app.js after login; hidden by default */
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;   /* centered on the line */
  text-align: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg);                       /* matches dashboard bg: light-light, dark-dark */
  border-top: 1px solid var(--border-s, var(--border));
}
.legal-footer-link {
  color: var(--text-4, var(--text-3));        /* faint, delicate */
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.6;
  text-decoration: none;
  transition: opacity var(--ease), color var(--ease);
}
.legal-footer-link:hover {
  opacity: 1;
  color: var(--text-2);
}
.legal-footer-sep {
  color: var(--text-4, var(--text-3));
  opacity: 0.4;
  font-size: 0.68rem;
  user-select: none;
}

/* ── Custom Cookie Consent Banner (dark purple, brand-matched) ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 28px;
  padding: 16px 24px;
  background: linear-gradient(160deg, #130b2e 0%, #0c0618 100%);
  border-top: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  line-height: 1.55;
  animation: cookieBannerIn 0.35s ease;
}
@keyframes cookieBannerIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cookie-banner-out { animation: cookieBannerOut 0.25s ease forwards; }
@keyframes cookieBannerOut { to { transform: translateY(100%); opacity: 0; } }

.cookie-banner-text {
  max-width: 620px;
  text-align: center;
}
.cookie-banner-text a {
  color: #a78bfa;
  text-decoration: underline;
  font-weight: 600;
}
.cookie-banner-text a:hover { color: #c4b5fd; }

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cookie-btn {
  padding: 9px 24px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cookie-btn-accept { background: #7c3aed; color: #fff; }
.cookie-btn-accept:hover { background: #6d28d9; }
.cookie-btn-reject {
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.28);
}
.cookie-btn-reject:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
