/* Larger module navigation. Keep every permitted module reachable by scrolling. */
html body #erp-module-navigation.module-nav {
 overflow-y:auto!important; overscroll-behavior:contain;
}
html body #erp-module-navigation.module-nav button[data-view] {
 flex:0 0 auto!important; min-height:54px!important; max-height:none!important;
 padding:14px 16px!important; font-size:16px!important; line-height:24px!important;
 text-align:left!important; white-space:normal!important;
}
html body #erp-module-navigation.module-nav button[data-view] .module-icon {font-size:21px!important;flex-shrink:0}
@media(max-width:980px) {
 html {scroll-padding-top:calc(var(--erp-mobile-header,160px) + 12px)}
 html body {min-width:0!important;overflow-x:clip!important}
 html body>main,html body .view {min-width:0!important;max-width:100%!important;box-sizing:border-box}
 html body>main {padding:16px 12px 32px!important}
 html body #erp-module-navigation.module-nav {padding:60px 12px 24px!important;padding-bottom:calc(24px + env(safe-area-inset-bottom))!important}
 html body #erp-module-navigation.module-nav button[data-view] {min-height:54px!important;font-size:16px!important;font-weight:700!important}
 html body :is(.panel,.sc,.qh,.ua,.metric-group,.contract-card,.contract-box) {min-width:0!important;max-width:100%!important;box-sizing:border-box}
 html body :is(.page-head,.cs-heading,.inventory-hero,.qh-heading,.ua-header,.panel-head) {flex-wrap:wrap!important;gap:12px!important}
 html body :is(.form-grid,.sc-fields,.qh-fields,.qh-item-fields,.ua-fields,.ua-form-grid,.profile-form,.hr-form,.req-form,.fields,.filters,.supplier-profile-grid,.contract-facts) {grid-template-columns:minmax(0,1fr)!important;min-width:0!important}
 html body :is(.form-grid,.sc-fields,.qh-fields,.ua-form-grid,.profile-form,.hr-form,.req-form)>* {min-width:0!important;grid-column:1!important}
 html body :is(.sc-metrics,.qh-metrics,.ua-stats,.academy-stats,.hr-summary,.mini-metrics) {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 html body :is(.qh-selected-items,.qh-ppe-options,.lerp-hr-hub,.grid-even,.grid-2,.meal-bars,.portfolio) {grid-template-columns:minmax(0,1fr)!important}
 html body :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {min-width:0!important;max-width:100%!important;box-sizing:border-box!important;font-size:16px!important}
 html body label {min-width:0;overflow-wrap:anywhere}
 html body :is(input[type=checkbox],input[type=radio]) {width:20px!important;height:20px!important;min-height:20px!important;flex:0 0 20px}
 html body button:not(.icon):not([aria-label="Close"]):not([data-close]):not(.sidebar-toggle):not(.nav-toggle):not(.mobile-menu-backdrop), html body input[type=submit],html body input[type=button] {min-height:44px!important;touch-action:manipulation}
 html body :is(.actions,.form-actions,.cs-row-actions,.inventory-hero-actions,.req-report-actions) {display:flex;flex-wrap:wrap!important;gap:8px!important;max-width:100%}
 html body :is(.sc-stock-row-status,.sc-stock-row-status .cs-row-actions) {flex-wrap:wrap!important;white-space:normal!important}
 html body #view-stores :is(.cs-categories button,#inventory-nav button,.cs-heading button,.inventory-hero-actions button) {height:auto!important;min-height:44px!important;white-space:normal!important}
 html body :is(.sc-scroll,.table-wrap,.qh-scroll,.ua-table-wrap,.table-scroll) {width:100%!important;min-width:0!important;max-width:100%!important;overflow-x:auto!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 html body table:not(.portal-table) {display:block;max-width:100%!important;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 html body :is(th,td) {line-height:1.5!important}
 html body :is(.contract-module-tabs,.contract-inner-tabs,.hr-tabs,.qh-tabs,.ua-tabs,#inventory-nav) {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 html body :is(dialog,.sc-dialog,.qh-modal,.req-dialog) {box-sizing:border-box!important;width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;margin:calc(var(--erp-mobile-header,160px) + 8px) auto 8px!important;max-height:calc(100dvh - var(--erp-mobile-header,160px) - 16px)!important;padding:16px!important;overflow:auto!important;overscroll-behavior:contain}
 html body :is(.modal-backdrop,.history-overlay,.hr-modal,.profile-modal) {padding:8px!important;padding-top:calc(var(--erp-mobile-header,160px) + 8px)!important;place-items:start center!important;z-index:11000!important;box-sizing:border-box!important}
 html body :is(.modal,.history-box,.hr-modal-card,.profile-card,.rate-modal-box,.bd-report-modal) {box-sizing:border-box!important;width:100%!important;max-width:100%!important;max-height:calc(100dvh - var(--erp-mobile-header,160px) - 16px)!important;overflow:auto!important}
 html body :is(dialog>header,.modal-head,.hr-modal-head,.qh-modal>header,.req-dialog>header) {position:sticky!important;top:-16px!important;background:var(--surface,#fff)!important;z-index:2!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px;padding:12px 0!important}
 html body :is(dialog>header h2,.modal-head h2,.hr-modal-head h2) {min-width:0;font-size:20px!important;line-height:1.3!important}
 html body :is([data-close],.close,.modal-close) {flex-shrink:0!important;min-width:44px!important;min-height:44px!important}
 html body iframe {width:100%!important;max-width:100%!important}
 html body .toast {left:12px!important;right:12px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;max-width:calc(100% - 24px);box-sizing:border-box}
}
@media(max-width:380px) {
 html body :is(.kpis,.meal-summary,.sc-metrics,.qh-metrics,.ua-stats,.academy-stats,.hr-summary,.mini-metrics) {grid-template-columns:minmax(0,1fr)!important}
}
@media(prefers-reduced-motion:reduce) {
 html body :is(.view,.module-nav,button) {animation:none!important;transition:none!important}
}

/* Settings belongs to the signed-in profile; the desktop menu fits its viewport. */
html body #erp-module-navigation button[data-view="settings"]{display:none!important}
.profile-name-line{display:flex;align-items:center;gap:8px;min-width:0}
.profile-name-line b{flex:1;min-width:0}
html body #profile-menu .profile-settings-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;min-height:34px;padding:0;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--accent);font-size:21px;cursor:pointer}
@media(min-width:981px){
 html body #erp-module-navigation.module-nav{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important;gap:0!important}
 html body #erp-module-navigation.module-nav button[data-view]{flex:1 1 0!important;min-height:0!important;max-height:54px!important;margin:0!important;padding:2px 10px!important;font-size:clamp(12px,1.85vh,16px)!important;line-height:1.15!important;white-space:nowrap!important}
 html body #erp-module-navigation.module-nav button[data-view] .module-icon{font-size:clamp(16px,2.2vh,21px)!important}
}
