/* AIOTOR ERP V12.7.8 — no-horizontal-scroll enterprise contract.
   Desktop rule: every standard ERP register fits the available viewport width.
   Long business values wrap; action groups wrap; no right-side columns are hidden.
   Mobile may stack/collapse, but standard screens do not require horizontal panning. */

html, body { max-width:100%; overflow-x:hidden !important; }

/* Runtime / CRUD registers */
body.aiotor-runtime-shell .rt-content,
body.aiotor-runtime-shell .rt-main,
body.aiotor-runtime-shell .rt-table-card,
body.aiotor-runtime-shell .rt-table-wrap,
body.aiotor-runtime-shell .rt-screen-toolbar,
body.aiotor-runtime-shell .rt-inline-pager,
body.aiotor-runtime-shell .rt-pager {
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
body.aiotor-runtime-shell .rt-content,
body.aiotor-runtime-shell .rt-main,
body.aiotor-runtime-shell .rt-table-card,
body.aiotor-runtime-shell .rt-table-wrap { overflow-x:hidden !important; }
body.aiotor-runtime-shell .rt-table-wrap > table,
body.aiotor-runtime-shell table.rt-table {
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}
body.aiotor-runtime-shell table.rt-table col,
body.aiotor-runtime-shell .rt-table-wrap > table col { width:auto !important; min-width:0 !important; }
body.aiotor-runtime-shell table.rt-table th,
body.aiotor-runtime-shell table.rt-table td,
body.aiotor-runtime-shell .rt-table-wrap > table th,
body.aiotor-runtime-shell .rt-table-wrap > table td {
  min-width:0 !important;
  max-width:none !important;
  width:auto !important;
  height:auto !important;
  max-height:none !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  vertical-align:top !important;
}
body.aiotor-runtime-shell table.rt-table th { line-height:1.15 !important; }
body.aiotor-runtime-shell table.rt-table td { line-height:1.25 !important; }
body.aiotor-runtime-shell .rt-cell,
body.aiotor-runtime-shell .rt-cell > *,
body.aiotor-runtime-shell .rt-table td > a:not(.rt-btn),
body.aiotor-runtime-shell .rt-table td > span:not(.rt-badge) {
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
}
body.aiotor-runtime-shell .rt-actions,
body.aiotor-runtime-shell .rt-cell-actions,
body.aiotor-runtime-shell .rt-table-actions {
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:flex-start !important;
  gap:3px !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
}
body.aiotor-runtime-shell .rt-actions > *,
body.aiotor-runtime-shell .rt-cell-actions > * { flex:0 1 auto !important; min-width:0 !important; }

/* Give descriptive business columns more room and compress IDs/numbers/actions. */
body.aiotor-runtime-shell table.rt-table th[data-semantic="description"],
body.aiotor-runtime-shell table.rt-table td[data-semantic="description"],
body.aiotor-runtime-shell table.rt-table th[data-semantic="product"],
body.aiotor-runtime-shell table.rt-table td[data-semantic="product"],
body.aiotor-runtime-shell table.rt-table th[data-semantic="customer"],
body.aiotor-runtime-shell table.rt-table td[data-semantic="customer"],
body.aiotor-runtime-shell table.rt-table th[data-semantic="supplier"],
body.aiotor-runtime-shell table.rt-table td[data-semantic="supplier"] { width:18% !important; }
body.aiotor-runtime-shell table.rt-table th[data-semantic="status"],
body.aiotor-runtime-shell table.rt-table td[data-semantic="status"] { width:10% !important; }
body.aiotor-runtime-shell table.rt-table th[data-semantic="actions"],
body.aiotor-runtime-shell table.rt-table td[data-semantic="actions"] { width:13% !important; }

/* Server-rendered CRUD tables */
body.admin-tw .table-card,
body.admin-tw .erp-grid-table,
body.admin-tw .overflow-x-auto,
body.admin-tw .table-wrap,
body.admin-tw main { max-width:100% !important; min-width:0 !important; overflow-x:hidden !important; }
body.admin-tw .table-card table,
body.admin-tw .erp-grid-table table,
body.admin-tw main table {
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}
body.admin-tw table col { width:auto !important; min-width:0 !important; }
body.admin-tw table th,
body.admin-tw table td {
  min-width:0 !important;
  max-width:none !important;
  width:auto !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  vertical-align:top !important;
}
body.admin-tw table td:last-child,
body.admin-tw table th:last-child { min-width:0 !important; width:auto !important; }
body.admin-tw table td .actions,
body.admin-tw table td .toolbar-right,
body.admin-tw table td:last-child > div { flex-wrap:wrap !important; max-width:100% !important; }

/* Order returns historically forced a 980px table. */
body.admin-tw .return-table { overflow-x:hidden !important; max-width:100% !important; }
body.admin-tw .return-table table { min-width:0 !important; width:100% !important; table-layout:fixed !important; }

/* Finance is isolated, but it follows the same no-horizontal-scroll desktop rule. */
body.page-finance-ultimate .finance-main,
body.page-finance-ultimate .fu-shell,
body.page-finance-ultimate .fu-panel,
body.page-finance-ultimate .fu-table-wrap { width:100% !important; max-width:100% !important; min-width:0 !important; overflow-x:hidden !important; }
body.page-finance-ultimate .fu-table,
body.page-finance-ultimate .fu-compact-table,
body.page-finance-ultimate .fu-compliance-table {
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}
body.page-finance-ultimate .fu-table th,
body.page-finance-ultimate .fu-table td {
  min-width:0 !important;
  max-width:none !important;
  width:auto !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  vertical-align:top !important;
}
body.page-finance-ultimate .fu-table td.wrap,
body.page-finance-ultimate .fu-table td[data-semantic="description"],
body.page-finance-ultimate .fu-table td[data-semantic="customer"],
body.page-finance-ultimate .fu-table td[data-semantic="supplier"],
body.page-finance-ultimate .fu-table td[data-semantic="warehouse"] { min-width:0 !important; max-width:none !important; }
body.page-finance-ultimate .fu-actions,
body.page-finance-ultimate .fu-table td:last-child { white-space:normal !important; }

/* B2B CRUD/listing pages: fit desktop viewport, wrap business text, keep all columns visible. */
body.b2b-desk,
body.b2b-desk main,
body.b2b-desk .table-wrap,
body.b2b-desk .b2b-table-wrap { max-width:100% !important; overflow-x:hidden !important; }
body.b2b-desk table { width:100% !important; max-width:100% !important; min-width:0 !important; table-layout:fixed !important; }
body.b2b-desk table th,
body.b2b-desk table td { min-width:0 !important; max-width:none !important; white-space:normal !important; overflow:visible !important; text-overflow:clip !important; overflow-wrap:anywhere !important; word-break:break-word !important; }

/* Navigation may wrap instead of forcing horizontal scroll. */
body.aiotor-runtime-shell .rt-title-actions,
body.aiotor-runtime-shell .rt-toolbar,
body.admin-tw .shell-workbench-nav,
body.admin-tw .shell-workbench-subnav,
body.page-finance-ultimate .finance-subnav,
body.page-finance-ultimate .fu-inline-tabs,
body.page-finance-ultimate .fu-report-tabs {
  overflow-x:hidden !important;
  flex-wrap:wrap !important;
  max-width:100% !important;
}

@media (max-width:980px) {
  body.aiotor-runtime-shell table.rt-table,
  body.admin-tw main table,
  body.page-finance-ultimate .fu-table { font-size:10px !important; }
  body.aiotor-runtime-shell .rt-table th,
  body.aiotor-runtime-shell .rt-table td,
  body.admin-tw table th,
  body.admin-tw table td,
  body.page-finance-ultimate .fu-table th,
  body.page-finance-ultimate .fu-table td { padding:4px 5px !important; }
}
