.app-header-stack {
    position: relative;
    margin-bottom: 20px;
}

.app-header-stack--with-submenu {
    margin-bottom: 20px;
    padding-bottom: 34px;
}

.app-header {
    border: 1px solid rgba(91, 65, 44, 0.12);
    background: rgba(255, 250, 242, 0.88);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px rgba(64, 39, 18, 0.12);
    border-radius: 20px;
    position: relative;
    z-index: 2;
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
}

.app-header__left,
.app-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-header__brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.app-header__eyebrow {
    color: #726458;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.app-header__title {
    color: #2d241c;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.app-header__back,
.app-header__logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(91, 65, 44, 0.12);
    background: rgba(255, 255, 255, 0.64);
    color: #2d241c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.app-header__back:hover,
.app-header__logout:hover {
    transform: translateY(-1px);
}

.app-header__profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-header__avatar,
.app-header__avatar-fallback {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(182, 92, 52, 0.14);
    flex: 0 0 auto;
}

.app-header__avatar-fallback {
    display: grid;
    place-items: center;
    color: #83391b;
    font-weight: 800;
}

.app-header__profile-text {
    min-width: 0;
}

.app-header__profile-name,
.app-header__profile-email {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header__profile-name {
    color: #2d241c;
    font-size: 14px;
    font-weight: 700;
}

.app-header__profile-email {
    color: #726458;
    font-size: 13px;
}

.app-submenu {
    position: absolute;
    left: 24px;
    right: 24px;
    top: calc(100% - 28px);
    z-index: 1;
    pointer-events: auto;
}

.app-submenu__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 10px;
    border: 1px solid rgba(91, 65, 44, 0.1);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(249, 241, 229, 0.88), rgba(255, 249, 240, 0.96));
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 34px rgba(64, 39, 18, 0.1);
    min-height: 48px;
    overflow-x: auto;
    opacity: 1;
    transform: translateY(-12px);
    transform-origin: top center;
    animation: app-submenu-drop 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-submenu__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    background: transparent;
    border: 0;
    color: #2d241c;
    white-space: nowrap;
}

.app-submenu__item.is-current {
    background: rgba(182, 92, 52, 0.14);
    color: #83391b;
    box-shadow: inset 0 0 0 1px rgba(182, 92, 52, 0.14);
}

.app-submenu__label {
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

@keyframes app-submenu-drop {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }

    to {
        opacity: 1;
        transform: translateY(-12px);
    }
}

@media (max-width: 720px) {
    .app-header-stack--with-submenu {
        margin-bottom: 18px;
        padding-bottom: 0;
    }

    .app-header__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .app-header__left,
    .app-header__right {
        width: 100%;
        justify-content: space-between;
    }

    .app-header__right {
        gap: 10px;
    }

    .app-header__profile {
        min-width: 0;
        flex: 1 1 auto;
    }

    .app-header__logout,
    .app-header__back {
        flex: 0 0 auto;
    }

    .app-submenu {
        position: static;
        margin-top: 10px;
        pointer-events: auto;
    }

    .app-submenu__inner {
        padding-top: 10px;
        opacity: 1;
        transform: none;
        animation: none;
    }

}
