/* ==============================================================================
   NAILTAP CRM® | B2B PIPELINE & SALON MANAGEMENT STYLES
   Cyber-Glam Enterprise Theme, Kanban Board, Map & Totem Simulator
   ============================================================================== */

.crm-body {
  background-color: var(--bg-obsidian);
  color: var(--text-light);
  font-family: var(--font-body);
  min-height: 100vh;
  padding-bottom: 4rem;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   1. TOP NAVBAR & INVENTORY WIDGET
   -------------------------------------------------------------------------- */
.crm-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 14, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.crm-nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

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

.crm-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.crm-badge-pill {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--electric-cyan), #0077FF);
  color: #FFFFFF;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

.crm-subtitle-tag {
  font-size: 0.78rem;
  color: var(--text-dim);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 0.75rem;
  display: none;
}

@media (min-width: 900px) {
  .crm-subtitle-tag {
    display: inline-block;
  }
}

/* Widget de Inventario Central */
.central-inventory-widget {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  padding: 0.35rem 0.85rem;
}

.inv-widget-icon {
  font-size: 1.25rem;
}

.inv-widget-info {
  display: flex;
  flex-direction: column;
}

.inv-widget-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.inv-widget-values {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.inv-stock-num {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.05rem;
  font-weight: 800;
}

.inv-stock-total {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.crm-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.crm-switch-btn {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.crm-switch-btn:hover {
  color: #FFFFFF;
  border-color: var(--electric-cyan);
  background: var(--electric-cyan-soft);
}

/* --------------------------------------------------------------------------
   2. CONTENEDOR PRINCIPAL & KPIS
   -------------------------------------------------------------------------- */
.crm-main-container {
  max-width: 1600px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

.crm-kpis-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: linear-gradient(180deg, #15151D 0%, #101015 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  transition: var(--transition-fast);
}

.kpi-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

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

.kpi-title {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.kpi-icon {
  font-size: 1.1rem;
}

.kpi-value {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.75rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Pestañas de Vista */
.crm-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.crm-tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.crm-tab-btn.active {
  color: #FFFFFF;
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.crm-view-section {
  display: none;
}

.crm-view-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* --------------------------------------------------------------------------
   3. PIPELINE KANBAN (5 ETAPAS)
   -------------------------------------------------------------------------- */
.kanban-pipeline-wrapper {
  display: grid;
  grid-template-columns: repeat(5, minmax(280px, 1fr));
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.kanban-column {
  background: rgba(18, 18, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 580px;
  backdrop-filter: blur(10px);
}

.column-header {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.stage-1-header { border-top: 3px solid #00E5FF; }
.stage-2-header { border-top: 3px solid #8A2BE2; }
.stage-3-header { border-top: 3px solid #FFB800; }
.stage-4-header { border-top: 3px solid #FF5722; }
.stage-5-header { border-top: 3px solid #FF007A; }

.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-num-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.col-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFFFFF;
}

.col-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.col-desc {
  padding: 0.5rem 1rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.3;
}

.cards-dropzone {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 150px;
}

/* Tarjetas Individuales de Lead */
.lead-kanban-card {
  background: #15151D;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: var(--transition-fast);
  position: relative;
}

.lead-kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.card-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lead-zone-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--electric-cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.lead-time {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.lead-salon-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.lead-owner-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

.lead-social-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.lead-ig-link {
  color: var(--cyber-pink);
  text-decoration: none;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-phone {
  color: var(--text-dim);
}

.lead-package-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.pkg-name {
  color: var(--text-dim);
}

.pkg-price {
  font-weight: 700;
  color: #FFB800;
}

/* Indicadores de automatización dentro de la tarjeta */
.auto-status-indicator {
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #00E5FF;
  background: rgba(0, 229, 255, 0.06);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.auto-status-won {
  color: #FF007A;
  background: rgba(255, 0, 122, 0.1);
  border: 1px solid rgba(255, 0, 122, 0.3);
  font-weight: 600;
}

/* Acciones en la tarjeta Kanban */
.card-actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-card-action {
  width: 100%;
  padding: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-whatsapp-speech {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25D366;
}

.btn-whatsapp-speech:hover {
  background: #25D366;
  color: #FFFFFF;
}

.btn-next-stage {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--border-cyan);
  color: var(--electric-cyan);
}

.btn-next-stage:hover {
  background: var(--electric-cyan);
  color: #0B0B0C;
}

.btn-close-deal {
  background: linear-gradient(135deg, var(--cyber-pink), #FF2A8D);
  border: none;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.4);
}

.btn-close-deal:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(255, 0, 122, 0.7);
}

/* --------------------------------------------------------------------------
   4. VISTA DE MAPA INTERACTIVO (GUADALAJARA / ZMG)
   -------------------------------------------------------------------------- */
.map-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.map-zone-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.crm-select {
  background: #171720;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
}

.map-interactive-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 992px) {
  .map-interactive-wrapper {
    grid-template-columns: 1fr 340px;
  }
}

.gdl-map-canvas {
  background: #0B0B0E;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  min-height: 520px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

.gdl-svg-map {
  width: 100%;
  height: 100%;
  display: block;
}

/* Marcadores Neón en SVG */
.salon-marker-pin {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.salon-marker-pin:hover {
  transform: scale(1.35);
}

.pin-pulse {
  animation: pulseNeon 2s infinite;
}

/* Popup de Salón en Mapa */
.map-popup-card {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  max-width: 320px;
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid var(--electric-cyan);
  box-shadow: 0 12px 35px rgba(0, 229, 255, 0.35);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 1.15rem;
  z-index: 20;
  display: none;
  animation: fadeIn 0.25s ease;
}

.map-popup-card.show {
  display: block;
}

.map-popup-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
}

.map-popup-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--electric-cyan);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.map-popup-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.25rem;
}

.map-popup-address {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
}

.map-popup-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.85rem;
}

.popup-stat-item {
  text-align: center;
}

.popup-stat-num {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.2rem;
  font-weight: 800;
  display: block;
}

.popup-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.map-popup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.authorized-seal {
  font-size: 0.68rem;
  font-weight: 700;
  color: #25D366;
}

/* Barra Lateral del Mapa */
.map-sidebar-list {
  background: #121218;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-status-tag {
  font-size: 0.7rem;
  color: #25D366;
  background: rgba(37, 211, 102, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.sidebar-salons-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 440px;
}

.sidebar-salon-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-salon-item:hover {
  background: rgba(0, 229, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.3);
}

.sidebar-salon-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
}

.sidebar-salon-zone {
  font-size: 0.75rem;
  color: var(--electric-cyan);
  margin-bottom: 0.35rem;
}

.sidebar-salon-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   5. TÓTEM VALIDADOR DE SALÓN (PUNTO DE VENTA)
   -------------------------------------------------------------------------- */
.totem-portal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .totem-portal-grid {
    grid-template-columns: 460px 1fr;
  }
}

.totem-device-mockup {
  display: flex;
  justify-content: center;
}

.totem-acrylic-body {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(30, 30, 42, 0.95) 0%, rgba(15, 15, 22, 0.98) 100%);
  border: 2px solid rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.25), 0 25px 60px rgba(0,0,0,0.8);
  border-radius: 28px;
  padding: 1.5rem;
  position: relative;
}

.totem-top-notch {
  text-align: center;
  margin-bottom: 1.25rem;
}

.totem-led-strip {
  width: 60px;
  height: 4px;
  background: var(--cyber-pink);
  box-shadow: 0 0 15px var(--cyber-pink);
  border-radius: 999px;
  margin: 0 auto 0.5rem;
}

.totem-brand-text {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.totem-screen-area {
  background: #0D0D13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.7);
}

.totem-screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.totem-salon-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
}

.totem-salon-icon {
  font-size: 1.5rem;
}

.totem-salon-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.totem-salon-zone {
  font-size: 0.72rem;
  color: var(--electric-cyan);
}

.totem-validator-box {
  margin-bottom: 1.25rem;
}

.totem-input-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

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

.totem-input {
  flex: 1;
  background: #171722;
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #FFFFFF;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  outline: none;
  text-transform: uppercase;
}

.totem-input:focus {
  border-color: var(--cyber-pink);
  box-shadow: 0 0 15px rgba(255, 0, 122, 0.3);
}

.totem-input-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* Tarjeta de Resultado de Validación */
.totem-result-card {
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  display: none;
  animation: fadeIn 0.3s ease;
}

.totem-result-card.show {
  display: block;
}

.result-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25D366;
  color: #000;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.25rem;
}

.result-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.result-footer-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.totem-base-stand {
  text-align: center;
  padding-top: 1.25rem;
}

.totem-nfc-symbol {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--electric-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* Panel Lateral del Tótem */
.totem-management-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.totem-salon-selector-card, .totem-redemptions-card {
  background: #121218;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem;
}

.totem-credentials-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.85rem;
  border-radius: 10px;
}

.cred-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cred-label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.cred-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--electric-cyan);
}

.cred-pin {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--cyber-pink);
}

.redemptions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.badge-live-count {
  font-size: 0.7rem;
  color: var(--electric-cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.redemptions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
}

.redemption-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
}

.red-client {
  font-weight: 600;
  color: #FFFFFF;
}

.red-reward {
  color: var(--cyber-pink);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. VISTA DE LOGS / AUDITORÍA EN VIVO
   -------------------------------------------------------------------------- */
.logs-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logs-table-card {
  background: #111116;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow-x: auto;
}

.logs-table-header {
  display: grid;
  grid-template-columns: 240px 1fr 240px 160px;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logs-table-body {
  display: flex;
  flex-direction: column;
}

.log-row {
  display: grid;
  grid-template-columns: 240px 1fr 240px 160px;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  align-items: center;
}

.log-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.log-badge-event {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-event-blue { background: rgba(0, 229, 255, 0.15); color: #00E5FF; }
.badge-event-pink { background: rgba(255, 0, 122, 0.15); color: #FF007A; }
.badge-event-green { background: rgba(37, 211, 102, 0.15); color: #25D366; }
.badge-event-gold { background: rgba(255, 184, 0, 0.15); color: #FFB800; }

.log-desc {
  color: var(--text-light);
  padding-right: 1rem;
}

.log-payload-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-time {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   7. MODALES CRM (SPEECH WHATSAPP & CIERRE GANADO)
   -------------------------------------------------------------------------- */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.crm-modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.crm-modal-dialog {
  background: linear-gradient(180deg, #171722 0%, #101015 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  position: relative;
}

.crm-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speech-modal-header {
  margin-bottom: 1.25rem;
}

.speech-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #25D366;
  background: rgba(37, 211, 102, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.speech-modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
}

.speech-modal-target {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.speech-textarea {
  width: 100%;
  background: #0B0B0E;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.86rem;
  padding: 0.85rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  margin-bottom: 1.25rem;
}

.myths-accordion-box {
  background: rgba(255, 184, 0, 0.06);
  border: 1px solid rgba(255, 184, 0, 0.25);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.myths-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFB800;
  margin-bottom: 0.5rem;
}

.myth-item {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.speech-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Modal de Cierre Ganado (Triple Acción) */
.won-dialog {
  max-width: 600px;
  border-color: var(--cyber-pink);
  box-shadow: 0 0 50px rgba(255, 0, 122, 0.4);
}

.won-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.won-trophy-icon {
  font-size: 3rem;
  margin-bottom: 0.25rem;
}

.won-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
}

.won-subtitle {
  font-size: 0.88rem;
  color: var(--cyber-pink);
  font-weight: 600;
}

.won-intro {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  text-align: center;
}

.won-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.won-action-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.action-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyber-pink), var(--electric-cyan));
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-content h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.2rem;
}

.action-content p {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.action-highlight-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
}

/* ==============================================================================
   CRM AUTH SHIELD & MANAGEMENT TABLES (SALONES, LISTA ESPERA & CHIPS)
   ============================================================================== */

/* Escudo de Seguridad / Pantalla de Login */
.crm-auth-shield {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 8, 11, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.crm-auth-shield.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.crm-auth-card {
  max-width: 480px;
  width: 100%;
  background: rgba(17, 17, 24, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 0 70px rgba(0, 229, 255, 0.15), 0 20px 40px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 0, 122, 0.12);
  border: 1px solid rgba(255, 0, 122, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyber-pink);
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.auth-brand-logo {
  font-size: 2.2rem;
  font-weight: 800;
  display: block;
  margin-bottom: 0.4rem;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-error-alert {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: #FF6B6B;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: none;
}

.auth-error-alert.visible {
  display: block;
}

.auth-quick-fill-chip {
  background: rgba(0, 229, 255, 0.08);
  border: 1px dashed rgba(0, 229, 255, 0.3);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
  text-align: center;
}

.auth-quick-fill-chip:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--electric-cyan);
}

.auth-quick-fill-chip small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.auth-quick-fill-chip code {
  color: var(--electric-cyan);
  font-size: 0.78rem;
  font-weight: 600;
}

/* User Badge en Header */
.crm-user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
}

.crm-user-info {
  display: flex;
  flex-direction: column;
}

.crm-user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
}

.crm-user-role {
  font-size: 0.68rem;
  color: var(--electric-cyan);
}

.btn-crm-logout {
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: #FFA4A2;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-crm-logout:hover {
  background: rgba(255, 59, 48, 0.25);
  color: #FFFFFF;
}

/* Tablas y Contenedores de Datos CRM */
.crm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.crm-section-title-wrap h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 0.25rem;
}

.crm-section-title-wrap p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.crm-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
}

.crm-table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.crm-table th {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.crm-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges y Pills */
.partner-badge-vip {
  display: inline-block;
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.2), rgba(255, 0, 122, 0.2));
  border: 1px solid #FFB800;
  color: #FFB800;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.partner-badge-aliado {
  display: inline-block;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--electric-cyan);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #00FF88;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill-active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00FF88;
  box-shadow: 0 0 8px #00FF88;
}

.prio-pill-alta {
  background: rgba(255, 0, 122, 0.15);
  color: var(--cyber-pink);
  border: 1px solid rgba(255, 0, 122, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
}

.prio-pill-media {
  background: rgba(255, 184, 0, 0.15);
  color: #FFB800;
  border: 1px solid rgba(255, 184, 0, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
}

.link-google-review-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.76rem;
  transition: all 0.2s ease;
}

.link-google-review-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--electric-cyan);
  color: var(--electric-cyan);
}

.btn-table-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table-action:hover {
  background: rgba(255, 0, 122, 0.15);
  border-color: var(--cyber-pink);
  color: var(--cyber-pink);
}

