/* AIOTOR ERP V12.7.27 — native document scroll + PO route truth.
   This file MUST be the final ERP layout cascade layer. */

html:has(body.aiotor-runtime-shell:not(.rt-order-entry-active):not(.page-cat-printstudio)),
html:has(body.admin-tw:not(.page-cat-printstudio)){
  height:auto!important;
  min-height:100%!important;
  max-height:none!important;
  overflow-x:clip!important;
  overflow-y:scroll!important;
  overscroll-behavior:auto!important;
  scrollbar-gutter:auto!important;
  scroll-behavior:auto!important;
}
body.aiotor-runtime-shell:not(.rt-order-entry-active):not(.page-cat-printstudio),
body.admin-tw:not(.page-cat-printstudio){
  height:auto!important;
  min-height:100vh!important;
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
  scrollbar-gutter:auto!important;
  touch-action:pan-y pinch-zoom!important;
}

/* Reset overflow as a shorthand. Leaving overflow-x:hidden from an older layer
   makes overflow-y:visible compute back to auto, recreating an inner scroll owner. */
body.aiotor-runtime-shell:not(.rt-order-entry-active):not(.page-cat-printstudio)
:is(.rt-app,.rt-platinum-shell,.rt-dashboard,.rt-content,.rt-main,.rt-table-card,.rt-screen,.rt-screen-body,.rt-workspace,.rt-page,.page-shell,.content-shell,.app-shell),
body.admin-tw:not(.page-cat-printstudio)
:is(.app-shell,.main,.main-full,.shared-shell-main,.shared-shell-content,.shared-shell-body,.tabs.active,.page-shell,.content-shell){
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
  scrollbar-gutter:auto!important;
  touch-action:pan-y pinch-zoom!important;
  contain:none!important;
}

body.aiotor-runtime-shell:not(.rt-order-entry-active):not(.page-cat-printstudio)
:is(.rt-table-wrap,.table-wrap,.table-responsive,.data-table-wrap),
body.admin-tw:not(.page-cat-printstudio)
:is(.rt-table-wrap,.table-wrap,.table-responsive,.data-table-wrap,.ops-table-wrap){
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  overscroll-behavior-x:contain!important;
  overscroll-behavior-y:auto!important;
  scrollbar-gutter:auto!important;
  touch-action:pan-x pan-y pinch-zoom!important;
}

.rt-loading .rt-table-card:after,
.rt-loading .rt-table-wrap:after,
.rt-runtime-progress,
.rt-backend-load-progress,
#globalBusyBar{
  pointer-events:none!important;
}
.rt-loading .rt-table-card{overflow:visible!important}

[data-screen="orders.pending"] tr[data-po-state="failed"] td[data-col-key="status"] .tone-warning{
  background:#fff4d8!important;
  color:#825b00!important;
}
