/* ============================================================
   style.css — TaskMaster (Mobile-First)

   KEY RULE: On mobile (< 768px), sidebar is HIDDEN.
   It slides in ONLY when hamburger is clicked.
   On desktop (≥ 1024px), sidebar is always visible.
   ============================================================ */

/* ─── 1. VARIABLES ─────────────────────────────────────── */
:root {
  --bg:       #0a0a0f;
  --surface:  #12121a;
  --surface2: #1c1c28;
  --surface3: #252535;
  --border:   rgba(255,255,255,0.08);
  --accent:   #7c5cfc;
  --accent2:  #fc5c7d;
  --accent3:  #5cf8c8;
  --gold:     #f5a623;
  --text:     #f0f0f5;
  --muted:    #7a7a90;
  --muted2:   #3a3a4a;
  --navbar-h: 62px;
  --sidebar-w: 280px;
  --bottom-nav-h: 70px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow: 0 24px 64px rgba(0,0,0,0.55);
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.35);

  /* Sidebar slide animation duration */
  --sidebar-dur: 0.38s;
  --sidebar-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ─── 2. RESET ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}
button { cursor: pointer; font-family: inherit; border: none; outline: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; border: none; }

/* ─── 3. BG MESH ────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%,  rgba(124,92,252,.20) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 100%, rgba(252,92,125,.14) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 60% 50%,  rgba(92,248,200,.07) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}

/* ─── 4. PAGE SYSTEM ────────────────────────────────────── */
.page { display: none; position: relative; z-index: 1; }
.page.active { display: flex; }

/* ─── 5. AUTH PAGE ──────────────────────────────────────── */
#auth-page {
  flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  align-items: stretch;
}

/* Left decorative panel — desktop only */
.auth-left { display: none; }

.auth-left-inner { position: relative; z-index: 1; padding: 48px; }

.auth-left-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  margin-bottom: 28px;
  box-shadow: 0 8px 32px rgba(124,92,252,.4);
}

.auth-left-title {
  font-family: 'Syne', sans-serif;
  font-size: 40px; font-weight: 800;
  line-height: 1.1; letter-spacing: -1px;
  margin-bottom: 16px;
}

.auth-left-sub {
  font-size: 16px; color: rgba(255,255,255,.6);
  line-height: 1.6; max-width: 300px;
  margin-bottom: 32px;
}

/* Floating preview cards */
.deco-card {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  animation: floatUp 3s ease-in-out infinite;
}
.deco-2 { animation-delay: .6s; margin-left: 20px; }
.deco-3 { animation-delay: 1.2s; margin-left: 10px; }

@keyframes floatUp {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

/* Stats row inside left panel */
.auth-left-stats {
  display: flex; gap: 24px; margin-top: 32px;
}
.al-stat { display: flex; flex-direction: column; gap: 4px; }
.al-num { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 28px; }
.al-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }

/* Right form panel */
.auth-right {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  min-height: 100vh; min-height: 100dvh;
  overflow-y: auto;
}

/* The form card */
.auth-box {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  box-shadow: var(--shadow);
  animation: slideUp .55s cubic-bezier(.22,1,.36,1) both;
}

/* Brand row */
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }

.brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 4px 16px rgba(124,92,252,.35);
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 22px; letter-spacing: -.5px;
}
.brand-accent { color: var(--accent); }

/* Headline */
.auth-headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 28px;
  letter-spacing: -.6px; margin-bottom: 6px;
}
.auth-sub { font-size: 16px; color: var(--muted); margin-bottom: 24px; font-weight: 300; }

/* Tabs */
.auth-tabs {
  display: flex; gap: 4px;
  background: var(--surface2);
  border-radius: var(--radius-md);
  padding: 4px; margin-bottom: 24px;
}
.tab-btn {
  flex: 1; height: 48px;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600; font-size: 15px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s;
}
.tab-btn.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(124,92,252,.4);
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* Form groups */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .9px;
  margin-bottom: 8px;
}
.form-group label i { font-size: 11px; }

/* Input and select shared styles */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 52px;
  color: var(--text);
  font-size: 16px; font-weight: 400;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.form-group textarea {
  height: auto; padding: 14px 16px;
  resize: none; line-height: 1.5;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,252,.18);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted2); font-size: 15px; }
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7a90' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.form-group select option { background: var(--surface); }

/* Password field with show/hide button */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 48px; }
.eye-btn {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: 16px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  transition: color .2s;
}
.eye-btn:hover { color: var(--accent); }

/* Two-column form row */
.form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* Forgot link */
.forgot-row { text-align: right; margin: -4px 0 16px; }
.forgot-link {
  font-size: 13px; color: var(--accent); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

/* Primary button */
.btn-primary {
  width: 100%; height: 54px;
  background: linear-gradient(135deg, var(--accent), #9b7dff);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s; margin-top: 8px;
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,.08));
  pointer-events: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(124,92,252,.5); }
.btn-primary:active { transform: translateY(0); }

/* Google button */
.btn-google {
  width: 100%; height: 52px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: all .2s;
}
.btn-google:hover { background: var(--surface2); border-color: rgba(255,255,255,.18); }
.google-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* Divider */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--muted); font-size: 13px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── 6. APP PAGE ──────────────────────────────────────── */
#app-page { flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ─── 7. NAVBAR ─────────────────────────────────────────── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--navbar-h);
  padding: 0 16px;
  background: rgba(10,10,15,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  flex-shrink: 0;
}
.nav-left { display: flex; align-items: center; gap: 10px; }
.nav-brand {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; gap: 8px;
}
.nav-brand .dot { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 6px; }

/* Icon buttons in navbar */
.nav-icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; position: relative;
}
.nav-icon-btn:hover { background: var(--surface2); color: var(--text); }

/* Notification red dot */
.notif-dot {
  width: 8px; height: 8px;
  background: var(--accent2);
  border-radius: 50%;
  position: absolute; top: 7px; right: 7px;
  border: 2px solid var(--bg);
  display: none;
}
.notif-dot.show { display: block; }

/* Avatar */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  flex-shrink: 0;
}
.avatar:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(124,92,252,.4); }

/* User dropdown menu */
.user-menu {
  position: absolute;
  top: calc(var(--navbar-h) + 4px);
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 220px;
  box-shadow: var(--shadow);
  z-index: 300;
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.user-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

.user-menu-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 14px;
}
.user-menu-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.user-menu-name { font-weight: 600; font-size: 15px; }
.user-menu-email { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  font-size: 15px; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.user-menu-item:hover { background: var(--surface2); color: var(--accent2); }

/* ─── 8. SEARCH BAR ─────────────────────────────────────── */
.search-bar-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s cubic-bezier(.22,1,.36,1), padding .3s;
  background: var(--surface);
  border-bottom: 1px solid transparent;
  z-index: 190;
}
.search-bar-wrap.open {
  max-height: 72px;
  padding: 10px 16px;
  border-bottom-color: var(--border);
}
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 48px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-icon { color: var(--muted); font-size: 15px; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none;
  color: var(--text); font-size: 16px;
  border: none; outline: none;
  height: 100%;
}
.search-bar input::placeholder { color: var(--muted2); }
.search-close {
  color: var(--muted); font-size: 16px;
  background: none; border: none; cursor: pointer; padding: 4px;
  transition: color .2s;
}
.search-close:hover { color: var(--text); }

/* ─── 9. HAMBURGER ──────────────────────────────────────── */
/* Visible on mobile/tablet (< 1024px), hidden on desktop */
.hamburger {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  transition: background .2s, color .2s, transform .15s;
}
.hamburger:hover { background: var(--surface3); }
.hamburger:active { transform: scale(.92); }
/* Hamburger icon rotation when sidebar open */
.hamburger.sidebar-open { background: rgba(124,92,252,.15); color: var(--accent); border-color: rgba(124,92,252,.3); }

/* ─── 10. SIDEBAR OVERLAY ───────────────────────────────── */
/* Dark backdrop — covers content behind open sidebar on mobile */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(3px);
  z-index: 299;
  opacity: 0; visibility: hidden;
  transition: opacity var(--sidebar-dur), visibility var(--sidebar-dur);
}
.sidebar-overlay.visible { opacity: 1; visibility: visible; }

/* ─── 11. APP LAYOUT ────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 1fr;   /* Mobile: full width — sidebar is overlay */
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ─── 12. SIDEBAR ───────────────────────────────────────── */
/*
   MOBILE (default): sidebar is position:fixed, off-screen left.
   translateX(-110%) hides it completely.
   When .open is added by JS, it slides in with smooth animation.

   DESKTOP (≥1024px): sidebar is position:static, always visible.
*/
.sidebar {
  /* Fixed, off-screen by default on mobile */
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100%;
  z-index: 300;

  background: var(--surface);
  border-right: 1px solid var(--border);

  /* Start fully hidden off the left edge */
  transform: translateX(-110%);
  /* Smooth spring-like slide animation */
  transition:
    transform var(--sidebar-dur) var(--sidebar-ease),
    box-shadow var(--sidebar-dur);

  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 12px 32px;

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--muted2) transparent;
}

/* When JS adds .open — slides in */
.sidebar.open {
  transform: translateX(0);
  box-shadow: 8px 0 48px rgba(0,0,0,.6);
}

/* Close X button at top of sidebar (mobile only) */
.sidebar-close-btn {
  position: sticky; top: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface2); color: var(--muted);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  margin: 14px 4px 8px auto;
  z-index: 1; flex-shrink: 0;
}
.sidebar-close-btn:hover { background: rgba(252,92,125,.15); color: var(--accent2); }

/* Sidebar brand (mobile) */
.sidebar-brand {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 20px;
  color: var(--text);
}
.sidebar-brand i { color: var(--accent); }
.sidebar-brand span { color: var(--accent); }

/* Sidebar section */
.sidebar-section { margin-bottom: 24px; }

.sidebar-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.3px; color: var(--muted);
  padding: 0 12px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 7px;
}
.sidebar-label i { font-size: 10px; }

/* Each nav item */
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 12px;
  border-radius: var(--radius-md);
  cursor: pointer; color: var(--muted);
  font-size: 16px; font-weight: 400;
  margin-bottom: 2px;
  transition: background .18s, color .18s, transform .15s;
  min-height: 50px;
  /* Stagger animation when sidebar slides in */
  opacity: 0; transform: translateX(-10px);
  animation: none;
}

/* When sidebar is open, animate items in */
.sidebar.open .sidebar-item {
  animation: sidebarItemIn .3s forwards;
}
.sidebar.open .sidebar-item:nth-child(1) { animation-delay: .05s; }
.sidebar.open .sidebar-item:nth-child(2) { animation-delay: .09s; }
.sidebar.open .sidebar-item:nth-child(3) { animation-delay: .13s; }
.sidebar.open .sidebar-item:nth-child(4) { animation-delay: .17s; }
.sidebar.open .sidebar-item:nth-child(5) { animation-delay: .21s; }
.sidebar.open .sidebar-item:nth-child(6) { animation-delay: .25s; }
.sidebar.open .sidebar-item:nth-child(7) { animation-delay: .29s; }

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

.sidebar-item:hover { background: var(--surface2); color: var(--text); transform: translateX(3px); }
.sidebar-item.active { background: rgba(124,92,252,.15); color: var(--accent); font-weight: 600; }
.sidebar-item.active .s-icon { color: var(--accent); }

.s-icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.s-text { flex: 1; }

/* Badge */
.badge {
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
  min-width: 26px; text-align: center;
}

/* Quick stats row inside sidebar */
.sidebar-stats {
  display: flex; gap: 6px;
  background: var(--surface2);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  margin: 8px 0;
}
.sidebar-stat {
  flex: 1; text-align: center;
  display: flex; flex-direction: column; gap: 3px;
}
.ss-num { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px; }
.ss-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }

/* Progress bar in sidebar */
.sidebar-progress {
  background: var(--surface2); border-radius: var(--radius-md);
  padding: 14px; margin-top: 8px;
}
.sp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sp-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.sp-pct { font-size: 13px; font-weight: 700; color: var(--accent); }
.sp-bar { height: 6px; background: var(--muted2); border-radius: 3px; overflow: hidden; }
.sp-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  transition: width .6s cubic-bezier(.22,1,.36,1);
}

/* ─── 13. MAIN CONTENT ──────────────────────────────────── */
.main-content {
  padding: 20px 16px calc(var(--bottom-nav-h) + 20px + env(safe-area-inset-bottom));
  overflow-y: auto; min-height: 0;
}

/* Content header */
.content-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.page-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 26px; letter-spacing: -.6px; line-height: 1.1;
}
.page-date { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Add Task button (desktop only) */
.add-task-btn {
  display: none;   /* Hidden on mobile — FAB replaces it */
  align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), #9b7dff);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 14px;
  white-space: nowrap; transition: all .2s;
}
.add-task-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,92,252,.4); }

/* ─── 14. STATS CARDS ───────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 12px;
  text-align: center; position: relative; overflow: hidden;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-purple::before { background: var(--accent); }
.stat-teal::before   { background: var(--accent3); }
.stat-pink::before   { background: var(--accent2); }

.stat-icon { font-size: 18px; color: var(--muted); margin-bottom: 8px; }
.stat-purple .stat-icon { color: var(--accent); }
.stat-teal   .stat-icon { color: var(--accent3); }
.stat-pink   .stat-icon { color: var(--accent2); }

.stat-num {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 26px; line-height: 1; margin-bottom: 4px;
}
.stat-label { font-size: 11px; color: var(--muted); font-weight: 500; }

/* ─── 15. PROGRESS BAR ──────────────────────────────────── */
.progress-section {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.progress-bar {
  flex: 1; height: 6px; background: var(--muted2);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 3px;
  transition: width .7s cubic-bezier(.22,1,.36,1);
}
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 500; }

/* ─── 16. FILTER + SORT ROW ─────────────────────────────── */
.filter-sort-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  height: 38px; padding: 0 14px;
  border-radius: 19px;
  border: 1.5px solid var(--border);
  background: transparent; color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.filter-chip.active {
  background: rgba(124,92,252,.15);
  border-color: var(--accent); color: var(--accent); font-weight: 600;
}
.filter-chip:hover:not(.active) { border-color: rgba(255,255,255,.2); color: var(--text); }

/* Sort dropdown */
.sort-wrap select {
  height: 38px; padding: 0 32px 0 12px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13px;
  cursor: pointer; min-width: 120px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7a90' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  -webkit-appearance: none; appearance: none;
}
.sort-wrap select:focus { border-color: var(--accent); outline: none; }

/* ─── 17. TASK LIST ─────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 10px; }

/* Task card */
.task-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  transition: border-color .2s, background .2s, transform .2s;
  animation: fadeIn .3s ease both;
  cursor: default;
}
.task-item:hover {
  border-color: rgba(255,255,255,.14);
  background: var(--surface2);
  transform: translateY(-1px);
}

/* Checkbox */
.task-check {
  width: 26px; height: 26px; min-width: 26px;
  border-radius: 50%;
  border: 2px solid var(--muted2);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; margin-top: 1px;
}
.task-check:hover { border-color: var(--accent); background: rgba(124,92,252,.1); }
.task-check.done { background: var(--accent); border-color: var(--accent); }
.task-check.done::after { content: ''; }
.task-check.done i { color: #fff; font-size: 12px; }

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

/* Task title */
.task-title {
  font-size: 16px; font-weight: 500;
  margin-bottom: 6px; line-height: 1.3;
  word-break: break-word; transition: color .2s;
}
.task-item.done .task-title { text-decoration: line-through; color: var(--muted); }

/* Meta row */
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.priority-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.priority-pill.high   { background: rgba(252,92,125,.14); color: var(--accent2); }
.priority-pill.medium { background: rgba(245,166,35,.14);  color: var(--gold); }
.priority-pill.low    { background: rgba(92,248,200,.14);  color: var(--accent3); }

.task-tag {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  background: rgba(124,92,252,.12); color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
}
.task-due {
  font-size: 11px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 5px;
}
.task-due.overdue { color: var(--accent2); }

/* Notes preview */
.task-notes-preview {
  font-size: 13px; color: var(--muted);
  margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Action buttons */
.task-actions {
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0;
}
.task-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.task-btn:hover { background: var(--surface3); }
.task-btn.edit:hover { color: var(--accent); background: rgba(124,92,252,.12); }
.task-btn.del:hover  { color: var(--accent2); background: rgba(252,92,125,.12); }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.empty-emoji { font-size: 52px; display: block; margin-bottom: 16px; }
.empty-state h3 {
  font-family: 'Syne', sans-serif; font-size: 22px; color: var(--text);
  margin-bottom: 8px;
}
.empty-state p { font-size: 15px; }

/* ─── 18. MOBILE BOTTOM NAV ─────────────────────────────── */
/* Shown below 1024px, hidden on desktop */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(18,18,26,.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; flex: 1; height: 100%;
  cursor: pointer; color: var(--muted);
  transition: color .15s;
  min-height: 44px; padding: 4px 2px;
}
.bnav-item.active { color: var(--accent); }
.bnav-item:active { opacity: .7; }
.bnav-icon { font-size: 20px; }
.bnav-label { font-size: 10px; font-weight: 600; letter-spacing: .2px; }

/* Centre FAB */
.bnav-fab {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), #9b7dff);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  cursor: pointer; flex-shrink: 0;
  margin-bottom: 12px;
  box-shadow: 0 4px 24px rgba(124,92,252,.6);
  transition: all .2s;
}
.bnav-fab:hover { transform: scale(1.08); box-shadow: 0 6px 32px rgba(124,92,252,.7); }
.bnav-fab:active { transform: scale(.92); }

/* ─── 19. MODAL ─────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  z-index: 400;
  align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  width: 100%; max-width: 100%;
  animation: slideUpModal .35s cubic-bezier(.22,1,.36,1) both;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px;
  display: flex; align-items: center; gap: 10px;
}
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); color: var(--muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { color: var(--accent2); background: rgba(252,92,125,.12); }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-cancel {
  flex: 1; height: 50px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--muted);
  font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .15s;
}
.btn-cancel:hover { color: var(--text); }
.btn-save {
  flex: 2; height: 50px;
  background: linear-gradient(135deg, var(--accent), #9b7dff);
  border-radius: var(--radius-md); color: #fff;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .2s;
}
.btn-save:hover { box-shadow: 0 6px 24px rgba(124,92,252,.45); }

/* ─── 20. TOAST ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom));
  left: 16px; right: 16px;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 15px; font-weight: 500;
  z-index: 999;
  display: flex; align-items: center; gap: 10px;
  transform: translateY(20px); opacity: 0;
  transition: all .3s cubic-bezier(.22,1,.36,1);
  box-shadow: var(--shadow-sm);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ─── 21. ANIMATIONS ────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 22. TABLET 768px+ ─────────────────────────────────── */
@media (min-width: 768px) {
  .auth-box { padding: 44px 36px; }
  .auth-headline { font-size: 32px; }

  /* Modal: centred, not full-width sheet */
  .modal-overlay { align-items: center; padding: 24px; }
  .modal {
    border-radius: var(--radius-xl);
    max-width: 520px;
    padding: 32px;
  }

  .toast { left: auto; right: 24px; bottom: calc(var(--bottom-nav-h) + 16px); max-width: 340px; }

  .page-title { font-size: 28px; }
  .add-task-btn { display: flex; }

  .stats-row { gap: 14px; }
  .stat-num { font-size: 30px; }
  .stat-card { padding: 20px 16px; }
}

/* ─── 23. DESKTOP 1024px+ ───────────────────────────────── */
@media (min-width: 1024px) {
  /* Auth: two columns */
  #auth-page { flex-direction: row; }
  .auth-left {
    display: flex; flex: 1;
    align-items: center; justify-content: center;
    background: linear-gradient(160deg, rgba(124,92,252,.18) 0%, rgba(252,92,125,.08) 100%);
    border-right: 1px solid var(--border);
    padding: var(--space-xl);
    min-height: 100vh;
  }
  .auth-right { width: 520px; flex: none; border-left: 1px solid var(--border); }

  /* Hide hamburger — sidebar always shown */
  .hamburger { display: none; }

  /* Hide sidebar overlay — not needed on desktop */
  .sidebar-overlay { display: none !important; }

  /* Sidebar: normal document flow, always visible */
  .sidebar {
    position: sticky;
    top: var(--navbar-h);
    height: calc(100vh - var(--navbar-h));
    transform: none !important; /* Never slide */
    box-shadow: none;
    background: rgba(18,18,26,.6);
    border-right: 1px solid var(--border);
  }

  /* Sidebar items don't need animation on desktop — just show them */
  .sidebar-item {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  /* Hide close button (no drawer to close on desktop) */
  .sidebar-close-btn { display: none; }

  /* Hide sidebar-brand (main navbar has branding) */
  .sidebar-brand { display: none; }

  /* Two-column grid */
  .app-layout { grid-template-columns: var(--sidebar-w) 1fr; }

  /* Hide bottom nav */
  .bottom-nav { display: none; }

  /* No bottom padding offset needed */
  .main-content {
    padding: 28px 28px;
    height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
  }

  /* Toast: bottom right, no nav offset */
  .toast { bottom: 24px; right: 24px; left: auto; max-width: 340px; }
}

/* ─── 24. LARGE DESKTOP 1280px+ ─────────────────────────── */
@media (min-width: 1280px) {
  :root { --sidebar-w: 300px; }
  .page-title { font-size: 30px; }
  .stat-num { font-size: 36px; }
  .main-content { padding: 32px 36px; }
}

/* ─── 25. VERY SMALL PHONES ≤ 360px ────────────────────── */
@media (max-width: 360px) {
  .auth-box { padding: 28px 16px; }
  .auth-headline { font-size: 24px; }
  .stat-num { font-size: 22px; }
  .stat-card { padding: 14px 10px; }
  .bnav-icon { font-size: 18px; }
  .bnav-label { font-size: 9px; }
  .bnav-fab { width: 50px; height: 50px; font-size: 20px; }
}
