/* Every application data grid owns both axes; never rely on the form's scrollbar. */
/* Keep all grid column labels black across skins and account text preferences,
   including lookup/BOM headers and report sorting buttons. */
@media screen {
 body :is(th,[role="columnheader"],.unit-grid-heading),
 body :is(th,[role="columnheader"],.unit-grid-heading) :is(span,button,label) {
  color:#000!important;
 }
}
body :is(.purchase-request-grid,.quality-grid,.opening-stock-grid,.bulk-master-grid,
.cash-lines,.journal-lines,.closepo-grid,.bill-grid,.request-grid-scroll,.production-grid-wrap,
.bom-grid,.product-child-grid,.product-record-grid,.finance-grid,.master-list,.account-bills,
.report-grid-scroll,.production-mrp-grid,.unit-grid,.rights-table,.user-access-table,
.topten-results,.locksmith-catalog,.bom-flow-body,[data-entry-grid],[data-grid-scroll]) {
 min-width:0;max-width:100%;overflow:scroll!important;
 scrollbar-width:auto;scrollbar-color:#8d9b92 #e8ede5;scrollbar-gutter:stable;
}
body [data-grid-scroll]{max-height:min(420px,55dvh);min-height:100px;box-sizing:border-box}
/* The measured entry-grid minimum must not restore overflow:auto over these tracks. */
body .entry-screen .entry-four-row-grid{overflow:scroll!important}
body [data-grid-scroll]>table{width:max-content;min-width:100%;margin:0}
body [data-grid-scroll]>table th{position:sticky;top:0;z-index:1}
body :is([data-grid-scroll],.locksmith-catalog) :is(th,td){white-space:nowrap}
body .stock-adjustment-search .unit-grid{min-width:0!important}
body .stock-adjustment-search .unit-grid-row{min-width:1025px}
body .stock-adjustment-search .unit-grid-heading{min-width:0!important;overflow:hidden;scrollbar-gutter:stable}
.report-grid-toolbar{flex:0 0 auto;max-height:28dvh;overflow:auto}
/* Long item descriptions must occupy their own column instead of painting over stock values. */
body .report-results-workbench .report-result-table td{max-width:none;overflow:hidden}
/* Only displayed when an outer scroll area clips the grid's own bottom bar.
   It controls the existing grid; it does not move Blazor-owned rows or controls. */
.grid-bottom-scrollbar{position:fixed;display:none;height:18px;overflow-x:scroll;overflow-y:hidden;
 box-sizing:border-box;background:#e8ede5;border:1px solid #aebbb1;z-index:1900;
 scrollbar-width:auto;scrollbar-color:#8d9b92 #e8ede5}
.grid-bottom-scrollbar>div{height:1px;pointer-events:none}
body :is([data-grid-scroll],.grid-bottom-scrollbar,.purchase-request-grid,.quality-grid,
.opening-stock-grid,.bulk-master-grid,.closepo-grid,.bill-grid,.bom-grid,.product-child-grid,
.finance-grid,.master-list,.account-bills,.report-grid-scroll,.production-mrp-grid,.unit-grid,
.rights-table,.topten-results,.locksmith-catalog)::-webkit-scrollbar{width:16px;height:16px}
body ::-webkit-scrollbar-track{background:#e8ede5}
body ::-webkit-scrollbar-thumb{background:#8d9b92;border:3px solid #e8ede5;border-radius:8px}
@media print{.grid-bottom-scrollbar{display:none!important}body [data-grid-scroll]{overflow:visible!important;max-height:none;min-height:0}}

body :is(.financial-grid,.daily-grid,.city-grid,.lookup-grid,.lookup-scroll,.bulk-grid,.stock-grid,.user-list,.user-rights-table){min-width:0;max-width:100%;overflow:scroll!important;scrollbar-gutter:stable;scrollbar-color:#8d9b92 #e8ede5}body .sgac-data-grid{max-height:min(320px,38dvh);overflow:scroll;scrollbar-gutter:stable;margin:6px 0}

body :is(.financial-grid,.daily-grid,.city-grid,.lookup-grid,.lookup-scroll,.bulk-grid,.stock-grid,.user-list,.user-rights-table){min-width:0;max-width:100%;overflow:scroll!important;scrollbar-gutter:stable;scrollbar-color:#8d9b92 #e8ede5}body .sgac-data-grid{max-height:min(320px,38dvh);overflow:scroll;scrollbar-gutter:stable;margin:6px 0}

body :is(.daily-report-grid,.user-grid,.rights-grid){min-width:0;max-width:100%;overflow:scroll;scrollbar-gutter:stable}
