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

/* ─── SVG Icon Utilities ─────────────────────────────────────────────────── */
.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-sm  { width: 14px; height: 14px; }
.icon-lg  { width: 22px; height: 22px; }
.icon-xl  { width: 28px; height: 28px; }

:root {
  --bg:          #080810;
  --bg2:         #0e0e1a;
  --bg3:         #141428;
  --surface:     rgba(255,255,255,0.04);
  --surface-h:   rgba(255,255,255,0.07);
  --border:      rgba(255,255,255,0.08);
  --border-h:    rgba(255,255,255,0.16);

  --cyan:        #00d4ff;
  --cyan-dim:    rgba(0,212,255,0.15);
  --cyan-glow:   rgba(0,212,255,0.4);
  --purple:      #a855f7;
  --purple-dim:  rgba(168,85,247,0.15);
  --green:       #10b981;
  --green-dim:   rgba(16,185,129,0.15);
  --red:         #f43f5e;
  --red-dim:     rgba(244,63,94,0.15);
  --yellow:      #f59e0b;
  --yellow-dim:  rgba(245,158,11,0.15);

  --text:        #e8e8f0;
  --text-muted:  #7878a0;
  --text-dim:    #4a4a6a;

  --sidebar-w:   240px;
  --radius:      12px;
  --radius-lg:   18px;
  --radius-sm:   8px;

  --font:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;

  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
  --glow-cyan:   0 0 40px rgba(0,212,255,0.2);
  --glow-purple: 0 0 40px rgba(168,85,247,0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Animated BG Orbs ──────────────────────────────────────────────────── */
.bg-orbs {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
  animation: drift 20s ease-in-out infinite;
}
.orb-1 {
  width: 600px; height: 600px;
  background: var(--cyan);
  top: -200px; left: -200px;
  animation-duration: 18s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: var(--purple);
  bottom: -150px; right: -150px;
  animation-duration: 24s;
  animation-delay: -8s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: #3b82f6;
  top: 40%; left: 50%;
  animation-duration: 30s;
  animation-delay: -4s;
}
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(60px,-40px) scale(1.05); }
  66%      { transform: translate(-40px,60px) scale(0.95); }
}

/* ─── App Shell ─────────────────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(14,14,26,0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 32px;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
}
.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 12px var(--cyan));
}
.logo-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.logo-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  position: relative;
}
.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(0,212,255,0.2);
}
.nav-icon { font-size: 16px; }

.nav-badge {
  margin-left: auto;
  background: var(--purple-dim);
  color: var(--purple);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(168,85,247,0.3);
}

.sidebar-status {
  margin-top: auto;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.status-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.3s;
}
.status-item.ok .status-dot   { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-item.ok               { color: var(--text); }
.status-item.err .status-dot  { background: var(--red); }
.status-item.err              { color: var(--text-muted); }

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ─── Pages ──────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-h); }

/* ─── Search Form ────────────────────────────────────────────────────────── */
.search-card { margin-bottom: 24px; }

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.field-input,
.field-select,
input[type="number"].field-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
input[type="number"].field-input::-webkit-inner-spin-button,
input[type="number"].field-input::-webkit-outer-spin-button {
  opacity: 0.4;
}
.field-input:focus,
.field-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.field-input::placeholder { color: var(--text-dim); }
.field-select option { background: var(--bg2); }

.field-hint { font-size: 11px; color: var(--text-dim); }

.field-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  margin: 6px 0;
}
.field-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-glow);
  border: 2px solid white;
}

/* Backend toggle */
.backend-toggle { display: flex; gap: 8px; }
.backend-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.backend-btn:hover { border-color: var(--border-h); color: var(--text); }
.backend-btn.active {
  background: var(--cyan-dim);
  border-color: rgba(0,212,255,0.4);
  color: var(--cyan);
}

.search-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #0099cc 100%);
  color: #000;
  box-shadow: 0 4px 16px rgba(0,212,255,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,212,255,0.45);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-h);
  border-color: var(--border-h);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(244,63,94,0.3);
}

.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-xs  { padding: 5px 10px; font-size: 12px; }
.btn-icon { font-size: 16px; }

/* ─── Progress ───────────────────────────────────────────────────────────── */
.progress-card {
  margin-bottom: 24px;
  border-color: rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.03);
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.progress-spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; display: inline-block; }

.progress-title { font-size: 15px; font-weight: 600; }
.progress-msg   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
  animation: progress-pulse 1.5s ease-in-out infinite;
  width: 60%;
}
@keyframes progress-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.progress-log {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  max-height: 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.progress-log .log-line { animation: fadein 0.2s ease; }

/* ─── Stats ──────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-val {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.stat-green { border-color: rgba(16,185,129,0.3); }
.stat-green .stat-val { color: var(--green); }
.stat-purple { border-color: rgba(168,85,247,0.3); }
.stat-purple .stat-val { color: var(--purple); }
.stat-red { border-color: rgba(244,63,94,0.3); }
.stat-red .stat-val { color: var(--red); }

/* ─── Bulk Bar ───────────────────────────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 20px;
}
.bulk-info { font-size: 14px; color: var(--text-muted); }
.bulk-info span { color: var(--cyan); font-weight: 600; }
.bulk-actions { display: flex; align-items: center; gap: 10px; }

/* ─── Leads Table ────────────────────────────────────────────────────────── */
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leads-table thead {
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}
.leads-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  white-space: nowrap;
}
.th-check { width: 40px; }

.leads-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.leads-table tbody tr:hover { background: var(--surface); }
.leads-table tbody tr.selected { background: rgba(0,212,255,0.05); }
.leads-table tbody tr:last-child { border-bottom: none; }

.leads-table td {
  padding: 13px 16px;
  vertical-align: middle;
}

.lead-name { font-weight: 600; color: var(--text); }
.lead-cat  { color: var(--text-muted); font-size: 12px; }
.lead-addr { color: var(--text-muted); font-size: 12px; max-width: 200px; }
.lead-addr a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 11px;
}
.lead-addr a:hover { text-decoration: underline; }

/* Rating */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.rating-stars { color: var(--yellow); font-size: 10px; }

/* Web badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(244,63,94,0.25); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(245,158,11,0.25); }
.badge-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }

/* Row actions */
.row-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Vault Grid ─────────────────────────────────────────────────────────── */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vault-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
  animation: fadein 0.3s ease;
}
.vault-item:hover {
  border-color: rgba(0,212,255,0.3);
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}
.vault-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  word-break: break-word;
}
.vault-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: 14px;
}
.vault-files { display: flex; gap: 8px; flex-wrap: wrap; }
.vault-file-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.vault-file-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.vault-file-btn.product:hover { border-color: var(--purple); color: var(--purple); }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}
.empty-icon-svg {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--text-dim);
  opacity: 0.6;
}
.empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-sub   { font-size: 14px; color: var(--text-muted); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadein 0.2s ease;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideup 0.25s ease;
}
@keyframes slideup {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.modal-tabs  { display: flex; gap: 8px; margin-left: auto; }
.modal-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.modal-tab.active {
  background: var(--cyan-dim);
  border-color: rgba(0,212,255,0.4);
  color: var(--cyan);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--red-dim); color: var(--red); border-color: var(--red); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
}
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Markdown Preview */
.doc-preview {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.doc-preview h1 {
  font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.doc-preview h2 {
  font-size: 16px; font-weight: 700;
  color: var(--cyan);
  margin: 24px 0 12px;
}
.doc-preview h3 {
  font-size: 14px; font-weight: 600;
  color: var(--purple);
  margin: 16px 0 8px;
}
.doc-preview p   { margin-bottom: 12px; color: var(--text); }
.doc-preview ul, .doc-preview ol { margin: 8px 0 12px 20px; }
.doc-preview li  { margin-bottom: 6px; color: var(--text-muted); }
.doc-preview strong { color: var(--text); font-weight: 600; }
.doc-preview code {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
}
.doc-preview pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}
.doc-preview pre code {
  background: none; border: none; padding: 0; color: var(--text);
}
.doc-preview blockquote {
  border-left: 3px solid var(--cyan);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--cyan-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.doc-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.doc-preview th {
  background: rgba(0,0,0,0.3);
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.doc-preview td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

/* Frontmatter stripping */
.doc-preview .frontmatter { display: none; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideup 0.25s ease, fadeout 0.3s ease 2.7s forwards;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { border-color: rgba(16,185,129,0.4); color: var(--green); }
.toast-error   { border-color: rgba(244,63,94,0.4);  color: var(--red); }
.toast-info    { border-color: rgba(0,212,255,0.3);  color: var(--cyan); }
@keyframes fadeout { to { opacity: 0; transform: translateX(20px); } }

/* ─── Generating row state ───────────────────────────────────────────────── */
.lead-row-generating td { opacity: 0.6; }
.lead-row-done td:first-child::after {
  content: ' ✅';
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
}

/* ─── Pipeline ───────────────────────────────────────────────────────────── */
.pipeline-card { margin-bottom: 20px; padding: 20px 24px; }
.pipeline-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 16px;
}
.pipeline-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pipe-step {
  flex: 1; min-width: 80px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  transition: all 0.2s;
}
.pipe-step:hover { transform: translateY(-2px); }
.pipe-n   { display: block; font-size: 24px; font-weight: 700; font-family: var(--mono); }
.pipe-lbl { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pipe-arrow { font-size: 20px; color: var(--text-dim); flex-shrink: 0; }

.pipe-nuovo      { border-color: rgba(0,212,255,0.25); }
.pipe-nuovo      .pipe-n { color: var(--cyan); }
.pipe-contattato { border-color: rgba(168,85,247,0.25); }
.pipe-contattato .pipe-n { color: var(--purple); }
.pipe-trattativa { border-color: rgba(245,158,11,0.25); }
.pipe-trattativa .pipe-n { color: var(--yellow); }
.pipe-cliente    { border-color: rgba(16,185,129,0.3); }
.pipe-cliente    .pipe-n { color: var(--green); }
.pipe-perso      { border-color: rgba(244,63,94,0.2); }
.pipe-perso      .pipe-n { color: var(--text-dim); }

/* ─── DB Filters ─────────────────────────────────────────────────────────── */
.db-filters { margin-bottom: 16px; padding: 16px 20px; }
.db-filter-row { display: flex; gap: 16px; align-items: flex-end; }

/* ─── Table footer ───────────────────────────────────────────────────────── */
.table-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}

/* ─── Status select inline ───────────────────────────────────────────────── */
.status-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  padding: 3px 10px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}
.status-select:focus { border-color: var(--cyan); }
.status-select option { background: var(--bg2); }

/* Status colors */
.status-nuovo      { color: var(--cyan);   border-color: rgba(0,212,255,0.3);   background: rgba(0,212,255,0.06); }
.status-contattato { color: var(--purple); border-color: rgba(168,85,247,0.3);  background: rgba(168,85,247,0.06); }
.status-trattativa { color: var(--yellow); border-color: rgba(245,158,11,0.3);  background: rgba(245,158,11,0.06); }
.status-cliente    { color: var(--green);  border-color: rgba(16,185,129,0.3);  background: rgba(16,185,129,0.08); }
.status-perso      { color: var(--text-dim); border-color: rgba(255,255,255,0.1); }

