/* ==========================================================================
   CrediPay - Estilo Fintech Premium (CSS Global)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Paleta de Colores Claro Fintech (Blanco y Verde Esmeralda) */
  --bg-primary: #f3f4f6; /* Gris hielo muy claro */
  --bg-secondary: #ffffff; /* Blanco puro */
  --bg-card: #ffffff; /* Blanco puro */
  --bg-card-hover: #fafafa;
  --border-color: #e5e7eb; /* Gris suave */
  --border-color-focus: rgba(16, 185, 129, 0.4); /* Verde esmeralda suave */
  
  --text-primary: #1f2937; /* Gris oscuro casi negro */
  --text-secondary: #4b5563; /* Gris medio */
  --text-muted: #9ca3af; /* Gris claro */
  
  /* Colores de Acento y Marca (Verde Esmeralda #10b981) */
  --primary: #10b981;       
  --primary-hover: #059669;
  --accent: #10b981;        
  --accent-rgb: 16, 185, 129;
  --accent-hover: #059669;  
  
  /* Semáforo de Riesgo (Cartera) */
  --color-verde: #10b981;    /* Cliente Excelente */
  --color-verde-bg: rgba(16, 185, 129, 0.1);
  --color-amarillo: #f59e0b; /* Pago con Retrasos */
  --color-amarillo-bg: rgba(245, 158, 11, 0.15);
  --color-rojo: #ef4444;     /* Cartera Castigada */
  --color-rojo-bg: rgba(239, 68, 68, 0.15);

  /* Sombras y Efectos */
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.025);
  --blur-card: none;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Fuentes */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Utilidades de Tamaño (Estilo Tailwind) */
.w-12 { width: 3rem !important; }
.h-12 { height: 3rem !important; }
.w-16 { width: 4rem !important; }
.h-16 { height: 4rem !important; }
.w-20 { width: 5rem !important; }
.h-20 { height: 5rem !important; }
.w-24 { width: 6rem !important; }
.h-24 { height: 6rem !important; }
.h-auto { height: auto !important; }
.w-auto { width: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mb-4 { margin-bottom: 1rem !important; }
.d-block { display: block !important; }
.text-red-600 { color: #dc2626 !important; }
.bg-red-100 { background-color: #fee2e2 !important; }

.w-full { width: 100% !important; }
.min-h-screen { min-height: 100vh !important; }
.overflow-x-hidden { overflow-x: hidden !important; }

/* FIX iOS AUTO-ZOOM */
input, select, textarea {
  font-size: 16px !important;
}


/* Reset de Estilos */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

/* Scrollbar Personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Estructura SPA y Navegación */
header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#demo-quick-links {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  z-index: 1000 !important;
  pointer-events: auto !important;
}

#demo-quick-links button {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.brand svg {
  width: 48px;
  height: auto;
}

.brand span {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-nav-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.role-tag {
  background-color: var(--primary);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* Enrutador SPA (Vistas) */
.view-section {
  display: none;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
  display: block;
}

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

/* Tarjetas y Componentes Comunes */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: var(--transition-smooth);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: #d1d5db;
}

.title-gradient {
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

/* Botones Premium */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

/* Ancho completo para botones de formulario por defecto */
form .btn:not([style*="width: auto"]):not([style*="width:auto"]) {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
  filter: brightness(1.1);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #047857 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Formularios Fintech */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-container {
  position: relative;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--border-color-focus);
}

/* 1. MODULO DE AUTENTICACIÓN */
.auth-wrapper {
  max-width: 480px;
  margin: 2rem auto;
  text-align: center;
}

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

.auth-header svg {
  width: 80px;
  height: auto;
  margin-bottom: 1rem;
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-tab.active {
  background-color: var(--bg-primary);
  color: var(--accent);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.auth-footer {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-note {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: rgba(79, 70, 229, 0.1);
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: left;
}

/* 2. PANEL DE CONTROL SUPERVISOR */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background-color: rgba(79, 70, 229, 0.15);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.3);
}

.kpi-card:nth-child(2) .kpi-icon {
  background-color: rgba(0, 245, 212, 0.15);
  color: var(--accent);
  border-color: rgba(0, 245, 212, 0.3);
}

.kpi-card:nth-child(3) .kpi-icon {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-verde);
  border-color: rgba(16, 185, 129, 0.3);
}

.kpi-card:nth-child(4) .kpi-icon {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--color-amarillo);
  border-color: rgba(245, 158, 11, 0.3);
}

.kpi-info h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-info p {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.supervisor-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.route-form-container h3,
.route-query-container h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--accent);
  padding-left: 0.75rem;
}

/* Mapa Dinámico Simulado */
.map-canvas-container {
  height: 280px;
  background-color: #ffffff;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.map-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

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

/* Animación de pulso para agentes activos */
@keyframes pulseGlow {
  0% {
    r: 6px;
    opacity: 1;
  }
  100% {
    r: 16px;
    opacity: 0;
  }
}

.agent-node-pulse {
  animation: pulseGlow 2s infinite ease-out;
}

/* Tabla de Progreso */
.table-wrapper {
  overflow-x: auto;
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.route-table th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.route-table td {
  padding: 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.route-table tr:hover td {
  background-color: rgba(255,255,255,0.02);
}

.status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
}

.status-badge.en-ruta {
  background-color: rgba(79, 70, 229, 0.15);
  color: #818cf8;
}

.status-badge.completado {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-verde);
}

.status-badge.incidencia {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--color-rojo);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* 3. INTERFAZ AGENTE/COBRADOR (VISTA MÓVIL OPTIMIZADA) */
.mobile-simulator-layout {
  width: 100%;
  min-height: 100vh;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 768px) {
  .mobile-simulator-layout {
    max-width: 440px;
    margin: 0 auto;
    border-radius: 36px;
    border: 12px solid #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    height: 720px;
    min-height: auto;
    overflow: hidden;
  }
}


/* Barra de Estado Móvil */
.phone-status-bar {
  height: 24px;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.phone-screen-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
}

.phone-screen-content::-webkit-scrollbar {
  width: 4px;
}

.agent-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.agent-title-bar h3 {
  font-size: 1.1rem;
}

.agent-title-bar span {
  font-size: 0.75rem;
  color: var(--accent);
}

/* Buscador por Cédula */
.search-box {
  margin-bottom: 1.25rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
}

.search-input-wrapper input {
  padding-right: 3rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-primary);
  width: 100%;
  padding: 0.75rem 1rem;
  outline: none;
}

.search-input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--border-color-focus);
}

.btn-search-icon {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Semáforo e Historial de Cliente */
.client-result-container {
  margin-bottom: 1.25rem;
}

.traffic-light-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.traffic-light-header.verde {
  background-color: var(--color-verde-bg);
  color: var(--color-verde);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.traffic-light-header.amarillo {
  background-color: var(--color-amarillo-bg);
  color: var(--color-amarillo);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.traffic-light-header.rojo {
  background-color: var(--color-rojo-bg);
  color: var(--color-rojo);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.light-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

.client-detail-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}

.client-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.client-detail-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
}

.client-detail-label {
  color: var(--text-secondary);
}

.client-detail-val {
  color: var(--text-primary);
}

.collect-money-form {
  background-color: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.collect-money-form h4 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

/* Registro de Clientes */
.agent-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.agent-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.agent-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Alertas de Riesgo de Créditos Activos */
.risk-alert-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background-color: rgba(239, 68, 68, 0.08);
  color: var(--color-rojo);
}
.risk-alert-box.warning {
  border-color: rgba(245, 158, 11, 0.2);
  background-color: rgba(245, 158, 11, 0.08);
  color: var(--color-amarillo);
}

/* Celda del Cartón de Pagos */
.payment-card-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.payment-card-cell:hover:not(.pagado) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--accent);
}

.payment-card-cell.pagado {
  background-color: var(--color-verde-bg) !important;
  color: var(--color-verde) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  cursor: not-allowed;
}

.payment-card-cell.atrasado {
  background-color: var(--color-rojo-bg) !important;
  color: var(--color-rojo) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  animation: pulse-red 2s infinite;
}

.payment-card-cell.abonado {
  background-color: var(--color-amarillo-bg) !important;
  color: var(--color-amarillo) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.ledger-slot-card.partially-paid {
  background-color: var(--color-amarillo-bg) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.payment-card-cell.pendiente {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.payment-card-cell.selected {
  background-color: rgba(99, 102, 241, 0.2) !important;
  border: 2px solid var(--primary) !important;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
  z-index: 2;
}

/* Espacio Publicitario / Monetización */
.ad-banner-placeholder {
  background-color: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 12px;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}



/* Modal Simulado de SMS/WhatsApp */
.overlay-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 200;
}

.overlay-modal.active {
  display: flex;
}

.whatsapp-mockup {
  background-color: #0b141a;
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
  border: 1px solid #233138;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.whatsapp-header {
  background-color: #008069;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.whatsapp-avatar {
  width: 32px;
  height: 32px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #008069;
}

.whatsapp-chat-info h5 {
  font-size: 0.85rem;
  color: #ffffff;
}

.whatsapp-chat-info span {
  font-size: 0.65rem;
  color: #e1f5fe;
}

.whatsapp-body {
  background-color: #efeae2;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="%23e5ddd5"/><circle cx="80" cy="50" r="1.5" fill="%23e5ddd5"/></svg>');
  padding: 1rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.whatsapp-bubble {
  background-color: #ffffff;
  color: #303030;
  padding: 0.75rem;
  border-radius: 8px 8px 8px 0;
  font-size: 0.8rem;
  position: relative;
  align-self: flex-start;
  max-width: 85%;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.whatsapp-bubble.out {
  background-color: #d9fdd3;
  align-self: flex-end;
  border-radius: 8px 8px 0 8px;
}

.whatsapp-bubble a {
  color: #027eb5;
  text-decoration: underline;
  display: block;
  word-break: break-all;
  margin-top: 0.25rem;
}

.whatsapp-bubble-time {
  display: block;
  text-align: right;
  font-size: 0.6rem;
  color: rgba(0,0,0,0.4);
  margin-top: 0.25rem;
}

.whatsapp-actions {
  background-color: #f0f2f5;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid #e9edef;
}

/* 4. INTERFAZ CLIENTE FINAL (VISTA PÚBLICA) */
.customer-view-container {
  max-width: 720px;
  margin: 0 auto;
}

.customer-header-card {
  text-align: center;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(79, 70, 229, 0.1) 100%);
}

.customer-debt-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

@media (min-width: 600px) {
  .customer-debt-summary {
    grid-template-columns: repeat(4, 1fr);
  }
}

.debt-item {
  padding: 1rem;
  background-color: rgba(255,255,255,0.02);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.debt-item h5 {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.debt-item p {
  font-size: 1.25rem;
  font-weight: 700;
}

.debt-item.outstanding p {
  color: var(--accent);
}

/* Cartón Digital de Estado de Cuenta */
.digital-ledger-container {
  margin-bottom: 2.5rem;
}

.digital-ledger-container h3 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.digital-ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.ledger-slot-card {
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  transition: var(--transition-smooth);
}

.ledger-slot-card.paid {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 2px solid var(--color-verde);
  border-style: solid;
}

.ledger-slot-card.abonado {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.15) 100%);
  border: 2px solid var(--color-amarillo);
  border-style: solid;
}

.ledger-slot-card.nopago {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.15) 100%);
  border: 2px solid var(--color-rojo);
  border-style: solid;
}

.slot-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  position: absolute;
  top: 8px;
  left: 8px;
}

.ledger-slot-card.paid .slot-num {
  color: var(--color-verde);
}
.ledger-slot-card.abonado .slot-num {
  color: var(--color-amarillo);
}
.ledger-slot-card.nopago .slot-num {
  color: var(--color-rojo);
}

.slot-amount {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem 0;
}

.slot-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.slot-signature {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 0.5rem;
  word-break: break-all;
}

.slot-stamp {
  position: absolute;
  right: -5px;
  bottom: -5px;
  font-size: 2.2rem;
  opacity: 0.15;
  transform: rotate(-15deg);
  color: var(--color-verde);
}
.ledger-slot-card.abonado .slot-stamp {
  color: var(--color-amarillo);
}

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

/* Directorio de Agentes */
.directory-section {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.directory-filter-wrapper {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.directory-filter-wrapper select {
  max-width: 250px;
}

.agents-directory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.agent-dir-card {
  background-color: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.agent-dir-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.agent-dir-avatar {
  width: 40px;
  height: 40px;
  background-color: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border-color);
}

.agent-dir-info h4 {
  font-size: 0.95rem;
}

.agent-dir-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.agent-contact-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-contact-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.btn-contact-call {
  background-color: rgba(79, 70, 229, 0.15);
  color: #818cf8;
  border: 1px solid rgba(79, 70, 229, 0.3);
}

.btn-contact-whatsapp {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-verde);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Responsividad general */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .supervisor-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  .user-nav-info {
    gap: 0.75rem;
  }
  .user-profile-badge span {
    display: none;
  }
  main {
    padding: 1rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .agents-directory-grid {
    grid-template-columns: 1fr;
  }
  .directory-filter-wrapper {
    flex-direction: column;
    gap: 0.75rem;
  }
  .directory-filter-wrapper select {
    max-width: 100%;
  }
}

/* Modo de simulación de enlace móvil para escritorio */
.mobile-simulator-wrapper {
  padding: 1rem 0;
}

/* ==========================================================================
   CrediPay - Estilos Adicionales Premium
   ========================================================================== */

/* Sub-pestañas del Supervisor */
.supervisor-tabs-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.supervisor-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition-smooth);
}

.supervisor-tab-btn:hover {
  color: var(--text-primary);
}

.supervisor-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.supervisor-tab-panel {
  display: none;
}

.supervisor-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Tablas adicionales del Supervisor */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-badge.verde {
  background-color: var(--color-verde-bg);
  color: var(--color-verde);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.risk-badge.amarillo {
  background-color: var(--color-amarillo-bg);
  color: var(--color-amarillo);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-badge.rojo {
  background-color: var(--color-rojo-bg);
  color: var(--color-rojo);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Modales de Recibo Digital Premium (Estilo Ticket Fintech) */
.receipt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  min-height: 100vh;
  background-color: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.receipt-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.receipt-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 90%;
  max-width: 380px;
  padding: 2rem 1.5rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.receipt-overlay.active .receipt-card {
  transform: translateY(0);
}

/* Diseño de Ticket Recortado */
.receipt-card::before, .receipt-card::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  background-size: 16px 8px;
}

.receipt-card::before {
  top: 0;
  background-image: radial-gradient(circle at 8px -4px, transparent 8px, var(--bg-primary) 8px);
}

.receipt-card::after {
  bottom: 0;
  background-image: radial-gradient(circle at 8px 12px, transparent 8px, var(--bg-primary) 8px);
}

.receipt-header {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 1rem;
}

.receipt-header h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-top: 0.5rem;
}

.receipt-header p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.receipt-badge-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 0.5rem;
  background-color: var(--color-verde-bg);
  color: var(--color-verde);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.receipt-badge-status.abonado {
  background-color: var(--color-amarillo-bg);
  color: var(--color-amarillo);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.receipt-body {
  margin-bottom: 1.5rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.receipt-row.total {
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.receipt-row .label {
  color: var(--text-secondary);
}

.receipt-row .value {
  color: var(--text-primary);
  font-weight: 600;
}

.receipt-row.total .value {
  color: var(--primary);
}

.receipt-signature-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1rem;
  word-break: break-all;
}

.receipt-stamp-mark {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 4rem;
  opacity: 0.15;
  transform: rotate(-20deg);
  pointer-events: none;
}

.receipt-footer {
  text-align: center;
}

/* Barra de Progreso del Cliente Portal */
.cust-progress-wrapper {
  margin-top: 1.25rem;
  background-color: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 12px;
}

.cust-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.cust-progress-bg {
  width: 100%;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.cust-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px;
  width: 0%;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Interactividad de Ledger Cards */
.ledger-slot-card.paid, .ledger-slot-card.abonado, .ledger-slot-card.nopago {
  cursor: pointer;
}

.ledger-slot-card.paid:hover, .ledger-slot-card.abonado:hover, .ledger-slot-card.nopago:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 245, 212, 0.15);
  border-color: var(--accent);
}

/* Modales de Supervisión y Drill-down */
.supervisor-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.supervisor-modal-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.supervisor-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.supervisor-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.supervisor-modal-close:hover {
  color: var(--text-primary);
}

.kpi-card-clickable {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.kpi-card-clickable:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 245, 212, 0.15);
}

/* Ranking de recaudo */
.ranking-bar-wrapper {
  margin-bottom: 0.75rem;
}

.ranking-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.ranking-bar-container {
  width: 100%;
  height: 12px;
  background-color: rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
}

.ranking-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 6px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Feed en vivo */
.live-feed-pulse-dot {
  animation: feedPulse 1.5s infinite;
}

@keyframes feedPulse {
  0% {
    opacity: 0.4;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

.live-feed-log {
  animation: feedLogFadeIn 0.5s ease forwards;
  border-left: 2px solid var(--accent);
  padding-left: 0.5rem;
  background-color: rgba(255,255,255,0.01);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border-radius: 0 4px 4px 0;
}

@keyframes feedLogFadeIn {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Modal de Términos y Condiciones Premium */
.terms-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  min-height: 100vh;
  background-color: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.terms-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.terms-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.terms-overlay.active .terms-card {
  transform: translateY(0);
}

.terms-scroll-body {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.terms-scroll-body::-webkit-scrollbar {
  width: 6px;
}
.terms-scroll-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.terms-scroll-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.terms-scroll-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Botones deshabilitados por control de horario y ruta cerrada */
.btn:disabled, .btn-accent:disabled, .btn-secondary:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   CrediPay - Estilos Adicionales para Detalle de Comercios
   ========================================================================== */

.commerce-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.commerce-card-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.commerce-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  background: var(--bg-card-hover);
}

.commerce-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.commerce-card-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.commerce-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.commerce-card-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}

.commerce-card-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.commerce-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.commerce-badge-pagado {
  background-color: var(--color-verde-bg);
  color: var(--color-verde);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.commerce-badge-proceso {
  background-color: var(--color-amarillo-bg);
  color: var(--color-amarillo);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.commerce-btn-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  transition: var(--transition-smooth);
}

.commerce-btn-back:hover {
  color: var(--primary);
}

.commerce-detail-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 576px) {
  .commerce-detail-box {
    grid-template-columns: 1fr;
  }
}

.commerce-detail-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.commerce-detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

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

.commerce-progress-container {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.commerce-progress-track {
  background: var(--border-color);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.commerce-progress-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.commerce-history-title {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.commerce-badge-casi-pagado {
  background-color: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Selector de Días Operativos */
label.dias-operativos-card:has(input[type="radio"]:checked) {
  border-color: var(--primary) !important;
  background-color: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 0 2px var(--border-color-focus);
}
/* Detector de orientación móvil para supervisión */
.rotate-phone-icon {
  animation: phoneRotate 2.5s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes phoneRotate {
  0%, 15% {
    transform: rotate(0deg);
  }
  45%, 65% {
    transform: rotate(-90deg);
  }
  85%, 100% {
    transform: rotate(0deg);
  }
}

/* ==========================================================================
   MENÚ HAMBURGUESA Y DRAWER LATERAL DE NAVEGACIÓN
   ========================================================================== */
.btn-hamburger {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-hamburger:hover {
  background: var(--border-color);
  border-color: var(--color-verde);
  color: var(--color-verde);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 19, 43, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  padding-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.drawer-content::-webkit-scrollbar {
  width: 6px;
}
.drawer-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.drawer-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.drawer-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.drawer-overlay.active .drawer-content {
  transform: translateX(0);
}

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

.btn-drawer-close {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  font-size: 1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-drawer-close:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #ef4444 !important;
  transform: scale(1.05) !important;
}

/* Utilidades Responsivas para Ocultar/Mostrar en Móvil vs PC */
.d-none {
  display: none !important;
}

.d-block {
  display: block;
}

.drawer-btn-logout {
  width: 100% !important;
  text-align: left !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  border-radius: 10px !important;
  padding: 0.8rem 1rem !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  margin-top: 1rem !important;
  margin-bottom: 1.5rem !important;
  cursor: pointer !important;
  align-items: center !important;
  gap: 0.65rem !important;
  transition: all 0.22s ease !important;
}

.drawer-btn-logout .drawer-logout-icon {
  flex-shrink: 0;
  stroke: #ef4444;
  transition: transform 0.22s ease, stroke 0.22s ease;
}

.drawer-btn-logout:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #f87171 !important;
}

.drawer-btn-logout:hover .drawer-logout-icon {
  stroke: #f87171;
  transform: translateX(2px);
}

/* Reglas de Visibilidad Responsiva: Ocultar en PC (>=769px) y mostrar siempre en menú lateral de Móvil (<=768px) */
@media (min-width: 769px) {
  .d-md-none,
  .drawer-btn-logout,
  #drawer-btn-logout {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .drawer-btn-logout,
  #drawer-btn-logout,
  .d-block.d-md-none {
    display: flex !important;
  }
}

.drawer-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.drawer-menu-item:hover {
  border-color: var(--color-verde);
  background: rgba(16, 185, 129, 0.08);
  color: var(--color-verde);
}

.drawer-menu-item.master-item {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
}

.drawer-menu-item.master-item:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
}

/* ESTILOS PANEL SUPERADMINISTRADOR */
#view-superadmin {
  width: 100%;
  min-height: 85vh;
  position: relative;
  z-index: 10;
}

#view-superadmin.active {
  display: block !important;
}

.superadmin-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.superadmin-card {
  background: var(--bg-card);
}

.superadmin-tab.active {
  color: var(--color-verde) !important;
  border-bottom-color: var(--color-verde) !important;
}

.sa-agent-item:hover {
  background: rgba(16, 185, 129, 0.08) !important;
}

/* ESTILOS ESPECÍFICOS Y TABLA DE USUARIOS DEL SUPERADMINISTRADOR MAESTRO */
#superadmin-fixed-overlay .superadmin-card,
#view-superadmin .superadmin-card {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 14px !important;
  padding: 1.5rem !important;
  color: #f8fafc !important;
}

.sa-users-table {
  width: 100% !important;
  min-width: 950px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 0.85rem !important;
  text-align: left !important;
  background: #0b132b !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

.sa-users-table th {
  background: #1e293b !important;
  color: #34d399 !important;
  text-transform: uppercase !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  border-bottom: 2px solid rgba(52, 211, 153, 0.3) !important;
  padding: 0.9rem 1rem !important;
}

.sa-users-table tr.sa-user-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  transition: background 0.2s ease !important;
}

.sa-users-table tr.sa-user-row:nth-child(odd) {
  background: #0f172a !important;
}

.sa-users-table tr.sa-user-row:nth-child(even) {
  background: #1e293b !important;
}

.sa-users-table tr.sa-user-row:hover {
  background: rgba(52, 211, 153, 0.12) !important;
}

.sa-users-table td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
}

.sa-user-col-username {
  width: 22% !important;
  min-width: 180px !important;
}

.sa-user-col-name {
  width: 24% !important;
  min-width: 190px !important;
}

.sa-user-col-role {
  width: 16% !important;
  min-width: 140px !important;
}

.sa-user-col-contact {
  width: 18% !important;
  min-width: 170px !important;
}

.sa-user-col-status {
  width: 8% !important;
  min-width: 80px !important;
}

.sa-user-col-actions {
  width: 12% !important;
  min-width: 190px !important;
  text-align: right !important;
}

.sa-user-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.92rem !important;
  display: block !important;
  line-height: 1.2 !important;
  letter-spacing: 0.01em !important;
}

.sa-user-doc-badge {
  font-size: 0.75rem !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
  display: inline-block !important;
  background: rgba(56, 189, 248, 0.14) !important;
  padding: 0.2rem 0.55rem !important;
  border-radius: 5px !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  margin-top: 0.25rem !important;
}

.sa-user-fullname {
  color: #f8fafc !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  display: block !important;
  line-height: 1.3 !important;
  word-break: break-word !important;
}

/* MODAL DE SOPORTE DIRECTO DE LOGIN */
#modal-login-support input:focus,
#modal-login-support select:focus,
#modal-login-support textarea:focus {
  border-color: #a855f7 !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25) !important;
}

#modal-login-support button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* TARJETA MODERNA VERDE CORPORATIVO DE SOPORTE (CONTÁCTANOS) */
#btn-top-contactus,
#btn-open-support,
#btn-contactanos,
.btn-open-support,
.btn-contactanos,
.btn-contact-card {
  background: #10B981 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  padding: 0.55rem 1.15rem !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  font-family: var(--font-sans) !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.55rem !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 9999999 !important;
  margin: 0 !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.contact-card-icon-wrapper,
.contact-card-icon,
.contact-card-text,
#btn-contactanos *,
.btn-contact-card * {
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none !important;
}

.contact-card-icon-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.contact-card-icon {
  stroke: #ffffff !important;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  transition: transform 0.25s ease !important;
}

.contact-card-text {
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  line-height: 1 !important;
}

#modal-login-support.active,
#modal-login-support.show {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 9999999 !important;
}

#btn-top-contactus:hover,
#btn-open-support:hover,
#btn-contactanos:hover,
.btn-open-support:hover,
.btn-contactanos:hover,
.btn-contact-card:hover {
  background: #059669 !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45) !important;
}

#btn-top-contactus:hover .contact-card-icon,
#btn-contactanos:hover .contact-card-icon,
.btn-contact-card:hover .contact-card-icon {
  transform: scale(1.12) rotate(-4deg) !important;
}

#btn-top-contactus:active,
#btn-open-support:active,
#btn-contactanos:active,
.btn-open-support:active,
.btn-contactanos:active,
.btn-contact-card:active {
  background: #047857 !important;
  transform: translateY(0) scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

/* Botón Circular Minimalista de Campanita en Header Top-Bar (credipay-v337) */
.btn-comunicados-nav {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
  padding: 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-comunicados-bell-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.btn-comunicados-nav:hover .btn-comunicados-bell-icon {
  transform: scale(1.12) rotate(8deg);
}

.btn-comunicados-nav:hover,
.btn-comunicados-nav:active {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(16, 185, 129, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

/* Dinámica de Alerta (Verde por defecto vs Rojo intenso cuando hay pendientes no leídos) */
.btn-comunicados-nav.has-unread {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.65) !important;
  color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.55) !important;
  animation: pulseRedAlert 2s infinite ease-in-out;
}

.btn-comunicados-nav.has-unread:hover,
.btn-comunicados-nav.has-unread:active {
  background: rgba(239, 68, 68, 0.38) !important;
  border-color: rgba(239, 68, 68, 0.85) !important;
}

@keyframes pulseRedAlert {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.comunicados-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  border-radius: 9999px;
  padding: 0.12rem 0.4rem;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #0b132b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ESTILOS DEL MODAL FLOTANTE DE ANUNCIOS Y PUBLICIDAD (credipay-v339) */
.pwa-ad-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 43, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  animation: fadeInAd 0.3s ease-out;
}

.pwa-ad-modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 1000000 !important;
}

.pwa-ad-modal-card,
.pwa-ad-modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  width: 96%;
  max-width: 480px;
  max-height: 88vh;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.9), 0 0 35px rgba(16, 185, 129, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 0 !important; /* Elimina marco interno y padding sobrante */
}

.pwa-ad-modal-overlay.active .pwa-ad-modal-card,
.pwa-ad-modal-overlay.active .pwa-ad-modal-content {
  transform: scale(1);
}

.pwa-ad-modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0) 100%);
  pointer-events: none; /* Permite interacción directa con el video debajo salvo en botones */
}

.pwa-ad-badge {
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: auto;
}

/* Botón de Cierre "X" Reposicionado con margen holgado para evitar clics accidentales en controles de video */
.pwa-ad-close-btn {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6) !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
  pointer-events: auto !important;
  margin-top: 4px;
  margin-right: 4px;
}

.pwa-ad-close-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.35) !important;
}

.pwa-ad-modal-body {
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #0f172a;
}

.pwa-ad-media-box {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 80vh;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
}

.pwa-ad-media-box img,
.pwa-ad-media-box video,
.pwa-ad-modal-image,
.pwa-ad-modal-video {
  width: 100%;
  height: 100%;
  max-height: 80vh;
  object-fit: contain; /* Ajusta la imagen o el video al 100% de alto y ancho sin recortar */
  display: block;
  border: none;
  background: transparent;
  outline: none;
}

.pwa-ad-description {
  color: #f1f5f9;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-line;
  padding: 1.25rem;
  margin: 0;
  background: rgba(15, 23, 42, 0.9);
}

.pwa-ad-modal-footer {
  display: none !important; /* Se oculta el contenedor footer estático */
}

/* Botón "Continuar" Superpuesto y Estilizado Moderno (Glassmorphism) */
.pwa-ad-btn-continue {
  position: absolute !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 40 !important;
  padding: 0.75rem 1.4rem !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92) 0%, rgba(5, 150, 105, 0.95) 100%) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  border-radius: 50px !important;
  cursor: pointer !important;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  min-height: 46px !important;
  min-width: 120px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}

.pwa-ad-btn-continue:active {
  transform: scale(0.94) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

@keyframes fadeInAd {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ESTILOS FORMULARIO DE ANUNCIOS SUPERADMIN */
.ad-form-card {
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 14px !important;
  padding: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.ad-dropzone-preview {
  margin-top: 0.5rem;
  border: 2px dashed rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  background: rgba(245, 158, 11, 0.04);
}

/* ASEGURAR QUE SWEETALERT2 SIEMPRE SE RENDERICE POR ENCIMA DEL OVERLAY SUPERADMIN */
.swal2-container {
  z-index: 9999999 !important;
}

/* Logo Unificado del Header */
.header-main-logo {
  width: 130px;
  max-width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
  display: block;
  margin: 0 !important;
  mix-blend-mode: multiply;
}

/* Bloques Flexbox del Header */
.header-left,
.header-left-group {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.header-right,
.header-right-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 20px !important;
  flex-wrap: nowrap !important;
}

/* ==========================================================================
   Ajustes Optimización Cabecera (Header) Vista Móvil & Alineación
   ========================================================================== */

/* 1. Eliminar el indicador de Vigencia en la cabecera */
#nav-user-vigencia-badge,
.badge-vigencia-header,
.vigencia-badge,
header span[id*="vigencia"] {
  display: none !important;
}

/* 2. Ajustes de Distribución y Limpieza para móviles (@media max-width: 768px) */
@media (max-width: 768px) {
  /* Distribución del Header principal */
  header .nav-container,
  .nav-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Bloque Izquierdo (header-left): Hamburguesa + Logo */
  .header-left,
  .header-left-group {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .header-left .brand,
  .header-left-group .brand,
  #brand-link {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  .header-main-logo {
    width: 120px !important;
    max-width: 130px !important;
    height: auto !important;
    max-height: 40px !important;
    object-fit: contain !important;
    margin: 0 !important;
  }

  /* Bloque Derecho (header-right): Campana + Contacto */
  .header-right,
  .header-right-actions {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ocultar texto 'Contáctanos' dejando solo el icono del sobre */
  #btn-contactanos .contact-card-text,
  .btn-contact-card .contact-card-text {
    display: none !important;
  }

  /* Minimizar botón 'Contáctanos' a botón de ícono compacto */
  #btn-contactanos,
  .btn-contactanos,
  .btn-contact-card {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
  }

  .contact-card-icon-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #btn-contactanos .contact-card-icon,
  .btn-contact-card .contact-card-icon {
    width: 18px !important;
    height: 18px !important;
  }

  /* Campana de Notificaciones */
  .btn-comunicados-nav {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .btn-comunicados-bell-icon {
    font-size: 1.05rem !important;
  }

  /* Limpieza estricta: Ocultar botón 'Cerrar Sesión' e información de usuario en móviles del header */
  .user-nav-info,
  #user-nav-info,
  header .btn-logout,
  header #btn-logout {
    display: none !important;
  }
}

/* ==========================================================================
   ESTILOS BANNER & MODAL DE INSTALACIÓN PWA (ANDROID + IOS)
   ========================================================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 440px;
  background: rgba(11, 19, 43, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 245, 212, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 245, 212, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
  animation: slideUpPwa 0.4s ease-out;
}

@keyframes slideUpPwa {
  from { transform: translate(-50%, 100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pwa-banner-text h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #00f5d4;
}

.pwa-banner-text p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #cbd5e1;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pwa-install {
  background: linear-gradient(135deg, #00f5d4, #00bbf9);
  color: #0b132b;
  border: none;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 245, 212, 0.3);
}

.btn-pwa-install:active {
  transform: scale(0.95);
}

.btn-pwa-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-pwa-close:hover {
  color: #ffffff;
}

.ios-instruction-box {
  width: 100%;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(0, 245, 212, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: #e2e8f0;
}

.ios-instruction-steps {
  margin-top: 8px;
  padding-left: 18px;
  margin-bottom: 0;
}

.ios-instruction-steps li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.ios-share-icon {
  display: inline-block;
  background: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  font-weight: bold;
}




