.barra-topo {
    grid-column: 1 / -1;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--barra-topo-altura);
    padding: 0 1.5rem;
    background-color: var(--vel-glass-bg);
    backdrop-filter: blur(var(--vel-glass-blur));
    -webkit-backdrop-filter: blur(var(--vel-glass-blur));
    border-bottom: var(--vel-borda-separador);
}

.barra-topo__grade {
    position: absolute;
    inset: 0;
    opacity: var(--vel-grade-opacidade);
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--color-outline-variant) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-outline-variant) 1px, transparent 1px);
    background-size: var(--vel-grade-tamanho) var(--vel-grade-tamanho);
    background-position: center;
}

.barra-topo__corpo {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.barra-topo__marca {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: inherit;
}

.barra-topo__logo {
    display: block;
    width: auto;
    height: 2.25rem;
    flex-shrink: 0;
}

.barra-topo__marca-texto {
    font-family: var(--font-headline);
    font-size: 1.375rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--color-primary);
}

.barra-topo__esquerda {
    display: flex;
    align-items: center;
}

.barra-topo__direita {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.barra-topo__tema-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font: inherit;
    color: var(--color-on-surface-variant);
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.barra-topo__tema-botao:hover {
    color: var(--color-primary);
    background-color: var(--color-surface-container-high);
}

.barra-topo__tema-icone {
    font-size: 1.375rem;
}

.barra-topo__tema-icone--claro {
    display: none;
}

html[data-theme="dark"] .barra-topo__tema-icone--escuro {
    display: none;
}

html[data-theme="dark"] .barra-topo__tema-icone--claro {
    display: inline-block;
}

html[data-theme="dark"] .barra-topo__logo {
    filter: brightness(0) invert(1);
}

.barra-topo__perfil {
    position: relative;
}

.barra-topo__perfil-botao {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.5rem 0.375rem 0.375rem;
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.barra-topo__perfil-botao:hover,
.barra-topo__perfil--aberto .barra-topo__perfil-botao {
    background-color: var(--color-surface-container-high);
}

.barra-topo__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-on-primary);
    background-color: var(--color-primary);
    flex-shrink: 0;
}

.barra-topo__avatar--card {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.barra-topo__perfil-nome {
    max-width: 10rem;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--color-on-surface);
}

.barra-topo__perfil-seta {
    font-size: 1.25rem;
    color: var(--color-on-surface-variant);
    transition: transform 0.15s ease;
}

.barra-topo__perfil--aberto .barra-topo__perfil-seta {
    transform: rotate(180deg);
}

.barra-topo__perfil-card {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 1;
    width: min(18rem, calc(100vw - 2rem));
    overflow: hidden;
    background-color: var(--color-surface-container-lowest);
    border: var(--vel-borda-painel);
}

.barra-topo__perfil-card[hidden] {
    display: none;
}

.barra-topo__perfil-card-faixa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.75rem;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-on-primary);
    background-color: var(--color-primary);
}

.barra-topo__perfil-card-corpo {
    padding: 1rem;
}

.barra-topo__perfil-cabecalho {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.875rem;
    border-bottom: var(--vel-borda-separador);
}

.barra-topo__perfil-card-nome {
    display: block;
    font-family: var(--font-headline);
    font-size: 0.9375rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--color-on-surface);
}

.barra-topo__perfil-card-email {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-on-surface-variant);
    word-break: break-word;
}

.barra-topo__perfil-dados {
    display: grid;
    gap: 0.75rem;
    margin: 0.875rem 0 0;
    padding: 0;
}

.barra-topo__perfil-dados div {
    display: grid;
    gap: 0.125rem;
}

.barra-topo__perfil-dados dt {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.barra-topo__perfil-dados dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-on-surface);
}

.barra-topo__perfil-sair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-on-primary);
    background-color: var(--color-primary);
    transition: background-color 0.15s ease;
}

.barra-topo__perfil-sair:hover {
    background-color: var(--color-primary-container);
}

.barra-topo__perfil-sair .material-symbols-outlined {
    font-size: 1.125rem;
}

@media (max-width: 640px) {
    .barra-topo__perfil-nome {
        display: none;
    }
}
