/*
Style-rjr.css
Archivo que contiene maquetación adicional para el sistema
Nuevo 11-08-2024
Agregada configuracion para compatibilidad con bootstrap 5
-------------------------------------------------------
License
-------------------------------------------------------
• New BSD License
-------------------------------------------------------
*/

/*
*
* ==========================================
* CUSTOM UTIL CLASSES
* ==========================================
*
*/
/* DIVISORES */
hr.dashed {
    border-top: 2px dashed #999;
}

hr.dotted {
    border-top: 2px dotted #999;
}

hr.solid {
    border-top: 2px solid #999;
    opacity: 0.5;
}

hr.hr-text {
  position: relative;
    border: none;
    height: 1px;
    background: #999;
}

hr.hr-text::before {
    content: attr(data-content);
    display: inline-block;
    background: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    color: #999;
    border-radius: 30rem;
    padding: 0.2rem 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* tabs */
.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
    background-color: #ced4da;
    border-color: gray;
}

/* tablas */
table thead {
    background-color: #ced4da;
    border-color: gray;
}

/* ESTILOS PARA dbSelect/Select2 - igual que text, number, date */
.input.input-form .select2-container .select2-selection--single {
    height: 34px !important;
    line-height: 34px !important;
    border: none !important;
    box-shadow: none !important;
}

.input.input-form .select2-container .select2-selection__rendered {
    line-height: 34px !important;
    padding-left: 8px !important;
}

.input.input-form .select2-container .select2-selection__arrow {
    height: 34px !important;
}

/* Estilo para el contenedor del select cuando está habilitado Select2 */
.input.input-form .dbselect-select2,
.input.input-form select.dbselect-select2 {
    height: 34px !important;
    min-height: 34px !important;
    line-height: 34px !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 4px 8px !important;
}

/* Quitar cualquier borde negro del Select2 */
.select2-container .select2-selection {
    border: none !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single {
    border: none !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:focus-within {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Quitar el borde negro del select original cuando Select2 está activo */
.select2-container ~ select.dbselect-select2,
.dbselect-select2.select2-hidden-accessible {
    visibility: hidden;
    position: absolute;
    border: none !important;
    outline: none !important;
}

/* Asegurar que Select2 reemplace visualmente al select */
.input.input-form:has(.select2-container) {
    position: relative;
}

.input.input-form .select2-container {
    width: 100% !important;
}

/* Ensure Select2 inside the main content doesn't overlap images or sidebar visuals */
.content { position: relative; z-index: 1; }
/* Constrain Select2 dropdowns to their input wrappers to avoid overlapping images/sidebar */
.input-form .select2-container { z-index: 999 !important; }
.input-form .select2-dropdown { z-index: 1000 !important; }

/* Select2 z-index para no superponerse a modales (Bootstrap modal: 1050+) */
.select2-container {
    z-index: 1040 !important;
}

.select2-dropdown {
    z-index: 1049 !important;
}

.agregar-full { height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; }
.agregar-full, .agregar-full .agregar-body { box-sizing: border-box; }
.agregar-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 16px; }

/* No horizontal scroll en toda la pagina de formulario de agregar */
html, body { overflow-x: hidden !important; }
.h-100, html, body, #page-container { height: 100%; }

/* Reducir espacio del encabezado Hero */
#main-container > .content {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

#main-container > .content .h4 {
    margin-bottom: 3px !important;
    line-height: 1.2 !important;
}

#main-container > .content .h6 {
    margin-bottom: 0 !important;
    line-height: 1 !important;
}
#page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: 64px; /* Desktop header height */
}

#page-footer {
  position: fixed;
  bottom: 0;
  left: 50px;
  right: 0;
  z-index: 1030;
  height: 30px; /* Footer height (adjust if your footer is taller) */
}

/* ===== ESTILOS FLEXBOX PARA MEJOR DISTRIBUCIÓN ===== */
/* Hacer que el contenedor shell-view sea flexible */
.container.shell-view {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
}

/* Asegurar que el contenido interno también sea flexible */
.container.shell-view > .row:last-child,
.container.shell-view > div:last-child {
  margin-bottom: 0px !important; /* Reducido de 60px a 20px */
  padding-bottom: 0px !important; /* Reducido de 40px a 15px */
  flex: 1 1 auto !important;
}

/* Ajuste para el contenedor de botones sin modificar clases específicas */
.container.shell-view [class*="form-actions"] {
  margin-bottom: 25px !important; /* Reducido de 70px a 25px */
  padding-bottom: 20px !important; /* Reducido de 50px a 20px */
  min-height: 50px !important; /* Reducido de 100px a 50px */
}

/* Adjust page container for fixed header/footer - REDUCIDO A 20px */
#page-container.page-header-fixed {
  padding-top: 20px !important;
  padding-bottom: 50px;
  min-height: auto;
}

/* Main content - permitir expandir para gráficos grandes */
#main-container {
  min-height: auto;
  height: auto;
  overflow: visible;
}

.content {
  min-height: auto;
  overflow: visible !important;
  padding-bottom: 20px;
}

/* Forzar overflow visible en TODOS los contenedores */
#page-container,
#main-container,
.content,
.container,
.container-overflow,
.block,
.row {
  overflow: visible !important;
  min-height: auto !important;
  max-height: none !important;
}

/* ===== SOLUCIÓN PARA CONTENEDOR SHELL-VIEW ===== */
/* Asegurar que shell-view ocupe el 100% del área disponible */
.container.shell-view {
  min-height: 0px !important; /* Altura total menos header (64px) y footer (30px) */
  padding-bottom: 0 !important; /* Reducido de 60px a 25px - espacio justo para el footer */
  margin-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: none !important;
}

/* Espacio extra de seguridad para el último contenido antes del footer */
.container.shell-view > *:last-child {
  margin-bottom: 0 !important; /* Reducido de 40px a 15px */
  padding-bottom: 0 !important; /* Reducido de 30px a 10px */
}

/* Asegurar que los botones dentro de shell-view tengan espacio suficiente */
.container.shell-view .form-actions {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  min-height: 60px !important; /* Altura mínima para asegurar visibilidad */
}

/* Ajuste específico para el footer de CoreUI */
#page-footer {
  z-index: 1030 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 50px !important;
  right: 0 !important;
  height: 30px !important;
  background-color: #f8f9fa !important;
}

/* Asegurar que el contenedor principal tenga espacio para el footer */
#main-container {
  padding-bottom: 40px !important; /* Espacio extra para el footer fijo */
  min-height: calc(100vh - 94px) !important; /* Altura total menos header y footer */
}

/* Estilos para notificaciones de acceso */
.colored-toast.swal2-popup {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.access-notification-popup {
  border: 1px solid #dee2e6 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.access-notification-title {
  color: #495057 !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
}

.access-notification-content {
  color: #6c757d !important;
  line-height: 1.6 !important;
  font-size: 0.9rem !important;
}

.access-notification-content strong {
  color: #495057 !important;
  font-weight: 500 !important;
}

/* Animaciones mejoradas para notificaciones */
.access-notification-popup {
  animation: slideInRight 0.3s ease-out !important;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive para móviles */
@media (max-width: 576px) {
  .access-notification-popup {
    width: 90vw !important;
    max-width: 350px !important;
    margin: 10px !important;
  }
  
  .access-notification-title {
    font-size: 1rem !important;
  }
  
  .access-notification-content {
    font-size: 0.85rem !important;
  }
}

/* Estilos para notificaciones de acceso */
.colored-toast.swal2-popup {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.access-notification-popup {
  border: 1px solid #dee2e6 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.access-notification-title {
  color: #495057 !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
}

.access-notification-content {
  color: #6c757d !important;
  line-height: 1.6 !important;
  font-size: 0.9rem !important;
}

.access-notification-content strong {
  color: #495057 !important;
  font-weight: 500 !important;
}

/* Animaciones mejoradas para notificaciones */
.access-notification-popup {
  animation: slideInRight 0.3s ease-out !important;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive para móviles */
@media (max-width: 576px) {
  .access-notification-popup {
    width: 90vw !important;
    max-width: 350px !important;
    margin: 10px !important;
  }
  
  .access-notification-title {
    font-size: 1rem !important;
  }
  
  .access-notification-content {
    font-size: 0.85rem !important;
  }
}

/* Mobile adjustments (header 56px, sidebar mini) */
@media (max-width: 991px) {
  #page-header {
    height: 56px;
  }
  
  #page-container.page-header-fixed {
    padding-top: 20px !important;
    padding-bottom: 50px;
  }
  
  #main-container {
    min-height: calc(100vh - 56px - 50px);
  }
}

/* ==========================================
* NOTIFICACIONES DE ACCESO A MÓDULOS
* ==========================================
*/

/* Estilos personalizados para las notificaciones de acceso */
.access-notification-popup {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    border-radius: 12px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.access-notification-title {
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    margin-bottom: 1rem !important;
}

.access-notification-content {
    color: #6c757d !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

.access-notification-content strong {
    color: #343a40 !important;
    font-weight: 600 !important;
}

/* Animaciones personalizadas para las notificaciones */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.animate__fadeInRight {
    animation: slideInRight 0.5s ease-out;
}

.animate__fadeOutRight {
    animation: slideOutRight 0.3s ease-in;
}

/* Estilos para el modo toast de SweetAlert2 */
.swal2-toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.swal2-toast .swal2-title {
    color: white !important;
    font-weight: 500 !important;
}

/* Colores de módulos específicos */
.module-sistema { border-left: 4px solid #dc3545 !important; }
.module-admin { border-left: 4px solid #007bff !important; }
.module-gerencia { border-left: 4px solid #28a745 !important; }
.module-inventario { border-left: 4px solid #ffc107 !important; }
.module-configura { border-left: 4px solid #17a2b8 !important; }
.module-reporte { border-left: 4px solid #6f42c1 !important; }
.module-dashboard { border-left: 4px solid #fd7e14 !important; }

/* Responsive para notificaciones en móviles */
@media (max-width: 576px) {
    .access-notification-popup {
        width: 90vw !important;
        max-width: 350px !important;
    }
    
    .swal2-toast {
        width: 90vw !important;
        max-width: 350px !important;
    }
}

/* Indicador visual de acceso reciente */
.recent-access-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: 9999;
    cursor: pointer;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* ===== ESTILOS FLEXBOX PARA MEJOR DISTRIBUCIÓN ===== */
/* Hacer que el contenedor shell-view sea flexible */
.container.shell-view {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
}

/* Asegurar que el contenido interno también sea flexible */
.container.shell-view > .row:last-child,
.container.shell-view > div:last-child {
  margin-bottom: 20px !important;
  padding-bottom: 10px !important;
  flex: 1 1 auto !important;
}

/* Ajuste para el contenedor de botones sin modificar clases específicas */
.container.shell-view [class*="form-actions"] {
  margin-bottom: 0px !important;
  padding-bottom: 0px !important;
  min-height: 0px !important;
}

/* ===== AJUSTES FINALES PARA EL LAYOUT COMPLETO ===== */
/* Asegurar que el page-container tenga espacio suficiente */
#page-container.page-header-fixed {
  padding-top: 20px !important;
  padding-bottom: 80px !important; /* Aumentar el espacio para el footer */
  min-height: 100vh !important; /* Asegurar altura completa */
  display: flex !important;
  flex-direction: column !important;
}

/* Hacer que el main-container también sea flexible */
#main-container {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: auto !important;
  padding-bottom: 0 !important;
}

/* Asegurar que el contenido principal ocupe el espacio disponible */
#main-container > .content:last-child {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 0 !important;
}

/* Ajuste específico para cuando shell-view es el último elemento */
.content > .container.shell-view:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 20px !important; /* Reducido de 80px a 20px - espacio justo */
}

/* Estilos para el toast coloreado de SweetAlert2 */
.colored-toast.swal2-popup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Estilos para notificaciones de acceso */
.access-notification-popup {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.access-notification-title {
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.access-notification-content {
    color: #6c757d !important;
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
}

.access-notification-content strong {
    color: #495057 !important;
    font-weight: 500 !important;
}

/* Animaciones mejoradas para notificaciones */
.access-notification-popup {
    animation: slideInRight 0.3s ease-out !important;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive para móviles */
@media (max-width: 576px) {
    .access-notification-popup {
        width: 90vw !important;
        max-width: 350px !important;
        margin: 10px !important;
    }
    
    .access-notification-title {
        font-size: 1rem !important;
    }
    
    .access-notification-content {
        font-size: 0.85rem !important;
    }
}

/* Estilos para las notificaciones de acceso */
.access-notification-popup {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.access-notification-title {
    color: #495057 !important;
    font-weight: 600 !important;
}

.access-notification-content {
    color: #6c757d !important;
    line-height: 1.6 !important;
}

.colored-toast .swal2-title {
    color: white !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

.colored-toast .swal2-icon {
    color: white !important;
}

.colored-toast .swal2-success-ring {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.colored-toast .swal2-success-line-tip,
.colored-toast .swal2-success-line-long {
    background-color: white !important;
}

/* ==========================================
* NOTIFICACIONES DE ACCESO A MÓDULOS
* ==========================================
*/

/* Estilos personalizados para las notificaciones de acceso */
.access-notification-popup {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    border-radius: 12px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.access-notification-title {
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 1.2rem !important;
    margin-bottom: 1rem !important;
}

.access-notification-content {
    color: #6c757d !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

.access-notification-content strong {
    color: #343a40 !important;
    font-weight: 600 !important;
}

/* Animaciones personalizadas para las notificaciones */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.animate__fadeInRight {
    animation: slideInRight 0.5s ease-out;
}

.animate__fadeOutRight {
    animation: slideOutRight 0.3s ease-in;
}

/* Estilos para el modo toast de SweetAlert2 */
.swal2-toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.swal2-toast .swal2-title {
    color: white !important;
    font-weight: 500 !important;
}

/* Colores de módulos específicos */
.module-sistema { border-left: 4px solid #dc3545 !important; }
.module-admin { border-left: 4px solid #007bff !important; }
.module-gerencia { border-left: 4px solid #28a745 !important; }
.module-inventario { border-left: 4px solid #ffc107 !important; }
.module-configura { border-left: 4px solid #17a2b8 !important; }
.module-reporte { border-left: 4px solid #6f42c1 !important; }
.module-dashboard { border-left: 4px solid #fd7e14 !important; }

/* Responsive para notificaciones en móviles */
@media (max-width: 576px) {
    .access-notification-popup {
        width: 90vw !important;
        max-width: 350px !important;
    }
    
    .swal2-toast {
        width: 90vw !important;
        max-width: 350px !important;
    }
}

/* Indicador visual de acceso reciente */
.recent-access-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: 9999;
    cursor: pointer;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}