/* Montador de relatórios: critérios e campos dão lugar à tabela de resultado. */
#report-builder-dialog {
  width: min(1320px, calc(100% - 28px));
}
.report-builder-body {
  display: grid;
  gap: 18px;
  padding: 20px 24px 24px;
}
.report-config-bar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, .8fr) minmax(210px, 1.15fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-2);
}
.report-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.report-field input,
.report-field select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}
.report-config-actions,
.report-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.report-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 14px;
  align-items: start;
}
.report-section {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
}
.report-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.report-section-heading h3,
.report-preview-heading h3 {
  font-size: 15px;
}
.report-section-heading p,
.report-preview-heading p {
  color: var(--muted);
  font-size: 12px;
}
.report-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.report-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  max-height: 176px;
  margin: 0;
  padding: 0 2px 4px;
  overflow: auto;
  border: 0;
}
.report-column-choice,
.report-direction {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.report-column-choice span {
  overflow-wrap: anywhere;
}
.report-sort-field {
  margin-top: 12px;
}
.report-direction {
  margin-top: 8px;
  color: var(--muted);
}
.report-preview-section {
  min-width: 0;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
}
.report-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.report-preview-heading > div:first-child {
  display: grid;
  gap: 2px;
}
.report-preview-frame {
  min-height: 110px;
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
}
.report-table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.report-table th,
.report-table td {
  min-width: 110px;
  max-width: 300px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.report-table tr:last-child td {
  border-bottom: 0;
}
.report-table tbody {
  display: table-row-group;
}
.report-table thead {
  display: table-header-group;
}
.report-empty {
  display: grid;
  min-height: 108px;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
@media (max-width: 1120px) {
  .report-table {
    display: table;
  }
  .report-table thead {
    display: table-header-group;
  }
  .report-table tbody {
    display: table-row-group;
  }
  .report-table tbody tr {
    display: table-row;
    padding: 0;
    border: 0;
    background: transparent;
  }
}
@media (max-width: 980px) {
  .report-config-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .report-builder-body {
    padding: 16px;
  }
  .report-config-bar,
  .report-builder-grid,
  .report-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-section-heading,
  .report-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .report-output-actions > .button {
    flex: 1;
  }
  .list-heading {
    align-items: flex-start;
  }
  .list-heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
