/* Responsividade isolada do modal de Auditoria de Acessos ao Portal do Cliente.
   Não altera menus, APIs, autenticação, dados ou outros modais. */
.agp-access-audit-overlay {
  padding: clamp(8px, 1.5vw, 20px);
  overscroll-behavior: contain;
}
.agp-access-audit-modal {
  width: min(1480px, calc(100vw - 24px));
  max-width: min(1480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  min-width: 0;
  min-height: 0;
}
.agp-access-audit-header {
  gap: 12px;
  padding: 16px clamp(12px, 2vw, 24px);
}
.agp-access-audit-header > div { min-width: 0; }
.agp-access-audit-header > div > div:last-child { min-width: 0; }
.agp-access-audit-header h2,
.agp-access-audit-header p { overflow-wrap: anywhere; }
.agp-access-audit-header > button { flex-shrink: 0; }
.agp-access-audit-filters {
  grid-template-columns: minmax(220px, 2fr) minmax(135px, 1fr) minmax(155px, 1fr) minmax(155px, 1fr);
  align-items: stretch;
}
.agp-access-audit-filters > * { min-width: 0; }
.agp-access-audit-filters > :first-child { grid-column: auto; }
.agp-access-audit-filters input,
.agp-access-audit-filters select { width: 100%; min-width: 0; }
.agp-access-audit-filter-actions > button { min-width: 0; }
.agp-access-audit-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.agp-access-audit-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.agp-access-audit-table {
  min-width: 1080px;
  width: 100%;
  table-layout: auto;
}
.agp-access-audit-table th,
.agp-access-audit-table td { vertical-align: middle; }
.agp-access-audit-table th { white-space: nowrap; }
.agp-access-audit-table td:nth-child(3) {
  max-width: 295px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.agp-access-audit-table td:nth-child(4) { max-width: 215px; }
.agp-access-audit-table td:nth-child(7) { white-space: nowrap; }
.agp-access-audit-footer { gap: 12px; padding: 12px clamp(12px, 2vw, 24px); }
.agp-access-audit-footer > div { flex-shrink: 0; }
.agp-access-audit-detail-overlay { padding: 12px; }
.agp-access-audit-detail-card {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.agp-access-audit-detail-fields > div { gap: 8px; min-width: 0; }
.agp-access-audit-detail-fields > div > :last-child {
  min-width: 0;
  max-width: 100%;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 950px) {
  .agp-access-audit-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .agp-access-audit-filters > :first-child { grid-column: 1 / -1; }
  .agp-access-audit-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .agp-access-audit-overlay { padding: 8px; align-items: center; }
  .agp-access-audit-modal { width: 100%; max-width: 100%; max-height: calc(100dvh - 16px); border-radius: 14px; }
  .agp-access-audit-header { padding: 12px; align-items: flex-start; }
  .agp-access-audit-header > div { gap: 8px; align-items: flex-start; }
  .agp-access-audit-header h2 { font-size: 12px; line-height: 1.35; }
  .agp-access-audit-header p { font-size: 10px; line-height: 1.4; }
  .agp-access-audit-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .agp-access-audit-filters > * { grid-column: 1 / -1 !important; }
  .agp-access-audit-filter-actions { display: flex; width: 100%; }
  .agp-access-audit-filter-actions > button:first-child { flex: 1 1 auto; }
  .agp-access-audit-body { padding: 10px; }
  .agp-access-audit-table-scroll { border: 0; background: transparent; overflow-x: hidden; }
  .agp-access-audit-table,
  .agp-access-audit-table tbody { display: block; width: 100%; min-width: 0; }
  .agp-access-audit-table thead { display: none; }
  .agp-access-audit-table tbody tr {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.94);
  }
  .agp-access-audit-table tbody td,
  .agp-access-audit-table tbody td:nth-child(3),
  .agp-access-audit-table tbody td:nth-child(4),
  .agp-access-audit-table tbody td:nth-child(7) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 6px 0;
    text-align: right;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .agp-access-audit-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 90px;
    min-width: 0;
    font-size: 10px;
    font-family: inherit;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #94a3b8;
  }
  .agp-access-audit-table tbody td > * { min-width: 0; max-width: calc(100% - 98px); }
  .agp-access-audit-table tbody td:first-child > div { flex: 1; }
  .agp-access-audit-table tbody td:first-child span { white-space: normal; overflow-wrap: anywhere; text-align: right; }
  .agp-access-audit-table tbody td:last-child button { max-width: 100%; }
  .agp-access-audit-footer { flex-wrap: wrap; justify-content: center; gap: 10px; text-align: center; padding: 12px; }
  .agp-access-audit-footer > span { width: 100%; }
  .agp-access-audit-footer > div { justify-content: center; }
  .agp-access-audit-detail-card { padding: 12px; border-radius: 12px; }
  .agp-access-audit-detail-fields { padding: 12px; }
}
@media (max-width: 360px) {
  .agp-access-audit-table tbody td::before { flex-basis: 76px; }
  .agp-access-audit-table tbody td > * { max-width: calc(100% - 84px); }
}

/* Resumo de acessos na página administrativa: IPv6 e nomes não podem transbordar. */
.agp-access-audit-recent-grid { min-width: 0; }
.agp-access-audit-recent-card { min-width: 0; max-width: 100%; overflow: hidden; }
.agp-access-audit-recent-card > div { min-width: 0; max-width: 100%; }
.agp-access-audit-recent-card > div:nth-child(2),
.agp-access-audit-recent-card > div:nth-child(2) span {
  display: block; min-width: 0; max-width: 100%; white-space: normal;
  overflow-wrap: anywhere; word-break: break-word;
}
.agp-access-audit-recent-card > div:first-child { gap: 6px; }
.agp-access-audit-recent-card > div:first-child > span:last-child { flex-shrink: 0; }
