/* Birdi — style.css */
/* Font: Sora (display) + JetBrains Mono (code/data) */

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

:root {
  /* Brand */
  --brand:        #4B6EF5;
  --brand-2:      #7B4FD4;
  --brand-grad:   linear-gradient(135deg, #7B4FD4 0%, #4B6EF5 100%);
  --brand-glow:   rgba(75, 110, 245, 0.2);

  /* Light mode (default) */
  --bg:           #F4F5F7;
  --bg-2:         #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #F4F5F7;
  --surface-3:    #EAECF0;

  /* Borders */
  --border:       rgba(0,0,0,0.08);
  --border-2:     rgba(0,0,0,0.14);

  /* Text */
  --text:         #111827;
  --text-2:       #4B5563;
  --text-3:       #9CA3AF;

  /* Status */
  --green:        #059669;
  --green-bg:     rgba(5, 150, 105, 0.1);
  --yellow:       #D97706;
  --yellow-bg:    rgba(217, 119, 6, 0.1);
  --red:          #DC2626;
  --red-bg:       rgba(220, 38, 38, 0.1);
  --blue:         #2563EB;
  --blue-bg:      rgba(37, 99, 235, 0.1);

  /* Source colors */
  --c-gmail:      #EA4335;
  --c-linkedin:   #0A66C2;
  --c-reddit:     #FF4500;
  --c-ph:         #DA552F;
  --c-stripe:     #635BFF;
  --c-supabase:   #10B981;
  --c-cf:         #F6821F;
  --c-github:     #24292F;

  /* Layout */
  --sidebar-w:    220px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;

  /* Font */
  --font:         'Sora', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* Dark mode — applied via .dark class on <html> */
html.dark {
  --bg:           #0D0F18;
  --bg-2:         #12151F;
  --surface:      #181B27;
  --surface-2:    #1E2130;
  --surface-3:    #252838;
  --border:       rgba(255,255,255,0.07);
  --border-2:     rgba(255,255,255,0.12);
  --text:         #F0F0F8;
  --text-2:       #9B9DB8;
  --text-3:       #5A5C78;
  --green:        #10B981;
  --green-bg:     rgba(16, 185, 129, 0.12);
  --yellow:       #F59E0B;
  --yellow-bg:    rgba(245, 158, 11, 0.12);
  --red:          #EF4444;
  --red-bg:       rgba(239, 68, 68, 0.12);
  --blue:         #3B82F6;
  --blue-bg:      rgba(59, 130, 246, 0.12);
  --c-github:     #E6EDF3;
  --brand-glow:   rgba(75, 110, 245, 0.25);
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

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

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark { display: flex; align-items: center; }
.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 1px;
  position: relative;
}
.nav-item i { font-size: 16px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: rgba(75, 110, 245, 0.12);
  color: var(--brand);
  font-weight: 500;
}
.nav-item.active i { color: var(--brand); }

.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--font-mono);
}
.nav-badge.review { background: rgba(245, 158, 11, 0.2); color: var(--yellow); }

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

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.project-switcher:hover { background: var(--surface); }
.project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-name { flex: 1; }
.project-switcher i { font-size: 13px; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--surface); }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 500; color: var(--text); }
.user-role { font-size: 10px; color: var(--text-3); }

/* ─── Main ──────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view { display: none; flex: 1; overflow-y: auto; flex-direction: column; }
.view.active { display: flex; }

/* ─── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-left h1 { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-left p { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  border: none; cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--brand-grad);
  color: white;
  box-shadow: 0 0 20px var(--brand-glow);
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 0 30px var(--brand-glow); }
.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text-2); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

/* ─── Section ───────────────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
}
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg); color: var(--red); }
.badge-blue   { background: var(--blue-bg); color: var(--blue); }
.badge-brand  { background: rgba(75,110,245,0.15); color: var(--brand); }

/* ─── Signal items ──────────────────────────────────────────────────────────── */
.signal-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.signal-item:last-child { border-bottom: none; }
.signal-item:hover { background: var(--surface-2); }
.signal-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}
.signal-item.cleared { opacity: 0.4; }

.signal-source-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.signal-content { flex: 1; min-width: 0; }
.signal-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.signal-detail { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.signal-time { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.signal-project { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-3); }

.signal-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.signal-item:hover .signal-actions { opacity: 1; }
.signal-action-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: none; background: var(--surface-3);
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.1s;
}
.signal-action-btn:hover { background: var(--surface-2); color: var(--text); }
.signal-action-btn.starred { color: var(--yellow); }
.signal-action-btn.cleared { color: var(--green); }

/* ─── Drawer ────────────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  background: var(--bg-2);
  border-left: 1px solid var(--border-2);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-close {
  width: 28px; height: 28px;
  border-radius: 6px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: all 0.1s;
}
.drawer-close:hover { color: var(--text); background: var(--surface-2); }
.drawer-source-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-2);
}

.drawer-body {
  flex: 1; overflow-y: auto;
  padding: 20px;
}
.drawer-signal-title {
  font-size: 20px; font-weight: 600; color: var(--text);
  line-height: 1.3; margin-bottom: 8px;
}
.drawer-signal-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.drawer-signal-meta span { font-size: 12px; color: var(--text-3); }
.drawer-signal-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.drawer-metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 24px;
}
.drawer-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.drawer-metric-val {
  font-size: 22px; font-weight: 600; color: var(--text);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}
.drawer-metric-label { font-size: 11px; color: var(--text-3); }
.drawer-metric-delta {
  font-size: 11px; font-weight: 500;
  margin-top: 4px;
  font-family: var(--font-mono);
}
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }

.drawer-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 8px; margin-top: 20px;
}

.drawer-related { display: flex; flex-direction: column; gap: 6px; }
.drawer-related-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.drawer-related-item i { font-size: 14px; }

.drawer-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.drawer-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 500; font-family: var(--font);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
}
.drawer-action-btn:hover { background: var(--surface-2); color: var(--text); }
.drawer-action-btn.primary {
  grid-column: span 2;
  background: var(--brand-grad);
  color: white; border-color: transparent;
  box-shadow: 0 0 20px var(--brand-glow);
  font-size: 13px;
}
.drawer-action-btn.primary:hover { opacity: 0.9; }
.drawer-action-btn i { font-size: 14px; }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 560px; max-width: calc(100vw - 32px);
  max-height: 85vh;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  z-index: 70;
  opacity: 0; pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }

.review-modal {
  width: 620px;
  max-height: 88vh;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--text);
}
.modal-title i { color: var(--brand); }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: all 0.1s;
}
.modal-close:hover { color: var(--text); }

.modal-body { flex: 1; overflow-y: auto; padding: 20px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-2); margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13px; font-family: var(--font);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
  resize: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-textarea { min-height: 72px; line-height: 1.5; }
.form-select { cursor: pointer; }
.form-select option { background: var(--surface-2); }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.metric-input-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.metric-input-label { font-size: 10px; color: var(--text-3); margin-bottom: 4px; }
.metric-input-name { font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.metric-row { display: flex; gap: 6px; align-items: center; }
.metric-val {
  flex: 1; padding: 5px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; font-family: var(--font-mono); color: var(--text);
  outline: none;
}
.metric-val:focus { border-color: var(--brand); }
.metric-arrow { color: var(--text-3); font-size: 12px; }

.review-period {
  display: flex; gap: 8px; margin-top: 8px;
}
.review-option {
  flex: 1; padding: 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  transition: all 0.15s;
}
.review-option:hover { border-color: var(--brand); color: var(--brand); }
.review-option.selected { border-color: var(--brand); background: rgba(75,110,245,0.1); color: var(--brand); }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

/* ─── Decision cards ────────────────────────────────────────────────────────── */
.decision-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.decision-card:hover { border-color: var(--border-2); background: var(--surface-2); }
.decision-card.review-due { border-color: rgba(245,158,11,0.3); }
.decision-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.decision-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.decision-card-why { font-size: 12px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }
.decision-card-meta { display: flex; align-items: center; gap: 10px; }
.decision-card-meta span { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.decision-card-meta i { font-size: 12px; }

/* Review outcome display */
.outcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.outcome-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.outcome-label { font-size: 10px; color: var(--text-3); margin-bottom: 6px; }
.outcome-baseline { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.outcome-arrow { font-size: 10px; color: var(--text-3); margin: 2px 0; }
.outcome-actual { font-size: 18px; font-weight: 700; font-family: var(--font-mono); margin-bottom: 2px; }
.outcome-delta { font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.outcome-status { font-size: 10px; margin-top: 4px; }
.outcome-beat { color: var(--green); }
.outcome-miss { color: var(--yellow); }

.verdict-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 16px 0; }
.verdict-btn {
  padding: 12px 8px; border-radius: var(--radius);
  border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 500; font-family: var(--font);
  cursor: pointer; text-align: center; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.verdict-btn i { font-size: 18px; }
.verdict-btn:hover { border-color: var(--brand); background: rgba(75,110,245,0.08); }
.verdict-btn.selected-continue { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.verdict-btn.selected-adjust { border-color: var(--yellow); background: var(--yellow-bg); color: var(--yellow); }
.verdict-btn.selected-reverse { border-color: var(--red); background: var(--red-bg); color: var(--red); }

/* ─── Notes ─────────────────────────────────────────────────────────────────── */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.note-card:hover { border-color: var(--border-2); background: var(--surface-2); }
.note-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.note-preview { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.note-connections { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.note-connection {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-3);
}
.note-connection i { font-size: 11px; }
.note-date { font-size: 10px; color: var(--text-3); margin-top: 6px; font-family: var(--font-mono); }

/* ─── Today view ────────────────────────────────────────────────────────────── */
.today-greeting {
  padding: 32px 28px 20px;
}
.today-greeting h1 {
  font-size: 26px; font-weight: 700; color: var(--text);
  margin-bottom: 4px; letter-spacing: -0.5px;
}
.today-greeting p { font-size: 14px; color: var(--text-2); }

.today-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 0 28px 28px;
  flex: 1;
}

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

.attention-list { display: flex; flex-direction: column; gap: 6px; }
.attention-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s;
}
.attention-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.attention-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.attention-text { flex: 1; }
.attention-title { font-size: 13px; font-weight: 500; color: var(--text); }
.attention-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.attention-cta {
  font-size: 11px; font-weight: 500; color: var(--brand);
  white-space: nowrap;
}

.wins-list { display: flex; flex-direction: column; gap: 6px; }
.win-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.win-emoji { font-size: 16px; }
.win-text { font-size: 12px; color: var(--text-2); }
.win-text strong { color: var(--text); }

.today-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
}
.today-sidebar-title {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.mini-signal {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 12px; cursor: pointer;
}
.mini-signal:last-child { border-bottom: none; }
.mini-signal-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mini-signal-text { flex: 1; color: var(--text-2); }
.mini-signal-time { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }

/* ─── Filter tabs ───────────────────────────────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 2px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}
.filter-tab {
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--text-3); cursor: pointer;
  transition: all 0.1s; white-space: nowrap;
  border: none; background: transparent;
}
.filter-tab:hover { color: var(--text-2); background: var(--surface); }
.filter-tab.active { background: rgba(75,110,245,0.12); color: var(--brand); }

/* ─── Source icon colors ────────────────────────────────────────────────────── */
.src-gmail     { background: rgba(234,67,53,0.12); color: var(--c-gmail); }
.src-linkedin  { background: rgba(10,102,194,0.15); color: var(--c-linkedin); }
.src-reddit    { background: rgba(255,69,0,0.12); color: var(--c-reddit); }
.src-ph        { background: rgba(218,85,47,0.12); color: var(--c-ph); }
.src-stripe    { background: rgba(99,91,255,0.12); color: var(--c-stripe); }
.src-supabase  { background: rgba(62,207,142,0.12); color: var(--c-supabase); }
.src-cf        { background: rgba(246,130,31,0.12); color: var(--c-cf); }
.src-github    { background: rgba(230,237,243,0.08); color: var(--c-github); }
.src-decision  { background: rgba(75,110,245,0.12); color: var(--brand); }

/* ─── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px;
  color: var(--text-3); text-align: center; gap: 8px;
}
.empty-state i { font-size: 32px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 100; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text);
  animation: slideIn 0.25s ease;
  min-width: 240px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast i { font-size: 15px; }
.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Divider ───────────────────────────────────────────────────────────────── */
.date-divider {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 11px;
  color: var(--text-3); font-weight: 500;
}
.date-divider::before, .date-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── Search ────────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.search-bar i { font-size: 15px; color: var(--text-3); }
.search-bar input {
  flex: 1; background: none; border: none;
  font-size: 13px; font-family: var(--font); color: var(--text);
  outline: none;
}
.search-bar input::placeholder { color: var(--text-3); }

/* ─── Project dropdown ──────────────────────────────────────────────────────── */
.project-dropdown {
  position: fixed;
  bottom: 80px; left: 16px;
  width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  z-index: 30;
  opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: all 0.15s;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.project-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.project-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: background 0.1s;
}
.project-dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.project-dropdown-item.active { color: var(--text); font-weight: 500; }
.project-dropdown-item.new-project { color: var(--text-3); }
.project-dropdown-divider { height: 1px; background: var(--border); margin: 2px 0; }
.badge-new { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: var(--brand-bg, rgba(75,110,245,0.15)); color: var(--brand); margin-left: auto; }

/* ─── Sources view ──────────────────────────────────────────────────────────── */
.sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.source-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  transition: border-color 0.15s;
}
.source-card:hover { border-color: var(--border-2); }
.source-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.source-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.source-connected { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.source-disconnected { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.source-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.source-desc { font-size: 11px; color: var(--text-3); }

/* ─── Toggle ────────────────────────────────────────────────────────────────── */
.toggle {
  width: 32px; height: 18px; border-radius: 9px;
  background: var(--surface-3); position: relative;
  cursor: pointer; transition: background 0.2s;
  border: none; flex-shrink: 0;
}
.toggle.on { background: var(--brand); }
.toggle::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  background: white; position: absolute; top: 2px; left: 2px;
  transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on::after { left: 16px; }

/* ─── Dashboards ────────────────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.dash-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
}
.dash-stat-label { font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.dash-stat-val { font-size: 26px; font-weight: 700; color: var(--text); font-family: var(--font-mono); line-height: 1; margin-bottom: 4px; }
.dash-stat-delta { font-size: 11px; font-family: var(--font-mono); }

/* ─── Mobile ────────────────────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 20;
}
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px;
  font-size: 10px; color: var(--text-3); cursor: pointer;
  text-decoration: none; transition: color 0.1s;
}
.mobile-nav-item i { font-size: 20px; }
.mobile-nav-item.active { color: var(--brand); }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main { padding-bottom: 60px; }
  .drawer { width: 100%; }
  .modal { width: calc(100vw - 16px); max-height: 90vh; }
  .today-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .outcome-grid { grid-template-columns: 1fr; }
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.view.active > * { animation: fadeIn 0.2s ease; }

/* ─── INITIATIVES ──────────────────────────────────────────────────────────── */

.initiative-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.initiative-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.initiative-card.at-risk {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.02);
}
.initiative-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.initiative-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.initiative-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 14px;
}
.initiative-progress-row { margin-bottom: 14px; }
.initiative-progress-block { width: 100%; }
.initiative-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.progress-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  position: relative;
  overflow: visible;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width 0.3s ease;
}
.progress-fill.ahead { background: var(--green); }
.progress-fill.behind { background: var(--red); }
.progress-time-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--text-3);
  border-radius: 1px;
  transform: translateX(-50%);
}
.initiative-progress-sub {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 5px;
}
.initiative-card-footer {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.initiative-card-footer span { display: flex; align-items: center; gap: 4px; }

/* Initiative Detail */
.initiative-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  cursor: pointer;
  border-left: 2px solid var(--border);
  padding-left: 18px;
  margin-left: 8px;
  position: relative;
}
.timeline-item:hover .timeline-content { opacity: 0.85; }
.timeline-dot {
  position: absolute;
  left: -6px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.signal-dot { background: var(--text-3); }
.decision-dot { background: var(--brand); }
.timeline-content { flex: 1; }
.timeline-date { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); margin-bottom: 3px; }
.timeline-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.timeline-detail { font-size: 12px; color: var(--text-2); line-height: 1.5; }

.initiative-outcome-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: sticky;
  top: 0;
}
.initiative-outcome-stat { margin-bottom: 4px; }
.initiative-outcome-val { font-size: 32px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.initiative-outcome-label { font-size: 12px; color: var(--text-3); }
.initiative-outcome-target { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.initiative-linked-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.1s;
}
.initiative-linked-item:hover { background: var(--surface-2); }
.initiative-linked-item i { margin-top: 1px; font-size: 14px; flex-shrink: 0; }

/* ─── PROJECT CARDS (Mission Control) ─────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.project-card.urgent { border-color: rgba(245,158,11,0.3); }
.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.project-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}
.project-card-alerts { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.project-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: var(--radius);
  font-weight: 500;
}
.alert-red { background: rgba(239,68,68,0.08); color: #EF4444; }
.alert-yellow { background: rgba(245,158,11,0.08); color: #F59E0B; }
.alert-blue { background: rgba(75,110,245,0.08); color: var(--brand); }
.project-card-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.project-card-last { font-size: 11px; color: var(--text-3); }
