/* COR-X Task Hub — Editorial Redesign */

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

:root {
  --bg: #f5f5f2;
  --bg-card: #ffffff;
  --bg-hover: #f2f1ee;
  --bg-input: #ffffff;
  --bg-sidebar: #efeeeb;
  --bg-inset: #eeedea;
  --bg-main: #fefefe;
  --text: #1a1a1a;
  --text-secondary: #64625d;
  --text-muted: #9c9a95;
  --accent: #FF4D00;
  --accent-hover: #e64500;
  --accent-soft: rgba(255, 77, 0, 0.06);
  --accent-border: rgba(255, 77, 0, 0.15);
  --border: #e5e4e0;
  --border-light: transparent;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
  --shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 40px rgba(44, 47, 48, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.07);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.07);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.07);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.07);
  --sky: #0ea5e9;
  --sky-soft: rgba(14, 165, 233, 0.07);
}

[data-theme="dark"] {
  --bg: #111110;
  --bg-card: #1c1b19;
  --bg-hover: #23221f;
  --bg-input: #1c1b19;
  --bg-sidebar: #161514;
  --bg-inset: #1a1918;
  --bg-main: #161514;
  --text: #eeede8;
  --text-secondary: #9c9a95;
  --text-muted: #6b6963;
  --accent: #ff5c1a;
  --accent-hover: #ff7a42;
  --accent-soft: rgba(255, 92, 26, 0.08);
  --accent-border: rgba(255, 92, 26, 0.2);
  --border: #2a2926;
  --border-light: transparent;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.1);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.1);
}

html, body { height: 100%; height: 100dvh; overflow: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #ff7a42 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(255, 77, 0, 0.25);
  transition: all 0.2s;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 77, 0, 0.3);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid rgba(0,0,0,0.04); border-radius: var(--radius-sm); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-sm { padding: 8px 14px; font-size: 12px; }

/* ===== Login ===== */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

.login-warm-bg {
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 77, 0, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(255, 122, 66, 0.03) 0%, transparent 50%),
              var(--bg);
}
[data-theme="dark"] .login-warm-bg {
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 92, 26, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(255, 122, 66, 0.04) 0%, transparent 50%),
              var(--bg);
}

.login-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: none;
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .login-card {
  background: rgba(26, 25, 23, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.login-logo { height: 24px; width: auto; object-fit: contain; margin-bottom: 24px; }
[data-theme="dark"] .login-logo { content: url('/logo-light.png'); }
.login-card h1 { font-family: 'Manrope', sans-serif; font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.03em; }
.login-card .subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group textarea { resize: vertical; min-height: 56px; }

.login-card .btn-primary { width: 100%; padding: 12px; margin-top: 4px; justify-content: center; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; display: none; }

/* ===== App Layout ===== */

.app { display: none; height: 100vh; height: 100dvh; height: calc(var(--vh, 1vh) * 100); flex-direction: column; }
.app.active { display: flex; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  height: 52px;
  flex-shrink: 0;
  z-index: 100;
}
[data-theme="dark"] .app-header {
  background: rgba(17, 17, 16, 0.85);
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.header-logo { height: 24px; width: auto; object-fit: contain; }
[data-theme="dark"] .header-logo { content: url('/logo-light.png'); }

.header-right { display: flex; align-items: center; gap: 2px; }

.header-right .user-pill {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-inset);
  border-radius: var(--radius);
  margin-right: 6px;
}

.header-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.12s;
}
.header-btn:hover { background: var(--bg-inset); color: var(--text); }
.header-btn svg { width: 18px; height: 18px; }

.app-body { display: flex; flex: 1; overflow: hidden; }

/* ===== Sidebar ===== */

.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  gap: 2px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 20px 14px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.today-dot { background: var(--accent); }
.week-dot { background: #3b82f6; }
.month-dot { background: #8b5cf6; }
.quarter-dot { background: #06b6d4; }
.backlog-dot { background: var(--text-muted); opacity: 0.4; }
.activity-dot { background: var(--success); }
.progress-dot { background: linear-gradient(135deg, var(--accent), var(--purple), var(--sky)); border-radius: 50%; }
.affiliates-dot { background: #10b981; }
.seo-dot { background: #6366f1; }

.nav-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item.active .nav-avatar { background: var(--accent-soft); color: var(--accent); }

.nav-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--text-muted); min-width: 18px; text-align: center; }
.nav-item.active .nav-badge { color: var(--accent); }

.sidebar-spacer { flex: 1; }

/* ===== Main Content ===== */

.main-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 40px;
  min-width: 0;
  transition: margin-right 0.2s;
  background: var(--bg);
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.view-title {
  font-family: 'Manrope', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1.1;
}
.view-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
}

/* ===== Day Pulse ===== */
/* Today pulse bar (merged stats + pulse) */
.today-pulse-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tp-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.tp-stats strong { color: var(--text); font-weight: 700; }
.tp-stat.tp-progress strong { color: var(--accent); }
.tp-stat.tp-done strong { color: var(--success); }
.tp-stat.tp-sub { color: var(--text-muted); font-size: 12px; }
.tp-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.tp-right { display: flex; gap: 6px; align-items: center; }
.tp-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.tp-overdue { background: var(--danger-soft); color: var(--danger); }
.tp-due { background: var(--warning-soft); color: var(--warning); }
.tp-week { background: var(--bg-inset); color: var(--text-muted); }

/* Blocked alert */
.today-alert {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .today-pulse-bar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  .tp-stats { flex-wrap: wrap; gap: 6px; }
  .tp-right { flex-wrap: wrap; }
}

.day-pulse {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.pulse-sep { opacity: 0.4; }
.pulse-progress { color: var(--accent); }
.pulse-done { color: var(--success); }

/* ===== Completed Today Toggle ===== */
.completed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.completed-toggle:hover { color: var(--text); }
.completed-count {
  font-size: 11px;
  background: var(--bg-inset);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.toggle-caret { font-size: 10px; margin-left: 2px; }

/* ===== Quick Add Bar ===== */

.quick-add-bar { margin-bottom: 20px; }

.quick-add-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: var(--bg-inset);
  box-shadow: none;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.quick-add-input::placeholder { color: var(--text-muted); }
.quick-add-input:focus { background: var(--bg-card); box-shadow: 0 0 0 2px var(--accent); }

/* ===== Alert Bar ===== */

.alert-bar {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}
.alert-bar.crit { background: var(--danger-soft); color: var(--danger); }

/* ===== Today Dashboard ===== */

.td-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.td-hello {
  font-family: 'Manrope', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}
.td-summary {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.td-summary strong { color: var(--text); }
.td-warn { color: var(--danger); font-weight: 600; }
.td-due { color: var(--warning); font-weight: 600; }

/* Bento grid */
.td-bento {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  margin-bottom: 20px;
}

/* Velocity card */
.td-velocity {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.td-vel-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.td-vel-title { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); }
.td-vel-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.td-vel-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  min-height: 60px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: none;
}
.td-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.td-bar-track { flex: 1; width: 100%; position: relative; }
.td-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--border);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}
.td-bar-fill.td-bar-today { background: linear-gradient(to top, var(--accent), #ff7a42); }
.td-bar-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.td-bar-label-today { color: var(--accent); }

.td-vel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.td-vs { text-align: center; }
.td-vs-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 2px; }
.td-vs-num { font-family: 'Manrope', sans-serif; font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

/* Right sidebar cards */
.td-side { display: flex; flex-direction: column; gap: 14px; }

.td-quick-add {
  background: linear-gradient(135deg, var(--accent) 0%, #c44400 100%);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.td-quick-add:hover { box-shadow: 0 4px 20px rgba(255, 77, 0, 0.3); transform: translateY(-1px); }
.td-qa-bolt {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 72px;
  height: 72px;
  color: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.td-quick-add:hover .td-qa-bolt { color: rgba(255, 255, 255, 0.15); transform: scale(1.1); transition: all 0.2s; }
.td-qa-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.td-qa-title { font-family: 'Manrope', sans-serif; font-size: 18px; font-weight: 800; color: white; }
.td-qa-hint { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 6px; }

.td-activity {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-height: 0;
}
.td-act-title { font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.td-act-list { display: flex; flex-direction: column; gap: 10px; }
.td-act-item { display: flex; align-items: flex-start; gap: 8px; }
.td-act-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); margin-top: 5px; flex-shrink: 0; }
.td-a-created { background: var(--accent); }
.td-a-completed { background: var(--success); }
.td-a-updated { background: var(--warning); }
.td-act-body { flex: 1; min-width: 0; }
.td-act-text { font-size: 12px; color: var(--text-secondary); line-height: 1.4; display: block; }
.td-act-text strong { color: var(--text); font-weight: 600; }
.td-act-task { color: var(--accent); font-weight: 500; }
.td-act-time { font-size: 10px; color: var(--text-muted); }
.td-act-empty { font-size: 12px; color: var(--text-muted); }

@media (max-width: 900px) {
  .td-bento { grid-template-columns: 1fr; }
  .td-side { flex-direction: row; }
  .td-quick-add { flex: 1; }
  .td-activity { flex: 1; }
}
@media (max-width: 640px) {
  .td-hello { font-size: 26px; }
  .td-bento { gap: 10px; }
  .td-side { flex-direction: column; }
  .td-vel-bars { height: 60px; }
  .td-vs-num { font-size: 18px; }
  .td-quick-add { padding: 14px 16px; }
  .td-qa-title { font-size: 16px; }
}

/* Critical tasks strip */
.td-crit-section { margin-bottom: 20px; }
.td-crit-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.td-crit-title { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); }
.td-crit-count { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-inset); padding: 2px 8px; border-radius: 10px; }

.td-crit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.td-crit-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.td-crit-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.td-cc-top { margin-bottom: 10px; }
.td-cc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.td-cc-urgent { background: var(--danger-soft); color: var(--danger); }
.td-cc-high { background: var(--warning-soft); color: var(--warning); }

.td-cc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.td-cc-progress { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.td-cc-bar { flex: 1; height: 4px; background: var(--bg-inset); border-radius: 3px; overflow: hidden; }
.td-cc-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.td-cc-st { font-size: 11px; color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }

.td-cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: none;
}
.td-cc-due { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.td-cc-due.td-cc-overdue { color: var(--danger); }
.td-cc-owner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

@media (max-width: 640px) {
  .td-crit-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .td-crit-card { padding: 12px; }
  .td-cc-title { font-size: 13px; }
}

/* ===== Today Board ===== */

/* Capacity bar */
.td-capacity-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.td-cap-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 4px;
}
.td-cap-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px 14px 6px 6px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  font-family: inherit;
}
.td-cap-pill:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); transform: translateY(-1px); }
.td-cap-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.td-cap-info { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.td-cap-name { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1; }
.td-cap-bar-wrap { display: flex; align-items: center; gap: 4px; }
.td-cap-bar { width: 40px; height: 3px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; }
.td-cap-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.td-cap-pct { font-size: 9px; font-weight: 700; color: var(--text-muted); }
.td-cap-sub { font-size: 9px; font-weight: 600; color: var(--text-muted); }

@media (max-width: 640px) {
  .td-capacity-bar { gap: 6px; }
  .td-cap-pill { padding: 5px 10px 5px 5px; }
  .td-cap-label { display: none; }
}

.today-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }

.founder-col {
  background: var(--bg-card);
  border: none;
  border-radius: 16px;
  padding: 20px;
  min-height: 120px;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.founder-col:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}
.founder-col.drop-active {
  box-shadow: 0 0 0 2px var(--accent);
  border: none;
}

.founder-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.founder-name { font-family: 'Manrope', sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.founder-count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 500; }

.founder-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.founder-progress { height: 3px; background: var(--bg-inset); border-radius: 2px; margin-bottom: 12px; overflow: hidden; }
.founder-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }

.founder-tasks { min-height: 32px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 0; }

.drop-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 10px;
  line-height: 1.5;
}
.drop-hint strong {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  background: var(--bg-inset);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

/* Pool sections (Up Next / This Month below the board) */
.pool-section {
  margin-top: 28px;
  padding-top: 0;
  border-top: none;
}
.pool-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.pool-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pool-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pool-count { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.pool-tasks {
  background: var(--bg-card);
  border: none;
  padding: 4px 8px;
  box-shadow: var(--shadow-sm);
  border-radius: 16px;
  overflow: visible;
}

.pool-row { cursor: grab; }
.pool-row:active { cursor: grabbing; }

/* Assign buttons on pool tasks (P / L / A) */
.assign-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assign-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.1);
}
.assign-p:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.assign-l:hover { background: var(--purple-soft); color: var(--purple); border-color: var(--purple); }
.assign-a:hover { background: var(--sky-soft); color: var(--sky); border-color: var(--sky); }

/* Remove from today button */
.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  display: flex;
  align-items: center;
}
.task-row:hover .remove-btn { opacity: 0.4; }
.remove-btn:hover { opacity: 1 !important; color: var(--danger); }

.show-more-link {
  display: block;
  width: 100%;
  padding: 8px;
  text-align: center;
  background: none;
  border: none;
  border-top: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.show-more-link:hover { background: var(--accent-soft); }

/* progress-track/progress-fill removed — unused */

/* ===== Task Section ===== */

.task-section { margin-bottom: 24px; }

.task-list-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 4px 8px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 4px 8px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.section-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-inset);
  padding: 2px 8px;
  border-radius: 10px;
}

.show-done-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 4px 0;
}
.show-done-link:hover { color: var(--accent); }
.show-done-link.small { font-size: 11px; margin: 4px 0; display: block; }

.task-list { display: flex; flex-direction: column; }
.empty-small { padding: 12px 0; color: var(--text-muted); font-size: 13px; }

/* ===== Task Row ===== */

.task-row {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  transition: background 0.15s ease, opacity 0.3s, transform 0.3s;
  cursor: default;
  border-bottom: none;
  margin-bottom: 2px;
  min-width: 0;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--bg-card); box-shadow: 0 1px 4px rgba(0,0,0,0.03); }
.task-row.is-expanded { background: var(--bg-hover); }
.task-row.is-new { background: var(--accent-soft); }
.task-row.is-done { opacity: 0.5; }
.task-row.is-done:hover { opacity: 0.7; }
.task-row.completing { opacity: 0; transform: translateX(20px); }
.task-row.dragging { opacity: 0.4; }
.task-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }

.task-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px;
  cursor: pointer;
  border-radius: 8px;
  min-width: 0;
}

/* Inline accordion */
.task-expand {
  padding: 0 12px 14px 42px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.expand-desc { line-height: 1.5; }
.expand-notes {
  background: var(--bg-inset);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.expand-subtasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.expand-st {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
}
.expand-st.done span { text-decoration: line-through; color: var(--text-muted); }
.expand-st input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.expand-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: none;
}
.expand-status {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.expand-edit-btn {
  margin-left: auto;
  background: var(--bg-inset);
  border: none;
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.expand-edit-btn:hover { background: var(--accent-soft); color: var(--accent); }

/* Checkbox */
.check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-top: 2px;
}
.check svg { width: 10px; height: 10px; display: none; }
.check:hover { border-color: var(--success); background: var(--success-soft); }
.check:hover svg { display: block; color: var(--success); opacity: 0.5; }

.check.s-progress { border-color: var(--accent); border-width: 2px; }
.check.s-progress::after { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.check.s-done { border-color: var(--success); background: var(--success); }
.check.s-done svg { display: block; color: white; }
.check.s-done:hover { background: var(--success); border-color: var(--success); opacity: 0.8; }
.check.s-done:hover svg { opacity: 1; }
.check.s-blocked { border-color: var(--danger); }
.check.s-blocked::after { content: ''; width: 6px; height: 6px; background: var(--danger); border-radius: 50%; }
.tr-pri-critical > .task-main > .check { border-color: var(--danger); border-width: 2.5px; }
.tr-pri-high > .task-main > .check { border-color: var(--warning); border-width: 2px; }

/* Task body (two-row layout) */
.task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.task-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.task-row.is-done .task-name { text-decoration: line-through; color: var(--text-muted); }

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Priority dot */
.tm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tm-dot-critical { background: var(--danger); }
.tm-dot-high { background: var(--warning); }

/* Subtask progress */
.tm-subtasks {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.tm-st-bar {
  width: 56px;
  height: 5px;
  background: var(--bg-inset);
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
}
.tm-st-fill {
  height: 100%;
  background: var(--st-color, var(--text-muted));
  border-radius: 3px;
  transition: width 0.3s;
  display: block;
}
.tm-st-text { font-variant-numeric: tabular-nums; }

/* Tags */
.tm-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Due date chips (used in meta row) */
.chip { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: var(--bg-inset); color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.chip-danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.chip-warn { background: var(--warning-soft); color: var(--warning); font-weight: 600; }
.chip-muted { background: var(--bg-inset); color: var(--text-muted); }

.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.horizon-chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-inset);
  color: var(--h-color, var(--text-muted));
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.1s;
}
.task-row:hover .horizon-chip { opacity: 0.6; }
.horizon-chip:hover { opacity: 1 !important; background: var(--bg-inset); }

.owner-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.owner-btn:hover { background: var(--accent-soft); color: var(--accent); transform: scale(1.1); }

.focus-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  display: flex;
  align-items: center;
}
.task-row:hover .focus-btn { opacity: 0.5; }
.focus-btn:hover { opacity: 1 !important; color: var(--accent); }

/* Horizon picker dropdown */
.horizon-picker {
  position: fixed;
  z-index: 999;
  background: var(--bg-card);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 130px;
}
.hp-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  transition: background 0.1s;
}
.hp-opt:hover { background: var(--bg-hover); }
.hp-opt.hp-current { font-weight: 600; }
.hp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--h-color);
  flex-shrink: 0;
}

/* ===== Side Panel ===== */

.side-panel {
  width: 0;
  overflow: hidden;
  background: var(--bg-card);
  border-left: none;
  box-shadow: -1px 0 3px rgba(0,0,0,0.02);
  transition: width 0.2s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.panel-open .side-panel {
  width: 380px;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
  flex-shrink: 0;
}

.panel-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.panel-close:hover { background: var(--bg-hover); color: var(--text); }

.panel-body { padding: 8px 20px 20px; }

.panel-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.panel-title-row .check { margin-top: 4px; }

.panel-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  outline: none;
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.1s;
}
.panel-title:focus { background: var(--bg-inset); }
.panel-title.done { text-decoration: line-through; color: var(--text-muted); }

.panel-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.panel-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.panel-field select,
.panel-field input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.panel-field select:focus,
.panel-field input:focus { border-color: var(--accent); }

.panel-section { margin-bottom: 16px; }
.panel-section > label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.panel-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  outline: none;
  line-height: 1.5;
}
.panel-textarea:focus { border-color: var(--accent); }
.panel-textarea::placeholder { color: var(--text-muted); }

.panel-subtasks { display: flex; flex-direction: column; gap: 2px; }

.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.subtask-row input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
.subtask-row.done { text-decoration: line-through; color: var(--text-muted); }

.subtask-add {
  width: 100%;
  font-size: 12px;
  padding: 5px 0;
  border: none;
  border-bottom: 1px dashed var(--border);
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: inherit;
  margin-top: 2px;
}
.subtask-add::placeholder { color: var(--text-muted); }
.subtask-add:focus { border-color: var(--accent); }

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: none;
  margin-top: 8px;
}

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

.panel-delete {
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
}
.panel-delete:hover { color: var(--danger); background: var(--danger-soft); }

/* ===== Person View ===== */

.pp-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.pp-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.pp-info { flex: 1; min-width: 0; }
.pp-name { font-family: 'Manrope', sans-serif; font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.pp-role { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.pp-seen { font-size: 11px; color: var(--text-muted); margin-top: 4px; opacity: 0.7; }
.pp-add-btn { flex-shrink: 0; }

.pp-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.pp-ring-card {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.pp-ring { width: 80px; height: 80px; }
.pp-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.pp-ring-pct { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.03em; }
.pp-ring-sub { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.pp-stat-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
}
.pp-stat-num { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.1; }
.pp-stat-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.pp-stat-progress { color: #3b82f6; }
.pp-stat-done { color: var(--success); }
.pp-stat-blocked { color: var(--danger); }

.pp-priority-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pp-pri-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
}
.pp-pri-critical { background: var(--danger-soft); color: var(--danger); }
.pp-pri-high { background: var(--warning-soft); color: var(--warning); }
.pp-pri-medium { background: var(--accent-soft); color: var(--accent); }

.pp-horizon-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.pp-horizon-pills::-webkit-scrollbar { display: none; }
.pp-h-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.pp-h-pill strong {
  color: var(--h-color);
  font-weight: 700;
  font-size: 14px;
}
.pp-h-pill:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.pp-h-pill.pp-h-empty { opacity: 0.45; }
.pp-h-pill.pp-h-empty strong { color: var(--text-muted); }

.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .pp-profile { gap: 12px; }
  .pp-avatar { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
  .pp-name { font-size: 18px; }
  .pp-stats { flex-direction: column; align-items: stretch; padding: 20px; gap: 12px; border-radius: 16px; }
  .pp-ring-card { align-self: center; width: 70px; height: 70px; }
  .pp-ring { width: 70px; height: 70px; }
  .pp-ring-pct { font-size: 16px; }
  .pp-stat-num { font-size: 18px; }
  .pp-stat { padding: 5px 2px; }
  .pp-horizon-pills { gap: 5px; }
  .pp-h-pill { padding: 7px 11px; font-size: 12px; }
  .founder-col { padding: 16px; border-radius: 14px; }
  .task-main { padding: 12px 8px; }
}


/* ===== Activity Feed ===== */

.feed { display: flex; flex-direction: column; }

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  padding-bottom: 8px;
  border-bottom: none;
}

.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
  background: var(--border);
}
.feed-dot.a-created { background: var(--accent); }
.feed-dot.a-completed { background: var(--success); }
.feed-dot.a-updated { background: var(--warning); }
.feed-dot.a-moved { background: var(--purple); }

.feed-body { flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.feed-body strong { color: var(--text); font-weight: 600; }
.feed-task-link { color: var(--accent); font-weight: 500; cursor: pointer; }
.feed-task-link:hover { text-decoration: underline; }
.feed-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.feed-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
  white-space: nowrap;
  margin-top: 1px;
}

.filter-select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}


/* bar-row/label/track/fill/count removed — unused */

/* ===== Search ===== */

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
[data-theme="dark"] .search-overlay { background: rgba(0,0,0,0.5); }
.search-overlay.active { display: flex; }

.search-box {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 40px rgba(44, 47, 48, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  border: none;
  font-size: 15px;
  background: transparent;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.search-results { max-height: 280px; overflow-y: auto; }

.sr-item {
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.08s;
  border-top: none;
}
.sr-item:hover { background: var(--bg-hover); }
.sr-title { font-size: 14px; font-weight: 500; }
.sr-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ===== Modal ===== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(44, 47, 48, 0.06);
}
.modal h2 { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.modal .form-row { display: flex; gap: 10px; }
.modal .form-row .form-group { flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--bg);
  border-radius: 14px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--danger); color: white; }
.toast.success { background: var(--success); color: white; }

.toast-undo {
  background: none;
  border: none;
  color: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
}
.toast-undo:hover { opacity: 1; }

/* ===== Filter Bar ===== */

.filter-bar { display: none; gap: 8px; margin-bottom: 16px; align-items: center; }
.filter-bar.active { display: flex; }
.filter-bar select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
}

/* ===== Empty State ===== */

.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Keyboard Hints ===== */

.kbd-hints {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 5;
}
.kbd-hints kbd {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0px 5px;
  font-size: 10px;
  font-family: 'SF Mono', monospace;
  font-weight: 500;
}

/* ===== Progress View ===== */

.prg-summary {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.prg-summary-stat { flex: 1; text-align: center; }
.prg-summary-num { font-family: 'Manrope', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.prg-summary-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.prg-summary-divider { width: 1px; height: 32px; background: rgba(0,0,0,0.04); margin: 0 8px; flex-shrink: 0; }

.prg-person {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.prg-person-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: none;
}

.prg-person-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.prg-person-name { font-size: 14px; font-weight: 600; color: var(--text); }

.prg-person-nums { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.prg-num-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-inset);
  color: var(--text-secondary);
  white-space: nowrap;
}
.prg-num-active { color: var(--accent); }

.prg-person-body { padding: 10px 18px 14px; }

.prg-section { margin-bottom: 10px; }
.prg-section:last-child { margin-bottom: 0; }

.prg-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 0 6px;
}

.prg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: none;
}
.prg-item:last-child { border-bottom: none; }

.prg-check-icon { width: 12px; height: 12px; color: var(--success); flex-shrink: 0; }
.prg-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prg-item-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.prg-empty { color: var(--text-muted); font-size: 12px; padding: 8px 0; }

.prg-overdue { color: var(--danger); }

.prg-workload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.prg-workload-col {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.prg-workload-col .prg-section-label { margin-bottom: 10px; }

.wl-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wl-bar:last-child { margin-bottom: 0; }
.wl-bar-label { width: 60px; font-size: 12px; color: var(--text-secondary); text-transform: capitalize; flex-shrink: 0; }
.wl-bar-track { flex: 1; height: 5px; background: var(--bg-inset); border-radius: 3px; overflow: hidden; }
.wl-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.wl-bar-num { width: 24px; text-align: right; font-size: 12px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }

/* ===== Scoped access (roles) ===== */
/* applyPermissions() in app.js toggles the `hidden` attribute on nav pieces an
   account cannot open. Author display rules would otherwise beat the UA
   [hidden] style, so make it explicit here. */
.sidebar .nav-item[hidden],
.sidebar .sidebar-label[hidden],
.sidebar .sidebar-divider[hidden],
.mobile-nav button[hidden],
.header-btn[hidden] { display: none !important; }

/* Exactly one allowed view: that view owns the whole canvas, no empty rail. */
body.single-view .sidebar,
body.single-view .mobile-nav { display: none !important; }

/* Keyboard hint strip advertises task shortcuts (N, 1-5, /). */
body.no-tasks .kbd-hints { display: none !important; }

/* ===== Mobile ===== */

.mobile-nav { display: none; }

@media (max-width: 1200px) {
  .today-board { grid-template-columns: 1fr 1fr; }
  .today-board .founder-col:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  /* === Base === */
  html, body { overflow-x: hidden; }
  .main-content { padding: 20px 14px calc(72px + env(safe-area-inset-bottom, 34px)); }
  .kbd-hints { display: none; }
  body.single-view .main-content { padding-bottom: 20px; }

  /* === Header === */
  .app-header { padding: 0 12px; }
  .header-btn { width: 36px; height: 36px; }

  /* === Sidebar (fullscreen overlay) === */
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 52px 0 calc(56px + env(safe-area-inset-bottom, 0px)) 0;
    width: 100%;
    z-index: 150;
    background: var(--bg-sidebar);
    border-right: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.mobile-open .nav-item {
    padding: 10px 14px;
    font-size: 15px;
  }

  /* === Bottom Navigation === */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: none;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.02);
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
  }
  [data-theme="dark"] .mobile-nav {
    background: rgba(17,17,16,0.9);
    border-top: none;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.15);
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    min-width: 48px;
    min-height: 44px;
  }
  .mobile-nav button .m-icon { width: 22px; height: 22px; }
  .mobile-nav button.active { color: var(--accent); font-weight: 600; }

  .app-body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

  /* === Today View === */
  .today-board { grid-template-columns: 1fr; gap: 16px; }
  .founder-col { padding: 20px; min-height: 100px; border-radius: 16px; }
  .founder-name { font-size: 15px; }

  .day-pulse { flex-wrap: wrap; gap: 4px 8px; }

  /* === Task Rows (touch-optimized) === */
  .task-main { padding: 14px 10px; gap: 8px; min-height: 48px; }
  .task-name { font-size: 14px; white-space: normal; line-height: 1.4; }
  .task-body { gap: 5px; }

  .check { width: 26px; height: 26px; }
  .check svg { width: 13px; height: 13px; }

  .task-meta { gap: 5px; }
  .tm-tag { font-size: 9px; padding: 1px 5px; }
  .tm-st-bar { width: 32px; }

  .task-expand { padding: 0 8px 14px 42px; }

  /* Hide action buttons that crowd on mobile */
  .task-actions .horizon-chip { display: none; }
  .task-actions .focus-btn { display: none; }
  .task-actions .owner-btn { width: 24px; height: 24px; font-size: 10px; flex-shrink: 0; }
  .task-actions .assign-btn { width: 26px; height: 26px; font-size: 11px; }
  .remove-btn { opacity: 0.3; }

  /* === Quick Add === */
  .quick-add-input { padding: 14px 16px; font-size: 15px; border-radius: 14px; }

  /* === Side Panel (full overlay) === */
  .panel-open .side-panel {
    position: fixed;
    inset: 48px 0 0 0;
    width: 100%;
    z-index: 150;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel-body { padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .panel-title { font-size: 16px; }
  .panel-field select, .panel-field input { padding: 8px 10px; font-size: 14px; }
  .panel-textarea { font-size: 14px; min-height: 72px; }
  .subtask-row { padding: 6px 0; font-size: 14px; min-height: 36px; }
  .subtask-row input[type="checkbox"] { width: 18px; height: 18px; }
  .subtask-add { padding: 8px 0; font-size: 14px; }


  /* === Progress View === */
  .prg-summary { flex-wrap: wrap; gap: 4px; padding: 12px 14px; }
  .prg-summary-divider { display: none; }
  .prg-summary-stat { min-width: 45%; text-align: left; padding: 4px 0; }
  .prg-summary-num { font-size: 20px; }
  .prg-summary-label { font-size: 10px; }
  .prg-person-header { flex-wrap: wrap; padding: 12px 14px; }
  .prg-person-nums { margin-left: 42px; margin-top: 4px; }
  .prg-person-body { padding: 10px 14px 14px; }
  .prg-workload { grid-template-columns: 1fr; }
  .prg-workload-col { padding: 12px 14px; }


  /* === Modals === */
  .modal {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 20px 16px;
    border-radius: 16px;
  }
  .modal h2 { font-size: 16px; margin-bottom: 14px; }
  .modal .form-row { flex-direction: column; gap: 0; }
  .modal .form-group input, .modal .form-group select, .modal .form-group textarea {
    font-size: 16px;
    padding: 10px 12px;
  }
  .modal-footer { flex-direction: column; gap: 8px; }
  .modal-footer .btn { width: 100%; padding: 12px; font-size: 14px; }

  /* === Search === */
  .search-overlay { padding-top: 6vh; }
  .search-box { max-width: calc(100vw - 24px); border-radius: 16px; }
  .search-input { padding: 14px 16px; font-size: 16px; }
  .sr-item { padding: 12px 16px; }
  .sr-title { font-size: 14px; }

  /* === Toast (above bottom nav) === */
  .toast {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
    font-size: 13px;
  }

  /* === Filter bar === */
  .filter-bar { flex-wrap: wrap; }
  .filter-bar select { font-size: 13px; padding: 8px 12px; }
  .filter-select { font-size: 13px; padding: 8px 12px; }

  /* === View headers === */
  .view-header { flex-direction: column; gap: 8px; }
  .view-title { font-size: 26px; }
  .view-sub { font-size: 12px; }

  /* === Section headers === */
  .section-header { flex-wrap: wrap; }
  .pool-header { flex-wrap: wrap; }

  /* === Activity Feed === */
  .feed-item { padding: 10px 2px; gap: 8px; }
  .feed-body { font-size: 13px; }
  .feed-time { font-size: 10px; }
}

@media (max-width: 640px) {
  .founder-col { padding: 16px; border-radius: 14px; }
  .task-main { padding: 12px 8px; }
  .view-title { font-size: 24px; }
  .quick-add-input { padding: 14px 16px; }
  .btn-primary { padding: 10px 16px; border-radius: 10px; }
}

/* ===== AFFILIATES VIEW ===== */

.aff-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.aff-header h1 { font-family: 'Manrope', sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.aff-header-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.aff-header-actions { display: flex; gap: 8px; }

.aff-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 16px 24px; }
.aff-stat { background: var(--bg-card); border: none; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.aff-stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px; }
.aff-stat-value { font-family: 'Manrope', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.aff-stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

.aff-tabs { display: flex; gap: 0; padding: 0 24px; border-bottom: 1px solid rgba(0,0,0,0.04); }
.aff-tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.aff-tab:hover { color: var(--text-secondary); }
.aff-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.aff-period-btn { padding: 4px 12px; font-size: 11px; font-weight: 500; color: var(--text-muted); background: var(--bg-inset); border: none; border-radius: 4px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.aff-period-btn:hover { color: var(--text-secondary); background: var(--bg-hover); }
.aff-period-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.aff-sortable { cursor: pointer; user-select: none; }
.aff-sortable:hover { color: var(--text-secondary); }

.aff-content { padding: 16px 24px; }
.aff-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: none; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.aff-table th { text-align: left; padding: 10px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg-inset); }
.aff-table td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.aff-table tr:last-child td { border-bottom: none; }
.aff-table tr:hover td { background: var(--bg-hover); }

.aff-mono { font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; font-size: 11px; color: var(--text-secondary); }
.aff-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }
.aff-badge-active { background: var(--success-soft); color: var(--success); }
.aff-badge-paused { background: var(--warning-soft); color: var(--warning); }
.aff-badge-unpaid { background: var(--accent-soft); color: var(--accent); }
.aff-badge-paid { background: var(--success-soft); color: var(--success); }

.aff-filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.aff-filter-bar select, .aff-filter-bar input[type="date"] { padding: 6px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 12px; font-family: inherit; }
.aff-filter-bar input[type="date"] { width: 130px; }

/* Affiliate modal */
.aff-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 300; justify-content: center; align-items: center; }
.aff-modal-overlay.active { display: flex; }
.aff-modal { background: var(--bg-card); border: none; border-radius: var(--radius); padding: 24px; width: 460px; max-width: 90vw; box-shadow: 0 12px 40px rgba(44, 47, 48, 0.06); }
.aff-modal h3 { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.aff-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aff-form-group { margin-bottom: 12px; }
.aff-form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 3px; }
.aff-form-group input, .aff-form-group select { width: 100%; padding: 7px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit; }
.aff-form-group input:focus { outline: none; border-color: var(--accent); }
.aff-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.aff-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }

@media (max-width: 768px) {
  .aff-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .aff-stat { padding: 10px 12px; }
  .aff-stat-value { font-size: 20px; }
  .aff-form-row { grid-template-columns: 1fr; }
  .aff-header { flex-direction: column; gap: 8px; align-items: flex-start; padding: 16px 12px 0; }
  .aff-content { padding: 12px; }
  .aff-table { font-size: 12px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .aff-table th, .aff-table td { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .aff-tabs { padding: 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .aff-tab { padding: 10px 12px; font-size: 12px; white-space: nowrap; }
  .aff-stats { padding: 12px; }
  .aff-filter-bar { gap: 6px; }
  .aff-filter-bar select, .aff-filter-bar input[type="date"] { font-size: 13px; padding: 8px 10px; }
  .aff-modal { padding: 20px 16px; width: calc(100vw - 24px); }
  .aff-form-group input, .aff-form-group select { font-size: 16px; padding: 8px 10px; }
}

/* ===== KNOWLEDGE BASE VIEW ===== */

.kb-dot { background: var(--accent); }

.kb-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.kb-header h1 { font-family: 'Manrope', sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.kb-header-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kb-header-actions { display: flex; gap: 8px; }

.kb-pills { display: flex; gap: 4px; align-items: center; padding: 14px 24px; flex-wrap: wrap; }
.kb-pill { padding: 5px 14px; font-size: 12px; font-weight: 500; color: var(--text-muted); background: var(--bg-inset); border: none; border-radius: var(--radius); cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.kb-pill:hover { color: var(--text-secondary); background: var(--bg-hover); }
.kb-pill.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.kb-pill-count { font-size: 10px; opacity: 0.6; margin-left: 2px; }
.kb-pill.active .kb-pill-count { opacity: 0.8; }

.kb-search { padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 12px; font-family: inherit; width: 200px; transition: border-color 0.15s; }
.kb-search:focus { outline: none; border-color: var(--accent); }

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 0 24px 24px; }

.kb-card { background: var(--bg-card); border: none; border-radius: var(--radius); padding: 20px; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s; box-shadow: var(--shadow); }
.kb-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.kb-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kb-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kb-card-size { font-size: 10px; color: var(--text-muted); font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; }
.kb-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; color: var(--text); }
.kb-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); }
.kb-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }

.kb-cat-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; text-transform: capitalize; }
.kb-cat-marketing { background: var(--warning-soft, rgba(230,126,34,0.12)); color: var(--warning, #e67e22); }
.kb-cat-product { background: rgba(155,89,182,0.12); color: #9b59b6; }
.kb-cat-tech { background: var(--accent-soft); color: var(--accent); }
.kb-cat-finance { background: var(--success-soft, rgba(39,174,96,0.12)); color: var(--success, #27ae60); }
.kb-cat-operations { background: rgba(241,196,15,0.15); color: #d4a800; }
.kb-cat-general { background: var(--bg-inset); color: var(--text-muted); }

.kb-tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; color: var(--text-muted); background: var(--bg-inset); }

.kb-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); font-size: 14px; grid-column: 1 / -1; line-height: 1.6; }

.kb-loading { text-align: center; padding: 60px; color: var(--text-muted); font-size: 13px; }

/* Document viewer */
.kb-viewer-bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: none; box-shadow: 0 1px 3px rgba(0,0,0,0.02); background: var(--bg-card); position: sticky; top: 0; z-index: 10; }
.kb-viewer-info { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; overflow: hidden; }
.kb-viewer-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-viewer-actions { display: flex; gap: 6px; flex-shrink: 0; }

.kb-iframe { width: 100%; height: calc(100vh - 48px - 52px); border: none; background: var(--bg-card); }

/* Upload modal */
.kb-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 300; justify-content: center; align-items: center; }
.kb-modal-overlay.active { display: flex; }
.kb-modal { background: var(--bg-card); border: none; border-radius: var(--radius); padding: 24px; width: 500px; max-width: 90vw; box-shadow: 0 12px 40px rgba(44, 47, 48, 0.06); }
.kb-modal h3 { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 16px; }

/* Drag-and-drop zone */
.kb-dropzone { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.kb-dropzone:hover { border-color: var(--text-muted); }
.kb-dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.kb-dropzone a { color: var(--accent); text-decoration: none; font-weight: 500; }

@media (max-width: 768px) {
  .kb-grid { grid-template-columns: 1fr; padding: 0 12px 24px; gap: 10px; }
  .kb-header { flex-direction: column; gap: 8px; align-items: flex-start; padding: 16px 12px 0; }
  .kb-header-actions { width: 100%; }
  .kb-header-actions .btn { padding: 10px 16px; width: 100%; justify-content: center; }
  .kb-pills { padding: 10px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: wrap; gap: 6px; }
  .kb-pill { flex-shrink: 0; padding: 6px 14px; }
  .kb-search {
    width: 100%;
    order: -1;
    font-size: 16px;
    padding: 10px 12px;
    margin-bottom: 4px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
  }
  .kb-pills > div[style*="flex:1"] { display: none; }
  .kb-card { padding: 14px; }
  .kb-card-title { font-size: 14px; }
  .kb-viewer-bar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .kb-viewer-info { font-size: 12px; }
  .kb-viewer-actions { width: 100%; justify-content: space-between; }
  .kb-viewer-actions .btn { padding: 8px 12px; font-size: 12px; }
  .kb-iframe { height: calc(100dvh - 48px - 90px - 56px - env(safe-area-inset-bottom, 0px)); }
  .kb-modal { padding: 20px 16px; width: calc(100vw - 24px); }
  .kb-dropzone { padding: 16px; }
  .cc-metric-strip { flex-direction: column; }
  .cc-metric { border-right: none; border-bottom: 1px solid var(--border); }
  .cc-metric:last-child { border-bottom: none; }
  .cc-post-grid { grid-template-columns: 1fr; }
  .cc-split { grid-template-columns: 1fr; }
  .cc-prod-row { grid-template-columns: 1fr; gap: 4px; }
  .cc-prod-track { display: none; }
  .cc-profile { flex-direction: column; text-align: center; }
  .cc-profile-nums { justify-content: center; }
}

/* ===== WAR ROOM ===== */

.nav-warroom {
  background: rgba(239, 68, 68, 0.06) !important;
  border: 1px solid rgba(239, 68, 68, 0.12) !important;
  border-radius: 8px !important;
  margin: 4px 8px !important;
  color: #dc2626 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 0.02em;
}
.nav-warroom .nav-ico { opacity: 0.8 !important; color: #dc2626; }
.nav-warroom:hover { background: rgba(239, 68, 68, 0.1) !important; }
.nav-warroom.active { background: rgba(239, 68, 68, 0.14) !important; color: #dc2626 !important; }
[data-theme="dark"] .nav-warroom { color: #f87171 !important; }
[data-theme="dark"] .nav-warroom .nav-ico { color: #f87171; }

.wr {
  --wr-bg: var(--bg);
  --wr-surface: var(--bg-card);
  --wr-surface-2: var(--bg-inset);
  --wr-border: var(--border);
  --wr-border-subtle: var(--border);
  --wr-text: var(--text);
  --wr-text-2: var(--text-secondary);
  --wr-text-3: var(--text-muted);
  --wr-red: #dc2626;
  --wr-red-soft: rgba(220,38,38,0.06);
  --wr-amber: #d97706;
  --wr-amber-soft: rgba(217,119,6,0.06);
  --wr-green: #16a34a;
  --wr-green-soft: rgba(22,163,74,0.06);
  color: var(--wr-text-2);
  font-family: Inter, -apple-system, sans-serif;
}

[data-theme="dark"] .wr {
  --wr-red: #f87171;
  --wr-red-soft: rgba(248,113,113,0.08);
  --wr-amber: #fbbf24;
  --wr-amber-soft: rgba(251,191,36,0.08);
  --wr-green: #4ade80;
  --wr-green-soft: rgba(74,222,128,0.08);
}

.wr-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--wr-border-subtle);
}
.wr-header-left { display: flex; align-items: center; gap: 14px; }
.wr-pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--wr-red);
  box-shadow: 0 0 12px rgba(220,38,38,0.4), 0 0 24px rgba(220,38,38,0.15);
  animation: wrPulse 2s ease-in-out infinite;
}
@keyframes wrPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}
.wr-title {
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 14px; font-weight: 700; color: var(--wr-text);
  letter-spacing: 0.15em; text-transform: uppercase;
}
.wr-subtitle {
  font-family: 'SF Mono', monospace; font-size: 11px;
  color: var(--wr-text-3); letter-spacing: 0.04em; margin-top: 2px;
}
.wr-status {
  display: flex; align-items: center; gap: 8px;
  font-family: 'SF Mono', monospace; font-size: 11px; letter-spacing: 0.08em;
}
.wr-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.wr-status-dot.standby { background: var(--wr-amber); box-shadow: 0 0 8px rgba(217,119,6,0.4); }
.wr-status-dot.live { background: var(--wr-green); box-shadow: 0 0 8px rgba(22,163,74,0.4); animation: wrPulse 2s ease-in-out infinite; }
.wr-status-dot.alert { background: var(--wr-red); box-shadow: 0 0 8px rgba(220,38,38,0.4); animation: wrPulse 1s ease-in-out infinite; }
.wr-status-text { color: var(--wr-amber); font-weight: 600; }

.wr-alert {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--wr-amber-soft); border: 1px solid rgba(217,119,6,0.2);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 24px;
  color: var(--wr-amber);
}
.wr-alert-title { font-size: 13px; font-weight: 600; color: var(--wr-amber); margin-bottom: 3px; }
.wr-alert-text { font-size: 12px; color: var(--wr-text-2); line-height: 1.5; }

.wr-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 10px; margin-bottom: 28px;
}
.wr-card {
  background: var(--wr-surface); border: 1px solid var(--wr-border-subtle);
  border-radius: 10px; padding: 18px 20px;
}
.wr-card-hero {
  position: relative; overflow: hidden;
  border-color: var(--wr-border);
  background: var(--wr-red-soft);
}
.wr-card-hero::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--wr-red), transparent);
}
.wr-card-label {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--wr-text-3); letter-spacing: 0.1em; margin-bottom: 10px;
}
.wr-card-value {
  font-family: 'SF Mono', monospace; font-size: 26px; font-weight: 700;
  color: var(--wr-text); line-height: 1; letter-spacing: -0.02em;
}
.wr-card-value-huge { font-size: 40px; }
.wr-card-sub { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--wr-text-3); margin-top: 8px; }
.wr-card-target {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--wr-green); margin-top: 6px; opacity: 0.7;
}

.wr-section { margin-bottom: 28px; }
.wr-section-title {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--wr-text-3); letter-spacing: 0.12em;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--wr-border-subtle);
}

.wr-empty-table {
  background: var(--wr-surface); border: 1px solid var(--wr-border-subtle);
  border-radius: 10px; overflow: hidden;
}
.wr-empty-table-head {
  display: flex; gap: 12px; padding: 10px 18px;
  background: var(--wr-surface-2);
  font-family: 'SF Mono', monospace; font-size: 10px;
  color: var(--wr-text-3); letter-spacing: 0.06em;
}
.wr-empty-table-head span { flex: 1; }
.wr-empty-table-body {
  padding: 40px 20px; text-align: center; color: var(--wr-text-3);
}

.wr-budget-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.wr-budget-card {
  background: var(--wr-surface); border: 1px solid var(--wr-border-subtle);
  border-radius: 10px; padding: 18px 20px;
}
.wr-budget-bar {
  height: 4px; background: var(--wr-surface-2); border-radius: 2px;
  overflow: hidden; margin: 10px 0 6px;
}
.wr-budget-fill { height: 100%; background: var(--wr-red); border-radius: 2px; transition: width 0.4s; }

.wr-alerts-empty { display: flex; flex-direction: column; gap: 6px; }
.wr-alert-rule {
  display: flex; align-items: center; gap: 10px;
  background: var(--wr-surface); border: 1px solid var(--wr-border-subtle);
  border-radius: 8px; padding: 12px 16px; font-size: 12px; color: var(--wr-text-2);
}
.wr-rule-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.wr-rule-dot.green { background: var(--wr-green); box-shadow: 0 0 6px rgba(22,163,74,0.3); }
.wr-rule-dot.amber { background: var(--wr-amber); box-shadow: 0 0 6px rgba(217,119,6,0.3); }
.wr-rule-dot.red { background: var(--wr-red); box-shadow: 0 0 6px rgba(220,38,38,0.3); }
.wr-rule-status {
  margin-left: auto; font-family: 'SF Mono', monospace; font-size: 10px;
  font-weight: 600; color: var(--wr-green); letter-spacing: 0.04em; opacity: 0.7;
}

.wr-connect-grid { display: flex; flex-direction: column; gap: 8px; }
.wr-connect-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--wr-surface); border: 1px dashed var(--wr-border);
  border-radius: 10px; padding: 16px 20px; cursor: pointer;
  color: var(--wr-text-2); transition: all 0.2s; text-align: left;
  font-family: Inter, sans-serif;
}
.wr-connect-btn:hover { background: var(--wr-surface-2); border-style: solid; }
.wr-connect-badge {
  margin-left: auto; font-family: 'SF Mono', monospace; font-size: 10px;
  font-weight: 600; color: var(--wr-red); letter-spacing: 0.04em;
  padding: 4px 10px; border: 1px solid var(--wr-border); border-radius: 6px;
}

.wr-footer {
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--wr-border-subtle);
}
.wr-footer-text { font-family: 'SF Mono', monospace; font-size: 12px; color: var(--wr-text-2); }
.wr-footer-text strong { color: var(--wr-text); }
.wr-footer-sub { font-size: 11px; color: var(--wr-text-3); margin-top: 4px; }

@media (max-width: 768px) {
  .wr { }
  .wr-grid { grid-template-columns: 1fr 1fr; }
  .wr-budget-grid { grid-template-columns: 1fr; }
  .wr-empty-table-head { display: none; }
  .wr-card-value-huge { font-size: 28px; }
}

/* ===== NAV REDESIGN ===== */

.nav-ico {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.5;
}

.nav-item.active .nav-ico { opacity: 1; }

.nav-chevron {
  width: 10px; height: 10px; margin-left: auto; opacity: 0.4;
  transition: transform 0.2s ease;
}

.nav-expand-trigger.expanded .nav-chevron { transform: rotate(180deg); }

.nav-sub {
  display: none;
}

.nav-sub.open {
  display: flex;
  flex-direction: column;
  animation: navSlideDown 0.2s ease;
}

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

.nav-sub-item { padding-left: 34px !important; font-size: 12px !important; }

.sidebar-divider {
  height: 1px; background: var(--border); margin: 8px 14px;
}

/* ===== COMMAND CENTER: PULSE COMPONENTS ===== */

.briefing-dot { background: var(--accent); }
.ig-dot { background: #e1306c; }
.revenue-dot { background: var(--success); }

/* Metric strip */
.cc-metric-strip {
  display: flex; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.cc-metric {
  flex: 1; padding: 18px 22px; border-right: 1px solid var(--border);
}
.cc-metric:last-child { border-right: none; }
.cc-metric-val {
  font-family: 'SF Mono', 'Cascadia Code', monospace; font-size: 24px; font-weight: 700;
  color: var(--text); line-height: 1; letter-spacing: -0.02em;
}
.cc-metric-label {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 8px;
}
.cc-metric-sub {
  font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.cc-delta-pos { color: var(--success); }
.cc-delta-neg { color: var(--danger); }

/* Target bar */
.cc-target { margin-bottom: 20px; }
.cc-target-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-secondary); margin-bottom: 8px;
}
.cc-target-row strong { color: var(--text); font-weight: 600; }
.cc-target-track { height: 4px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; }
.cc-target-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease; }
.cc-target-note { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); margin-top: 8px; }

/* Chart */
.cc-chart-wrap {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.cc-chart-title {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px;
}
.cc-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; position: relative; }
.cc-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.cc-bar { width: 100%; border-radius: 2px 2px 0 0; transition: opacity 0.15s; cursor: default; }
.cc-bar.filled { background: var(--accent); opacity: 0.45; }
.cc-bar.filled:hover { opacity: 0.8; }
.cc-bar.empty { background: var(--bg-inset); min-height: 1px; opacity: 0.5; }
.cc-bar.future { border: 1px dashed var(--border); opacity: 0.3; background: transparent; }
.cc-bar-lbl { position: absolute; bottom: -15px; font-family: 'SF Mono', monospace; font-size: 8px; color: var(--text-muted); }

/* Section labels */
.cc-section-label {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em;
  margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* Insights */
.cc-insights { margin-bottom: 16px; }
.cc-insight {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  padding: 5px 0 5px 14px; position: relative;
}
.cc-insight::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0.5;
}

/* Feed */
.cc-feed { margin-bottom: 16px; }
.cc-feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.cc-feed-item:last-child { border-bottom: none; }
.cc-feed-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-inset);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600; color: var(--text-muted);
}
.cc-feed-body { flex: 1; min-width: 0; }
.cc-feed-author { font-size: 12px; font-weight: 500; color: var(--text); }
.cc-feed-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; margin-top: 1px; }
.cc-feed-meta { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Post grid */
.cc-post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.cc-post-item {
  padding: 14px 0; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.cc-post-item:hover { background: var(--bg-hover); margin: 0 -8px; padding: 14px 8px; border-radius: var(--radius-sm); }
.cc-post-caption { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-post-stats { display: flex; gap: 12px; font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-muted); }
.cc-post-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cc-post-date { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); }
.cc-post-author { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--accent); }
.cc-post-tag { font-family: 'SF Mono', monospace; font-size: 9px; font-weight: 500; color: var(--text-muted); background: var(--bg-inset); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }

/* Profile card */
.cc-profile {
  display: flex; align-items: center; gap: 18px; padding: 18px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.cc-profile-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: Manrope, sans-serif; font-size: 15px; font-weight: 700; color: var(--accent);
}
.cc-profile-info { flex: 1; }
.cc-profile-name { font-size: 15px; font-weight: 600; color: var(--text); }
.cc-profile-handle { font-family: 'SF Mono', monospace; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.cc-profile-bio { font-size: 12px; color: var(--text-secondary); margin-top: 4px; max-width: 50ch; line-height: 1.4; }
.cc-profile-nums { display: flex; gap: 20px; }
.cc-pnum { text-align: center; }
.cc-pnum-val { font-family: 'SF Mono', monospace; font-size: 17px; font-weight: 600; color: var(--text); }
.cc-pnum-lbl { font-family: 'SF Mono', monospace; font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Pills */
.cc-pills { display: flex; background: var(--bg-inset); border-radius: var(--radius-sm); padding: 2px; gap: 1px; }
.cc-pill {
  padding: 4px 12px; border-radius: 8px; font-size: 11px; font-weight: 500;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer; transition: all 0.15s;
}
.cc-pill:hover { color: var(--text-secondary); }
.cc-pill.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }

/* Working / Flopping */
.cc-wf { margin-bottom: 16px; }
.cc-wf-group { margin-bottom: 16px; }
.cc-wf-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.cc-wf-tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cc-wf-tag.working { color: var(--success); }
.cc-wf-tag.flopping { color: var(--danger); }
.cc-wf-entry { padding: 6px 0; border-bottom: 1px solid var(--border); }
.cc-wf-entry:last-child { border-bottom: none; }
.cc-wf-stats { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.cc-wf-stats strong { color: var(--text-secondary); }
.cc-wf-cap { font-size: 13px; color: var(--text); }

/* Products */
.cc-products { margin-bottom: 16px; }
.cc-prod-row { display: grid; grid-template-columns: 160px 1fr 70px 50px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.cc-prod-row:last-child { border-bottom: none; }
.cc-prod-name { font-size: 13px; color: var(--text); }
.cc-prod-track { height: 4px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; }
.cc-prod-bar { height: 100%; background: var(--accent); border-radius: 2px; opacity: 0.5; }
.cc-prod-rev { font-family: 'SF Mono', monospace; font-size: 12px; color: var(--text-secondary); text-align: right; }
.cc-prod-pct { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-muted); text-align: right; }

/* Split cards */
.cc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.cc-split-item { background: var(--bg-card); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.cc-split-label { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.cc-split-val { font-family: 'SF Mono', monospace; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.cc-split-detail { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── FINANCIALS MODULE ── */

.fin-tabs {
  display: flex; gap: 4px; padding: 0 0 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.fin-tabs::-webkit-scrollbar { display: none; }
.fin-tab {
  padding: 8px 16px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.fin-tab:hover { background: var(--bg-hover); color: var(--text); }
.fin-tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.fin-kpi-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px;
}
.fin-kpi-grid.four { grid-template-columns: repeat(4, 1fr); }
.fin-kpi {
  background: var(--bg-card); border-radius: var(--radius-sm); padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.fin-kpi-val {
  font-family: 'SF Mono', monospace; font-size: 22px; font-weight: 700;
  color: var(--text); line-height: 1; margin-bottom: 6px;
}
.fin-kpi-label {
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.fin-kpi-sub {
  font-family: 'SF Mono', monospace; font-size: 11px; color: var(--text-muted);
}

.fin-zone-alert {
  padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px;
  font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px;
}
.fin-zone-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  animation: finPulse 2s infinite;
}
@keyframes finPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.fin-zone-alert.red { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(220,38,38,0.2); }
.fin-zone-alert.red .fin-zone-dot { background: var(--danger); }
.fin-zone-alert.yellow { background: var(--warning-soft); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.fin-zone-alert.yellow .fin-zone-dot { background: var(--warning); }
.fin-zone-alert.green { background: var(--success-soft); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.fin-zone-alert.green .fin-zone-dot { background: var(--success); }

.fin-chart-card {
  background: var(--bg-card); border-radius: var(--radius-sm); padding: 20px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.fin-chart-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px;
}
.fin-chart-wrap { position: relative; width: 100%; }
.fin-chart-wrap canvas { touch-action: pan-y !important; }

.fin-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 4px;
}

.fin-section-label {
  font-family: Manrope, 'Inter', sans-serif; font-weight: 700; font-size: 14px;
  color: var(--text); margin: 24px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Waterfall bars */
.fin-waterfall-container { margin-bottom: 24px; }
.fin-waterfall-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.fin-waterfall-label {
  width: 220px; flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fin-waterfall-track {
  flex: 1; display: flex; height: 24px; border-radius: 4px; overflow: hidden;
  background: var(--bg-inset);
}
.fin-waterfall-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff; white-space: nowrap;
  transition: width 0.4s ease;
}
.fin-waterfall-cm {
  width: 50px; text-align: right; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.fin-waterfall-legend {
  display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap;
}
.fin-legend-dot {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 4px;
}

/* Tables */
.fin-table-wrap { overflow-x: auto; margin-bottom: 24px; }
.fin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.fin-table thead th {
  background: var(--bg-inset); padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.fin-table tbody td {
  padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap;
}
.fin-table tbody tr:hover { background: var(--bg-hover); }
.fin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fin-table thead th.num { text-align: right; }

.fin-cm-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.fin-cm-badge.high { background: var(--success-soft); color: var(--success); }
.fin-cm-badge.mid { background: var(--warning-soft); color: var(--warning); }
.fin-cm-badge.low { background: var(--danger-soft); color: var(--danger); }

/* Cohort heatmap */
.fin-cohort-table {
  width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums;
}
.fin-cohort-table th {
  padding: 8px 10px; font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--text-secondary); border-bottom: 1px solid var(--border);
  text-align: center;
}
.fin-cohort-table th:first-child { text-align: left; }
.fin-cohort-table td {
  padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500;
}
.fin-cohort-label { text-align: left !important; color: var(--text-secondary) !important; font-weight: 600 !important; }
.fin-cohort-cell {
  border-radius: 4px; padding: 3px 6px; display: inline-block; min-width: 50px; font-size: 11px;
}

/* Segmentation */
.fin-seg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.fin-seg-card {
  background: var(--bg-card); border-radius: var(--radius-sm); padding: 20px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.fin-seg-val { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; }
.fin-seg-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.fin-seg-pct { font-size: 12px; color: var(--text-muted); }

/* Zone badge (table) */
.fin-zone-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px;
}
.fin-zone-badge.red { background: var(--danger-soft); color: var(--danger); }
.fin-zone-badge.yellow { background: var(--warning-soft); color: var(--warning); }
.fin-zone-badge.green { background: var(--success-soft); color: var(--success); }

/* Scenario cards */
.fin-scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.fin-scenario-card {
  background: var(--bg-card); border-radius: var(--radius-sm); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.fin-scenario-header { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.fin-scenario-roas { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.fin-scenario-row { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.fin-scenario-row strong { color: var(--text); }

/* Mobile */
@media (max-width: 768px) {
  .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-kpi-grid.four { grid-template-columns: repeat(2, 1fr); }
  .fin-two-col { grid-template-columns: 1fr; }
  .fin-seg-grid { grid-template-columns: 1fr; }
  .fin-scenario-grid { grid-template-columns: 1fr; }
  .fin-waterfall-label { width: 140px; font-size: 11px; }
  .fin-chart-wrap { min-height: 200px; }
  .fin-table-wrap { position: relative; }
  .fin-table-wrap::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 24px;
    background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none;
  }
  .fin-cohort-table { font-size: 11px; }
  .fin-cohort-cell { min-width: 40px; padding: 2px 4px; font-size: 10px; }
  #fin-content { padding-bottom: 24px; }
}
@media (max-width: 600px) {
  .fin-tabs { gap: 2px; padding-bottom: 12px; }
  .fin-tab { padding: 6px 12px; font-size: 12px; }
  .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-kpi-grid.four { grid-template-columns: repeat(2, 1fr); }
  .fin-waterfall-row { flex-wrap: wrap; }
  .fin-waterfall-label { width: 100%; margin-bottom: 2px; }
  .fin-kpi-val { font-size: 18px; }
  .fin-zone-alert { font-size: 12px; padding: 12px 14px; }
}

/* ── INSTAGRAM REDESIGN ── */

/* Health bar */
.ig-health {
  background: var(--bg-card); border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.ig-health-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ig-health-bar { height: 8px; background: var(--bg-inset); border-radius: 4px; overflow: hidden; }
.ig-health-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

/* Post performance table */
.ig-table { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.ig-table-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: var(--bg-inset); font-family: 'SF Mono', monospace; font-size: 10px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.ig-table-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); transition: background 0.1s;
}
.ig-table-row:last-child { border-bottom: none; }
.ig-table-row:hover { background: var(--bg-hover); }
.ig-table-caption { font-size: 13px; color: var(--text); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-table-meta { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); }

/* Performance split (Top vs Bottom) */
.ig-perf-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px; }
.ig-perf-col { display: flex; flex-direction: column; gap: 0; }
.ig-perf-header {
  display: flex; align-items: center; gap: 8px;
  font-family: 'SF Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 10px; margin-bottom: 4px;
}
.ig-perf-dot { width: 6px; height: 6px; border-radius: 50%; }
.ig-perf-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ig-perf-row:last-child { border-bottom: none; }
.ig-perf-rank {
  font-family: 'SF Mono', monospace; font-size: 12px; font-weight: 700;
  width: 24px; flex-shrink: 0; padding-top: 1px;
}
.ig-perf-body { flex: 1; min-width: 0; }
.ig-perf-caption {
  font-size: 13px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ig-perf-bar-wrap { height: 4px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; margin: 8px 0 6px; }
.ig-perf-bar { height: 100%; border-radius: 2px; opacity: 0.5; transition: width 0.4s ease; }
.ig-perf-meta { font-family: 'SF Mono', monospace; font-size: 10px; color: var(--text-muted); }
.ig-perf-takeaway {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  padding: 14px 0; margin-bottom: 8px;
}
.ig-perf-takeaway strong { color: var(--text); font-weight: 600; }

@media (max-width: 768px) {
  .ig-perf-split { grid-template-columns: 1fr; gap: 16px; }
}

/* Action items */
.ig-actions { margin-bottom: 20px; }
.ig-action {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px;
  margin-bottom: 4px; border-radius: var(--radius-sm);
  background: var(--bg-card); transition: background 0.15s;
}
.ig-action:hover { background: var(--bg-hover); }
.ig-action-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ig-action-text { font-size: 13px; color: var(--text); line-height: 1.55; }

@media (max-width: 768px) {
  .ig-wf-grid { grid-template-columns: 1fr; }
  .ig-table-head { display: none; }
  .ig-table-row { flex-wrap: wrap; gap: 6px; }
}

/* CRM styles moved to crm.css */

/* Archive view + archive results in search (migration 052 working set) */
.sr-section { padding: 10px 12px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.archive-row { cursor: pointer; }
