header.app-top-bar {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    padding: 0.625rem 0.75rem;
    padding-top: max(0.625rem, env(safe-area-inset-top));
    box-shadow: 0 2px 12px rgb(2 132 199 / 0.35);
    position: sticky;
    top: 0;
    z-index: 1030;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    width: 100%;
    box-sizing: border-box;
}

header.app-top-bar a {
    text-decoration: none;
}

.app-top-bar__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.app-top-bar__home {
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    padding: 0.35rem 0.5rem;
    margin: -0.35rem -0.25rem;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
}

.app-top-bar__home:hover {
    color: #fff !important;
    background: rgb(255 255 255 / 0.12);
}

.app-top-bar__home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgb(255 255 255 / 0.15);
}

.app-top-bar__account {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.app-top-bar__meta {
    min-width: 0;
    font-size: 0.8125rem;
    line-height: 1.25;
    display: none;
    align-items: baseline;
    gap: 0.35rem;
    text-align: right;
}

@media (min-width: 640px) {
    .app-top-bar__meta {
        display: flex;
    }
}

@media (min-width: 768px) {
    header.app-top-bar {
        padding: 0.75rem 1rem;
    }
    .app-top-bar__home {
        font-size: 1.0625rem;
    }
    .app-top-bar__meta {
        font-size: 0.875rem;
        flex: 1;
        justify-content: center;
        text-align: center;
    }
}

@media (min-width: 1024px) {
    .app-top-bar__meta {
        font-size: 0.9375rem;
    }
}

.app-top-bar__profile {
    position: relative;
    flex-shrink: 0;
}

.app-top-bar__avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 2px solid rgb(255 255 255 / 0.9);
    border-radius: 9999px;
    background: rgb(15 23 42 / 0.25);
    cursor: pointer;
    overflow: hidden;
    line-height: 1;
}

.app-top-bar__avatar-btn:hover,
.app-top-bar__profile.is-open .app-top-bar__avatar-btn {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgb(255 255 255 / 0.2);
}

.app-top-bar__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-top-bar__avatar-fallback {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
}

.app-top-bar__user-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    left: auto;
    min-width: 13rem;
    max-width: min(18rem, calc(100vw - 1.5rem));
    background: #fff;
    color: #0f172a;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
    padding: 0.35rem 0;
    z-index: 1040;
}

.app-top-bar__user-menu-head {
    padding: 0.65rem 0.875rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.app-top-bar__user-menu-head strong {
    display: block;
    font-size: 0.9375rem;
    color: #0f172a;
}

.app-top-bar__user-menu-head span {
    display: block;
    color: #64748b;
    margin-top: 0.15rem;
    word-break: break-word;
}

.app-top-bar__user-menu-item {
    display: block;
    padding: 0.55rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a !important;
    text-decoration: none;
}

.app-top-bar__user-menu-item:hover {
    background: #f1f5f9;
    color: #0284c7 !important;
}

.app-top-bar__user {
    font-weight: 600;
    white-space: nowrap;
}

.app-top-bar__nucleo {
    color: rgb(219 234 254 / 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.app-top-bar__dot {
    color: rgb(186 230 253 / 0.8);
    flex-shrink: 0;
}

.app-top-bar__logout {
    flex-shrink: 0;
    background: rgb(15 23 42 / 0.35);
    color: #fff !important;
    padding: 0.45rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgb(255 255 255 / 0.25);
    transition: background 0.15s ease;
}

.app-top-bar__logout:hover {
    background: rgb(15 23 42 / 0.55);
    color: #fff !important;
}

.app-top-bar__logout--light {
    background: #fff;
    color: #0284c7 !important;
    border-color: transparent;
    margin-left: auto;
}

.app-top-bar__logout--light:hover {
    background: #e0f2fe;
    color: #0369a1 !important;
}

@media (max-width: 639px) {
    .app-top-bar__home-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .app-top-bar__account {
        flex: 1;
        justify-content: flex-end;
    }
}
