/* ─── SIDEBAR NAVIGATION ─── */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(10, 14, 24, 0.95);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
}

.brand-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    border: 1px solid rgba(168, 85, 247, 0.3);
    flex-shrink: 0;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #d8b4fe, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.brand-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    margin-top: 0.25rem;
    font-weight: 600;
}

.mobile-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-group-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.35rem 0.65rem 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-item, .tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    font-family: inherit;
}

.nav-item:hover, .tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.nav-item.active, .tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(59, 130, 246, 0.16) 100%);
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.1);
    font-weight: 700;
}

.nav-item.active::before, .tab-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-blue));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px var(--accent-purple);
}

.nav-icon {
    font-size: 1.1rem;
    width: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.nav-badge.badge-studio {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
}

.nav-badge.badge-live {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* ─── SIDEBAR FOOTER & PROGRESS ─── */
.sidebar-footer {
    padding: 1rem 0.85rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
}

.mini-progress-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
}

.mini-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.mini-progress-bar-bg {
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    overflow: hidden;
}

.mini-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
    transition: width 0.4s ease;
}

.mini-progress-text {
    display: block;
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.35rem;
    font-weight: 500;
}

.sidebar-legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-legal-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.sidebar-legal-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* ─── MAIN VIEWPORT & TOPBAR ─── */
.app-topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 13, 22, 0.75);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    gap: 1rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.45rem;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.breadcrumb-root {
    color: #64748b;
    font-weight: 500;
}

.breadcrumb-sep {
    color: #475569;
}

.breadcrumb-current {
    color: #f1f5f9;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar-action-btn {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    padding: 0.45rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topbar-action-btn:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.5);
    color: #fff;
}

/* ─── RESPONSIVE BEHAVIOR FOR SIDEBAR ─── */
@media (max-width: 960px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .mobile-menu-btn {
        display: flex;
    }
    .mobile-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        z-index: 35;
    }
    .sidebar-overlay.open {
        display: block;
    }
    .app-topbar {
        padding: 0 1rem;
    }
}
