:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --success: #10b981;
  --success-soft: #d1fae5;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --note-default: #ffffff;
  --note-yellow: #fff8c5;
  --note-blue: #d6e9ff;
  --note-green: #d6f5dd;
  --note-pink: #ffd9e4;
  --note-purple: #e6d6ff;
  --note-orange: #ffe1c2;
  --note-gray: #ececec;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #131b2e;
  --surface-2: #1a2438;
  --surface-hover: #1f2a42;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --border: #283449;
  --border-strong: #3a4a66;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1e1b4b;
  --danger: #f87171;
  --danger-soft: #4a1d1d;
  --success: #34d399;
  --success-soft: #1a3d2e;
  --warning: #fbbf24;
  --warning-soft: #3d2f0e;
  --note-default: #1a2438;
  --note-yellow: #5c5430;
  --note-blue: #2d4a6b;
  --note-green: #2d5a3d;
  --note-pink: #6b3346;
  --note-purple: #4a3a6b;
  --note-orange: #6b4a30;
  --note-gray: #3a3a3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  transition: transform var(--transition), background-color var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition);
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-section {
  margin-top: 18px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  transition: background-color var(--transition);
}
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.menu-toggle:hover { background: var(--surface-hover); color: var(--text); }

.search-bar {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  outline: none;
  transition: border-color var(--transition), background-color var(--transition);
}
.search-bar input:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.search-bar .icon-search {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background-color var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.content {
  padding: 28px;
  flex: 1;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background-color var(--transition), transform 80ms, border-color var(--transition);
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
}
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 10px; font-size: 13px; }

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 25;
  transition: transform var(--transition), background-color var(--transition);
}
.fab:hover { background: var(--accent-hover); transform: translateY(-2px) scale(1.04); }
.fab .icon { width: 24px; height: 24px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 18px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* ---------- Dashboard grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.stat-icon .icon { width: 22px; height: 22px; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.dashboard-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 1024px) {
  .dashboard-columns { grid-template-columns: 1fr; }
}

.dash-list { display: flex; flex-direction: column; gap: 8px; }
.dash-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
  cursor: pointer;
}
.dash-row:hover { background: var(--surface-hover); }
.dash-row .title { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row .meta { color: var(--text-muted); font-size: 12.5px; flex-shrink: 0; }
.dash-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dash-row.done .title { color: var(--text-muted); text-decoration: line-through; }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.empty-state .icon { width: 28px; height: 28px; margin-bottom: 8px; opacity: 0.5; }

/* ---------- Notes grid ---------- */
.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}
.note {
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 240ms ease;
}
.note:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.note.pinned::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.note h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  padding-right: 16px;
  word-break: break-word;
}
.note .body {
  font-size: 13.5px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  max-height: 220px;
  overflow: hidden;
}
.note .checklist { display: flex; flex-direction: column; gap: 4px; }
.note .check {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: flex-start;
}
.note .check.done { color: var(--text-muted); text-decoration: line-through; }
.note .check input { margin-top: 2px; flex-shrink: 0; }
.note .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .tag { background: rgba(255, 255, 255, 0.08); }
.tag.priority-high { background: var(--danger-soft); color: var(--danger); }
.tag.priority-medium { background: var(--warning-soft); color: var(--warning); }
.tag.priority-low { background: var(--success-soft); color: var(--success); }
.tag.due { background: var(--accent-soft); color: var(--accent); }
.tag.due.overdue { background: var(--danger-soft); color: var(--danger); }

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

/* ---------- Todo page ---------- */
.todo-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}
@media (max-width: 900px) { .todo-layout { grid-template-columns: 1fr; } }

.todo-lists { display: flex; flex-direction: column; gap: 4px; }
.todo-list-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  transition: background-color var(--transition);
}
.todo-list-btn:hover { background: var(--surface-hover); color: var(--text); }
.todo-list-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.todo-list-btn .count {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 7px;
  border-radius: 999px;
}
[data-theme="dark"] .todo-list-btn .count { background: rgba(255, 255, 255, 0.08); }

.todo-detail .progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 18px;
}
.todo-detail .progress > div {
  height: 100%;
  background: var(--accent);
  transition: width 300ms ease;
}

.todo-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.task {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: background-color var(--transition), opacity var(--transition);
}
.task:hover { background: var(--surface-hover); }
.task.dragging { opacity: 0.4; }
.task.drag-over { border-color: var(--accent); }
.task .grip {
  color: var(--text-faint);
  cursor: grab;
  margin-top: 2px;
  user-select: none;
}
.task input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.task .task-body { flex: 1; min-width: 0; }
.task .task-title { font-weight: 500; word-break: break-word; }
.task.done .task-title { color: var(--text-muted); text-decoration: line-through; }
.task .task-meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.task .subtasks { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; padding-left: 4px; }
.subtask {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.subtask.done { text-decoration: line-through; opacity: 0.7; }
.subtask input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); }

.task .task-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}
.task:hover .task-actions { opacity: 1; }

.add-task {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.add-task input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color var(--transition);
}
.add-task input:focus { border-color: var(--accent); }

/* ---------- Calendar ---------- */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-header h2 { font-size: 20px; font-weight: 700; margin: 0; }
.cal-nav { display: flex; gap: 4px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.cal-weekday {
  background: var(--surface-2);
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-day {
  background: var(--surface);
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background-color var(--transition);
}
.cal-day:hover { background: var(--surface-hover); }
.cal-day.other-month { color: var(--text-faint); background: var(--surface-2); }
.cal-day.today .day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.day-num { font-size: 13px; font-weight: 500; }
.cal-event {
  font-size: 11.5px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Photos ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: var(--surface-2);
  transition: all var(--transition);
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone .icon { width: 36px; height: 36px; color: var(--accent); }
.dropzone h3 { margin: 8px 0 4px; font-size: 16px; }
.dropzone p { margin: 0; color: var(--text-muted); font-size: 13px; }

.album-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 240ms ease;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}
.photo-card:hover img { transform: scale(1.05); }
.photo-card .actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.photo-card:hover .actions { opacity: 1; }
.photo-card .actions button {
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.photo-card .actions button:hover { background: rgba(15, 23, 42, 0.9); }
.photo-card .name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 10px 8px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storage-bar {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.storage-bar .label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.storage-bar .bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.storage-bar .bar > div {
  height: 100%;
  background: linear-gradient(to right, var(--accent), #8b5cf6);
  transition: width 300ms ease;
}

/* ---------- Settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle .switch {
  width: 38px;
  height: 22px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background-color var(--transition);
}
.toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(16px); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fadeIn 160ms ease;
  padding: 20px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: pop 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.title-input {
  width: 100%;
  padding: 6px 0;
  border: none;
  outline: none;
  font-size: 18px;
  font-weight: 600;
  background: transparent;
  margin-bottom: 8px;
}
.body-input {
  width: 100%;
  min-height: 120px;
  padding: 8px 0;
  border: none;
  outline: none;
  background: transparent;
  resize: vertical;
  font-size: 14.5px;
  line-height: 1.55;
}
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { border-color: var(--accent); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) { .field-row { grid-template-columns: 1fr; } }

.checklist-edit { display: flex; flex-direction: column; gap: 6px; }
.checklist-edit .check-edit { display: flex; gap: 8px; align-items: center; }
.checklist-edit .check-edit input[type="text"] {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
}
.checklist-edit .check-edit input[type="text"]:focus { border-color: var(--accent); }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 240ms ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .content { padding: 18px; }
  .topbar { padding: 12px 16px; }
  .page-header h1 { font-size: 22px; }
  .cal-day { min-height: 64px; padding: 5px; }
  .cal-event { font-size: 10px; padding: 1px 4px; }
  .fab { bottom: 18px; right: 18px; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 25;
}
.sidebar-overlay.show { display: block; }

.hidden { display: none !important; }

/* ---------- Login screen ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 200ms ease;
}
.login-screen[hidden] { display: none !important; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  animation: pop 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 6px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}
.login-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-hint {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.login-card input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  outline: none;
  font-size: 14.5px;
  transition: border-color var(--transition);
}
.login-card input[type="password"]:focus { border-color: var(--accent); }
.login-card .btn-primary {
  justify-content: center;
  padding: 11px 14px;
  font-weight: 600;
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  background: var(--danger-soft);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}
