.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    font-family: var(--font-family);
    width: 300px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 200;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.app-sidebar.open {
    transform: translateX(0);
}

.brand {
    flex-shrink: 0;
    font-size: 2.5rem;
    font-weight: 800;
    text-decoration: none;
    background-image: linear-gradient(90deg, var(--accent-cyan), var(--text-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 20px;
    display: block;
    padding-top: 15px;
}

.sidebar-nav {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}
.sidebar-nav::-webkit-scrollbar-button {
    display: none;
}



.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-item a:hover {
    background: rgba(0, 229, 255, 0.05);
    color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.nav-item.active a {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.1), transparent);
    color: var(--accent-cyan);
    border-right: 3px solid var(--accent-cyan);
}


.nav-item a.always-on {
    color: var(--accent-gold);
    background: linear-gradient(90deg, rgba(255, 200, 50, 0.08), transparent);
}

.nav-item a.always-on .nav-icon {
    color: var(--accent-gold);
}

.nav-item a.always-on:hover {
    background: rgba(255, 200, 50, 0.08);
    color: var(--accent-gold);
}

.dashboard-is-locked, .dashboard-is-locked a {
    cursor: default;
    color: var(--text-muted);
    background-color: transparent;
    text-decoration: none;
    transition: none;

}
.dashboard-is-locked a:hover {
    color: var(--text-muted);
    background-color: transparent;
    box-shadow: none;
    transition: none;
    transform: none;
    border: none;
    
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-inline-start: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--accent-danger, #ff5470);
    color: #fff;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-divider {
    flex-shrink: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 0.75rem 0.5rem;
}

.nav-section-secondary .nav-item a {
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
}

.nav-section-secondary .nav-icon {
    font-size: 1rem;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-footer .logout-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition-smooth);
    font-size: 0.95rem;
}

.sidebar-footer .logout-link:hover {
    background: rgba(255, 84, 112, 0.08);
    color: var(--accent-danger, #ff5470);
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 25px;
    left: 1rem;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 200;
}

.sidebar-close-btn:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

@media (max-width: 1024px) {
    .sidebar-close-btn {
        display: inline-flex;
    }
}

.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 35%;
    right: 0;
    transform: translateY(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--accent-cyan);
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 12px 8px;
    cursor: pointer;
    z-index: 110;
    box-shadow: -2px 0 10px rgba(0, 229, 255, 0.2);
    transition: right 0.3s ease;
}

.sidebar-toggle-btn .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent-cyan);
    margin: 4px 0;
    transition: all 0.3s ease;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

@media (max-width: 1024px) {
    .sidebar-toggle-btn {
        display: block;
        z-index: 1001;
    }

    .app-sidebar {
        z-index: 1000;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .sidebar-toggle-btn.open {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .sidebar-toggle-btn.open .icon-bar:nth-child(1) {
        transform: rotate(-45deg) translate(-4px, 4px);
    }
    .sidebar-toggle-btn.open .icon-bar:nth-child(2) {
        opacity: 0;
    }
    .sidebar-toggle-btn.open .icon-bar:nth-child(3) {
        transform: rotate(45deg) translate(-4px, -4px);
    }
}

@media (min-width: 1025px) {
    .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle-btn,
    .sidebar-overlay {
        display: none !important;
    }

    body.has-sidebar {
        padding-right: 300px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .my-element,
    .nav-item a {
        transition: none;
    }
}


