/* ═══════════════════════════════════════════════════════════════
   RTGEO — Módulo de Follow-up Preditivo & Gestão de Leads
   Design System Oficial: Regional Triângulo Imóveis
   ═══════════════════════════════════════════════════════════════ */

/* ─── Container Principal ─── */
#app-followup {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  font-family: var(--font-sans, 'Outfit', sans-serif);
  color: var(--text-main, #1e293b);
  box-sizing: border-box;
}

/* ═══════════ 1. TOOLBAR / SUB-HEADER ═══════════ */
.followup-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(15, 23, 42, 0.05));
  gap: 16px;
  flex-wrap: wrap;
}

.followup-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.followup-title-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md, 10px);
  background: var(--primary-light, #eef3fb);
  color: var(--primary, #274c8a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.followup-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary, #274c8a);
  margin: 0 0 2px 0;
  letter-spacing: -0.3px;
}

.followup-subtitle {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin: 0;
}

.followup-subtitle strong {
  color: var(--text-main, #1e293b);
}

.followup-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app, #f4f6fa);
  border: 1px solid var(--border, #e2e8f0);
  padding: 5px 12px;
  border-radius: var(--radius-full, 9999px);
  font-size: 12px;
  color: var(--text-main, #1e293b);
}

.user-email {
  font-weight: 600;
  color: var(--text-main, #1e293b);
}

.role-badge-master {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.role-badge-corretor {
  background: var(--surface, #ffffff);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  font-size: 10px;
  font-weight: 600;
}

.btn-sync-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.28);
  transition: all 0.2s ease;
}

.btn-sync-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.38);
}

.btn-action-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full, 9999px);
  background: var(--surface, #ffffff);
  color: var(--text-main, #1e293b);
  border: 1px solid var(--border, #e2e8f0);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-icon:hover {
  background: var(--bg-app, #f4f6fa);
  border-color: var(--primary-bright, #3b66ac);
  color: var(--primary, #274c8a);
}

.btn-action-icon.btn-logout {
  color: var(--danger, #ef4444);
}

.btn-action-icon.btn-logout:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ═══════════ 2. KPI GRID ═══════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card, 0 4px 12px -2px rgba(15, 23, 42, 0.08));
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated, 0 12px 28px -4px rgba(15, 23, 42, 0.14));
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.kpi-card.accent::before { background: var(--primary, #274c8a); }
.kpi-card.success::before { background: var(--oportunidade, #26a25c); }
.kpi-card.danger::before { background: var(--danger, #ef4444); }
.kpi-card.warn::before { background: var(--warning, #d97706); }

.kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #64748b);
  margin-bottom: 6px;
}

.kpi-card .kpi-value {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.kpi-card.accent .kpi-value { color: var(--primary, #274c8a); }
.kpi-card.success .kpi-value { color: var(--oportunidade, #26a25c); }
.kpi-card.danger .kpi-value { color: var(--danger, #ef4444); }
.kpi-card.warn .kpi-value { color: var(--warning, #d97706); }

.kpi-card .kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
  margin-top: 4px;
  font-weight: 500;
}

/* ═══════════ 3. FUNIL DE ATENDIMENTO & MOTIVOS DE DESCARTE ═══════════ */
.charts-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.chart-section {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: 16px 20px;
  box-shadow: var(--shadow-card, 0 4px 12px -2px rgba(15, 23, 42, 0.08));
  display: flex;
  flex-direction: column;
}

.chart-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-section-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary, #274c8a);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-section-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: var(--bg-app, #f4f6fa);
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border, #e2e8f0);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  min-width: 140px;
  max-width: 180px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-app, #f4f6fa);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full, 9999px);
  background: linear-gradient(90deg, var(--primary, #274c8a) 0%, var(--primary-bright, #3b66ac) 100%);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 24px;
}

.bar-fill.danger {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.bar-value {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10.5px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

.unidade-switch-pills {
  display: inline-flex;
  align-items: center;
  background: rgba(226, 232, 240, 0.8);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid var(--border, #cbd5e1);
  gap: 2px;
}

.unidade-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-family: inherit;
  font-weight: 700;
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unidade-tab-btn:hover {
  color: var(--text-main, #1e293b);
}

.unidade-tab-btn.active {
  background: #ffffff;
  color: var(--text-main, #1e293b);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ═══════════ 4. FILTROS & ORDENAÇÃO ═══════════ */
.filters-bar {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card, 0 4px 12px -2px rgba(15, 23, 42, 0.08));
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
}

.filter-group select,
.filter-group input[type="text"] {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 6px 12px;
  height: 36px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-main, #1e293b);
  min-width: 150px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
  border-color: var(--primary, #274c8a);
  box-shadow: 0 0 0 3px rgba(39, 76, 138, 0.12);
}

.filter-group.search-input {
  flex: 1;
  min-width: 220px;
}

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-bar .count {
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
}

.stats-bar .count strong {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  color: var(--primary, #274c8a);
}

.sort-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(226, 232, 240, 0.6);
  padding: 3px;
  border-radius: var(--radius-full, 9999px);
}

.sort-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted, #64748b);
  background: transparent;
  border: none;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sort-btn:hover {
  color: var(--text-main, #1e293b);
}

.sort-btn.active {
  background: var(--surface, #ffffff);
  color: var(--primary, #274c8a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.action-btn-whatsapp-direct:hover {
  transform: translateY(-1px);
  background: #1eb857 !important;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4) !important;
}

#btn-export-csv:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

/* ═══════════ 5. LEAD CARDS (ESTRUTURA COMPLETA) ═══════════ */
.leads-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.lead-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card, 0 4px 12px -2px rgba(15, 23, 42, 0.08));
}

.lead-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-elevated, 0 12px 28px -4px rgba(15, 23, 42, 0.14));
}

.lead-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.lead-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.priority-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.lead-name-block {
  min-width: 0;
}

.lead-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-meta {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.lead-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lead-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-full, 9999px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-phase {
  background: var(--primary-light, #eef3fb);
  color: var(--primary, #274c8a);
  border: 1px solid rgba(39, 76, 138, 0.18);
}

.tag-type {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.tag-temp {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.tag-motive {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.contact-log-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-full, 9999px);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  white-space: nowrap;
}

.expand-arrow {
  color: var(--text-muted, #64748b);
  font-size: 12px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.lead-card.expanded .expand-arrow {
  transform: rotate(180deg);
}

/* ═══════════ 6. CONTEÚDO EXPANDIDO DO CARD (NOVO LAYOUT MASTER 2-COLUNAS) ═══════════ */
.lead-expanded {
  display: none;
  padding: 16px 20px 22px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
}

.lead-card.expanded .lead-expanded {
  display: block;
}

.lead-expanded-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 6.1 Barra Superior de Ações Rápidas (Quick Ribbon) */
.lead-quick-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  gap: 12px;
  flex-wrap: wrap;
}

.quick-actions-left,
.quick-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-quick-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #ffffff);
  color: var(--text-main, #1e293b);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-quick-action:hover {
  transform: translateY(-1px);
}

.btn-wa-primary {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white !important;
  border: none;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}

.btn-wa-primary:hover {
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.45);
}

.btn-contact-record {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.btn-contact-record:hover {
  background: #d1fae5;
  color: #047857;
}

.badge-already-contacted {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  padding: 5px 12px;
  border-radius: var(--radius-full, 9999px);
  font-size: 11.5px;
  font-weight: 600;
}

.btn-imoview-link {
  background: var(--primary-light, #eef3fb);
  color: var(--primary, #274c8a);
  border-color: rgba(39, 76, 138, 0.2);
}

.btn-imoview-link:hover {
  background: #e0ecfb;
}

.btn-deactivate-lead {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-deactivate-lead:hover {
  background: #fee2e2;
}

.btn-reactivate-lead {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

/* 6.2 Formulário de Contato Rápido */
.contact-form-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-md, 10px);
}

.contact-corretor-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: #1e293b;
  outline: none;
}

.btn-confirm-contact {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-cancel-contact {
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

/* 6.3 Grid Principal de 2 Colunas */
.lead-main-grid {
  display: grid;
  grid-template-columns: minmax(310px, 38%) 1fr;
  gap: 16px;
}

@media (max-width: 960px) {
  .lead-main-grid {
    grid-template-columns: 1fr;
  }
}

.lead-left-column,
.lead-right-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 6.4 Painéis Padronizados (.lead-panel-box) */
.lead-panel-box {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.panel-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.panel-box-header h3 {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary, #274c8a);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-icon {
  font-size: 14px;
}

/* 6.5 Grid de Dados de Contato */
.info-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.data-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.data-item.full-width {
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

.data-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.data-value {
  font-size: 12.5px;
  color: var(--text-main, #1e293b);
  font-weight: 500;
  word-break: break-word;
}

.phone-link {
  color: #059669;
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-mono, monospace);
}

.phone-link:hover {
  text-decoration: underline;
}

.campaign-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary, #274c8a);
  background: var(--primary-light, #eef3fb);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.price-highlight {
  font-family: var(--font-mono, monospace);
  font-size: 13.5px;
  font-weight: 800;
  color: #059669;
}

/* 6.6 Lista de Contexto & Histórico */
.context-styled-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.context-styled-list li {
  font-size: 12px;
  color: var(--text-muted, #475569);
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}

.context-styled-list li::before {
  content: '•';
  position: absolute;
  left: 2px;
  color: var(--primary, #274c8a);
  font-weight: 800;
  font-size: 14px;
}

.context-styled-list li strong {
  color: var(--text-main, #1e293b);
}

/* 6.7 Ação Recomendada (Estratégia IA) */
.strategy-box {
  border-left: 4px solid var(--primary, #274c8a);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.priority-score-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #274c8a);
  background: var(--primary-light, #eef3fb);
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid rgba(39, 76, 138, 0.2);
}

.strategy-text-content {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main, #1e293b);
  line-height: 1.55;
}

/* 6.8 Script de Abordagem Sugerido */
.script-panel-box {
  border-left: 4px solid #10b981;
}

.script-badge-type {
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid #a7f3d0;
}

.chat-preview-bubble {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px 12px 12px 2px;
  padding: 14px 16px;
  position: relative;
  margin-bottom: 12px;
}

.chat-bubble-content {
  font-size: 13px;
  color: #14532d;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-bubble-footer-time {
  font-size: 10.5px;
  color: #16a34a;
  text-align: right;
  margin-top: 6px;
  font-weight: 600;
}

.script-footer-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-script-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full, 9999px);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-copy-text {
  background: #ffffff;
  color: var(--text-main, #1e293b);
  border: 1px solid var(--border, #cbd5e1);
}

.btn-copy-text:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-copy-text.copied {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.btn-send-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white !important;
  border: none;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}

.btn-send-whatsapp:hover {
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.45);
}

/* 6.9 Playbook de Respostas Rápidas */
.lead-playbook-container {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  margin-top: 14px;
}

.playbook-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.playbook-main-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary, #274c8a);
}

.playbook-tagline {
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
}

.playbook-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.playbook-box {
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px;
}

.playbook-box.positive { border-top: 3.5px solid #10b981; }
.playbook-box.negative { border-top: 3.5px solid #ef4444; }
.playbook-box.no-response { border-top: 3.5px solid #f59e0b; }

.playbook-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main, #1e293b);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: #10b981; }
.status-dot.red { background: #ef4444; }
.status-dot.amber { background: #f59e0b; }

.playbook-steps-list {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.playbook-steps-list li {
  counter-increment: step;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.45;
  padding-left: 20px;
  position: relative;
}

.playbook-steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════ 7. CARDS DESATIVADOS ═══════════ */
.lead-card.deactivated {
  opacity: 0.55;
  background: #f8fafc;
  border-style: dashed;
}

/* ═══════════ 8. PAGINAÇÃO ═══════════ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  color: var(--text-main, #1e293b);
  padding: 6px 12px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 36px;
  text-align: center;
}

.page-btn:hover {
  background: var(--bg-app, #f4f6fa);
  border-color: var(--primary, #274c8a);
  color: var(--primary, #274c8a);
}

.page-btn.active {
  background: var(--primary, #274c8a);
  border-color: var(--primary, #274c8a);
  color: white;
  box-shadow: 0 2px 6px rgba(39, 76, 138, 0.3);
}

/* ═══════════ 9. MODAIS (INFO, SYNC, EQUIPE) ═══════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-box {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-xl, 16px);
  padding: 24px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-popup, 0 20px 35px -5px rgba(15, 23, 42, 0.22));
  max-height: 90vh;
  overflow-y: auto;
  font-family: var(--font-sans, 'Outfit', sans-serif);
}

.modal-box.info-modal {
  max-width: 620px;
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary, #274c8a);
  text-align: center;
}

.modal-text {
  font-size: 13px;
  color: var(--text-muted, #64748b);
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: center;
}

.info-section {
  margin-bottom: 14px;
  background: var(--bg-app, #f4f6fa);
  padding: 14px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border, #e2e8f0);
}

.info-section h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary, #274c8a);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-section ul {
  list-style: none;
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-section li {
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.info-section li::before {
  content: '•';
  color: var(--primary, #274c8a);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* ═══════════ 10. ESTADOS DE CARREGAMENTO & VAZIO ═══════════ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border, #e2e8f0);
  border-top-color: var(--primary, #274c8a);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface, #ffffff);
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
}

.empty-state .emoji {
  font-size: 36px;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--text-muted, #64748b);
  max-width: 380px;
  margin: 0 auto;
}