/* ==========================================================================
   VALE ENERGY - PAINEL ADMINISTRATIVO (CÓDIGO 473731)
   Padrão Apple • Alta Densidade • Gestão de Faturas, Leads & Telemetria X9
   ========================================================================== */

.admin-body {
  background-color: #F8FAFC;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Largura fluida para o painel admin: remove as bordas vazias de 370px e elimina o scroll horizontal */
.admin-body .container {
  max-width: 98% !important;
  width: 98% !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ==========================================================================
   TELA DE LOGIN DO ADMIN (PIN 473731)
   ========================================================================== */

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at center, #FFFFFF 0%, #F1F5F9 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
  transition: transform 0.2s ease;
}

.login-logo {
  height: 44px;
  margin-bottom: 24px;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.45;
}

.pin-input-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.pin-input-field {
  width: 100%;
  padding: 16px 48px 16px 20px;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  text-align: center;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  background-color: #FAFAFA;
}

.pin-input-field:focus {
  outline: none;
  border-color: var(--brand-navy);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.btn-toggle-pin {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

.btn-toggle-pin:hover {
  color: var(--brand-navy);
}

.remember-device-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  text-align: left;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  user-select: none;
  gap: 8px;
}

.checkbox-container input {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-navy);
}

.login-error-msg {
  color: #DC2626;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}

.login-footer-badges {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.card-shake {
  animation: shakeError 0.4s ease-in-out;
}

/* ==========================================================================
   LAYOUT PRINCIPAL DO DASHBOARD & CABEÇALHO FIXO
   ========================================================================== */

/* Envoltório adesivo fixo no topo com backdrop-blur e sombra executiva (Imagem 4) */
.admin-sticky-header-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  transition: all var(--transition-fast);
}

.admin-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
  position: static;
  top: auto;
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-badge-indicator {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-pulse-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-pulse-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #065F46;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.operator-badge {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background-color: #F1F5F9;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   NAVEGAÇÃO ENTRE ABAS
   ========================================================================== */

.admin-tabs-nav {
  background-color: transparent;
  border-bottom: none;
}

.admin-tabs-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--brand-navy);
  background-color: #F8FAFC;
}

.admin-tab-btn.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
  font-weight: 700;
}

.tab-badge {
  background-color: #F1F5F9;
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.tab-badge.pulse {
  background-color: #DCFCE7;
  color: #15803D;
}

.admin-main {
  flex: 1;
  padding: 28px 0 64px;
}

/* ==========================================================================
   CARDS DE MÉTRICAS EXECUTIVAS
   ========================================================================== */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card-admin {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
}

.metric-card-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   BARRA DE FILTROS & AÇÕES
   ========================================================================== */

.admin-filter-bar {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-select, .search-input {
  padding: 9px 14px;
  font-size: 0.88rem;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-xs);
  background-color: #FFFFFF;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

/* Dropdown polido de alta conversão/acabamento Apple */
.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: 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='%23475569' stroke-width='2.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 12px center;
  background-size: 14px;
  padding: 9px 36px 9px 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.filter-select:hover {
  border-color: #94A3B8;
  background-color: #F8FAFC;
}

.search-input {
  width: 260px;
}

.filter-select:focus, .search-input:focus {
  outline: none;
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   TABELA DE LEADS
   ========================================================================== */

.table-wrapper {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  box-shadow: var(--shadow-subtle);
  width: 100%;
}

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

.admin-table th {
  background-color: #F8FAFC;
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  position: sticky;
  top: 96px;
  z-index: 20;
  box-shadow: inset 0 -1px 0 var(--border-light);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background-color: #F8FAFC;
}

.lead-entity-title {
  font-weight: 700;
  color: var(--text-primary);
}

.lead-entity-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-chip.qualified {
  background-color: var(--brand-green-subtle);
  color: var(--brand-green);
}

.status-chip.disqualified {
  background-color: #FEE2E2;
  color: #B91C1C;
}

.status-chip.pending {
  background-color: var(--brand-gold-subtle);
  color: var(--brand-gold);
}

/* Polimento cirúrgico do Dropdown de Status do Lead (Imagem 3) */
.table-status-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 6px 28px 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 9999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: left;
  outline: none;
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
  line-height: 1.2;
}

.table-status-select.status-novo {
  background-color: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
  background-image: 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='%231D4ED8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select.status-qualificado {
  background-color: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
  background-image: 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='%23047857' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select.status-contatado {
  background-color: #F5F3FF;
  border-color: #DDD6FE;
  color: #6D28D9;
  background-image: 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='%236D28D9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select.status-em-analise {
  background-color: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
  background-image: 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='%23B45309' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select.status-contrato-enviado {
  background-color: #FDF4FF;
  border-color: #F0ABFC;
  color: #A21CAF;
  background-image: 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='%23A21CAF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select.status-fechado,
.table-status-select.status-ganho {
  background-color: #F0FDF4;
  border-color: #86EFAC;
  color: #15803D;
  background-image: 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='%2315803D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select.status-desqualificado,
.table-status-select.status-perdido {
  background-color: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
  background-image: 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='%23B91C1C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.table-status-select:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.table-status-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

.table-status-select option {
  background-color: #FFFFFF;
  color: #0F172A;
  font-weight: 500;
  padding: 6px;
}

.btn-action-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   ABA 2: RADAR X9 EM TEMPO REAL
   ========================================================================== */

.radar-header-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.radar-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #15803D;
  background-color: #DCFCE7;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.live-dot-blink {
  width: 8px;
  height: 8px;
  background-color: #16A34A;
  border-radius: 50%;
  animation: pulseGreen 1.4s infinite;
}

.radar-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

.radar-subheading {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.radar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radar-stream-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.radar-stream-header {
  padding: 14px 20px;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.radar-stream-list {
  max-height: 700px;
  overflow-y: auto;
}

.radar-event-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background-color 0.15s ease;
}

.radar-event-item:hover {
  background-color: #F8FAFC;
}

.event-left-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.event-time-col {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 60px;
}

.event-chip {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.event-chip.type-pageview { background-color: #E0E7FF; color: #3730A3; }
.event-chip.type-cta { background-color: #FEF3C7; color: #92400E; }
.event-chip.type-step { background-color: #E0F2FE; color: #0369A1; }
.event-chip.type-choice { background-color: #F3E8FF; color: #6B21A8; }
.event-chip.type-upload { background-color: #FFEDD5; color: #9A3412; }
.event-chip.type-qualified { background-color: #DCFCE7; color: #166534; }
.event-chip.type-rejected { background-color: #FEE2E2; color: #991B1B; }
.event-chip.type-converted { background-color: #BBF7D0; color: #14532D; font-weight: 800; }
.event-chip.type-whatsapp { background-color: #D1FAE5; color: #065F46; }
.event-chip.type-section { background-color: #EDE9FE; color: #5B21B6; }
.event-chip.type-field { background-color: #FEF9C3; color: #854D0E; }
.event-chip.type-heartbeat { background-color: #CFFAFE; color: #155E75; }
.event-chip.type-copy { background-color: #FCE7F3; color: #9D174D; }
.event-chip.type-exit-intent { background-color: #FFE4E6; color: #9F1239; }
.event-chip.type-scroll { background-color: #F1F5F9; color: #334155; }
.event-chip.type-default { background-color: #F1F5F9; color: #475569; }

.event-label-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.event-sub-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.event-right-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.event-geo-tag {
  background-color: #F1F5F9;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.radar-empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   ABA 3: FUNIL & MÉTRICAS X9
   ========================================================================== */

.funnel-container {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: start;
}

.funnel-left-col {
  max-width: 480px;
  width: 100%;
}

.funnel-right-col {
  width: 100%;
  min-width: 0;
}

.funnel-right-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: start;
}

.funnel-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.funnel-card-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

.funnel-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 2px;
}

.funnel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-omnichannel {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background-color: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
  letter-spacing: 0.03em;
}

.badge-ads {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background-color: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
  letter-spacing: 0.03em;
}

.funnel-step-item {
  margin-bottom: 16px;
}

.funnel-step-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.funnel-step-name {
  color: var(--text-primary);
}

.funnel-step-stats {
  font-family: var(--font-mono);
  color: var(--brand-navy);
}

.funnel-progress-track {
  height: 10px;
  background-color: #F1F5F9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #0EA5E9 0%, #10B981 100%);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.geo-rank-item, .device-rank-item, .traffic-source-item, .campaign-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  gap: 12px;
}

.geo-rank-item:last-child, .device-rank-item:last-child, .traffic-source-item:last-child, .campaign-item:last-child {
  border-bottom: none;
}

.traffic-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--brand-navy);
}

.traffic-channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.traffic-stats-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

.traffic-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background-color: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
  white-space: nowrap;
}

.traffic-source-pill.ig {
  background-color: #FDF2F8;
  color: #DB2777;
  border-color: #FBCFE8;
}

.traffic-source-pill.fb {
  background-color: #EFF6FF;
  color: #2563EB;
  border-color: #BFDBFE;
}

.traffic-source-pill.gads {
  background-color: #FEF3C7;
  color: #D97706;
  border-color: #FDE68A;
}

.traffic-source-pill.wpp {
  background-color: #ECFDF5;
  color: #059669;
  border-color: #A7F3D0;
}

@media (max-width: 1024px) {
  .funnel-container {
    grid-template-columns: 1fr;
  }
  .funnel-left-col {
    max-width: 100%;
  }
}

/* ==========================================================================
   ALERTA DE CAMPOS PENDENTES (VERMELHO PULSANTE)
   ========================================================================== */

@keyframes pulseRedError {
  0%, 100% {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22) !important;
    background-color: #FEF2F2 !important;
  }
  50% {
    border-color: #F87171 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.08) !important;
    background-color: #FFFFFF !important;
  }
}

.input-error {
  animation: pulseRedError 1.2s infinite ease-in-out !important;
  border-color: #DC2626 !important;
}

/* ==========================================================================
   MODAL DE DETALHES DO LEAD (PADRÃO APPLE GLASS & CONTRASTE)
   ========================================================================== */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 220ms ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-window {
  background-color: #FFFFFF;
  border-radius: 20px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28);
  border: 1px solid var(--border-light);
  transform: scale(0.95);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-window {
  transform: scale(1);
}

.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.btn-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-modal-close:hover {
  background-color: var(--border-medium);
  color: var(--text-primary);
}

.modal-body {
  padding: 28px;
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.detail-block {
  background-color: #F8FAFC;
  padding: 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.detail-block-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.detail-block-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Seção de Anotações Comerciais */
.modal-notes-section {
  padding: 0 28px 20px;
}

.modal-notes-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-navy);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  background-color: #FAFAFA;
}

.modal-notes-textarea:focus {
  outline: none;
  border-color: var(--brand-navy);
  background-color: #FFFFFF;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: #FAFAFA;
}

@media (max-width: 900px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .funnel-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }
  
  .modal-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
