/* === ВЕРХНЯЯ ПАНЕЛЬ === */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    padding: 0 28px;
    background: var(--topbar-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.2);
    transition: background 0.4s ease;
}

.top-bar__left { display: flex; align-items: center; gap: 16px; }

.logo { font-size: 1.35rem; font-weight: 800; white-space: nowrap; letter-spacing: -0.3px; }
.logo span { 
    background: linear-gradient(135deg, var(--accent-light), #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hamburger {
    display: none;
    background: none; border: none; color: var(--text-primary);
    font-size: 1.5rem; cursor: pointer; padding: 6px; border-radius: 8px;
    transition: var(--transition);
}
.hamburger:hover { background: rgba(128,128,128,0.1); }

.top-bar__nav { display: flex; gap: 4px; }

.nav-link {
    padding: 8px 20px; border-radius: 50px;
    color: var(--text-secondary); font-weight: 500; font-size: 0.88rem;
    transition: var(--transition); text-decoration: none;
}
.nav-link:hover { color: var(--text-primary); background: rgba(128,128,128,0.08); }
.nav-link.active { 
    color: #fff; background: rgba(124, 58, 237, 0.2);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.top-bar__right { display: flex; align-items: center; gap: 12px; }

.credits-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.2);
    padding: 7px 16px; border-radius: 50px;
    font-weight: 600; font-size: 0.88rem;
}
.credits-icon { font-size: 0.9rem; }
.credits-value { color: var(--accent-light); font-weight: 700; }
.credits-label { color: var(--text-muted); font-size: 0.78rem; }

.theme-toggle-header {
    background: none; border: none;
    font-size: 1.3rem; cursor: pointer;
    padding: 6px; transition: transform 0.3s;
}
.theme-toggle-header:hover { transform: scale(1.2); }

.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(6, 182, 212, 0.2));
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem; transition: var(--transition);
}
.user-avatar:hover { 
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* === ДАШБОРД === */
.dashboard {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: calc(100vh - 68px);
}

/* === БОКОВАЯ ПАНЕЛЬ === */
.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 24px 20px;
    overflow-y: auto;
    max-height: calc(100vh - 68px);
    position: sticky;
    top: 68px;
    transition: background 0.4s ease;
}

.sidebar__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.sidebar__header h3 { 
    font-size: 1.1rem; font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar__close {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 1.5rem; cursor: pointer;
}

/* === РАБОЧАЯ ЗОНА === */
.workspace { padding: 36px; overflow-y: auto; animation: fadeInUp 0.5s ease; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInUp 0.4s ease; }

@media (max-width: 900px) {
    .dashboard { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: -100%; top: 68px; z-index: 99;
        width: 320px; height: calc(100vh - 68px);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.open { left: 0; box-shadow: 10px 0 40px rgba(0,0,0,0.5); }
    .sidebar__close { display: block; }
    .hamburger { display: block; }
    .top-bar__nav { display: none; }
    .workspace { padding: 20px 16px; }
}