:root,
[data-theme="dark"] {
  --bg: #1a2421;
  --bg-card: #243029;
  --bg-muted: #2f3d36;
  --text: #eef4f0;
  --text-muted: #9eb5a8;
  --accent: #6fcf97;
  --accent-dim: #3d7a6b;
  --border: rgba(255, 255, 255, 0.08);
  --topbar-bg: rgba(26, 36, 33, 0.85);
  --hero-gradient: rgba(111, 207, 151, 0.12);
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f4f7f5;
  --bg-card: #ffffff;
  --bg-muted: #e8efea;
  --text: #1a2421;
  --text-muted: #5a6b62;
  --accent: #2d8a5e;
  --accent-dim: #3d7a6b;
  --border: rgba(26, 36, 33, 0.1);
  --topbar-bg: rgba(244, 247, 245, 0.92);
  --hero-gradient: rgba(45, 138, 94, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--hero-gradient), transparent),
    var(--bg);
}

.app-layout { min-height: 100dvh; background: var(--bg); }
.sidebar { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.today-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.main {
  flex: 1;
  padding: 0 16px 100px;
}

.hero {
  padding: 24px 4px 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.day-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 20px;
  scrollbar-width: none;
}
.day-picker::-webkit-scrollbar { display: none; }

.day-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  padding: 10px 8px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.15s, background 0.15s;
}
.day-chip strong { font-size: 1.1rem; color: var(--text); }
.day-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text);
}
.day-chip.is-today:not(.active) strong { color: var(--accent); }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 24px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.week-day.is-today { border-color: var(--accent); }
.week-dow { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; }
.week-num { font-size: 1rem; font-weight: 600; color: var(--text); }
.week-dots { display: flex; gap: 3px; margin-top: 2px; }
.week-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }

.section h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px 4px;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card {
  display: flex;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 72px;
  transition: transform 0.12s;
}
.event-card:active { transform: scale(0.98); }

.event-stripe { width: 5px; flex-shrink: 0; }

.event-body {
  padding: 14px 16px;
  flex: 1;
  min-width: 0;
}
.event-body time {
  display: block;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}
.event-body strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.event-body p {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty, .empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}
.empty-state .btn { margin-top: 16px; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 24px calc(12px + var(--safe-bottom));
  background: rgba(26, 36, 33, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 6px 16px;
}
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 1.2rem; }

.nav-fab {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #7ee0a8, var(--accent-dim));
  color: #1a2421;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 56px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(111, 207, 151, 0.35);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-card input[type="text"],
.form-card input[type="date"],
.form-card input[type="time"],
.form-card textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  width: 100%;
  -webkit-appearance: none;
}
.form-card textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch input { display: none; }
.color-swatch span {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-swatch input:checked + span {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-card);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.delete-form {
  margin-top: 20px;
  padding: 0 4px;
}

.btn {
  display: block;
  text-align: center;
  padding: 14px 20px;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #1a2421;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-danger {
  background: transparent;
  color: #e07a6a;
  border: 1px solid rgba(224, 122, 106, 0.35);
  width: 100%;
}

.form-error {
  color: #e07a6a;
  font-size: 0.9rem;
  margin: 0;
  padding: 10px 12px;
  background: rgba(224, 122, 106, 0.1);
  border-radius: 8px;
}

/* Auth */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(111, 207, 151, 0.15), transparent), var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { font-family: var(--font-display); font-size: 2rem; margin: 0 0 8px; }
.auth-sub { color: var(--text-muted); margin: 0 0 24px; }
.auth-form { margin-bottom: 16px; }
.auth-footer { text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.auth-footer a { color: var(--accent); }
.form-card input[type="email"],
.form-card input[type="password"],
.form-card select { font: inherit; font-size: 1rem; color: var(--text); background: var(--bg-muted); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; width: 100%; }

/* Topbar extras */
.topbar-inner { gap: 8px; flex-wrap: wrap; }
.ws-switcher select {
  font: inherit; font-size: 0.75rem; max-width: 120px;
  background: var(--bg-muted); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px;
}
.topbar-actions { display: flex; gap: 4px; margin-left: auto; }
.icon-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; text-decoration: none; }
.inline-form { display: inline; }
.flash-bar { background: var(--accent-dim); padding: 10px 16px; font-size: 0.85rem; }
.flash-bar p { margin: 0; }

/* Tasks */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-alert h2 { color: #e07a6a; }
.btn-sm { font-size: 0.8rem; padding: 8px 12px; border-radius: 8px; background: var(--bg-muted); color: var(--text); border: 1px solid var(--border); text-decoration: none; display: inline-block; }
.block-btn { margin-bottom: 20px; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-item { display: flex; gap: 8px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; position: relative; overflow: hidden; }
.task-stripe { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; margin: -10px 0 -10px -12px; margin-right: 4px; }
.task-title-row { display: flex; align-items: center; gap: 6px; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-dot.high { background: #e07a6a; }
.task-aside { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.status-pill {
  font: inherit; font-size: 0.65rem; font-weight: 600; padding: 4px 8px; border-radius: 6px;
  border: none; background: color-mix(in srgb, var(--status-color) 25%, transparent);
  color: var(--status-color); cursor: pointer; max-width: 88px;
}
.status-pill.sm { font-size: 0.6rem; padding: 3px 6px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: var(--text); flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 0.6rem; }
.task-check.sm { width: 18px; height: 18px; }
.task-check-form { flex-shrink: 0; }
.task-check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--text-muted);
  background: transparent; cursor: pointer; padding: 0;
}
.task-check.checked { background: var(--accent); border-color: var(--accent); }
.task-body { flex: 1; text-decoration: none; color: inherit; min-width: 0; }
.task-body strong { display: block; font-size: 0.95rem; line-height: 1.3; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 0.75rem; color: var(--text-muted); }
.task-list-done .task-body strong { text-decoration: line-through; opacity: 0.6; }
.priority-high { border-left: 3px solid #e07a6a; }
.priority-medium { border-left: 3px solid #c9a227; }
.assignee, .project-tag { background: var(--bg-muted); padding: 2px 8px; border-radius: 6px; }

/* Board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; }
.board-col { flex: 0 0 260px; background: var(--bg-card); border-radius: var(--radius); padding: 12px; border: 1px solid var(--border); }
.board-col-title { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.board-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.board-card { display: block; padding: 12px; background: var(--bg-muted); border-radius: 10px; text-decoration: none; color: inherit; }
.board-card strong { display: block; font-size: 0.9rem; margin-bottom: 6px; }
.board-card time, .board-card .assignee { font-size: 0.75rem; color: var(--text-muted); }

/* Calendar */
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head span { text-align: center; font-size: 0.7rem; color: var(--text-muted); padding: 4px; }
.cal-week { margin-bottom: 4px; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--text); background: var(--bg-card); border-radius: 10px; border: 1px solid var(--border); font-size: 0.85rem;
}
.cal-day.other-month { opacity: 0.35; }
.cal-day.is-today { border-color: var(--accent); }
.cal-dots { display: flex; gap: 3px; margin-top: 2px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.dot-task { background: var(--accent); }
.dot-event { background: #4a6fa5; }

/* Workspaces */
.ws-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ws-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.ws-card-head { display: flex; justify-content: space-between; border-left: 4px solid; padding-left: 10px; margin-bottom: 8px; }
.ws-role { font-size: 0.75rem; color: var(--text-muted); text-transform: capitalize; }
.ws-card p { margin: 0 0 12px; font-size: 0.85rem; color: var(--text-muted); }
.ws-actions { display: flex; gap: 8px; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.invite-box { margin-top: 16px; padding: 16px; background: var(--bg-card); border-radius: 12px; }
.invite-link { width: 100%; font-size: 0.75rem; padding: 10px; margin: 8px 0; background: var(--bg-muted); border: 1px solid var(--border); color: var(--text); border-radius: 8px; }

/* Stats & filters */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-chip { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 8px; text-align: center; }
.stat-chip strong { display: block; font-size: 1.2rem; }
.stat-chip span { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-chip.highlight { border-color: var(--accent); }
.stat-chip.alert strong { color: #e07a6a; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 16px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 20px; font-size: 0.8rem;
  text-decoration: none; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border);
}
.filter-chip.active { background: var(--accent-dim); color: var(--text); border-color: var(--accent); }
.quick-add { display: flex; gap: 8px; margin-bottom: 16px; }
.quick-add input { flex: 1; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); }
.search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-form input { flex: 1; font: inherit; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); }
.due-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 6px; background: var(--bg-muted); }
.due-badge.overdue { background: rgba(224,122,106,0.2); color: #e07a6a; }
.due-badge.due-today { background: rgba(111,207,151,0.2); color: var(--accent); }
.due-badge.due-tomorrow { background: rgba(201,162,39,0.15); color: #c9a227; }
.subtask-badge, .comment-badge { font-size: 0.7rem; opacity: 0.8; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; display: inline-block; margin-bottom: 8px; }
.task-detail-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.subtask-list { list-style: none; margin: 0 0 12px; padding: 0; }
.subtask-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.subtask-item.done span { text-decoration: line-through; opacity: 0.55; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item time { font-size: 0.75rem; color: var(--text-muted); margin-left: 8px; }
.comment-item p { margin: 6px 0 0; line-height: 1.45; }
.compact-form { margin-top: 12px; }
.project-list { list-style: none; margin: 12px 0 0; padding: 0; }
.project-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.project-dot { width: 10px; height: 10px; border-radius: 50%; }
.board-card-wrap { position: relative; }
.board-moves { display: flex; gap: 4px; padding: 0 8px 8px; }
.move-btn { flex: 1; padding: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-muted); color: var(--text); cursor: pointer; font-size: 0.85rem; }
.board-col-title .count { opacity: 0.5; font-weight: 400; }
.board-card-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.board-card-foot .assignee { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; }
.flash-hide { opacity: 0; transition: opacity 0.4s; }

/* Home & auth rich */
.home-hero .greeting { color: var(--text-muted); margin: 0 0 4px; font-size: 0.9rem; }
.alert-banner {
  display: block; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px;
  background: rgba(224,122,106,0.15); color: #e07a6a; text-decoration: none; font-weight: 500;
}
.link-chip { text-decoration: none; color: inherit; transition: transform 0.12s; }
.link-chip:active { transform: scale(0.97); }
.task-list.compact .task-item { padding: 10px; }
.activity-list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.activity-list li { padding: 10px 0; border-bottom: 1px solid var(--border); line-height: 1.4; }
.activity-list em { color: var(--text-muted); font-style: normal; }
.activity-list time { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.more-menu { display: flex; flex-direction: column; gap: 8px; }
.more-item {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none; color: inherit;
}
.more-item span { font-size: 1.4rem; }
.more-item small { display: block; color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.logout-form { margin-top: 24px; }
.filter-label { font-size: 0.75rem; color: var(--text-muted); align-self: center; padding-right: 4px; }
.label-tag { font-size: 0.65rem; padding: 2px 7px; border-radius: 4px; color: #fff; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-alert {
  background: #e07a6a; color: #fff; font-size: 0.7rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; text-decoration: none; padding: 0 6px;
}
.auth-page-rich { padding: 0; }
.auth-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-hero-panel {
  padding: 40px 24px 32px;
  background: linear-gradient(160deg, rgba(111,207,151,0.2), transparent 60%), var(--bg);
}
.auth-hero-panel h1 { font-family: var(--font-display); font-size: 2.2rem; margin: 0; }
.auth-hero-panel > p { color: var(--text-muted); margin: 8px 0 20px; }
.auth-features { list-style: none; margin: 0; padding: 0; color: var(--text-muted); font-size: 0.9rem; }
.auth-features li { padding: 4px 0; }
.auth-shell .auth-card { padding: 24px; flex: 1; }
.auth-shell .auth-card h2 { font-family: var(--font-display); margin: 0 0 20px; }
.board-card-wrap.dragging { opacity: 0.5; }
.board-col.drag-over { border-color: var(--accent); background: rgba(111,207,151,0.06); }
.cal-count { font-size: 0.6rem; color: var(--accent); font-weight: 600; }

/* Notifications */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; background: #e07a6a; color: #fff;
  font-size: 0.6rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { border-bottom: 1px solid var(--border); }
.notif-item.unread { background: rgba(111,207,151,0.06); }
.notif-body { display: block; padding: 14px 4px; text-decoration: none; color: inherit; }
.notif-kind { font-size: 0.65rem; text-transform: uppercase; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }
.notif-body p { margin: 4px 0; font-size: 0.9rem; }
.notif-body small { color: var(--text-muted); font-size: 0.75rem; }
.notif-body time { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.form-success { color: var(--accent); font-size: 0.85rem; margin: 0 0 12px; }
.filter-labels { flex-wrap: wrap; }
.label-chip.active { background: rgba(111,207,151,0.12); }

/* View tabs (Asana/Monday) */
.view-tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 0 0 16px; margin-bottom: 4px;
  scrollbar-width: none; border-bottom: 1px solid var(--border);
}
.view-tabs::-webkit-scrollbar { display: none; }
.view-tab {
  flex: 0 0 auto; padding: 10px 14px; font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.view-tab.active { color: var(--text); border-bottom-color: var(--accent); background: rgba(111,207,151,0.08); }

.hero-compact { padding: 16px 4px 8px; }
.hero-compact h1 { font-size: 1.4rem; }

/* Task groups */
.task-group h2 { display: flex; align-items: center; gap: 8px; }
.group-count {
  font-size: 0.7rem; background: var(--bg-muted); padding: 2px 8px;
  border-radius: 10px; font-weight: 600; color: var(--text-muted);
}
.group-overdue h2 { color: #e07a6a; }
.group-today h2 { color: var(--accent); }

.filter-projects { flex-wrap: wrap; }
.project-dot-inline { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.project-chip { display: inline-flex; align-items: center; }

/* Board Monday-style */
.board-col { border-top: 3px solid var(--col-color, var(--border)); }
.col-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.board-card-wrap { position: relative; overflow: hidden; border-radius: 10px; }
.board-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; z-index: 1; }
.board-card { position: relative; padding-left: 14px; }
.board-card-top { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; min-height: 18px; }
.label-tag.sm { font-size: 0.55rem; padding: 1px 5px; }
.project-tag.sm { font-size: 0.65rem; padding: 1px 6px; display: inline-block; margin-top: 4px; }

/* Table view */
.table-wrap { overflow-x: auto; margin: 0 -4px; border: 1px solid var(--border); border-radius: 12px; }
.task-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 640px; }
.task-table th {
  text-align: left; padding: 10px 12px; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); background: var(--bg-muted);
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.task-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.task-table tr:hover td { background: rgba(255,255,255,0.02); }
.cell-title { display: flex; align-items: center; gap: 8px; }
.cell-title a { color: inherit; text-decoration: none; font-weight: 500; }
.row-stripe { width: 4px; height: 20px; border-radius: 2px; flex-shrink: 0; }
.priority-pill { font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; text-transform: capitalize; }
.priority-pill.high { background: rgba(224,122,106,0.2); color: #e07a6a; }
.priority-pill.medium { background: rgba(201,162,39,0.15); color: #c9a227; }
.priority-pill.low { background: rgba(111,207,151,0.12); color: var(--accent); }
.empty-cell { text-align: center; color: var(--text-muted); padding: 32px !important; }

/* Desktop sidebar */
@media (min-width: 900px) {
  .app-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    max-width: 1280px;
    margin: 0 auto;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    border-right: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    height: 100dvh;
  }
  .sidebar-brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px 20px;
  }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .sidebar-link {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 10px; text-decoration: none;
    color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
  }
  .sidebar-link:hover { background: var(--bg-muted); color: var(--text); }
  .sidebar-link.active { background: rgba(111,207,151,0.15); color: var(--accent); }
  .sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
  .sidebar-badge {
    margin-left: auto; background: #e07a6a; color: #fff; font-size: 0.65rem;
    padding: 2px 6px; border-radius: 8px; font-weight: 700;
  }
  .shell { max-width: none; margin: 0; }
  .bottom-nav { display: none; }
  .topbar .brand { display: none; }
  .main { padding-bottom: 40px; }
  .board { flex-wrap: nowrap; }
  .board-col { flex: 1; min-width: 0; }
}

/* Timeline Gantt */
.timeline-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
.timeline-head { display: flex; border-bottom: 1px solid var(--border); min-width: 700px; }
.timeline-label-col { width: 140px; flex-shrink: 0; }
.timeline-days { display: flex; flex: 1; }
.timeline-day { flex: 1; text-align: center; padding: 8px 2px; border-left: 1px solid var(--border); font-size: 0.7rem; }
.timeline-day.is-today { background: rgba(111,207,151,0.1); color: var(--accent); }
.timeline-day strong { display: block; font-size: 0.85rem; }
.timeline-row { display: flex; align-items: center; min-width: 700px; border-bottom: 1px solid var(--border); min-height: 44px; }
.timeline-label {
  width: 140px; flex-shrink: 0; padding: 8px 10px; font-size: 0.78rem;
  text-decoration: none; color: inherit; display: flex; align-items: center; gap: 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.timeline-track { flex: 1; position: relative; height: 32px; margin: 4px 8px; background: var(--bg-muted); border-radius: 6px; }
.timeline-bar {
  position: absolute; top: 4px; bottom: 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--bar-color) 70%, transparent);
  border-left: 3px solid var(--bar-color); overflow: hidden; min-width: 4px;
}
.timeline-bar span { font-size: 0.65rem; padding: 0 6px; white-space: nowrap; opacity: 0.9; line-height: 24px; }

/* Projects */
.project-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .project-grid { grid-template-columns: 1fr 1fr; } }
.project-card {
  display: flex; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.project-card-stripe { width: 6px; flex-shrink: 0; }
.project-card-body { padding: 14px 16px; flex: 1; }
.project-card-body strong { display: block; margin-bottom: 8px; }
.project-progress { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.progress-bar { flex: 1; height: 6px; background: var(--bg-muted); border-radius: 3px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; border-radius: 3px; }
.header-progress { margin-top: 12px; }
.project-section { border-left: 3px solid var(--border); padding-left: 12px; margin-left: 4px; }
.section-quick { margin-top: 8px; }
.section-foot { display: flex; gap: 10px; margin-top: 24px; }
.section-hint { margin: -8px 0 16px; }
.section-groups { display: flex; flex-direction: column; gap: 4px; }
.draggable-section { cursor: grab; }
.draggable-section.dragging-section { opacity: 0.55; }
.draggable-section.drag-over-section { outline: 2px dashed var(--accent); outline-offset: 4px; }
.drag-handle {
  cursor: grab; color: var(--text-muted); font-size: 1rem; padding: 0 8px 0 0;
  user-select: none; letter-spacing: -2px;
}
.project-section .section-head { display: flex; align-items: center; }
.offline-banner {
  position: sticky; top: 0; z-index: 50; background: #c9a227; color: #1a2421;
  text-align: center; padding: 8px 16px; font-size: 0.85rem; font-weight: 600;
}
.offline-hero { text-align: center; padding-top: 48px; }
.export-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.project-dot-inline.lg { width: 12px; height: 12px; }
.project-list-link { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; padding: 8px 0; }
.section-tag { font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; background: var(--bg-muted); color: var(--text-muted); }
.status-pill.static { pointer-events: none; }
.task-hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.task-star.sm { font-size: 0.95rem; }
.task-star.lg { font-size: 1.4rem; margin-right: 8px; }
.task-actions-row { display: flex; align-items: center; gap: 8px; }
.dep-list { list-style: none; margin: 0 0 12px; padding: 0; }
.dep-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.dep-item.blocked a { color: #e07a6a; }
.dep-item span { color: var(--text-muted); font-size: 0.75rem; }
.dep-note { font-size: 0.82rem; color: var(--text-muted); }
.dep-badge { font-size: 0.7rem; opacity: 0.7; }
.btn-xs { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0 4px; }

/* Portfolio */
.portfolio-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .portfolio-grid { grid-template-columns: 1fr 1fr; } }
.portfolio-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.portfolio-card.health-bad { border-color: rgba(224,122,106,0.4); }
.portfolio-card.health-warn { border-color: rgba(201,162,39,0.35); }
.portfolio-card-head {
  display: flex; align-items: stretch; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
}
.portfolio-card-head > div { padding: 14px 16px; display: flex; align-items: center; gap: 8px; flex: 1; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; margin-left: auto; }
.health-good .health-dot { background: #00c875; }
.health-warn .health-dot { background: #c9a227; }
.health-bad .health-dot { background: #e07a6a; }
.portfolio-card-body { padding: 14px 16px; }
.portfolio-stats { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-muted); margin: 10px 0; }
.overdue-stat { color: #e07a6a; }
.portfolio-next { font-size: 0.82rem; color: var(--text-muted); margin: 8px 0; }
.portfolio-next em { color: var(--text); font-style: normal; }
.portfolio-activity { list-style: none; margin: 10px 0 0; padding: 0; font-size: 0.75rem; color: var(--text-muted); }
.portfolio-activity li { padding: 4px 0; }
.portfolio-activity em { font-style: normal; opacity: 0.8; }

/* Automations */
.automation-list { list-style: none; margin: 0; padding: 0; }
.automation-item {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
}
.automation-item.on { border-color: rgba(111,207,151,0.35); }
.automation-info { flex: 1; min-width: 0; }
.automation-info strong { display: block; font-size: 0.9rem; }
.automation-info small { color: var(--text-muted); font-size: 0.75rem; }
.toggle-btn {
  width: 44px; height: 26px; border-radius: 13px; border: none; background: var(--bg-muted);
  position: relative; cursor: pointer; padding: 0; flex-shrink: 0;
}
.toggle-btn i {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.2s, background 0.2s;
}
.toggle-btn.active { background: var(--accent-dim); }
.toggle-btn.active i { transform: translateX(18px); background: var(--accent); }

/* Attachments */
.attachment-list { list-style: none; margin: 0 0 12px; padding: 0; }
.attachment-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.attachment-link {
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  text-decoration: none; color: inherit; font-size: 0.85rem; min-width: 0;
}
.attachment-link small { color: var(--text-muted); font-size: 0.72rem; width: 100%; }
.file-icon { font-size: 1rem; }
.attach-form input[type="file"] {
  flex: 1; font-size: 0.8rem; color: var(--text-muted);
  background: var(--bg-muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px;
}
.form-hint { font-size: 0.72rem; color: var(--text-muted); margin: 8px 0 0; }
.export-row { margin: 0 0 16px; }

/* Image gallery & lightbox */
.attachment-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.attachment-gallery:empty { display: none; }
.gallery-thumb {
  border: none; padding: 0; background: var(--bg-muted); border-radius: 10px;
  overflow: hidden; cursor: pointer; aspect-ratio: 1; display: block; width: 100%;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-preview-btn {
  border: none; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit;
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0;
}
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; padding-top: max(24px, env(safe-area-inset-top));
}
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 100%; max-height: 75dvh; border-radius: 8px; object-fit: contain; }
.lightbox-close {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 1.5rem; cursor: pointer;
}

.install-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 49; background: var(--accent); color: #fff;
  padding: 10px 16px; font-size: 0.85rem; font-weight: 500;
}
.install-dismiss { background: transparent; border: none; color: inherit; font-size: 1.2rem; cursor: pointer; opacity: 0.8; }

.task-draggable { cursor: grab; }
.task-draggable.dragging-task { opacity: 0.5; }
.section-task-zone.drag-over-tasks {
  outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 8px;
  min-height: 40px;
}
.section-tasks-drop:empty { min-height: 8px; }

.section-menu { margin-left: auto; position: relative; }
.section-menu-btn { cursor: pointer; padding: 4px 8px; color: var(--text-muted); list-style: none; }
.section-menu-panel {
  position: absolute; right: 0; top: 100%; z-index: 10;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.section-rename-form { display: flex; gap: 6px; margin-bottom: 8px; }
.section-rename-form input { flex: 1; min-width: 0; }
.btn-danger-text { color: #c44; }

.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-item time { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.avatar.sm { width: 28px; height: 28px; font-size: 0.65rem; }
#lightbox-caption { color: #ccc; font-size: 0.85rem; margin-top: 12px; text-align: center; }

.task-star {
  flex-shrink: 0; border: none; background: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted); opacity: 0.35; padding: 0 4px;
  line-height: 1; transition: opacity 0.15s, color 0.15s, transform 0.15s;
}
.task-star:hover { opacity: 0.8; transform: scale(1.1); }
.task-star.starred { opacity: 1; color: #e8b923; }

.saved-views-bar {
  margin: 12px 0 16px; padding: 12px; background: var(--bg-muted); border-radius: 12px;
}
.save-view-form { display: flex; gap: 8px; margin-bottom: 8px; }
.save-view-form input { flex: 1; min-width: 0; }
.saved-views-list { display: flex; flex-wrap: wrap; gap: 6px; }
.saved-view-chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 4px 2px 10px; font-size: 0.78rem;
}
.saved-view-chip a { color: inherit; text-decoration: none; }
.saved-view-del {
  border: none; background: none; color: var(--text-muted); cursor: pointer;
  font-size: 1rem; padding: 0 6px; line-height: 1;
}
.sidebar-saved { padding: 8px 16px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.sidebar-saved-label {
  display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 4px; padding: 0 8px;
}
.sidebar-saved-link { font-size: 0.82rem !important; padding-left: 20px !important; }
.pref-card { margin-top: 8px; }
.push-status { margin-top: 8px; }

.task-select {
  flex-shrink: 0; display: flex; align-items: center; cursor: pointer;
}
.task-bulk-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.bulk-bar {
  position: sticky; bottom: calc(72px + var(--safe-bottom)); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px; margin: 12px 0; box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
@media (min-width: 901px) {
  .bulk-bar { bottom: 16px; }
}
.bulk-count { font-size: 0.85rem; margin-right: 4px; }
.bulk-select {
  font: inherit; font-size: 0.8rem; padding: 6px 8px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-muted); color: var(--text);
}
.recur-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--accent); margin-left: 4px;
}
.cf-fieldset {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin: 12px 0; background: var(--bg-muted);
}
.cf-fieldset legend { padding: 0 6px; font-size: 0.8rem; color: var(--text-muted); }
.cf-list { list-style: none; padding: 0; margin: 0; }
.cf-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cf-item:last-child { border-bottom: none; }
.cf-type {
  display: inline-block; font-size: 0.72rem; padding: 2px 8px; margin-left: 8px;
  border-radius: 999px; background: var(--bg-muted); color: var(--text-muted);
}

.task-drag-hint {
  color: var(--text-muted); font-size: 0.75rem; letter-spacing: -2px;
  cursor: grab; user-select: none; opacity: 0.5; padding-right: 2px;
}
.th-cf { min-width: 110px; font-size: 0.75rem; }
.cell-cf { min-width: 110px; }
.cf-inline {
  width: 100%; min-width: 90px; font: inherit; font-size: 0.8rem;
  padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-muted); color: var(--text);
}
.cf-inline.cf-saving { opacity: 0.6; }
.cf-inline.cf-saved { border-color: var(--accent); }
.mention {
  background: rgba(111, 207, 151, 0.2); color: var(--accent);
  padding: 0 4px; border-radius: 4px; font-weight: 600;
}
[data-theme="light"] .mention { background: rgba(45, 138, 94, 0.12); }
.mention-label { position: relative; display: block; }
.mention-suggestions {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 30;
  list-style: none; margin: 0 0 4px; padding: 4px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); max-height: 180px; overflow: auto;
}
.mention-suggestion {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.9rem;
}
.mention-suggestion:hover,
.mention-suggestion.active { background: var(--bg-muted); }
.mention-hint { margin-top: 4px; }
.comment-body { margin: 4px 0 0; line-height: 1.45; }
