:root {
  --sky: #38BDF8;
  --sky-light: #E0F2FE;
  --sky-dark: #0EA5E9;
  --blue: #1E40AF;
  --violet: #7C3AED;
  --violet-light: #EDE9FE;
  --violet-mid: #6D28D9;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --orange: #F97316;
  --orange-light: #FFF7ED;
  --green: #22C55E;
  --green-light: #DCFCE7;
  --green-dark: #166534;
  --white: #FFFFFF;
  --surface: #F8FAFC;
  --surface2: #F1F5F9;
  --sidebar-bg: #EFF6FF;
  --sidebar-bd: #BFDBFE;
  --slate: #1E293B;
  --slate2: #334155;
  --muted: #64748B;
  --muted2: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  font-size: 13px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

/* ── Dark mode ─────────────────────────────── */
body.dark-mode {
  --surface: #0F172A;
  --surface2: #1E293B;
  --sidebar-bg: #1E293B;
  --sidebar-bd: #334155;
  --slate: #F1F5F9;
  --slate2: #CBD5E1;
  --muted: #94A3B8;
  --muted2: #64748B;
  --border: #334155;
  --border-light: #1E293B;
  --white: #0F172A;
  background: #0F172A;
  color: #F1F5F9;
}
body.dark-mode .modal,
body.dark-mode .topbar,
body.dark-mode .detail-panel,
body.dark-mode .task-item,
body.dark-mode .kanban-card,
body.dark-mode .habit-card,
body.dark-mode .matrix-quadrant,
body.dark-mode .auth-card {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}
body.dark-mode input:not([type=checkbox]):not([type=range]),
body.dark-mode select,
body.dark-mode textarea {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}
body.dark-mode .sb-head,
body.dark-mode .profile-dropdown,
body.dark-mode .assignee-dropdown,
body.dark-mode [id^="assignee-dropdown"],
body.dark-mode [id^="det-assignee-dd"] {
  background: #1E293B !important;
  border-color: #334155 !important;
}
body.dark-mode .view-panel,
body.dark-mode .content-area,
body.dark-mode .task-panel { background: #0F172A !important; }
body.dark-mode .kanban-col { background: #1E293B; border-color: #334155; }
body.dark-mode .section-header .section-line { background: #334155; }
body.dark-mode .free-banner { background: #1E293B; border-color: #334155; }

/* ── Skeleton loader ────────────────────────── */
@keyframes skeleton-pulse {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}
.skeleton-row { display:flex; align-items:center; gap:10px; padding:10px 14px; }
.skeleton-check { width:18px; height:18px; border-radius:50%; background:#CBD5E1; flex-shrink:0; animation:skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-lines { flex:1; display:flex; flex-direction:column; gap:6px; }
.skeleton-line { height:10px; border-radius:6px; background:#CBD5E1; animation:skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-line.short { width:40%; animation-delay:.2s; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--surface);
  color: var(--slate);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── LAYOUT ── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-bd);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s ease;
}
.sidebar.collapsed { width: 52px; min-width: 52px; }
.sidebar.collapsed .sb-label,
.sidebar.collapsed .sb-text,
.sidebar.collapsed .sb-badge,
.sidebar.collapsed .ai-badge,
.sidebar.collapsed .sb-section-title,
.sidebar.collapsed .sb-bottom-text { display: none; }
.sidebar.collapsed .sb-item { justify-content: center; padding: 8px; }
.sidebar.collapsed .logo-text { display: none; }

.sb-head {
  padding: 16px 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--sidebar-bd);
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--sky);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark i { color: white; font-size: 17px; }
.logo-text { font-size: 16px; font-weight: 600; color: var(--slate); letter-spacing: -.4px; white-space: nowrap; }
.free-pill {
  font-size: 9px; font-weight: 600;
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid #BBF7D0;
  padding: 2px 6px; border-radius: 20px;
  white-space: nowrap;
}

.sb-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 0; }
.sb-scroll::-webkit-scrollbar { width: 4px; }
.sb-scroll::-webkit-scrollbar-thumb { background: var(--sidebar-bd); border-radius: 4px; }

.sb-section { margin-bottom: 4px; }
.sb-section-title {
  font-size: 10px; font-weight: 600; color: var(--muted2);
  text-transform: uppercase; letter-spacing: .8px;
  padding: 8px 8px 4px;
}
.sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px;
  cursor: pointer; color: var(--muted);
  transition: background .12s, color .12s;
  font-size: 13px; font-weight: 400;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.sb-item:hover { background: #DBEAFE; color: var(--slate); }
.sb-item.active { background: var(--sky); color: white; font-weight: 500; }
.sb-item i { font-size: 16px; min-width: 16px; flex-shrink: 0; }
.sb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-badge {
  background: #BFDBFE; color: var(--blue);
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 20px;
  min-width: 20px; text-align: center; flex-shrink: 0;
}
.sb-item.active .sb-badge { background: rgba(255,255,255,.3); color: white; }
.ai-badge {
  background: var(--violet-light); color: var(--violet-mid);
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 20px; flex-shrink: 0;
}
.sb-divider { height: 1px; background: var(--sidebar-bd); margin: 8px 8px; }

.sb-bottom {
  padding: 8px;
  border-top: 1px solid var(--sidebar-bd);
}
.tip-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
  color: var(--muted); font-size: 12px; transition: background .12s;
}
.tip-item:hover { background: #FEF2F2; color: #B91C1C; }
.tip-item i { color: #F87171; font-size: 15px; }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── TOPBAR ── */
.topbar {
  height: 54px; flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
}
.topbar-toggle {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; cursor: pointer; color: var(--muted);
  transition: background .12s;
}
.topbar-toggle:hover { background: var(--surface2); }
.page-title { font-size: 17px; font-weight: 600; color: var(--slate); flex: 1; letter-spacing: -.3px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.search-box {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 11px;
  color: var(--muted); font-size: 12px; cursor: text; width: 180px;
  transition: border-color .15s;
}
.search-box:hover { border-color: var(--sky); }
.search-box input { border: none; background: transparent; outline: none; width: 100%; font-size: 12px; color: var(--slate); font-family: inherit; }
.search-box input::placeholder { color: var(--muted2); }
.kbd {
  display: inline-flex; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-size: 10px; color: var(--muted2);
  font-family: 'DM Mono', monospace;
}
.btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all .15s; font-family: inherit;
}
.btn-primary { background: var(--sky); color: white; }
.btn-primary:hover { background: var(--sky-dark); }
.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--muted); cursor: pointer; background: white;
  transition: all .12s;
}
.btn-icon:hover { background: var(--surface2); border-color: var(--sky); color: var(--sky); }

/* ── VIEW TABS ── */
.view-tabs {
  display: flex; gap: 2px; padding: 0 20px;
  background: var(--white); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.view-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent;
  transition: all .15s; white-space: nowrap;
}
.view-tab:hover { color: var(--slate); }
.view-tab.active { color: var(--sky); border-bottom-color: var(--sky); }
.view-tab i { font-size: 15px; }

/* ── CONTENT AREA ── */
.content-area { flex: 1; display: flex; overflow: hidden; }

/* ── TASK PANEL ── */
.task-panel { flex: 1; overflow-y: auto; padding: 20px; min-width: 0; }
.task-panel::-webkit-scrollbar { width: 5px; }
.task-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* free banner */
.free-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--green-light); border: 1px solid #BBF7D0;
  border-radius: 10px; padding: 11px 15px; margin-bottom: 18px;
  animation: slideDown .3s ease;
}
.free-banner i { color: #16A34A; font-size: 20px; flex-shrink: 0; }
.free-banner-text { font-size: 12px; color: #166534; line-height: 1.5; flex: 1; }
.free-banner-text strong { font-weight: 600; }
.free-banner-close { color: #16A34A; cursor: pointer; font-size: 16px; opacity: .6; }
.free-banner-close:hover { opacity: 1; }

/* add task input */
.add-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1.5px dashed var(--border);
  border-radius: 10px; margin-bottom: 18px; cursor: text;
  transition: border-color .15s; background: white;
}
.add-task-row:hover { border-color: var(--sky); }
.add-task-row input {
  flex: 1; border: none; outline: none; font-size: 13px;
  color: var(--slate); font-family: inherit; background: transparent;
}
.add-task-row input::placeholder { color: var(--muted2); }
.ai-parse-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; background: var(--violet-light);
  color: var(--violet-mid); border: none; border-radius: 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.ai-parse-btn:hover { background: #DDD6FE; }
.ai-parse-btn i { font-size: 13px; }

/* section */
.section-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; margin-top: 4px;
}
.section-label {
  font-size: 11px; font-weight: 600; color: var(--muted2);
  text-transform: uppercase; letter-spacing: .7px;
}
.section-label.overdue { color: var(--red); }
.section-count {
  font-size: 11px; color: var(--muted2);
  background: var(--surface2); padding: 1px 7px; border-radius: 20px;
}
.section-line { flex: 1; height: 1px; background: var(--border-light); }

/* task item */
.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 13px; border-radius: 10px; margin-bottom: 4px;
  border: 1px solid var(--border); background: var(--white);
  cursor: pointer; transition: all .15s; position: relative;
}
.task-item:hover { border-color: #7DD3FC; box-shadow: 0 2px 8px rgba(56,189,248,.1); }
.task-item.selected { border-color: var(--sky); background: #F0F9FF; }
.task-item.completed { opacity: .6; }

.task-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0; cursor: pointer; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.task-check:hover { border-color: var(--sky); background: var(--sky-light); }
.task-check.done { background: var(--sky); border-color: var(--sky); }
.task-check.done i { color: white; font-size: 11px; }

.pdot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.pdot.p1 { background: var(--red); }
.pdot.p2 { background: var(--orange); }
.pdot.p3 { background: var(--sky); }
.pdot.p4 { background: var(--muted2); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13px; color: var(--slate); line-height: 1.4; }
.task-title.done { text-decoration: line-through; color: var(--muted2); }
.task-meta { display: flex; align-items: center; gap: 7px; margin-top: 4px; flex-wrap: wrap; }
.task-time { font-size: 11px; color: var(--muted2); display: flex; align-items: center; gap: 3px; }
.task-time i { font-size: 11px; }
.tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
}
.tag-work { background: #EFF6FF; color: #1D4ED8; }
.tag-home { background: var(--orange-light); color: #C2410C; }
.tag-family { background: #FDF4FF; color: #6B21A8; }
.tag-health { background: #F0FDF4; color: #166534; }
.tag-personal { background: #F8F4FF; color: #5B21B6; }

.task-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-top: 1px; }
.overdue-badge { font-size: 10px; color: var(--red); font-weight: 600; }
.ai-generated-badge {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--violet-mid); font-weight: 600;
  background: var(--violet-light); padding: 2px 7px; border-radius: 4px;
}
.ai-generated-badge i { font-size: 11px; }

.prio-badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
}
.prio-p1 { background: var(--red-light); color: #B91C1C; }
.prio-p2 { background: #FEF3C7; color: #92400E; }
.prio-p3 { background: #EFF6FF; color: #1D4ED8; }
.prio-p4 { background: var(--surface2); color: var(--muted); }

/* ── DETAIL PANEL ── */
.detail-panel {
  width: 300px; min-width: 300px;
  border-left: 1px solid var(--border);
  background: var(--white);
  display: flex; flex-direction: column;
  overflow: hidden; transition: width .25s;
}
.detail-panel.collapsed { width: 0; min-width: 0; overflow: hidden; }

.detail-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.detail-list-label {
  font-size: 11px; color: var(--muted2); margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.detail-title-input {
  font-size: 15px; font-weight: 600; color: var(--slate);
  border: none; outline: none; width: 100%;
  font-family: inherit; line-height: 1.4;
  background: transparent;
}
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.detail-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.detail-body::-webkit-scrollbar { width: 4px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.detail-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border-light);
  font-size: 12px; color: var(--muted);
}
.detail-row:last-of-type { border-bottom: none; }
.detail-row i { font-size: 15px; min-width: 16px; color: var(--muted2); }
.detail-val { color: var(--slate); }
.detail-val.blue { color: var(--sky-dark); }

.subtasks-section { margin-top: 14px; }
.subtasks-title {
  font-size: 11px; font-weight: 600; color: var(--muted2);
  text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px;
}
.subtask-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border-light);
  font-size: 12px; color: var(--slate);
}
.subtask-item:last-child { border-bottom: none; }
.subtask-check {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .12s;
}
.subtask-check:hover { border-color: var(--sky); }
.subtask-check.done { background: var(--sky); border-color: var(--sky); }
.subtask-check.done i { color: white; font-size: 9px; }
.subtask-text.done { text-decoration: line-through; color: var(--muted2); }

/* AI inline panel */
.ai-inline-panel {
  background: #F5F3FF; border: 1px solid #DDD6FE;
  border-radius: 10px; padding: 13px; margin-top: 14px;
}
.ai-inline-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.ai-inline-icon {
  width: 24px; height: 24px; background: var(--violet);
  border-radius: 7px; display: flex; align-items: center; justify-content: center;
}
.ai-inline-icon i { color: white; font-size: 13px; }
.ai-inline-title { font-size: 12px; font-weight: 600; color: #5B21B6; flex: 1; }
.ai-free-tag {
  font-size: 9px; font-weight: 700; background: var(--green-light);
  color: var(--green-dark); padding: 2px 5px; border-radius: 3px;
}
.ai-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; background: white; border: 1px solid #DDD6FE;
  border-radius: 8px; font-size: 12px; color: #5B21B6;
  cursor: pointer; margin-bottom: 6px; transition: all .12s;
}
.ai-chip:last-child { margin-bottom: 0; }
.ai-chip:hover { background: var(--violet-light); border-color: #C4B5FD; }
.ai-chip i { font-size: 13px; color: var(--violet); }

/* keyboard shortcuts */
.kbd-section { margin-top: 14px; padding: 12px; background: var(--surface); border-radius: 8px; }
.kbd-section-title { font-size: 11px; font-weight: 600; color: var(--muted2); margin-bottom: 8px; }
.kbd-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted); padding: 3px 0;
}

/* ── VIEWS ── */
.view-panel { flex: 1; overflow: auto; }
.view-panel::-webkit-scrollbar { width: 5px; height: 5px; }
.view-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Calendar view */
.calendar-view { padding: 20px; }
.cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cal-nav button:hover { border-color: var(--sky); color: var(--sky); }
.cal-month-title { font-size: 18px; font-weight: 600; color: var(--slate); }
.cal-today-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 7px; background: white; cursor: pointer; font-size: 12px; color: var(--muted); font-family: inherit; }
.cal-today-btn:hover { border-color: var(--sky); color: var(--sky); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--border); border-radius: 10px; overflow: hidden; }
.cal-day-header { background: var(--surface); padding: 8px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; }
.cal-day {
  background: white; padding: 8px; min-height: 90px;
  cursor: pointer; transition: background .12s; position: relative;
}
.cal-day:hover { background: var(--sky-light); }
.cal-day.other-month { background: var(--surface); }
.cal-day.today { background: #F0F9FF; }
.cal-day-num {
  font-size: 13px; font-weight: 500; color: var(--muted);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 4px;
}
.cal-day.today .cal-day-num { background: var(--sky); color: white; }
.cal-day.other-month .cal-day-num { color: var(--muted2); opacity: .4; }
.cal-event {
  font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 3px;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event.work { background: #EFF6FF; color: #1D4ED8; }
.cal-event.family { background: #FDF4FF; color: #6B21A8; }
.cal-event.health { background: #F0FDF4; color: #166534; }
.cal-event.home { background: var(--orange-light); color: #C2410C; }

/* Kanban view */
.kanban-view { padding: 20px; display: flex; gap: 16px; overflow-x: auto; min-height: 100%; }
.kanban-col {
  min-width: 260px; width: 260px; flex-shrink: 0;
  background: var(--surface); border-radius: 12px;
  display: flex; flex-direction: column;
}
.kanban-col-header {
  padding: 12px 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.kanban-col-dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-title { font-size: 13px; font-weight: 600; color: var(--slate); flex: 1; }
.kanban-col-count { font-size: 11px; color: var(--muted2); background: white; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border); }
.kanban-cards { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban-card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; cursor: pointer; transition: all .15s;
}
.kanban-card:hover { border-color: var(--sky); box-shadow: var(--shadow); }
.kanban-card-title { font-size: 13px; color: var(--slate); margin-bottom: 8px; line-height: 1.4; }
.kanban-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-card.dragging { opacity: 0.35; transform: rotate(2deg); }
.kanban-cards.drag-over { background: #EFF6FF; outline: 2px dashed var(--sky); border-radius: 8px; }
.kanban-add-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  color: var(--muted2); font-size: 12px; cursor: pointer; border-radius: 0 0 12px 12px;
  transition: background .12s;
}
.kanban-add-btn:hover { background: #DBEAFE; color: var(--sky); }

/* Priority Matrix */
.matrix-view { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; min-height: 100%; }
.matrix-quadrant { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; overflow: hidden; }
.matrix-quadrant-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.matrix-quadrant-dot { width: 8px; height: 8px; border-radius: 50%; }
.matrix-quadrant-title { font-size: 12px; font-weight: 700; color: var(--slate); }
.matrix-quadrant-sub { font-size: 10px; color: var(--muted2); margin-left: auto; }
.matrix-task { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; cursor: pointer; }
.matrix-task:last-child { border-bottom: none; }
.matrix-task:hover { color: var(--sky-dark); }
.matrix-check { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border); flex-shrink: 0; }

/* Habits view */
.habits-view { padding: 20px; }
.habits-header { margin-bottom: 20px; }
.habits-title { font-size: 18px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
.habits-sub { font-size: 13px; color: var(--muted); }
.habits-grid { display: flex; flex-direction: column; gap: 12px; }
.habit-card {
  background: white; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.habit-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.habit-icon i { font-size: 18px; }
.habit-info { flex: 1; }
.habit-name { font-size: 14px; font-weight: 500; color: var(--slate); }
.habit-streak { font-size: 11px; color: var(--muted); margin-top: 2px; }
.habit-days { display: flex; gap: 5px; }
.habit-day { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; }
.habit-day.done { background: var(--sky); color: white; }
.habit-day.missed { background: var(--surface2); color: var(--muted2); }
.habit-day.today-day { background: var(--green-light); color: var(--green-dark); border: 1.5px solid var(--green); }

/* AI View */
.ai-view { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ai-view-header { margin-bottom: 4px; }
.ai-view-title { font-size: 18px; font-weight: 600; color: var(--slate); display: flex; align-items: center; gap: 8px; }
.ai-view-title i { color: var(--violet); }
.ai-view-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ai-feature-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; transition: border-color .15s;
}
.ai-feature-card:hover { border-color: #C4B5FD; }
.ai-feature-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ai-feature-icon { width: 32px; height: 32px; background: var(--violet); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-feature-icon i { color: white; font-size: 17px; }
.ai-feature-title { font-size: 14px; font-weight: 600; color: var(--slate); flex: 1; }
.ai-feature-free { font-size: 9px; font-weight: 700; background: var(--green-light); color: var(--green-dark); padding: 2px 6px; border-radius: 3px; }
.ai-textarea {
  width: 100%; border: 1px solid #DDD6FE; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--slate);
  font-family: inherit; resize: none; background: #FAFAFA;
  line-height: 1.5; transition: border-color .15s;
}
.ai-textarea:focus { outline: none; border-color: var(--violet); background: white; }
.ai-row { display: flex; gap: 10px; align-items: flex-start; }
.ai-suggestions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ai-suggestion-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; background: var(--violet-light); border: 1px solid #DDD6FE;
  border-radius: 20px; font-size: 11px; color: var(--violet-mid); font-weight: 500;
  cursor: pointer; transition: all .12s;
}
.ai-suggestion-chip:hover { background: #DDD6FE; }
.ai-submit-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: var(--violet); color: white;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.ai-submit-btn:hover { background: var(--violet-mid); }
.ai-submit-btn:disabled { background: #C4B5FD; cursor: not-allowed; }
.ai-result {
  margin-top: 12px; background: #FAFAFA; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.ai-result-header {
  padding: 9px 13px; background: var(--violet-light); border-bottom: 1px solid #DDD6FE;
  font-size: 11px; font-weight: 600; color: var(--violet-mid);
  display: flex; align-items: center; gap: 6px;
}
.ai-result-body { padding: 12px 13px; }
.result-task-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border-light);
  font-size: 12px; color: var(--slate);
}
.result-task-row:last-child { border-bottom: none; }
.result-check { width: 14px; height: 14px; border: 1.5px solid var(--border); border-radius: 3px; flex-shrink: 0; margin-top: 1px; }
.result-task-body { flex: 1; }
.result-task-meta { font-size: 10px; color: var(--muted2); margin-top: 2px; display: flex; gap: 8px; }
.result-time-block { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.result-time-block:last-child { border-bottom: none; }
.time-pill { background: #EFF6FF; color: #1D4ED8; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px; min-width: 70px; text-align: center; flex-shrink: 0; }
.loading-state { display: flex; align-items: center; gap: 10px; padding: 14px 13px; font-size: 12px; color: var(--muted); }
.loading-state i { color: var(--violet); font-size: 15px; animation: spin 1.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.apply-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px; background: var(--sky); color: white; border: none; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; margin-top: 10px; font-family: inherit; transition: background .15s; }
.apply-btn:hover { background: var(--sky-dark); }

/* parsed result */
.parsed-tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.parsed-tag { display: flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.parsed-tag.date { background: #EFF6FF; color: #1D4ED8; }
.parsed-tag.time-tag { background: var(--orange-light); color: #C2410C; }
.parsed-tag.list-tag { background: #FDF4FF; color: #6B21A8; }
.parsed-tag.prio-tag { background: var(--green-light); color: var(--green-dark); }
.parsed-tag.reminder { background: #FEF3C7; color: #92400E; }
.parsed-task-title { font-size: 15px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }

/* Focus / Pomodoro */
.focus-view { padding: 20px; display: flex; flex-direction: column; align-items: center; }
.focus-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 32px; max-width: 420px; width: 100%; text-align: center; }
.focus-title { font-size: 18px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
.focus-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.timer-ring { width: 160px; height: 160px; border-radius: 50%; border: 6px solid var(--border); margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; position: relative; }
.timer-ring.active { border-color: var(--sky); }
.timer-display { font-size: 36px; font-weight: 600; color: var(--slate); font-family: 'DM Mono', monospace; }
.focus-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }
.focus-btn { padding: 10px 24px; border-radius: 9px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.focus-btn-primary { background: var(--sky); color: white; }
.focus-btn-primary:hover { background: var(--sky-dark); }
.focus-btn-secondary { background: var(--surface2); color: var(--muted); }
.focus-btn-secondary:hover { background: var(--border); }
.focus-sessions { display: flex; gap: 8px; justify-content: center; }
.focus-session-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.focus-session-dot.done { background: var(--sky); }
.focus-task-select { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 13px; color: var(--slate); margin-top: 20px; background: var(--surface); cursor: pointer; }

/* Modal overlay */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }
.modal { background: white; border-radius: 14px; padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: slideUp .25s ease; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--slate); margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal-input { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 10px 13px; font-size: 13px; font-family: inherit; color: var(--slate); outline: none; margin-bottom: 10px; }
.modal-input:focus { border-color: var(--sky); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-btn { padding: 8px 18px; border-radius: 8px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.modal-btn-cancel { background: var(--surface2); color: var(--muted); }
.modal-btn-cancel:hover { background: var(--border); }
.modal-btn-primary { background: var(--sky); color: white; }
.modal-btn-primary:hover { background: var(--sky-dark); }
.modal-row { display: flex; gap: 10px; }
.modal-select { flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 10px 13px; font-size: 13px; font-family: inherit; color: var(--slate); outline: none; background: white; cursor: pointer; }
.modal-select:focus { border-color: var(--sky); }
select option { font-family: inherit; }

/* notifications */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--slate); color: white;
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  z-index: 10000; animation: slideLeft .3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  max-width: 320px;
}
.toast.success { background: #166534; }
.toast.error   { background: #991B1B; }
.toast.violet { background: var(--violet); }
.toast.hidden { display: none; }

/* animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* scrollbar global */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── AI TAB BAR — no wrap, scrollable ── */
.ai-tab-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.ai-tab-bar > div { flex-shrink: 0; }

/* ── AUTH SCREEN ── */
.auth-screen {
  position: fixed; inset: 0;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 20px;
}
.auth-screen.hidden { display: none; }
.auth-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 18px; padding: 36px 32px;
  width: 100%; max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,.10);
  animation: slideUp .3s ease;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 28px;
}
.auth-logo-mark {
  width: 40px; height: 40px; background: var(--sky);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.auth-logo-mark i { color: white; font-size: 22px; }
.auth-logo-text { font-size: 22px; font-weight: 700; color: var(--slate); letter-spacing: -.5px; }
.auth-title { font-size: 20px; font-weight: 700; color: var(--slate); margin-bottom: 6px; text-align: center; }
.auth-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 26px; line-height: 1.5; }
.auth-tabs {
  display: flex; background: var(--surface2);
  border-radius: 10px; padding: 3px; margin-bottom: 22px; gap: 2px;
}
.auth-tab {
  flex: 1; text-align: center; padding: 8px;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--muted); transition: all .15s;
}
.auth-tab.active { background: var(--white); color: var(--sky); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.auth-field { margin-bottom: 14px; }
.auth-label { font-size: 12px; font-weight: 500; color: var(--slate); margin-bottom: 5px; display: block; }
.auth-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  color: var(--slate); outline: none; transition: border-color .15s;
  background: var(--white);
}
.auth-input:focus { border-color: var(--sky); }
.auth-input.error { border-color: var(--red); }
.auth-error {
  font-size: 12px; color: var(--red); margin-top: 4px;
  display: flex; align-items: center; gap: 5px;
}
.auth-error i { font-size: 13px; }
.auth-btn {
  width: 100%; padding: 13px; background: var(--sky); color: white;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-top: 6px;
  transition: background .15s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { background: var(--sky-dark); }
.auth-btn:disabled { background: #BAE6FD; cursor: not-allowed; }
.auth-link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--sky); font-size: 13px; text-decoration: underline;
}
.auth-link-btn:hover { color: var(--sky-dark); }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--muted2); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-google-btn {
  width: 100%; padding: 11px; background: var(--white);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  color: var(--slate); display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .15s;
}
.auth-google-btn:hover { border-color: var(--sky); }
.auth-google-icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335);
  flex-shrink: 0;
}
.auth-free-note {
  text-align: center; font-size: 11px; color: var(--muted2); margin-top: 18px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.auth-free-note i { color: var(--green); font-size: 13px; }

/* ── USER AVATAR in sidebar ── */
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  color: white; cursor: pointer;
}
.user-profile-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px; border-radius: 8px; cursor: pointer;
  transition: background .12s; margin-bottom: 2px;
}
.user-profile-row:hover { background: #DBEAFE; }
.user-profile-name { font-size: 12px; font-weight: 500; color: var(--slate); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-profile-email { font-size: 10px; color: var(--muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── PROFILE DROPDOWN ── */
.profile-dropdown {
  position: fixed; bottom: 64px; left: 8px;
  width: 220px; background: var(--white);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); z-index: 500; overflow: hidden;
  animation: slideUp .15s ease;
}
.profile-dropdown.hidden { display: none; }
.profile-dd-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.profile-dd-name { font-size: 13px; font-weight: 600; color: var(--slate); }
.profile-dd-email { font-size: 11px; color: var(--muted2); margin-top: 2px; }
.profile-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; color: var(--slate);
  cursor: pointer; transition: background .1s;
}
.profile-dd-item:hover { background: var(--surface); }
.profile-dd-item i { font-size: 16px; color: var(--muted2); }
.profile-dd-item.danger { color: var(--red); }
.profile-dd-item.danger i { color: var(--red); }
.profile-dd-divider { height: 1px; background: var(--border); }

/* ── LANDING PAGE (shown inside auth-screen for logged-out users) ── */
.auth-screen { gap: 56px; overflow-y: auto; }

.landing-hero {
  flex: 0 1 400px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.landing-brand {
  display: flex; align-items: center; gap: 10px;
}
.landing-logo-mark {
  width: 42px; height: 42px; background: var(--sky);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.landing-logo-mark i { color: white; font-size: 24px; }
.landing-logo-text {
  font-size: 24px; font-weight: 700; color: var(--slate); letter-spacing: -.5px;
}
.landing-free-pill {
  font-size: 11px; font-weight: 700;
  background: #DCFCE7; color: #166534;
  padding: 3px 10px; border-radius: 20px;
}

.landing-headline {
  font-size: 34px; font-weight: 700;
  color: var(--slate); line-height: 1.22;
  letter-spacing: -.8px;
  font-family: inherit;
}
.landing-headline br { display: block; }

.landing-sub {
  font-size: 14px; color: var(--muted); line-height: 1.65;
}

.landing-features {
  display: flex; flex-direction: column; gap: 11px;
}
.landing-feat {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--slate2); font-weight: 500;
}
.landing-feat i {
  font-size: 17px; color: var(--sky);
  width: 22px; text-align: center; flex-shrink: 0;
}

/* Dark mode overrides */
body.dark-mode .landing-free-pill { background: #14532D; color: #86EFAC; }

/* Hide landing hero on mobile — auth card takes full width */
@media (max-width: 767px) {
  .landing-hero { display: none; }
}
