/* ObraGestão 8.6.3.46 — importação inteligente em lote */
.aib46-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;background:#fff;border:1px solid #e3e8ee;border-radius:14px;padding:16px;margin-bottom:12px}.aib46-head>div:first-child{display:grid;gap:4px}.aib46-head b{font-size:14px;color:#18344f}.aib46-head span{font-size:12px;color:#627386}.aib46-stats{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end}.aib46-stats span{display:inline-flex;gap:6px;align-items:center;padding:6px 9px;border-radius:999px;background:#eef5ff;color:#1c5e98;font-size:11px}.aib46-stats .warn{background:#fff6db;color:#8a6400}.aib46-stats .dup{background:#fff0f0;color:#aa2f34}.aib46-attachment{display:grid;gap:10px;background:#fff;border:1px solid #e3e8ee;border-radius:14px;padding:14px;margin-bottom:12px}.aib46-attachment>div:first-child{display:grid;gap:3px}.aib46-attachment small{color:#718092}.aib46-file{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;background:#f7f9fb;border:1px solid #e6ebf0}.aib46-file>span{font-size:20px}.aib46-file>div{display:grid;flex:1}.aib46-file.empty{justify-content:space-between}.aib46-tools{display:flex;gap:12px;align-items:center;justify-content:space-between;margin:10px 0}.aib46-tools .searchbox{max-width:420px}.aib46-tools label{font-size:12px;color:#4f6174;display:flex;align-items:center;gap:6px}.aib46-table-wrap{overflow:auto;border:1px solid #e1e7ed;border-radius:14px;background:#fff;max-height:56vh}.aib46-table{min-width:1680px;width:100%;border-collapse:separate;border-spacing:0}.aib46-table th{position:sticky;top:0;z-index:2;background:#f6f8fa;color:#516274;font-size:10px;text-transform:uppercase;letter-spacing:.02em;padding:9px 8px;border-bottom:1px solid #e1e7ed;white-space:nowrap}.aib46-table td{padding:8px;border-bottom:1px solid #edf0f3;vertical-align:top}.aib46-table input,.aib46-table select{min-height:34px;font-size:12px}.aib46-table .aib46-desc{min-width:230px}.aib46-table .aib46-notes{min-width:260px}.aib46-table .aib46-amount{width:110px}.aib46-table .aib46-date,.aib46-table .aib46-due{width:130px}.aib46-origin{min-width:235px;display:grid;gap:5px}.aib46-origin .origin-supplier,.aib46-origin .origin-worker{display:grid;gap:5px}.aib46-origin .ai-origin-actions{display:flex;gap:5px}.aib46-origin .ai-origin-actions button{border:0;background:transparent;color:#0b6fc5;font-size:10px;cursor:pointer;padding:0}.aib46-category{display:block;margin-top:4px;max-width:160px;color:#718092}.aib46-dup{display:flex;gap:4px;align-items:center;margin-top:5px;font-size:10px;color:#a44716}.aib46-footer{position:sticky;bottom:0;z-index:3;margin-top:12px;padding:12px 0 2px;background:#eef1f4;display:flex;align-items:center;justify-content:space-between;gap:12px}.aib46-footer>span{font-size:11px;color:#657587}.aib46-footer>div{display:flex;gap:8px}.aib46-prefill{display:block;margin-top:6px;color:#247148!important;font-weight:600}.ai-review-modal .modalbox{max-width:min(97vw,1780px)}
@media(max-width:800px){.aib46-head{display:grid}.aib46-stats{justify-content:flex-start}.aib46-tools{align-items:flex-start;display:grid}.aib46-footer{display:grid}.aib46-footer>div{justify-content:flex-end}.aib46-table-wrap{max-height:58vh}}
.aib46-prefill-wrap{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px;flex-wrap:wrap}.aib46-prefill-wrap .aib46-prefill{margin-top:0}.aib46-remove-prefill{padding:5px 8px!important;min-height:30px!important;font-size:11px!important}


/* ObraGestão 8.6.3.47 — compactação do topo da leitura em lote */
.aib47-overview{display:grid;grid-template-columns:minmax(360px,1.05fr) minmax(380px,.95fr);gap:10px;align-items:stretch;margin-bottom:10px}
.aib46-head.compact,.aib46-attachment.compact{margin-bottom:0;min-height:0}
.aib46-head.compact{padding:12px 14px;gap:12px;align-items:center}
.aib46-head.compact b{font-size:13px}
.aib46-head.compact span{font-size:11px;line-height:1.3}
.aib46-stats{gap:6px}
.aib46-stats span{padding:5px 8px;font-size:10.5px}
.aib46-attachment.compact{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr);align-items:center;gap:10px;padding:12px 14px}
.aib46-attachment.compact .aib46-attachment-copy{display:grid;gap:3px;align-self:start}
.aib46-attachment.compact .aib46-attachment-copy b{font-size:13px;color:#18344f}
.aib46-attachment.compact .aib46-attachment-copy small{font-size:11px;line-height:1.3}
.aib46-attachment.compact .aib46-file{padding:9px 10px;min-height:0}
.aib46-attachment.compact .aib46-file>span{font-size:18px}
.aib46-attachment.compact .aib46-file b{font-size:12px}
.aib46-attachment.compact .aib46-file small{font-size:11px}
.aib46-file-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.aib46-file-actions .btn{min-height:34px;padding:0 12px}
.aib46-tools.compact{margin:8px 0 10px;padding:0 2px}
.aib46-tools.compact .searchbox{max-width:360px}
.aib46-table-wrap{max-height:calc(94dvh - 360px);min-height:45dvh}
@media(max-width:1100px){.aib47-overview{grid-template-columns:1fr}.aib46-attachment.compact{grid-template-columns:1fr}.aib46-file-actions{justify-content:flex-start}.aib46-table-wrap{max-height:calc(94dvh - 430px);min-height:40dvh}}
@media(max-width:800px){.aib47-overview{gap:8px}.aib46-head.compact,.aib46-attachment.compact{padding:11px 12px}.aib46-tools.compact{display:grid;gap:8px}.aib46-tools.compact .searchbox{max-width:none;width:100%}.aib46-table-wrap{max-height:calc(94dvh - 470px);min-height:38dvh}}


/* ObraGestão 8.6.3.48 — ajuste fiel ao layout aprovado */
.aib48-overview{display:grid;grid-template-columns:minmax(460px,1.1fr) minmax(420px,.9fr);gap:12px;align-items:stretch;margin-bottom:12px}
.aib48-card{background:#fff;border:1px solid #e3e8ee;border-radius:14px;padding:12px 14px;display:grid;gap:12px;min-height:118px}
.aib48-card-top{display:grid;grid-template-columns:46px minmax(0,1fr);gap:12px;align-items:start}
.aib48-card-icon{width:46px;height:46px;border-radius:14px;background:#eef4ff;color:#215fb0;display:flex;align-items:center;justify-content:center;font-size:24px;line-height:1;border:1px solid #d9e6fb}
.aib48-card-icon.clip{background:#f2f8ff;color:#1d6bc1}
.aib48-card-copy{display:grid;gap:4px;min-width:0}
.aib48-card-copy b{font-size:13px;color:#18344f;line-height:1.25}
.aib48-card-copy span,.aib48-card-copy small{font-size:11px;color:#627386;line-height:1.35}
.aib48-stats{justify-content:flex-start;align-items:center;padding-left:58px}
.aib48-stats span{padding:6px 10px;font-size:11px}
.aib48-attachment-card .aib48-file-row{margin-left:58px;min-height:72px;align-items:center}
.aib48-file-row>div{min-width:0}
.aib48-file-row b{overflow-wrap:anywhere}
.aib48-tools{margin:8px 0 12px;padding:0 2px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.aib48-tools .searchbox{width:100%;max-width:380px;height:48px;border-radius:12px}
.aib48-tools label{font-size:12px;font-weight:500;color:#5a6d80;white-space:nowrap}
.aib48-table-wrap{max-height:calc(94dvh - 340px);min-height:47dvh}
.aib48-table-wrap .aib46-table th{font-size:10px;padding:10px 8px}
.aib48-table-wrap .aib46-table td{padding:6px 8px}
.aib48-table-wrap .aib46-table input,.aib48-table-wrap .aib46-table select{min-height:34px}
.aib48-table-wrap .aib46-origin{gap:4px;min-width:240px}
.aib48-table-wrap .origin-supplier,.aib48-table-wrap .origin-worker{gap:4px}
.aib48-table-wrap .ai-origin-actions{gap:8px;margin-top:2px}
.aib48-table-wrap .ai-origin-actions button{font-size:10px;line-height:1.2}
@media(max-width:1180px){.aib48-overview{grid-template-columns:1fr}.aib48-attachment-card .aib48-file-row,.aib48-stats{margin-left:0;padding-left:0}.aib48-tools{display:grid;gap:8px}.aib48-tools .searchbox{max-width:none}.aib48-table-wrap{max-height:calc(94dvh - 430px);min-height:41dvh}}
@media(max-width:800px){.aib48-card{padding:11px 12px}.aib48-card-top{grid-template-columns:40px minmax(0,1fr);gap:10px}.aib48-card-icon{width:40px;height:40px;border-radius:12px;font-size:21px}.aib48-attachment-card .aib48-file-row{margin-left:0}.aib48-stats{padding-left:0}.aib48-file-row{display:grid;gap:8px}.aib46-file-actions{justify-content:flex-start}.aib48-table-wrap{max-height:calc(94dvh - 470px);min-height:38dvh}}


/* ObraGestão 8.6.3.49 — fidelidade final do layout de leitura em lote */
.ai-review-modal.og-modal-workspace #mb,.ai-review-modal .ai-review-shell{min-height:0!important;height:100%!important;display:flex;flex-direction:column;overflow:hidden!important}
.ai-review-modal .ai-review-top{flex:0 0 auto}
.ai-review-modal #aiPurchasePreview{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.aib49-review{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.aib49-overview{grid-template-columns:minmax(520px,1.15fr) minmax(430px,.85fr);gap:10px;margin-bottom:10px;flex:0 0 auto}
.aib49-summary-card,.aib48-attachment-card{padding:10px 14px;min-height:92px;gap:8px}
.aib49-summary-card .aib48-card-top,.aib48-attachment-card .aib48-card-top{grid-template-columns:40px minmax(0,1fr);gap:10px}
.aib49-summary-card .aib48-card-icon,.aib48-attachment-card .aib48-card-icon{width:40px;height:40px;border-radius:12px;font-size:20px}
.aib49-summary-card .aib48-card-copy b,.aib48-attachment-card .aib48-card-copy b{font-size:12px}
.aib49-summary-card .aib48-card-copy span,.aib48-attachment-card .aib48-card-copy small{font-size:11px;line-height:1.25}
.aib49-stats{padding-left:50px;gap:8px}.aib49-stats span{padding:6px 12px;font-size:11px}
.aib48-attachment-card .aib48-file-row{margin-left:50px;min-height:54px;padding:8px 10px}.aib48-file-row b{font-size:12px}.aib48-file-row small{font-size:11px}
.aib46-file-actions .btn{min-height:30px;padding:0 12px;font-size:11px}
.aib49-tools{margin:6px 0 8px;padding:0;flex:0 0 auto}.aib49-tools .searchbox{height:46px;max-width:350px}.aib49-tools-right{display:flex;align-items:center;gap:24px}.aib49-count{font-size:12px;color:#66798c;white-space:nowrap}
.aib49-table-wrap{flex:1 1 auto;min-height:0;max-height:none!important;height:auto;border-radius:14px;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable both-edges}
.aib49-table{min-width:0!important;width:100%;table-layout:fixed}
.aib49-table th{font-size:10px;padding:9px 8px}.aib49-table td{padding:5px 6px;vertical-align:top}.aib49-table input,.aib49-table select{min-height:34px;height:34px;font-size:12px;padding:0 9px}
.aib49-table th:nth-child(1),.aib49-table td:nth-child(1){width:42px}.aib49-table th:nth-child(2),.aib49-table td:nth-child(2){width:116px}.aib49-table th:nth-child(3),.aib49-table td:nth-child(3){width:110px}.aib49-table th:nth-child(4),.aib49-table td:nth-child(4){width:172px}.aib49-table th:nth-child(5),.aib49-table td:nth-child(5){width:29%}.aib49-table th:nth-child(6),.aib49-table td:nth-child(6){width:27%}.aib49-table th:nth-child(7),.aib49-table td:nth-child(7){width:110px}.aib49-table th:nth-child(8),.aib49-table td:nth-child(8){width:132px}
.aib49-col-check{text-align:center}.aib49-col-validation .c8-validation{white-space:nowrap;font-size:11px;padding:6px 8px}.aib49-col-validation .aib46-dup{margin-top:4px}.aib49-col-date input,.aib49-col-amount input{width:100%}.aib49-col-desc .aib46-desc,.aib49-col-method .aib46-method,.aib49-col-destination .aib46-destination{width:100%}
.aib49-origin{display:grid;gap:4px}.aib49-origin-top{display:flex;gap:6px;align-items:center}.aib49-origin .ais-origin-type{width:102px;flex:0 0 102px}.aib49-origin .origin-supplier,.aib49-origin .origin-worker{display:grid;gap:4px;min-width:0}.aib49-origin .ais-supplier,.aib49-origin .ais-worker,.aib49-origin .ais-branch{width:100%}.aib49-origin .ai-origin-actions{display:flex;gap:8px;flex-wrap:wrap}.aib49-origin .ai-origin-actions button{font-size:10px;border:0;background:transparent;color:#0b6fc5;padding:0;cursor:pointer}.aib49-origin .ais-branch{min-height:30px;height:30px;font-size:11px}
.aib49-col-destination .aib46-category{max-width:none;font-size:10px;line-height:1.2;margin-top:4px}
.aib49-footer{flex:0 0 auto;margin-top:8px;padding:10px 0 0;background:#eef1f4}
@media(max-width:1300px){.aib49-overview{grid-template-columns:1fr}.aib49-stats,.aib48-attachment-card .aib48-file-row{padding-left:0;margin-left:0}.aib49-tools{display:grid;gap:8px}.aib49-tools .searchbox{max-width:none}.aib49-tools-right{justify-content:space-between}.aib49-table-wrap{overflow:auto}.aib49-table{min-width:1120px!important;table-layout:auto}}


/* ObraGestão 8.6.3.50 — layout final publicado, cache-busted */
.modalbox.ai-review-modal.aib50-batch-active{
  height:94dvh!important;
  max-height:94dvh!important;
}
.modalbox.ai-review-modal.aib50-batch-active #mb{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:hidden!important;
}
.modalbox.ai-review-modal.aib50-batch-active .ai-review-shell{
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.modalbox.ai-review-modal.aib50-batch-active .ai-review-top{
  flex:0 0 auto!important;
}
.modalbox.ai-review-modal.aib50-batch-active .c8-helper-note,
.modalbox.ai-review-modal.aib50-batch-active #aiReaderStatus{
  display:none!important;
}
.modalbox.ai-review-modal.aib50-batch-active #aiPurchasePreview{
  flex:1 1 auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-review{
  flex:1 1 auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}

/* Compact upper cards exactly to give the list the dominant area */
.modalbox.ai-review-modal.aib50-batch-active .aib49-overview{
  flex:0 0 auto!important;
  grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr)!important;
  gap:10px!important;
  margin:7px 0 8px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-summary-card,
.modalbox.ai-review-modal.aib50-batch-active .aib48-attachment-card{
  min-height:96px!important;
  padding:10px 12px!important;
  gap:7px!important;
  border-radius:13px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib48-card-top{
  grid-template-columns:38px minmax(0,1fr)!important;
  gap:9px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib48-card-icon{
  width:38px!important;
  height:38px!important;
  border-radius:11px!important;
  font-size:19px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib48-card-copy b{
  font-size:12px!important;
  line-height:1.2!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib48-card-copy span,
.modalbox.ai-review-modal.aib50-batch-active .aib48-card-copy small{
  font-size:10.5px!important;
  line-height:1.25!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-stats{
  padding-left:47px!important;
  gap:7px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-stats span{
  padding:5px 10px!important;
  font-size:10.5px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib48-attachment-card .aib48-file-row{
  margin-left:47px!important;
  min-height:48px!important;
  padding:7px 9px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib46-file-actions .btn{
  min-height:29px!important;
  height:29px!important;
  padding:0 11px!important;
  font-size:10.5px!important;
}

/* Search strip */
.modalbox.ai-review-modal.aib50-batch-active .aib49-tools{
  flex:0 0 auto!important;
  margin:0 0 6px!important;
  min-height:44px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-tools .searchbox{
  height:44px!important;
  max-width:350px!important;
  border-radius:11px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-tools-right{
  gap:22px!important;
}

/* The red area: takes all remaining height and has its own vertical scroll */
.modalbox.ai-review-modal.aib50-batch-active .aib49-table-wrap{
  flex:1 1 0!important;
  min-height:300px!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  border-radius:12px!important;
  scrollbar-gutter:stable!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th{
  padding:7px 6px!important;
  font-size:9.5px!important;
  height:31px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td{
  padding:4px 5px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table input,
.modalbox.ai-review-modal.aib50-batch-active .aib49-table select{
  height:31px!important;
  min-height:31px!important;
  font-size:11px!important;
  padding:0 7px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(1),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(1){width:38px!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(2),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(2){width:100px!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(3),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(3){width:108px!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(4),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(4){width:170px!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(5),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(5){width:29%!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(6),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(6){width:27%!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(7),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(7){width:105px!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-table th:nth-child(8),
.modalbox.ai-review-modal.aib50-batch-active .aib49-table td:nth-child(8){width:125px!important}
.modalbox.ai-review-modal.aib50-batch-active .aib49-origin{
  gap:3px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-origin-top{
  gap:5px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-origin .ais-origin-type{
  width:92px!important;
  flex-basis:92px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-origin .ais-branch{
  height:28px!important;
  min-height:28px!important;
  font-size:10px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-origin .ai-origin-actions{
  gap:6px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-origin .ai-origin-actions button{
  font-size:9.5px!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib46-category{
  font-size:9.5px!important;
  margin-top:3px!important;
}

/* Fixed bottom action strip, matching the approved image */
.modalbox.ai-review-modal.aib50-batch-active .aib49-footer{
  flex:0 0 auto!important;
  margin-top:6px!important;
  padding:8px 0 0!important;
}
.modalbox.ai-review-modal.aib50-batch-active .aib49-footer .btn{
  min-height:40px!important;
}

/* Preserve responsive safety, but desktop gets the no-horizontal-scroll design */
@media(max-width:1300px){
  .modalbox.ai-review-modal.aib50-batch-active .aib49-overview{
    grid-template-columns:1fr!important;
  }
  .modalbox.ai-review-modal.aib50-batch-active .aib49-table-wrap{
    overflow-x:auto!important;
  }
  .modalbox.ai-review-modal.aib50-batch-active .aib49-table{
    min-width:1080px!important;
    table-layout:auto!important;
  }
}

/* 8.6.3.51 - ajustes de altura, blocos e comprovantes */
.aib51-review{display:flex;flex-direction:column;min-height:0;flex:1 1 auto}
.aib51-cards-wrap{border:0!important;background:transparent!important;max-height:none!important;min-height:0;display:flex;flex-direction:column;flex:1 1 auto;overflow:hidden!important}
.aib51-cards-wrap>.c8-scroll-frame{border-color:#dce7f2;background:#fff}
.aib51-cards{display:grid;gap:10px;padding:2px}
.aib51-card{border:1px solid #dce7f2;border-radius:12px;background:#fff;padding:10px 12px;display:grid;gap:8px}
.aib51-card[data-validation='review']{background:#fffaf0;border-color:#ecd39e}
.aib51-card[data-validation='duplicate']{background:#fff6f1;border-color:#efc3b6}
.aib51-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.aib51-check{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#24415f}
.aib51-index{margin-left:auto;font-size:11px;color:#6a7d90;font-weight:700}
.aib51-grid{display:grid;gap:8px}
.aib51-grid-top{grid-template-columns:repeat(4,minmax(0,1fr))}
.aib51-grid-main{grid-template-columns:repeat(4,minmax(0,1fr))}
.aib51-span-2{grid-column:span 2}
.aib51-card .aib46-category{display:block;margin-top:4px;font-size:11px;max-width:none}
.ai-line-receipt{border:1px dashed #c9d7e6;border-radius:10px;background:#f9fcff;padding:8px}
.ai-line-receipt-shell{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ai-line-receipt-current{display:flex;align-items:center;gap:9px;min-width:0;flex:1}
.ai-line-receipt-current>div{display:grid;min-width:0}
.ai-line-receipt-current b,.ai-line-receipt-current small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-line-receipt-current small{color:#6d8199}
.ai-line-receipt-icon{font-size:18px;line-height:1}
.ai-line-receipt-picker{display:flex;flex-direction:column;align-items:flex-start;gap:1px;white-space:nowrap}
.ai-line-receipt-picker small{font-size:10px;color:#6d8199}
.ai-line-receipt-actions{margin-left:auto}
.modalbox.ai-review-modal.aib51-single-active{height:min(90dvh,920px)!important;max-height:90dvh!important}
.modalbox.ai-review-modal.aib51-single-active #aiPurchasePreview,.modalbox.ai-review-modal.aib51-single-active #c8SinglePurchase{display:flex;flex-direction:column;min-height:0;flex:1 1 auto;overflow:hidden}
.modalbox.ai-review-modal.aib51-single-active .aib51-single-scroll{flex:1 1 auto;min-height:0}
.modalbox.ai-review-modal.aib51-single-active .aib51-single-scroll .c8-scroll-body{padding-right:2px}
.modalbox.ai-review-modal.aib51-single-active .aib51-single-wrap{padding:1px 2px 10px}
.modalbox.ai-review-modal.aib51-single-active .purchase-modal-form{min-height:0}
@media(max-width:980px){
  .aib51-grid-top,.aib51-grid-main{grid-template-columns:repeat(2,minmax(0,1fr))}
  .aib51-span-2{grid-column:span 2}
}
@media(max-width:720px){
  .ai-line-receipt-shell{flex-direction:column;align-items:stretch}
  .aib51-grid-top,.aib51-grid-main{grid-template-columns:1fr}
  .aib51-span-2{grid-column:auto}
  .aib51-index{margin-left:0}
}

/* 8.6.3.52 — blocos completos, origem compacta e comprovante reduzido */
.aib52-card{padding:9px 11px!important;gap:7px!important}
.aib52-grid{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:6px 8px!important;align-items:start!important}
.aib52-grid .c85-field{min-width:0!important}
.aib52-grid .c85-field>label{font-size:9.5px!important;margin-bottom:2px!important;color:#607792!important;font-weight:800!important;white-space:nowrap!important}
.aib52-grid .c85-field input,.aib52-grid .c85-field select{width:100%!important;min-width:0!important;height:30px!important;min-height:30px!important;font-size:10.8px!important;padding:3px 6px!important;border-radius:5px!important}
.aib52-grid-secondary,.aib52-grid-payment{margin-top:1px!important}
.aib52-span-2{grid-column:span 2!important}
.aib52-span-3{grid-column:span 3!important}
.aib52-party{display:grid;gap:4px;min-width:0}
.aib52-party-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;min-width:0}
.aib52-party-line .origin-supplier,.aib52-party-line .origin-worker{min-width:0}
.aib52-party-line select,.aib52-branch select{width:100%!important;min-width:0!important;height:30px!important;font-size:10.8px!important}
.aib52-party-line .ai-origin-actions{display:flex!important;align-items:center!important;gap:7px!important;white-space:nowrap!important}
.aib52-party-line .ai-origin-actions button{border:0!important;background:transparent!important;color:#0b6fc5!important;font-size:9.8px!important;font-weight:800!important;padding:0!important;cursor:pointer!important}
.aib52-branch{margin-top:1px!important}
.aib52-receipt-row{margin-top:1px!important}
.aib52-receipt-field{width:100%!important}
.aib52-receipt-field .ai-line-receipt{padding:4px 7px!important;border-radius:8px!important}
.aib52-receipt-field .ai-line-receipt-shell{min-height:34px!important;gap:8px!important}
.aib52-receipt-field .ai-line-receipt-current{gap:6px!important}
.aib52-receipt-field .ai-line-receipt-icon{font-size:15px!important}
.aib52-receipt-field .ai-line-receipt-current b{font-size:10.5px!important}
.aib52-receipt-field .ai-line-receipt-current small{font-size:9px!important}
.aib52-receipt-field .ai-line-receipt-picker{height:29px!important;min-height:29px!important;padding:3px 9px!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;font-size:10px!important}
.aib52-receipt-field .ai-line-receipt-picker small{display:none!important}
.aib52-card .aib46-category{display:none!important}
.c85-span-2{grid-column:span 2!important}
.c85-row4{grid-template-columns:minmax(0,1fr)!important}
.c85-row4 .c85-receipt-field .ai-line-receipt{padding:4px 7px!important}
.c85-row4 .c85-receipt-field .ai-line-receipt-shell{min-height:34px!important}
.c85-row4 .c85-receipt-field .ai-line-receipt-picker{height:29px!important;min-height:29px!important;padding:3px 9px!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important}
.c85-row4 .c85-receipt-field .ai-line-receipt-picker small{display:none!important}
@media(max-width:1180px){
  .aib52-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .aib52-span-2,.aib52-span-3{grid-column:span 3!important}
}
@media(max-width:760px){
  .aib52-grid{grid-template-columns:1fr!important}
  .aib52-span-2,.aib52-span-3{grid-column:auto!important}
  .aib52-party-line{grid-template-columns:1fr!important}
  .aib52-party-line .ai-origin-actions{justify-content:flex-start!important}
}


/* 8.6.3.55 - ajustes consolidados importação IA */
.modalbox.ai-review-modal.aib50-batch-active{height:min(88dvh,860px)!important;max-height:88dvh!important;}
.modalbox.ai-review-modal.aib50-batch-active .aib49-review.aib55-review{padding-top:2px!important;}
.aib55-tabs{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:2px 0 8px;}
.aib55-tab{border:1px solid #dbe5ef;background:#eef5ff;color:#1c5e98;border-radius:999px;padding:8px 12px;font-size:12px;line-height:1;display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-weight:700;}
.aib55-tab.warn{background:#fff6db;color:#8a6400;border-color:#f0dd97;}
.aib55-tab.dup{background:#fff0f0;color:#aa2f34;border-color:#f1c7c9;}
.aib55-tab.active{background:#163d7a;color:#fff;border-color:#163d7a;box-shadow:0 4px 10px rgba(11,44,94,.15);}
.aib55-tools{margin-top:0!important;}
.aib55-cards-wrap{margin-top:2px!important;}
.ai-review-modal #aiQuickEntityDock{flex:0 0 auto;max-height:min(48dvh,460px);overflow-y:auto;overflow-x:hidden;padding-right:4px;margin-top:8px;scrollbar-gutter:stable;}
.ai-review-modal #aiQuickEntityDock:empty{display:none;}
.ai-review-modal #aiQuickEntityDock .actions{position:sticky;bottom:0;background:#f8fbff;padding-top:8px;}
.aib52-party-line .origin-other{min-width:0;}
.aib52-party-line .origin-other input{width:100%!important;min-width:0!important;height:30px!important;font-size:10.8px!important;padding:3px 6px!important;border-radius:5px!important;}
.aib52-party-line .ai-origin-actions[style*='display:none']{display:none!important;}
@media(max-width:900px){.ai-review-modal #aiQuickEntityDock{max-height:min(52dvh,420px);}}


/* 8.6.3.56 - correções de filtro, rolagem e alinhamento */
.aib55-tools{justify-content:flex-end!important;min-height:20px!important}
.aib55-tools .aib49-tools-right{margin-left:auto!important}
.ai-review-modal #aiQuickEntityDock{max-height:min(44dvh,430px)!important;overflow-y:auto!important;overflow-x:hidden!important;padding-right:4px!important;padding-bottom:96px!important;margin:8px 0 6px!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
.ai-review-modal #aiQuickEntityDock .quick-entity-form,
.ai-review-modal #aiQuickEntityDock .quick-supplier-unit-86342{margin-bottom:0!important;padding-bottom:6px!important}
.ai-review-modal #aiQuickEntityDock .actions{position:sticky!important;bottom:0!important;background:#f8fbff!important;padding:10px 0 12px!important;margin-top:10px!important;box-shadow:0 -10px 12px rgba(248,251,255,.98)!important;z-index:3!important}
.ai-review-modal #aiQuickEntityDock .actions .btn{min-height:36px!important}
.quick-entity-form .quick-grid input,
.quick-entity-form .quick-grid select,
.quick-category-line select{height:34px!important;min-height:34px!important;line-height:34px!important;padding-top:0!important;padding-bottom:0!important}
.quick-entity-form .quick-grid .field select[name='entity_type'],
.quick-category-line select{font-size:13px!important}
.quick-entity-form .quick-grid .field select[name='entity_type'] option,
.quick-category-line select option{font-size:13px!important}
@media(max-width:900px){
  .ai-review-modal #aiQuickEntityDock{max-height:min(48dvh,420px)!important;padding-bottom:108px!important}
}


/* 8.6.3.57 — revisão visual e funcional da importação IA */
.modalbox.ai-review-modal.aib50-batch-active{height:min(88dvh,860px)!important;max-height:88dvh!important}
.aib57-review{display:flex!important;flex-direction:column!important;min-height:0!important;flex:1 1 auto!important}
.aib57-tabbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:2px 0 7px;padding:0 1px}
.aib57-tabbar .aib55-tabs{margin:0!important;flex:1 1 auto}
.aib57-select-visible{display:flex;align-items:center;justify-content:flex-end;gap:20px;margin-left:auto;white-space:nowrap;color:#65798e;font-size:12px}
.aib57-select-visible label{display:flex;align-items:center;gap:7px}
.aib57-cards-wrap{flex:1 1 auto!important;min-height:0!important;margin-top:0!important;overflow:hidden!important}
.aib57-cards-wrap .c8-scroll-frame{height:100%!important;min-height:0!important;overflow:hidden!important}
.aib57-cards-wrap .c8-scroll-body{height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;padding-right:3px!important;scrollbar-gutter:stable!important}
.aib57-cards-wrap .c8-hscroll{display:none!important}
.aib57-cards-wrap .aib51-cards{width:100%!important;min-width:0!important;padding:2px 1px 12px!important;box-sizing:border-box!important}
.aib57-card{border:1.5px solid #a9c6e6!important;box-shadow:0 1px 0 rgba(25,72,120,.04)!important}
.aib57-card[data-validation='review']{border-color:#e6b85b!important;background:#fffaf0!important}
.aib57-card[data-validation='duplicate']{border-color:#e59b9e!important;background:#fff7f7!important}
.aib57-footer{background:transparent!important;margin:5px 0 0!important;padding:5px 10px 13px!important;border:0!important;box-shadow:none!important}
.aib57-footer>span{background:transparent!important}
.aib57-footer>div{padding-bottom:2px!important}
.aib57-footer .btn{margin-bottom:2px!important}
.aib57-inline-dock:empty{display:none!important}
.aib57-inline-dock{margin-top:5px;max-height:310px;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;padding-right:3px}
.aib57-inline-dock .quick-entity-form{margin:0!important;border-color:#9ebee0!important;background:#f8fbff!important}
.aib57-inline-dock .actions{position:sticky!important;bottom:0!important;background:#f8fbff!important;padding:9px 0 8px!important;margin-top:8px!important;z-index:2!important}
.aib52-party-line .origin-other{min-width:0!important;display:block}
.aib52-party-line .origin-other[style*='display:none']{display:none!important}
.aib52-party-line .origin-other input{width:100%!important;min-width:0!important;height:30px!important;min-height:30px!important;padding:3px 7px!important;font-size:10.8px!important}
.aib57-category{min-width:0}
.aib57-category-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:center}
.aib57-category-line select{width:100%!important;min-width:0!important}
.aib57-category-add{height:30px;border:0;background:transparent;color:#0b6fc5;font-weight:800;font-size:9.5px;white-space:nowrap;cursor:pointer;padding:0 2px}
.aib57-category-create{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:5px;margin-top:4px;padding:6px;border:1px solid #cbdced;background:#f7fbff;border-radius:7px}
.aib57-category-create[hidden]{display:none!important}
.aib57-category-create input{height:30px!important;min-height:30px!important}
.aib57-category-create .btn{height:30px!important;min-height:30px!important;padding:0 8px!important}
.aib57-category-cancel{border:0;background:transparent;color:#5d7187;font-size:10px;font-weight:700;cursor:pointer}
.quick-entity-form .quick-grid input,.quick-entity-form .quick-grid select,.quick-category-line select{height:34px!important;min-height:34px!important;line-height:normal!important;padding-top:0!important;padding-bottom:0!important;display:block!important}
.quick-entity-form select[name='entity_type'],.quick-category-line select{padding-top:0!important;padding-bottom:0!important;vertical-align:middle!important}
@media(max-width:950px){.aib57-tabbar{align-items:flex-start}.aib57-select-visible{width:100%;justify-content:space-between}.aib57-category-line{grid-template-columns:1fr}.aib57-category-add{text-align:left}}


/* 8.6.3.58 - origem adaptativa para entradas financeiras */
.aib58-origin-type-label,.aib58-origin-party-label{font-size:9.5px!important;margin-bottom:2px!important;color:#607792!important;font-weight:800!important;white-space:nowrap!important;display:block}
.aib58-income-label{color:#17834f!important}
.aib52-grid-secondary .ais-origin-type{width:100%!important;min-width:0!important;height:30px!important;min-height:30px!important;font-size:10.8px!important;padding:3px 6px!important;border-radius:5px!important}
.aib52-grid-secondary .origin-other input{width:100%!important;height:30px!important;min-height:30px!important}


/* 8.6.3.62 — contador e estados persistentes */
.aib62-select-separator{color:#9aaabd;margin:0 2px}
.aib62-selected-count{color:#0b4d8b;font-size:11px;white-space:nowrap}
.aib57-select-visible{gap:9px!important}
