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

:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-2:    #1c2333;
  --border:       #30363d;
  --border-subtle:#21262d;
  --text:         #e6edf3;
  --text-muted:   #7d8590;
  --text-subtle:  #484f58;
  --primary:      #58a6ff;
  --primary-hover:#79b8ff;
  --danger:       #f85149;
  --danger-hover: #ff6a69;
  --scrape:       #bc8cff;
  --scrape-hover: #d2a8ff;
  --sidebar-width: 240px;
  --radius: 6px;

  /* Status colours — dark-mode palette */
  --status-sourced-bg:        #1c2333; --status-sourced-text:        #7d8590;
  --status-requested-bg:      #0d2044; --status-requested-text:      #58a6ff;
  --status-no_answer-bg:      #2d1212; --status-no_answer-text:      #f85149;
  --status-in_progress-bg:    #2b2005; --status-in_progress-text:    #e3b341;
  --status-first_meeting-bg:  #0a2a4a; --status-first_meeting-text:  #79c0ff;
  --status-qualified_demo-bg: #1e1448; --status-qualified_demo-text: #bc8cff;
  --status-pilot_poc-bg:      #0a2d1a; --status-pilot_poc-text:      #3fb950;
  --status-customer_small-bg: #145228; --status-customer_small-text: #aff5b4;
  --status-customer_full-bg:  #1a6632; --status-customer_full-text:  #aff5b4;
  --status-no_intro-bg:       #3d0e0e; --status-no_intro-text:       #ffa198;
  --status-in_pipeline-bg:    #1a1f2e; --status-in_pipeline-text:    #8b949e;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

/* ── Login screen ────────────────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

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

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

.login-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.login-field input:focus { border-color: var(--primary); }

.login-error {
  font-size: 12px;
  color: var(--danger);
  text-align: center;
}

.login-submit {
  width: 100%;
  padding: 9px;
  font-size: 14px;
  margin-top: 4px;
}

.login-admin-toggle {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  padding: 4px 0 0;
  transition: color 0.15s;
}
.login-admin-toggle:hover { color: var(--text-muted); }

/* ── Topbar user ─────────────────────────────────────────────────────────── */

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

.topbar-username {
  font-size: 12px;
  color: var(--text-subtle);
}

.topbar {
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-logo {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  width: var(--sidebar-width);
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s ease;
}

.topbar-search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-subtle);
  pointer-events: none;
}

.topbar-search {
  width: 100%;
  padding: 6px 70px 6px 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.topbar-search::placeholder { color: var(--text-subtle); }
.topbar-search:focus { border-color: var(--primary); }

.topbar-search-shortcut {
  position: absolute;
  right: 8px;
  font-size: 10px;
  font-family: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-subtle);
  pointer-events: none;
}

/* ── Angel chip (in search results) ─────────────────────────────────────── */

.angel-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--primary);
  white-space: nowrap;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease;
}

body.sidebar-collapsed .sidebar {
  width: 40px;
}

body.sidebar-collapsed .topbar-logo {
  width: 40px;
}

body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar-sep {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.sidebar-header {
  padding: 8px 7px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

body.sidebar-collapsed .sidebar-header {
  justify-content: center;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(88, 166, 255, 0.12);
  color: var(--primary);
}

body.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

.sidebar-logo {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ── Sidebar sections ────────────────────────────────────────────────────── */

.sidebar-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 0 1 auto;
  overflow: hidden;
}

.sidebar-section--board {
  flex: 1 0 auto;        /* grow but never shrink below min-height */
  min-height: 168px;     /* header (~32px) + 3 items (~36px each) + "more" row (~24px) */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
}

.sidebar-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
  flex-shrink: 0;
}

.btn-xs {
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 400;
  border-radius: 4px;
  line-height: 1.4;
}

/* ── Angel search ────────────────────────────────────────────────────────── */

.angel-search-wrap {
  padding: 0 10px 6px;
  flex-shrink: 0;
}

.angel-search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 9px;
  outline: none;
  transition: border-color 0.15s;
}
.angel-search-input::placeholder { color: var(--text-subtle); }
.angel-search-input:focus { border-color: var(--primary); }

/* ── Angel list ──────────────────────────────────────────────────────────── */

.angel-list {
  list-style: none;
  overflow-y: auto;
  padding: 2px 0 6px;
  max-height: 340px;
  min-height: 0;
  flex-shrink: 1;
}

.angel-list li {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.1s, border-color 0.1s;
}

.angel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  letter-spacing: 0;
}

.angel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.angel-list-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.angel-list li:hover { background: var(--surface-2); }

.angel-list li.active {
  background: rgba(88, 166, 255, 0.08);
  border-left-color: var(--primary);
}

.angel-list .angel-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.angel-list li.active .angel-name { color: var(--primary); }

.angel-sidebar-title {
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── Scoreboard list ─────────────────────────────────────────────────────── */

.scoreboard-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 2px 0 8px;
}

.scoreboard-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 12px;
}
.scoreboard-item:hover  { background: var(--surface-2); }
.scoreboard-item.active { background: rgba(88,166,255,0.08); }

.sb-rank {
  font-size: 12px;
  min-width: 22px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.sb-name {
  flex: 1;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.sb-pts {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.sb-open {
  font-size: 10px;
  font-weight: 600;
  background: rgba(227, 179, 65, 0.15);
  color: #e3b341;
  border-radius: 99px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.scoreboard-empty {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-subtle);
}

.scoreboard-more {
  padding: 5px 14px;
  font-size: 11px;
  color: var(--text-subtle);
  cursor: pointer;
  transition: color 0.1s;
}
.scoreboard-more:hover { color: var(--primary); }

.sidebar-section-hd--link {
  cursor: pointer;
  transition: color 0.1s;
  border-radius: 4px;
}
.sidebar-section-hd--link:hover { color: var(--primary); }
.sidebar-section-hd--link:hover .sb-nav-arrow { opacity: 1; }
.sidebar-section-hd--link.is-active { color: var(--primary); }

.sb-nav-arrow {
  font-size: 12px;
  opacity: 0.4;
  transition: opacity 0.1s;
}

/* ── Leaderboard page ────────────────────────────────────────────────────── */

.leaderboard-page {
  height: 100%;
}

.leaderboard-table {
  font-size: 16px !important;
}

.leaderboard-table td {
  padding: 13px 18px !important;
}

.leaderboard-table .lb-rank {
  font-size: 18px;
  text-align: center;
}

.leaderboard-table .lb-name {
  font-weight: 600;
  color: var(--text);
}

.leaderboard-table .lb-title {
  color: var(--text-subtle);
  font-size: 14px;
}

.leaderboard-table .lb-pts {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}

.leaderboard-table .lb-total {
  color: var(--text-muted);
}

.leaderboard-table .lb-none {
  color: var(--text-subtle);
}

.lb-sourced-num {
  font-size: 13px;
  font-weight: 700;
  color: #58a6ff;
}

.lb-open-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
}

.leaderboard-table tbody tr:hover td {
  background: var(--surface-2);
  cursor: pointer;
}

.lb-bar-cell { min-width: 120px; }

.lb-bar-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3fb950);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 4px;
}

/* ── Main ────────────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  overflow: auto;
  padding: 28px 36px;
  background: var(--bg);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-subtle);
  font-size: 14px;
}

/* ── Detail header ───────────────────────────────────────────────────────── */

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

.detail-title h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}

.detail-title-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.angel-title-text {
  font-size: 13px;
  color: var(--text-muted);
}

.linkedin-logo {
  display: inline-flex;
  align-items: center;
  color: #0a66c2;
  opacity: 0.85;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.linkedin-logo:hover { opacity: 1; }

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Angel stats bar ─────────────────────────────────────────────────────── */

.angel-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 20px;
  width: fit-content;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-value--open {
  color: #58a6ff;
}

.stat-label {
  font-size: 12px;
  color: var(--text-subtle);
}

.stat-sep {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
  margin: 0 20px;
}

/* ── Points badge in table ───────────────────────────────────────────────── */

.status-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pts-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(88,166,255,0.1);
  border-radius: 99px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Scrape status ───────────────────────────────────────────────────────── */

.scrape-status {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scrape-status.running { background: #0d2044; color: #79c0ff; border-color: #1f4068; }
.scrape-status.done    { background: #0a2d1a; color: #3fb950; border-color: #196c2e; }
.scrape-status.error   { background: #2d1212; color: #f85149; border-color: #6e2b2b; }

.scrape-log-line { font-family: monospace; font-size: 12px; line-height: 1.5; }
.scrape-log-done  { color: #3fb950; font-weight: 600; }
.scrape-log-error { color: #f85149; font-weight: 600; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.toolbar-search {
  width: 280px;
  font-size: 13px;
  font-family: inherit;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d8590' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.toolbar-search::placeholder { color: var(--text-subtle); }
.toolbar-search:focus { border-color: var(--primary); background-color: var(--surface-2); }

/* ── Column header filter ────────────────────────────────────────────────── */

.th-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.filter-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-subtle);
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}
.filter-icon:hover     { background: var(--surface-2); color: var(--text-muted); }
.filter-icon.is-active { color: var(--primary); }

/* ── Filter panel ────────────────────────────────────────────────────────── */

.filter-panel {
  position: fixed;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  min-width: 200px;
  max-width: 260px;
  padding: 6px 0;
  font-size: 13px;
}

.filter-sort-row {
  display: flex;
  flex-direction: column;
}

.filter-sort-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
}
.filter-sort-btn:hover { background: var(--surface-2); color: var(--text); }

.filter-panel-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.filter-values-wrap {
  max-height: 240px;
  overflow-y: auto;
  padding: 2px 0;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  color: var(--text-muted);
}
.filter-item:hover { background: var(--surface-2); color: var(--text); }
.filter-item input[type="checkbox"] { cursor: pointer; accent-color: var(--primary); }

/* ── Status select ───────────────────────────────────────────────────────── */

.status-select {
  border: none;
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  white-space: nowrap;
  max-width: 190px;
  min-width: 0;
}

.status-select[data-status="sourced"]        { background: var(--status-sourced-bg);        color: var(--status-sourced-text); }
.status-select[data-status="requested"]      { background: var(--status-requested-bg);      color: var(--status-requested-text); }
.status-select[data-status="no_answer"]      { background: var(--status-no_answer-bg);      color: var(--status-no_answer-text); }
.status-select[data-status="in_progress"]    { background: var(--status-in_progress-bg);    color: var(--status-in_progress-text); }
.status-select[data-status="first_meeting"]  { background: var(--status-first_meeting-bg);  color: var(--status-first_meeting-text); }
.status-select[data-status="qualified_demo"] { background: var(--status-qualified_demo-bg); color: var(--status-qualified_demo-text); }
.status-select[data-status="pilot_poc"]      { background: var(--status-pilot_poc-bg);      color: var(--status-pilot_poc-text); }
.status-select[data-status="customer_small"] { background: var(--status-customer_small-bg); color: var(--status-customer_small-text); }
.status-select[data-status="customer_full"]  { background: var(--status-customer_full-bg);  color: var(--status-customer_full-text); }
.status-select[data-status="no_intro"]       { background: var(--status-no_intro-bg);       color: var(--status-no_intro-text); }
.status-select[data-status="in_pipeline"]    { background: var(--status-in_pipeline-bg);    color: var(--status-in_pipeline-text); }

/* ── Bulk action bar ─────────────────────────────────────────────────────── */

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 13px;
}

.bulk-count {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.bulk-status-select {
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
}
.bulk-status-select:focus { border-color: var(--primary); }

/* ── Table ───────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.contacts-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 11px;
}

.contacts-table td {
  white-space: nowrap;
}

/* Cap width on name / title / company so very long values don't blow out the table */
.contacts-table td:nth-child(2),
.contacts-table td:nth-child(3),
.contacts-table td:nth-child(4) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-check {
  width: 36px;
  text-align: center;
  padding-right: 0 !important;
}

.col-check input[type="checkbox"],
.row-cb {
  cursor: pointer;
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
}

.row-selected td {
  background: rgba(88, 166, 255, 0.06) !important;
}

.contacts-table th {
  text-align: left;
  padding: 7px 12px;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-subtle);
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.contacts-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-muted);
}

.contacts-table tr:last-child td { border-bottom: none; }
.contacts-table tbody tr:hover td { background: var(--surface-2); color: var(--text); }
.contacts-table tbody tr { transition: background 0.1s; }

.contact-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}
.contact-name a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.contact-name a:hover { color: var(--primary); }

.contact-email-cell {
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-email-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.contact-email-link:hover { color: var(--primary); text-decoration: underline; }

.contact-date-cell {
  white-space: nowrap;
  width: 110px;
  min-width: 90px;
}

.requested-date {
  font-size: 12px;
  color: var(--text-subtle);
}

.duplicate-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(188, 140, 255, 0.12);
  color: var(--scrape);
  white-space: nowrap;
  vertical-align: middle;
  cursor: default;
}

.contact-notes-cell {
  max-width: 180px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.1s;
}
.contacts-table tr:hover .row-actions { opacity: 1; }
body.role-angel .row-actions { display: none !important; }

.row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  background: transparent;
}

.row-action-edit {
  color: var(--text-subtle);
}
.row-action-edit:hover {
  background: rgba(88, 166, 255, 0.12);
  color: var(--primary);
}

.row-action-delete {
  color: var(--text-subtle);
}
.row-action-delete:hover {
  background: rgba(248, 81, 73, 0.12);
  color: var(--danger);
}

.row-action-enrich {
  color: var(--text-subtle);
}
.row-action-enrich:hover {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
}

/* ── Toast notifications ──────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 320px;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { background: #145228; color: #aff5b4; border: 1px solid #3fb950; }
.toast-error   { background: #2d1212; color: #ffa198; border: 1px solid #f85149; }
.toast-info    { background: #1c2333; color: #7d8590; border: 1px solid #30363d; }

.no-contacts {
  padding: 48px;
  text-align: center;
  color: var(--text-subtle);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-primary {
  background: var(--primary);
  color: #0d1117;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.12);
  border-color: var(--danger);
}

.btn-scrape {
  background: transparent;
  color: var(--scrape);
  border-color: var(--border);
}
.btn-scrape:hover:not(:disabled) {
  background: rgba(188, 140, 255, 0.12);
  border-color: var(--scrape);
}

.btn-hubspot {
  background: transparent;
  color: #ff7a59;
  border-color: var(--border);
}
.btn-hubspot:hover:not(:disabled) {
  background: rgba(255, 122, 89, 0.12);
  border-color: #ff7a59;
}
.btn-hubspot:disabled {
  opacity: 0.6;
  cursor: default;
}

.hs-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 122, 89, 0.15);
  color: #ff7a59;
  border: 1px solid rgba(255, 122, 89, 0.3);
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
.hs-badge:hover {
  background: rgba(255, 122, 89, 0.25);
  color: #ff7a59;
}
.hs-badge--cold {
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-subtle);
  border-color: rgba(139, 148, 158, 0.25);
}
.hs-badge--cold:hover {
  background: rgba(139, 148, 158, 0.2);
  color: var(--text-muted);
}

.btn-email {
  background: transparent;
  color: #3fb950;
  border-color: var(--border);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-email:hover:not(:disabled) {
  background: rgba(63, 185, 80, 0.12);
  border-color: #3fb950;
  color: #56d364;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-subtle);
  padding: 3px 6px;
  font-size: 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  width: 440px;
  max-width: 95vw;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.6);
}

.modal h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

.modal-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.modal input,
.modal textarea,
.modal select {
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
  width: 100%;
  outline: none;
  transition: border-color 0.12s;
}
.modal input::placeholder,
.modal textarea::placeholder { color: var(--text-subtle); }

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ── Review modal ────────────────────────────────────────────────────────── */

.review-modal-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 420px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.review-auto-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(63,185,80,0.15);
  color: #3fb950;
}

.review-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.review-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.review-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.review-card-role {
  font-size: 13px;
  color: var(--text-muted);
}

.review-card-headline {
  font-size: 12px;
  color: var(--text-subtle);
  font-style: italic;
  max-width: 320px;
  line-height: 1.4;
}

.review-card-linkedin {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
}
.review-card-linkedin:hover { text-decoration: underline; }

.review-progress {
  text-align: center;
  font-size: 12px;
  color: var(--text-subtle);
}

.review-actions {
  display: flex;
  gap: 12px;
}

.review-btn-skip {
  flex: 1;
  background: transparent;
  border-color: var(--border);
  color: var(--danger);
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 6px;
}
.review-btn-skip:hover { background: rgba(248,81,73,0.1); border-color: var(--danger); }

.review-btn-add {
  flex: 1;
  background: transparent;
  border-color: var(--border);
  color: #3fb950;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 6px;
}
.review-btn-add:hover { background: rgba(63,185,80,0.1); border-color: #3fb950; }

.review-btn-skip kbd, .review-btn-add kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-subtle);
}

.review-btn-add-all {
  align-self: center;
  width: 100%;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-subtle);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.review-btn-add-all:hover {
  background: rgba(63,185,80,0.08);
  border-color: #3fb950;
  color: #3fb950;
}

.review-done-btn {
  align-self: center;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
