/* ── Design tokens (light theme, matching sales_intelligence.html) ── */
:root {
  --bg: #f9f9f8;
  --surface: #ffffff;
  --surface2: #f1efe8;
  --border: #d3d1c7;
  --border-light: #e8e8e0;
  --text: #1a1a18;
  --text-secondary: #5f5e5a;
  --muted: #888780;
  --faint: #c8c8c0;

  --red: #E24B4A;
  --red-bg: rgba(226, 75, 74, 0.08);
  --amber: #EF9F27;
  --amber-bg: rgba(239, 159, 39, 0.08);
  --teal: #0F6E56;
  --teal-bg: rgba(15, 110, 86, 0.08);
  --blue: #185FA5;
  --blue-bg: rgba(24, 95, 165, 0.08);
  --purple: #7a6af0;
  --purple-bg: rgba(122, 106, 240, 0.08);

  --green-pill-bg: #EAF3DE;
  --green-pill-text: #3B6D11;
  --blue-pill-bg: #E6F1FB;
  --blue-pill-text: #185FA5;
  --amber-pill-bg: #FAEEDA;
  --amber-pill-text: #633806;
  --red-pill-bg: #FCEBEB;
  --red-pill-text: #A32D2D;
  --pink-pill-bg: #FBEAF0;
  --pink-pill-text: #72243E;
  --gray-pill-bg: #F1EFE8;
  --gray-pill-text: #5F5E5A;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --sidebar-width: 200px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

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

/* ── Layout shell ── */
.shell {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 2px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #EF9F27, #E8A020);
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-text {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-app-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 400;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--text-secondary);
  background: var(--surface2);
}

.nav-item.active {
  color: var(--text);
  background: var(--surface2);
  font-weight: 500;
}

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

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Sidebar search trigger ── */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-search:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}

.sidebar-search span {
  flex: 1;
  text-align: left;
}

.sidebar-search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
}

.sidebar-copilot {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid rgba(239, 159, 39, 0.2);
  background: var(--amber-bg);
  color: var(--amber);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-copilot:hover {
  background: rgba(239, 159, 39, 0.12);
  border-color: rgba(239, 159, 39, 0.35);
}

.sidebar-copilot.active {
  background: rgba(239, 159, 39, 0.15);
  border-color: var(--amber);
}

.sidebar-copilot span { flex: 1; text-align: left; }

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group-label,
.nav-group-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 10px 4px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: 6px 10px;
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.4;
}

.nav-spacer {
  margin-top: auto;
}

/* ── Sidebar user footer ── */
.sidebar-user-wrap {
  position: relative;
  margin-top: 4px;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.sidebar-user:hover {
  background: var(--surface2);
}

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sidebar-user-chevron.open {
  transform: rotate(180deg);
}

.sidebar-user-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 4px;
  animation: slideUp 0.15s ease;
}

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
}

.sidebar-user-menu-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-logout:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--amber);
  color: #1a1200;
}
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 400;
}
.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--text);
}

/* ── Search input ── */
.search-wrap {
  position: relative;
  max-width: 280px;
  flex: 1;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 7px 12px 7px 32px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--muted); }

/* ── Filter bar ── */
.filterbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
  background: none;
}

.filter-tab:hover { color: var(--text); background: var(--surface2); }
.filter-tab.active {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border);
}

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

.filter-sep {
  width: 1px;
  height: 16px;
  background: var(--border-light);
  margin: 0 6px;
}

/* ── Badge ── */
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2px 8px;
}

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

/* ── Metric card ── */
.metric-card {
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px 14px;
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Pills / Tags ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 400;
}

.pill-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill-prospect { background: var(--blue-bg); color: var(--blue); }
.pill-customer { background: var(--teal-bg); color: var(--teal); }
.pill-stalled { background: var(--amber-bg); color: var(--amber); }
.pill-lost { background: var(--gray-pill-bg); color: var(--gray-pill-text); }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-champion { background: var(--green-pill-bg); color: var(--green-pill-text); }
.tag-decision { background: var(--blue-pill-bg); color: var(--blue-pill-text); }
.tag-evaluator { background: var(--amber-pill-bg); color: var(--amber-pill-text); }
.tag-cooling { background: var(--pink-pill-bg); color: var(--pink-pill-text); }
.tag-warm { background: var(--amber-pill-bg); color: var(--amber-pill-text); }
.tag-not-engaged { background: var(--gray-pill-bg); color: var(--gray-pill-text); }
.tag-risk { background: var(--red-pill-bg); color: var(--red-pill-text); }
.tag-active { background: var(--teal-bg); color: var(--teal); }

/* Category tags */
.cat-champion { background: var(--amber-bg); color: var(--amber); }
.cat-stakeholder { background: var(--blue-bg); color: var(--blue); }
.cat-competition { background: var(--red-bg); color: var(--red); }
.cat-objections { background: var(--purple-bg); color: var(--purple); }
.cat-renewals { background: var(--amber-bg); color: var(--amber); }
.cat-engagement { background: var(--blue-bg); color: var(--blue); }
.cat-pipeline { background: var(--amber-bg); color: var(--amber); }
.cat-upsell { background: var(--teal-bg); color: var(--teal); }
.cat-win_back { background: var(--purple-bg); color: var(--purple); }
.cat-requests { background: var(--red-bg); color: var(--red); }
.cat-budget { background: var(--teal-bg); color: var(--teal); }

/* ── Section label ── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ── Urgency dots ── */
.urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.urgency-today { background: var(--red); }
.urgency-week { background: var(--amber); }
.urgency-month { background: var(--teal); }

/* ── Score helpers ── */
.score-high { color: var(--teal); }
.score-mid { color: var(--amber); }
.score-low { color: var(--red); }

/* ── Avatar ── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.avatar-square { border-radius: 8px; }
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-md { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 52px; height: 52px; font-size: 18px; }

/* ── Sort select ── */
.sort-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sort-select {
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.tab {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--amber);
  font-weight: 500;
}

/* ── Stage track ── */
.stage-track {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.stage-step {
  flex: 1;
  padding: 7px 4px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border-right: 1px solid var(--border-light);
}

.stage-step:last-child { border-right: none; }
.stage-step.current { background: var(--surface2); color: var(--text); font-weight: 500; }
.stage-step.done { background: #E1F5EE; color: var(--teal); }

/* ── BANT row ── */
.bant-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bant-item {
  text-align: center;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface);
}

.bant-letter { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.bant-status { font-size: 11px; }
.bant-note { font-size: 10px; color: var(--muted); margin-top: 2px; }
.bant-confirmed { color: var(--teal); }
.bant-suspected { color: var(--amber); }

/* ── Signal cards ── */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.signal-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface);
}

.signal-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.signal-dot-high { background: var(--red); }
.signal-dot-medium { background: var(--amber); }
.signal-dot-low { background: var(--teal); }

.signal-evidence { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }

/* ── Footer ── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
}

.footer-stats { display: flex; gap: 20px; }
.footer-stats span { color: var(--text); font-weight: 500; }

/* ── Action card (for today page and detail pages) ── */
.action-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
}

.action-card.urgency-today::before { background: var(--red); }
.action-card.urgency-week::before { background: var(--amber); }
.action-card.urgency-month::before { background: var(--teal); }

.action-card:hover {
  border-color: var(--border);
  background: #fafaf8;
}

/* ── Content grid (for detail pages) ── */
.detail-columns,
.content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  flex: 1;
}

.col-main {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--border-light);
}

.col-side {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Timeline ── */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.timeline-item:last-child { border-bottom: none; }

.tl-date {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  width: 72px;
  flex-shrink: 0;
  padding-top: 2px;
}

.tl-event {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.tl-context {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Person row ── */
.person-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.person-row:last-child { border-bottom: none; padding-bottom: 0; }

.person-name { font-size: 13px; font-weight: 500; color: var(--text); }
.person-title-text { font-size: 11px; color: var(--muted); font-weight: 400; }
.person-summary { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.person-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

/* ── Status bar ── */
.status-bar {
  background: var(--surface2);
  border-radius: 8px;
  padding: 14px 16px;
}

.status-main {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.status-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Renewal banner ── */
.renewal-banner {
  background: var(--amber-bg);
  border-bottom: 1px solid rgba(239, 159, 39, 0.2);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.renewal-banner strong { color: var(--amber); font-weight: 500; }
.renewal-banner span { color: var(--muted); }

/* ── Sentiment chart ── */
.sent-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 52px;
  margin-bottom: 6px;
}

.sent-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.sent-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
}

.sent-label { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

/* ── Contract card ── */
.contract-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}

.contract-row:last-child { border-bottom: none; }
.cr-label { color: var(--muted); }
.cr-value { font-family: var(--font-mono); font-weight: 500; }

/* ── Health gauge ── */
.health-bar-bg {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  border-radius: 3px;
}

/* ── Stall card ── */
.stall-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.stall-card:hover {
  border-color: var(--border);
  background: #fafaf8;
}

/* ── Win card ── */
.win-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: #fafaf8; }
.data-table tbody tr:hover .row-edit-btn { opacity: 1; }

.data-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

/* ── Row edit button ── */
.row-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}

.row-edit-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ── Page content area ── */
.page-content {
  flex: 1;
  overflow-y: auto;
}

/* ── Settings page ── */
.settings-section {
  border-bottom: 1px solid var(--border-light);
  padding: 20px 0;
}

.settings-section:last-child { border-bottom: none; }

.settings-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.settings-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.settings-input {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.settings-input:focus { border-color: var(--amber); }

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.settings-toggle:last-child { border-bottom: none; }

/* Toggle switch */
.toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--faint);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  flex-shrink: 0;
}

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

.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

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

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  color: var(--muted);
  font-size: 13px;
  gap: 8px;
}

/* ── Summary card ── */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.summary-card:hover {
  border-color: var(--border);
  background: #fafaf8;
}

.sc-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.sc-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.sc-sub {
  font-size: 11.5px;
  color: var(--muted);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

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

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: slideUp 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--surface2);
  color: var(--text);
}

.modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font-sans);
}

.modal-input:focus {
  border-color: var(--amber);
}

.modal-input::placeholder {
  color: var(--faint);
}

.modal-row {
  display: flex;
  gap: 12px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border-light);
}

.modal-footer .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.required {
  color: var(--red);
  font-weight: 400;
}

/* ── Suggested account card ── */
.suggested-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.15s;
}

.suggested-card:hover {
  border-color: var(--border);
}

/* ── Notes ── */
.note-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.note-textarea:focus {
  border-color: var(--amber);
}

.note-textarea::placeholder {
  color: var(--faint);
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.note-card:hover {
  border-color: var(--border);
}

.note-delete {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0;
}

.note-card:hover .note-delete {
  opacity: 1;
}

.note-delete:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* ── Draft button (inline on action cards) ── */
.draft-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(239, 159, 39, 0.3);
  background: var(--amber-bg);
  color: var(--amber);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}

.draft-btn:hover {
  background: rgba(239, 159, 39, 0.15);
  border-color: var(--amber);
}

/* ── Shimmer animation ── */
.shimmer-line {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border-light) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Kanban board ── */
.kanban-board {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 16px 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.kanban-column {
  flex: 1;
  min-width: 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.kanban-column.drag-over {
  border-color: var(--amber);
  background: rgba(239, 159, 39, 0.04);
}

/* Chart bars (reports) */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 16px 8px;
}

.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}

.chart-bar-col:hover .chart-bar {
  background: var(--amber);
}

.chart-bar-label {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--faint);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.view-toggle-btn:hover {
  color: var(--text);
}

.view-toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Deal type pill */
.pill-deal-type {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 10px;
  color: #fff;
  opacity: 0.85;
  white-space: nowrap;
}

/* Stage suggestion nudge */
.kanban-card-nudge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--amber);
  padding: 4px 0;
  cursor: pointer;
}
.kanban-card-nudge:hover {
  color: var(--text);
}

/* Filter count badge */
.filter-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}

.kanban-column-suggested {
  border: 1.5px dashed var(--border);
  background: var(--surface);
  max-width: 250px;
}

.kanban-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.kanban-btn-approve,
.kanban-btn-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.kanban-btn-approve {
  color: var(--teal);
}
.kanban-btn-approve:hover {
  background: var(--teal-bg, rgba(45, 180, 160, 0.1));
  border-color: var(--teal);
}

.kanban-btn-dismiss {
  color: var(--muted);
}
.kanban-btn-dismiss:hover {
  background: var(--red-bg, rgba(220, 70, 70, 0.1));
  border-color: var(--red);
  color: var(--red);
}

/* Suggested accounts sidebar */
.suggested-sidebar {
  width: 260px;
  min-width: 260px;
  border-left: 1px solid var(--border-light);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.suggested-sidebar-header {
  padding: 14px 16px 10px;
  flex-shrink: 0;
}

.suggested-sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.suggested-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggested-card {
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.suggested-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggested-card-meta {
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggested-card-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-self: flex-start;
}

.suggested-card-btns .kanban-btn-approve,
.suggested-card-btns .kanban-btn-dismiss {
  width: 24px;
  height: 22px;
}

.kanban-column-header {
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.kanban-column-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-column-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 400;
}

.kanban-column-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.kanban-column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-empty {
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  padding: 24px 8px;
}

/* Kanban card */
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
  position: relative;
  overflow: hidden;
}

.kanban-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
}

.kanban-card.urgency-today::before { background: var(--red); }
.kanban-card.urgency-week::before { background: var(--amber); }
.kanban-card.urgency-month::before { background: var(--teal); }

.kanban-card:hover {
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
}

.kanban-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kanban-card-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-domain {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.kanban-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.kanban-card-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-card-days {
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.kanban-card-momentum {
  display: flex;
  align-items: center;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.kanban-card-action {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Alert card ── */
.alert-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.15s;
}

.alert-card:hover {
  border-color: var(--border);
  background: #fafaf8;
}

.alert-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

.alert-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-card-owner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 500;
  flex-shrink: 0;
}

/* ── Command palette ── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 200;
  animation: fadeIn 0.1s ease;
}

.cmd-palette {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: slideUp 0.15s ease;
  overflow: hidden;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.cmd-search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
}

.cmd-input::placeholder {
  color: var(--faint);
}

.cmd-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 6px;
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.cmd-hint {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--faint);
}

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

.cmd-group {
  margin-bottom: 4px;
}

.cmd-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.08s;
}

.cmd-item.selected {
  background: var(--surface2);
}

.cmd-item-avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
}

.cmd-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--surface2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cmd-item-text {
  flex: 1;
  min-width: 0;
}

.cmd-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-subtitle {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-arrow {
  color: var(--faint);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.1s;
}

.cmd-item.selected .cmd-item-arrow {
  opacity: 1;
}

.cmd-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--faint);
}

.cmd-footer kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 1px 4px;
  margin: 0 1px;
}

/* ── AI Copilot panel ── */
.copilot-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 150;
  animation: slideInRight 0.2s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.copilot-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.copilot-msg.user {
  flex-direction: row-reverse;
}

.copilot-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copilot-msg.ai .copilot-msg-avatar {
  background: var(--amber-bg);
  color: var(--amber);
}

.copilot-msg.user .copilot-msg-avatar {
  background: var(--blue-bg);
  color: var(--blue);
}

.copilot-msg-bubble {
  max-width: 85%;
  border-radius: 12px;
  padding: 10px 14px;
}

.copilot-msg.ai .copilot-msg-bubble {
  background: var(--bg);
  border: 1px solid var(--border-light);
}

.copilot-msg.user .copilot-msg-bubble {
  background: var(--blue-bg);
  border: 1px solid rgba(24, 95, 165, 0.15);
}

.copilot-msg-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}

.copilot-msg-text strong { font-weight: 600; }
.copilot-msg-text ul, .copilot-msg-text ol { padding-left: 16px; margin: 4px 0; }
.copilot-msg-text li { margin-bottom: 2px; }
.copilot-msg-text blockquote {
  border-left: 2px solid var(--amber);
  padding-left: 10px;
  margin: 6px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.copilot-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.copilot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingDot 1.2s ease infinite;
}

.copilot-typing span:nth-child(2) { animation-delay: 0.2s; }
.copilot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

.copilot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.copilot-suggestion {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s;
}

.copilot-suggestion:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-bg);
}

.copilot-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.copilot-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  outline: none;
}

.copilot-input:focus { border-color: var(--amber); }
.copilot-input::placeholder { color: var(--faint); }

.copilot-send {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.copilot-send:hover { opacity: 0.85; }
.copilot-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Meeting prep ── */
.prep-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.prep-list {
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.prep-list li { margin-bottom: 4px; }

.prep-avoid li { color: var(--red); }
.prep-avoid li::marker { color: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Risk explainer ── */
.risk-explainer {
  margin-top: 4px;
}

.risk-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.risk-factors {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  animation: slideUp 0.15s ease;
}

.risk-factor {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.risk-factor:last-child { border-bottom: none; padding-bottom: 0; }

/* ── Sentiment tags ── */
.sentiment-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  font-family: var(--font-mono);
}

.sentiment-positive { background: var(--teal-bg); color: var(--teal); }
.sentiment-neutral { background: var(--surface2); color: var(--muted); }
.sentiment-negative { background: var(--red-bg); color: var(--red); }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
.auth-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.1);
}
.auth-input::placeholder {
  color: var(--faint);
}

.auth-error {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.auth-error--amber {
  color: #92400e;
  background: #fffbeb;
}
.auth-error--red {
  color: var(--red);
  background: #fef2f2;
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1a1a2e;
  border: 1px solid rgba(0,0,0,0.15);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
}
.auth-google-btn:hover {
  background: #f8f8f8;
}

.provider-buttons {
  display: flex;
  gap: 8px;
}
.provider-buttons .btn {
  flex: 1;
}

.ms-roadmap-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px 12px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  margin-top: 4px;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
}

.auth-switch a {
  color: var(--amber);
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ── Onboarding ── */
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
  transition: all 0.3s;
}

.onboarding-dot.active {
  background: var(--amber);
  width: 24px;
  border-radius: 4px;
}

.onboarding-dot.done {
  background: var(--teal);
  width: 8px;
  border-radius: 50%;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
}

.onboarding-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 24px;
  max-width: 380px;
}

.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 24px;
}

.onboarding-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.onboarding-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--amber-bg);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-feature-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.onboarding-feature-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.onboarding-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.onboarding-permissions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.onboarding-permission {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.gmail-connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.gmail-connect-btn:hover {
  background: var(--bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.gmail-connect-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.gmail-connected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--teal-bg);
  border: 1px solid rgba(15, 110, 86, 0.15);
  border-radius: 10px;
  width: 100%;
}

.onboarding-checkmark {
  color: var(--teal);
  margin-bottom: 16px;
  animation: checkPop 0.4s ease;
}

@keyframes checkPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.onboarding-ready-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.onboarding-ready-stat {
  font-size: 12px;
  color: var(--muted);
}

.spin {
  animation: spin 1s linear infinite;
}

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

/* ---------------------------------------------------------------------------
   Utility classes (for Django templates — replaces React inline styles)
   --------------------------------------------------------------------------- */

/* Spacing */
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.px-sm { padding-left: 8px; padding-right: 8px; }
.px-md { padding-left: 16px; padding-right: 16px; }
.py-sm { padding-top: 8px; padding-bottom: 8px; }
.py-md { padding-top: 16px; padding-bottom: 16px; }
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }

/* Layout */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; min-width: 0; }
.grid { display: grid; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Text */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; line-height: 1.5; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Colors */
.text-muted { color: var(--muted); }
.text-secondary { color: var(--text-secondary); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-teal { color: var(--teal); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }

/* Borders */
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }

/* Action icon buttons (execute / dismiss) */
.action-icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.15s;
}
.action-icon-btn:hover {
  border-color: var(--text-secondary);
}

/* ── Additional utilities ── */
.leading-tight { line-height: 1.3; }
.leading-normal { line-height: 1.4; }
.leading-relaxed { line-height: 1.5; }
.min-w-0 { min-width: 0; }
.link-plain { text-decoration: none; color: inherit; }
.whitespace-pre { white-space: pre-wrap; }
.btn-danger { color: var(--red); border-color: rgba(226,75,74,0.3); }
.badge-danger { background: var(--red-bg); color: var(--red); border-color: rgba(226,75,74,0.2); }

/* Page content width variants */
.page-content { padding: 24px 28px; overflow-y: auto; }
.page-sm { max-width: 640px; }
.page-md { max-width: 880px; }
.page-lg { max-width: 960px; }

/* Grid column utilities */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }

/* HTMX indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }
