/* design-system/components/topbar.css */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(52px + var(--safe-area-top));
    padding: calc(var(--safe-area-top) / 2 + 4px) var(--space-md) 4px var(--space-md);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: background var(--transition-normal);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(148, 163, 184, 0.1);
}

.topbar.is-scrolled {
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.topbar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: var(--font-weight-bold);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.topbar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar__info {
    display: flex;
    flex-direction: column;
}

.topbar__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__status {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Новий компактний блок балансів: кожна валюта в окремій капсулі */
.topbar__balances {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar__balances .currency {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow:
        0 8px 24px rgba(15, 23, 42, 0.7),
        0 0 0 1px rgba(148, 163, 184, 0.32);
}

/* Статус тарифу справа у шапці */
.topbar__status {
    display: flex;
    align-items: center;
}

@keyframes topbar-status-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.04);
        opacity: 0.92;
    }
}

.topbar__status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    animation: topbar-status-pulse 2.2s ease-in-out infinite;
}

.topbar__status-badge--premium {
    color: #facc15;
    background: rgba(250, 204, 21, 0.15);
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.25);
}

.topbar__status-badge--standard {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.topbar__status-badge.js-open-premium-info {
    cursor: pointer;
}

.topbar__status-badge.js-open-premium-info:active {
    animation: none;
    transform: scale(0.98);
    opacity: 1;
}