/* =========================================
   ESTRUCTURA PRINCIPAL Y FUENTES
   ========================================= */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    overflow-x: hidden; /* Evitar scroll horizontal por el menú */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f8; /* Fondo gris ultra suave, más moderno */
    color: #212529;
}

/* =========================================
   LAYOUT DEL DASHBOARD (SIDEBAR + CONTENIDO)
   ========================================= */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* --- BARRA LATERAL (SIDEBAR LIANASOFT) --- */
#sidebar-wrapper {
    min-height: 100vh;
    width: 270px; /* Un poco más ancho para respirar */
    margin-left: -270px;
    transition: margin 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Animación más fluida */
    background-color: #636262 !important; /* PLOMO CORPORATIVO LIANASOFT */
    color: #fff;
    position: fixed; 
    z-index: 1000;
    height: 100%;
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1); /* Sombra lateral elegante */
}

/* Encabezado del Menú (Logo) */
#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    background-color: #525151 !important; /* Plomo oscuro para resaltar la cabecera */
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#sidebar-wrapper .list-group {
    width: 100%;
    background-color: transparent !important;
}

/* Enlaces del Menú Lateral */
#sidebar-wrapper .list-group-item {
    background-color: transparent !important;
    color: #e0e0e0 !important;
    border: none !important;
    margin: 4px 16px !important;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

#sidebar-wrapper .list-group-item:hover, 
#sidebar-wrapper .list-group-item:focus,
#sidebar-wrapper .list-group-item[aria-expanded="true"] {
    background-color: rgba(255,255,255,0.1) !important; /* Brillo blanco sutil */
    color: #ffffff !important;
    transform: translateX(4px); /* Pequeño salto a la derecha */
}

/* Submenús (Items anidados) */
#sidebar-wrapper .sidebar-submenu .list-group-item {
    margin-left: 32px !important;
    padding: 8px 15px !important;
    font-size: 0.9em;
    opacity: 0.9;
}

/* Títulos de sección */
#sidebar-wrapper .sidebar-heading.text-secondary {
    color: #d1d1d1 !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-left: 31px !important;
    font-size: 0.75rem;
    margin-bottom: 2px;
    background: transparent !important;
    border: none;
}

/* --- CONTENIDO DE LA PÁGINA (DERECHA) --- */
#page-content-wrapper {
    width: 100%;
    min-height: 100vh;
    transition: margin 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================
   EFECTOS Y ANIMACIONES LIANASOFT
   ========================================= */

/* 1. Efecto Hover del Menú Superior (Navbar) */
.text-hover-lianasoft {
    transition: all 0.2s ease-in-out;
}
.text-hover-lianasoft:hover {
    background-color: #f1f3f5;
    color: #636262 !important;
    transform: translateY(-1px);
}

/* 2. Efecto Elevación para Tarjetas (Cards) */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}

/* 3. Botones más dinámicos */
.btn {
    transition: all 0.2s ease;
}
.btn:active {
    transform: scale(0.97); /* Efecto de "presionado" real */
}

/* =========================================
   COMPORTAMIENTO RESPONSIVO (Desktop vs Mobile)
   ========================================= */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
        position: sticky;
        top: 0;
    }
    
    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }

    body.sb-sidenav-toggled #sidebar-wrapper {
        margin-left: -270px;
    }
}

@media (max-width: 767px) {
    body.sb-sidenav-toggled #sidebar-wrapper {
        margin-left: 0; 
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
    }
}

/* =========================================
   UTILIDADES Y COMPONENTES
   ========================================= */

#loader-wrapper {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(4px); /* Desenfoque elegante de fondo */
    z-index: 9999;
    display: none; 
    align-items: center; 
    justify-content: center;
    flex-direction: column;
}
.spinner-border { width: 3rem; height: 3rem; color: #636262 !important; }

.select2-container--bootstrap-5 .select2-selection { border-radius: 0.375rem; }
.select2-container { z-index: 100; }

/* =========================================
   ESTILOS DE IMPRESIÓN (CTRL + P)
   ========================================= */
@media print {
    #sidebar-wrapper, 
    nav.navbar, 
    .btn, 
    footer,
    .no-print,
    .breadcrumb {
        display: none !important;
    }

    #page-content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        border: none !important;
    }

    #wrapper {
        display: block !important;
    }

    body {
        background-color: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .card-header, .bg-light, .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .card, .table {
        page-break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }
}