/* Presentation adapters for the original branch warehouse popups.
   manual-* geometry: manual-stock-bento.css / ManualStockEntry.js.
   audit-* geometry: stock-audit-popup.css / StockAuditModal.js.
   trf-* geometry: stock-transfer.css / StockTransferModal.js.
   Only the enclosing native dialog and central field identifiers differ. */
:is(#central-warehouse-form,#central-warehouse-access){box-sizing:border-box;width:min(780px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid #e5dfd5;border-radius:24px;background:#fff;color:#1c1917;color-scheme:light;font-family:Outfit,system-ui,sans-serif;overflow:hidden;box-shadow:0 20px 40px #0003}
:is(#central-warehouse-form,#central-warehouse-access)::backdrop{background:rgba(28,25,23,.65);backdrop-filter:blur(6px)}
:is(#central-warehouse-form,#central-warehouse-access) *{box-sizing:border-box}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-frame{display:flex;flex-direction:column;min-width:0;min-height:0;max-height:calc(100dvh - 34px);margin:0}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 20px;flex:none;border-bottom:1px solid #e5dfd5;background:#fff}
:is(#central-warehouse-form,#central-warehouse-access) :is(.manual-heading,.cwf-heading){display:flex;align-items:center;gap:12px;min-width:0}
:is(#central-warehouse-form,#central-warehouse-access) :is(.manual-heading-icon,.cwf-heading>svg){display:grid;place-items:center;width:42px;height:42px;flex:none;border-radius:13px;background:#f7eae6;border:1px solid #ead5cd;color:#8b1515}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-heading>svg{padding:10px}
:is(#central-warehouse-form,#central-warehouse-access) .manual-heading-icon svg{width:22px;height:22px}
:is(#central-warehouse-form,#central-warehouse-access) h2{font:300 25px/1.2 Outfit,system-ui,sans-serif;letter-spacing:-.6px;margin:0;overflow-wrap:anywhere}
:is(#central-warehouse-form,#central-warehouse-access) h2 strong{font-weight:650}
:is(#central-warehouse-form,#central-warehouse-access) .manual-branch{display:block;font:400 12px/1.3 Outfit,system-ui,sans-serif;margin-top:5px;color:#78716c}
:is(#central-warehouse-form,#central-warehouse-access) :is(.manual-actions,.cwf-actions){display:flex;align-items:center;gap:8px;flex:none}
:is(#central-warehouse-form,#central-warehouse-access) button{font:500 14px Outfit,system-ui,sans-serif;cursor:pointer}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-button{min-height:40px;border:1px solid #e5dfd5;border-radius:999px;padding:9px 16px;font:500 14px Outfit,system-ui,sans-serif;background:#faf8f5;color:#1c1917;display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;white-space:nowrap}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-primary{background:#8b1515;border-color:#8b1515;color:#fff}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-actions svg{width:17px;height:17px;flex:none}
:is(#central-warehouse-form,#central-warehouse-access) button:disabled{opacity:.4;cursor:default}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-body{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0;overflow:auto;scrollbar-gutter:stable;padding:14px}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-field{display:flex;flex-direction:column;gap:6px;min-width:0;font:400 13px/1.35 Outfit,system-ui,sans-serif;color:#78716c;margin:0}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-span{grid-column:1/-1}
:is(#central-warehouse-form,#central-warehouse-access) :is(input:not([type=checkbox]),select,textarea){height:42px;min-height:42px;font:400 14px Outfit,system-ui,sans-serif;border-radius:11px;border:1px solid #e5dfd5;background:#fff;color:#1c1917;width:100%;min-width:0;box-shadow:none;padding:0 12px}
:is(#central-warehouse-form,#central-warehouse-access) textarea{height:72px;max-height:140px;padding:10px 12px;resize:vertical}
:is(#central-warehouse-form,#central-warehouse-access) input::placeholder{font-weight:300;color:#9a928b}
:is(#central-warehouse-form,#central-warehouse-access) :is(input,textarea,button):focus-visible{outline:2px solid #8b1515;outline-offset:2px}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-help{font:400 13px/1.4 Outfit,system-ui,sans-serif;color:#78716c;margin:0}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-inline{display:flex;align-items:flex-start;gap:8px;font:400 14px/1.4 Outfit,system-ui,sans-serif;color:#44403a;min-width:0}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-inline input{width:18px;height:18px;accent-color:#8b1515;flex:none}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-error{padding:10px 12px;margin:0;border:1px solid #edb6b1;border-radius:12px;background:#fff1ef;color:#991b1b;font:400 14px/1.4 Outfit,system-ui,sans-serif;flex:none;overflow-wrap:anywhere}
:is(#central-warehouse-form,#central-warehouse-access) [hidden]{display:none!important}
:is(#central-warehouse-form,#central-warehouse-access) :is(.cwf-section,.cwf-status){padding:12px;border:1px solid #e5dfd5;border-radius:16px;background:#faf8f5;min-width:0}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-status{display:flex;align-items:center;gap:10px;background:#1c1917;border-color:#1c1917;color:#fff;font-size:14px;line-height:1.4;flex:none}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-status svg{width:22px;height:22px;flex:none}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-status span{min-width:0;overflow-wrap:anywhere}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-effect{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:11px;border:1px solid #e5dfd5;border-radius:12px;background:#fff;min-width:0;font:400 14px/1.4 Outfit,system-ui,sans-serif}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-effect strong{font-weight:600;font-variant-numeric:tabular-nums;max-width:100%;overflow-wrap:anywhere}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-rows{display:flex;flex-direction:column;gap:10px}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 12px;font-size:18px;font-weight:600}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;min-width:0}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-row-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;grid-column:1/-1;font-size:15px;font-weight:600}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-remove{border:0;background:transparent;color:#8b1515;min-height:32px;padding:4px 8px;font-size:13px}
:is(#central-warehouse-form,#central-warehouse-access) .cwf-row>.cwf-help{grid-column:1/-1}
/* ManualStockEntry's actual two-bento workspace, catalogue and selected entry. */
#central-warehouse-form[data-stock-template=manual]{width:min(860px,calc(100vw - 32px));height:min(540px,calc(100dvh - 32px))}
#central-warehouse-form[data-stock-template=manual] .cwf-frame{height:100%}
#central-warehouse-form[data-stock-template=manual] .cwf-header{padding:14px 18px}
#central-warehouse-form[data-stock-template=manual] .cwf-body{flex:1;overflow:hidden;padding:14px;gap:10px}
#central-warehouse-form .manual-fields{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:12px;min-height:0;flex:1;overflow:hidden}
#central-warehouse-form .manual-catalog{display:flex;flex-direction:column;gap:8px;padding:10px;background:#faf8f5;border:1px solid #e5dfd5;border-radius:16px;min-height:0;min-width:0}
#central-warehouse-form .manual-catalog-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}
#central-warehouse-form .manual-catalog-heading h3{margin:0;font-size:17px;font-weight:600}
#central-warehouse-form .manual-catalog-heading .cwf-button{min-height:32px;padding:6px 10px;font-size:13px}
#central-warehouse-form .manual-search{position:relative;flex:none}
#central-warehouse-form .manual-search input{padding-right:40px}
#central-warehouse-form .manual-search svg{position:absolute;right:12px;top:12px;width:18px;height:18px;color:#8b1515;pointer-events:none}
#central-warehouse-form .manual-stock-list{display:flex;flex-direction:column;gap:5px;overflow:auto;min-height:0;flex:1}
#central-warehouse-form .manual-stock-option{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:47px;padding:10px;border:1px solid transparent;border-radius:11px;background:#fff;flex:none;text-align:left;cursor:pointer;color:#1c1917}
#central-warehouse-form .manual-stock-option strong{font:500 13px/1.3 Outfit,system-ui,sans-serif;overflow-wrap:anywhere}
#central-warehouse-form .manual-stock-option>span{font:600 14px Outfit,system-ui,sans-serif;white-space:nowrap;font-variant-numeric:tabular-nums}
#central-warehouse-form .manual-stock-option small{font-size:11px;font-weight:400;color:#78716c}
#central-warehouse-form .manual-stock-option[aria-pressed=true]{border-color:#b6675d;background:#f8ece8}
#central-warehouse-form .manual-entry{display:flex;flex-direction:column;gap:9px;border:1px solid #e7d3cb;border-radius:16px;background:#faf1ed;padding:16px;min-width:0;min-height:0;overflow:auto}
#central-warehouse-form .manual-selected{display:flex;flex-direction:column;gap:5px;min-height:45px}
#central-warehouse-form .manual-selected>span{font:400 12px/1.35 Outfit,system-ui,sans-serif;color:#78716c}
#central-warehouse-form .manual-selected strong{font:600 16px/1.3 Outfit,system-ui,sans-serif}
#central-warehouse-form .manual-entry [name$=".quantity"]{height:56px;min-height:56px;font-size:28px;font-weight:650}
#central-warehouse-form .manual-entry .cwf-row>.cwf-field:first-of-type{grid-column:1/-1}
#central-warehouse-form .manual-entry .cwf-row-heading{display:none}
#central-warehouse-form .manual-entry .cwf-row:has([data-remove]) .cwf-row-heading{display:flex}
#central-warehouse-form .manual-document-meta{flex:none;min-height:0;border:1px solid #e5dfd5;border-radius:14px;background:#faf8f5;overflow:auto;max-height:150px;padding:10px}
#central-warehouse-form .manual-document-meta summary{font-size:14px;font-weight:500;cursor:pointer}
#central-warehouse-form .manual-document-meta[open] summary{margin-bottom:10px}
#central-warehouse-form .manual-document-meta .cwf-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#central-warehouse-form .manual-footer-note{flex:none;padding:10px 12px;background:#f7f1e7;border:1px solid #e9dfcd;border-radius:16px}
#central-warehouse-form .manual-search-empty{font-size:14px;color:#78716c;text-align:center;margin:12px 0}
/* StockAuditModal's bounded table and compact search/area rail. */
#central-warehouse-form[data-stock-template=audit]{width:min(1000px,calc(100vw - 32px));height:min(650px,calc(100dvh - 32px))}
#central-warehouse-form[data-stock-template=audit] .cwf-frame{height:100%}
#central-warehouse-form[data-stock-template=audit] .cwf-header{padding:14px 18px;min-height:64px;gap:12px}
#central-warehouse-form[data-stock-template=audit] .cwf-body{flex:1;padding:0;overflow:hidden;gap:0}
#central-warehouse-form .audit-workspace{display:flex;flex-direction:column;flex:1;min-height:0}
#central-warehouse-form .audit-toolbar{display:flex;align-items:center;gap:8px;padding:10px 14px;flex:none;background:#fff;min-width:0;flex-wrap:wrap}
#central-warehouse-form .audit-toolbar>div:first-child{display:flex;align-items:center;gap:8px;min-width:0;flex:1;flex-wrap:wrap}
#central-warehouse-form .audit-search{position:relative;width:220px;flex-shrink:0}
#central-warehouse-form .audit-search-input{height:36px;min-height:36px;padding:0 10px 0 31px;font-size:14px;border-radius:999px}
#central-warehouse-form .audit-search svg{position:absolute;left:10px;top:11px;width:15px;height:15px;color:#a8a29e;pointer-events:none}
#central-warehouse-form .audit-cat-filters{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:2px;padding:4px;border:1px solid #e5dfd5;border-radius:999px;background:#f0ece5;min-width:0;max-width:100%;flex:1}
#central-warehouse-form .audit-cat-btn{height:30px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#57534e;font:500 13px/1.3 Outfit,system-ui,sans-serif;flex:none}
#central-warehouse-form .audit-cat-btn.active{background:#1c1917;color:#fff}
#central-warehouse-form .audit-table-scroll{overflow:auto;min-height:0;flex:1 1 0;padding:0 12px}
#central-warehouse-form .audit-table-scroll table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}
#central-warehouse-form .audit-table-scroll th{position:sticky;top:0;z-index:2;background:#f7f5f2;padding:10px 8px;font:500 13px/1.3 Outfit,system-ui,sans-serif}
#central-warehouse-form .audit-table-scroll td{padding:8px;font:400 14px/1.35 Outfit,system-ui,sans-serif;vertical-align:middle;border-bottom:1px solid #f3f4f6}
#central-warehouse-form .audit-table-scroll :is(th,td):first-child{width:34%;text-align:left}
#central-warehouse-form .audit-table-scroll :is(th,td):not(:first-child){text-align:center}
#central-warehouse-form .audit-table-scroll td:first-child{font-weight:600}
#central-warehouse-form .audit-area{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border-radius:6px;font-size:12px;background:#f5f5f4;color:#57534e}
#central-warehouse-form .audit-area svg{width:12px;height:12px;flex:none}
#central-warehouse-form .audit-count-control{display:flex;align-items:center;justify-content:center;gap:4px}
#central-warehouse-form .audit-count-control>span{font-size:12px;color:#78716c}
#central-warehouse-form .audit-input{height:32px;min-height:32px;width:70px;padding:4px 6px;text-align:center;font-size:14px;flex:none}
#central-warehouse-form .audit-variance{font-size:13px;white-space:nowrap}
#central-warehouse-form .audit-variance[data-variance=negative]{color:#b91c1c}
#central-warehouse-form .audit-variance[data-variance=positive]{color:#15803d}
#central-warehouse-form .audit-reason{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:12px 18px;border-top:1px solid #e5dfd5;background:#fdfdfd;font-size:14px}
#central-warehouse-form .audit-reason .cwf-field{min-width:280px;flex:1;max-width:560px}
/* StockTransferModal's original route / list / dark summary / note bento. */
#central-warehouse-form[data-stock-template=transfer]{width:min(1080px,calc(100vw - 32px));height:min(520px,calc(100dvh - 32px))}
#central-warehouse-form[data-stock-template=transfer] .cwf-frame{height:100%}
#central-warehouse-form[data-stock-template=transfer] .cwf-body{flex:1;padding:16px 20px;background:#faf8f5;overflow:hidden}
#central-warehouse-form .trf-workspace{display:grid;grid-template-columns:minmax(0,2fr) minmax(240px,.9fr);grid-template-rows:64px minmax(0,1fr) 56px auto;grid-template-areas:"route route" "items summary" "note note" "help help";gap:12px;overflow:hidden;min-height:0;flex:1}
#central-warehouse-form .trf-route-fields{grid-area:route;display:grid;grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr);gap:10px;align-items:stretch;min-width:0}
#central-warehouse-form .trf-route-fields section{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid #e5dfd5;border-radius:18px;min-width:0}
#central-warehouse-form .trf-source-box{background:linear-gradient(120deg,#8b1515,#a32121);border-color:#8b1515!important;color:#fff}
#central-warehouse-form .trf-source-box label{display:flex;align-items:center;gap:6px;color:#f8d9d4;font-size:13px;white-space:nowrap}
#central-warehouse-form .trf-source-box label svg{width:17px;height:17px;flex:none}
#central-warehouse-form .trf-source-box strong{font-size:16px;font-weight:500;line-height:1.25;min-width:0;overflow-wrap:anywhere}
#central-warehouse-form .trf-destination-box{background:#edf4ee;border-color:#d2e0d4!important}
#central-warehouse-form .trf-destination-box .cwf-field{flex:1;flex-direction:row;align-items:center;gap:10px;font-size:13px;white-space:nowrap}
#central-warehouse-form .trf-destination-box select{height:38px;min-height:38px;flex:1}
#central-warehouse-form .trf-route-arrow{align-self:center;justify-self:center;width:22px;height:22px;color:#8b1515}
#central-warehouse-form .trf-items-panel{grid-area:items;display:flex;flex-direction:column;border:1px solid #e5dfd5;border-radius:18px;padding:14px;background:#fff;min-width:0;min-height:0;overflow:hidden}
#central-warehouse-form .trf-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex:none}
#central-warehouse-form .trf-workspace h3{display:flex;align-items:center;gap:8px;font-size:21px;font-weight:600;line-height:1.2;margin:0}
#central-warehouse-form .trf-items-panel h3 svg{width:22px;height:22px;color:#8b1515;flex:none}
#central-warehouse-form .trf-panel-heading .cwf-button{min-height:36px;height:36px;padding:0 14px;background:#8b1515;border-color:#8b1515;color:#fff}
#central-warehouse-form .trf-items-container{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
#central-warehouse-form .trf-item-row{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(110px,.85fr) minmax(100px,.85fr) 28px;gap:8px;padding:8px 10px;min-height:56px;border:1px solid #e5dfd5;border-radius:12px;background:#faf8f5;align-items:center;margin-bottom:8px}
#central-warehouse-form .trf-item-row>div{min-width:0}
#central-warehouse-form .trf-item-row .cwf-field{font-size:12px}
#central-warehouse-form .trf-item-row input{height:38px;min-height:38px;padding:0 8px;font-size:14px}
#central-warehouse-form .trf-item-row strong{font-size:13px;font-weight:500}
#central-warehouse-form .trf-cost-label{display:block;font-size:12px;color:#78716c;margin-bottom:5px}
#central-warehouse-form .trf-item-row .trf-packaging{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#central-warehouse-form .trf-item-row .cwf-remove{padding:0}
#central-warehouse-form .trf-item-row .cwf-remove svg{width:16px;height:16px}
#central-warehouse-form .trf-summary-box{grid-area:summary;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:6px;padding:14px;border:1px solid #1c1917;border-radius:18px;background:#1c1917;color:#fff}
#central-warehouse-form .trf-summary-box h3{font-size:15px;font-weight:500;color:#d6d3d1}
#central-warehouse-form .trf-summary-box h3 svg{width:19px;height:19px;color:#ed8585}
#central-warehouse-form .trf-summary-box dl{display:grid;gap:8px;margin:0;padding-top:8px;border-top:1px solid #ffffff18}
#central-warehouse-form .trf-summary-box dl>div{display:flex;align-items:center;justify-content:space-between;gap:12px}
#central-warehouse-form .trf-summary-box dt{font-size:13px;color:#d6d3d1}
#central-warehouse-form .trf-summary-box dd{font-size:16px;font-weight:500;margin:0;text-align:right;overflow-wrap:anywhere}
#central-warehouse-form .trf-summary-box p{font-size:12px;line-height:1.4;color:#bdb8b1;margin:4px 0 0}
#central-warehouse-form .trf-extra-charge{display:flex;flex-direction:column;gap:8px;margin-top:6px}
#central-warehouse-form .trf-extra-charge .cwf-field{color:#d6d3d1}
#central-warehouse-form .trf-note-box{grid-area:note;display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid #e9dfcd;border-radius:16px;background:#f7f1e7;min-height:0}
#central-warehouse-form .trf-note-box .cwf-field{flex:1;flex-direction:row;align-items:center;gap:12px}
#central-warehouse-form .trf-note-box input{height:32px;min-height:32px;flex:1;background:#ffffffb0;border-color:#e9dfcd}
#central-warehouse-form .trf-fefo-note{grid-area:help;font-size:12px;line-height:1.35;color:#78716c;margin:0}
#central-warehouse-form[data-step=preview] .cwf-body,#central-warehouse-form[data-step=result] .cwf-body{overflow:auto;gap:12px;padding:14px;background:#faf8f5}
#central-warehouse-form .cwf-loader{animation:cwf-turn 1s linear infinite}
@keyframes cwf-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#central-warehouse-form .cwf-loader{animation:none}}
@media(max-width:768px){
 :is(#central-warehouse-form,#central-warehouse-access){width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:20px}
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-frame{max-height:calc(100dvh - 26px)}
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-header{padding:14px;flex-wrap:wrap;gap:12px}
 :is(#central-warehouse-form,#central-warehouse-access) h2{font-size:22px}
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-actions{width:100%;justify-content:flex-end}
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-actions .cwf-button{min-height:44px}
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-body{padding:12px}
 #central-warehouse-form[data-stock-template=manual]{width:calc(100vw - 24px);height:min(700px,calc(100dvh - 24px))}
 #central-warehouse-form[data-stock-template=manual] .cwf-body{overflow:auto;flex:1}
 #central-warehouse-form .manual-fields{grid-template-columns:1fr;grid-template-rows:minmax(160px,auto) auto;overflow:visible;flex:none}
 #central-warehouse-form .manual-catalog{max-height:230px;min-height:160px}
 #central-warehouse-form .manual-entry{padding:12px;overflow:visible}
 #central-warehouse-form .manual-entry [name$=".quantity"]{height:48px;min-height:48px;font-size:25px}
 #central-warehouse-form .manual-selected{min-height:0}
 #central-warehouse-form .manual-document-meta{max-height:180px;flex:none}
 #central-warehouse-form .manual-document-meta .cwf-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #central-warehouse-form .manual-footer-note{padding:10px}
 #central-warehouse-form[data-stock-template=audit]{width:calc(100vw - 24px);height:calc(100dvh - 24px)}
 #central-warehouse-form .audit-table-scroll table{min-width:640px}
 #central-warehouse-form .audit-search{width:min(220px,100%);flex:1}
 #central-warehouse-form .audit-cat-filters{flex:none;max-width:100%}
 #central-warehouse-form .audit-reason{align-items:stretch;flex-direction:column;padding:12px}
 #central-warehouse-form .audit-reason .cwf-field{min-width:0;max-width:none;width:100%}
 #central-warehouse-form[data-stock-template=transfer]{width:calc(100vw - 24px);height:calc(100dvh - 24px)}
 #central-warehouse-form[data-stock-template=transfer] .cwf-body{padding:12px;overflow:auto}
 #central-warehouse-form .trf-workspace{grid-template-columns:1fr;grid-template-rows:auto minmax(200px,auto) auto auto auto;grid-template-areas:"route" "items" "summary" "note" "help";overflow:visible;flex:none}
 #central-warehouse-form .trf-route-fields{grid-template-columns:1fr 20px 1fr;gap:6px}
 #central-warehouse-form .trf-route-fields section{padding:12px;flex-direction:column;align-items:stretch;gap:8px}
 #central-warehouse-form .trf-destination-box .cwf-field{flex-direction:column;align-items:stretch}
 #central-warehouse-form .trf-route-fields label{white-space:normal}
 #central-warehouse-form .trf-items-container{max-height:320px}
 #central-warehouse-form .trf-item-row{grid-template-columns:minmax(0,1fr) minmax(75px,.65fr) 28px}
 #central-warehouse-form .trf-item-row>div:nth-child(3){grid-column:1/3}
 #central-warehouse-form .trf-item-row>.cwf-remove{grid-column:3;grid-row:1}
 #central-warehouse-form .trf-summary-box{overflow:visible}
 #central-warehouse-form .trf-note-box{min-height:82px}
 #central-warehouse-form .trf-note-box .cwf-field{flex-direction:column;align-items:stretch;width:100%}
 #central-warehouse-form .trf-extra-charge{display:grid;grid-template-columns:1fr 1fr;gap:12px}
}
@media(max-width:480px){
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-grid{grid-template-columns:1fr}
 :is(#central-warehouse-form,#central-warehouse-access) .cwf-row>.cwf-field:has(input[type=date]){grid-column:1/-1}
 #central-warehouse-form .manual-document-meta .cwf-grid{grid-template-columns:1fr}
 #central-warehouse-form .manual-entry .cwf-row>.cwf-field>span{min-height:2.6em}
 #central-warehouse-form .manual-catalog-heading .cwf-button{min-height:40px}
 #central-warehouse-form .trf-workspace h3{font-size:17px}
 #central-warehouse-form .trf-extra-charge{grid-template-columns:1fr}
}
@media print{
 @page{size:A4;margin:12mm}
 html:has(#central-warehouse-form[open]),body:has(#central-warehouse-form[open]){background:#fff!important;color:#000!important;height:auto!important;min-height:0!important;overflow:visible!important;margin:0!important;padding:0!important}
 body:has(#central-warehouse-form[open])>*:not(#central-warehouse-form){display:none!important}
 dialog#central-warehouse-form[open]{position:static!important;inset:auto!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;margin:0!important;display:block!important;width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;overflow:visible!important;color:#000!important;break-inside:auto}
 dialog#central-warehouse-form[open]::backdrop{background:transparent!important;backdrop-filter:none!important}
 #central-warehouse-form .cwf-frame,#central-warehouse-form .cwf-body{position:static!important;display:block!important;inset:auto!important;margin:0!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;background:#fff!important;color:#000!important;padding:0!important}
 #central-warehouse-form .cwf-header{display:block!important;padding:0 0 8mm!important;border-bottom:1px solid #ddd!important;background:#fff!important;break-after:avoid-page}
 #central-warehouse-form .cwf-actions,#central-warehouse-form button,#central-warehouse-form .cwf-error{display:none!important}
 #central-warehouse-form .cwf-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;margin:5mm 0!important}
 #central-warehouse-form .cwf-rows{display:block!important}
 #central-warehouse-form .cwf-effect,#central-warehouse-form .cwf-status{margin:0 0 3mm!important;background:#fff!important;color:#000!important;border-color:#ccc!important;box-shadow:none!important;break-inside:avoid-page;page-break-inside:avoid}
 #central-warehouse-form .manual-heading-icon{background:#fff!important;border-color:#ccc!important;color:#000!important}
}

@media(max-width:768px){
 #central-warehouse-form[data-stock-template=audit] .cwf-header{display:contents}
 #central-warehouse-form[data-stock-template=audit] .cwf-heading{order:0;padding:12px;border-bottom:1px solid #e5dfd5;min-height:64px;flex:none}
 #central-warehouse-form[data-stock-template=audit] .cwf-body{order:1}
 #central-warehouse-form[data-stock-template=audit] .cwf-header>.cwf-actions{order:2;flex:none;display:grid;grid-template-columns:1fr 1fr;padding:12px;margin:0;background:#fff;border-top:1px solid #e5dfd5}
 #central-warehouse-form[data-stock-template=audit] .cwf-header>.cwf-actions:has([data-action=edit]){grid-template-columns:1fr 1fr 1fr}
 #central-warehouse-form .audit-toolbar{display:flex;flex-direction:column;align-items:stretch}
 #central-warehouse-form .audit-toolbar>div:first-child{display:flex;flex-direction:column;align-items:stretch;width:100%}
 #central-warehouse-form .audit-search{width:100%;flex:none}
 #central-warehouse-form .audit-cat-filters{width:100%;flex:none}
 #central-warehouse-form .audit-toolbar>.cwf-button{width:100%}
 #central-warehouse-form[data-stock-template=manual]{height:calc(100dvh - 48px)}
 #central-warehouse-form[data-stock-template=manual] .cwf-frame{max-height:calc(100dvh - 50px)}
}
/* StockItemModal / stock-detail-refined.css presentation adapter, no data/API logic. */
dialog.cw-detail-dialog{box-sizing:border-box;width:min(800px,calc(100vw - 32px));max-width:800px;max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid #e5dfd5;border-radius:24px;overflow:hidden;background:#fff;color:#292725;font-family:Outfit,system-ui,sans-serif}
dialog.cw-detail-dialog::backdrop{background:rgba(28,25,23,.65);backdrop-filter:blur(8px)}
.cw-detail-dialog *{box-sizing:border-box}
.cw-detail-dialog .sim-detail-card{display:flex;flex-direction:column;min-height:0;max-height:calc(100dvh - 34px)}
.cw-detail-dialog .sim-detail-header{padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #e5dfd5;flex:none}
.cw-detail-dialog .sim-identity{display:flex;align-items:center;gap:10px;min-width:0}
.cw-detail-dialog .sim-identity>svg{width:28px;height:28px;flex:none;color:#8b1515}
.cw-detail-dialog .sim-identity h2{font:600 25px/1.2 Outfit,system-ui,sans-serif;letter-spacing:0;margin:0;overflow-wrap:anywhere}
.cw-detail-dialog .sim-detail-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex:none}
.cw-detail-dialog button{min-height:40px;border:1px solid #e5dfd5;border-radius:999px;padding:0 14px;background:#faf8f5;color:#44403a;font:500 14px/1.2 Outfit,system-ui,sans-serif;cursor:pointer}
.cw-detail-dialog button:focus-visible{outline:2px solid #8b1515;outline-offset:2px}
.cw-detail-dialog .sim-detail-body{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-content:start;gap:12px;padding:16px;overflow:auto;min-height:0;flex:1}
.cw-detail-dialog :is(.sim-settings,.sim-recipes){background:#faf8f5;border:1px solid #e5dfd5;border-radius:14px;padding:14px;min-width:0;display:flex;flex-direction:column;gap:10px}
.cw-detail-dialog .sim-detail-fields{grid-column:1/-1}
.cw-detail-dialog .sim-detail-fields dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin:0}
.cw-detail-dialog .sim-detail-fields dl>div{min-width:0;padding:8px 0;border-bottom:1px solid #e5dfd5}
.cw-detail-dialog :is(dt,dd){margin:0;overflow-wrap:anywhere}
.cw-detail-dialog dt{font:400 13px/1.35 Outfit,sans-serif;color:#78716c}
.cw-detail-dialog dd{font:500 15px/1.4 Outfit,sans-serif;color:#292725;margin-top:4px}
.cw-detail-dialog .sim-detail-body h3{font:300 18px/1.25 Outfit,sans-serif;margin:0}
.cw-detail-dialog .sim-detail-body h3 b{font-weight:600}
.cw-detail-dialog :is(.cw-detail-lines,.cw-detail-history){display:flex;flex-direction:column;gap:0;max-height:260px;overflow:auto;min-width:0}
.cw-detail-dialog :is(.cw-detail-lines,.cw-detail-history)>*{padding:9px 0;border-bottom:1px solid #e5dfd5;font:400 14px/1.4 Outfit,sans-serif;overflow-wrap:anywhere}
.cw-detail-dialog .sim-detail-note{grid-column:1/-1;font:400 13px/1.4 Outfit,sans-serif;color:#78716c}
@media(max-width:650px){dialog.cw-detail-dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}.cw-detail-dialog .sim-detail-header{flex-wrap:wrap;padding:14px}.cw-detail-dialog .sim-identity h2{font-size:22px}.cw-detail-dialog .sim-detail-actions{width:100%;justify-content:flex-end}.cw-detail-dialog .sim-detail-body{display:flex;flex-direction:column;padding:12px}.cw-detail-dialog .sim-detail-fields dl{grid-template-columns:1fr}}

#central-warehouse-form .audit-search input.audit-search-input{padding-left:31px;border-radius:999px;height:36px;min-height:36px}
#central-warehouse-form .trf-extra-charge{display:block}
#central-warehouse-form .trf-extra-charge summary{font-size:13px;cursor:pointer;color:#e0d9d1}
#central-warehouse-form .trf-extra-charge summary small{display:block;font-size:11px;color:#a8a29e;margin:3px 0 8px}
#central-warehouse-form .trf-extra-charge[open]>.cwf-field{margin-top:10px}

.cw-detail-dialog .sim-detail-body>.sim-recipes{grid-column:1/-1}

.cw-detail-dialog .sim-stock-summary{grid-column:1/-1;display:flex;justify-content:space-between;gap:20px;padding:14px 18px;background:#292725;border:0;border-radius:14px;color:#fff}
.cw-detail-dialog .sim-stock-summary>div{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;min-width:0}
.cw-detail-dialog .sim-stock-summary span{font:400 14px/1.3 Outfit,sans-serif;color:#e0d9d1}
.cw-detail-dialog .sim-stock-summary strong{font:600 25px/1.2 Outfit,sans-serif;color:#fff;white-space:nowrap}
.cw-detail-dialog .sim-stock-summary small{font:400 14px/1.3 Outfit,sans-serif;color:#e0d9d1}
@media(max-width:650px){.cw-detail-dialog .sim-stock-summary{gap:12px;padding:12px}.cw-detail-dialog .sim-stock-summary>div{flex-direction:column;align-items:flex-start;gap:5px}.cw-detail-dialog .sim-stock-summary strong{font-size:23px}}
@media(max-width:360px){.cw-detail-dialog .sim-stock-summary{flex-wrap:wrap}.cw-detail-dialog .sim-stock-summary>div{flex:1 1 80px}}
/* Keep the branch transfer surface, stacking fields before their labels become unreadable. */
@media(max-width:480px){
 #central-warehouse-form .trf-route-fields{grid-template-columns:minmax(0,1fr);gap:8px}
 #central-warehouse-form .trf-route-fields section{flex-direction:row;align-items:center;gap:10px;padding:12px}
 #central-warehouse-form .trf-route-fields>.trf-route-arrow{justify-self:center;transform:rotate(90deg);width:18px;height:18px}
 #central-warehouse-form .trf-destination-box .cwf-field{width:100%;flex-direction:column;align-items:stretch}
 #central-warehouse-form .trf-item-row{grid-template-columns:minmax(0,1fr) 28px;align-items:end}
 #central-warehouse-form .trf-item-row>div:first-child{grid-column:1/-1}
 #central-warehouse-form .trf-item-row>div:nth-child(2){grid-column:1;grid-row:2}
 #central-warehouse-form .trf-item-row>.cwf-remove{grid-column:2;grid-row:2;min-height:38px}
 #central-warehouse-form .trf-item-row>div:nth-child(3){grid-column:1/-1;grid-row:3}
 #central-warehouse-form .trf-item-row .trf-packaging{grid-column:1/-1;grid-template-columns:minmax(0,1fr)}
}
