/* AIOTOR ERP V12.7.23 — single vertical scroll owner + compact procurement truth.
   Normal application pages use the browser document as the only vertical scroll
   owner. Tables may scroll horizontally only when the viewport is genuinely too
   narrow; no ancestor may become a hidden/100vh vertical scroll trap. */
html{
  height:auto!important;min-height:100%!important;max-height:none!important;
  overflow-x:clip!important;overflow-y:auto!important;scroll-behavior:auto!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active),
body.admin-tw:not(.page-settings.page-cat-printstudio),
body.page-finance-ultimate{
  position:static!important;height:auto!important;min-height:100dvh!important;max-height:none!important;
  overflow-x:clip!important;overflow-y:visible!important;overscroll-behavior:auto!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) :is(.rt-app,.rt-platinum-shell,.rt-dashboard,.rt-content,.rt-main),
body.admin-tw:not(.page-settings.page-cat-printstudio) :is(.shared-shell,.shared-shell-content,.shared-shell-body,.content,.main,.page,.page-content),
body.page-finance-ultimate :is(.finance-app-shell,.finance-main,.fu-shell,.fu-content,.fu-view.active){
  height:auto!important;min-height:0!important;max-height:none!important;
  overflow-x:visible!important;overflow-y:visible!important;overscroll-behavior:auto!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-table-card{
  height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-table-wrap{
  height:auto!important;min-height:0!important;max-height:none!important;
  overflow-x:visible!important;overflow-y:visible!important;overscroll-behavior:auto!important;
  scrollbar-gutter:auto!important;
}
/* At narrower widths only the table rail owns horizontal movement. It still has
   no constrained height, therefore it cannot become a second vertical scroller. */
@media (max-width:1180px){
  body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-table-wrap,
  body.admin-tw:not(.page-settings.page-cat-printstudio) :is(.table-wrap,.data-table-wrap,.ops-table-wrap,.inventory-table-wrap),
  body.page-finance-ultimate .fu-table-wrap{
    overflow-x:auto!important;overflow-y:clip!important;max-height:none!important;
    overscroll-behavior-inline:auto!important;-webkit-overflow-scrolling:touch;
  }
}
/* Pending/PO toolbar: controls must remain distinct instead of visually merging
   into strings such as Filter2550100Refresh. */
[data-screen="orders.pending"] .rt-screen-toolbar,
[data-screen="orders.po_register"] .rt-screen-toolbar{gap:6px!important;flex-wrap:wrap!important}
[data-screen="orders.pending"] .rt-screen-toolbar :is(button,a,select,input),
[data-screen="orders.po_register"] .rt-screen-toolbar :is(button,a,select,input){margin:0!important;min-height:30px!important}
/* Batch result stays a summary, not a page-sized report. */
[data-rt-po-batch-progress]{max-width:100%!important;overflow:visible!important}
.rt-po-factory-grid{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))!important;gap:6px!important}
.rt-po-route-exceptions{margin-top:6px!important}
.rt-po-route-exceptions summary{cursor:pointer!important}
.rt-po-exception-scroll{max-height:none!important;overflow:visible!important;border:1px solid #e5eaf1!important;border-radius:6px!important}
.rt-po-exception-scroll table{font-size:10.5px!important}
.rt-po-exception-scroll th,.rt-po-exception-scroll td{padding:4px 6px!important;line-height:1.25!important}


/* V12.7.23 — hard release of legacy viewport locks. Normal runtime pages must
   scroll from any pointer location without first focusing a nested panel. */
body.aiotor-runtime-shell:not(.rt-order-entry-active) :is(.rt-app,.rt-platinum-shell,.rt-dashboard,.rt-content,.rt-main,.rt-table-card,.rt-table-wrap){
  position:static!important;
  top:auto!important;bottom:auto!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-dashboard{
  display:block!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-main{
  display:block!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-table-card{
  display:block!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active) .rt-table-wrap{
  touch-action:pan-y pan-x!important;
}
.rt-po-batch-compact{padding:5px 7px!important;margin:4px 6px!important}
.rt-po-batch-compact-line{display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important;min-height:30px!important}
.rt-po-batch-compact-line>b{font-size:11px!important}
.rt-po-batch-compact-line>span{font-size:11px!important;font-weight:800!important}
.rt-po-batch-compact-line>em{font-size:10px!important;color:#64748b!important;margin-right:auto!important}
.rt-po-batch-compact-line :is(a,button){min-height:26px!important;padding:3px 8px!important;font-size:10px!important}
.rt-po-batch-compact .rt-po-route-exceptions{width:100%!important;margin-top:4px!important}
.rt-po-batch-compact .rt-po-exception-scroll{max-height:180px!important;overflow:auto!important}

/* V12.7.24 — manual PO supplier route selector. The row action is allowed to
   choose an explicit Supplier Master route for legacy demand instead of
   returning a false success and then showing Create PO again. */
.rt-po-route-selector{max-width:560px!important;width:min(560px,calc(100vw - 28px))!important}
.rt-po-route-field{grid-column:1/-1;padding:10px 12px;border:1px solid #dbe5ef;border-radius:9px;background:#f8fbfe}
.rt-po-route-field label{display:grid;gap:5px;font-size:12px;font-weight:800;color:#1f334d}
.rt-po-route-field select{width:100%;min-height:38px;border:1px solid #b8c8d9;border-radius:7px;background:#fff;padding:7px 9px;font:600 12px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172b45}
.rt-po-route-field small{display:block;margin-top:6px;font-size:10.5px;line-height:1.35;color:#5a6b7e}
