/* 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;
    gap: var(--space-sm);
    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__start {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.topbar__start--primary {
    min-width: 0;
}

.topbar__cabinet-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.topbar__cabinet-group--single .topbar__cabinet-link {
    flex: 1 1 auto;
    max-width: 100%;
    justify-content: flex-start;
}

.topbar__cabinet-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 0;
    max-width: 50%;
}

.topbar__cabinet-link i {
    flex-shrink: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.topbar__cabinet-link-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__cabinet-link--passenger {
    border-color: rgba(52, 211, 153, 0.28);
    background: rgba(52, 211, 153, 0.08);
}

.topbar__cabinet-link--passenger:hover {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.14);
}

.topbar__cabinet-link--driver {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.08);
}

.topbar__cabinet-link--driver:hover {
    border-color: rgba(56, 189, 248, 0.48);
    background: rgba(56, 189, 248, 0.14);
}

@media (max-width: 380px) {
    .topbar__cabinet-link {
        padding: 8px;
        flex: 0 1 auto;
    }

    .topbar__cabinet-link-label {
        display: none;
    }

    .topbar__cabinet-link i {
        margin: 0;
    }
}

/* Кнопки повідомлень / сповіщень справа (базові стилі — .btn.btn--secondary.btn--icon) */
.topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.topbar__action-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    /* Замість круглих .btn--icon — помірно заокруглений прямокутник */
    border-radius: var(--radius-md);
}

.topbar__action-btn i {
    font-size: 1.05rem;
}