/* Barra do topo — uma só para Home, Preparar Scan, Escaneando e Resultados
   (desktop). Montada por utils/barra.js a partir de <div id="barra-topo">.
   O scanning mobile NÃO usa esta barra (decisão de 15/09). */
.barra-topo {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: var(--fonte-ui);
    color: var(--texto);
}
.barra-topo-inner {
    max-width: var(--barra-largura, 1120px);
    margin: 0 auto;
    padding: 12px 24px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.barra-esquerda { display: flex; align-items: center; gap: 16px; min-width: 0; }
.barra-logo { display: flex; align-items: center; text-decoration: none; }
.barra-logo img { height: 40px; display: block; }
.barra-divisor { width: 1px; height: 24px; background: var(--linha); flex-shrink: 0; }
.barra-titulo {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--texto);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botão do usuário (avatar + seta) e o menu suspenso */
.barra-usuario { position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
/* Pílula do teste de 30 dias (21/09): à esquerda do avatar, leva à aba Plano */
.barra-teste {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; text-decoration: none;
    border: 1px solid transparent; transition: filter .15s;
}
.barra-teste.ok { background: var(--acento-suave, #e3f7f4); color: var(--acento-forte, #0b7f76); border-color: #b9ebe3; }
.barra-teste.aguardando { background: var(--superficie-2, #f3f1ec); color: var(--texto-2, #4b4f58); border-color: var(--linha, #e6e3dd); }
.barra-teste.atencao { background: #fdf0dc; color: #9a5300; border-color: #f5d9a8; }
.barra-teste.fim { background: #fde8e8; color: #b91c1c; border-color: #f1c4c4; }
.barra-teste:hover { filter: brightness(.96); }
@media (max-width: 520px) { .barra-teste { font-size: 11px; padding: 0 8px; } }
/* 28/09: rótulo curto no celular + balão aberto para baixo (o de tema.css abre para cima) */
.barra-teste-envolto { display: inline-flex; }
.barra-teste-curto { display: none; }
@media (max-width: 520px) { .barra-teste-longo { display: none; } .barra-teste-curto { display: inline; } }
.balao.balao-abaixo { bottom: auto; top: calc(100% + 8px); width: max-content; transform: translateY(-4px); }
.balao.balao-abaixo::after { bottom: auto; top: -5px; }
.barra-usuario-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 0;
    background: none;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    color: var(--texto-2);
}
.barra-usuario-btn:hover, .barra-usuario-btn[aria-expanded="true"] { background: var(--superficie-2); }
.barra-usuario-btn:focus-visible { outline: 2px solid var(--acento-forte); outline-offset: 2px; }
.barra-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--acento-forte);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}
.barra-menu {
    position: absolute;
    top: 48px;
    right: 0;
    width: 260px;
    background: #ffffff;
    border: 1px solid var(--linha);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 60;
}
.barra-menu[hidden] { display: none; }
.barra-menu-cabecalho {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--superficie-2);
    margin-bottom: 4px;
}
.barra-menu-cabecalho .barra-avatar { width: 40px; height: 40px; font-size: 15px; }
.barra-menu-quem { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.barra-menu-nome { font-size: 14px; font-weight: 600; color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-menu-loja { font-size: 12px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--texto);
    text-decoration: none;
    border-radius: 6px;
    border: 0;
    background: none;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.barra-menu-item:hover { background: var(--superficie-2); color: var(--texto); }
.barra-menu-item svg { color: var(--texto-2); flex-shrink: 0; }
.barra-menu-item.perigo, .barra-menu-item.perigo svg { color: #b91c1c; }
.barra-menu-sep { height: 1px; background: var(--superficie-2); margin: 4px 8px; }

/* Selo de avisos não lidos (Fase 2, sobra): no canto do avatar e ao lado do item "Avisos". */
.barra-usuario-btn { position: relative; }
.barra-badge {
    position: absolute;
    top: 0;
    right: 16px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e41e3f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
    border: 2px solid #ffffff;
    pointer-events: none;
}
.barra-contador {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e41e3f;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

@media (max-width: 640px) {
    .barra-topo-inner { padding: 10px 12px; }
    .barra-titulo { font-size: 16px; }
}
