/* ================================================================
   ECSA — styles.css | Hoja de estilos compartida
   Complementa los estilos inline de cada módulo HTML
   ================================================================ */

/* ── FUENTES Y VARIABLES ── */
:root {
  --primary: #2E9CDB;
  --primary-dark: #2480b8;
  --primary-light: #e8f4fb;
  --secondary: #FF6B00;
  --secondary-dark: #d95b00;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --white: #ffffff;
  --bg: #f0f2f5;
  --text: #333333;
  --text-light: #777777;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 60px;
}

/* ── FACTURACIÓN ELECTRÓNICA ── */
.fact-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #d4edda;
  color: #155724;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.fact-badge.pendiente {
  background: #fff3cd;
  color: #856404;
}

.fact-badge.error {
  background: #f8d7da;
  color: #721c24;
}

/* ── PANEL ITBMS ── */
.itbms-panel {
  background: #e8f4fb;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
}

.itbms-panel .itbms-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.itbms-panel .itbms-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  border-top: 1px solid var(--primary);
  padding-top: 6px;
  margin-top: 4px;
}

/* ── MÓDULO YAPPY ── */
.yappy-info {
  background: linear-gradient(135deg, #6f42c1, #9b59b6);
  color: white;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.yappy-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 8px 0;
}

/* ── BADGES DE MEMBRESÍA ── */
.badge-sin     { background: #e9ecef; color: #6c757d; }
.badge-bronce  { background: #fde0cc; color: #7a3d00; }
.badge-plata   { background: #e2e3e5; color: #383d41; }
.badge-platinium { background: linear-gradient(135deg, #8e44ad, #9b59b6); color: white; }
.badge-oro     { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; }
.badge-gold    { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; }
.badge-premium { background: linear-gradient(135deg, #27ae60, #2ecc71); color: white; }

/* ── IMPRESIÓN ── */
@media print {
  .no-print { display: none !important; }
  .sidebar { display: none !important; }
  .topbar { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* ── ACCESIBILIDAD ── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── LOADER GLOBAL ── */
.ecsa-loader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.ecsa-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ecsaSpin 0.7s linear infinite;
}

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

/* ── RESPONSIVE COMPARTIDO ── */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 260px;
  }
}

/* ── WHATSAPP FLOAT (compartido entre todas las paginas) ── */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: wa-pulse 2s infinite;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow .2s;
}
.whatsapp-float:hover {
  box-shadow: 0 6px 20px rgba(37,211,102,0.5);
}
@keyframes wa-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
  .whatsapp-float svg { width: 28px; height: 28px; }
}
