:root {
    --sidebar-bg: #1a252f;
    --sidebar-hover: #34495e;
    --accent: #3498db;
    --text-white: #ffffff;
    --bg-light: #f8f9fa;
    --sidebar-width: 260px; /* Definimos un ancho fijo ideal */
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* --- BOTÓN DE CONTROL (TOGGLE) --- */
.toggle-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: var(--sidebar-bg);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    transition: left 0.3s ease, background 0.3s ease; /* Transición suave de posición */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

    .toggle-btn:hover {
        background: var(--accent);
    }

    /* Cuando el menú se abre, el botón se desplaza junto con él */
    /*.toggle-btn.shifted {
        left: calc(var(--sidebar-width) + 15px);
    }*/

/* --- MENÚ LATERAL (SIDEBAR) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

    /* Estado oculto: Se desplaza completamente a la izquierda */
    .sidebar.hidden {
        transform: translateX(-100%);
    }

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    padding: 40px;
    padding-top: 80px;
    box-sizing: border-box;
    transform: translateX(-20%);
    /* Por defecto, como el menú inicia oculto (.hidden), el contenido toma todo el ancho */
    width: 100%;
    margin-left: 0;
    /* Esta transición es la que creará el efecto visual suave (slide) */
    transition: margin-left 0.3s ease, width 0.3s ease;
}

    /* CUANDO EL MENÚ ESTÁ VISIBLE: 
   Aplicamos esta clase al contenedor principal para encogerlo y moverlo */
    /*.main-content.shifted {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }*/

/* ==========================================
   ADAPTACIÓN PARA MÓVILES (Media Queries)
   ========================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 280px; /* Un poco más ancho en móviles para facilitar el toque */
    }

    /* En móviles no queremos empujar el contenido; el menú debe flotar por encima */
    .main-content.shifted {
        margin-left: 0;
        width: 100%;
    }

    .toggle-btn.shifted {
        left: calc(280px + 15px);
    }
}
