/************************************************************
   SIDEBAR PRINCIPAL (fuera de dietasfinal)
 ************************************************************/

/* == OVERLAY == */
.sidebar-overlay-principal {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: rgba(0,0,0,0.55);
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.sidebar-overlay-principal.active {
    display: block;
    opacity: 1;
}

/* == SIDEBAR == */
.sidebar-principal {
    position: fixed;
    top: 60px;
    right: -300px;
    width: 280px;
    height: calc(100vh - 60px);
    background: linear-gradient(180deg, #24597f 0%, #1a4563 100%);
    color: #fff;
    padding-top: 60px;
    overflow-y: auto;
    z-index: 1002;
    box-shadow: -4px 0 16px rgba(0,0,0,0.35);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-principal.active {
    right: 0;
}

/* == HEADER == */
.sidebar-header-principal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title-principal {
    font-size: 1.2em;
    font-weight: 600;
    color: white;
}

.close-sidebar-principal {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.close-sidebar-principal:hover {
    background: rgba(255,255,255,0.12);
    transform: rotate(90deg);
}

/* == NAV == */
.sidebar-nav-principal ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-principal li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* == MENÚ PADRE == */
.menu-padre {
    user-select: none;
}

.submenu-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.submenu-header:hover {
    background: rgba(255,255,255,0.10);
}

.submenu-header i {
    margin-right: 12px;
    font-style: normal;
}

.submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

/* == SUBMENÚ == */
.submenu {
    list-style: none;
    padding-left: 10px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    transition: max-height .35s ease;
}

.menu-padre.open .submenu {
    max-height: 500px;
}

.menu-padre.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu li a {
    display: flex;
    align-items: center;
    padding: 12px 26px;
    font-size: 14px;
    color: #e8e8e8;
    text-decoration: none;
    transition: background 0.25s ease;
}

.submenu li a i {
    margin-right: 10px;
}

.submenu li a:hover {
    background: rgba(255,255,255,0.18);
}

/* == LOGOUT == */
.sidebar-logout-principal {
    padding: 10px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 20px;
}

.sidebar-logout-principal a {
    color: #ff8989 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-logout-principal a i {
    margin-right: 10px;
}

.sidebar-logout-principal a:hover {
    background: rgba(255,107,107,0.12) !important;
}
