/* Menú lateral institucional Cultura Hong Kong */

/* Sidebar fijo y profesional */
.sb-sidebar {
    background: #1A237E;
    color: #fff;
    box-shadow: 2px 0 12px rgba(26,35,126,0.08);
    width: 260px;
    padding-bottom: 32px;
    position: fixed;
    top: 56px;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transform: translateX(-260px);
    transition: transform 0.3s;
    padding-left: 18px;
}
.sb-sidebar.open {
    transform: translateX(0);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 1039;
}
#sidebar-overlay.active {
    display: block;
}

/* El contenido se desplaza cuando el sidebar está abierto */

#mainContent {
    margin-left: 0;
    transition: margin-left 0.3s;
    background: #fff;
    min-height: 100vh;
    padding: 32px 32px 32px 32px;
    box-sizing: border-box;
    z-index: 1;
}
body.sidebar-open #mainContent {
    margin-left: 260px;
    width: calc(100% - 260px);
    max-width: 100vw;
    box-shadow: 0 0 8px rgba(44,62,80,0.05);
}
@media (max-width: 991px) {
    #mainContent {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw;
        padding: 12px 12px 20px 12px;
    }
    body.sidebar-open #mainContent {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 991px) {
    .sb-sidebar {
        top: 56px;
        left: 0;
        width: 260px;
        height: 100vh;
        position: fixed;
        transform: translateX(-260px);
        z-index: 1040;
    }
    .sb-sidebar.open {
        transform: translateX(0);
    }
    #mainContent {
        margin-left: 0 !important;
    }
    body.sidebar-open #mainContent {
        margin-left: 0 !important;
    }
    #sidebar-overlay.active {
        display: block;
    }
}
.sb-sidebar .nav-link {
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.5rem;
    border-radius: 0.35rem;
    transition: background 0.2s, color 0.2s;
}
.sb-sidebar .nav-link.active, .sb-sidebar .nav-link:hover {
    background: #FFD600;
    color: #1A237E;
    font-weight: bold;
    border-radius: 0 2rem 2rem 0;
}
.sb-sidebar .nav-link i {
    margin-right: 8px;
    color: #FFD600;
    font-size: 1.2rem;
}
.sb-navbar {
    background: #fff;
    box-shadow: 0 2px 6px rgba(44,62,80,0.05);
    border-bottom: 1px solid #e3e6f0;
}
.sb-navbar .navbar-brand {
    font-weight: bold;
    color: #1A237E;
    letter-spacing: 1px;
}
.sb-navbar .navbar-brand img {
    height: 32px;
    margin-right: 10px;
}
.sb-content {
    background: #f8f9fc;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 32px;
    padding-right: 32px;
}

.main-dashboard-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Wrapper que centra sidebar + contenido. Ancho = ancho sidebar + ancho máximo del contenido */
.sb-content {
    background: #f8f9fc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 32px;
    padding-right: 32px;
    width: 100%;
}

/* Wrapper que centra sidebar + contenido: ancho = sidebar + contenido máximo */
.dashboard-wrapper {
    display: flex;
    gap: 24px;
    width: min(1260px, 100%);
    margin: 0 auto;
    align-items: flex-start;
    padding-top: 8px;
    margin-top: 0;
}
.sb-header {
    color: #1A237E;
    font-weight: 700;
}

/* Ajustes para que el dashboard quede junto al sidebar en la parte superior */
#mainContent {
    padding-top: 8px !important;
}
.sb-header {
    margin-top: 0;
}
.dashboard-cards {
    margin-top: 0 !important;
}

@media (max-width: 991px) {
    .sb-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        box-shadow: none;
        top: 0;
        height: auto;
    }
    .sb-content {
        margin-left: 0;
        width: 100%;
        align-items: stretch;
        padding-left: 12px;
        padding-right: 12px;
    }
    .main-dashboard-content {
        max-width: 100%;
        padding: 0 8px;
    }
}

@media (min-width: 992px) {
    /* En escritorio el wrapper mantiene la composición centrada */
    .dashboard-wrapper {
        padding-top: 24px;
    }
}

@media (max-width: 991px) {
    /* En móvil apilamos: sidebar encima del contenido */
    .dashboard-wrapper {
        flex-direction: column;
        width: 100%;
        padding: 0 8px;
    }
    .sb-sidebar {
        width: 100%;
    }
}
