/* ═══════════════════════════════════════════════════════════════
   Attira — style.css
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables ──────────────────────────────────────────────────── */
:root {
  --purple:        #534AB7;
  --purple-light:  #6B64C8;
  --purple-faint:  #EEEDFC;
  --purple-bg:     #EBEBF8;
  --teal:          #1D9E75;
  --teal-light:    #E6F7F1;
  --coral:         #E55B5B;
  --coral-light:   #FDE8E8;
  --amber:         #F59E0B;
  --amber-light:   #FEF3C7;
  --gray:          #9CA3AF;
  --gray-light:    #F3F4F6;
  --red:           #EF4444;
  --red-light:     #FEE2E2;
  --pink:          #EC4899;
  --pink-light:    #FCE7F3;
  --blue:          #3B82F6;
  --blue-light:    #EFF6FF;

  /* Platform colors */
  --reddit-color:  #FF4500;
  --reddit-light:  #FFF0EB;
  --tiktok-color:  #111111;
  --tiktok-light:  #F0F0F0;
  --twitter-color: #1D9BF0;
  --twitter-light: #E8F5FE;
  --of-color:      #00AFF0;
  --of-light:      #E6F6FD;

  --white:         #FFFFFF;
  --text:          #1F2937;
  --text-soft:     #374151;
  --text-muted:    #6B7280;
  --border:        #E5E7EB;
  --border-soft:   #F0F0F8;

  --radius:        16px;
  --radius-sm:     10px;
  --radius-pill:   100px;
  --shadow:        0 2px 10px rgba(83,74,183,0.07), 0 0 0 1px rgba(83,74,183,0.06);
  --shadow-hover:  0 6px 24px rgba(83,74,183,0.13), 0 0 0 1px rgba(83,74,183,0.1);
  --transition:    0.18s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--purple-bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

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

/* ─── Header ─────────────────────────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(83,74,183,0.06);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-gem { width: 26px; height: 26px; color: var(--purple); }
.logo-text { font-size: 20px; font-weight: 700; color: var(--purple); letter-spacing: -0.3px; }

/* Nav tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--purple-bg);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.nav-tab {
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-tab:hover { color: var(--purple); background: var(--white); }
.nav-tab.active {
  background: var(--white);
  color: var(--purple);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(83,74,183,0.12);
}

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

.scan-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  opacity: 0;
  transition: opacity var(--transition);
}
.scan-status:not(:empty) { opacity: 1; }
.scan-success { background: var(--teal-light); color: var(--teal); }
.scan-error   { background: var(--coral-light); color: var(--coral); }

.btn-scan {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-scan:hover   { background: var(--purple-light); }
.btn-scan:active  { transform: scale(0.97); }
.btn-scan:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-stop {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: #C0392B;
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-stop:hover:not(:disabled) { background: #A93226; }
.btn-stop:active:not(:disabled) { transform: scale(0.97); }
.btn-stop:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Main container ─────────────────────────────────────────────── */
.main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }

/* ─── Views ──────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ─── Filter bar ─────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition);
}
.filter-pill:hover  { border-color: var(--purple); color: var(--purple); }
.filter-pill.active { background: var(--purple); border-color: var(--purple); color: var(--white); }

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-teal   { background: var(--teal); }
.dot-coral  { background: var(--coral); }
.dot-purple { background: var(--purple); }
.dot-amber  { background: var(--amber); }
.dot-gray   { background: var(--gray); }
.dot-reddit { background: var(--reddit-color); }
.dot-black  { background: var(--tiktok-color); }
.dot-blue   { background: var(--twitter-color); }
.dot-pink   { background: var(--pink); }

.lead-count { margin-left: auto; font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ─── Leads Grid ─────────────────────────────────────────────────── */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

/* ─── Loading / Empty / Error states ────────────────────────────── */
.loading-state, .empty-state, .error-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 24px;
  color: var(--text-muted);
  text-align: center;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Lead Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: box-shadow var(--transition), transform var(--transition), opacity 0.4s ease;
  position: relative;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-managed { opacity: 0.45; }
.card-managed:hover { opacity: 0.65; }
.card-fade { opacity: 0 !important; transform: scale(0.95) translateY(4px) !important; pointer-events: none; }

/* Platform badge top-left accent strip */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card[data-platform="reddit"]::before  { background: var(--reddit-color); }
.card[data-platform="tiktok"]::before  { background: var(--tiktok-color); }
.card[data-platform="twitter"]::before { background: var(--twitter-color); }
.card[data-platform="onlyfans"]::before { background: var(--of-color); }

/* Card header */
.card-header { display: flex; align-items: flex-start; gap: 10px; }

.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
}
.badge-reddit  { background: var(--reddit-light);  color: var(--reddit-color); }
.badge-tiktok  { background: var(--tiktok-light);  color: var(--tiktok-color); }
.badge-twitter { background: var(--twitter-light); color: var(--twitter-color); }
.badge-onlyfans { background: var(--of-light);     color: var(--of-color); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.user-info { flex: 1; min-width: 0; }
.username {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.username:hover { text-decoration: underline; }
.meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* Score badge */
.score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 1;
}
.score-num  { font-size: 16px; font-weight: 800; color: var(--white); display: block; }
.tier-ltr   { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.85); display: block; margin-top: 1px; }
.tier-a     { background: var(--teal); }
.tier-b     { background: var(--amber); }
.tier-c     { background: var(--gray); }

/* Post quote */
.post-quote {
  background: var(--purple-faint);
  border-left: 3px solid var(--purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 13px;
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.55;
  font-style: italic;
}

/* Signal tags */
.tags-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
/* Coral = burnout/overwhelmed */
.tag-burnout  { background: var(--coral-light);  color: var(--coral); }
/* Purple = agency curious, link aggregator, multi-platform */
.tag-agency   { background: #EDE9FE;             color: #6D28D9; }
/* Amber = growth/plateau */
.tag-growth   { background: var(--amber-light);  color: #B45309; }
/* Teal = strong base, presence */
.tag-presence { background: var(--teal-light);   color: var(--teal); }
/* Pink = nsfw content, OF-adjacent */
.tag-nsfw     { background: var(--pink-light);   color: var(--pink); }
/* Teal = OF link */
.tag-of       { background: var(--of-light);     color: var(--of-color); }
/* Red = already managed */
.tag-managed  { background: var(--red-light);    color: var(--red); }

/* Platform chips */
.platforms-row { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.chip-of { background: var(--of-light);      color: var(--of-color); }
.chip-ig { background: #FDE7F3;              color: #BE185D; }
.chip-tw { background: var(--twitter-light); color: var(--twitter-color); }
.chip-tt { background: var(--tiktok-light);  color: var(--tiktok-color); }
.chip-yt { background: #FEE2E2;              color: #DC2626; }
.chip-sc { background: #FFF3CD;              color: #92400E; }

/* Stats row */
.stats-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Notes preview */
.notes-preview {
  background: var(--amber-light);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.5;
  border: 1px solid #FDE68A;
}

/* Card actions */
.card-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.btn-card {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-card:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-faint); }
.btn-of:hover   { background: var(--of-light); border-color: var(--of-color); color: var(--of-color); }
.btn-dm         { background: var(--purple); border-color: var(--purple); color: var(--white); }
.btn-dm:hover   { background: var(--purple-light); }
.btn-skip:hover { border-color: var(--coral); color: var(--coral); background: var(--coral-light); }

/* ─── Pipeline Board ─────────────────────────────────────────────── */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
  min-height: 60vh;
}
.pipeline-col {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
}
.col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}
.col-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.col-count {
  background: var(--gray-light);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.col-cards { display: flex; flex-direction: column; gap: 10px; min-height: 80px; }

.pipeline-card {
  background: var(--purple-bg);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.pipeline-card:hover { box-shadow: 0 2px 12px rgba(83,74,183,0.1); transform: translateY(-1px); }
.pipeline-card-header { display: flex; align-items: center; gap: 8px; }
.pipeline-card .username { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.score-badge-sm {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.score-badge-sm span { font-size: 10px; opacity: 0.85; font-weight: 600; }

.pipeline-signal { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.follow-up-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--amber-light);
  color: #B45309;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.pipeline-notes {
  font-size: 11.5px;
  color: #92400E;
  background: var(--amber-light);
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.4;
}
.pipeline-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.btn-stage {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  flex: 1;
  text-align: center;
}
.btn-stage:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-faint); }
.btn-stage-next { border-color: var(--purple); color: var(--purple); background: var(--purple-faint); }
.btn-stage-next:hover { background: var(--purple); color: var(--white); }

/* ─── Modals ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,10,40,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideUp 0.18s ease;
}
.modal-sm { max-width: 440px; }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title  { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-sub    { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.modal-close  {
  background: none; border: none; font-size: 18px; color: var(--text-muted);
  line-height: 1; padding: 2px 6px; border-radius: 6px; flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--gray-light); }

.post-preview {
  background: var(--purple-faint);
  border-left: 3px solid var(--purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
  line-height: 1.55;
  max-height: 90px;
  overflow-y: auto;
}

.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  display: flex; align-items: center; gap: 6px;
}
.field-hint  { font-size: 11.5px; font-weight: 400; color: var(--text-muted); }
.char-count  { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }

.tone-options { display: flex; gap: 6px; }
.tone-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  transition: all var(--transition);
}
.tone-btn:hover  { border-color: var(--purple); color: var(--purple); }
.tone-btn.active { background: var(--purple); border-color: var(--purple); color: var(--white); }

.dm-textarea, .notes-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--text);
}
.dm-textarea:focus, .notes-textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(83,74,183,0.1);
}
.notes-lg { min-height: 120px; }

.select-field {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  max-width: 200px;
  transition: border-color var(--transition);
}
.select-field:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(83,74,183,0.1); }
.follow-up-row { flex-direction: row; align-items: center; }
.follow-up-row .field-label { white-space: nowrap; }

.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.btn-primary {
  padding: 9px 20px; background: var(--purple); color: var(--white);
  border: none; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover  { background: var(--purple-light); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  padding: 9px 16px; background: var(--white); color: var(--text-soft);
  border: 1.5px solid var(--border); border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600; transition: all var(--transition);
}
.btn-secondary:hover    { border-color: var(--purple); color: var(--purple); background: var(--purple-faint); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-send {
  padding: 9px 18px; background: var(--teal); color: var(--white);
  border: none; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 600;
  margin-left: auto; transition: background var(--transition), transform var(--transition);
}
.btn-send:hover    { background: #188a64; }
.btn-send:active   { transform: scale(0.97); }
.btn-send:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 28px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 999;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateX(110%);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px; line-height: 1.4;
}
.toast.toast-show { transform: translateX(0); }
.toast-success { background: var(--teal);   color: var(--white); }
.toast-error   { background: var(--coral);  color: var(--white); }
.toast-info    { background: var(--purple); color: var(--white); }

/* ─── Sources Page ───────────────────────────────────────────────── */
.sources-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.sources-page-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.sources-page-sub   { font-size: 13px; color: var(--text-muted); }

/* Stats row */
.src-stats-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.src-stat {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 120px; flex: 1;
}
.src-stat-num   { font-size: 30px; font-weight: 800; color: var(--purple); line-height: 1; }
.src-stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }

/* Platform section card */
.platform-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.platform-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border);
}
.platform-section-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.icon-reddit  { background: var(--reddit-light);  color: var(--reddit-color); }
.icon-tiktok  { background: var(--tiktok-light);  color: var(--tiktok-color); }
.icon-twitter { background: var(--twitter-light); color: var(--twitter-color); }
.icon-of      { background: var(--of-light);      color: var(--of-color); }

.platform-section-name { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.platform-coming-soon {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: var(--gray-light);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600;
}
.platform-active-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: var(--teal-light);
  color: var(--teal);
  border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600;
}

/* Source table */
.src-table-wrap { overflow-x: auto; }
.src-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.src-table thead th {
  background: var(--purple-bg);
  color: var(--text-muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 16px; text-align: left;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.src-table tbody tr { border-bottom: 1px solid var(--border-soft); transition: background var(--transition); }
.src-table tbody tr:last-child { border-bottom: none; }
.src-table tbody tr:hover { background: var(--purple-bg); }
.src-table td { padding: 11px 16px; vertical-align: middle; color: var(--text-soft); }
.src-table td:first-child { font-weight: 600; color: var(--text); }

.src-name-link { color: var(--purple); text-decoration: none; font-weight: 600; }
.src-name-link:hover { text-decoration: underline; }
.src-loading { text-align: center; padding: 28px !important; color: var(--text-muted); }
.src-never   { color: var(--gray); font-style: italic; font-size: 12.5px; }
.src-leads-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  background: var(--purple-faint); color: var(--purple);
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 700;
}

/* Add / bulk section inside platform card */
.platform-section-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.src-add-row { display: flex; align-items: center; gap: 0; max-width: 440px; }
.src-prefix {
  padding: 9px 10px 9px 14px;
  background: var(--purple-bg);
  border: 1.5px solid var(--border); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--purple);
}
.src-input {
  flex: 1; padding: 9px 12px;
  border: 1.5px solid var(--border); border-right: none;
  font-size: 13.5px; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.src-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(83,74,183,0.1); z-index: 1; position: relative; }
.src-add-submit { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; padding: 9px 20px !important; white-space: nowrap; }
.src-add-error  { font-size: 12.5px; color: var(--coral); font-weight: 500; }
.src-add-error.hidden { display: none; }
.src-add-label  { font-size: 13px; font-weight: 600; color: var(--text-soft); }

.src-bulk-textarea {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; line-height: 1.6; resize: vertical; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.src-bulk-textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(83,74,183,0.1); }
.src-bulk-actions { display: flex; align-items: center; gap: 14px; }
.src-bulk-result  { font-size: 13px; font-weight: 500; color: var(--teal); }
.src-bulk-result.has-error { color: var(--coral); }

/* Remove button */
.btn-src-remove {
  padding: 3px 9px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--white);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  transition: all var(--transition); white-space: nowrap;
}
.btn-src-remove:hover { border-color: var(--coral); color: var(--coral); background: var(--coral-light); }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #D1D5DB; border-radius: 22px; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: var(--white); border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider         { background: var(--teal); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-slider   { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }

/* ─── Feed split layout ──────────────────────────────────────────── */
.card { cursor: pointer; }

#feed-layout.has-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
#feed-layout.has-detail .leads-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}

/* ─── Mini cards (left column in split view) ─────────────────────── */
.mini-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity var(--transition), border-color var(--transition), box-shadow var(--transition);
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}
.mini-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.mini-card[data-platform="reddit"]::before   { background: var(--reddit-color); }
.mini-card[data-platform="twitter"]::before  { background: var(--twitter-color); }
.mini-card[data-platform="tiktok"]::before   { background: var(--tiktok-color); }
.mini-card[data-platform="onlyfans"]::before { background: var(--of-color); }
.mini-card:not(.selected) { opacity: 0.45; }
.mini-card:hover { opacity: 1 !important; }
.mini-card.selected {
  border-color: var(--purple);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(83,74,183,0.15);
}
.mini-card-info { flex: 1; min-width: 0; }
.mini-card-user {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 1;
}
.mini-score-num  { font-size: 12px; font-weight: 800; color: var(--white); display: block; }
.mini-score-tier { font-size: 9px;  font-weight: 700; color: rgba(255,255,255,0.85); display: block; }

/* ─── Detail panel ───────────────────────────────────────────────── */
#detail-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.detail-header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.avatar-lg {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--white);
  flex-shrink: 0;
}
.detail-username {
  font-size: 15px; font-weight: 700; color: var(--purple);
  text-decoration: none; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-username:hover { text-decoration: underline; }
.detail-score { width: 52px; height: 52px; flex-shrink: 0; }

.detail-pipeline-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.detail-stage-pill {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: #EEEDFE; color: var(--purple);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; text-transform: capitalize;
}

.detail-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-bottom: 8px;
}
.detail-quote {
  background: #F8F7FF;
  border-left: 2px solid #AFA9EC;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 13px;
  font-size: 12.5px; color: var(--text-soft);
  font-style: italic; line-height: 1.55;
}
.detail-quote-meta { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.detail-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.detail-stat-box {
  background: #F8F7FF; border-radius: 8px;
  padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.detail-stat-val { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1; }
.detail-stat-val.teal  { color: var(--teal); }
.detail-stat-val.muted { color: var(--text-muted); font-weight: 500; }
.detail-stat-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; text-align: center; line-height: 1.2; }

.detail-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

.detail-notes-textarea {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; line-height: 1.55;
  resize: vertical; color: var(--text); min-height: 80px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.detail-notes-textarea:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(83,74,183,0.1);
}
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .leads-grid     { grid-template-columns: repeat(2, 1fr); }
  .pipeline-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .header-inner   { padding: 0 16px; gap: 16px; }
  .logo-text      { display: none; }
  .main           { padding: 20px 16px 48px; }
  .leads-grid     { grid-template-columns: 1fr; }
  .pipeline-board { grid-template-columns: 1fr; }
  .nav-tabs       { gap: 2px; }
  .nav-tab        { padding: 6px 12px; font-size: 12.5px; }
  .modal          { padding: 20px; }
  .modal-actions  { flex-direction: column; }
  .btn-send       { margin-left: 0; }
  .tone-options   { flex-wrap: wrap; }
  .follow-up-row  { flex-direction: column; align-items: flex-start; }
  .card-actions   { gap: 4px; }
  .btn-card       { font-size: 11px; padding: 4px 9px; }
  .filter-pill    { font-size: 12px; padding: 5px 10px; }
}
@media (max-width: 480px) {
  .score-badge { width: 44px; height: 44px; }
  .score-num   { font-size: 14px; }
}
