/* ==========================================================================
   SISTEMA DE DISEÑO - ÁRBOL DE DECISIONES & SCRIPTING CONTACT CENTER
   Optimizado para 70 asesores: Rapidez extrema, cero distracciones, alta legibilidad
   ========================================================================== */

:root {
  /* Paleta Base */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Tipografía y Textos */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Tamaños de fuente dinámicos */
  --script-font-size: 1.25rem; /* Ajustable con A- / A / A+ */
  --script-line-height: 1.6;

  /* Acciones & Estados */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --success: #059669;
  --success-hover: #047857;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;

  --alert-obj: #ea580c;
  --alert-obj-hover: #c2410c;
  --alert-obj-light: #fff7ed;
  --alert-obj-border: #fed7aa;

  --danger: #dc2626;
  --purple: #7c3aed;
  --amber: #d97706;

  /* Sombras y Elevación */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transiciones */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y caja */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   HEADER SUPERIOR DE OPERACIÓN (Contacto Center Bar)
   ========================================================================== */
.header-bar {
  background: #ffffff;
  border-bottom: 2px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-badge {
  background: linear-gradient(135deg, var(--primary), #1e40af);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.brand-info h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

/* Barra de utilidades del asesor */
.advisor-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Cronómetro TMO */
.timer-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.timer-pill.tmo-warning {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
  animation: pulse 1.5s infinite;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(5, 150, 105, 0.5);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* Conmutador de Canal (Llamada / WhatsApp) */
.channel-switcher {
  display: flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
}

.channel-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.channel-btn:hover {
  color: var(--text-main);
}

.channel-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.channel-btn.active.channel-wa {
  color: #15803d;
}

/* Modificador de Tamaño de Texto (A- / A / A+) */
.font-scaler {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.font-btn {
  border: none;
  background: #ffffff;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.font-btn:last-child {
  border-right: none;
}

.font-btn:hover, .font-btn.active {
  background: var(--bg-card-subtle);
  color: var(--primary);
}

/* Botón Reiniciar Flujo */
.btn-reset-call {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-reset-call:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fef2f2;
}

/* ==========================================================================
   BREADCRUMB / STEPPER DE NAVEGACIÓN
   ========================================================================== */
.stepper-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: center;
}

.stepper-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 1100px;
  width: 100%;
  list-style: none;
  overflow-x: auto;
  padding-bottom: 2px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.step-item:hover:not(.disabled) {
  background: var(--bg-card-subtle);
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.step-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Estado Activo */
.step-item.active {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.step-item.active .step-badge {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.step-item.active .step-name {
  color: var(--primary);
  font-weight: 700;
}

/* Estado Completado */
.step-item.completed .step-badge {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.step-item.completed .step-name {
  color: var(--success);
}

/* Deshabilitado */
.step-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.step-divider {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL DEL FLUJO
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Animación de entrada de pantalla */
.step-screen {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Encabezado del Paso */
.step-header {
  margin-bottom: 1.25rem;
}

.step-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.step-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   TARJETAS Y BOTONES GRANDES (PASO 1: MOTIVO DE LLAMADA)
   ========================================================================== */
.motivos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.motivo-card-btn {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.motivo-card-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.motivo-card-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.motivo-card-btn .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.motivo-category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.motivo-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.motivo-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

/* ==========================================================================
   TELEPROMPTER / SCRIPT DESTACADO (GRANDE Y LEGIBLE)
   ========================================================================== */
.script-display-card {
  background: #ffffff;
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.script-display-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
}

.script-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.script-type-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.script-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

.script-type-badge.badge-call {
  background: #dbeafe;
  color: #1e40af;
}

.script-type-badge.badge-wa {
  background: #dcfce7;
  color: #15803d;
}

.teleprompter-text {
  font-size: var(--script-font-size);
  line-height: var(--script-line-height);
  color: #0f172a;
  font-weight: 500;
  background: #f8fafc;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border-left: 5px solid var(--primary);
  letter-spacing: -0.1px;
  margin-bottom: 1.5rem;
  user-select: all; /* Facilita selección */
}

.teleprompter-text strong {
  color: #1e3a8a;
  font-weight: 700;
  background: #fef08a; /* Marcador amarillo sutil */
  padding: 1px 4px;
  border-radius: 3px;
}

.script-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   BOTONES DE ACCIÓN (AVANCE Y COPIADO)
   ========================================================================== */
.btn-primary-advance {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all var(--transition-fast);
}

.btn-primary-advance:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-primary-advance:active {
  transform: translateY(0);
}

.btn-copy-script {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-copy-script:hover {
  background: var(--bg-card-subtle);
  border-color: var(--text-muted);
}

/* ==========================================================================
   PASO 2: PERFILAMIENTO (PREGUNTAS EN VIÑETAS & SELECCIÓN DE OFERTA)
   ========================================================================== */
.perfilamiento-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.questions-guide-box {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.questions-guide-box .box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.questions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.85rem;
  list-style: none;
}

.question-card-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  transition: all var(--transition-fast);
}

.question-card-item:hover {
  background: #ffffff;
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.question-bullet-num {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.question-content {
  flex: 1;
}

.question-target {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.25rem;
  letter-spacing: 0.3px;
}

.question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.question-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Sección de Selección de Oferta */
.next-phase-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.next-phase-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.next-phase-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.ofertas-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.btn-oferta-option {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.btn-oferta-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.btn-oferta-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.oferta-btn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.oferta-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.oferta-btn-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.oferta-btn-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ==========================================================================
   PASO 3: OFERTA & PREÁMBULO + SUB-MENÚ DE APLICACIONES (UPSELL)
   ========================================================================== */
.preambulos-selection-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.preambulo-card {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preambulo-card:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.preambulo-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.preambulo-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preambulo-card-text {
  font-size: var(--script-font-size);
  line-height: var(--script-line-height);
  color: var(--text-main);
  font-weight: 500;
}

/* Sub-Menú Dinámico de Aplicaciones (Paso 3 para Upsell) */
.apps-submenu-box {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-top: 1.5rem;
}

.apps-submenu-header {
  margin-bottom: 1.25rem;
}

.apps-submenu-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.apps-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.btn-app-choice {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.btn-app-choice:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-app-choice.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.app-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
}

.app-choice-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.app-choice-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   PASO 4: ARGUMENTARIO & TABLAS DE CONSUMO (UPSELL & CRUCE DE DATOS)
   ========================================================================== */
.argumentario-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tarjeta de métricas de consumo destacadas */
.consumption-hero-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.consumption-app-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.consumption-app-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.consumption-app-titles h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.consumption-app-titles p {
  color: #94a3b8;
  font-size: 0.85rem;
}

.consumption-stats-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-metric-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  text-align: right;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #cbd5e1;
  display: block;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}

/* Tabla comparativa de consumo visual */
.consumption-table-box {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
}

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

.consumption-table th {
  background: var(--bg-card-subtle);
  padding: 0.65rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

.consumption-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
}

.consumption-table tr.highlight-row {
  background: #eff6ff;
}

.consumption-table tr.highlight-row td {
  color: var(--primary);
  font-weight: 800;
}

/* ==========================================================================
   PASO 5: MÓDULO DE OBJECIONES (SIEMPRE ACCESIBLE)
   Botón flotante + Drawer lateral + Modal de respuesta inmediata
   ========================================================================== */
.floating-objections-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  background: linear-gradient(135deg, #ea580c, #dc2626);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px -3px rgba(234, 88, 12, 0.45);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.floating-objections-trigger:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 28px -3px rgba(234, 88, 12, 0.55);
}

.objection-badge-count {
  background: #ffffff;
  color: #ea580c;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Drawer / Panel Desplegable de Objeciones */
.objections-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.objections-drawer-overlay.open {
  display: block;
  opacity: 1;
}

.objections-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  z-index: 70;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.objections-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1.5px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.drawer-title-group h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-drawer {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-close-drawer:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

/* Buscador rápido y filtros de objeción */
.drawer-search-area {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--alert-obj);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.drawer-filter-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--alert-obj);
  color: var(--alert-obj);
}

.filter-chip.active {
  background: var(--alert-obj-light);
  border-color: var(--alert-obj);
  color: var(--alert-obj);
}

/* Lista de objeciones clicables */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.objection-item-btn {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.objection-item-btn:hover {
  border-color: var(--alert-obj);
  background: var(--alert-obj-light);
  transform: translateX(4px);
}

.objection-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.objection-category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--alert-obj);
}

.objection-quote-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Modal o Tarjeta de Respuesta Comercial de la Objeción */
.objection-response-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.15s ease-out;
}

.objection-response-modal.open {
  display: flex;
}

.objection-modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 2px solid var(--alert-obj-border);
}

.modal-header-alert {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-alert-title {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body-content {
  padding: 1.5rem;
}

.client-saying-box {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.client-saying-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--danger);
}

.client-saying-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #991b1b;
}

.rebuttal-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 0.35rem;
}

.rebuttal-script-text {
  font-size: var(--script-font-size);
  line-height: var(--script-line-height);
  color: var(--text-main);
  background: var(--success-light);
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   PASO 6: CIERRES & VALIDACIÓN DE TITULARIDAD (PANTALLA DE ÉXITO)
   ========================================================================== */
.success-screen-box {
  background: #ffffff;
  border: 2px solid var(--success-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.success-hero-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--border-color);
}

.trophy-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.success-banner-text h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.success-banner-text p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Grid de alternativas de cierre */
.cierres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.cierre-card {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cierre-card:hover {
  border-color: var(--success);
  box-shadow: var(--shadow-md);
}

.cierre-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cierre-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.cierre-text {
  font-size: var(--script-font-size);
  line-height: var(--script-line-height);
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 1rem;
}

.cierre-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

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

/* Checklist de validación de titularidad */
.titularidad-checklist-box {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.titularidad-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.titularidad-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.titularidad-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.titularidad-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  cursor: pointer;
}

.titularidad-item-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Botón gigante de reinicio de llamada */
.next-call-banner-btn {
  background: linear-gradient(135deg, var(--success), #047857);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  font-size: 1.35rem;
  font-weight: 800;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
  transition: all var(--transition-fast);
}

.next-call-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(5, 150, 105, 0.45);
}

/* ==========================================================================
   CANVAS DE CONFETI PARA CELEBRACIÓN DE CIERRE
   ========================================================================== */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
}

/* ==========================================================================
   TOAST / NOTIFICACIONES FLOTANTES (EJ: "COPIADO AL PORTAPAPELES")
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVIDAD Y AJUSTES MOBILE / PANTALLA ANCHA
   ========================================================================== */
@media (max-width: 768px) {
  .header-bar {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .stepper-nav {
    padding: 0.5rem;
  }
  
  .main-wrapper {
    padding: 1rem;
  }

  .step-title {
    font-size: 1.4rem;
  }

  .floating-objections-trigger {
    bottom: 16px;
    right: 16px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .objections-drawer {
    max-width: 100%;
  }
}

/* ==========================================================================
   IDENTIFICACIÓN DEL ASESOR Y PANEL DE SUPERVISIÓN
   ========================================================================== */
.advisor-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.advisor-profile-pill:hover {
  background: #e2e8f0;
  border-color: var(--primary);
}

.advisor-avatar-circle {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.advisor-calls-count {
  background: var(--success);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

.btn-supervisor-metrics {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-supervisor-metrics:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Modal de Login de Asesor */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 2px solid var(--primary-border);
}

.login-card-header {
  background: linear-gradient(135deg, var(--primary), #1e40af);
  color: #ffffff;
  padding: 1.5rem 1.75rem;
  text-align: center;
}

.login-card-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.login-card-header p {
  font-size: 0.85rem;
  color: #bfdbfe;
}

.login-form-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-group-login {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group-login label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-group-login input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group-login input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-start-shift {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #ffffff;
  border: none;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all var(--transition-fast);
  margin-top: 0.5rem;
}

.btn-start-shift:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

/* Modal de Supervisión y Métricas */
.supervisor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.supervisor-modal-overlay.open {
  display: flex;
}

.supervisor-modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.supervisor-modal-header {
  padding: 1.25rem 1.75rem;
  background: #f8fafc;
  border-bottom: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.supervisor-modal-content {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.metrics-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.metric-summary-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-align: center;
}

.metric-summary-card .m-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.metric-summary-card .m-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.table-calls-wrapper {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 260px;
}

.calls-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.calls-log-table th {
  background: #f1f5f9;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 2;
}

.calls-log-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.calls-log-table tr:hover {
  background: #f8fafc;
}

.webhook-config-box {
  background: #f8fafc;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.webhook-config-box h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.webhook-config-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.webhook-input-row {
  display: flex;
  gap: 0.5rem;
}

.webhook-input-row input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.supervisor-modal-footer {
  padding: 1rem 1.75rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

