:root {
  --font: 'Vazirmatn', -apple-system, system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --bg: #f2f2f7;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-elevated: rgba(255, 255, 255, 0.95);
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --text-muted: #aeaeb2;
  --border: rgba(0, 0, 0, 0.06);

  --shadow-neo-up: 8px 8px 18px rgba(0, 0, 0, 0.06), -8px -8px 18px rgba(255, 255, 255, 0.8);
  --shadow-neo-down: inset 4px 4px 10px rgba(0, 0, 0, 0.05), inset -4px -4px 10px rgba(255, 255, 255, 0.7);
  --shadow-neo-sm: 4px 4px 10px rgba(0, 0, 0, 0.04), -4px -4px 10px rgba(255, 255, 255, 0.7);
  --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);

  --q1: #ff3b30;
  --q2: #007aff;
  --q3: #ff9500;
  --q4: #8e8e93;
  --success: #34c759;
  --warning: #ff9500;
  --accent: #007aff;
  --accent2: #5856d6;
  --gradient: linear-gradient(135deg, #007aff, #5856d6);
  --gradient-warm: linear-gradient(135deg, #ff3b30, #ff9500);
  --gradient-cool: linear-gradient(135deg, #007aff, #34c759);

  --input-bg: rgba(0, 0, 0, 0.04);
  --input-border: rgba(0, 0, 0, 0.1);
  --input-focus: rgba(0, 122, 255, 0.3);
}

body.dark {
  --bg: #1c1c1e;
  --bg-card: rgba(44, 44, 46, 0.85);
  --bg-elevated: rgba(44, 44, 46, 0.96);
  --text: #f5f5f7;
  --text-secondary: #98989d;
  --text-muted: #636366;
  --border: rgba(255, 255, 255, 0.08);

  --shadow-neo-up: 6px 6px 14px rgba(0, 0, 0, 0.35), -6px -6px 14px rgba(255, 255, 255, 0.03);
  --shadow-neo-down: inset 4px 4px 10px rgba(0, 0, 0, 0.4), inset -4px -4px 10px rgba(255, 255, 255, 0.02);
  --shadow-neo-sm: 4px 4px 8px rgba(0, 0, 0, 0.25), -4px -4px 8px rgba(255, 255, 255, 0.02);
  --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.3);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.2);

  --glass-bg: rgba(44, 44, 46, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);

  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus: rgba(10, 132, 255, 0.4);

  --q1: #ff453a;
  --q2: #0a84ff;
  --q3: #ff9f0a;
  --q4: #8e8e93;
  --success: #30d158;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: rgba(0, 122, 255, 0.25); }
.dark ::selection { background: rgba(10, 132, 255, 0.3); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

.app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.theme-toggle:hover { transform: scale(1.08); }
.theme-toggle:active { transform: scale(0.95); }
.icon-sun, .icon-moon { position: absolute; transition: opacity 0.4s ease, transform 0.4s ease; }
.dark .icon-sun { opacity: 1; transform: rotate(0deg); }
.dark .icon-moon { opacity: 0; transform: rotate(90deg); }
.icon-sun { opacity: 0; transform: rotate(-90deg); }
.icon-moon { opacity: 1; transform: rotate(0deg); }

/* ── Clock Widget ── */
.clock-widget {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  width: auto;
  max-width: 220px;
  overflow: hidden;
}
.clock-widget:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-elevated), 0 0 0 1px var(--accent);
}
.clock-display {
  padding: 12px 16px;
  min-width: 140px;
  text-align: center;
}
.clock-analog {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  position: relative;
}
.clock-analog svg {
  width: 100%;
  height: 100%;
}
.clock-face {
  fill: var(--clock-bg, #ffffff);
  stroke: var(--border);
  stroke-width: 2;
}
.clock-tick {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-linecap: round;
}
.clock-tick-major {
  stroke: var(--text-secondary);
  stroke-width: 2;
}
.clock-hand {
  stroke: var(--clock-hands, var(--accent));
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: center;
  transform: rotate(0deg);
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.clock-hand-hour { stroke-width: 4; }
.clock-hand-minute { stroke-width: 3; }
.clock-hand-second { stroke: var(--q1); stroke-width: 1.5; }
.clock-center {
  fill: var(--clock-hands, var(--accent));
}
.clock-digital {
  font-family: var(--clock-digital-font, 'monospace');
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
  direction: ltr;
}
.clock-digital-small {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.clock-calendar {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.6;
}
.clock-calendar .cal-day { font-weight: 600; color: var(--text); }
.clock-calendar .cal-events { font-size: 0.75rem; color: var(--accent); }

/* ── Mobile Bottom Nav ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mobile-bottom-nav::-webkit-scrollbar { display: none; }
.mobile-nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font);
  white-space: nowrap;
  min-width: 54px;
  flex-shrink: 0;
}
.mobile-nav-tab svg { width: 22px; height: 22px; opacity: 0.6; transition: opacity 0.25s; }
.mobile-nav-tab.active { color: var(--accent); font-weight: 600; }
.mobile-nav-tab.active svg { opacity: 1; }

/* ── User Profile in Settings ── */
.user-profile-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.user-profile-avatar {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25);
}
.user-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-profile-avatar span {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
}
.avatar-upload-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  text-align: center;
  padding: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.user-profile-avatar:hover .avatar-upload-label { opacity: 1; }
.user-profile-info { flex: 1; }

/* ── Clock Settings Inline ── */
.clock-settings-form { display: flex; flex-direction: column; gap: 12px; }

/* ── Navigation ── */
.nav-bar {
  display: flex;
  gap: 2px;
  padding: 6px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: stretch;
}
.nav-bar::-webkit-scrollbar { height: 0; }
.nav-bar-scroll {
  display: flex;
  gap: 2px;
  flex: 1;
  width: 100%;
}
.nav-tab {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  white-space: nowrap;
}
.nav-tab svg { width: 20px; height: 20px; opacity: 0.8; transition: opacity 0.3s; }
.nav-tab:hover { color: var(--text); }
.nav-tab:hover svg { opacity: 1; }
.nav-tab.active {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-neo-sm);
  color: var(--accent);
  font-weight: 600;
}
.nav-tab.active svg { opacity: 1; }

/* ── Sections ── */
.section-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 8px 0;
}
.section-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-header .subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* ── Glass Container ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

/* ── Neo Card ── */
.neo {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-neo-up);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.neo:hover { box-shadow: var(--shadow-neo-up); transform: translateY(-1px); }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-up);
  transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.stat-card.total .stat-icon { background: rgba(0, 122, 255, 0.1); color: var(--q2); }
.stat-card.pending .stat-icon { background: rgba(255, 149, 0, 0.1); color: var(--q3); }
.stat-card.completed .stat-icon { background: rgba(52, 199, 89, 0.1); color: var(--success); }
.stat-card.routine .stat-icon { background: rgba(90, 200, 250, 0.1); color: #5ac8fa; }
.stat-info { display: flex; flex-direction: column; align-items: center; }
.stat-number { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 1px; font-weight: 500; }

/* ── Progress Card ── */
.progress-card {
  padding: 20px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
}
.progress-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.progress-header h3 { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.progress-percent { font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--input-bg);
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient);
  transition: width 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-track.mini { height: 6px; border-radius: 3px; }
.progress-track.mini .progress-fill { border-radius: 3px; }

/* ── Dashboard Panels ── */
.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.dash-panel {
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}
.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-panel-header h3 { font-size: 0.85rem; font-weight: 600; }
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--gradient);
  color: #fff;
}
.dash-panel-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
  max-height: 220px;
  overflow-y: auto;
}
.dash-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  transition: background 0.2s;
}
.dash-preview-item:hover { background: rgba(0, 122, 255, 0.06); }
.dash-preview-item .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dot.q1 { background: var(--q1); }
.dot.q2 { background: var(--q2); }
.dot.q3 { background: var(--q3); }
.dot.q4 { background: var(--q4); }
.dash-preview-item .time { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }
.dash-preview-item .text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-panel-link {
  display: block;
  text-align: center;
  padding: 10px;
  margin-top: 12px;
  background: var(--input-bg);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.dash-panel-link:hover { background: rgba(0, 122, 255, 0.08); }
.dash-empty { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 20px 0; }

/* ── Dashboard Welcome State ── */
.dash-welcome {
  text-align: center;
  padding: 40px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}
.dash-welcome-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.25);
}
.dash-welcome h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.dash-welcome p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

/* Dashboard Matrix Preview - Beautiful */
.dash-matrix-preview { margin-top: 8px; }
.dash-matrix-full { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-quadrant { border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; min-height: 120px; }
.dm-q-header { padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; font-weight: 700; }
.dm-q-label { text-transform: uppercase; letter-spacing: 0.5px; }
.dm-q-count { background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 10px; font-size: 0.65rem; }
.dm-q-tasks { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.dm-task { padding: 8px 10px; background: var(--bg-elevated); border-radius: var(--radius-sm); border-left: 3px solid; cursor: pointer; transition: all 0.2s; }
.dm-task:hover { transform: translateX(4px); background: var(--input-bg); }
.dm-task-title { font-size: 0.75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-task-meta { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.dm-empty { font-size: 0.7rem; color: var(--text-muted); text-align: center; padding: 12px 0; }
.dm-more { padding: 6px 8px; text-align: center; font-size: 0.65rem; color: var(--accent); cursor: pointer; background: var(--input-bg); border-top: 1px solid var(--border); }

@media (max-width: 768px) {
  .dash-matrix-full { grid-template-columns: 1fr; }
}

/* ── Forms ── */
.form-section {
  padding: 24px;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
}
.form-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

input[type="text"],
input[type="number"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: all 0.25s ease;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}
textarea { min-height: 72px; resize: vertical; }
select {
  cursor: pointer;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 34px;
}
select option { background: var(--bg-elevated); color: var(--text); }

/* ── Buttons ── */
.btn-primary {
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-goal-s { box-shadow: 0 4px 14px rgba(255, 59, 48, 0.25); background: var(--gradient-warm); }
.btn-goal-s:hover { box-shadow: 0 6px 20px rgba(255, 59, 48, 0.35); }
.btn-routine-s { box-shadow: 0 4px 14px rgba(255, 149, 0, 0.25); background: linear-gradient(135deg, #ff9500, #ff3b30); }
.btn-routine-s:hover { box-shadow: 0 6px 20px rgba(255, 149, 0, 0.35); }

.btn-secondary {
  padding: 11px 24px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.btn-secondary:hover { background: var(--bg-card); color: var(--text); }

/* ── Filter Group ── */
.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.tasks-header h2 { font-size: 1.05rem; font-weight: 600; }
.filter-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
}
.filter-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font);
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--bg-card); box-shadow: var(--shadow-neo-sm); color: var(--accent); font-weight: 600; }

/* ── Task Card ── */
.task-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-sm);
  transition: all 0.3s ease;
}
.task-card:hover { box-shadow: var(--shadow-neo-up); transform: translateY(-1px); }
.task-card.completed { opacity: 0.55; }
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
  margin-top: 2px;
}
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox.checked { background: var(--success); border-color: var(--success); }
.task-checkbox.checked::after { content: '✓'; color: #fff; font-size: 0.75rem; font-weight: 700; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 0.92rem; font-weight: 600; margin-bottom: 3px; }
.task-description { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.task-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-meta-item { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.task-meta-item svg { width: 12px; height: 12px; }
.priority-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.priority-badge.q1 { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.priority-badge.q2 { background: rgba(0, 122, 255, 0.1); color: var(--q2); }
.priority-badge.q3 { background: rgba(255, 149, 0, 0.1); color: var(--q3); }
.priority-badge.q4 { background: rgba(142, 142, 147, 0.1); color: var(--q4); }
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
.task-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.task-action-btn:hover { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.task-action-btn.edit-action:hover { background: rgba(0, 122, 255, 0.1); color: var(--q2); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state svg { opacity: 0.3; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ── Matrix ── */
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.matrix-q {
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-up);
  border: 1px solid var(--glass-border);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.matrix-q:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.matrix-q.q1 { border-top: 4px solid var(--q1); }
.matrix-q.q2 { border-top: 4px solid var(--q2); }
.matrix-q.q3 { border-top: 4px solid var(--q3); }
.matrix-q.q4 { border-top: 4px solid var(--q4); }
.q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--input-border);
}
.q-badge { font-size: 0.7rem; font-weight: 700; padding: 5px 14px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.matrix-q.q1 .q-badge { background: rgba(255, 59, 48, 0.12); color: var(--q1); }
.matrix-q.q2 .q-badge { background: rgba(0, 122, 255, 0.12); color: var(--q2); }
.matrix-q.q3 .q-badge { background: rgba(255, 149, 0, 0.12); color: var(--q3); }
.matrix-q.q4 .q-badge { background: rgba(142, 142, 147, 0.12); color: var(--q4); }
.q-count {
  margin-right: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.matrix-q.q1 .q-count { background: var(--q1); }
.matrix-q.q2 .q-count { background: var(--q2); }
.matrix-q.q3 .q-count { background: var(--q3); }
.matrix-q.q4 .q-count { background: var(--q4); }
.q-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 2px dashed var(--input-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font);
}
.q-add-btn:hover { 
  border-color: var(--accent); 
  color: var(--accent); 
  background: rgba(0, 122, 255, 0.06);
  transform: scale(1.02);
}
.q-tasks { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }
.q-task {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid transparent;
  position: relative;
}
.q-task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.matrix-q.q1 .q-task::before { background: var(--q1); }
.matrix-q.q2 .q-task::before { background: var(--q2); }
.matrix-q.q3 .q-task::before { background: var(--q3); }
.matrix-q.q4 .q-task::before { background: var(--q4); }
.q-task:hover { 
  background: var(--bg-elevated);
  border-color: var(--glass-border);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.q-task.q-task-done { opacity: 0.6; }
.q-task.q-task-done .q-task-title { text-decoration: line-through; color: var(--text-muted); }
.q-task-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-task-title { font-size: 0.85rem; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-task-status { font-size: 0.6rem; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: var(--input-bg); color: var(--text-muted); flex-shrink: 0; }
.q-task-status.active { background: rgba(0, 122, 255, 0.12); color: var(--accent); }
.q-task-status.completed { background: rgba(52, 199, 89, 0.12); color: var(--success); }
.q-task-status.planned { background: rgba(255, 149, 0, 0.12); color: var(--warning); }
.q-task-status.paused { background: rgba(142, 142, 147, 0.12); color: var(--q4); }
.q-task-meta { font-size: 0.7rem; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.q-task-meta span { display: flex; align-items: center; gap: 4px; }
.q-empty { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 30px 0; background: var(--input-bg); border-radius: var(--radius-md); border: 2px dashed var(--input-border); }

/* ── Goals ── */
.framework-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.framework-bar > span { color: var(--text-secondary); font-weight: 500; font-size: 0.78rem; }
.framework-tabs { display: flex; gap: 4px; }
.framework-tab {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.framework-tab:hover { color: var(--text); }
.framework-tab.active { background: var(--bg-elevated); box-shadow: var(--shadow-neo-sm); color: var(--accent); font-weight: 600; }
.framework-info { padding: 14px 20px; margin-bottom: 20px; border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.framework-desc { display: none; }
.framework-desc.active { display: block; }
.framework-fields { transition: opacity 0.3s; }

.goals-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.goal-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-sm);
  transition: all 0.3s;
}
.goal-card:hover { box-shadow: var(--shadow-neo-up); transform: translateY(-1px); }
.goal-card.completed { opacity: 0.55; }
.goal-card.completed .goal-title { text-decoration: line-through; color: var(--text-muted); }
.goal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.goal-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.goal-icon.short { background: rgba(255, 59, 48, 0.1); }
.goal-icon.mid { background: rgba(0, 122, 255, 0.1); }
.goal-icon.long { background: rgba(255, 149, 0, 0.1); }
.goal-info { flex: 1; }
.goal-title { font-size: 0.92rem; font-weight: 600; }
.goal-type-badge { font-size: 0.65rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.goal-type-badge.short { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.goal-type-badge.mid { background: rgba(0, 122, 255, 0.1); color: var(--q2); }
.goal-type-badge.long { background: rgba(255, 149, 0, 0.1); color: var(--q3); }
.goal-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 4px; }
.goal-why { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.goal-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.goal-deadline { font-size: 0.75rem; color: var(--text-muted); }
.goal-days { font-size: 0.75rem; font-weight: 600; }
.goal-days.overdue { color: var(--q1); }
.goal-actions-inline { display: flex; gap: 4px; flex-shrink: 0; }
.btn-add-kr {
  padding: 8px 16px;
  margin-top: 6px;
  border: 1px dashed var(--input-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.btn-add-kr:hover { background: rgba(0, 122, 255, 0.06); border-color: var(--accent); }

/* ── Routines ── */
.routine-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.routine-progress span { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.routine-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-sm);
  transition: all 0.3s;
}
.routine-card:hover { box-shadow: var(--shadow-neo-up); transform: translateY(-1px); }
.routine-card.completed { opacity: 0.55; }
.routine-card.completed .routine-name { text-decoration: line-through; color: var(--text-muted); }
.routine-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--input-bg);
}
.routine-content { flex: 1; min-width: 0; }
.routine-name { font-size: 0.92rem; font-weight: 600; }
.routine-meta { display: flex; gap: 12px; margin-top: 3px; }
.routine-time { font-size: 0.75rem; color: var(--text-muted); }
.routine-streak { font-size: 0.75rem; color: var(--q3); font-weight: 600; }
.routine-rewards { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.routine-reward-tag { font-size: 0.65rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.routine-reward-tag.reward { background: rgba(52, 199, 89, 0.1); color: var(--success); }
.routine-reward-tag.punishment { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.routine-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Timeline V2 — Precise positioning ── */
.timeline-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
}
.nav-arrow {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.nav-arrow:hover { background: var(--bg-card); color: var(--text); }
.timeline-date { font-size: 0.95rem; font-weight: 600; }
.timeline-container { padding: 20px; border-radius: var(--radius-md); overflow-y: auto; max-height: 70vh; }
.tl-canvas { position: relative; width: 100%; }
.tl-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.tl-hour-label {
  position: absolute;
  left: 0;
  top: -8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0 6px;
}
.tl-now-line {
  position: absolute;
  left: 50px;
  right: 0;
  height: 2px;
  background: var(--q1);
  z-index: 10;
}
.tl-now-dot {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--q1);
}
.tl-block {
  position: absolute;
  left: 56px;
  right: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  border-right: 3px solid;
  transition: all 0.2s;
  cursor: pointer;
  overflow: hidden;
}
.tl-block:hover { transform: translateX(4px); background: rgba(0, 122, 255, 0.06); }
.tl-block.q1 { border-right-color: var(--q1); }
.tl-block.q2 { border-right-color: var(--q2); }
.tl-block.q3 { border-right-color: var(--q3); }
.tl-block.q4 { border-right-color: var(--q4); }
.tl-block.completed { opacity: 0.5; }
.tl-block.completed .tl-block-title { text-decoration: line-through; }
.tl-block-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tl-block-title { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-block-badge { font-size: 0.58rem; font-weight: 600; padding: 2px 6px; border-radius: 8px; flex-shrink: 0; }
.tl-block-badge.q1 { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.tl-block-badge.q2 { background: rgba(0, 122, 255, 0.1); color: var(--q2); }
.tl-block-badge.q3 { background: rgba(255, 149, 0, 0.1); color: var(--q3); }
.tl-block-badge.q4 { background: rgba(142, 142, 147, 0.1); color: var(--q4); }
.tl-block-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.tl-block-done { font-size: 0.65rem; color: var(--success); font-weight: 600; }
.tl-block.tl-routine { border-right-color: var(--success); background: rgba(52, 199, 89, 0.05); }
.tl-block.tl-routine:hover { background: rgba(52, 199, 89, 0.1); }
.tl-routine-badge { background: rgba(52, 199, 89, 0.1); color: var(--success); }

/* ── Report ── */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.report-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-neo-up);
  transition: all 0.3s;
}
.report-card:hover { transform: translateY(-2px); }
.report-card-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: rgba(0, 122, 255, 0.08); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.report-card:nth-child(2) .report-card-icon { color: var(--success); background: rgba(52, 199, 89, 0.08); }
.report-card:nth-child(3) .report-card-icon { color: var(--q3); background: rgba(255, 149, 0, 0.08); }
.report-card:nth-child(4) .report-card-icon { color: var(--accent2); background: rgba(88, 86, 214, 0.08); }
.report-card-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.report-card-label { font-size: 0.7rem; color: var(--text-secondary); font-weight: 500; }

.report-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-container {
  padding: 22px;
  border-radius: var(--radius-md);
}
.chart-container h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }

/* Donut */
.donut-chart {
  position: relative;
  width: 160px;
  margin: 0 auto 16px;
}
.donut-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: var(--input-bg); stroke-width: 3; }
.donut-segment { fill: none; stroke-width: 3; transition: stroke-dasharray 1s ease; }
.donut-segment.q1 { stroke: var(--q1); }
.donut-segment.q2 { stroke: var(--q2); }
.donut-segment.q3 { stroke: var(--q3); }
.donut-segment.q4 { stroke: var(--q4); }
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-total { display: block; font-size: 1.6rem; font-weight: 700; }
.donut-label { font-size: 0.65rem; color: var(--text-secondary); }
.donut-legend { display: flex; flex-direction: column; gap: 6px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-dot.q1 { background: var(--q1); }
.donut-legend-dot.q2 { background: var(--q2); }
.donut-legend-dot.q3 { background: var(--q3); }
.donut-legend-dot.q4 { background: var(--q4); }
.donut-legend-num { margin-right: auto; font-weight: 600; }

/* Weekly chart */
.weekly-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 10px;
}
.wc-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.wc-bar {
  width: 100%;
  border-radius: 4px;
  min-height: 4px;
  transition: height 0.8s ease;
  background: var(--gradient);
}
.wc-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 500; }
.wc-count { font-size: 0.65rem; font-weight: 600; color: var(--text-secondary); }

.report-details {
  padding: 22px;
  border-radius: var(--radius-md);
}
.report-details h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; color: var(--text-secondary); }
.report-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: var(--radius-sm); background: var(--input-bg); }
.report-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.report-tab.active { background: var(--bg-card); box-shadow: var(--shadow-neo-sm); color: var(--accent); font-weight: 600; }
.report-detail-content { display: none; }
.report-detail-content.active { display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.detail-item { text-align: center; padding: 12px; background: var(--input-bg); border-radius: var(--radius-sm); }
.detail-label { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; }
.detail-value { font-size: 1.3rem; font-weight: 700; }
.detail-value.success { color: var(--success); }
.detail-value.warning { color: var(--warning); }

/* ── Pomodoro ── */
.pomo-card {
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
}
.pomo-ring-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
}
.pomo-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--input-bg); stroke-width: 6; }
.ring-progress { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.5s; }
.pomo-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.pomo-time { font-size: 2.8rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pomo-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.pomo-sessions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--input-bg);
  transition: all 0.3s;
}
.session-dot.active { background: var(--accent); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2); }
.session-dot.done { background: var(--success); }
.session-num { font-size: 0.72rem; color: var(--text-muted); margin-right: 4px; }

.pomo-buttons { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.pomo-btn {
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  font-family: var(--font);
}
.pomo-btn.start { background: var(--gradient); color: #fff; box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3); }
.pomo-btn.start:hover { transform: scale(1.06); box-shadow: 0 8px 28px rgba(0, 122, 255, 0.4); }
.pomo-btn.pause { background: var(--gradient-warm); color: #fff; box-shadow: 0 6px 20px rgba(255, 59, 48, 0.3); }
.pomo-btn.pause:hover { transform: scale(1.06); }
.pomo-btn.secondary {
  width: 44px;
  height: 44px;
  background: var(--input-bg);
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
}
.pomo-btn.secondary:hover { background: var(--bg-card); color: var(--text); }

.pomo-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.pomo-stats span { font-weight: 700; color: var(--text); }
.pomo-config {
  padding: 22px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}
.pomo-config h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.pomo-toggles { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.toggle-label { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; cursor: pointer; }
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--input-bg);
  border-radius: 13px;
  border: 1px solid var(--input-border);
  transition: all 0.3s;
  cursor: pointer;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.toggle input:checked + .toggle-slider { background: var(--success); border-color: var(--success); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }
.pomo-task-select { padding: 18px 22px; margin-bottom: 16px; border-radius: var(--radius-md); }
.pomo-task-select h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.pomo-task-select select { margin-bottom: 0; }

/* ── Jalaali Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header span { font-size: 0.95rem; font-weight: 600; }
.modal-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-nav-btn:hover { background: var(--bg-card); color: var(--text); }
.calendar-days-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.calendar-days-header span { text-align: center; font-size: 0.68rem; font-weight: 600; color: var(--text-muted); }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jalaali-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.jalaali-day:hover { background: var(--input-bg); }
.jalaali-day.today { background: var(--accent); color: #fff; font-weight: 700; }
.jalaali-day.selected { background: var(--accent2); color: #fff; font-weight: 600; }
.jalaali-day.empty { pointer-events: none; }
.modal-footer { display: flex; gap: 10px; margin-top: 16px; }
.modal-footer .btn-secondary, .modal-footer .btn-primary { flex: 1; text-align: center; }

/* ── Matrix Editor Modal ── */
.matrix-editor-content { max-width: 480px; }
.matrix-editor-content form { display: flex; flex-direction: column; gap: 12px; }
.matrix-editor-content .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
  pointer-events: all;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ── Tab Content ── */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .report-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .report-charts { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-panels { grid-template-columns: 1fr; }
  .nav-tab span { font-size: 0.65rem; }
  .app-container { padding: 16px; }
  .nav-bar { display: none; }
  .mobile-bottom-nav { display: flex; justify-content: space-around; }
  .app-container { padding-bottom: 80px; }
  .theme-toggle { top: 12px; left: 12px; z-index: 1101; }
  .clock-widget { display: none; }
  .user-profile-card { flex-direction: column; align-items: center; text-align: center; }
  .quick-capture-btn { bottom: 84px; left: 16px; width: 44px; height: 44px; }
  .focus-toggle-btn { bottom: 84px; right: 16px; width: 38px; height: 38px; }
  .toast-container { bottom: 90px; }
  body.focus-mode .quick-capture-btn { bottom: 16px; }
  body.focus-mode .focus-toggle-btn { bottom: 16px; }
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px 8px; }
  .stat-number { font-size: 1.3rem; }
  .tasks-header { flex-direction: column; align-items: flex-start; }
  .filter-group { width: 100%; }
  .nav-tab span { display: none; }
  .nav-tab { padding: 10px 4px; }
  .nav-tab svg { width: 22px; height: 22px; }
  .pomo-ring-wrapper { width: 160px; height: 160px; }
  .pomo-time { font-size: 2.2rem; }
  .report-card-value { font-size: 1.3rem; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .goal-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
  .mobile-nav-tab { min-width: 44px; padding: 6px 4px; }
  .mobile-nav-tab span { font-size: 0.55rem; }
  .app-container { padding: 10px; padding-bottom: 80px; }
  .setting-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .setting-control { width: 100%; }
  .setting-control select { min-width: auto; width: 100%; }
  .quick-capture-btn { width: 40px; height: 40px; bottom: 72px; left: 12px; }
  .focus-toggle-btn { width: 34px; height: 34px; bottom: 72px; right: 12px; }
}

/* ── Goals Progress (Dashboard) ── */
.goals-progress-container { display: flex; flex-direction: column; gap: 8px; }
.goal-mini-progress { display: flex; align-items: center; gap: 10px; }
.goal-mini-progress .gmp-name { font-size: 0.78rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-mini-progress .gmp-track { flex: 2; height: 6px; border-radius: 3px; background: var(--input-bg); overflow: hidden; }
.goal-mini-progress .gmp-fill { height: 100%; border-radius: 3px; background: var(--gradient); transition: width 0.6s; }
.goal-mini-progress .gmp-pct { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); min-width: 32px; text-align: right; }

/* ── Dashboard second row ── */
.dashboard-panels.second-row { margin-top: 16px; }

/* ── Quick Capture Button ── */
.quick-capture-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.quick-capture-btn:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(0, 122, 255, 0.45); }
.quick-capture-btn:active { transform: scale(0.95); }

/* ── Quick Capture Modal ── */
.quick-capture-content { max-width: 420px; }
.quick-capture-content form { display: flex; flex-direction: column; gap: 12px; }
.quick-capture-content input { width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text); font-size: 1rem; font-family: var(--font); outline: none; }
.quick-capture-content input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--input-focus); }

/* ── Focus Toggle ── */
.focus-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-neo-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.focus-toggle-btn:hover { transform: scale(1.08); color: var(--accent); }
.focus-toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Task Drawer ── */
.task-drawer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.task-drawer.active { pointer-events: all; opacity: 1; }
.task-drawer .drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.task-drawer .drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.task-drawer.active .drawer-panel { transform: translateX(0); }
.drawer-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.drawer-close:hover { background: var(--bg-card); color: var(--text); }
.drawer-actions-top { display: flex; gap: 6px; }
.drawer-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.drawer-action:hover { background: rgba(0, 122, 255, 0.1); color: var(--accent); }
.drawer-action.drawer-delete:hover { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.drawer-action.drawer-complete:hover { background: rgba(52, 199, 89, 0.1); color: var(--success); }
.drawer-body { padding: 24px; }
.drawer-task-header { margin-bottom: 20px; }
.drawer-task-state { font-size: 0.75rem; font-weight: 600; margin-bottom: 6px; }
.drawer-task-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.drawer-task-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }
.drawer-task-meta { margin-bottom: 16px; }
.drawer-task-meta .dm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.drawer-task-meta .dm-label { color: var(--text-muted); }
.drawer-task-meta .dm-value { font-weight: 600; }
.drawer-task-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dtag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--input-bg);
  color: var(--text-secondary);
}

/* ── Command Palette ── */
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.command-palette.active { opacity: 1; pointer-events: all; }
.cp-panel {
  width: 90%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.command-palette.active .cp-panel { transform: scale(1); }
.cp-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cp-search {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
}
.cp-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.cp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s;
}
.cp-item:hover { background: var(--input-bg); }
.cp-icon { font-size: 1.1rem; width: 24px; text-align: center; }

/* ── Habit Tracker ── */
.habit-tracker-section { margin-top: 24px; }
.habit-nav { display: flex; align-items: center; gap: 12px; }
.habit-nav span { font-size: 0.85rem; font-weight: 600; }
.habit-tracker-grid { overflow-x: auto; padding: 16px 0; }
.habit-table { width: 100%; border-collapse: collapse; }
.habit-header-row, .habit-row { display: flex; align-items: center; gap: 2px; }
.habit-header-row { border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
.habit-label-col { min-width: 140px; flex-shrink: 0; font-size: 0.78rem; font-weight: 600; padding: 6px 8px; }
.habit-day-col {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.habit-day-col:hover { background: var(--input-bg); }
.habit-day-col.today { font-weight: 700; color: var(--accent); }
.habit-day-col.checked { background: var(--success); color: #fff; font-weight: 700; }
.habit-check { font-size: 0.7rem; }
.habit-streak-col { min-width: 36px; text-align: center; font-size: 0.7rem; color: var(--text-muted); }
.habit-streak-num { font-weight: 700; color: var(--q3); }
.habit-row { padding: 4px 0; border-bottom: 1px solid var(--border); }
.habit-row:last-child { border-bottom: none; }

/* Habit Summary */
.habit-summary { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.habit-summary-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--input-bg); border-radius: var(--radius-sm); }
.hsi-icon { font-size: 1.1rem; flex-shrink: 0; }
.hsi-name { font-size: 0.8rem; font-weight: 600; min-width: 100px; }
.hsi-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.hsi-fill { height: 100%; border-radius: 3px; background: var(--gradient); transition: width 0.6s; }
.hsi-pct { font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); min-width: 32px; text-align: right; }

/* ── Focus Mode ── */
body.focus-mode .app-container { max-width: 600px; padding-top: 40px; }
body.focus-mode .quick-capture-btn { bottom: 16px; left: 16px; width: 48px; height: 48px; }
body.focus-mode .focus-toggle-btn { bottom: 16px; right: 16px; }

/* ── Goal Progress Bar ── */
.goal-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.goal-progress-fill {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--gradient);
  transition: width 0.6s;
}
.goal-progress-pct { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); min-width: 32px; text-align: right; }

/* ── Milestones List ── */
.milestones-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.milestone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.82rem;
}
.milestone-item:hover { background: rgba(0, 122, 255, 0.06); }
.milestone-item.done .ms-text { text-decoration: line-through; color: var(--text-muted); }
.ms-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #fff;
  flex-shrink: 0;
  transition: all 0.2s;
}
.milestone-item.done .ms-check { background: var(--success); border-color: var(--success); }
.ms-text { flex: 1; }

/* ── State Badge ── */
.state-badge { font-size: 0.65rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--input-bg); }

/* ── Dashboard Action Buttons ── */
.dash-item-actions { display: flex; gap: 4px; margin-left: 8px; flex-shrink: 0; }
.daction-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.daction-btn:hover { background: rgba(0, 122, 255, 0.1); color: var(--accent); }
.daction-btn.daction-done { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.daction-btn.daction-danger:hover { background: rgba(255, 59, 48, 0.1); color: var(--q1); }
.dash-preview-item { position: relative; }
.dash-preview-item .text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.routine-dot { width: 24px; height: 24px; border-radius: 6px; background: var(--input-bg); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }

/* ── Settings Panel ── */
.settings-panel {
  padding: 24px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
}
.settings-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.setting-item:last-child { border-bottom: none; padding-bottom: 0; }
.setting-item:first-of-type { padding-top: 0; }
.setting-info { flex: 1; }
.setting-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.setting-desc { display: block; font-size: 0.78rem; color: var(--text-muted); }
.setting-control { flex-shrink: 0; }
.setting-control select {
  min-width: 140px;
  padding: 9px 34px 9px 12px;
}
.range-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-control input[type="range"] {
  width: 120px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--input-bg);
  border-radius: 3px;
  outline: none;
  border: none;
  padding: 0;
}
.range-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,122,255,0.3);
}
.range-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
}
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-danger { color: var(--q1); border-color: rgba(255,59,48,0.3); }
.btn-danger:hover { background: rgba(255,59,48,0.08); color: var(--q1); }

/* Nav Order List */
.nav-order-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
  border: 1px solid transparent;
}
.nav-order-item:hover { background: var(--bg-card); border-color: var(--glass-border); }
.nav-order-item.dragging {
  opacity: 0.5;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.nav-order-item.drag-over {
  border-color: var(--accent);
  background: rgba(0,122,255,0.06);
}
.nav-order-handle {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  cursor: grab;
}
.nav-order-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-order-icon svg { width: 16px; height: 16px; color: var(--accent); }
.nav-order-label { flex: 1; font-size: 0.85rem; font-weight: 500; }
.nav-order-toggle {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  border: none;
  background: var(--input-bg);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-order-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.nav-order-toggle.on { background: var(--success); }
.nav-order-toggle.on::after { transform: translateX(16px); }

/* ── Color Picker ── */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-picker-group input[type="color"] {
  width: 44px;
  height: 44px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--input-bg);
}
.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-group input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.btn-reset-color {
  padding: 6px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.btn-reset-color:hover { background: var(--bg-card); color: var(--text); }

/* ── Theme Style Section ── */
.theme-style-section { margin-top: 18px; }
.theme-styles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.theme-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font);
}
.theme-style-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.theme-style-card.active { border-color: var(--accent); background: rgba(0,122,255,0.08); box-shadow: 0 0 0 3px var(--input-focus); }
.ts-preview {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  transition: all 0.3s;
}
.ts-name { font-size: 0.65rem; font-weight: 600; color: var(--text-secondary); text-align: center; }

/* Theme preview thumbnails */
.ts-default { background: linear-gradient(135deg, #007aff, #5856d6); }
.ts-stripe { background: linear-gradient(135deg, #635bff, #a259ff, #ff7eb3); }
.ts-linear { background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); }
.ts-notion { background: linear-gradient(135deg, #e8e8e8, #d4d4d4); }
.ts-glass { background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.2)); border: 1px solid rgba(255,255,255,0.3); }
.ts-neumorphism { background: linear-gradient(145deg, #e6e6e6, #f0f0f0); }
.ts-dashboard { background: linear-gradient(135deg, #1e293b, #334155); }
.ts-brutalist { background: #000; border: 2px solid #fff; }
.ts-aurora { background: linear-gradient(135deg, #00f5d4, #7b2ff7, #f72585); }
.ts-minimal { background: #fafafa; border: 1px solid #e5e5e5; }
.ts-vintage { background: linear-gradient(135deg, #d4a574, #c8956e, #b8860b); }

body.dark .ts-default { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
body.dark .ts-stripe { background: linear-gradient(135deg, #7c3aed, #c084fc, #fb7185); }
body.dark .ts-linear { background: linear-gradient(135deg, #0f0f23, #1a1a3e, #0a2647); }
body.dark .ts-notion { background: linear-gradient(135deg, #2f2f2f, #1a1a1a); }
body.dark .ts-glass { background: linear-gradient(135deg, rgba(50,50,50,0.5), rgba(30,30,30,0.3)); border: 1px solid rgba(255,255,255,0.1); }
body.dark .ts-neumorphism { background: linear-gradient(145deg, #2a2a2a, #1a1a1a); }
body.dark .ts-minimal { background: #1a1a1a; border: 1px solid #333; }

@media (max-width: 768px) {
  .theme-styles-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .theme-styles-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   THEME STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Stripe Style ── */
.theme-stripe {
  --bg: #f6f8fc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-elevated: rgba(255, 255, 255, 0.98);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.8);
  --gradient: linear-gradient(135deg, #635bff, #a259ff);
  --gradient-warm: linear-gradient(135deg, #ff6b6b, #ffa07a);
  --gradient-cool: linear-gradient(135deg, #635bff, #00d4aa);
}
.theme-stripe.dark {
  --bg: #0a2540;
  --bg-card: rgba(15, 35, 60, 0.9);
  --bg-elevated: rgba(15, 35, 60, 0.98);
  --glass-bg: rgba(15, 35, 60, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --gradient: linear-gradient(135deg, #7c3aed, #a78bfa);
  --gradient-warm: linear-gradient(135deg, #f87171, #fbbf24);
  --gradient-cool: linear-gradient(135deg, #7c3aed, #34d399);
}
.theme-stripe .section-header h1 { background: linear-gradient(135deg, #635bff, #a259ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-stripe.dark .section-header h1 { background: linear-gradient(135deg, #7c3aed, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-stripe .btn-primary { background: linear-gradient(135deg, #635bff, #a259ff); box-shadow: 0 4px 14px rgba(99, 91, 255, 0.3); }
.theme-stripe .btn-primary:hover { box-shadow: 0 6px 20px rgba(99, 91, 255, 0.4); }

/* ── Linear Style ── */
.theme-linear {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.06);
  --text: #1a1a1a;
  --text-secondary: #666;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-glass: 0 1px 3px rgba(0, 0, 0, 0.04);
}
body.dark.theme-linear {
  --bg: #121212;
  --bg-card: #1e1e1e;
  --bg-elevated: #252525;
  --glass-bg: rgba(30, 30, 30, 0.9);
  --glass-border: rgba(255, 255, 255, 0.06);
  --text: #e8e8e8;
  --text-secondary: #999;
  --border: rgba(255, 255, 255, 0.06);
  --shadow-glass: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.theme-linear .matrix-q { border-radius: 10px; border: 1px solid var(--border); border-top: 3px solid; }
.theme-linear .btn-primary { border-radius: 8px; }

/* ── Notion Style ── */
.theme-notion {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --glass-bg: #ffffff;
  --glass-border: #e8e8e8;
  --text: #37352f;
  --text-secondary: #787774;
  --text-muted: #b4b4b0;
  --border: #e8e8e8;
  --input-bg: #f7f6f3;
  --input-border: #e8e8e8;
  --shadow-glass: none;
  --shadow-neo-up: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-neo-sm: 0 1px 2px rgba(0,0,0,0.03);
  --radius-md: 6px;
  --radius-sm: 4px;
}
body.dark.theme-notion {
  --bg: #191919;
  --bg-card: #202020;
  --bg-elevated: #252525;
  --glass-bg: #202020;
  --glass-border: #333;
  --text: #e0e0e0;
  --text-secondary: #999;
  --text-muted: #666;
  --border: #333;
  --input-bg: #2a2a2a;
  --input-border: #333;
}
.theme-notion .section-header h1 { background: none; -webkit-text-fill-color: var(--text); font-weight: 700; }
.theme-notion .nav-tab.active { background: var(--input-bg); box-shadow: none; }
.theme-notion .btn-primary { background: #2eaadc; border-radius: 4px; box-shadow: none; }
.theme-notion .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ── Glassmorphism Style ── */
.theme-glass {
  --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  --bg-card: rgba(255, 255, 255, 0.3);
  --bg-elevated: rgba(255, 255, 255, 0.4);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.6);
  --border: rgba(255, 255, 255, 0.3);
  --input-bg: rgba(255, 255, 255, 0.2);
  --input-border: rgba(255, 255, 255, 0.3);
}
body.dark.theme-glass {
  --bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.15);
  --bg-card: rgba(255, 255, 255, 0.12);
  --bg-elevated: rgba(255, 255, 255, 0.15);
}
.theme-glass body { background: var(--bg); }
.theme-glass .glass { backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.theme-glass .neo { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.theme-glass .section-header h1 { background: none; -webkit-text-fill-color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.theme-glass .theme-toggle { border: 1px solid rgba(255,255,255,0.3); }
.theme-glass .clock-widget { border: 1px solid rgba(255,255,255,0.25); }

/* ── Neumorphism Style ── */
.theme-neumorphism {
  --bg: #e0e5ec;
  --bg-card: #e0e5ec;
  --bg-elevated: #e0e5ec;
  --glass-bg: #e0e5ec;
  --glass-border: transparent;
  --shadow-neo-up: 8px 8px 16px #b8bec7, -8px -8px 16px #ffffff;
  --shadow-neo-down: inset 4px 4px 8px #b8bec7, inset -4px -4px 8px #ffffff;
  --shadow-neo-sm: 4px 4px 8px #b8bec7, -4px -4px 8px #ffffff;
  --shadow-glass: 8px 8px 16px #b8bec7, -8px -8px 16px #ffffff;
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --border: transparent;
  --input-bg: #e0e5ec;
  --input-border: transparent;
  --q1: #ff6b6b;
  --q2: #4ecdc4;
  --q3: #feca57;
  --q4: #95afc0;
}
body.dark.theme-neumorphism {
  --bg: #2d3436;
  --bg-card: #2d3436;
  --bg-elevated: #2d3436;
  --glass-bg: #2d3436;
  --shadow-neo-up: 6px 6px 12px #1e2324, -6px -6px 12px #3c4548;
  --shadow-neo-down: inset 4px 4px 8px #1e2324, inset -4px -4px 8px #3c4548;
  --shadow-neo-sm: 4px 4px 8px #1e2324, -4px -4px 8px #3c4548;
  --shadow-glass: 6px 6px 12px #1e2324, -6px -6px 12px #3c4548;
  --text: #f5f5f5;
  --text-secondary: #b2bec3;
  --text-muted: #636e72;
  --input-bg: #2d3436;
}
.theme-neumorphism .section-header h1 { background: none; -webkit-text-fill-color: var(--text); }
.theme-neumorphism .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
.theme-neumorphism .neo { border: none; }

/* ── Dashboard SaaS Style ── */
.theme-dashboard {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --input-bg: #f8fafc;
  --input-border: #e2e8f0;
  --shadow-glass: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-neo-up: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --q1: #ef4444;
  --q2: #3b82f6;
  --q3: #f59e0b;
  --q4: #94a3b8;
}
body.dark.theme-dashboard {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #1e293b;
  --glass-bg: rgba(30, 41, 59, 0.95);
  --glass-border: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --input-bg: #0f172a;
  --input-border: #334155;
  --shadow-glass: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-neo-up: 0 4px 6px -1px rgba(0,0,0,0.3);
}
.theme-dashboard .nav-tab.active { border-bottom: 2px solid var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

/* ── Brutalist Style ── */
.theme-brutalist {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --glass-bg: #ffffff;
  --glass-border: #000000;
  --text: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  --border: #000000;
  --input-bg: #f5f5f5;
  --input-border: #000000;
  --shadow-glass: 4px 4px 0px #000;
  --shadow-neo-up: 4px 4px 0px #000;
  --shadow-neo-sm: 2px 2px 0px #000;
  --shadow-elevated: 6px 6px 0px #000;
  --radius-md: 0px;
  --radius-sm: 0px;
  --radius-lg: 0px;
  --q1: #ff0000;
  --q2: #0000ff;
  --q3: #ff8800;
  --q4: #666666;
  --gradient: none;
}
body.dark.theme-brutalist {
  --bg: #111111;
  --bg-card: #1a1a1a;
  --bg-elevated: #222222;
  --glass-bg: #1a1a1a;
  --glass-border: #ffffff;
  --text: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --border: #ffffff;
  --input-bg: #222222;
  --input-border: #ffffff;
  --shadow-glass: 4px 4px 0px #fff;
  --shadow-neo-up: 4px 4px 0px #fff;
  --shadow-neo-sm: 2px 2px 0px #fff;
}
.theme-brutalist .section-header h1 { background: none; -webkit-text-fill-color: var(--text); font-weight: 900; text-transform: uppercase; letter-spacing: 2px; }
.theme-brutalist .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
.theme-brutalist .btn-primary { border-radius: 0; border: 2px solid #000; font-weight: 900; text-transform: uppercase; }
.theme-brutalist .theme-toggle,
.theme-brutalist .clock-widget { border: 2px solid #000; }
.theme-brutalist .nav-tab svg,
.theme-brutalist .mobile-nav-tab svg { opacity: 1; }
.theme-brutalist body.dark .btn-primary { border-color: #fff; }

/* ── Aurora Style ── */
.theme-aurora {
  --bg: #0d1117;
  --bg-card: rgba(13, 17, 23, 0.9);
  --bg-elevated: rgba(22, 27, 34, 0.95);
  --glass-bg: rgba(13, 17, 23, 0.7);
  --glass-border: rgba(139, 92, 246, 0.3);
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --border: rgba(139, 92, 246, 0.2);
  --input-bg: rgba(139, 92, 246, 0.08);
  --input-border: rgba(139, 92, 246, 0.3);
  --gradient: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
  --gradient-warm: linear-gradient(135deg, #f43f5e, #fb923c);
  --gradient-cool: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --q1: #f43f5e;
  --q2: #8b5cf6;
  --q3: #fb923c;
  --q4: #484f58;
}
.theme-aurora .section-header h1 { background: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-aurora .btn-primary { background: linear-gradient(135deg, #7c3aed, #a855f7); box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4); }
.theme-aurora .btn-primary:hover { box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5); }
.theme-aurora .glass { backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); }

/* ── Minimal Style ── */
.theme-minimal {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --glass-bg: #ffffff;
  --glass-border: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #888;
  --text-muted: #bbb;
  --border: #f0f0f0;
  --input-bg: #fafafa;
  --input-border: #e8e8e8;
  --shadow-glass: none;
  --shadow-neo-up: none;
  --shadow-neo-down: none;
  --shadow-neo-sm: none;
  --shadow-elevated: none;
  --radius-md: 12px;
  --radius-sm: 8px;
  --q1: #e74c3c;
  --q2: #3498db;
  --q3: #f39c12;
  --q4: #95a5a6;
  --gradient: none;
}
body.dark.theme-minimal {
  --bg: #111111;
  --bg-card: #1a1a1a;
  --bg-elevated: #1a1a1a;
  --glass-bg: #1a1a1a;
  --glass-border: #222;
  --text: #e8e8e8;
  --text-secondary: #888;
  --text-muted: #555;
  --border: #222;
  --input-bg: #222;
  --input-border: #333;
}
.theme-minimal .section-header h1 { background: none; -webkit-text-fill-color: var(--text); }
.theme-minimal .glass { backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid var(--border); }
.theme-minimal .neo { box-shadow: none; border: 1px solid var(--border); }
.theme-minimal .btn-primary { background: var(--text); color: var(--bg); border-radius: 8px; box-shadow: none; }
.theme-minimal .nav-tab.active { background: var(--text); color: var(--bg); box-shadow: none; }
.theme-minimal .theme-toggle,
.theme-minimal .clock-widget { border: 1px solid var(--border); }
.theme-minimal .nav-tab svg,
.theme-minimal .mobile-nav-tab svg { opacity: 1; }

/* ── Vintage / Retro Style ── */
.theme-vintage {
  --bg: #faf6f1;
  --bg-card: #fff9f2;
  --bg-elevated: #fffdf9;
  --glass-bg: rgba(255, 249, 242, 0.9);
  --glass-border: #e8d5c0;
  --text: #3d2c1e;
  --text-secondary: #7a6552;
  --text-muted: #b8a48e;
  --border: #e8d5c0;
  --input-bg: #f5ece3;
  --input-border: #dcc8b0;
  --shadow-glass: 0 4px 16px rgba(61, 44, 30, 0.08);
  --shadow-neo-up: 4px 4px 12px rgba(61, 44, 30, 0.08), -2px -2px 8px rgba(255, 255, 255, 0.8);
  --shadow-neo-sm: 2px 2px 8px rgba(61, 44, 30, 0.06);
  --q1: #c0392b;
  --q2: #2980b9;
  --q3: #d4a017;
  --q4: #7f8c8d;
  --gradient: linear-gradient(135deg, #8b6914, #b8860b);
  --gradient-warm: linear-gradient(135deg, #c0392b, #d4a017);
  --gradient-cool: linear-gradient(135deg, #2980b9, #27ae60);
}
body.dark.theme-vintage {
  --bg: #1a1410;
  --bg-card: #2a2118;
  --bg-elevated: #332a20;
  --glass-bg: rgba(42, 33, 24, 0.9);
  --glass-border: #4a3c2c;
  --text: #e8d5c0;
  --text-secondary: #b8a48e;
  --text-muted: #7a6552;
  --border: #4a3c2c;
  --input-bg: #332a20;
  --input-border: #4a3c2c;
}
.theme-vintage .section-header h1 { background: linear-gradient(135deg, #8b6914, #b8860b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-vintage .btn-primary { background: linear-gradient(135deg, #8b6914, #b8860b); box-shadow: 0 4px 14px rgba(139, 105, 20, 0.3); }
.theme-vintage .glass { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ── Clock Widget Responsive ── */
@media (max-width: 768px) {
  .clock-widget {
    position: fixed;
    top: auto;
    bottom: 16px;
    right: 16px;
    z-index: 999;
  }
  .clock-display { padding: 8px 12px; min-width: auto; }
  .clock-menu {
    position: fixed;
    top: auto;
    bottom: 60px;
    right: 16px;
    left: 16px;
    width: auto;
    max-height: 70vh;
    border-radius: var(--radius-lg);
  }
  .clock-digital { font-size: 1.1rem !important; }
  .clock-analog { width: 140px !important; height: 140px !important; }
}
@media (max-width: 480px) {
  .clock-widget { bottom: 12px; right: 12px; }
  .clock-display { padding: 6px 10px; }
  .clock-menu { bottom: 56px; right: 12px; left: 12px; }
  .clock-analog { width: 120px !important; height: 120px !important; }
  .clock-digital { font-size: 0.95rem !important; }
}

/* ══════════════════════════════════════════════════════════════════
   AUTH — Login / Register Overlay
   ══════════════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-card {
  width: 380px;
  max-width: 90vw;
  padding: 40px 32px 32px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.auth-body form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 4px;
}

.auth-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
}

.auth-toggle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-toggle a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════
   USER MENU
   ══════════════════════════════════════════════════════════════════ */
.user-menu {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9999;
}

.user-menu-dropdown {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.82rem;
  transition: background 0.2s;
  white-space: nowrap;
}

.user-menu-btn:hover {
  background: var(--bg-elevated);
}

.user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-badge {
  font-size: 0.65rem;
  background: var(--gradient);
  color: white;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 600;
}

.user-menu-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  margin-top: 6px;
  padding: 6px 0;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
}

.user-menu-dropdown:hover .user-menu-content,
.user-menu-dropdown:focus-within .user-menu-content {
  display: block;
}

.user-menu-info {
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  text-align: right;
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu-item:hover {
  background: var(--input-bg);
}

.user-menu-item.logout {
  color: var(--q1);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
}

/* ══════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════════════════════════ */
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.admin-user-item.admin {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.06);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.admin-user-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toast-error {
  background: var(--q1) !important;
  color: white !important;
}

/* Timeline PDF Download */
.timeline-pdf-section {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.btn-pdf-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-pdf-download::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn-pdf-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0, 122, 255, 0.4);
}

.btn-pdf-download:hover::before {
  transform: translateX(100%);
}

.btn-pdf-download:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.btn-pdf-download svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.btn-pdf-download:hover svg {
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════
   LANDING PAGE — Minimal, brand-consistent
   ═══════════════════════════════════════════════════ */
.landing-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
}

.landing-logo {
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-actions {
  display: flex;
  gap: 10px;
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  max-width: 640px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.landing-hero h1 .highlight {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.landing-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-btn {
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.3s ease;
}

.landing-btn.primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25);
}
.landing-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.landing-btn.secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-neo-sm);
}
.landing-btn.secondary:hover {
  border-color: var(--accent);
}

.landing-features-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 32px 24px;
  flex-wrap: wrap;
}

.landing-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.landing-feature-item .lf-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 122, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.landing-footer {
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════
   DASHBOARD IMPROVEMENTS — New sections
   ═══════════════════════════════════════════════════ */

/* Top 3 Goals */
.top3-section {
  margin-bottom: 20px;
}
.top3-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.top3-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top3-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-neo-sm);
  transition: all 0.25s ease;
}

.top3-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-neo-up);
}

.top3-item.done {
  opacity: 0.55;
}

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

.top3-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}

.top3-num.n1 { background: linear-gradient(135deg, #ff3b30, #c0392b); }
.top3-num.n2 { background: linear-gradient(135deg, #007aff, #5856d6); }
.top3-num.n3 { background: linear-gradient(135deg, #ff9500, #e67e22); }

.top3-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
}

.top3-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: transparent;
  font-size: 0.7rem;
  font-weight: 700;
}

.top3-check:hover {
  border-color: var(--success);
}

.top3-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* Habit preview (dashboard) */
.habit-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.habit-mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-neo-sm);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.habit-mini-item:hover {
  border-color: var(--accent);
}

.habit-mini-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.habit-mini-name {
  flex: 1;
  font-weight: 500;
}

.habit-mini-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.65rem;
  font-weight: 700;
  color: transparent;
}

.habit-mini-check:hover {
  border-color: var(--success);
}

.habit-mini-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* Water tracker */
.water-section {
  margin-top: 16px;
}

.water-track {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.water-cup {
  width: 30px;
  height: 38px;
  border: 2px solid var(--border);
  border-radius: 0 0 8px 8px;
  border-top: none;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.water-cup.filled {
  border-color: var(--accent);
}

.water-cup::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(0,122,255,0.2), rgba(0,122,255,0.6));
  transition: height 0.4s ease;
}

.water-cup.filled::after {
  height: 85%;
}

.water-cup:hover {
  border-color: var(--accent);
}

/* Daily Reflection */
.reflection-section {
  margin-top: 16px;
}

.reflection-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.mood-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mood-btn {
  flex: 1;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: center;
  font-size: 1.3rem;
  transition: all 0.25s;
}

.mood-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.mood-btn.selected {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.08);
}

.reflection-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.reflection-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.reflection-prompt {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-style: italic;
}

/* Daily quote */
.daily-quote-box {
  background: linear-gradient(135deg, rgba(0,122,255,0.04), rgba(88,86,214,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.daily-quote-mark {
  font-size: 2rem;
  line-height: 0.5;
  color: var(--accent);
  opacity: 0.5;
  font-family: Georgia, serif;
  margin-top: 10px;
  flex-shrink: 0;
}

.daily-quote-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
}

.daily-quote-author {
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 600;
}

/* Score ring mini */
.score-ring-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

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

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--input-bg);
  stroke-width: 6;
}

.score-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.score-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-ring-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.score-ring-label {
  font-size: 0.5rem;
  color: var(--text-muted);
}

.score-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.score-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score-stat-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.score-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Hide landing when app is loaded */
body.logged-in .landing-wrap {
  display: none;
}
/* Hide app when NOT logged in */
body:not(.logged-in) .app-container,
body:not(.logged-in) .theme-toggle,
body:not(.logged-in) .clock-widget,
body:not(.logged-in) .nav-bar,
body:not(.logged-in) .mobile-bottom-nav,
body:not(.logged-in) .quick-capture-btn,
body:not(.logged-in) .focus-toggle-btn,
body:not(.logged-in) .task-drawer,
body:not(.logged-in) .command-palette,
body:not(.logged-in) #jalaaliPickerModal,
body:not(.logged-in) #matrixEditorModal,
body:not(.logged-in) #quickCaptureModal,
body:not(.logged-in) #changePasswordModal,
body:not(.logged-in) #toastContainer {
  display: none !important;
}