/* ============================================================
   SMART LIFE MANAGER — Premium Dark Theme
   Aesthetic: Refined dark-luxury with neon-violet accents
   Fonts: Syne (display) + DM Sans (body)
   ============================================================ */

:root {
  /* Core Palette */
  --bg-base:       #0a0a12;
  --bg-surface:    #111120;
  --bg-card:       #16162a;
  --bg-card2:      #1c1c35;
  --border:        rgba(255,255,255,0.07);
  --border-glow:   rgba(139,92,246,0.35);

  /* Accent spectrum */
  --accent:        #8b5cf6;
  --accent-light:  #a78bfa;
  --accent-glow:   rgba(139,92,246,0.25);
  --accent-2:      #06b6d4;   /* cyan pop */
  --accent-3:      #f59e0b;   /* amber */
  --accent-4:      #10b981;   /* emerald */
  --danger:        #ef4444;
  --success:       #22c55e;

  /* Text */
  --text-primary:  #f0f0ff;
  --text-secondary:#9999bb;
  --text-muted:    #5c5c7a;

  /* Gradients */
  --grad-violet:   linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --grad-cyan:     linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-amber:    linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-green:    linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-red:      linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  /* Misc */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow:0 0 24px rgba(139,92,246,0.3);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg-base);
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Subtle animated gradient on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(139,92,246,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(6,182,212,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Desktop hint ────────────────────────────────────────── */
.desktop-hint {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(139,92,246,0.15);
  border: 1px solid var(--border-glow);
  color: var(--accent-light);
  padding: 6px 18px;
  border-radius: 50px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(12px);
  z-index: 10;
}

/* ── Phone Shell ─────────────────────────────────────────── */
.phone-shell {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 390px;
  height: 820px;
  background: #080810;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.8),
    0 30px 80px rgba(0,0,0,0.7),
    0 0 60px rgba(139,92,246,0.15),
    inset 0 1px 0 rgba(255,255,255,0.08);
  z-index: 1;
  overflow: hidden;
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #080810;
  border-radius: 0 0 20px 20px;
  z-index: 10;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
  border-radius: 48px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── Tab Panels ──────────────────────────────────────────── */
.tab-panel {
  display: none;
  flex: 1;
  overflow: hidden;
  position: relative;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-panel.active { display: flex; flex-direction: column; }

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

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 60px 18px 100px;
  scrollbar-width: none;
}
.panel-scroll::-webkit-scrollbar { display: none; }

/* ── Home Header ─────────────────────────────────────────── */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  margin-top: 6px;
}

.greeting-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 4px;
}

.greeting-main {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, #f0f0ff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-violet);
  padding: 2px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}
.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
}

.date-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 20px;
}

/* ── Summary Grid ────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
}
.card-tasks::before    { background: var(--grad-violet); }
.card-habits::before   { background: var(--grad-amber); }
.card-expenses::before { background: var(--grad-cyan); }

.summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.summary-card:hover::before { opacity: 0.12; }
.summary-card:active { transform: scale(0.97); }

.card-icon { font-size: 22px; margin-bottom: 6px; }
.card-stat {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.card-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Section Heading ─────────────────────────────────────── */
.section-heading {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ── Inner Header (Tasks/Habits/Expenses) ────────────────── */
.inner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  margin-top: 6px;
}
.inner-title {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #f0f0ff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Chips / Badges ──────────────────────────────────────── */
.streak-badge, .total-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
}

/* ── Filter Bar ──────────────────────────────────────────── */
.task-filter {
  display: flex;
  gap: 6px;
}
.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Glass Card (Forms) ──────────────────────────────────── */
.glass-card {
  background: rgba(22,22,42,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.form-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
  transition: var(--transition);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
/* Remove number input arrows */
.form-input[type=number]::-webkit-inner-spin-button,
.form-input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
}

.form-select {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.form-select:focus { border-color: var(--accent); }
.form-select option { background: var(--bg-card); }

.add-btn {
  background: var(--grad-violet);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(139,92,246,0.4);
  white-space: nowrap;
}
.add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(139,92,246,0.5); }
.add-btn:active { transform: scale(0.97); }

/* ── List Items ──────────────────────────────────────────── */
.list-container { display: flex; flex-direction: column; gap: 8px; }

/* Task Item */
.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  animation: fadeSlideUp 0.3s ease both;
  position: relative;
  overflow: hidden;
}
.task-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.task-item.priority-high::before   { background: var(--danger); }
.task-item.priority-medium::before { background: var(--accent-3); }
.task-item.priority-low::before    { background: var(--accent-4); }

.task-item:hover { border-color: var(--border-glow); transform: translateX(2px); }

.task-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-glow);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  font-size: 11px;
  color: transparent;
}
.task-check:hover { border-color: var(--accent); background: var(--accent-glow); }
.task-item.done .task-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.task-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}
.task-item.done .task-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-delete, .habit-delete, .expense-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
  line-height: 1;
}
.task-delete:hover, .habit-delete:hover, .expense-delete:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
}

/* Habit Item */
.habit-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  animation: fadeSlideUp 0.3s ease both;
}
.habit-item:hover { border-color: var(--border-glow); }

.habit-toggle {
  width: 44px; height: 24px;
  border-radius: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: var(--transition);
}
.habit-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}
.habit-item.done .habit-toggle {
  background: var(--accent);
  border-color: var(--accent);
}
.habit-item.done .habit-toggle::after {
  transform: translateX(20px);
  background: #fff;
}

.habit-info { flex: 1; }
.habit-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.habit-item.done .habit-name { color: var(--text-muted); }
.habit-meta {
  display: flex; gap: 8px; align-items: center;
}
.habit-cat-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 50px;
  background: var(--accent-glow);
  color: var(--accent-light);
}
.habit-streak-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* Expense Item */
.expense-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  animation: fadeSlideUp 0.3s ease both;
}
.expense-item:hover { border-color: var(--border-glow); }

.expense-cat-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--bg-card2);
}

.expense-info { flex: 1; }
.expense-note-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.expense-cat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}
.expense-time {
  font-size: 10px;
  color: var(--text-muted);
}

.expense-amount-text {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-3);
}

/* ── Expense Summary Strip ───────────────────────────────── */
.expenses-summary-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.expenses-summary-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.cat-chip strong { color: var(--accent-3); }

/* ── Home Previews ───────────────────────────────────────── */
.home-tasks-preview, .home-habits-preview {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preview-task-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  animation: fadeSlideUp 0.3s ease both;
}
.preview-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.preview-habit-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  animation: fadeSlideUp 0.3s ease both;
}
.preview-streak {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-3);
}

/* Expense Chart placeholder */
.expense-donut-wrapper {
  margin-bottom: 24px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.expense-chart-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-card2);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.bar-label { min-width: 80px; }
.bar-amount { min-width: 50px; text-align: right; font-weight: 600; color: var(--accent-3); }

/* ── Bottom Nav ──────────────────────────────────────────── */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px 10px;
  border-radius: 0 0 48px 48px;
  z-index: 50;
}

.glass-nav {
  background: rgba(16,16,30,0.85);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}
.nav-btn:hover { background: var(--accent-glow); }
.nav-btn:active { transform: scale(0.93); }

.nav-icon { font-size: 20px; transition: var(--transition); }
.nav-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: var(--transition);
  text-transform: uppercase;
}

.nav-btn.active .nav-label { color: var(--accent-light); }
.nav-btn.active .nav-icon { transform: translateY(-2px); filter: drop-shadow(0 0 6px rgba(139,92,246,0.7)); }
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-preview {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.empty-list {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Priority Labels ─────────────────────────────────────── */
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.p-high   { background: var(--danger); }
.p-medium { background: var(--accent-3); }
.p-low    { background: var(--accent-4); }

/* ── Responsive (actual mobile) ──────────────────────────── */
@media (max-width: 440px) {
  .phone-shell {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    top: 0; left: 0;
    transform: none;
    position: fixed;
  }
  .phone-screen { border-radius: 0; }
  .desktop-hint { display: none; }
  .phone-notch { display: none; }
  .panel-scroll { padding-top: 28px; }
  .bottom-nav { border-radius: 0; }
}
