/*--------------------------- BASE ---------------------------*/

html, body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    min-height: 100vh;
    font-family: Arial, sans-serif;
}

/*--------------------------- HEADER FIJO ---------------------------*/

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #4e4e4e;
    height: 58px;
    overflow: visible;
}

body {
    padding-top: 68px;
    padding-left: 310px !important;
}

/*--------------------------- SIDEBAR ---------------------------*/

aside {
    position: fixed !important;
    left: 0 !important;
    top: 58px !important;
    width: 300px !important;
    height: calc(100vh - 58px) !important;
    background-color: #000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 500 !important;
    padding: 0 !important;
}

aside::-webkit-scrollbar       { width: 8px; }
aside::-webkit-scrollbar-track { background: #1a1a1a; }
aside::-webkit-scrollbar-thumb { background: #4e4e4e; border-radius: 4px; }
aside::-webkit-scrollbar-thumb:hover { background: #666; }

/*--------------------------- CONTENIDO ---------------------------*/

.layout-container {
    min-height: calc(100vh - 58px);
    background-color: #1a1a1a;
}

.layout-container .main-content {
    background-color: #1a1a1a;
    min-height: calc(100vh - 58px);
}

/*--------------------------- OVERLAY SIDEBAR MOBILE ---------------------------*/

.sidebar-overlay {
    position: fixed;
    top: 58px;
    left: 300px;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active { opacity: 1; visibility: visible; }

/*--------------------------- BOTÓN HAMBURGUESA ---------------------------*/

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: auto;
    height: auto;
    padding: .4em .7em;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.hamburger:hover { background-color: rgba(255,255,255,0.08); }

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #d4d4d4;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/*--------------------------- RESPONSIVE ---------------------------*/

@media (max-width: 768px) {
    body { padding-left: 0 !important; padding-top: 62px; }

    aside {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    aside.open { transform: translateX(0); }

    /* Overlay oscurece toda la pantalla, sidebar queda encima por z-index */
    .sidebar-overlay { left: 0; z-index: 90; }

    .layout-container { padding: 2px !important; }

    .hamburger { display: flex; }
}

@media (max-width: 768px) {
    .hamburger { padding: 2px; gap: 5px;}
}