/* P2-Config C2 — Auditoria: cabeçalho, filtros grandes, resumo em chips e lista (tabela no desktop, cartão no celular). */
[data-aud] [data-aud-topo] { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
[data-aud] h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--text); }
[data-aud] [data-aud-sub] { font-size: 15px; line-height: 22px; color: var(--text-2); }
[data-aud] [data-aud-topo] button, [data-aud] [data-aud-filtros] button { box-sizing: border-box; height: 40px; padding: 0 20px; font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; }

[data-aud] [data-aud-filtros] { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; padding: 16px; }
[data-aud] [data-aud-campo] { flex: 1 1 0; min-width: 0; }
[data-aud] [data-aud-campo] label { display: block; margin-bottom: 4px; font-size: 13px; line-height: 18px; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--text-muted); }
[data-aud] [data-aud-campo] input, [data-aud] [data-aud-campo] select { box-sizing: border-box; width: 100%; min-width: 0; height: 40px; padding: 0 12px; font-size: 14px; }

[data-aud] [data-aud-resumo] { margin-bottom: 16px; }
[data-aud] [data-aud-total] { margin-bottom: 8px; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--text); }
[data-aud] [data-aud-chips] { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
[data-aud] [data-aud-chip] { display: inline-flex; align-items: center; box-sizing: border-box; height: 28px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 14px; font-size: 13px; line-height: 1; font-weight: 500; text-transform: none; white-space: nowrap; color: var(--text-2); }

[data-aud] [data-aud-tabela] table { width: 100%; border-collapse: collapse; text-align: left; }
[data-aud] [data-aud-tabela] th { padding: 12px; border-bottom: 1px solid var(--hairline); font-size: 13px; line-height: 18px; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--text-muted); }
[data-aud] [data-aud-tabela] td { padding: 12px; border-bottom: 1px solid var(--hairline); font-size: 14px; line-height: 20px; vertical-align: top; overflow-wrap: break-word; word-break: normal; color: var(--text); }
[data-aud] [data-aud-quando] { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
[data-aud] [data-aud-usuario] { white-space: nowrap; }
[data-aud] [data-aud-texto] { color: var(--text-2); }
[data-aud] [data-aud-abrir] { padding: 0; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; color: var(--primary); }
[data-aud] [data-aud-vazio], [data-aud] [data-aud-vazio-carga], [data-aud] [data-aud-erro] { padding: 32px; text-align: center; font-size: 14px; color: var(--text-2); }
[data-aud] [data-aud-item]:has([data-aud-abrir]) { cursor: pointer; }

@media (max-width: 767px) {
  [data-aud] > * { margin-left: 6px; margin-right: 6px; }
  [data-aud] [data-aud-topo] button, [data-aud] [data-aud-filtros] button { height: 44px; }
  [data-aud] [data-aud-filtros] { flex-wrap: wrap; }
  [data-aud] [data-aud-campo] { flex: 1 1 calc(50% - 6px); }
  [data-aud] [data-aud-campo]:has(#audit-actor) { flex-basis: 100%; }
  [data-aud] [data-aud-campo] input, [data-aud] [data-aud-campo] select { height: 44px; font-size: 16px; }
  [data-aud] [data-aud-filtros] button { flex: 1 1 100%; }

  /* Tabela vira cartão: "o que" e "quando" na primeira linha, usuário e resumo abaixo. */
  [data-aud] [data-aud-tabela] table, [data-aud] [data-aud-tabela] tbody { display: block; width: 100%; min-width: 0; max-width: 100%; }
  [data-aud] [data-aud-tabela] thead { display: none; }
  [data-aud] [data-aud-tabela] [data-aud-item] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 12px 0; padding: 12px; border: 1px solid var(--hairline); border-radius: 8px; }
  [data-aud] [data-aud-tabela] [data-aud-item] td { display: block; min-width: 0; padding: 0; border: 0; font-size: 15px; line-height: 22px; }
  [data-aud] [data-aud-item] [data-aud-oque] { grid-column: 1; grid-row: 1; align-self: center; font-weight: 600; }
  [data-aud] [data-aud-item] [data-aud-quando] { grid-column: 2; grid-row: 1; align-self: center; font-size: 14px; }
  [data-aud] [data-aud-item] [data-aud-usuario] { white-space: normal; grid-column: 1 / -1; grid-row: 2; color: var(--text-muted); }
  [data-aud] [data-aud-item] [data-aud-texto] { grid-column: 1 / -1; grid-row: 3; }
  [data-aud] [data-aud-item], [data-aud] [data-aud-item] * { background: transparent; box-shadow: none; }
  [data-aud] [data-aud-tabela] td[colspan] { display: block; width: 100%; box-sizing: border-box; }
}
