/* ===================== TOAST PERSONALIZADO ===================== */
/* ===== TOAST PERSONALIZADO ===== */
#toastContainer {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
    /* permite clickear detrás */
}

.toast-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    min-width: 280px;
    max-width: 400px;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-40px);
    animation: toastSlideIn 0.45s ease forwards;
    pointer-events: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-custom.success {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.toast-custom.error {
    background: linear-gradient(135deg, #e53935, #e35d5b);
}

.toast-custom.info {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
}

.toast-custom.warning {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #222;
}

.toast-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast-close:hover {
    transform: scale(1.2);
    opacity: 1;
}

/* Animaciones */
@keyframes toastSlideIn {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-40px);
        opacity: 0;
    }
}

/* ===================== BARRA DE PROGRESO EN TOAST ===================== */
.toast-custom {
    position: relative;
    overflow: hidden;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 12px 12px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}



/* ======== MODAL GENERAL ======== */
.modal {
    display: none;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.modal-show {
    display: block;
    opacity: 1;
}

.modal .modal-content {
    background-color: #fefefe;
    margin: 60px auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

/* ======== LAYOUT GENERAL ======== */
html,
body {
    height: 100%;
    margin: 0;
}

#mainContent {
    flex-grow: 1;
    padding: 1rem;
    transition: margin-left 0.3s ease;
}

/* ======== SIDEBAR (ESCRITORIO) ======== */
#sidebar {
    width: 250px;
    transition: width 0.3s ease, left 0.3s ease;
    background-color: #f8f9fa;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Colapsado (desktop) */
#sidebar.collapsed {
    width: 80px;
}

/* Título e icono de cabecera */
.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.sidebar-header-icon {
    display: none;
    font-size: 1.4rem;
    color: #555;
}

/* Cuando colapsa, ocultar texto y mostrar ícono */
#sidebar.collapsed .sidebar-title {
    display: none;
}

#sidebar.collapsed .sidebar-header-icon {
    display: inline-block;
}

/* Botón colapsar */
#btnToggleSidebar {
    border: none;
    background: transparent;
    font-size: 1.3rem;
    cursor: pointer;
    color: #555;
    transition: transform 0.2s ease;
}

#btnToggleSidebar:hover {
    transform: scale(1.15);
}

/* ======== ICONOS Y TEXTOS ======== */
.sidebar-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-pills .nav-link:hover .sidebar-icon {
    transform: scale(1.2);
}

.sidebar-text {
    transition: opacity 0.3s ease;
}

#sidebar.collapsed .sidebar-text {
    opacity: 0;
    display: none;
}

/* ======== ENCABEZADO SIDEBAR ======== */
#sidebar .border-bottom {
    background-color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ======== NAV ======== */
.nav-pills .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    margin: 0.25rem 0.5rem;
    transition: background-color 0.3s, color 0.3s;
}

.nav-pills .nav-link:hover {
    background-color: #e9ecef;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.nav-pills .nav-link.active i {
    color: white;
}

/* ======== FOOTER DEL SIDEBAR ======== */
.dropdown.mt-auto {
    border-top: 1px solid #ddd;
    padding-top: 0.75rem;
}

/* ======== MOVIL ======== */
/* ======== MOVIL ======== */
@media (max-width: 768px) {

    /* Ocultar completamente el sidebar lateral */
    #sidebar {
        display: none !important;
        visibility: hidden;
        opacity: 0;
    }

    /* Ocultar el botón hamburguesa */
    #btnMobileSidebar {
        display: none !important;
    }

    /* Barra inferior visible */
    #mobileNav {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid #ddd;
        padding: 0.4rem 0;
        z-index: 1100;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    }

    #mobileNav a {
        color: #555;
        text-decoration: none;
        text-align: center;
        flex-grow: 1;
        transition: all 0.2s ease;
    }

    #mobileNav a.active {
        color: #0d6efd;
        transform: scale(1.1);
    }

    #mobileNav i {
        font-size: 1.5rem;
    }
}

/* ======== DESKTOP ======== */
@media (min-width: 769px) {

    /* Ocultamos la barra inferior en escritorio */
    #mobileNav {
        display: none !important;
    }

    /* Sidebar visible normalmente */
    #sidebar {
        display: flex !important;
        opacity: 1;
        visibility: visible;
    }

    /* Mostrar el botón de colapsar */
    #btnToggleSidebar {
        display: inline-block;
    }
}