/* auditoria: estilos consolidados por responsabilidade. */
.audit-date-filter { width: 160px; gap: 4px; }

.audit-date-filter > span { color: var(--text-2); font-size: 11px; font-weight: 600; }

.audit-date-filter input { height: 32px; padding: 6px 9px; }

.movimentacoes-table-card { padding: 0px; overflow: hidden; }

.movimentacoes-table-scroll { width: 100%; overflow-x: auto; }

.movimentacoes-table { width: 100%; min-width: 820px; border-collapse: collapse; color: var(--text); font-size: 11px; text-align: left; }

.movimentacoes-table th { padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-align: left; white-space: nowrap; }

.movimentacoes-table td { max-width: 320px; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; }

.movimentacoes-table tbody tr:last-child td { border-bottom: 0px; }

.movimentacoes-table tbody tr { transition: background-color 160ms; }

.movimentacoes-table tbody tr:hover { background: var(--surface-hover); }

.movimentacoes-table__date { width: 132px; color: var(--text-2); white-space: nowrap; }

.movimentacoes-table__action { width: 170px; }

.movimentacoes-table__details { color: var(--text-2); line-height: 1.4; }

.movimentacoes-table__person, .movimentacoes-table__actor { min-width: 150px; }

.movimentacoes-table__person strong, .movimentacoes-table__actor strong { color: var(--text); font-size: 11px; font-weight: 650; }

.historico-snapshots { display: grid; gap: 0px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-sm); }

.historico-snapshot { overflow: hidden; border-bottom: 1px solid var(--border); background: transparent; }

.historico-snapshot:last-child { border-bottom: 0px; }

.historico-snapshot__header { padding: 12px 14px; }

.historico-snapshot__toggle { display: inline-flex; align-items: center; gap: 7px; padding: 0px; border: 0px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }

.historico-snapshot__toggle:hover, .historico-snapshot__toggle[aria-expanded="true"] { color: var(--teal-dark); }

.historico-snapshot__toggle:focus-visible { border-radius: 4px; outline: 2px solid var(--brand); outline-offset: 3px; }

.historico-snapshot__title { display: inline-flex; align-items: center; gap: 8px; min-width: 0px; }

.historico-snapshot__title strong { overflow: hidden; color: var(--text); font-size: 12.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.historico-snapshot__count { display: inline-flex; align-items: center; min-height: 21px; padding: 3px 7px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11px; font-weight: 700; white-space: nowrap; }

.historico-snapshot__meta { display: block; margin-top: 4px; color: var(--text-2); font-size: 11px; }

.historico-snapshot__body { border-top: 1px solid var(--border); }

.historico-snapshot__body[hidden] { display: none; }

.historico-table-scroll { width: 100%; overflow-x: auto; }

.historico-table { width: 100%; min-width: 720px; border-collapse: collapse; color: var(--text); font-size: 11px; text-align: left; }

.historico-table th { padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }

.historico-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }

.historico-table tbody tr:last-child td { border-bottom: 0px; }

.historico-table tbody tr:hover { background: var(--surface-hover); }

.historico-table__person { font-weight: 600; }

.historico-status { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 7px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 11px; font-weight: 700; white-space: nowrap; }

.historico-status.is-progress { background: color-mix(in srgb, #3278b8 9%, var(--card)); color: rgb(40, 103, 159); }

.historico-status.is-done { background: color-mix(in srgb, #0b8f75 9%, var(--card)); color: rgb(8, 116, 95); }

.historico-status.is-pending { background: color-mix(in srgb, #b87820 10%, var(--card)); color: rgb(153, 99, 21); }

.historico-table-scroll, .movimentacoes-table-scroll { overscroll-behavior-x: contain; }

.historico-table th, .historico-table td, .movimentacoes-table th, .movimentacoes-table td { border-right: 1px solid color-mix(in srgb, var(--border) 76%, transparent); }

.historico-table th:last-child, .historico-table td:last-child, .movimentacoes-table th:last-child, .movimentacoes-table td:last-child { border-right: 0px; }

.historico-table tbody tr:nth-child(even), .movimentacoes-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface) 46%, transparent); }

.historico-snapshot__title { align-items: center; flex-direction: row; gap: 8px; }

.historico-snapshot__title strong { white-space: nowrap; }

html[data-theme="dark"] .historico-status.is-progress { color: rgb(145, 197, 244); }

html[data-theme="dark"] .historico-status.is-done { color: rgb(112, 216, 189); }

html[data-theme="dark"] .historico-status.is-pending { color: rgb(233, 191, 116); }

@media (min-width: 1200px) {
  .area-trabalho-desktop-header__controls .audit-date-filter { width: 150px; gap: 2px; }
  .area-trabalho-desktop-header__controls .audit-date-filter > span { font-size: 11px; }
  .area-trabalho-desktop-header__controls .audit-date-filter input { height: 34px; padding: 5px 8px; font-size: 11px; }
  .historico-page > .area-trabalho-desktop-surface, .movimentacoes-page > .area-trabalho-desktop-surface, .historico-page > .empty-card, .movimentacoes-page > .empty-card { width: calc(100% - 32px); margin: 16px; }
  .historico-page > .historico-snapshots { gap: 12px; }
  .historico-page .historico-snapshots, .movimentacoes-page .movimentacoes-table-card { border-color: rgb(226, 231, 231); border-radius: 10px; box-shadow: rgba(15, 23, 42, 0.03) 0px 3px 12px; }
  .historico-page .historico-snapshot { border-color: rgb(237, 240, 240); }
  .historico-page .historico-snapshot__header { min-height: 54px; padding: 13px 16px; }
  .historico-page .historico-table th, .movimentacoes-page .movimentacoes-table th { height: 42px; background: rgb(251, 252, 252); color: rgb(113, 128, 131); font-size: 11px; font-weight: 680; }
  .historico-page .historico-table td, .movimentacoes-page .movimentacoes-table td { height: 48px; padding-inline: 14px; background: rgb(255, 255, 255); }
  html[data-theme="dark"] .historico-page .historico-table th, html[data-theme="dark"] .movimentacoes-page .movimentacoes-table th { background: var(--surface); color: var(--text-3); }
  html[data-theme="dark"] .historico-page .historico-table td, html[data-theme="dark"] .movimentacoes-page .movimentacoes-table td { background: var(--card); }
}

/* Controles responsivos das páginas de auditoria.
   O shell já fornece o título no mobile/tablet; aqui ficam apenas filtros funcionais. */
.responsive-page-toolbar {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.responsive-page-toolbar--audit {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.responsive-page-toolbar--audit .audit-date-filter {
  width: 100%;
}

.responsive-page-toolbar--audit .audit-date-filter input {
  width: 100%;
}

.responsive-page-toolbar--audit .toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.responsive-page-toolbar--audit .toggle-chip {
  flex: 0 0 auto;
}

@media (min-width: 700px) and (max-width: 1199px) {
  .responsive-page-toolbar--audit {
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    align-items: end;
  }

  .responsive-page-toolbar--audit .toggle-group {
    justify-content: flex-end;
  }
}

@media (min-width: 1200px) {
  .responsive-page-toolbar {
    display: none;
  }
}
