/* ============================================================================
   notificacoes.css — sino do header e o dropdown (js/notificacoes.js), 13/11/2026.
   Contrato: docs/notificacoes/DESENHO.md. O painel é `.ds-pop` (css/components/ds.css §9 + tema-ib.css):
   este arquivo só dá posição, tamanho, as linhas e a bolinha. Só tokens, nada de cor solta.
   Bolinha do contador e ponto de "não lida" = --st-info-fill/--st-info-on (neutro invertido; badge nunca é neon,
   docs/design-diretrizes.md §5); círculo de verdade = --ds-radius-round.
   ========================================================================== */

/* Âncora: a pílula do sino (o popover mede o lugar a partir dela). */
.app-header__pill.hn-ancora { position: relative; }
.app-header__pill.hn-ancora.is-aberto { background: var(--ds-fill-press); }
.app-header__pill .header-notif-btn { position: relative; }

/* Bolinha com o número de não lidas: canto superior direito do ícone. */
.hn-badge {
    position: absolute;
    top: 2px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--ds-radius-round);
    background: var(--st-info-fill);
    color: var(--st-info-on);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px var(--bg-primary);
    pointer-events: none;
}
.hn-badge[hidden] { display: none; }

/* Painel: abre embaixo da pílula, alinhado à direita, como o seletor de cliente. */
.hn-pop {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    text-align: left;
    transform-origin: top right;
}
.hn-pop[hidden] { display: none; }

.hn-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 0 10px;
    border-bottom: 1px solid var(--ds-glass-line);
    flex: none;
}
.hn-titulo {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: var(--ds-track-body);
    color: var(--text-primary);
}
.hn-lnk {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.hn-lnk:hover { color: var(--text-primary); }
.hn-lnk:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }

.hn-aviso {
    margin: 6px 4px 0;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
    background: var(--ds-fill);
    flex: none;
}

.hn-corpo {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 4px;
    min-height: 0;
}
.hn-vazio {
    margin: 0;
    padding: 28px 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Grupo recolhível: cabeçalho = linha do menu com seta, rótulo e contagem. */
.hn-grupo + .hn-grupo { margin-top: 2px; border-top: 1px solid var(--ds-glass-line); padding-top: 2px; }
.hn-grupo__cab {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: var(--ds-track-body);
    text-align: left;
    cursor: pointer;
}
.hn-grupo__cab:hover,
.hn-grupo__cab:focus-visible { background: var(--ds-fill); color: var(--text-primary); outline: none; }
.hn-grupo__seta { flex: none; transition: transform 160ms ease; }
.hn-grupo__cab[aria-expanded="false"] .hn-grupo__seta { transform: rotate(-90deg); }
.hn-grupo__rot { flex: 1; }
.hn-grupo__n {
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hn-lista { list-style: none; margin: 0; padding: 0 0 4px; }
.hn-lista[hidden] { display: none; }

/* Item: linha do menu (padrão do seletor), duas linhas de texto. */
.hn-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.hn-item:hover,
.hn-item:focus-visible { background: var(--ds-fill); outline: none; }
.hn-item--sk { cursor: default; }
.hn-item--sk:hover { background: transparent; }
.hn-item__ponto {
    flex: none;
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: var(--ds-radius-round);
    background: transparent;
}
.hn-item.is-nova .hn-item__ponto { background: var(--st-info-fill); }
.hn-item__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hn-item__tit {
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: var(--ds-track-body);
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}
.hn-item.is-nova .hn-item__tit { font-weight: 600; color: var(--text-primary); }
.hn-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-muted);
}
.hn-item__cli { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hn-item__qdo { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Etiqueta do tenant (N5): chip = só texto + fio 1px currentColor, sem fundo (diretrizes §5). */
.hn-tag {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border: 1px solid currentColor;
    border-radius: var(--radius-xs, 2px);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hn-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Skeleton no formato da lista (troca única pela pintura real). */
.hn-sk { display: block; height: 10px; }
.hn-sk--cab { width: 38%; }
.hn-sk--tit { width: 82%; height: 12px; }
.hn-sk--meta { width: 46%; }

[data-ui="ib"] .hn-item,
[data-ui="ib"] .hn-grupo__cab { border-radius: 0; }

@media (max-width: 768px) {
    .hn-pop { width: min(380px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) {
    .hn-grupo__seta { transition: none; }
}
