/* Layout Grid */
.app-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--bg-app);
    color: var(--text-primary);
}

/* Sidebar Styling */
.sidebar {
    width: 220px;
    background-color: var(--bg-sidebar-glass);
    /* Frosted background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: var(--sp-3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 110;
    flex-shrink: 0;
    position: relative;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-2);
    margin-bottom: var(--sp-5);
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    margin-bottom: var(--sp-2);
}

/* Slim scrollbar */
.nav-list::-webkit-scrollbar {
    width: 3px;
}

.nav-list::-webkit-scrollbar-track {
    background: transparent;
}

.nav-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.nav-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 1.05rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: rgba(0, 255, 135, 0.08);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon {
    width: 24px;
    height: 24px;
    opacity: 0.85;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2) var(--sp-3);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-6);
    position: relative;
    scroll-behavior: smooth;
}

/* Mobile Responsiveness */
.mobile-header {
    display: none;
    padding: var(--sp-3) var(--sp-4);
    background-color: var(--bg-sidebar-glass);
    /* Frosted background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    height: 56px;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        width: 280px;
        border-right: 1px solid var(--border-color);
        height: calc(100dvh - 56px);
        background-color: var(--bg-app);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-header {
        display: none;
    }

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-top: 56px;
        padding: var(--sp-4);
        padding-bottom: var(--sp-10);
    }
}