.navbar {
    height: 72px;
    padding: 0 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(15, 23, 42, .04);
}

.brand,
.nav-links,
.nav-actions,
.profile {
    display: flex;
    align-items: center;
}

.brand {
    gap: 12px;
    font: var(--font-brand);
}

.brand__mark {
    width: 32px;
    height: 32px;
}

.nav-links {
    --nav-hover-background: var(--color-success-surface);
    height: 100%;
    gap: 32px;
}

.nav-link {
    height: 100%;
    padding: 0 8px;
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    border-bottom: 3px solid transparent;
    font-size: var(--font-body);
    font-weight: 600;
    transition: color 140ms ease, background-color 140ms ease;
}

.nav-link:focus-visible {
    color: var(--color-success-dark);
    background-color: var(--nav-hover-background);
}

@media (hover: hover) and (pointer: fine) {
    .nav-link:hover {
        color: var(--color-success-dark);
        background-color: var(--nav-hover-background);
    }
}

.nav-link--active {
    color: var(--color-brand);
    border-color: var(--color-brand);
}

.nav-actions {
    gap: 12px;
    flex: 0 0 auto;
}

.icon-button,
.profile {
    position: relative;
    align-items: center;
    border: 0;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.icon-button {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
}

.icon-button img {
    width: 40px;
    height: 40px;
}

.profile {
    min-width: 0;
    min-height: 52px;
    gap: 10px;
    padding: 6px 8px;
    color: var(--color-text-primary);
    font-size: var(--font-body);
    font-weight: 600;
}

.profile__avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--color-success);
    background: var(--color-success-soft);
    border: 1px solid #a7f3d0;
    font: 700 var(--font-body)/1 Inter, sans-serif;
}

.profile__chevron {
    width: 16px;
    height: 16px;
    transition: transform 180ms ease;
}

.profile[aria-expanded="true"] { background: var(--color-success-surface); }
.profile[aria-expanded="true"] .profile__chevron { transform: rotate(180deg); }
.profile:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }

.profile__identity {
    display: flex;
    min-width: 0;
    max-width: 160px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.profile__identity strong {
    max-width: 100%;
    overflow: hidden;
    font-size: var(--font-body);
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile__identity small {
    color: #64748b;
    font-size: var(--font-caption);
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .navbar :is(.icon-button, .profile):hover {
        background: var(--color-neutral-surface);
    }
}

.navbar :is(.icon-button, .profile):active {
    background: var(--color-success-surface);
}

@media (min-width: 1101px) and (max-width: 1280px) {
    .navbar {
        padding-inline: 32px;
    }
    .nav-links {
        gap: 16px;
    }
    .profile__identity {
        max-width: 128px;
    }
}

.profile-menu {
    position: relative;
}

.profile-menu > summary {
    list-style: none;
}

.profile-menu > summary::-webkit-details-marker {
    display: none;
}

.profile-menu__logout {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: 216px;
    max-width: calc(100vw - 32px);
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
    transform-origin: top right;
}

.profile-menu__logout button {
    width: 100%;
    min-height: 40px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-danger);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font: 600 var(--font-body)/1.4 Inter, sans-serif;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.profile-menu__logout button svg { flex-shrink: 0; }
.profile-menu__logout button:active { transform: scale(.98); }

.profile-menu__logout button:hover {
    background: var(--color-danger-surface);
}

.profile-menu__logout button:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .profile__chevron, .profile-menu__logout button { transition: none; }
}
