#navigation-shell {
    position: relative;
    width: 250px;
    flex-shrink: 0; /* Cegah sidebar mengecil ditekan konten utama */
    background-color: var(--color-bg-sidebar);
    color: var(--color-text-primary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: width 0.3s ease;
    z-index: 100;
}

#navigation-shell.collapsed {
    width: 78px;
}

#navigation-shell.collapsed .nav-text {
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    height: 80px;
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
    position: relative;
}

.logo-details {
    display: flex;
    align-items: center;
    width: 140px;
    height: 100%;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.nav-logo {
    max-height: 35px;
    width: auto;
    object-fit: contain;
}

#navigation-shell.collapsed .logo-details {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background-color: var(--color-item-hover);
    color: var(--color-accent);
}

.toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

#navigation-shell.collapsed .toggle-btn svg {
    transform: rotate(180deg);
}

.icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.nav-menu {
    list-style: none;
    padding: 10px 0;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.nav-menu li {
    margin: 4px 12px;
}

.menu-logout-mobile {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item .icon {
    min-width: 35px;
    display: flex;
    justify-content: flex-start;
}

.nav-item .nav-text {
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background-color: var(--color-item-hover);
    color: var(--color-accent);
}

.nav-item.active {
    background-color: var(--color-item-active-bg);
    color: var(--color-item-active-text);
}

.nav-profile {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--color-bg-sidebar);
    border-top: 1px solid var(--color-border);
    gap: 15px;
    white-space: nowrap;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

.profile-details {
    flex-grow: 1;
}

.profile-details .name {
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-details .role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.logout-desktop {
    color: var(--color-text-muted);
}

.logout-desktop:hover {
    color: var(--color-accent);
}

@media (max-width: 1024px) {
    #app-container {
        flex-direction: column; 
    }

    #main-content {
        order: 1;
    }

    #navigation-shell, #navigation-shell.collapsed {
        order: 2;
        width: 100%;
        height: 70px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--color-border);
    }

    .nav-header, .nav-profile {
        display: none;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin: 0;
        padding: 0 10px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
    }
    
    .nav-menu::-webkit-scrollbar { 
        display: none;
    }

    .nav-menu li {
        margin: 0;
        flex-shrink: 0;
    }

    .menu-logout-mobile {
        display: flex;
    }

    .item-logout {
        color: var(--color-accent);
    }

    .nav-item {
        flex-direction: column;
        justify-content: center;
        padding: 8px 15px;
        gap: 6px;
    }

    .nav-item .icon {
        min-width: auto;
        justify-content: center;
    }

    .nav-item .icon svg {
        width: 20px;
        height: 20px;
    }

    .nav-item .nav-text {
        font-size: 0.7rem;
        opacity: 1 !important;
    }

    .nav-item:hover {
        background-color: transparent;
    }
    
    .nav-item.active {
        background-color: transparent;
        color: var(--color-item-active-bg);
    }
}