/* Keep the signed-in workspace within its viewport while allowing dense records
   to scroll inside their own panels. The sign-in screen has separate styles. */
body.app-ready main,
body.app-ready main .page,
body.app-ready main .page > *,
body.app-ready main .card,
body.app-ready main .grid > *,
body.app-ready main .cards > * {
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
}

/* The command title may be long (for example, Material Tracking History). */
body.app-ready #bc-command-bar {width:100%;box-sizing:border-box;min-width:0}
body.app-ready #bc-command-bar .bc-command-left {flex:1 1 auto;min-width:0}
body.app-ready #bc-command-bar .bc-command-copy {min-width:0}
body.app-ready #bc-command-bar .bc-command-copy strong,
body.app-ready #bc-command-bar .bc-command-copy small {
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.app-ready #bc-command-bar .bc-command-right {flex:0 0 auto;min-width:0}

/* Existing code places tables into .bc-table-shell, including newly rendered
   tables. Scrolling the shell preserves readable columns and actions. */
body.app-ready main .bc-table-shell,
body.app-ready main :is(.market-table-scroll,.bcp-vendor-table-wrap,.bc-acct-table-wrap,
  .bc-wh-table-wrap,.bc-me-table-wrap,.recon-table-wrap,.audit-table-wrap,
  .erp-table-card,.erp-line-wrap,.bc-gm-tablewrap) {
  box-sizing:border-box;max-width:100%;overflow-x:auto!important;
  overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;
}
body.app-ready main .page:not(#bcCalendarPage):not(#hrEmployeesPage)
  .bc-table-shell:has(thead th:nth-child(5)) > table:not(.bc-record-table) {
  min-width:720px!important;max-width:none!important;table-layout:auto!important;
}
body.app-ready main .page:not(#bcCalendarPage):not(#hrEmployeesPage)
  .bc-table-shell:has(thead th:nth-child(8)) > table:not(.bc-record-table) {
  min-width:920px!important;
}
body.app-ready #vendors .bcp-vendor-table-wrap table {
  min-width:1560px!important;max-width:none!important;table-layout:fixed!important;
}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(1){width:14%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(2){width:10%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(3){width:11%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(4){width:14%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(5){width:16%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(6){width:14%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(7){width:11%}
body.app-ready #vendors .bcp-vendor-table-wrap th:nth-child(8){width:10%}
body.app-ready #vendors .bcp-vendor-table-wrap td:nth-child(3){
  white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;
  font-variant-numeric:tabular-nums;
}
body.app-ready #vendors .bc-vendor-bank{line-height:1.35}
body.app-ready #vendors .bc-vendor-bank b{display:block}
body.app-ready #vendors .bc-vendor-bank small{display:block;margin-top:2px}
body.app-ready #vendors .bc-vendor-empty-bank{color:#718592}
body.app-ready #vendors .bcp-vendor-table-wrap td:last-child{white-space:nowrap!important}
body.app-ready #vendors .bcp-vendor-table-wrap td:last-child button{margin:2px 3px 2px 0}
body.app-ready #prices .market-table-scroll table {
  min-width:1000px!important;max-width:none!important;table-layout:auto!important;
}
/* The calendar and the narrow-screen employee cards fit their container. */
body.app-ready #bcCalendarPage .bc-cal-table {
  min-width:0!important;max-width:100%!important;
}
@media(max-width:1440px){
  body.app-ready #hrEmployeesPage .bc-hr-table-wrap {overflow:visible!important}
  body.app-ready #hrEmployeesPage .bc-employee-table {min-width:0!important;max-width:100%!important}
}
@media(min-width:1441px){
  body.app-ready #hrEmployeesPage .bc-hr-table-wrap {overflow-x:auto!important}
  body.app-ready #hrEmployeesPage .bc-employee-table {
    min-width:1720px!important;max-width:none!important;table-layout:fixed!important;
  }
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(1){width:6%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(2){width:14%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(3){width:19%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(4){width:10%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(5){width:11%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(6){width:7%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(7){width:10%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(8){width:8%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(9){width:7%}
  body.app-ready #hrEmployeesPage .bc-employee-table th:nth-child(10){width:8%}
  body.app-ready #hrEmployeesPage .bc-emp-person,
  body.app-ready #hrEmployeesPage .bc-emp-person > div,
  body.app-ready #hrEmployeesPage .bc-emp-contact {min-width:0!important;max-width:100%}
  body.app-ready #hrEmployeesPage .bc-emp-person strong,
  body.app-ready #hrEmployeesPage .bc-emp-contact span,
  body.app-ready #hrEmployeesPage .bc-emp-contact small {
    display:block;white-space:normal!important;overflow-wrap:anywhere!important;
    word-break:normal!important;line-height:1.35;
  }
}

@media(max-width:1180px){
  body.app-ready :is(.bc-gm-kpis,.bc-hr-kpis-pro) {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.app-ready :is(.bc-wh-kpis,.bc-wh-report-grid,.bc-acct-kpis,.bc-hr-kpis,.erp-stat-row) {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.app-ready .erp-page-head {flex-wrap:wrap;align-items:flex-start}
  body.app-ready .pr-head-actions {margin-left:0;flex-wrap:wrap}
}
@media(max-width:900px){
  body.app-ready main {padding-inline:14px!important}
  body.app-ready section.page .toolbar,
  body.app-ready section.page .erp-toolbar {
    display:flex;flex-wrap:wrap!important;overflow:visible!important;
  }
  body.app-ready section.page .toolbar > *,
  body.app-ready section.page .erp-toolbar > * {min-width:0;max-width:100%}
  body.app-ready .erp-form {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.app-ready .erp-bottom-grid {grid-template-columns:1fr!important}
}
@media(max-width:620px){
  body.app-ready main {padding:16px 10px 30px!important}
  body.app-ready .main-header .brandbar {padding-left:60px!important;padding-right:8px!important}
  body.app-ready #bc-command-bar {gap:5px;padding-inline:0}
  body.app-ready #bc-command-bar .bc-command-copy {display:none}
  body.app-ready #bc-command-bar .bc-command-right {margin-left:auto;gap:6px}
  body.app-ready #bc-command-bar .bc-signed-user {max-width:min(42vw,150px)}
  body.app-ready #bc-command-bar .bc-header-icon {flex:0 0 36px}
  body.app-ready .page h2 {overflow-wrap:anywhere}
  body.app-ready :is(.bc-gm-kpis,.bc-hr-kpis-pro) {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.app-ready section.page .toolbar > :is(input,select,textarea),
  body.app-ready section.page .erp-toolbar > :is(input,select,textarea) {
    flex:1 1 100%!important;width:100%!important;
  }
  body.app-ready .erp-form {grid-template-columns:1fr!important}
  body.app-ready .erp-form .span-2 {grid-column:auto}
  body.app-ready .modal {padding:8px!important;align-items:flex-start!important;overflow-y:auto!important}
  body.app-ready .modalbox {width:100%!important;max-height:calc(100dvh - 16px)!important;box-sizing:border-box}
}
@media(max-width:430px){
  body.app-ready #bc-command-bar .bc-signed-user {max-width:115px}
  body.app-ready #bc-command-bar #bc-refresh-view {display:none}
  body.app-ready :is(.bc-gm-kpis,.bc-hr-kpis-pro,.bc-wh-kpis,.bc-wh-report-grid,
    .bc-acct-kpis,.bc-hr-kpis,.erp-stat-row) {grid-template-columns:1fr!important}
}
