/* Emissão genérica: tokens compartilhados, configuração preservada e resultado separado. */
#main.report-builder { overflow: visible; --report-surface: var(--ictus-white); --report-ink: var(--ictus-blue); --report-muted: var(--ictus-lead); --report-soft: var(--ictus-screen); --report-line: var(--ictus-border); --report-selected: var(--ictus-cyan-mist); }
.report-builder__configuration { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 1.25rem; }
.report-builder__workspace, .report-builder__inputs { min-width: 0; }
#main.report-builder :is(input, button, [tabindex], h4) { scroll-margin-top: 140px; scroll-margin-bottom: 20px; }
@media (min-width: 768px) {
  #main.report-builder .page-heading.fixed-top { min-height: 104px; background: var(--ictus-screen); }
  body.theme-dark #main.report-builder .page-heading.fixed-top { background: var(--ictus-midnight); }
  #main.report-builder .report-builder__title h3 { display: flex; align-items: center; gap: .5rem; min-width: 0; }
  #main.report-builder .report-builder__title h3 > span, #main.report-builder .text-subtitle { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  #main.report-builder .header-menu-responsive { margin: 0 !important; }
  #main.report-builder .page-content { margin-top: 112px; }
}
.report-builder__inputs { display: grid; gap: 1.25rem; border: 0; padding: 0; margin: 0; }
.report-builder__panel { padding: 1.5rem; background: var(--report-surface); border: 1px solid var(--report-line); border-radius: 16px; box-shadow: 0 4px 20px rgba(0, 43, 92, .035); min-width: 0; }
.report-builder__section-heading { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.25rem; }
.report-builder__section-heading > div { min-width: 0; flex: 1; }
.report-builder__section-heading h4, .report-builder__summary h4, .report-builder__result-toolbar h4 { font-size: 1.15rem; color: var(--report-ink); margin: 0 0 .35rem; }
.report-builder__section-heading p { font-size: .875rem; line-height: 1.5; color: var(--report-muted); margin: 0; }
.report-builder__step { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 10px; color: var(--report-ink); background: var(--report-selected); font-size: .85rem; font-weight: 700; }
.report-builder__count { flex-shrink: 0; padding: .25rem .5rem; border-radius: 20px; background: var(--report-soft); color: var(--report-muted); font-size: .75rem; white-space: nowrap; }
.report-builder__field-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.report-builder__search { position: relative; margin: 0; flex: 1 1 190px; max-width: 350px; min-width: 0; }
.report-builder__search > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); display: flex; color: var(--report-muted); pointer-events: none; }
#main.report-builder .report-builder__search input { padding-left: 2.3rem; min-width: 0; border-radius: 8px; }
.report-builder__field-tools > div { display: flex; gap: .25rem; flex-wrap: wrap; }
.report-builder__field-tools .btn-link { text-decoration: none; padding: .35rem .5rem; }
.report-builder__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: .55rem; }
.report-builder__field { display: flex; align-items: center; gap: .7rem; min-width: 0; min-height: 49px; padding: .75rem; border: 1px solid var(--report-line); border-radius: 9px; color: var(--report-muted); cursor: pointer; margin: 0; font-size: .875rem; transition: background-color .15s, border-color .15s; }
.report-builder__field > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.report-builder__field > i { display: flex; font-size: 1rem; }
.report-builder__field .form-check-input { float: none; flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.report-builder__field.is-selected { background: var(--report-selected); border-color: var(--ictus-cyan); color: var(--report-ink); }
#main.report-builder .report-builder__field { display: flex; gap: .7rem; }
#main.report-builder .report-builder__section-heading h4, #main.report-builder .report-builder__summary h4, #main.report-builder .report-builder__result-toolbar h4 { color: var(--report-ink); font-size: 1.15rem; }
#main.report-builder .btn-primary { background-color: var(--ictus-blue); border-color: var(--ictus-blue); color: var(--ictus-white); }
#main.report-builder .btn-link { color: var(--ictus-ocean); text-decoration: none; }
#main.report-builder .btn-outline-primary { color: var(--ictus-blue); border-color: var(--ictus-blue); }
#main.report-builder .btn-outline-primary:hover { background-color: var(--report-selected); }
.report-builder__field:focus-within { outline: 2px solid var(--ictus-cyan); outline-offset: 2px; }
.report-builder__inputs:disabled .report-builder__field { cursor: wait; }
.report-builder__empty-search { padding: 1rem 0; margin: 0; color: var(--report-muted); font-size: .875rem; }
#main.report-builder .report-emit-filters { margin: 0; }
.report-builder .report-emit-filters > .col-12 { padding: 0; }
.report-builder .report-emit-filters__grid { padding: 0; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.report-builder .report-emit-filters__item > .d-flex > label { font-size: .85rem; font-weight: 600; color: var(--report-ink); }
.report-builder .report-emit-filters__item > .d-flex > button { font-size: .75rem; text-decoration: none; }
.report-builder .report-emit-filters__item .form-control, .report-builder .report-emit-filters__item .form-select { min-width: 0; font-size: .875rem; min-height: 40px; }
.report-builder .report-emit-filters__multi-select > .btn { display: flex; align-items: center; gap: .5rem; text-align: left; font-size: .875rem; min-height: 40px; border-color: var(--report-line); color: var(--report-muted); }
.report-builder .report-emit-filters__multi-select .dropdown-menu { width: min(340px, calc(100vw - 56px)); max-width: calc(100vw - 56px); }
.report-builder__period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.report-builder__period > label > span { font-size: .75rem; color: var(--report-muted); margin-bottom: .25rem; display: block; }
.report-builder__period .form-control { padding: .5rem; }
.report-builder__entity { display: flex; align-items: center; gap: .75rem; padding: .8rem; border: 1px solid var(--report-line); border-radius: 10px; }
.report-builder__entity > div { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .85rem; }
.report-builder__entity strong { color: var(--report-ink); }
.report-builder__entity small { display: block; color: var(--report-muted); }
.report-builder__entity .btn { display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0; font-size: .8rem; }
.report-builder__entity-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: var(--report-soft); border-radius: 50%; color: var(--report-muted); }
.report-builder__summary { position: sticky; top: 112px; }
.report-builder__eyebrow { display: block; color: var(--report-muted); font-size: .7rem; letter-spacing: .08em; font-weight: 700; margin-bottom: .5rem; }
.report-builder__metrics { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid var(--report-line); margin: 1.15rem 0; padding: 1rem 0; gap: .75rem; }
.report-builder__metrics strong { display: block; color: var(--report-ink); font-size: 1.8rem; line-height: 1.2; }
.report-builder__metrics span { font-size: .75rem; color: var(--report-muted); }
.report-builder__summary-label { font-size: .75rem; font-weight: 600; color: var(--report-muted); margin-bottom: .5rem; }
.report-builder__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.report-builder__chips > span { background: var(--report-soft); color: var(--report-muted); border-radius: 6px; padding: .3rem .5rem; font-size: .75rem; overflow-wrap: anywhere; max-width: 100%; }
.report-builder__filter-summary { margin-top: 1rem; }
.report-builder__filter-summary > span { display: block; font-size: .8rem; color: var(--report-muted); margin-top: .3rem; }
.report-builder__hint { font-size: .8rem; line-height: 1.6; color: var(--report-muted); margin: 1rem 0; }
.report-builder__generate, .report-builder__cancel { width: 100%; font-size: .875rem; }
.report-builder__generate { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; }
.report-builder__cancel { text-decoration: none; margin-top: .4rem; }
.report-builder__summary .alert { font-size: .85rem; }
.report-builder__result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.25rem; border-bottom: 1px solid var(--report-line); }
.report-builder__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.report-builder__actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-size: .85rem; }
.report-builder__result-message { padding: .75rem 1.25rem; display: flex; align-items: center; gap: .5rem; color: var(--report-muted); }
#main.report-builder #div-table-report { padding: 0; }
.report-builder__results .card { border: 1px solid var(--report-line); border-radius: 16px; background: var(--report-surface); }
.report-builder__results .table th { white-space: nowrap; font-size: .8rem; padding: 1rem; background: var(--report-soft); }
.report-builder__results .table td { padding: .9rem 1rem; font-size: .875rem; }
.report-builder__results .table th, .report-builder__results .table td { border-color: var(--report-line); }
body.theme-dark #main.report-builder { --report-surface: var(--ictus-dark-surface); --report-ink: var(--ictus-white); --report-muted: var(--ictus-dark-muted); --report-soft: var(--ictus-dark-surface-hover); --report-line: var(--ictus-dark-border); --report-selected: rgba(48, 192, 221, .12); }
body.theme-dark #main.report-builder .report-builder__field { background: var(--report-surface) !important; color: var(--report-muted); border-color: var(--report-line); }
body.theme-dark #main.report-builder .report-builder__field.is-selected { background: var(--report-selected) !important; color: var(--ictus-white); border-color: var(--ictus-cyan); }
body.theme-dark #main.report-builder .report-builder__field > span { color: inherit; }
body.theme-dark #main.report-builder .report-builder__field .form-check-input { position: static; margin: 0; }
body.theme-dark #main.report-builder .report-builder__field .form-check-input:not(:checked) { background-color: transparent; border-color: var(--ictus-gray-medium); }
body.theme-dark #main.report-builder .report-builder__field .form-check-input:checked { background-color: var(--ictus-ocean); border-color: var(--ictus-ocean); }
body.theme-dark #main.report-builder .report-builder__configuration .form-control, body.theme-dark #main.report-builder .report-builder__configuration .form-select { background-color: var(--report-surface); color: var(--ictus-white); border-color: var(--report-line); color-scheme: dark; }
body.theme-dark #main.report-builder .btn-link, body.theme-dark #main.report-builder .btn-outline-primary, body.theme-dark #main.report-builder .btn-outline-secondary { color: #9ee6f3; text-decoration: none; }
body.theme-dark #main.report-builder .btn-outline-primary, body.theme-dark #main.report-builder .btn-outline-secondary { border-color: var(--report-line); }
body.theme-dark #main.report-builder .report-emit-filters__multi-select > .btn { color: var(--report-muted); }
@media (min-width: 768px) and (max-width: 1099.98px) { .report-builder__configuration { grid-template-columns: minmax(0, 1fr) 255px; gap: 1rem; } .report-builder__panel { padding: 1.15rem; } }
@media (max-width: 767.98px) {
  body #main.report-builder .page-heading.fixed-top { height: 60px; padding: 10px 12px; border: 0; }
  #main.report-builder .report-builder__title { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
  #main.report-builder .report-builder__title h3 { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; min-width: 0; order: -1; color: white; }
  #main.report-builder .report-builder__title h3 > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #main.report-builder .header-menu-responsive { margin: 0 !important; }
  #main.report-builder .breadcrumb-header { display: none; }
  body #main.report-builder .page-heading .box-notification { display: flex; margin: 0; flex-shrink: 0; position: relative; }
  #main.report-builder .box-notification a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  #main.report-builder .page-content { padding: 12px; margin-top: 60px; }
  #main.report-builder :is(input, button, [tabindex], h4) { scroll-margin-top: 80px; }
  .report-builder__configuration { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .report-builder__inputs { gap: 1rem; }
  .report-builder__panel { padding: 1rem; border-radius: 12px; }
  .report-builder__section-heading { gap: .6rem; }
  .report-builder__section-heading h4 { font-size: 1rem; }
  #main.report-builder .report-builder__section-heading h4 { font-size: 1rem; }
  .report-builder__section-heading p { font-size: .8rem; }
  .report-builder__count { font-size: .7rem; }
  .report-builder__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-builder__field { padding: .6rem; gap: .45rem; font-size: .8rem; }
  .report-builder__field > i { display: none; }
  .report-builder__search { max-width: none; flex-basis: 100%; }
  .report-builder__summary { position: static; }
  .report-builder__entity { flex-wrap: wrap; gap: .5rem; }
  .report-builder__entity-icon { display: none; }
  .report-builder__result-toolbar { padding: 1rem; }
  .report-builder__result-toolbar .report-builder__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .report-builder__result-toolbar .report-builder__actions .btn:first-child { grid-column: 1 / -1; }
  .report-builder__result-toolbar .report-builder__actions .btn { flex: 1; font-size: .8rem; }
}
@media print {
  #main.report-builder .report-builder__configuration, #main.report-builder .row-buttons-report, #main.report-builder .report-builder__result-message, #main.report-builder .box-notification { display: none !important; }
  #main.report-builder, #main.report-builder .page-content { padding: 0 !important; margin: 0 !important; }
  #main.report-builder .page-heading.fixed-top { position: static !important; height: auto !important; background: white !important; color: black !important; }
  #main.report-builder .page-heading h3 { color: black !important; }
  #main.report-builder #div-table-report { overflow: visible !important; }
  #main.report-builder .report-builder__results .card { border: 0; box-shadow: none; }
  body.theme-dark #main.report-builder .report-builder__results .card, body.theme-dark #main.report-builder .report-builder__results .table, body.theme-dark #main.report-builder .report-builder__results .table th, body.theme-dark #main.report-builder .report-builder__results .table td { background: white !important; color: black !important; }
}
@media (prefers-reduced-motion: reduce) { .report-builder__field { transition: none; } }
