#wrapper {
    width: 100%;
}
#page-wrapper {
    padding: 7em 2em 2.5em;
    background-color: #F1F1F1;
    min-height: calc(100vh - 76px);
    width: 100%;
    max-width: 100%;
}

.main-page {
    width: 100%;
    max-width: 100%;
}

.row.calender.widget-shadow {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.widget {
    margin-bottom: 20px;
}
.navbar-top-links {
    margin-right: 0;
}

.navbar-top-links li {
    display: inline-block;
}

.navbar-top-links li:last-child {
    margin-right: 15px;
}

.navbar-top-links li a {
    padding: 15px;
    min-height: 50px;
}

.navbar-top-links .dropdown-menu li {
    display: block;
}

.navbar-top-links .dropdown-menu li:last-child {
    margin-right: 0;
}

.navbar-top-links .dropdown-menu li a {
    padding: 3px 20px;
    min-height: 0;
}

.navbar-top-links .dropdown-menu li a div {
    white-space: normal;
}

.navbar-top-links .dropdown-messages,
.navbar-top-links .dropdown-tasks,
.navbar-top-links .dropdown-alerts {
    width: 310px;
    min-width: 0;
}
.navbar-top-links .dropdown-messages {
    margin-left: 5px;
}
.navbar-top-links .dropdown-tasks {
    margin-left: -59px;
}

.navbar-top-links .dropdown-alerts {
    margin-left: -123px;
}

.navbar-top-links .dropdown-user {
    right: 0;
    left: auto;
}

.sidebar .sidebar-nav.navbar-collapse {
    padding-right: 0;
    padding-left: 0;
}

.sidebar .sidebar-search {
    padding: 15px;
}
.sidebar .arrow {
    float: right;
}

.sidebar .fa.arrow:before {
    content: "\f104";
}

.sidebar .active>a>.fa.arrow:before {
    content: "\f107";
}

.sidebar .nav-second-level li,
.sidebar .nav-third-level li {
    border-bottom: 0!important;
	margin-bottom: 0;
}

.sidebar .nav-second-level li a {
    padding-left: 53px;
    font-size: .9em;
}
.sidebar .nav-third-level li a {
    padding-left: 52px;
}
@media(min-width:768px){
    .navbar-top-links .dropdown-messages,
    .navbar-top-links .dropdown-tasks,
    .navbar-top-links .dropdown-alerts {
        margin-left: auto;
    }
}

/* SCROLL FORZADO PARA EL MENÚ LATERAL - IMPORTANTE */
.cbp-spmenu-vertical {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: calc(100vh - 76px) !important;
    max-height: calc(100vh - 76px) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) rgba(255,255,255,0.1);
}

/* Forzar scroll visible en webkit browsers */
.cbp-spmenu-vertical::-webkit-scrollbar {
    width: 12px !important;
    background: rgba(255,255,255,0.1);
}

.cbp-spmenu-vertical::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 6px;
}

.cbp-spmenu-vertical::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4) !important;
    border-radius: 6px;
    border: 2px solid rgba(79,82,186,1);
    transition: background 0.3s ease;
}

.cbp-spmenu-vertical::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.6) !important;
}

/* Asegurar que el contenido del menú sea scrolleable */
#cbp-spmenu-s1 {
    padding-right: 5px !important;
    box-sizing: border-box !important;
}

#side-menu {
    height: auto !important;
    overflow: visible !important;
}

/* Mejorar visibilidad de elementos del menú */
.sidebar ul li a {
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar ul li:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Scroll personalizado para el menú lateral */
.cbp-spmenu-vertical {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 76px) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* Estilo personalizado para webkit browsers (Chrome, Safari, Edge) */
.cbp-spmenu-vertical::-webkit-scrollbar {
    width: 8px;
}

.cbp-spmenu-vertical::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.cbp-spmenu-vertical::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.cbp-spmenu-vertical::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Mejorar el padding para evitar que el scroll cubra contenido */
#cbp-spmenu-s1 {
    padding-right: 8px;
}

/* Asegurar que los submenús funcionen correctamente con el scroll */
.nav-second-level {
    max-height: none !important;
}

/* Animación suave para el scroll */
.cbp-spmenu-vertical {
    scroll-behavior: smooth;
}

/* Indicador visual de scroll disponible */
.cbp-spmenu-vertical.has-scroll::after {
    content: "⋮";
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Efecto hover para los elementos del menú en scroll */
.cbp-spmenu-vertical .nav > li > a:hover {
    background-color: rgba(255,255,255,0.1);
    transition: background-color 0.3s ease;
}

/* ===== LAYOUT PRINCIPAL DEL ADMIN ===== */
.cbp-spmenu-push {
    overflow-x: hidden;
    position: relative;
    left: 0;
}

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    background: #f1f1f1;
    transition: margin-left 0.3s;
    width: calc(100% - 250px);
}

#page-wrapper {
    padding: 7em 2em 2.5em;
    background-color: #F1F1F1;
    min-height: calc(100vh - 76px);
    width: 100%;
}

.widget-shadow {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.row.calender.widget-shadow {
    margin-left: 0;
    margin-right: 0;
}

.sticky-header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    height: 76px;
    background: #fff;
    z-index: 999;
    border-bottom: 1px solid #e0e0e0;
    transition: left 0.3s;
    width: calc(100% - 250px);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #2c3e50;
    z-index: 1000;
    overflow-y: auto;
}

.cbp-spmenu {
    position: fixed !important;
    left: 0 !important;
    transform: translate3d(0, 0, 0) !important;
}

.cbp-spmenu-vertical {
    width: 250px;
    height: 100%;
    top: 0;
    z-index: 1000;
}

/* Forzar diseño desktop */
@media (min-width: 769px) {
    .main-content {
        margin-left: 250px !important;
        width: calc(100% - 250px) !important;
    }
    
    .sticky-header {
        left: 250px !important;
        width: calc(100% - 250px) !important;
    }
    
    .sidebar,
    .cbp-spmenu {
        left: 0 !important;
        transform: translate3d(0, 0, 0) !important;
    }
}

/* Responsive solo para móviles reales */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sticky-header {
        left: 0;
        width: 100%;
    }
    
    .sidebar {
        left: -250px;
    }
    
    .cbp-spmenu-push.cbp-spmenu-push-toleft {
        left: -250px;
    }
    
    .sidebar.cbp-spmenu-open {
        left: 0;
    }
}

/* ===== FOOTER ADMIN ===== */
.footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

.footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ===== BOTÓN TOGGLE MENÚ ===== */
#showLeftPush {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 10px 15px;
    display: none; /* Oculto por defecto en desktop */
}

#showLeftPush:hover {
    color: #6B8E23;
}

/* Mostrar botón solo en móviles */
@media (max-width: 768px) {
    #showLeftPush {
        display: inline-block !important;
    }
}