:root {
  --bg-primary: #f0f2f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f9fc;
  --bg-elevated: #eaecf4;
  --border: #e2e7f0;
  --border-light: #cdd4e3;

  --accent: #c8870a;
  --accent-dim: rgba(200, 135, 10, 0.12);
  --accent-hover: #e09a12;

  --sidebar-bg: #0f1f3d;
  --sidebar-border: #1e3358;
  --sidebar-text: #8faac8;
  --sidebar-text-active: #ffffff;

  --rob: #3d7fff;
  --rob-dim: rgba(61, 127, 255, 0.12);
  --bala: #00a87c;
  --bala-dim: rgba(0, 168, 124, 0.12);

  --priority-high: #dc2626;
  --priority-high-dim: rgba(220, 38, 38, 0.10);
  --priority-medium: #c8870a;
  --priority-medium-dim: rgba(200, 135, 10, 0.10);
  --priority-low: #16a34a;
  --priority-low-dim: rgba(22, 163, 74, 0.10);

  --status-new: #7c3aed;
  --status-new-dim: rgba(124, 58, 237, 0.10);
  --status-inprogress: #3d7fff;
  --status-inprogress-dim: rgba(61, 127, 255, 0.10);
  --status-waiting: #c8870a;
  --status-waiting-dim: rgba(200, 135, 10, 0.10);
  --status-done: #16a34a;
  --status-done-dim: rgba(22, 163, 74, 0.10);
  --status-archived: #94a3b8;
  --status-archived-dim: rgba(148, 163, 184, 0.10);

  --text-primary: #0d1b35;
  --text-secondary: #4a5f7c;
  --text-muted: #8fa0b8;

  --overdue: #dc2626;
  --overdue-dim: rgba(220, 38, 38, 0.06);

  --sidebar-w: 240px;
  --nav-h: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --transition: 0.18s ease;
  --shadow: 0 4px 20px rgba(15, 31, 61, 0.10);
  --shadow-card: 0 1px 4px rgba(15, 31, 61, 0.07), 0 0 0 1px rgba(15,31,61,0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── LAYOUT ─────────────────────────────── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.view.active { display: block; }

/* ─── SIDEBAR ────────────────────────────── */

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.logo-text .company {
  font-size: 10px;
  color: var(--sidebar-text);
  letter-spacing: 0.3px;
}

.sidebar-user {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.user-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-text);
  opacity: 0.7;
  margin-bottom: 6px;
}

.user-switcher {
  display: flex;
  gap: 6px;
}

.user-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-btn:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.07); color: #fff; }

.user-btn.active-rob {
  background: rgba(61,127,255,0.18);
  border-color: var(--rob);
  color: #7eb3ff;
}

.user-btn.active-bala {
  background: rgba(0,168,124,0.18);
  border-color: var(--bala);
  color: #4dd9b8;
}

.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-rob { background: var(--rob-dim); color: var(--rob); border: 1px solid var(--rob); }
.avatar-bala { background: var(--bala-dim); color: var(--bala); border: 1px solid var(--bala); }
.avatar-both {
  background: linear-gradient(135deg, var(--rob-dim), var(--bala-dim));
  border: 1px solid var(--accent);
  color: var(--accent);
}

.avatar-lg {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar-xl {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-text);
  opacity: 0.5;
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(200,135,10,0.18);
  color: #f0b429;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--priority-high);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.badge-accent {
  background: var(--accent);
  color: var(--bg-primary);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stat-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.stat-pill .val {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.stat-pill .lbl {
  font-size: 10px;
  color: var(--sidebar-text);
  margin-top: 2px;
}

/* ─── TOP BAR ────────────────────────────── */

.top-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(15,31,61,0.06);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.hamburger:hover { background: var(--bg-card); }

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  width: 220px;
  transition: border-color var(--transition);
}

.top-search:focus-within { border-color: var(--accent); }

.top-search svg { color: var(--text-muted); flex-shrink: 0; }

.top-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

.top-search input::placeholder { color: var(--text-muted); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}

.icon-btn svg { width: 18px; height: 18px; }

/* ─── BUTTONS ────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-danger {
  color: var(--priority-high);
  border-color: var(--priority-high);
}

.btn-danger:hover {
  background: var(--priority-high-dim);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* ─── FAB ─────────────────────────────────── */

.fab {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
  transition: all var(--transition);
  z-index: 200;
  border: none;
  cursor: pointer;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 212, 170, 0.5);
}

.fab svg { width: 24px; height: 24px; }

/* ─── QUICK CAPTURE BAR ──────────────────── */

.quick-capture {
  position: fixed;
  bottom: 88px;
  left: calc(var(--sidebar-w) + 24px);
  right: 92px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.2);
  animation: slideUp 0.15s ease;
}

.quick-capture.open { display: flex; }

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

.quick-capture input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
}

.quick-capture input::placeholder { color: var(--text-muted); }

.quick-capture-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── DASHBOARD VIEW ──────────────────────── */

.dashboard-greeting {
  margin-bottom: 24px;
}

.dashboard-greeting h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.dashboard-greeting p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.accent-teal::before { background: var(--accent); }
.stat-card.accent-blue::before { background: var(--rob); }
.stat-card.accent-red::before { background: var(--priority-high); }
.stat-card.accent-green::before { background: var(--priority-low); }

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-meta.danger { color: var(--priority-high); }
.stat-meta.good { color: var(--priority-low); }

.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .count {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 10px;
}

/* ─── TASK CARDS ─────────────────────────── */

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.task-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.task-card.overdue { border-left: 3px solid var(--overdue); }

.task-card.done {
  opacity: 0.6;
}

.task-card.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}

.task-check:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.task-check.checked {
  background: var(--priority-low);
  border-color: var(--priority-low);
}

.task-check.checked svg { display: block; }
.task-check svg { display: none; width: 12px; height: 12px; color: white; }

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

.task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 2px;
}

.task-client {
  font-size: 11px;
  color: var(--text-muted);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-priority-high { background: var(--priority-high-dim); color: var(--priority-high); }
.chip-priority-medium { background: var(--priority-medium-dim); color: var(--priority-medium); }
.chip-priority-low { background: var(--priority-low-dim); color: var(--priority-low); }

.chip-status-new { background: var(--status-new-dim); color: var(--status-new); }
.chip-status-inprogress { background: var(--status-inprogress-dim); color: var(--status-inprogress); }
.chip-status-waiting { background: var(--status-waiting-dim); color: var(--status-waiting); }
.chip-status-done { background: var(--status-done-dim); color: var(--status-done); }
.chip-status-archived { background: var(--status-archived-dim); color: var(--status-archived); }

.chip-cat {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.chip-agenda {
  background: var(--accent-dim);
  color: var(--accent);
}

.due-date {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.due-date.overdue { color: var(--overdue); font-weight: 600; }
.due-date.today { color: var(--priority-medium); font-weight: 600; }
.due-date svg { width: 11px; height: 11px; }

.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition);
  position: relative;
}

.task-card:hover .task-actions { opacity: 1; }

@media (hover: none) {
  /* Touch devices — always show 3-dot button */
  .task-actions { opacity: 1; }
}

.task-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.task-menu-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }

.task-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(15,31,61,0.12);
  z-index: 300;
  min-width: 140px;
  overflow: hidden;
  flex-direction: column;
}
.task-menu.open { display: flex; }
.task-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  transition: background var(--transition);
}
.task-menu button:hover { background: var(--bg-primary); }
.task-menu button.danger { color: var(--priority-high); }
.task-menu button.danger:hover { background: var(--priority-high-dim); }

/* ─── BOARD VIEW ─────────────────────────── */

.board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 140px);
}

.board-col {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.board-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
}

.board-col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.board-col-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.board-col-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 10px;
}

.board-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.board-col .task-card {
  margin-bottom: 8px;
}

.board-col .task-card:last-child { margin-bottom: 0; }

/* ─── LIST VIEW ──────────────────────────── */

.list-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--transition);
  cursor: pointer;
}

.filter-select:focus { border-color: var(--accent); }

.sort-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 12.5px;
  transition: all var(--transition);
}

.sort-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.sort-btn svg { width: 14px; height: 14px; }

.list-table-header {
  display: grid;
  grid-template-columns: 32px 1fr 100px 100px 80px 90px 36px;
  gap: 12px;
  padding: 8px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.list-row {
  display: grid;
  grid-template-columns: 32px 1fr 100px 100px 80px 90px 36px;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  align-items: center;
  transition: background var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.list-row:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.list-row.overdue { background: var(--overdue-dim); }

/* ─── TIMELINE / ACTIVITY ─────────────────── */

.timeline-container {
  max-width: 680px;
}

.timeline-date-group {
  margin-bottom: 24px;
}

.timeline-date-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-date-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.activity-item {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}

.activity-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  padding: 10px 14px;
  flex: 1;
  position: relative;
  transition: border-color var(--transition);
}

.activity-bubble:hover { border-color: var(--border-light); }

.activity-item.right .activity-bubble {
  border-radius: 12px 12px 4px 12px;
  background: var(--bg-elevated);
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.activity-actor {
  font-size: 12px;
  font-weight: 700;
}

.activity-actor.rob { color: var(--rob); }
.activity-actor.bala { color: var(--bala); }

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-task-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  cursor: pointer;
}

/* ─── AGENDA VIEW ────────────────────────── */

.agenda-header-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agenda-header-info h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.agenda-header-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.agenda-category-group {
  margin-bottom: 20px;
}

.agenda-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0 4px;
}

/* ─── MODALS ─────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.open { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-light); }
.modal-close svg { width: 18px; height: 18px; stroke-width: 2.5; }

.modal-body { padding: 20px 24px; }

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── FORMS ──────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--accent); }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

.form-select option { background: var(--bg-elevated); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toggle-label {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.toggle {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
}

.toggle.on { background: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle.on::after { transform: translateX(18px); }

/* ─── TASK DETAIL DRAWER ─────────────────── */

.detail-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  overflow-y: auto;
}

.detail-drawer.open { right: 0; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 399;
  display: none;
}

.drawer-overlay.open { display: block; }

.detail-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.detail-header-info { flex: 1; }

.detail-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.detail-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
.detail-close svg { width: 18px; height: 18px; }

.detail-body { padding: 20px 24px; flex: 1; }

.detail-section {
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.detail-props {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-prop {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.detail-prop .prop-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-prop .prop-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.snooze-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.snooze-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  padding: 5px 12px;
  font-size: 12px;
  transition: all var(--transition);
}

.snooze-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.status-changer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-option {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.status-option:hover { opacity: 0.8; }
.status-option.active { opacity: 1; }

.detail-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* ─── SNOOZE BADGE ───────────────────────── */

.snoozed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--priority-medium);
  background: var(--priority-medium-dim);
  padding: 2px 8px;
  border-radius: 20px;
}

/* ─── EMPTY STATE ────────────────────────── */

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

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
}

/* ─── TOAST ──────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease;
  pointer-events: all;
}

.toast.success { border-color: var(--priority-low); }
.toast.error { border-color: var(--priority-high); }
.toast svg { width: 16px; height: 16px; }

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

/* ─── NOTIFICATION PROMPT ─────────────────── */

.notif-prompt {
  background: linear-gradient(135deg, var(--accent-dim), var(--rob-dim));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.notif-prompt svg { color: var(--accent); flex-shrink: 0; }

.notif-prompt-text {
  flex: 1;
}

.notif-prompt-text strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.notif-prompt-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── BOTTOM NAV (MOBILE) ─────────────────── */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  height: 68px;
  width: 100%;
  justify-content: space-around;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  color: var(--sidebar-text);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  gap: 5px;
  transition: color var(--transition);
  cursor: pointer;
  user-select: none;
  position: relative;
}

.bottom-nav-item::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f0b429;
  opacity: 0;
  transition: opacity var(--transition);
}

.bottom-nav-item.active {
  color: #f0b429;
}

.bottom-nav-item.active::after {
  opacity: 1;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ─── ICON BUTTON ────────────────────────── */

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: none;
  transition: all var(--transition);
}

.btn-icon:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-light); }

/* ─── ADMIN MODAL ────────────────────────── */

.admin-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.admin-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-primary);
}

.admin-delete-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--priority-high);
  transition: background var(--transition);
}

.admin-delete-btn:hover { background: var(--priority-high-dim); }

.admin-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-add-row .form-input { flex: 1; }

.member-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── INSTALL BANNER ─────────────────────── */

.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  font-size: 14px;
}

.install-banner span { flex: 1; }

/* ─── MEMBER VIEW BANNER ─────────────────── */

.member-banner {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ─── LOGO FALLBACK ──────────────────────── */

.logo-icon img { display: block; }
.logo-icon img + .logo-icon-fallback { display: none; }

/* ─── RESPONSIVE ─────────────────────────── */

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  /* Always leave room for fixed bottom nav */
  .view { padding: 12px 14px 90px; }

  .hamburger { display: flex; }

  /* Top bar: compact on mobile */
  .top-bar { padding: 8px 14px; gap: 8px; }

  /* Mobile search: icon-only pill, expands on tap */
  .top-search {
    width: 36px;
    height: 36px;
    overflow: hidden;
    transition: width 0.25s ease;
    padding: 0 10px;
    cursor: pointer;
    justify-content: center;
  }
  .top-search:focus-within {
    width: 160px;
    justify-content: flex-start;
    padding: 0 10px;
  }
  .top-search input { min-width: 0; }
  .top-search svg { width: 18px; height: 18px; flex-shrink: 0; }

  /* Hide "New Task" label — keep just the + icon */
  .btn-primary .btn-label { display: none; }

  .bottom-nav { display: flex; }

  .fab { bottom: calc(var(--nav-h) + 20px); right: 14px; width: 48px; height: 48px; }

  .quick-capture {
    left: 14px;
    right: 72px;
    bottom: calc(var(--nav-h) + 14px);
  }

  .detail-drawer { width: 100%; right: -100%; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Compact stat cards */
  .stat-card { padding: 14px; }
  .stat-value { font-size: 28px; }

  /* Compact task cards */
  .task-card { padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; }
  .task-card-top { margin-bottom: 6px; gap: 8px; }
  .task-title { font-size: 13px; }
  .task-meta { gap: 4px; flex-wrap: wrap; }
  .chip { font-size: 10px; padding: 2px 7px; }
  .avatar { width: 20px; height: 20px; font-size: 9px; }

  /* Board: stacked columns */
  .board-container {
    flex-direction: column;
    overflow-x: visible;
    min-height: auto;
    gap: 10px;
  }

  .board-col {
    width: 100% !important;
    min-width: 0 !important;
    max-height: none;
    flex-shrink: 1;
  }

  .board-col-body { max-height: none; overflow-y: visible; }
  .board-col-header { padding: 10px 12px; }

  /* List */
  .list-table-header { display: none; }

  .list-row {
    grid-template-columns: 28px 1fr 60px;
    gap: 6px;
    padding: 10px 12px;
  }

  .list-col-assignee,
  .list-col-cat,
  .list-col-due { display: none; }

  /* Filters: 2x2 grid on mobile */
  .list-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    overflow-x: unset;
  }
  .filter-select { font-size: 12px; padding: 6px 8px; width: 100%; }
  .sort-btn { font-size: 12px; padding: 6px 8px; white-space: nowrap; }

  /* Modal: bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 18px 18px 0 0;
    align-self: flex-end;
    max-height: 92vh;
    overflow-y: auto;
  }
  .modal-header { padding: 16px 20px 12px; }
  .modal-body { padding: 0 20px 16px; }
  .form-group { margin-bottom: 12px; }
  .form-label { font-size: 11px; margin-bottom: 4px; }
  .form-input, .form-select, .form-textarea { padding: 8px 10px; font-size: 14px; }
  .form-textarea { min-height: 64px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }

  /* Agenda header: compact */
  .agenda-header-bar { flex-direction: row; align-items: center; padding: 12px 0; gap: 10px; }
  .agenda-header-info h2 { font-size: 15px; }
  .agenda-header-info p { font-size: 12px; }

  /* Detail drawer */
  .detail-props { grid-template-columns: 1fr; }

  /* Section headers */
  .dashboard-greeting h1 { font-size: 22px; }
  .dashboard-greeting p { font-size: 13px; }

  /* Page title */
  .page-title { font-size: 16px; }
}

/* ─── MISC UTILITIES ─────────────────────── */

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-rob { color: var(--rob); }
.text-bala { color: var(--bala); }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.recurring-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
}

.recurring-badge svg { width: 10px; height: 10px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.open { display: block; }
