/* ═══════════════════════════════════════════════════════════════
   ARANTES TECNOLOGIA — PAINEL ADMINISTRATIVO (ESTILOS DEDICADOS)
   admin-layout.css — Layout, Dashboard, Tabela, Modais e Componentes
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. LAYOUT PRINCIPAL E APP SHELL ── */
.admin-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  position: relative;
  overflow-x: hidden;
}

/* Background canvas de partículas */
#admin-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.admin-content-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── 2. TOPBAR HEADER ── */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 4rem;
  background-color: hsl(var(--background) / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border) / 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transition: border-color var(--transition-fast);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.topbar-brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.4));
}

.topbar-brand-divider {
  width: 1px;
  height: 22px;
  background-color: hsl(var(--border));
}

.topbar-brand-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.topbar-brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.topbar-live-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.3125rem 0.75rem 0.3125rem 0.375rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--arantes-purple)), hsl(var(--arantes-cyan)));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.admin-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-user-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.8125rem;
}

.admin-user-role {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

/* ── 3. CONTAINER PRINCIPAL DO DASHBOARD ── */
.admin-main-container {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── 4. DASHBOARD HEADER & AÇÕES RÁPIDAS ── */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 0.5rem;
}

.dash-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.dash-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.dash-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin: 0;
  max-width: 680px;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── 5. CARDS DE MÉTRICAS (KPI METRICS GRID) ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.metric-card {
  position: relative;
  background-color: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.375rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--card-accent, var(--primary))), transparent);
  opacity: 0.8;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--card-accent, var(--primary)) / 0.6);
  box-shadow: 0 10px 25px -10px hsl(var(--card-accent, var(--primary)) / 0.25);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.metric-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  background-color: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  transition: all var(--transition-fast);
}

.metric-card:hover .metric-icon-wrap {
  background-color: hsl(var(--card-accent, var(--primary)) / 0.15);
  color: hsl(var(--card-accent, var(--primary)));
}

.metric-value-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1;
}

.metric-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Cores específicas dos KPI cards */
.metric-card.total { --card-accent: var(--arantes-purple); }
.metric-card.novos { --card-accent: var(--arantes-cyan); }
.metric-card.configurando { --card-accent: var(--arantes-gold); }
.metric-card.concluidos { --card-accent: 142 71% 45%; }
.metric-card.segmentos { --card-accent: 280 84% 60%; }

/* ── 6. BARRA DE FILTROS E BUSCA EM TEMPO REAL ── */
.filters-bar {
  background-color: hsl(var(--card) / 0.7);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(8px);
}

.filters-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.search-box-wrap {
  position: relative;
  min-width: 260px;
  max-width: 360px;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding-left: 2.25rem;
  padding-right: 2rem;
  height: 2.375rem;
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
  background-color: hsl(var(--secondary));
}

.search-clear-btn {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  display: none;
  padding: 2px;
}

.search-clear-btn.active {
  display: block;
}

.filter-select {
  height: 2.375rem;
  padding: 0 2rem 0 0.75rem;
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 14px;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.filter-select option {
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
}

.filters-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-count-badge {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* ── 7. TABELA DE LEADS RICA E RESPONSIVA ── */
.table-card {
  background-color: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
}

.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.leads-table thead {
  background-color: hsl(var(--secondary) / 0.7);
  border-bottom: 1px solid hsl(var(--border));
}

.leads-table th {
  padding: 0.875rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  user-select: none;
}

.leads-table th.th-actions {
  text-align: right;
  padding-right: 1.25rem;
}

.leads-table tbody tr {
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  transition: background-color var(--transition-fast);
}

.leads-table tbody tr:last-child {
  border-bottom: none;
}

.leads-table tbody tr:hover {
  background-color: hsl(var(--secondary) / 0.35);
}

.leads-table td {
  padding: 1rem;
  vertical-align: middle;
}

/* Célula: Cliente / Lead */
.client-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 220px;
}

.client-avatar-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  color: hsl(var(--arantes-purple-light));
  flex-shrink: 0;
}

.client-avatar-wrap.empresa {
  color: hsl(var(--arantes-cyan));
  background-color: hsl(var(--arantes-cyan) / 0.1);
  border-color: hsl(var(--arantes-cyan) / 0.25);
}

.client-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow: hidden;
}

.client-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-sub {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}

/* Célula: Tipo & Segmento */
.entity-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3125rem;
  min-width: 130px;
}

/* Célula: Contato */
.contact-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  min-width: 170px;
}

.contact-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: #fff;
}

.contact-link.whatsapp {
  color: #10b981;
  font-weight: 500;
}

.contact-link.whatsapp:hover {
  color: #34d399;
  text-decoration: underline;
}

/* Célula: Domínio */
.domain-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  min-width: 160px;
}

.domain-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #e4e4e7;
}

/* Célula: Status */
.status-cell {
  min-width: 130px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.3125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.status-badge:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
}

.status-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Estilos dos status */
.status-novo {
  background-color: hsl(var(--arantes-cyan) / 0.12);
  color: hsl(var(--arantes-cyan));
  border-color: hsl(var(--arantes-cyan) / 0.25);
}
.status-novo .status-badge-dot { background-color: hsl(var(--arantes-cyan)); box-shadow: 0 0 6px hsl(var(--arantes-cyan)); }

.status-configurando {
  background-color: hsl(var(--arantes-gold) / 0.12);
  color: hsl(var(--arantes-gold));
  border-color: hsl(var(--arantes-gold) / 0.25);
}
.status-configurando .status-badge-dot { background-color: hsl(var(--arantes-gold)); box-shadow: 0 0 6px hsl(var(--arantes-gold)); }

.status-concluido {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}
.status-concluido .status-badge-dot { background-color: #10b981; box-shadow: 0 0 6px #10b981; }

.status-em_analise {
  background-color: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}
.status-em_analise .status-badge-dot { background-color: #a855f7; }

.status-proposta {
  background-color: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.25);
}
.status-proposta .status-badge-dot { background-color: #f97316; }

.status-aprovado {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}
.status-aprovado .status-badge-dot { background-color: #3b82f6; }

/* Célula: Ações Rápidas */
.actions-cell {
  text-align: right;
  white-space: nowrap;
  padding-right: 1.25rem !important;
}

.action-btns-group {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.action-btn:hover {
  color: #fff;
  border-color: hsl(var(--border) / 0.9);
  background-color: hsl(var(--secondary));
  transform: translateY(-1px);
}

.action-btn.btn-gen-link:hover {
  color: hsl(var(--arantes-purple-light));
  border-color: hsl(var(--arantes-purple) / 0.5);
  background-color: hsl(var(--arantes-purple) / 0.15);
}

.action-btn.btn-view-detail:hover {
  color: hsl(var(--arantes-cyan));
  border-color: hsl(var(--arantes-cyan) / 0.5);
  background-color: hsl(var(--arantes-cyan) / 0.15);
}

.action-btn.btn-open-cfg:hover {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.5);
  background-color: rgba(16, 185, 129, 0.15);
}

.action-btn.btn-export-json:hover {
  color: hsl(var(--arantes-gold));
  border-color: hsl(var(--arantes-gold) / 0.5);
  background-color: hsl(var(--arantes-gold) / 0.15);
}

.action-btn.btn-status-edit:hover {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.5);
  background-color: rgba(251, 146, 60, 0.15);
}

.action-btn.btn-lgpd-del:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
  background-color: rgba(239, 68, 68, 0.15);
}

/* Estado vazio da tabela */
.table-empty-state {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.empty-state-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: hsl(var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: hsl(var(--muted-foreground));
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  max-width: 420px;
  margin: 0;
}

/* ── 8. BARRA DE PAGINAÇÃO ── */
.table-pagination-footer {
  padding: 0.875rem 1.25rem;
  background-color: hsl(var(--secondary) / 0.3);
  border-top: 1px solid hsl(var(--border) / 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── 9. MODAIS & OVERLAYS DEDICADOS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-box.modal-lg { max-width: 840px; }
.modal-box.modal-xl { max-width: 1020px; }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-subtitle {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: hsl(var(--secondary));
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--secondary) / 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── 10. MODAL: LINK DO CONFIGURADOR GERADO (WHATSAPP) ── */
.link-highlight-box {
  background-color: hsl(var(--secondary) / 0.6);
  border: 1px solid hsl(var(--primary) / 0.4);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.link-input-group {
  display: flex;
  gap: 0.5rem;
}

.link-input {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: hsl(var(--arantes-purple-light));
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0 0.875rem;
  height: 2.5rem;
  flex: 1;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-box-wrap {
  border: 1px solid #10b981;
  background-color: rgba(16, 185, 129, 0.05);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.whatsapp-preview-text {
  background-color: #0d1f15;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e4e4e7;
  white-space: pre-wrap;
  user-select: text;
}

/* ── 11. MODAL: DETALHES COMPLETOS DO LEAD (TABS & TIMELINE) ── */
.lead-detail-tabs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 1.5rem;
  background-color: hsl(var(--secondary) / 0.3);
}

.lead-tab-btn {
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.lead-tab-btn:hover {
  color: #fff;
}

.lead-tab-btn.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--primary));
  font-weight: 600;
}

.lead-tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.lead-tab-pane.active {
  display: flex;
}

/* Timeline de Histórico */
.timeline-wrap {
  position: relative;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-wrap::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  background-color: hsl(var(--border));
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.timeline-item-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: hsl(var(--card));
  border: 2px solid hsl(var(--primary));
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.timeline-author {
  font-weight: 600;
  color: #fff;
}

.timeline-date {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.timeline-body {
  font-size: 0.875rem;
  color: hsl(var(--foreground) / 0.9);
  background-color: hsl(var(--secondary) / 0.4);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border) / 0.6);
}

/* ── 12. MODAL EXPORTAR JSONS (CARDS DE EXPORTAÇÃO) ── */
.export-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.export-card {
  background-color: hsl(var(--secondary) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.875rem;
  transition: all var(--transition-fast);
}

.export-card:hover {
  border-color: hsl(var(--primary) / 0.5);
  background-color: hsl(var(--secondary) / 0.7);
}

.export-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-card-desc {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
  margin: 0;
}

.json-preview-container {
  background-color: #050507;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 220px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a1a1aa;
}

/* ── 13. TELA DE LOGIN OVERLAY ── */
.admin-login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: hsl(var(--background));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity var(--transition-normal);
}

.admin-login-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background-color: hsl(var(--card) / 0.85);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 50px -20px hsl(var(--arantes-purple) / 0.2);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.login-logo {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.5));
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}

.login-subtitle {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

/* ── 14. SISTEMA DE TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 400px;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.1);
}
.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background-color: rgba(239, 68, 68, 0.1);
}
.toast.toast-info {
  border-color: hsl(var(--primary) / 0.4);
  background-color: hsl(var(--primary) / 0.1);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ── 15. RESPONSIVIDADE (MEDIA QUERIES) ── */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-topbar {
    padding: 0 1rem;
    height: 3.5rem;
  }
  .topbar-brand-name {
    display: none;
  }
  .admin-main-container {
    padding: 1.25rem 1rem 3rem 1rem;
    gap: 1.25rem;
  }
  .dash-title {
    font-size: 1.375rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-left {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box-wrap {
    max-width: none;
  }
  .export-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .dash-header-actions {
    width: 100%;
    justify-content: stretch;
  }
  .dash-header-actions .btn {
    flex: 1;
  }
}
