/* ==========================================================================
   ERP PAVCA — HOJA DE ESTILOS CENTRALIZADA
   Código Documental: ESTRUCTURA-7232 / MANUAL-7232
   Empresa: Puertas Automáticas de Venezuela C.A. (RIF: J-30897933-3)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES GLOBALES Y CONFIGURACIÓN BASE (BRAND PAVCA)
   -------------------------------------------------------------------------- */
:root {
  --rojo-pavca: #DC2626;
  --rojo-hover: #B91C1C;
  --negro-oscuro: #0B132B;
  --brand-navy: #0F172A;
  --brand-navy-light: #1E293B;
  --gris-claro: #F8FAFC;
  --gris-mediano: #E2E8F0;
  --gris-oscuro: #64748B;
  --gris-input-soft: #F1F5F9;
  --azul-border-input: #CBD5E1;
  --azul-accent: rgba(224, 242, 254, 0.15);
  --verde-exito: #16A34A;
  --blanco: #FFFFFF;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--gris-claro);
  color: var(--negro-oscuro);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   2. CABECERA SUPERIOR (TOP NAVBAR MODERNA Y CENTRADA)
   -------------------------------------------------------------------------- */
.top-navbar {
  background: rgba(15, 23, 42, 0.98) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 3px solid var(--rojo-pavca) !important;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center; /* Centra el contenedor interno en pantallas gigantes */
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

/* NUEVO: Contenedor interno para evitar que toque los bordes */
.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1350px; /* Límite de ancho para mantener todo agrupado */
  padding: 0 24px;
}

/* LOGO SD INTERACTIVO */
.navbar-logo-btn {
  height: 48px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}
.navbar-logo-btn:hover {
  transform: translateY(-2px) scale(1.05);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

/* CÁPSULA FLOTANTE DE MENÚ */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
  background: rgba(30, 41, 59, 0.6) !important; /* Fondo más sutil */
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.nav-link {
  color: #94A3B8; /* Texto gris claro inactivo */
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 2px solid transparent; /* Reserva espacio para el borde */
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* PESTAÑA ACTIVA CON BORDE BLANCO */
.nav-link.activo {
  background: linear-gradient(135deg, var(--rojo-hover) 0%, var(--rojo-pavca) 100%);
  color: #FFFFFF;
  border: 2px solid #FFFFFF !important; /* Borde blanco sólido */
  box-shadow: 0 6px 15px rgba(220, 38, 38, 0.4);
  transform: translateY(-2px);
}

/* Botón Máster Estilizado Especial */
.style-master-pill {
  color: #F59E0B !important;
  background: rgba(245, 158, 11, 0.1) !important;
  border: 2px solid rgba(245, 158, 11, 0.3) !important;
}
.style-master-pill:hover {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: #FBBF24 !important;
  color: #FBBF24 !important;
}

/* Contenedor Derecho del Header */
.header-right-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BOTÓN DE PERFIL DE USUARIO */
.btn-profile-pill {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2) !important; /* Borde sutil blanco translúcido */
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-profile-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF !important; /* Borde blanco brillante al pasar el ratón */
  transform: translateY(-2px);
}

.btn-profile-pill .status-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
}

.btn-hamburguesa {
  display: none;
}

/* --------------------------------------------------------------------------
   3. PANTALLA DE LOGIN (MAQUETACIÓN REFERENCIA + FONDO SLATE Y LOGO MAX)
   -------------------------------------------------------------------------- */
.modal-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--brand-navy-light) !important; /* Fondo slate neutro */
  z-index: 99999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Tarjeta contenedora de Login */
.login-card-reference {
  background: #FFFFFF;
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  border: 2px solid var(--rojo-pavca);
  padding: 38px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.login-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 6px;
}

.login-logo-img {
  max-height: 130px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.login-logo-fallback {
  width: 90px;
  height: 90px;
  background: var(--brand-navy);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 28px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--rojo-pavca);
}

.login-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-label-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-forgot-link {
  background: none;
  border: none;
  color: var(--rojo-pavca);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.login-forgot-link:hover {
  text-decoration: underline;
}

/* Inputs en fondo gris tenue suave */
.login-input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--gris-input-soft);
  border: 1px solid var(--azul-border-input);
  border-radius: 10px;
  font-size: 14px;
  color: var(--brand-navy);
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.login-input-field:focus {
  background: #FFFFFF;
  border-color: var(--rojo-pavca);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Botón Forma Cápsula (Rounded Pill) */
.login-btn-pill {
  width: 100%;
  background: var(--brand-navy);
  color: #FFFFFF;
  border: 2px solid var(--rojo-pavca);
  padding: 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.3);
  transition: all 0.25s ease-in-out;
  margin-top: 8px;
}

.login-btn-pill:hover {
  background: #991B1B !important; /* Rojo carmesí oscuro ajustado al logo */
  border-color: #7F1D1D !important;
  transform: scale(1.02);
  box-shadow: 0 14px 20px -3px rgba(153, 27, 27, 0.4);
}

.login-btn-pill:active {
  background: #7F1D1D !important; /* Rojo borgoña al presionar */
  transform: scale(0.98);
}

/* Pie de Página en 2 Líneas */
.login-footer-info {
  font-size: 11px;
  color: var(--gris-oscuro);
  text-align: center;
  margin-top: 4px;
  line-height: 1.5;
}

.login-footer-info b {
  color: var(--brand-navy);
}

/* Modales estándar de la app */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 440px;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  background: var(--negro-oscuro);
  color: #FFFFFF;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.profile-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.profile-avatar-large {
  width: 60px;
  height: 60px;
  background: #F1F5F9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border: 2px solid var(--gris-mediano);
}

.profile-role-tag {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  background: #DCFCE7;
  padding: 4px 12px;
  border-radius: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gris-oscuro);
  margin-bottom: 4px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--gris-mediano);
  font-size: 14px;
  outline: none;
  background-color: var(--blanco);
  transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--rojo-pavca);
}

.btn-primary-block {
  width: 100%;
  background: var(--rojo-pavca);
  color: #FFFFFF;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s ease;
}

.btn-primary-block:hover {
  background: var(--rojo-hover);
}

.modal-footer {
  padding: 15px 20px;
  background: var(--gris-claro);
  border-top: 1px solid var(--gris-mediano);
}

.btn-logout-block {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout-block:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* --------------------------------------------------------------------------
   4. ÁREA DE TRABAJO, CARDS Y REJILLA OPERATIVA
   -------------------------------------------------------------------------- */
.main-content {
  padding: 30px 20px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.dashboard-view h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--negro-oscuro);
}

.card-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 20px !important;
  margin-top: 20px !important;
}

.card {
  background: var(--blanco);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--gris-mediano);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

.grid-calendario-mes {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
}

.grid-calendario-mes .dia-box {
  padding: 8px 4px;
  background: #F1F5F9;
  border-radius: 8px;
  font-weight: 600;
}

.grid-calendario-mes .dia-box.ocupado {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.grid-calendario-mes .dia-box.libre {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

/* FORMATO HOJA CARTA PARA DOCUMENTOS IMPRESOS (COTIZACIONES / RECIBOS) */
.hoja-carta {
  width: 216mm;
  min-height: 279mm;
  padding: 15mm;
  background: white;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* --------------------------------------------------------------------------
   5. ADAPTACIÓN RESPONSIVE Y REGLAS MÓVILES (<950PX - MANUAL-7232)
   -------------------------------------------------------------------------- */
@media (max-width: 950px) {
  .btn-hamburguesa {
    display: block !important;
    background: transparent;
    border: none;
    color: var(--blanco);
    font-size: 26px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 75px;
    right: 15px;
    width: 240px;
    background: rgba(8, 14, 30, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    gap: 6px;
    z-index: 1001;
    animation: fadeInMenu 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-menu.abierto {
    display: flex !important;
  }

  .nav-link {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
  }

  .collapso-movil-boton {
    display: block !important;
    width: 100%;
    padding: 12px;
    background: var(--brand-navy);
    color: white;
    text-align: center;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
  }

  .main-content {
    padding: 15px 10px;
  }
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
}

.menu-overlay.activo {
  display: block !important;
}

/* --------------------------------------------------------------------------
   6. ANIMACIONES DE ENTRADA Y EFECTOS VISUALES
   -------------------------------------------------------------------------- */
@keyframes fadeInMenu {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --------------------------------------------------------------------------
   7. DASHBOARD MINIMALISTA FLOTANTE (SUAVE Y ESPACIOSO)
   -------------------------------------------------------------------------- */
.min-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-end; 
  margin-bottom: 30px; 
  border-bottom: 2px solid #F1F5F9; 
  padding-bottom: 16px; 
}

.min-title { 
  font-size: 24px; 
  font-weight: 800; 
  color: var(--brand-navy-light); 
  margin: 0; 
}

/* KPIs Integrados al Header */
.min-kpi-group { 
  display: flex; 
  gap: 30px; 
}

.min-kpi { 
  text-align: right; 
  background: var(--gris-claro); 
  padding: 8px 16px; 
  border-radius: 12px; 
  border: 1px solid var(--gris-mediano); 
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.min-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--azul-border-input);
}

.min-kpi span { 
  font-size: 11px; 
  color: var(--gris-oscuro); 
  font-weight: 700; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

.min-kpi strong { 
  display: block; 
  font-size: 24px; 
  font-weight: 900; 
  line-height: 1.1; 
  margin-top: 4px; 
}

/* Panel de Acciones Rápidas (Píldoras Flotantes) */
.min-actions { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 20px; 
  margin-bottom: 30px; 
}

.min-btn { 
  padding: 24px 10px; 
  border-radius: 20px; 
  font-weight: 800; 
  font-size: 14px; 
  color: var(--blanco);
  border: 4px solid var(--blanco); 
  box-shadow: 0 15px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); 
  cursor: pointer; 
  transition: all 0.3s ease; 
  text-align: center; 
  background-size: 200% auto;
}

.min-btn:hover { 
  transform: scale(1.03); 
  background-position: right center; 
}

.m-red { background-image: linear-gradient(to right, #EF4444 0%, #991B1B 51%, #EF4444 100%); }
.m-dark { background-image: linear-gradient(to right, #334155 0%, var(--brand-navy) 51%, #334155 100%); }
.m-blue { background-image: linear-gradient(to right, #3B82F6 0%, #1E3A8A 51%, #3B82F6 100%); }
.m-gray { background-image: linear-gradient(to right, #94A3B8 0%, #334155 51%, #94A3B8 100%); }

/* Tablas Operativas 50/50 */
.min-tables { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 30px; 
}

.min-card { 
  background: var(--blanco); 
  border-radius: 24px; 
  padding: 24px; 
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05); 
  border: 1px solid var(--gris-mediano); 
}

.table-header-flex { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-bottom: 1px solid var(--gris-input-soft); 
  padding-bottom: 12px; 
  margin-bottom: 12px; 
}

.link-small { 
  font-size: 11px; 
  font-weight: 800; 
  color: #2563EB; 
  text-decoration: none; 
  cursor: pointer; 
}

.link-small:hover {
  text-decoration: underline;
}

/* Responsividad para Minimalista Flotante */
@media (max-width: 950px) {
  .min-header { flex-direction: column; align-items: flex-start; gap: 20px; }
  .min-actions { grid-template-columns: 1fr 1fr; }
  .min-tables { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .min-actions { grid-template-columns: 1fr; }
  .min-kpi-group { width: 100%; justify-content: space-between; }
  .min-btn { padding: 18px 12px; }
}

/* --------------------------------------------------------------------------
   8. COMPONENTES: BUSCADOR INTELIGENTE Y DROPDOWNS
   -------------------------------------------------------------------------- */
.form-input-smart {
  width: 100%; padding: 10px 14px; border-radius: 6px; border: 2px solid var(--azul-border-input);
  font-size: 13px; outline: none; transition: border-color 0.2s; background: var(--blanco);
}

.form-input-smart:focus { 
  border-color: var(--rojo-pavca); 
}

/* DROPDOWN INTELIGENTE CON POSICIONAMIENTO FLOTANTE GLOBAL */
.smart-dropdown {
  position: fixed; /* Se libera del overflow del modal y de la tabla */
  max-height: 200px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 10050; /* Por encima de cualquier modal */
  list-style: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.smart-dropdown li {
  padding: 8px 12px;
  font-size: 11px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  color: #0F172A;
}

.smart-dropdown li:hover {
  background: #FEF2F2;
  color: var(--rojo-pavca, #DC2626);
  font-weight: bold;
}

.smart-dropdown.hidden {
  display: none !important;
}

/* Fila activa en edición para elevar su capa visual */
tr.row-searching {
  position: relative;
  z-index: 10001 !important;
}

/* Efecto interactivo para las filas de cuentas en Finanzas */
.tarjeta-auditable {
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: 4px; /* Un radio más pequeño porque es una fila, no la tarjeta entera */
  padding-left: 4px;
  padding-right: 4px;
  margin-left: -4px;
  margin-right: -4px;
}
.tarjeta-auditable:hover {
  background-color: #E2E8F0; /* Un gris un poco más notorio para que destaque sobre el fondo F8FAFC */
  transform: translateX(4px); /* En lugar de saltar hacia arriba, se desliza sutilmente a la derecha */
}

