/* ================================================= */
/* SIDEBAR — Estilo App (PWA)                        */
/* ================================================= */

.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100% - 60px);
    background-color: #111;
    z-index: 30;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-duration);
}

.sidebar-open {
    width: var(--sidebar-width-expanded);
}

.sidebar-collapsed {
    width: var(--sidebar-width-collapsed);
}

/* ------------------------------------------------- */
/* NAV CONTAINER                                     */
/* ------------------------------------------------- */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 8px 0;
}

/* ------------------------------------------------- */
/* ÍTEM BASE                                         */
/* ------------------------------------------------- */

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item i:first-child {
    width: 20px;
    text-align: center;
    font-size: 17px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.15s;
}

.nav-item:hover,
.nav-item:focus {
    background: rgba(255, 255, 255, 0.07);
    color: var(--color-white);
    border-left-color: var(--color-red);
    outline: none;
}

.nav-item:hover i:first-child,
.nav-item:focus i:first-child {
    color: var(--color-red);
}

.nav-item.active {
    background: rgba(227, 30, 36, 0.12);
    color: var(--color-white);
    border-left-color: var(--color-red);
}

.nav-item.active i:first-child {
    color: var(--color-red);
}

/* ------------------------------------------------- */
/* SUBITEMS (dentro de Configuración)                */
/* ------------------------------------------------- */

.nav-sub {
    padding-left: 44px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------- */
/* ACORDEÓN CONFIGURACIÓN                            */
/* ------------------------------------------------- */

.config-section {
    list-style: none;
}

.config-section > summary {
    list-style: none;
}

.config-section > summary::-webkit-details-marker {
    display: none;
}

.config-links {
    background: rgba(0, 0, 0, 0.25);
}

.chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
    color: rgba(255, 255, 255, 0.35) !important;
    width: auto !important;
    flex-shrink: 0;
}

.config-section[open] .chevron {
    transform: rotate(90deg);
}

/* ------------------------------------------------- */
/* LOGOUT — fijado al fondo                          */
/* ------------------------------------------------- */

.nav-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.nav-logout:hover {
    color: #ff4444;
    border-left-color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
}

.nav-logout:hover i:first-child {
    color: #ff4444;
}

/* ------------------------------------------------- */
/* SIDEBAR COLAPSADO — solo iconos                   */
/* ------------------------------------------------- */

.sidebar-collapsed .nav-item span {
    display: none;
}

.sidebar-collapsed .config-links {
    display: none;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 14px;
    gap: 0;
}

.sidebar-collapsed .nav-item i:first-child {
    width: auto;
}

.sidebar-collapsed .chevron {
    display: none;
}
