@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/roboto-300.ttf') format('truetype');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/roboto-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/roboto-500.ttf') format('truetype');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/roboto-700.ttf') format('truetype');
}

@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/robotoslab-300.ttf') format('truetype');
}

@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/robotoslab-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/robotoslab-700.ttf') format('truetype');
}

/* CSS Reset & Basics match Bootstrap but adding custom tweaks */
body {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    height: 100dvh;
    background-color: #f8f9fa;
    color: #333;
}

.font-serif {
    font-family: 'Roboto Slab', serif !important;
}

.watermark-bg {
    background-image: linear-gradient(rgba(248, 249, 250, 0.96), rgba(248, 249, 250, 0.96)), url(https://lh3.googleusercontent.com/aida-public/AB6AXuDS48FiSVm1Dm_CrCnXD7jJf43Q-z_5G1D7qCfsAeIEUPEYPuSBj62ljLtGUCoRPUxcioxXEsdWT7Ce3_l_lWpXqNkqcMpmMF4waV4sUPX8Jq2aUDkdzvrXMPyv8702kD5NbN7sCijiO0g2X-hqmzcM45IsrmIxXf9wCIqKvGbe2XZxzJ_eExpxhFO-2zZocrga3XikNL5Akq-cuh7XcQsSQ7TUvMmSu43HC3PwW9oVY7myepwffZLjOMr_hLFYGrhxmDL_p6lTWZsU);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Sidebar Mockup Match */
.sidebar-portal {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #dee2e6;
    height: 100%;
    z-index: 1050;
    transition: all 0.3s ease;
}

.main-portal {
    overflow-y: auto !important;
    max-height: 100dvh;
    animation: fadeIn 0.4s ease-out;
    display: flex !important;
    flex-direction: column !important;
}

.link {
    font-weight: bold;
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Navigation Hover & Active States */
.sidebar-portal .nav-link {
    color: #444 !important;
    text-decoration: none !important;
}

.sidebar-portal .nav-link:hover,
#sidebar .nav-link:hover {
    background-color: rgba(0, 111, 179, 0.05) !important;
    color: #006FB3 !important;
}

.sidebar-portal .nav-link.active,
#sidebar .nav-link.active,
.sidebar-portal .nav-link.active-page,
#sidebar .nav-link.active-page {
    background-color: rgba(0, 111, 179, 0.08) !important;
    color: #006FB3 !important;
    font-weight: 700 !important;
    border-left: 4px solid #006FB3;
}

.top-level-category .nav-link {
    font-weight: 500;
}

#back-to-panel-item .nav-link {
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 0 0.5rem 0.5rem 0.5rem;
    padding: 0.75rem 1rem;
}

#back-to-panel-item .nav-link:hover {
    background-color: #e9ecef !important;
}

.submenu {
    list-style: none;
    padding: 0;
}

.category-header-active {
    background-color: transparent !important;
    color: #333 !important;
    font-weight: 700 !important;
    pointer-events: none;
    border-left: none !important;
    font-size: 1.1rem;
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
}

#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .sidebar-portal {
        position: fixed;
        left: -280px;
    }

    .sidebar-portal.show {
        left: 0;
    }
}

/* Collapsed state for desktop */
@media (min-width: 992px) {
    .sidebar-portal.collapsed {
        width: 0;
        min-width: 0;
        border-right: none;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
    }
}


/* Show logo in header only when sidebar is collapsed */
.sidebar-portal.collapsed + .main-portal .header-logo {
    display: block !important;
}

/* Ensure smooth transition for all layout changes */
.sidebar-portal {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden;
}

.main-portal {
    flex: 1;
    min-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



/* Cards & Components */
.card {
    border: 1px solid #dbe0e6;
    border-radius: 4px !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

/* Status Borders for Dashboard */
.stat-card-border-primary {
    border-top: 3px solid #006FB3 !important;
}

.stat-card-border-success {
    border-top: 3px solid #2D717C !important;
}

.stat-card-border-warning {
    border-top: 3px solid #FFA11B !important;
}

.stat-card-border-danger {
    border-top: 3px solid #FE6565 !important;
}

/* Layout Containers */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    position: relative;
    z-index: 20;
}

.header-title {
    flex: 1;
    min-width: 250px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
    }

    .toolbar {
        justify-content: flex-start;
        width: 100%;
        gap: 0.5rem;
    }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Buttons */
.btn-primary {
    background-color: #006FB3 !important;
    border-color: #006FB3 !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
}

.btn-primary:hover {
    background-color: #005a91 !important;
    border-color: #005a91 !important;
}

.btn-toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0;
    min-height: 38px;
}

.btn-toolbar svg,
.btn-toolbar i {
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
}

.btn-toolbar:hover {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #006FB3 !important;
}


.btn-icon {
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Global Uppercase Support (Removido por solicitud) */

/* Estilo general de los links (Categorías - Imagen 2) */
#sidebar .nav-link {
    border-left: 4px solid transparent;
    margin: 2px 0;
}

#sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd !important;
}

/* Estado Activo (Imagen 2) */
.active-main {
    background-color: #eef6ff !important;
    /* Azul muy suave */
    color: #0d6efd !important;
    border-left: 4px solid #0d6efd !important;
    /* El borde azul de la imagen */
    font-weight: 600 !important;
}

.active-main i,
.active-main svg {
    color: #0d6efd !important;
}

/* Separadores */
.text-muted {
    opacity: 0.8;
}

/* ─── Mobile Scroll Fix ─── */
@media (max-width: 991.98px) {
    body {
        overflow-y: auto !important;
        height: auto !important;
    }
    .main-portal {
        overflow-y: visible !important;
        max-height: none !important;
        height: auto !important;
        display: block !important;
    }
    #wrapper-layout {
        height: auto !important;
    }
}