/* ════════════════════════════════════════════════════════════
   STRIPE DASHBOARD STYLE — escopado em #leadsSection apenas
   Branco puro, indigo #635BFF, hairlines, density business.
   ════════════════════════════════════════════════════════════ */

/* Tokens internos (reutilizados só dentro desta scope) */
#leadsSection {
  /* Stripe palette */
  --st-bg:        #FFFFFF;
  --st-bg-soft:   #F6F9FC;
  --st-bg-hover:  #F7FAFC;
  --st-line:      #E3E8EE;
  --st-line-soft: rgba(0, 0, 0, 0.06);
  --st-line-strong: #C1C9D2;
  --st-tx-1:      #0A2540;
  --st-tx-2:      #425466;
  --st-tx-3:      #697386;
  --st-tx-muted:  #8898AA;

  --st-indigo:        #635BFF;
  --st-indigo-hover:  #5147FF;
  --st-indigo-active: #4239E0;
  --st-indigo-bg:     rgba(99, 91, 255, 0.08);
  --st-indigo-border: rgba(99, 91, 255, 0.20);

  --st-success: #00D924;
  --st-success-bg: rgba(0, 217, 36, 0.10);
  --st-warning: #F5A524;
  --st-warning-bg: rgba(245, 165, 36, 0.12);
  --st-danger: #DF1C41;
  --st-danger-bg: rgba(223, 28, 65, 0.10);
  --st-info: #635BFF;

  --st-shadow-card: 0 1px 2px rgba(0,0,0,0.05), 0 1px 1px rgba(0,0,0,0.04);
  --st-shadow-elev: 0 4px 8px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);

  --st-r-sm: 4px;
  --st-r-md: 6px;
  --st-r-lg: 8px;

  /* Apply baseline */
  background: var(--st-bg);
  color: var(--st-tx-1);
  font-family: 'Sohne', 'Inter', -apple-system, system-ui, sans-serif;
  font-feature-settings: 'cv02','cv03','cv04','cv11','tnum';
}

/* ── PAGE HEADER ── */
#leadsSection .header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--st-line);
  flex-wrap: wrap;
}
#leadsSection .header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--st-tx-1);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}
#leadsSection .header .sub {
  font-size: 14px;
  color: var(--st-tx-3);
  font-weight: 400;
  margin-top: 4px;
}
#leadsSection .header .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Buttons em #leadsSection */
#leadsSection .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  height: 32px;
  border-radius: var(--st-r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--st-tx-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
#leadsSection .btn-primary {
  background: var(--st-indigo);
  color: #FFFFFF !important;
  border-color: var(--st-indigo);
  box-shadow: 0 1px 1px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.18);
  font-weight: 600;
}
#leadsSection .btn-primary:hover { background: var(--st-indigo-hover); border-color: var(--st-indigo-hover); }
#leadsSection .btn-primary:active { background: var(--st-indigo-active); }
#leadsSection .btn-primary svg,
#leadsSection .btn-primary * { color: #FFFFFF; stroke: #FFFFFF; }

#leadsSection .btn-ghost {
  background: var(--st-bg);
  color: var(--st-tx-2);
  border-color: var(--st-line);
}
#leadsSection .btn-ghost:hover {
  background: var(--st-bg-hover);
  color: var(--st-tx-1);
  border-color: var(--st-line-strong);
}

#leadsSection .btn-ico {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
}
#leadsSection .btn-ico svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

/* ── STATS GRID (Stripe metrics) ── */
#leadsSection .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 980px) { #leadsSection .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { #leadsSection .stats { grid-template-columns: 1fr; } }

#leadsSection .stat {
  background: var(--st-bg);
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-lg);
  padding: 18px 20px;
  box-shadow: var(--st-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
#leadsSection .stat:hover {
  border-color: var(--st-line-strong);
  box-shadow: var(--st-shadow-elev);
}
#leadsSection .stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--st-tx-3);
  text-transform: none;
  letter-spacing: 0;
}
#leadsSection .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--st-tx-1);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-feature-settings: 'tnum';
}
#leadsSection .stat.accent { border-color: var(--st-indigo-border); }
#leadsSection .stat.accent .stat-value { color: var(--st-indigo); }

/* ── FILTERS BAR (Stripe-style) ── */
#leadsSection .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--st-bg);
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-lg);
}
#leadsSection .search {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: none;
  height: 36px;
  padding: 7px 12px 7px 36px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-md);
  background: var(--st-bg) 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='%23697386' 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 12px center;
  font-family: inherit;
  font-size: 13px;
  color: var(--st-tx-1);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
#leadsSection .search::placeholder { color: var(--st-tx-muted); }
#leadsSection .search:focus {
  border-color: var(--st-indigo);
  box-shadow: 0 0 0 2px rgba(99, 91, 255, 0.20);
}
#leadsSection .filters select {
  appearance: none;
  flex: 0 1 128px;
  min-width: 112px;
  height: 32px;
  padding: 5px 28px 5px 12px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-md);
  background: var(--st-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--st-tx-2);
  cursor: pointer;
  outline: none;
}
#leadsSection .filters select:hover { border-color: var(--st-line-strong); color: var(--st-tx-1); }
#leadsSection .filters select:focus {
  border-color: var(--st-indigo);
  box-shadow: 0 0 0 2px rgba(99, 91, 255, 0.20);
}
#leadsSection .filters .btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 6px 12px;
}
#leadsSection .filters .btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
}

#leadsSection #orderByFilter {
  flex-basis: 142px;
}

@media (min-width: 1180px) {
  #leadsSection .filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(5, minmax(112px, 126px)) auto auto;
  }

  #leadsSection .filters .search,
  #leadsSection .filters select,
  #leadsSection #orderByFilter {
    width: 100%;
    min-width: 0;
  }

  #leadsSection .filters .btn {
    width: max-content;
  }
}

#leadsSection .active-filters-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--st-indigo-bg);
  color: var(--st-indigo);
  font-size: 11px;
  font-weight: 600;
}

/* ── ADVANCED FILTERS PANEL ── */
#leadsSection .filters-advanced {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--st-bg-soft);
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-lg);
}
#leadsSection .filt-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
#leadsSection .filt-group:last-child { margin-bottom: 0; }
#leadsSection .filt-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-tx-3);
  min-width: 70px;
}
#leadsSection .filt-group input,
#leadsSection .filt-group select {
  height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-sm);
  background: var(--st-bg);
  font: inherit;
  font-size: 12px;
  color: var(--st-tx-1);
  outline: none;
}
#leadsSection .filt-group input:focus,
#leadsSection .filt-group select:focus {
  border-color: var(--st-indigo);
  box-shadow: 0 0 0 2px rgba(99, 91, 255, 0.20);
}
#leadsSection .date-presets { display: inline-flex; gap: 4px; }
#leadsSection .date-presets button {
  height: 26px;
  padding: 2px 10px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-sm);
  background: var(--st-bg);
  color: var(--st-tx-2);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
#leadsSection .date-presets button:hover {
  background: var(--st-bg-hover);
  color: var(--st-tx-1);
  border-color: var(--st-line-strong);
}

/* ── TABLE (Stripe data table) ── */
#leadsSection .lead-table,
#leadsSection table.leads-list {
  width: 100%;
  border-collapse: collapse;
  background: var(--st-bg);
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-lg);
  overflow: hidden;
  box-shadow: var(--st-shadow-card);
}
#leadsSection .lead-table thead,
#leadsSection table.leads-list thead {
  background: var(--st-bg-soft);
  border-bottom: 1px solid var(--st-line);
}
#leadsSection .lead-table th,
#leadsSection table.leads-list th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--st-tx-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--st-line);
  white-space: nowrap;
}
#leadsSection .lead-table td,
#leadsSection table.leads-list td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--st-tx-1);
  border-bottom: 1px solid var(--st-line);
  vertical-align: middle;
}
#leadsSection .lead-table tbody tr,
#leadsSection table.leads-list tbody tr {
  transition: background 0.10s;
  cursor: pointer;
}
#leadsSection .lead-table tbody tr:hover td,
#leadsSection table.leads-list tbody tr:hover td {
  background: var(--st-bg-hover);
}
#leadsSection .lead-table tbody tr:last-child td,
#leadsSection table.leads-list tbody tr:last-child td {
  border-bottom: 0;
}

/* Lead row específicos */
#leadsSection .lead-name { font-weight: 600; color: var(--st-tx-1); }
#leadsSection .lead-email { color: var(--st-tx-3); font-size: 12px; }
#leadsSection .lead-value { font-weight: 600; font-feature-settings: 'tnum'; color: var(--st-tx-1); }

/* Status pills (Stripe) */
#leadsSection .pill,
#leadsSection .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border: 0;
  white-space: nowrap;
}
#leadsSection .pill::before,
#leadsSection .badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
#leadsSection .pill-novo,
#leadsSection .pill-status-novo { background: rgba(0,0,0,0.06); color: var(--st-tx-2); }
#leadsSection .pill-contatado { background: var(--st-warning-bg); color: var(--st-warning); }
#leadsSection .pill-tent_1, #leadsSection .pill-tent_2,
#leadsSection .pill-tent_3, #leadsSection .pill-tent_4 {
  background: var(--st-warning-bg); color: var(--st-warning);
}
#leadsSection .pill-qualificado,
#leadsSection .pill-reuniao,
#leadsSection .pill-proposta { background: var(--st-indigo-bg); color: var(--st-indigo); }
#leadsSection .pill-fechado { background: var(--st-success-bg); color: var(--st-success); }
#leadsSection .pill-perdido { background: var(--st-danger-bg); color: var(--st-danger); }

/* Source pills */
#leadsSection .pill-lab { background: var(--st-indigo-bg); color: var(--st-indigo); }
#leadsSection .pill-partners { background: rgba(34, 139, 230, 0.10); color: #228BE6; }
#leadsSection .pill-ecom { background: var(--st-warning-bg); color: var(--st-warning); }
#leadsSection .pill-reboot { background: var(--st-danger-bg); color: var(--st-danger); }
#leadsSection .pill-protocolo { background: rgba(34, 197, 94, 0.12); color: #16A34A; }

/* Score badges */
#leadsSection .score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-feature-settings: 'tnum';
}

/* Avatar circle */
#leadsSection .lead-avatar,
#leadsSection .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--st-indigo-bg);
  color: var(--st-indigo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Pagination */
#leadsSection .pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 16px;
  background: var(--st-bg);
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-lg);
  font-size: 13px;
  color: var(--st-tx-2);
}
#leadsSection .pagination button {
  height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-sm);
  background: var(--st-bg);
  color: var(--st-tx-1);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
#leadsSection .pagination button:hover:not(:disabled) {
  background: var(--st-bg-hover);
  border-color: var(--st-line-strong);
}
#leadsSection .pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Bulk actions / selected bar */
#leadsSection .bulk-bar,
#leadsSection .selected-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--st-indigo-bg);
  border: 1px solid var(--st-indigo-border);
  border-radius: var(--st-r-md);
  font-size: 13px;
  color: var(--st-tx-1);
}

/* Empty state */
#leadsSection .empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--st-bg);
  border: 1px dashed var(--st-line);
  border-radius: var(--st-r-lg);
  color: var(--st-tx-3);
}

/* Loading */
#leadsSection .loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--st-tx-3);
}

/* Checkbox em linhas */
#leadsSection input[type="checkbox"] {
  accent-color: var(--st-indigo);
  cursor: pointer;
}
