/* Base de ensaios (#/base) — estilos SÓ desta tela (etapa 2). Escopo: .tela-base. Tokens de css/app.css. */

/* filtros — .dc.html ~1128-1136 */
.tela-base .bs-filtros { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.tela-base .bs-busca { flex: 1 1 240px; max-width: 380px; }
.tela-base .bs-sel { flex: 0 1 auto; min-width: 150px; }
.tela-base .bs-sel .select { min-width: 150px; }
.tela-base .bs-datas { display: flex; gap: 10px; align-items: flex-start; }
.tela-base .bs-datas .campo { width: 160px; }
.tela-base .bs-limpar { color: var(--texto-2); }
.tela-base .bs-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tela-base .chip-filtro { max-width: 100%; }

/* cartão do resultado */
.tela-base .bs-contagem { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--texto-2); }
.tela-base .bs-contagem b { font-size: 13px; }
.tela-base .bs-spinner { display: none; color: var(--primaria); }
.tela-base .bs-resultado.bs-carregando .bs-spinner { display: inline-block; }
.tela-base .bs-resultado.bs-carregando .bs-corpo,
.tela-base .bs-resultado.bs-carregando .vazio { opacity: .5; transition: opacity .15s ease; pointer-events: none; }
.tela-base .bs-erro { padding: 16px 18px; }
.tela-base .card-titulo:focus { outline: none; }
.tela-base .card-titulo:focus-visible { outline: 2px solid var(--primaria); outline-offset: 2px; }

/* tabela (≥ 768 px) */
.tela-base .bs-tabela .tabela td { vertical-align: top; }
.tela-base .bs-tabela .tabela th { vertical-align: middle; }
.tela-base .bs-tab { font-variant-numeric: tabular-nums; }   /* número alinhado à esquerda (.num da tabela alinha à direita) */
.tela-base .bs-col-comp { min-width: 150px; }
.tela-base .bs-comp { display: inline-flex; align-items: center; gap: 6px; }
.tela-base .bs-ident { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tela-base .bs-un { font-size: 11.5px; color: var(--texto-3); }
.tela-base .bs-mob, .tela-base .bs-ordem-mob { display: none; }

/* paginação */
.tela-base .bs-paginas { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tela-base .bs-num { min-width: 36px; padding-left: 8px; padding-right: 8px; }
.tela-base .bs-retic { color: var(--texto-3); padding: 0 2px; }
.tela-base .bs-pag-mob { display: none; font-weight: 700; color: var(--texto); padding: 0 4px; }

/* Largura da TELA (não da janela): com a sidebar, 768–1024 px de janela dão 480–730 px de conteúdo.
   < 940 px de conteúdo: lista de cartões no lugar da tabela (a tabela precisa de ~920 px; com rolagem lateral o veredito sumiria);
   < 560 px: filtros em 2 colunas. */
.tela-base { container: tela-base / inline-size; }
@container tela-base (max-width: 939.98px) {
  .tela-base .bs-tabela { display: none; }
  .tela-base .bs-mob { display: block; }
  .tela-base .bs-ordem-mob { display: flex; padding: 10px 14px; border-bottom: 1px solid var(--divisoria); }
  .tela-base .bs-ordem-mob .select { flex: 1; min-width: 0; width: auto; max-width: 360px; }
  .tela-base .card-flush > .card-cab { padding: 12px 14px; }
  .tela-base .bs-num, .tela-base .bs-retic { display: none; }
  .tela-base .bs-pag-mob { display: inline; }
  .tela-base .bs-rodape { padding: 10px 14px; }
  .tela-base .bs-paginas { flex: 1; justify-content: space-between; }
}
@container tela-base (max-width: 559.98px) {
  .tela-base .bs-filtros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tela-base .bs-busca { grid-column: 1 / -1; max-width: none; }
  .tela-base .bs-sel, .tela-base .bs-sel .select { min-width: 0; }
  .tela-base .bs-datas { grid-column: 1 / -1; }
  .tela-base .bs-datas .campo { width: auto; flex: 1; min-width: 0; }
  .tela-base .bs-limpar { grid-column: 1 / -1; }
  /* paginação: "Mostrando…" em cima e [‹ Anterior] [1 / 124] [Próxima ›] numa linha só embaixo */
  .tela-base .bs-rodape { flex-direction: column; align-items: stretch; gap: 8px; }
  .tela-base .bs-mostrando { text-align: center; }
  .tela-base .bs-paginas { flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
  .tela-base .bs-paginas > .btn { flex: none; }
  .tela-base .bs-pag-mob { flex: 1; min-width: 0; text-align: center; white-space: nowrap; }
}

.tela-base .bs-lista { list-style: none; margin: 0; padding: 0; }
.tela-base .bs-item {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-height: var(--alvo);
  border-bottom: 1px solid var(--divisoria); color: var(--texto); text-decoration: none;
}
.tela-base .bs-lista li:last-child .bs-item { border-bottom: 0; }
.tela-base a.bs-item:hover, .tela-base a.bs-item:active { background: var(--superficie-suave); color: var(--texto); }
.tela-base a.bs-item:focus-visible { outline: 2px solid var(--primaria); outline-offset: -2px; }
.tela-base .bs-item-topo { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--texto-3); font-variant-numeric: tabular-nums; }
.tela-base .bs-item-id { font-weight: 800; color: var(--texto-2); }
.tela-base .bs-item-data { flex: 1; min-width: 0; }
.tela-base .bs-item-comp { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 14px; }
.tela-base .bs-item-comp b { font-variant-numeric: tabular-nums; }
.tela-base .bs-item-ident { flex: 1; min-width: 0; font-size: 12px; color: var(--texto-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tela-base .bs-item-pe { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.tela-base .bs-item-meta { font-size: 12px; color: var(--texto-2); min-width: 0; }
.tela-base .bs-item-res { text-align: right; font-size: 12px; color: var(--texto-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tela-base .bs-item-res b { font-size: 14px; color: var(--texto); }
.tela-base .bs-item-sub { display: block; font-size: 11.5px; }
