.cargo-controls{width:100%;flex-basis:100%;margin:2px 0 0;padding:0;font-size:13px;--ui-control-height:34px;--ui-form-height:34px;--ui-touch-size:34px;--ui-control-font:12px}
.cargo-scope-note,.cargo-refresh-status{font-size:11px;font-weight:400;color:#667085;margin:4px 0;line-height:1.5}
.cargo-refresh-status{display:block}.cargo-stale{color:#9a5a08!important}.cargo-product{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:5px;font-size:12px;font-weight:400}
.cargo-location{display:inline-block;max-width:100%;overflow-wrap:anywhere;border:1px solid #c5d7ea;border-radius:4px;padding:2px 6px;color:#234f7c;background:#f0f6fc;font-size:12px;font-weight:500;line-height:1.4}
.cargo-location::before{content:'货区：'}.cargo-unassigned{color:#805621;background:#fff9ec;border-color:#ead7b1}.cargo-unassigned::before{content:''}
.cargo-select,.cargo-replacement{display:flex;align-items:center;gap:6px;cursor:pointer}.cargo-select input,.cargo-replacement input{width:20px;height:20px;min-height:20px;flex:none;margin:0;accent-color:#2563eb}
.cargo-select{min-height:32px;color:#234f7c;font-weight:600}.cargo-select small{margin:0;font-size:11px;font-weight:400;color:#667085}.cargo-replacement{padding:12px 0;font-weight:600;font-size:13px}
.cargo-selection-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px;padding:6px 8px;background:#edf4ff;border:1px solid #c7daf2;border-radius:6px;min-width:0}
.cargo-selection-summary{display:flex;flex-wrap:wrap;align-items:center;gap:0;background:transparent;color:#245f9f;min-width:0;min-height:34px;font-size:12px;padding:4px 0;text-align:left}.cargo-selection-summary strong{font-weight:600}.cargo-selection-bar>.primary{flex:none;white-space:nowrap}
#main .inventory-product-card.cargo-selected,#main .inventory-table tr:has([data-cargo-select]:checked){background:#edf5ff;border-color:#2767b4;box-shadow:inset 0 0 0 1px #2767b4}
.cargo-card-selection{margin:0 0 4px}.cargo-card-select{width:100%;min-height:32px}.cargo-card-select small{margin-left:auto}.cargo-card-location{margin:3px 0 5px;min-width:0;max-width:100%}.cargo-card-location .cargo-location{white-space:normal}
.inventory-card-status{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:center;margin-top:2px;min-width:0}
.inventory-card-status>.inventory-card-stock,.inventory-card-status>.cargo-card-location{margin:0;min-width:0}
.inventory-card-fields>.inventory-stock-field:nth-last-child(2){grid-column:1}
.inventory-card-fields>.inventory-stock-field:last-child{grid-column:2}
html body #dialog[data-sheet^="cargo-"]{height:fit-content;min-height:0;width:min(540px,calc(100vw - 20px));max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));--ui-control-height:34px;--ui-form-height:34px;--ui-touch-size:34px;--ui-control-font:12px}
html body #dialog[data-sheet^="cargo-"][open]{display:flex;flex-direction:column;overflow:hidden}
html body #dialog[data-sheet^="cargo-"] .modal-head{padding:7px 12px;min-height:42px;flex:none;align-items:center}
html body #dialog[data-sheet^="cargo-"] #dialog-title{margin:0;font-size:16px;line-height:24px}
html body #dialog[data-sheet^="cargo-"] #dialog-body{padding:8px 12px;min-height:0;flex:0 1 auto;overflow-y:auto;overscroll-behavior:contain}
html body #dialog[data-sheet^="cargo-"] #dialog-footer{padding:7px 12px;gap:6px;flex:none}
html body #dialog[data-sheet^="cargo-"] #dialog-error:empty{display:none}
.cargo-new-zone{display:flex;align-items:center;gap:6px}.cargo-new-zone input{flex:1;min-width:0;width:100%;margin:0}.cargo-new-zone button{flex:none;white-space:nowrap}
.cargo-zone-list{list-style:none;padding:0;margin:8px 0 0}.cargo-zone-list li{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:6px;padding:6px 0;border-top:1px solid #e5e7eb;font-size:13px}.cargo-zone-name{min-width:0;overflow-wrap:anywhere;line-height:19px}.cargo-zone-list small{color:#667085;font-size:11px;white-space:nowrap}.cargo-zone-list button{white-space:nowrap;padding-inline:7px}
.cargo-selected-list{list-style:none;margin:4px 0;padding:0}.cargo-selected-list li{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 0;border-top:1px solid #e5e7eb}.cargo-selected-list img,.cargo-list-image-empty{width:48px;height:52px;object-fit:cover;border-radius:5px;background:#f3f5f8}.cargo-list-image-empty{display:grid;place-items:center;font-size:10px;color:#667085}.cargo-list-details{min-width:0;overflow-wrap:anywhere}.cargo-list-details strong{font-size:13px;line-height:19px}.cargo-list-details small{display:block;font-size:11px;color:#667085;margin-top:2px}.cargo-list-details .cargo-product{margin-top:3px}.cargo-selected-list li.cargo-selection-empty{display:block;padding:12px 0;color:#667085;font-size:13px}
.cargo-review-scroll{max-height:45vh;overflow:auto}.cargo-review-table{width:100%;font-size:13px}.cargo-review-table th,.cargo-review-table td{text-align:left;white-space:normal;overflow-wrap:anywhere;padding:8px;border-bottom:1px solid #e5e7eb}
html body #dialog[data-sheet="preparation"] .cargo-prep-location{grid-column:2/-1;display:flex;flex-wrap:wrap;flex-basis:100%;align-items:center;gap:4px 8px;min-width:0;margin-top:2px}
.cargo-prep-location .cargo-refresh-status{font-size:10px}
.cargo-controls[hidden],.cargo-selection-bar[hidden],.cargo-product[hidden],.cargo-select[hidden],.cargo-refresh-status[hidden],[data-cargo-filter-control][hidden],[data-cargo-action="manage"][hidden]{display:none!important}
@layer nzip-components{
 .cargo-controls :is(button,select),#dialog[data-sheet^="cargo-"] :is(button,input,select){height:34px!important;min-height:34px!important;padding-block:5px!important;font-size:12px!important}
 .cargo-select input,#dialog[data-sheet^="cargo-"] input[type="checkbox"]{width:20px!important;height:20px!important;min-height:20px!important;padding:0!important}
}
@media(max-width:950px){
 .cargo-controls .cargo-selection-bar{position:fixed;z-index:16;left:0;right:0;bottom:calc(63px + var(--nzip-safe-bottom,env(safe-area-inset-bottom,0px)));margin:0;border-radius:0;padding:7px 12px;border-left:0;border-right:0;box-shadow:0 -2px 8px #172b4308}
 body[data-mobile-page="inventory"]:has([data-cargo-selection-bar]:not([hidden])) #main{padding-bottom:160px}
 body.ui-keyboard-open .cargo-selection-bar{display:none}
 .cargo-prep-location .cargo-refresh-status{flex-basis:100%}
}
@media print{.cargo-selection-bar,.cargo-card-selection{display:none!important}}

/* Inventory toolbar and filter controls share a compact, readable treatment. */
#main .inventory-actions{gap:6px;margin:0 0 6px;padding:0;--ui-control-height:34px;--ui-touch-size:34px;--ui-control-font:12px}
#main .inventory-actions>.action-menu{min-width:0}
#main .inventory-actions>.action-menu>summary,#main .inventory-actions>button{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;min-width:0}
#main .inventory-actions .cargo-controls{margin:0}
#main .inventory-actions .cargo-selection-bar{margin-top:0}
#main .inventory-search-row{margin-bottom:6px;gap:6px}
#main .panel:has(>.inventory-actions) .inventory-chips{gap:6px;margin-block:6px}
#main .inventory-advanced{gap:6px;margin:6px 0;padding:8px}
.inventory-cargo-filter{display:block;min-width:0;margin:0;flex:0 1 200px}
.inventory-cargo-filter select{width:100%;min-width:0;max-width:100%}
#dialog[data-sheet=inventory] .inventory-cargo-filter{margin:0 0 6px}
#main .inventory-advanced .range-actions,#dialog[data-sheet=inventory] .range-actions{gap:6px}
#main .inventory-advanced .stock-range-fields{margin:0}
#main .inventory-advanced :is(input,select),#dialog[data-sheet=inventory] :is(input,select){background:#f7f9fb;border:1px solid #cdd6df;border-radius:6px}
@media(min-width:951px){#main .inventory-advanced .stock-range-fields>label{font-size:12px!important;color:#111;-webkit-text-fill-color:#111}}
@layer nzip-components{
 html body #main .inventory-actions :is(button,summary),html body #main .panel:has(>.inventory-actions) .inventory-chips>button,html body #main .inventory-more-toggle,html body #main .inventory-advanced :is(button,input,select),html body #dialog[data-sheet=inventory] :is(button,input,select){height:34px!important;min-height:34px!important;max-height:34px!important;padding:6px 8px!important;font-family:inherit!important;font-size:12px!important;font-weight:400!important;line-height:20px!important;color:#111!important;-webkit-text-fill-color:#111!important}
 html body #main .inventory-actions :is(button,summary),html body #main .panel:has(>.inventory-actions) .inventory-chips>button,html body #main .inventory-more-toggle,html body #main .inventory-advanced button,html body #dialog[data-sheet=inventory] button{background:#f2f5f8!important;border:1px solid #d1dae3!important;border-radius:6px!important}
 html body #main .inventory-actions button.primary,html body #main .panel:has(>.inventory-actions) .inventory-chips>.selected,html body #main .inventory-advanced button.primary,html body #dialog[data-sheet=inventory] button.primary{background:#e8f1fc!important;border-color:#adc7e6!important}
 html body #main .inventory-actions .cargo-selection-summary{background:transparent!important;border-color:transparent!important;padding-inline:0!important}
 html body #main .inventory-actions :is(button,summary):focus-visible,html body #main .panel:has(>.inventory-actions) .inventory-chips>button:focus-visible,html body #main .inventory-advanced :is(button,input,select):focus-visible,html body #dialog[data-sheet=inventory] :is(button,input,select):focus-visible{outline:2px solid #518ac9;outline-offset:2px}
}
@media(max-width:950px){
 #main .inventory-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr) minmax(0,.9fr);gap:4px;margin-bottom:6px}
 #main .inventory-actions:not(:has(>[data-cargo-action="manage"]:not([hidden]))){grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr)}
 #main .inventory-actions>.cargo-controls{display:contents}
 #main .inventory-actions>.cargo-controls>.cargo-refresh-status{grid-column:1/-1;margin:0}
 #main .inventory-actions>.action-menu>summary,#main .inventory-actions>button{width:100%}
 #main .panel:has(>.inventory-actions)>.inventory-chips{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:0 0 6px}
 #main .panel:has(>.inventory-actions)>.inventory-chips>button{min-width:0;white-space:nowrap}
 html body #dialog[data-sheet=inventory] #dialog-title{font-size:18px;line-height:26px;color:#111;-webkit-text-fill-color:#111}
 html body #dialog[data-sheet=inventory] .inventory-cargo-filter{margin:0}
 html body #dialog[data-sheet=inventory] .compact-field-heading{margin:6px 0 4px;font-size:16px;font-weight:400;line-height:22px;color:#111;-webkit-text-fill-color:#111}
 html body #dialog[data-sheet=inventory] .stock-range-fields{grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr)!important;gap:6px!important;font-size:16px;line-height:22px}
 html body #dialog[data-sheet=inventory] .stock-range-fields>label{display:block!important;min-width:0;font-size:0!important;line-height:0;color:#111}
 html body #dialog[data-sheet=inventory] .stock-range-fields>label[hidden]{display:none!important}
 html body #dialog[data-sheet=inventory] .stock-range-fields>label:before{content:none!important;display:none!important}
 html body #dialog[data-sheet=inventory] .stock-range-to{font-size:16px;line-height:22px;text-align:center;color:#111;-webkit-text-fill-color:#111}
 html body #dialog[data-sheet=inventory] #stock-max{grid-column:auto;grid-row:auto}
 html body #dialog[data-sheet=inventory] .inventory-sort-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin-top:0}
 html body #dialog[data-sheet=inventory] :is(#inventory-sort-field,#inventory-sort-direction){grid-column:auto}
 @layer nzip-components{
  html body #main .inventory-actions>button,html body #main .inventory-actions>.action-menu>summary,html body #main .panel:has(>.inventory-actions)>.inventory-chips>button{padding-inline:3px!important}
 }
 /* Keep mobile filter forms at 16px so focused inputs do not trigger iOS zoom. */
 @layer nzip-mobile-controls{
  html body #dialog[data-sheet=inventory] :is(input,select,.range-actions>button){height:40px!important;min-height:40px!important;max-height:40px!important;padding:6px 8px!important;font-family:inherit!important;font-size:16px!important;font-weight:400!important;line-height:22px!important;color:#111!important;-webkit-text-fill-color:#111!important}
 }
}
@media(max-width:360px){
 #main .inventory-actions,#main .inventory-actions:not(:has(>[data-cargo-action="manage"]:not([hidden]))){grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* R42 inventory overview: counts and two parent controls, search remains full width. */
#main .inventory-overview{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;margin-bottom:8px}
#main .inventory-overview h2{margin:0;min-width:0;display:flex}
#main .inventory-overview #inventory-counts{display:flex;gap:4px;margin:0;flex-wrap:wrap}
#main .inventory-mother-buttons{display:flex;gap:6px;margin-left:auto}
#main .r42-inventory-actions{display:block;margin:0;padding:0}
#main .r42-inventory-actions .cargo-controls{display:block;width:100%;margin:0}
#main .inventory-search-row{display:flex;width:100%}
#main .inventory-search-row .search-wrap{flex:1;width:100%;min-width:0}
#main #inventory-applied-filters{display:flex;flex-wrap:wrap;gap:5px;margin:0 0 7px}
#main #inventory-applied-filters[hidden]{display:none}
#main .cargo-location,.cargo-prep-location .cargo-location{border:0;border-radius:0;padding:0;background:transparent;color:#000;font-family:inherit;font-size:12px;font-weight:400;line-height:1.4}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]){width:min(460px,calc(100vw - 20px));max-width:calc(100vw - 20px);height:fit-content;min-height:0;max-height:calc(var(--sheet-height,100dvh) - 24px);margin:auto;inset:0;--ui-control-height:40px;--ui-form-height:40px;--ui-touch-size:40px;--ui-control-font:16px}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"])[open]{display:flex;flex-direction:column;overflow:hidden}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) .modal-head{flex:none;min-height:44px;padding:8px 12px}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) #dialog-title{margin:0}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) #dialog-body{padding:8px 12px;flex:0 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) #dialog-footer{display:flex;gap:8px;flex:none;padding:8px 12px}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) #dialog-footer>button{flex:1}
html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) #dialog-error:empty{display:none}
.inventory-management-menu{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
.inventory-management-menu>button{width:100%;text-align:left}
.inventory-quick-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:10px}
.inventory-filter-label{display:block;margin:8px 0 4px}
#dialog[data-sheet="inventory-r42"] .inventory-cargo-filter{display:block;width:100%;margin-top:4px}
#dialog[data-sheet="inventory-r42"] .inventory-range-pair{display:grid;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:6px;align-items:end}
#dialog[data-sheet="inventory-r42"] .inventory-range-pair>span{align-self:end;line-height:40px;text-align:center}
#dialog[data-sheet="inventory-r42"] .inventory-range-pair label{display:block;min-width:0}
#dialog[data-sheet="inventory-r42"] .inventory-range-pair input{display:block;margin-top:0;width:100%;min-width:0}
#dialog[data-sheet="inventory-r42"] .inventory-sort-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0}
#dialog[data-sheet="inventory-r42"] :is(input,select){width:100%;min-width:0;box-sizing:border-box}
#dialog[data-sheet="inventory-r42"] #stock-range-error:empty{display:none}
@layer nzip-components{
 html body #main .inventory-mother-buttons>button{height:34px!important;min-height:34px!important;padding:5px 8px!important;font-size:14px!important;font-weight:400!important;line-height:22px!important;color:#000!important;white-space:nowrap;background:#f2f5f8!important;border:1px solid #d1dae3!important;border-radius:6px!important}
 html body #main #inventory-applied-filters>.inventory-condition{height:auto!important;min-height:28px!important;padding:3px 7px!important;font-size:12px!important;font-weight:400!important;color:#000!important;background:#f2f5f8!important;border:1px solid #d1dae3!important;border-radius:5px!important}
 html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"],[data-sheet="cargo-manage"],[data-sheet="cargo-rename"],[data-sheet="cargo-delete"]) :is(h2,h3,label,span,p,small,option,input,select,button,.inventory-filter-label){font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;font-size:16px!important;font-weight:400!important;line-height:24px!important;color:#000!important;-webkit-text-fill-color:#000!important}
 html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"],[data-sheet="cargo-manage"],[data-sheet="cargo-rename"],[data-sheet="cargo-delete"]) :is(input:not([type="hidden"]),select,button){height:40px!important;min-height:40px!important;max-height:none!important;padding:7px 9px!important;border:1px solid #cdd6df!important;border-radius:6px!important;background:#f7f9fb!important;box-sizing:border-box!important}
 html body #dialog[data-sheet="inventory-r42"] button:is(.primary,.selected){background:#e8f1fc!important;border-color:#adc7e6!important}
 html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]) button:disabled{opacity:.45}
}
@media(max-width:360px){#main .inventory-overview{align-items:flex-start}#main .inventory-mother-buttons{width:100%;margin:0}#main .inventory-mother-buttons>button{flex:1} }
@media(max-width:950px){html body #dialog:is([data-sheet="inventory-r42"],[data-sheet="inventory-management"]){position:fixed;top:calc(var(--sheet-top,0px) + var(--sheet-height,100dvh)/2);transform:translateY(-50%);bottom:auto;max-height:calc(var(--sheet-height,100dvh) - 24px);margin:0 auto}}
html body #dialog:is([data-sheet="cargo-manage"],[data-sheet="cargo-rename"],[data-sheet="cargo-delete"]){max-height:calc(var(--sheet-height,100dvh) - 24px)}
@media(max-width:950px){html body #dialog:is([data-sheet="cargo-manage"],[data-sheet="cargo-rename"],[data-sheet="cargo-delete"]){position:fixed;inset:auto 0;top:calc(var(--sheet-top,0px) + var(--sheet-height,100dvh)/2);transform:translateY(-50%);margin:0 auto}}

@layer nzip-components{html body #dialog[data-sheet="inventory-management"] .inventory-management-menu>button{display:block!important;text-align:left!important;justify-content:flex-start!important;width:100%!important}}
