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

/* ─── Design Tokens ─── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255,255,255,0.04);
  --bg-glass: rgba(255,255,255,0.06);
  --bg-glass-hover: rgba(255,255,255,0.10);
  --bg-input: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --text-primary: #f0f0f5;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;
  --accent: #00e676;
  --accent-hover: #00c853;
  --accent-glow: rgba(0, 230, 118, 0.20);
  --accent-2: #05c46b;
  --gradient: linear-gradient(135deg, #00e676, #05c46b);
  --gradient-text: linear-gradient(135deg, #ffffff, #00e676);
  --success: #13b910;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

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

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
select, select option {
  background-color: #1a1a2e;
  color: #f0f0f5;
}
select option:checked {
  background-color: var(--accent);
  color: #000;
}

/* ─── Utility ─── */
.hidden { display: none !important; }
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── App Shell ─── */
#app { position: relative; z-index: 1; min-height: 100vh; }

/* ─── Navbar ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s, transform 0.2s;
}
/* Hide top navbar when dashboard is open — sidebar serves as navigation */
body.dashboard-active .navbar {
  display: none;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700;
}
.navbar-brand .logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.navbar-actions { display: flex; gap: 8px; align-items: center; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #000;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-glass-hover); border-color: var(--border-hover); }
.btn-ghost { color: var(--text-secondary); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-glass); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.btn-success:hover { background: rgba(16,185,129,0.25); }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text-primary); text-shadow: 0 0 12px rgba(255,255,255,0.2); }

/* ─── Landing View ─── */
.landing-view {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 40px 24px;
  text-align: center;
  background: transparent;
  background-attachment: fixed;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}
.landing-hero { max-width: 680px; margin-bottom: 48px; }
.landing-hero h1 {
  font-family: var(--font-heading);
  font-size: 56px; font-weight: 700;
  line-height: 1.1; margin-bottom: 18px;
}
.landing-hero p {
  font-size: 18px; color: var(--text-secondary);
  line-height: 1.6; max-width: 520px; margin: 0 auto 36px;
}
.landing-cards {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px; max-width: 640px; width: 100%;
}
.landing-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: left;
  transition: all var(--transition);
  cursor: pointer;
}
.landing-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(4,120,87,0.12);
}
.landing-card .card-icon {
  width: 48px; height: 48px;
  background: var(--gradient);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.landing-card h3 {
  font-family: var(--font-heading);
  font-size: 18px; font-weight: 600; margin-bottom: 8px;
}
.landing-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ─── Builder View ─── */
.builder-view { padding: 24px 32px; }
.builder-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.month-selector {
  display: flex; align-items: center; gap: 12px;
}
.month-selector select, .month-selector input[type="number"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
}
.month-selector select:focus, .month-selector input:focus {
  border-color: var(--accent);
}
.month-selector input[type="number"] { width: 90px; }
.builder-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ─── AI Prompt Bar ─── */
.ai-prompt-bar {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex; gap: 12px; align-items: flex-end;
  transition: border-color var(--transition);
}
.ai-prompt-bar:focus-within { border-color: var(--accent); }
.ai-prompt-bar textarea {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  min-height: 44px; max-height: 120px;
  line-height: 1.5;
}
.ai-prompt-bar textarea::placeholder { color: var(--text-muted); }
.ai-prompt-bar .btn { flex-shrink: 0; }

/* ─── Calendar Grid ─── */
.calendar-container {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.calendar-grid {
  width: 100%;
  border-collapse: collapse;
}
.calendar-grid thead th {
  padding: 12px 8px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  background: rgba(4,120,87,0.08);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.calendar-grid tbody td {
  width: calc(100% / 7);
  vertical-align: top;
  border: 1px solid var(--border);
  padding: 6px 8px 8px;
  min-height: 110px;
  height: 110px;
  transition: background var(--transition);
  position: relative;
  cursor: pointer;
}
.calendar-grid tbody td:hover {
  background: var(--bg-glass-hover);
}
.calendar-grid tbody td.empty-cell {
  background: transparent;
  cursor: default;
  border-color: rgba(255,255,255,0.03);
}
.calendar-grid tbody td.today {
  background: rgba(4,120,87,0.08);
  border-color: rgba(4,120,87,0.3);
}
.calendar-grid tbody td.weekend { background: rgba(239,68,68,0.03); }

.day-number {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: inline-block;
}
td.today .day-number { color: var(--accent); }
td.weekend .day-number { color: var(--danger); opacity: 0.7; }

.day-tasks { display: flex; flex-direction: column; gap: 2px; }

.task-pill {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 500;
  line-height: 1.3;
  cursor: grab;
  transition: all var(--transition);
  word-break: break-word;
  white-space: normal;
}
.task-pill:hover { filter: brightness(1.3); transform: scale(1.02); }
.task-pill .pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.task-pill.dragging { opacity: 0.4; }

.add-task-btn {
  width: 100%; padding: 3px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--transition);
  text-align: center;
}
td:hover .add-task-btn { opacity: 1; }
.add-task-btn:hover { background: var(--bg-glass-hover); color: var(--text-secondary); }

/* ─── Task Editor Popover ─── */
.task-popover {
  position: fixed;
  z-index: 10050;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.2s ease-out;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.task-popover .pop-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.task-popover .pop-header h4 {
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 600;
}
.task-popover input, .task-popover select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
}
.task-popover input:focus, .task-popover select:focus { border-color: var(--accent); }
.pop-colors {
  display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.pop-color-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.pop-color-btn:hover, .pop-color-btn.active { border-color: #fff; transform: scale(1.15); }
.pop-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Category Manager ─── */
.category-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.category-panel h3 {
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
  color: var(--text-secondary);
}
.category-list { display: flex; gap: 8px; flex-wrap: wrap; }
.category-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.category-tag:hover { border-color: var(--border-hover); }
.category-tag .cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.category-tag .remove-cat {
  font-size: 14px; color: var(--text-muted);
  cursor: pointer; line-height: 1;
}
.category-tag .remove-cat:hover { color: var(--danger); }

/* ─── Preview View ─── */
.preview-view { padding: 24px 32px; width: 100%; max-width: 100vw; overflow-x: hidden; }
.preview-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.preview-toolbar h2 {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 600;
}

/* #print-area base styles are now in css/themes.css */


/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  max-width: 480px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal h2 {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 700; margin-bottom: 20px;
}
.modal-field { margin-bottom: 16px; }
.modal-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}
.modal-field input:focus { border-color: var(--accent); }
.modal-field .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 600;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease-out;
  min-width: 260px;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast-icon { font-size: 16px; }

/* ─── Loading Spinner ─── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  border-radius: var(--radius-lg);
  z-index: 50;
  font-size: 14px; color: var(--text-secondary);
}
.loading-overlay .spinner { width: 32px; height: 32px; border-width: 3px; }

/* ─── Sync Progress ─── */
.sync-progress {
  width: 100%; height: 4px;
  background: var(--bg-glass);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.sync-progress-bar {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ─── Sidebar Overlay ─── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  display: none;
  backdrop-filter: blur(3px);
}

/* Desktop: ensure overlay never shows & sidebar stays put */
@media (min-width: 901px) {
  .sidebar-overlay { display: none !important; }
  .sidebar { transform: none !important; }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .landing-hero h1 { font-size: 36px; }
  .landing-cards { grid-template-columns: 1fr; }
  .navbar { padding: 12px 16px; }
  .builder-view, .preview-view { padding: 16px; }
  .calendar-grid tbody td { min-height: 80px; height: 80px; padding: 4px; }
  .day-number { font-size: 16px; }
  .task-pill { font-size: 9px; padding: 2px 5px; }

  /* Sidebar Off-canvas */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  
  .mobile-only { display: flex !important; }
  
  /* Layout Adjustments */
  .pages-container { padding: 16px !important; }
  .top-header { padding: 0 16px !important; }
  #header-date { display: none !important; }
  .navbar-links { display: none !important; } /* Hide landing page nav links on mobile to prevent overflow */

  /* Stack Dashboard & Calendar Grids */
  .dashboard-grid, 
  #page-calendar > div {
    grid-template-columns: 1fr !important;
  }

  /* Reports Grids */
  #page-reports > div > div:first-child { grid-template-columns: 1fr 1fr !important; } /* Stat cards */
  #page-reports > div > div:nth-child(2) { grid-template-columns: 1fr !important; } /* Charts */
  
  /* Inputs & Flex wraps */
  .month-selector { flex-wrap: wrap; }
  .month-selector select, .month-selector input { flex: 1; }
  .theme-picker-wrap { width: 100%; justify-content: center; overflow-x: auto; }
  .modal { margin: 20px; padding: 24px; max-height: 90vh; overflow-y: auto; }

  /* Fixed Layout for Calendar Tab on Mobile */
  #pages-container.active-tab-calendar {
    overflow-y: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: calc(100dvh - 56px) !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }
  #pages-container.active-tab-calendar #page-calendar {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #pages-container.active-tab-calendar #page-calendar > div {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    gap: 12px !important;
    overflow: hidden !important;
  }
  #pages-container.active-tab-calendar #page-calendar > div > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    gap: 12px !important;
    overflow: hidden !important;
  }
  #pages-container.active-tab-calendar #page-calendar > div > div:first-child > .dashboard-card {
    flex-shrink: 0 !important;
  }
  #pages-container.active-tab-calendar #customizer-card {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #pages-container.active-tab-calendar #customizer-card .preview-wrapper {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: auto !important;
    border-radius: 12px !important;
    background: #fff !important;
    -webkit-overflow-scrolling: touch;
  }
  #pages-container.active-tab-calendar #print-area {
    min-width: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #pages-container.active-tab-calendar .print-table-wrapper {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }
  #pages-container.active-tab-calendar #category-list {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #pages-container.active-tab-calendar #page-calendar > div > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
  }
  #pages-container.active-tab-calendar #page-calendar > div > div:last-child > .dashboard-card {
    flex: 1 !important;
    padding: 10px 12px !important;
    margin-bottom: 0 !important;
  }

  /* Mobile Preview Card on Landing */
  .landing-preview-section .preview-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: 360px; /* Fixed scaled height */
    overflow: visible !important;
    display: flex;
    justify-content: center;
  }
  #landing-calendar-preview {
    min-width: 900px !important;
    width: 900px !important;
    height: 850px !important;
    transform: scale(0.35);
    transform-origin: top center;
    border-radius: 40px !important;
    box-shadow: 0 40px 120px rgba(0,0,0,0.4) !important;
    overflow: hidden !important; 
    box-sizing: border-box;
  }
  #landing-calendar-preview .print-table-wrapper {
    overflow: hidden !important;
  }
}

@media (max-width: 480px) {
  #page-reports > div > div:first-child { grid-template-columns: 1fr !important; }
  .dashboard-card[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } /* Month Summary Stack */
}

/* ─── Print Styles ─── */
@media print {
  body { background: white !important; }
  body::before, #particle-canvas { display: none !important; }
  .navbar, .builder-view, .landing-view,
  .preview-toolbar, .toast-container, .modal-overlay { display: none !important; }
  .preview-view { padding: 0; }
  #print-area { border-radius: 0; box-shadow: none; overflow: visible !important; }
}

/* ─── Dashboard Shell ─── */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #90929f;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 4px;
}
.sidebar-nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.03);
}
.sidebar-nav-item.active {
  background: #171821;
  color: #00e676;
  font-weight: 600;
  border-left: 3px solid #00e676;
  border-radius: 0 12px 12px 0;
  padding-left: 13px;
}
.sidebar-nav-item .icon {
  font-size: 16px;
}

.dashboard-card {
  background: #111217;
  border: 1px solid #1a1b22;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Dark theme calendar grid inside dashboard */
.dark-calendar-theme .calendar-grid {
  width: 100%;
  border-collapse: collapse;
  background: #111217;
}
.dark-calendar-theme .calendar-grid thead th {
  padding: 12px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #90929f;
  background: #16171d;
  border: 1px solid #1a1b22;
  text-align: center;
}
.dark-calendar-theme .calendar-grid tbody td {
  width: calc(100% / 7);
  vertical-align: top;
  border: 1px solid #1a1b22;
  padding: 8px;
  min-height: 100px;
  height: 100px;
  position: relative;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s ease;
}
.dark-calendar-theme .calendar-grid tbody td:hover {
  background: rgba(255, 255, 255, 0.02);
}
.dark-calendar-theme .calendar-grid tbody td.empty-cell {
  background: #0e0f13;
  cursor: default;
  border-color: #15161c;
}
.dark-calendar-theme .calendar-grid tbody td.weekend {
  background: rgba(255, 255, 255, 0.005);
}
.dark-calendar-theme .calendar-grid tbody td.today {
  border: 2px solid #00e676 !important;
  box-shadow: inset 0 0 12px rgba(0, 230, 118, 0.15), 0 0 12px rgba(0, 230, 118, 0.15);
  background: rgba(0, 230, 118, 0.03);
}
.dark-calendar-theme .day-number {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: #585966;
  margin-bottom: 6px;
  display: block;
}
.dark-calendar-theme td.today .day-number {
  color: #00e676;
}
.dark-calendar-theme td.weekend .day-number {
  color: #ef4444;
  opacity: 0.7;
}

/* Today label badge */
.today-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #00e676;
  color: #000;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Add event button inside cells */
.dark-calendar-theme .add-task-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  font-size: 12px;
  color: #585966;
  border-radius: 50%;
  border: 1px solid #1a1b22;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.dark-calendar-theme td:hover .add-task-btn {
  opacity: 1;
}
.dark-calendar-theme .add-task-btn:hover {
  background: #1b1c23;
  color: #00e676;
}

/* Task checklist design for Upcoming Tasks */
.task-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1b1c23;
  border: 1px solid #282932;
  border-radius: 12px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.task-check-item:hover {
  background: #232530;
}
.task-check-item.completed {
  opacity: 0.6;
}
.task-check-item.completed .task-check-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.task-check-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.task-checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #282932;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  transition: all 0.2s ease;
}
.task-check-item.completed .task-checkbox-custom {
  background: #00e676;
  border-color: #00e676;
  color: #000;
}
.task-check-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

/* Daily Planner Hour timeline styles */
.timeline-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  position: relative;
  min-height: 48px;
}
.timeline-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.timeline-content {
  border-bottom: 1px solid #1a1b22;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
  position: relative;
  cursor: pointer;
}
.timeline-content:not(:has(.timeline-block)):hover::after {
  content: '+ Add event';
  position: absolute;
  right: 12px;
  font-size: 11px;
  color: #00e676;
  font-weight: 600;
}
.timeline-block {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.timeline-block.neon-green {
  background: #00e676;
  color: #000;
  box-shadow: 0 0 15px rgba(0,230,118,0.25);
}
.timeline-block.dark-green {
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.2);
  color: #00e676;
}

.timeline-block-delete {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  line-height: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-block-delete:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* View toggle button hover states */
.view-toggle-btn {
  background: transparent;
  color: #90929f;
  transition: all 0.2s ease;
  cursor: pointer;
}
.view-toggle-btn:hover {
  color: #fff;
}
.view-toggle-btn.active {
  background: #282932;
  color: #fff;
  opacity: 1 !important;
}

/* Custom Scrollbar */
.daily-planner-panel ::-webkit-scrollbar,
.pages-container ::-webkit-scrollbar {
  width: 6px;
}
.daily-planner-panel ::-webkit-scrollbar-track,
.pages-container ::-webkit-scrollbar-track {
  background: transparent;
}
.daily-planner-panel ::-webkit-scrollbar-thumb,
.pages-container ::-webkit-scrollbar-thumb {
  background: #282932;
  border-radius: 3px;
}
.daily-planner-panel ::-webkit-scrollbar-thumb:hover,
.pages-container ::-webkit-scrollbar-thumb:hover {
  background: #393a47;
}

/* Custom project card styling */
.project-card {
  background: #1b1c23;
  border: 1px solid #282932;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: #00e676;
}
.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.project-card-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Custom goal card styling */
.goal-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #1b1c23;
  border: 1px solid #282932;
  border-radius: 12px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.goal-card-item:hover {
  background: #232530;
}
.goal-card-item.completed {
  opacity: 0.6;
}
.goal-card-item.completed .goal-card-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.goal-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.goal-card-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.goal-card-delete {
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
}
.goal-card-delete:hover {
  color: #ef4444;
}

/* Custom report bar styling */
.report-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 16px;
}
.report-bar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.report-bar-track {
  height: 8px;
  background: #282932;
  border-radius: 4px;
  overflow: hidden;
}
.report-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.report-bar-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: right;
}

/* ─── Authentication Styling ─── */
.auth-tab-btn:hover {
  color: #fff !important;
}
.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #00e676 !important;
}
.btn-google {
  transition: all 0.2s ease;
}
.btn-google:hover {
  background: #f0f0f0 !important;
  transform: translateY(-1px);
}
.auth-form input:focus {
  border-color: #00e676 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  outline: none;
}
.modal-close:hover {
  color: #fff !important;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-block {
  width: 100%;
}
.account-section {
  animation: fadeIn 0.2s ease-out;
}

/* Desktop behaviors for collapsible details cards */
.mobile-collapsible summary {
  pointer-events: none;
  cursor: default;
}
.mobile-collapsible summary::after {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tablet / Small Desktop (≤ 900px) ─── */
@media (max-width: 900px) {
  /* Landing Hero */
  .landing-hero h1 { font-size: 36px !important; }
  .landing-hero p { font-size: 15px !important; }
  .navbar > div:last-child { gap: 16px !important; }

  /* Main content area – use dvh for mobile browser chrome */
  .main-content { height: 100dvh !important; }

  /* Dashboard Header */
  .top-header { height: 56px !important; }
  .top-header > div:last-child { gap: 12px !important; }
  #tab-title { font-size: 18px !important; }
  #dash-user-name { display: none !important; }
  .notification-btn { font-size: 16px !important; }

  /* Hero section height */
  #landing-view > .landing-view > div:first-child {
    min-height: calc(100dvh - 60px) !important;
    padding: 24px 16px !important;
  }

  /* Dashboard Grids */
  .dashboard-grid { gap: 20px !important; }
  .dashboard-left > div:last-child {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .daily-planner-panel {
    height: auto !important;
    max-height: 500px;
  }

  /* Dashboard Calendar */
  .dark-calendar-theme .calendar-grid tbody td {
    min-height: 80px;
    height: 80px;
    padding: 4px;
  }
  .dark-calendar-theme .day-number { font-size: 13px; }
  #dash-month-name { font-size: 22px !important; }

  /* Calendar card header wrapping */
  .dashboard-left > .dashboard-card:first-child > div:first-child {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .view-toggle { display: none !important; }

  /* Calendar Tab */
  .ai-prompt-bar { flex-direction: column !important; align-items: stretch !important; }
  .ai-prompt-bar .btn { width: 100%; justify-content: center; }
  .theme-picker-wrap { flex-wrap: wrap !important; }

  /* Projects Grid */
  #projects-list-container { grid-template-columns: 1fr 1fr !important; }

  /* Reports Gap */
  #page-reports > div > div:first-child { gap: 12px !important; }
  #page-reports > div > div:nth-child(2) { gap: 16px !important; }

  /* Settings */
  #page-settings input[type="text"] { max-width: 100% !important; }

  /* Auth Modal */
  .auth-modal-content {
    max-width: 92vw !important;
    padding: 28px 20px !important;
    margin: 0 12px;
  }

  /* Contact Section */
  #contact-us-anchor h2 { font-size: 32px !important; }
  #contact-us-anchor > div:first-child > div {
    padding: 28px 24px !important;
  }

  /* Toast */
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: auto; width: 100%; }

  /* Export / Sync buttons wrap */
  div:has(> #export-pdf-btn) {
    flex-wrap: wrap !important;
  }
  #full-view-btn, #export-pdf-btn, #gcal-sync-btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  /* Mobile Collapsible details panels */
  .mobile-collapsible summary {
    pointer-events: auto !important;
    cursor: pointer !important;
    list-style: none !important;
    outline: none !important;
    user-select: none !important;
  }
  .mobile-collapsible summary::-webkit-details-marker {
    display: none !important;
  }
  .mobile-collapsible summary::after {
    content: '▼' !important;
    font-size: 10px !important;
    transition: transform 0.2s ease !important;
    display: inline-block !important;
    color: var(--text-secondary) !important;
  }
  .mobile-collapsible[open] summary::after {
    transform: rotate(180deg) !important;
  }
  .mobile-collapsible:not([open]) {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
  .mobile-collapsible:not([open]) summary {
    margin-bottom: 0 !important;
  }
}

/* ─── Small Tablets / Large Phones (≤ 640px) ─── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .month-desc { display: none !important; }
  .theme-label { display: none !important; }
  #page-calendar .month-selector-card { padding: 12px 16px !important; }

  .landing-hero h1 { font-size: 30px !important; }
  .landing-hero p { font-size: 14px !important; max-width: 100% !important; }
  #hero-build-btn { font-size: 14px !important; padding: 12px 28px !important; }

  /* Card padding */
  .dashboard-card { padding: 16px !important; }

  /* Report stat values */
  #report-completion-rate,
  #report-active-tasks,
  #report-total-projects,
  #report-completed-count { font-size: 28px !important; }

  /* Landing Preview shrink */
  .landing-preview-section .preview-wrapper { height: 300px !important; }
  #landing-calendar-preview { transform: scale(0.3) !important; }
  #landing-theme-name { font-size: 18px !important; }

  /* Contact section */
  #contact-us-anchor h2 { font-size: 28px !important; }
  #contact-us-anchor p { font-size: 15px !important; }
  #contact-us-anchor a { font-size: 16px !important; word-break: break-all; }
  #contact-us-anchor > div:first-child > div:last-child {
    padding: 28px 20px !important;
  }

  /* Theme preview section padding */
  .landing-preview-section { padding: 32px 16px !important; }

  /* Footer */
  .landing-footer { font-size: 12px !important; gap: 10px !important; }

  /* Calendar tab: month selector card → stack */
  #page-calendar > div > div:first-child > .dashboard-card:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* Customizer Card Mobile Overrides */
  #customizer-card .customizer-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  #customizer-card .customizer-actions {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }
  #customizer-card #full-view-btn,
  #customizer-card #export-pdf-btn,
  #customizer-card #gcal-sync-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    font-size: 12px !important;
  }
  #customizer-card .theme-picker-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Back button compact */
  #nav-back-btn { font-size: 12px !important; padding: 4px 10px !important; }

  /* Sidebar nav font */
  .sidebar-nav-item { font-size: 13px; padding: 10px 14px; }
}

/* ─── Phones (≤ 480px) ─── */
@media (max-width: 480px) {
  .landing-hero h1 { font-size: 26px !important; }
  .landing-hero { margin-top: 2vh !important; }

  /* Projects fully stacked */
  #projects-list-container { grid-template-columns: 1fr !important; }

  /* Navbar compact */
  .navbar { padding: 10px 12px !important; }
  .navbar-brand { font-size: 18px !important; gap: 8px !important; }
  .navbar-brand .logo-icon { width: 28px; height: 28px; font-size: 14px; }

  /* Sidebar narrower */
  .sidebar { width: 240px !important; padding: 20px 12px !important; }

  /* Auth modal tighter */
  .auth-modal-content {
    padding: 24px 16px !important;
    border-radius: 16px !important;
  }
  .auth-modal-content h3 { font-size: 20px !important; }

  /* Task Popover – full-width on phone */
  .task-popover {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    min-width: auto !important;
    max-width: calc(100vw - 16px) !important;
  }

  /* Top header */
  .top-header { height: 50px !important; }

  /* Landing preview smaller */
  .landing-preview-section .preview-wrapper { height: 250px !important; }
  #landing-calendar-preview { transform: scale(0.25) !important; }

  /* Toast */
  .toast-container { left: 8px; right: 8px; bottom: 8px; }

  /* Export buttons compact */
  #full-view-btn, #export-pdf-btn, #gcal-sync-btn, #modal-export-pdf-btn {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }

  /* Reduce gaps */
  .dashboard-left { gap: 16px !important; }

  /* Sidebar brand compact */
  .sidebar-brand { margin-bottom: 20px !important; }

  /* Timeline */
  .timeline-time { font-size: 11px; }
  .timeline-row { grid-template-columns: 48px 1fr; }

  /* Calendar grid cells – phone size */
  .calendar-grid tbody td,
  .dark-calendar-theme .calendar-grid tbody td {
    min-height: 65px !important;
    height: 65px !important;
    padding: 3px !important;
  }
  .dark-calendar-theme .day-number { font-size: 12px !important; }
  .task-pill { font-size: 8px !important; padding: 1px 4px !important; }
  .today-badge { font-size: 7px !important; padding: 1px 4px !important; }

  /* Dashboard action buttons */
  #dash-prev-month, #dash-next-month {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }

  /* Goal & Task items */
  .task-check-item, .goal-card-item { padding: 10px 12px; }
  .task-check-text, .goal-card-text { font-size: 13px; }
}

/* ─── Very Small Phones (≤ 360px) ─── */
@media (max-width: 360px) {
  .landing-hero h1 { font-size: 22px !important; }
  .landing-hero p { font-size: 13px !important; }
  #hero-build-btn { font-size: 13px !important; padding: 10px 20px !important; }

  .sidebar { width: 200px !important; }
  #dash-month-name { font-size: 18px !important; }

  .auth-modal-content { padding: 20px 12px !important; }

  /* Reports stat cards stacked */
  #page-reports > div > div:first-child { grid-template-columns: 1fr !important; }

  /* Calendar cells minimal */
  .calendar-grid tbody td,
  .dark-calendar-theme .calendar-grid tbody td {
    min-height: 55px !important;
    height: 55px !important;
  }
}

/* Dashboard Bottom Row Layout */
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .dashboard-bottom-row {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* ─── Subscription Model Styling ─── */
.sub-tier-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.sub-tier-card:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-2px);
}
.sub-tier-card.active:hover {
  background: rgba(0, 230, 118, 0.08) !important;
  border-color: #00e676 !important;
}
#sub-pay-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 10px 25px rgba(0, 230, 118, 0.45) !important;
}
#sub-pay-btn:active {
  transform: translateY(0);
}
#settings-sub-upgrade-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
#settings-sub-cancel-btn:hover {
  background: rgba(255, 75, 75, 0.15) !important;
  border-color: rgba(255, 75, 75, 0.5) !important;
}

/* ─── Auth Error / Success Messages ─── */
.auth-error-msg,
.auth-success-msg {
  font-size: 13px;
  text-align: center;
  padding: 0 12px;
  border-radius: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, border 0.3s ease;
  display: block;
}
.auth-error-msg.show {
  max-height: 80px;
  opacity: 1;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #f87171;
}
.auth-success-msg.show {
  max-height: 80px;
  opacity: 1;
  padding: 10px 14px;
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid rgba(0, 230, 118, 0.22);
  color: #00e676;
}

/* ─── Forgot Password Panel ─── */
#forgot-password-panel.active {
  display: flex !important;
  animation: fadeSlideIn 0.22s ease-out;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Active tab style for auth modal ─── */
.auth-tab-btn.active {
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

/* ─── Reset email input focus ─── */
#reset-email:focus {
  border-color: var(--accent) !important;
  outline: none;
}
#reset-back-btn:hover {
  color: #fff !important;
  border-color: rgba(255,255,255,0.2) !important;
  background: rgba(255,255,255,0.04) !important;
}

/* ─── Notification Drawer ─── */
#notif-drawer.open {
  transform: translateX(0) !important;
}
#notif-overlay.open {
  opacity: 1 !important;
  pointer-events: all !important;
}
#notif-list-body::-webkit-scrollbar { width: 4px; }
#notif-list-body::-webkit-scrollbar-track { background: transparent; }
#notif-list-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.notif-item:hover {
  background: rgba(255,255,255,0.03) !important;
}
.notif-item:hover .notif-dismiss {
  opacity: 1 !important;
}

/* Bell ring animation when unread exist */
#notif-bell-btn.has-unread {
  animation: bell-ring 2.5s ease-in-out 0.5s;
}
@keyframes bell-ring {
  0%,100% { transform: rotate(0); }
  8%  { transform: rotate(14deg); }
  16% { transform: rotate(-12deg); }
  24% { transform: rotate(10deg); }
  32% { transform: rotate(-8deg); }
  40% { transform: rotate(6deg); }
  48% { transform: rotate(-4deg); }
  56% { transform: rotate(2deg); }
  64% { transform: rotate(0); }
}
