/* Use the existing ERP page controls and typography for the added modules. */
@media screen {
 html body #cj-native-route-layer {font-family:"Segoe UI",Roboto,Arial,sans-serif;font-size:14px!important;line-height:1.5;background:#f4f6f9!important;color:#172b40}
 html body .cj-native-module-launcher {font:inherit;background:#f4f6f9!important}
 html body .cj-native-module-head {background:#fff!important;border:1px solid #e2e8f0!important;border-radius:8px!important;padding:12px!important;gap:12px!important}
 html body .cj-native-module-title strong {font-size:16px!important;font-weight:600!important;line-height:1.5!important}
 html body .cj-native-module-title small {font-size:12px!important;color:#526276!important}
 html body .cj-native-module-search {min-width:0!important;max-width:100%;border:1px solid #64748b!important;border-radius:6px!important;background:#fff!important}
 html body .cj-native-module-search input {font:inherit!important;min-width:0;width:100%;min-height:36px;box-sizing:border-box}
 html body .cj-native-module-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;margin-top:12px!important}
 html body .cj-native-module-card {border:1px solid #e2e8f0!important;border-radius:8px!important;background:#fff!important;min-width:0}
 html body .cj-native-module-card>header {padding:10px 12px!important;font-size:13px!important;line-height:1.5!important}
 html body .cj-native-module-item {font-family:inherit!important;font-size:14px!important;line-height:1.5!important;padding:8px 12px!important;min-height:36px!important;box-sizing:border-box;border:1px solid #e2e8f0!important;border-radius:6px!important;background:#fff!important;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#172b40!important}
 html body .cj-native-module-item:hover {background:#eef3f8!important;border-color:#0b68aa!important}
 html body #cj-native-route-layer :is(.cj-action-btn,.cj-business-actions button,.cj-form-grid input:not([type=checkbox]):not([type=radio]),.cj-form-grid select,.cj-form-grid textarea) {font-family:inherit;font-size:14px!important;line-height:1.5}
 html body #cj-native-route-layer :is(.cj-action-btn,.cj-business-actions button) {min-height:36px;box-sizing:border-box;border-radius:6px;padding:7px 12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none}
 html body #cj-native-route-layer :is(button,a,input,select,textarea):focus-visible {outline:2px solid #0b68aa;outline-offset:2px}
 html body #cj-native-route-layer :is(button:disabled,[aria-disabled=true]) {cursor:not-allowed;opacity:.55}
 html body #cj-native-route-layer .cj-business-table {font-family:inherit;font-size:14px!important;line-height:1.5}
 html body #cj-native-route-layer :is(.cj-empty,.cj-page-empty) {font:inherit;padding:24px 16px;text-align:center;color:#526276;border:1px solid #e2e8f0;border-radius:8px;background:#fff}
 html body #cj-native-route-layer .cj-stat-card h3 {overflow-wrap:anywhere}
}
@media screen and (max-width:700px) {
 html body .cj-native-module-grid {grid-template-columns:minmax(0,1fr)!important}
 html body .cj-native-module-head {flex-wrap:wrap!important}
 html body .cj-native-module-search {width:100%!important;flex-basis:100%!important;margin-left:0!important}
 html body .cj-native-module-item,html body .page-modal-body button:has(.menu-label) {min-height:44px!important}
 html body #cj-native-route-layer :is(.cj-action-btn,.cj-business-actions button) {min-height:44px}
 html body .page-modal-body {padding-bottom:20px!important}
 html body #cj-native-route-layer {padding-bottom:20px!important;overscroll-behavior:contain}
}
@media screen {
 html body #cj-native-route-layer .cj-native-module-head .cj-native-module-title strong {color:#172b40!important;opacity:1!important}
 html body #cj-native-route-layer .cj-native-module-head .cj-native-module-title small {color:#526276!important;opacity:1!important}
 html body #cj-native-route-layer .cj-native-module-head .cj-native-module-folder {background:#eef3f8!important;color:#073e76!important}
 html body #cj-native-route-layer .cj-native-module-head .cj-native-module-folder svg {fill:#073e76!important;color:#073e76!important}
 html body #cj-native-route-layer .cj-native-module-head .cj-native-module-search>span {color:#526276!important;opacity:1!important}
}
/* One scroll owner and one window geometry for both renderer families. */
@media screen {
 html body .page-modal-body:has(>#cj-native-route-layer)>:not(#cj-native-route-layer){display:none!important}
 html body .page-modal-body>#cj-native-route-layer{position:relative!important;inset:auto!important;width:100%!important;height:auto!important;min-height:100%;overflow:visible!important;z-index:auto!important;visibility:visible!important;pointer-events:auto!important}
 html body .page-modal-body{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;box-sizing:border-box}
}
@media screen and (max-width:700px){
 html body{--cj-window-bottom:var(--cj-bottom-space,0px)}
 html body.cj-keyboard-open{--cj-window-bottom:0px}
 html body .page-modal-overlay:not(.is-minimized){inset:56px 0 var(--cj-window-bottom)!important;height:calc(100dvh - 56px - var(--cj-window-bottom))!important}
 html body .page-modal-overlay:not(.is-minimized) .page-modal-window{height:100%!important;max-height:100%!important;min-height:0!important;margin:0!important;width:100%!important;max-width:100%!important}
 html body .page-modal-overlay:not(.is-minimized) .page-modal-body{min-height:0;min-width:0;max-width:100%;box-sizing:border-box}
}
@media screen {
 html body .cj-business-modal :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font:inherit;min-height:36px;box-sizing:border-box}
 html body .cj-business-modal button{min-height:36px;font:inherit}
 html body .cj-business-modal :focus-visible{outline:2px solid #0b68aa;outline-offset:2px}
}
@media screen and (max-width:700px){html body .cj-business-modal button,html body .cj-business-modal :is(input:not([type=hidden]),select){min-height:44px}}
@media screen {
 html body .page-modal-body .cj-read-state{margin:12px;padding:16px;min-height:52px;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:8px;background:#fff;color:#526276;font:14px/1.5 "Segoe UI",Roboto,Arial,sans-serif;text-align:center}
 html body .page-modal-body .cj-read-error{display:flex;justify-content:center;align-items:center;gap:12px;color:#8f1515;border-color:#f3b7b7}
 html body .page-modal-body .cj-read-state button{padding:8px 14px;border:1px solid #64748b;border-radius:6px;background:#fff;color:#17375e;font:inherit;cursor:pointer;min-height:36px}
}
@media screen and (max-width:700px){html body .page-modal-body .cj-read-state button{min-height:44px}}
@media print{.cj-read-state{display:none!important}}

/* Shared operational controls: native React tables and additional-module tables. */
@media screen {
 html body .page-modal-body :is(.cj-data-table,.cj-business-table,.MuiTable-root){font-family:"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;width:100%;border-collapse:collapse}
 html body .page-modal-body :is(.cj-data-table,.cj-business-table,.MuiTable-root) :is(th,td){font-family:inherit;font-size:inherit;line-height:inherit;padding:8px 10px;vertical-align:middle;box-sizing:border-box}
 html body #cj-native-route-layer :is(.cj-business-toolbar,.cj-business-actions){min-width:0;gap:8px}
 html body #cj-native-route-layer .cj-business-actions :is(button,.cj-action-btn){min-height:36px;font-size:14px;line-height:1.5;padding:7px 12px;box-sizing:border-box}
 html body #cj-native-route-layer .cj-module-tabs{gap:0;max-width:100%;flex-wrap:wrap}
 html body #cj-native-route-layer .cj-tab-link{font-size:14px;line-height:1.5;min-height:36px;box-sizing:border-box}
 html body #cj-native-route-layer :is(.cj-table-wrap,.cj-table-scroll){max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain}
 html body #cj-native-route-layer [data-business-body]{min-width:0;max-width:100%}
}
@media screen and (max-width:700px){
 html body #cj-native-route-layer :is(.cj-business-actions button,.cj-action-btn,.cj-tab-link){min-height:44px;font-size:14px}
 html body #cj-native-route-layer .cj-business-toolbar{justify-content:flex-start}
 html body #cj-native-route-layer .cj-business-actions{width:100%;gap:8px}
 html body #cj-native-route-layer .cj-form-grid :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important;min-height:44px}
}

/* The same native mobile content inset and visible navigation on both route families. */
@media screen and (max-width:700px){
 html body .page-modal-overlay:not(.is-minimized) .page-modal-body{padding:12px!important}
}
@media screen and (max-width:600px){
 html body #cj-mobile-navigation{visibility:visible!important;pointer-events:auto!important}
}

@media screen and (max-width:700px){
 html body .page-modal-taskbar-root{bottom:calc(var(--cj-window-bottom,0px) + 12px)!important;left:12px;max-width:calc(100vw - 24px);visibility:visible!important}
 html body .page-modal-taskbar-chip{min-height:44px;box-sizing:border-box;font-size:14px}
}

@media screen {
 html body #cj-native-route-layer .cj-filter-btn{font-family:inherit;font-size:14px;line-height:1.5;min-height:36px;padding:7px 12px;box-sizing:border-box}
 html body #cj-native-route-layer [data-doc-result-region][hidden]{display:none!important}
 html body #cj-native-route-layer .cj-table-wrap:focus-visible{outline:2px solid #0b68aa;outline-offset:2px}
}
@media screen and (max-width:700px){html body #cj-native-route-layer .cj-filter-btn{min-height:44px}}

@media screen{html body #cj-native-route-layer .cj-filter-btn[aria-pressed="true"]{background:#eaf3f8;color:#073e76;border-color:#0b68aa}}

/* This mobile rule must win over desktop compound selectors and inline module sizes. */
@media screen and (max-width:700px){
 html body .page-modal-body #cj-native-route-layer :is(button,.cj-action-btn,.cj-filter-btn){min-height:44px!important;box-sizing:border-box;font-size:14px!important}
}

@media screen and (max-width:700px){
 html body .page-modal-body #cj-native-route-layer :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]),select,textarea){min-height:44px!important;font-size:16px!important;box-sizing:border-box}
}

@media screen and (max-width:700px){
 html body .mobile-sidebar .sidebar-header button{min-width:44px;min-height:44px}
 html body .mobile-sidebar .accordion-arrow{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
 html body .mobile-sidebar [role=button]:focus-visible{outline:2px solid #0b68aa;outline-offset:2px}
}

/* Mobile pointer targets share dimensions across native and added windows. */
@media screen and (max-width:700px){
 html body .page-modal-overlay:not(.is-minimized) .page-modal-titlebar{min-height:52px!important;box-sizing:border-box;flex-shrink:0}
 html body .page-modal-overlay:not(.is-minimized) .page-modal-titlebar button{min-width:44px!important;min-height:44px!important;width:44px!important;height:44px!important;padding:0!important;flex:0 0 44px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}
 html body .page-modal-body #cj-native-route-layer button,html body .cj-business-modal button{min-width:44px!important}
 html body .page-modal-body .MuiIconButton-root{min-width:44px!important;min-height:44px!important;width:44px!important;height:44px!important;box-sizing:border-box}
}

/* Parked Restore and Close are separate native keyboard actions. */
html body .page-modal-taskbar-item{display:inline-flex;align-items:stretch;max-width:220px;min-height:44px;border-radius:999px;background:#0b2b4b;color:#fff;box-shadow:0 8px 24px #00000040;overflow:visible}
html body .page-modal-taskbar-item .page-modal-taskbar-chip{flex:1;min-width:0;max-width:none;box-shadow:none;border-radius:999px 0 0 999px}
html body .page-modal-taskbar-item .page-modal-chip-close{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;min-width:44px;min-height:44px;margin:0;padding:8px;border:0;border-left:1px solid #ffffff40;border-radius:0 999px 999px 0;background:transparent;color:inherit;cursor:pointer}
html body .page-modal-taskbar-item .page-modal-chip-close:hover{background:#123a63}
html body .page-modal-taskbar-item button:focus-visible{outline:2px solid #fbbf24;outline-offset:2px}
@media(max-width:768px){html body .page-modal-taskbar-item{width:100%;max-width:none}}

/* Dashboard only: one gutter and equal mobile card widths. */
#cj-dashboard-layout{width:100%;min-width:0;box-sizing:border-box}
#cj-dashboard-stock-math{display:grid!important;grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr) 36px minmax(0,1fr)}
#cj-dashboard-stock-math>div:nth-child(odd){width:100%;min-width:0!important;box-sizing:border-box}
#cj-dashboard-layout #cj-dashboard-kpi-slot{box-sizing:border-box;padding-inline:19.2px}
#cj-dashboard-layout #cj-operational-summary{margin:16px 0 24px;width:100%;box-sizing:border-box}
@media(max-width:899px){
 .content:has(#cj-dashboard-layout){padding-left:0!important;padding-right:0!important}
 #cj-dashboard-layout #cj-dashboard-kpi-slot{padding-inline:12px}
 #cj-dashboard-layout #cj-operational-summary{margin:12px 0 18px}
 #cj-dashboard-stock-math{display:grid!important;grid-template-columns:minmax(0,1fr);gap:8px!important}
 #cj-dashboard-stock-math>div:nth-child(odd){width:100%!important;min-width:0!important;min-height:86px;box-sizing:border-box}
 #cj-dashboard-stock-math>div:nth-child(even){justify-self:center;width:24px!important;height:24px!important;margin:0!important}
}

/* Keep active form actions above the existing parked-window bar. */
@media screen {
 html body:has(.page-modal-taskbar-item) .page-modal-taskbar-root{flex-direction:row-reverse;flex-wrap:nowrap;overflow-x:auto;max-width:calc(100vw - 24px);pointer-events:auto}
 html body .page-modal-taskbar-root>.page-modal-taskbar-item{flex-shrink:0}
 html body:has(.page-modal-taskbar-item) .page-modal-overlay:not(.is-minimized){bottom:calc(var(--cj-window-bottom,0px) + 68px)!important;height:calc(100dvh - 56px - var(--cj-window-bottom,0px) - 68px)!important}
 html body:has(.page-modal-taskbar-item) .page-modal-overlay:not(.is-minimized) .page-modal-window{max-height:100%!important}
}

@media screen and (max-width:700px){html body .page-modal-body .MuiButton-root{min-height:44px;box-sizing:border-box}}
