.ob-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0;padding:10px 12px;border:1px solid var(--erp-border,#dfe7f2);border-radius:10px;background:var(--ui-surface,#fff);color:var(--erp-text,#183153)}
.ob-toolbar>label{display:flex;align-items:center;gap:6px;white-space:nowrap}.ob-toolbar input[type=checkbox],.ob-field input[type=checkbox],.ob-empty-only input{width:15px;height:15px;accent-color:var(--ui-accent,#2e7ef7)}
.ob-toolbar .ob-selected{font-size:12px;color:#73849b}.ob-toolbar .ob-link{border:0;background:transparent;color:var(--ui-accent,#2878ef);cursor:pointer;padding:5px}.ob-toolbar .ob-actions{display:flex;gap:7px;flex-wrap:wrap;margin-left:auto}.ob-toolbar svg,.ob-dialog svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.ob-toolbar .btn,.ob-dialog .btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
dialog.ob-dialog{width:min(860px,calc(100vw - 24px));max-width:860px;max-height:calc(100dvh - 28px);padding:0;border:1px solid var(--erp-border,#dce6f3);border-radius:15px;overflow:auto;color:var(--erp-text,#183153);background:var(--ui-surface,#fff);box-shadow:0 20px 65px #16375726}
.ob-dialog::backdrop{background:var(--ui-overlay,#18315355)}.ob-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:10px;padding:15px 18px;background:var(--ui-surface,#fff);border-bottom:1px solid #e6edf6}.ob-head h2{font-size:17px;margin:0;flex:1}.ob-head .erp-v5-close{margin-left:auto}.ob-body{padding:18px}.ob-footer{position:sticky;bottom:0;z-index:2;display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding:13px 18px;border-top:1px solid #e6edf6;background:var(--ui-surface,#fff)}
.ob-caption,.ob-hint{font-size:12px;color:#73849b;line-height:1.7;margin:0 0 13px}.ob-hint{margin:12px 0}.ob-error{font-size:13px;color:#d14545;background:#fff3f2;border-radius:7px;padding:9px}.ob-error[hidden]{display:none}
.ob-dialog .ob-body{flex:1;min-height:0;overflow:auto}.ob-dialog .ob-head,.ob-dialog .ob-footer{flex-shrink:0}
.ob-excluded{padding:10px;background:#fff8eb;border-radius:8px;font-size:12px;color:#936a27}.ob-excluded p{margin:7px 0;overflow-wrap:anywhere}.ob-result-table{overflow:auto;max-height:42dvh;border:1px solid #e1e9f3;border-radius:8px}.ob-result-table table{width:100%;border-collapse:collapse;font-size:12px}.ob-result-table th{position:sticky;top:0;background:var(--erp-table-head,#f5f8fc);color:inherit;z-index:1;white-space:nowrap}.ob-result-table th,.ob-result-table td{padding:10px;text-align:left;border-bottom:1px solid #e7edf5}.ob-result-table td:last-child{min-width:160px;overflow-wrap:anywhere}.ob-result-table td:first-child{white-space:nowrap}.ob-tag{display:inline-block;padding:4px 6px;border-radius:5px;white-space:nowrap;background:#edf3fb;color:#647c9c}.ob-accepted,.ob-done{background:#e8f8f0;color:#0d9d6d}.ob-failed{background:#fff0ee;color:#d24d4d}.ob-uncertain{background:#fff6e5;color:#c27a15}.ob-loading{display:flex;align-items:center;justify-content:center;gap:8px;min-height:100px;color:#2878ef}.ob-loading svg{animation:ob-spin 1s linear infinite}@keyframes ob-spin{to{transform:rotate(360deg)}}
@media(max-width:640px){.ob-toolbar{padding:9px;gap:6px}.ob-toolbar .ob-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0}.ob-toolbar .btn{width:100%;font-size:12px;padding:8px 5px}.ob-body{padding:13px}.ob-head{padding:12px 13px}.ob-head h2{font-size:16px}.ob-footer{padding:11px 13px}.ob-footer .btn{font-size:12px;flex:1}.ob-edit-grid{gap:12px}.ob-field{grid-column:1/-1}.ob-result-table{max-height:38dvh}}
@media(prefers-reduced-motion:reduce){.ob-loading svg{animation:none}}

/* Batch mode uses the original purchase form and its existing responsive grid. */
@layer erpComponents {
 html body.erp-system-ui #purchaseForm.purchase-bulk-form .field>label{display:flex!important;align-items:center;gap:7px}
 html body.erp-system-ui #purchaseForm.purchase-bulk-form input[data-pb-field],
 html body.erp-system-ui #purchaseForm .purchase-bulk-options input[type=checkbox]{width:15px!important;height:15px!important;min-width:15px!important;margin:0!important;padding:0!important;accent-color:var(--ui-accent);flex:none}
 html body.erp-system-ui #purchaseForm .purchase-bulk-options{display:flex;flex-direction:column;gap:7px;padding:10px 12px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-accent-soft);font-size:13px}
 html body.erp-system-ui #purchaseForm .purchase-bulk-caption{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
 html body.erp-system-ui #purchaseForm .purchase-bulk-caption>label{display:flex;align-items:center;gap:6px;font-size:12px}
 html body.erp-system-ui #purchaseForm .purchase-bulk-options small{color:var(--dm-muted,#73849b);font-size:12px}
 html body.erp-system-ui #purchaseBulkError{margin:0;color:var(--ui-danger,#d14545);font-size:12px}
}

/* Batch confirmations use the same native-dialog frame and theme tokens as ERP editors. */
@layer erpComponents {
 html body.erp-system-ui dialog.lc-dialog.ob-dialog{box-sizing:border-box!important;width:min(860px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 32px)!important;padding:0!important;margin:auto!important;border:1px solid var(--ui-border,#dfe7f0)!important;border-radius:var(--ui-dialog-radius,12px)!important;overflow:hidden!important;box-shadow:var(--ui-dialog-shadow,0 20px 65px #16375726)!important;}
 html body.erp-system-ui dialog.lc-dialog.ob-dialog[open]{display:flex!important;flex-direction:column!important;}
 html body.erp-system-ui dialog.lc-dialog.ob-dialog::backdrop{background:var(--ui-overlay,#18315355)!important;backdrop-filter:blur(3px)!important;}
 html body.erp-system-ui .ob-dialog>.ob-head{position:relative!important;flex:0 0 auto!important;display:flex!important;align-items:center!important;gap:10px!important;margin:0!important;padding:15px 20px!important;border-bottom:1px solid var(--ui-border-soft,#e6edf5)!important;background:var(--ui-surface,#fff)!important;}
 html body.erp-system-ui .ob-dialog .ob-heading-icon{display:grid!important;place-items:center!important;flex:0 0 36px!important;width:36px!important;height:36px!important;border:0!important;border-radius:10px!important;background:var(--dlg-wash,#edf3ff)!important;color:var(--dlg-ink,#3777ce)!important;}
 html body.erp-system-ui .ob-dialog .ob-head h2{flex:1!important;min-width:0!important;margin:0!important;font-size:17px!important;line-height:1.5!important;font-weight:600!important;}
 html body.erp-system-ui .ob-dialog .ob-close{display:grid!important;place-items:center!important;flex:0 0 32px!important;width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;margin:0 0 0 auto!important;padding:0!important;}
 html body.erp-system-ui .ob-dialog>.ob-body{flex:1 1 auto!important;min-height:0!important;padding:18px 20px!important;overflow:auto!important;overscroll-behavior:contain!important;}
 html body.erp-system-ui .ob-dialog>.ob-footer{position:relative!important;display:flex!important;justify-content:flex-end!important;gap:8px!important;flex:0 0 auto!important;flex-wrap:wrap!important;margin:0!important;padding:13px 20px!important;border-top:1px solid var(--ui-border-soft,#e6edf5)!important;background:var(--ui-field-surface,#f8faff)!important;}
 html body.erp-system-ui .ob-dialog .ob-footer>.erp-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-height:36px!important;border-radius:8px!important;white-space:nowrap!important;}
 html body.erp-system-ui .ob-dialog :is(.ob-caption,.ob-hint){color:var(--dlg-muted,#7d8da5)!important;}
 html body.erp-system-ui .ob-dialog .ob-result-table{border-color:var(--ui-border-soft,#e6edf5)!important;border-radius:9px!important;}
 html body.erp-system-ui .ob-dialog .ob-result-table th{background:var(--ui-field-surface,#f8faff)!important;color:var(--ui-label,#344054)!important;font-weight:500!important;}
 html body.erp-system-ui .ob-dialog .ob-result-table :is(th,td){border-color:var(--ui-border-soft,#e6edf5)!important;}
 html body.erp-system-ui .ob-dialog .ob-tag{background:var(--ui-field-surface,#f8faff)!important;color:var(--dlg-muted,#7d8da5)!important;}
 html body.erp-system-ui .ob-dialog :is(.ob-accepted,.ob-done){background:color-mix(in srgb,var(--fin-green,#24875c) 10%,var(--ui-surface,#fff))!important;color:var(--fin-green,#24875c)!important;}
 html body.erp-system-ui .ob-dialog .ob-failed{background:color-mix(in srgb,var(--fin-red,#c84e65) 10%,var(--ui-surface,#fff))!important;color:var(--fin-red,#c84e65)!important;}
 html body.erp-system-ui .ob-dialog .ob-uncertain{background:color-mix(in srgb,var(--fin-amber,#ac720d) 10%,var(--ui-surface,#fff))!important;color:var(--fin-amber,#ac720d)!important;}
 html body.erp-system-ui .ob-dialog .ob-error{background:color-mix(in srgb,var(--fin-red,#c84e65) 8%,var(--ui-surface,#fff))!important;color:var(--fin-red,#c84e65)!important;}
 html body.erp-system-ui .ob-dialog .ob-error[hidden]{display:none!important;}
 html body.erp-system-ui .ob-dialog td.ob-empty{text-align:center!important;padding:28px 12px!important;color:var(--dlg-muted,#7d8da5)!important;}
 html body.erp-system-ui .ob-dialog svg{width:17px!important;height:17px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.7!important;stroke-linecap:round!important;stroke-linejoin:round!important;flex-shrink:0!important;}
}
@layer erpComponents {
 html body.erp-system-ui .ob-dialog .ob-order-list{max-height:48dvh!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list td:last-child{min-width:120px!important;overflow-wrap:anywhere!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list table{table-layout:auto!important;}
 html body.erp-system-ui .ob-dialog .ob-excluded{margin-top:12px!important;background:var(--ui-field-surface,#f8faff)!important;color:var(--dlg-muted,#7d8da5)!important;}
 @media(max-width:640px){html body.erp-system-ui dialog.lc-dialog.ob-dialog{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;}html body.erp-system-ui .ob-dialog>.ob-head{padding:12px 14px!important;}html body.erp-system-ui .ob-dialog>.ob-body{padding:14px!important;}html body.erp-system-ui .ob-dialog>.ob-footer{padding:11px 14px!important;}html body.erp-system-ui .ob-dialog .ob-footer>.erp-btn{flex:1 1 auto!important;min-width:0!important;}}
}

/* Four distinct columns; product media and identity share the ERP renderers. */
@layer erpComponents {
 html body.erp-system-ui dialog.lc-dialog.ob-dialog{width:min(1040px,calc(100vw - 32px))!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list{max-height:54dvh!important;overflow:auto!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list table{width:100%!important;min-width:0!important;table-layout:fixed!important;}
 html body.erp-system-ui .ob-dialog .ob-col-shop{width:15%!important;}
 html body.erp-system-ui .ob-dialog .ob-col-order{width:21%!important;}
 html body.erp-system-ui .ob-dialog .ob-col-product{width:40%!important;}
 html body.erp-system-ui .ob-dialog .ob-col-delivery{width:24%!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list :is(th,td){box-sizing:border-box!important;min-width:0!important;max-width:none!important;padding:14px 12px!important;vertical-align:middle!important;text-align:center!important;white-space:normal!important;overflow-wrap:anywhere!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list th{padding:12px!important;}
 html body.erp-system-ui .ob-dialog .ob-order-list td+td{border-left:1px solid var(--ui-border-soft,#e6edf5)!important;}
 html body.erp-system-ui .ob-dialog .ob-shop{margin:0!important;line-height:1.7!important;color:var(--ui-label,#344054)!important;}
 html body.erp-system-ui .ob-dialog :is(.fb-order-copy,.fb-order-center-copy){min-width:0!important;padding:0!important;border:0!important;background:none!important;color:var(--ui-accent,#2878ef)!important;font:inherit!important;cursor:pointer!important;line-height:inherit!important;overflow-wrap:anywhere!important;white-space:normal!important;text-align:inherit!important;}
 html body.erp-system-ui .ob-dialog :is(.fb-order-copy,.fb-order-center-copy):hover{text-decoration:underline!important;}
 html body.erp-system-ui .ob-dialog .ob-product-item+.ob-product-item{margin-top:12px!important;padding-top:12px!important;border-top:1px solid var(--ui-border-soft,#e6edf5)!important;}
 html body.erp-system-ui .ob-dialog :is(.fb-order-products,.fb-order-center-products){display:block!important;min-width:0!important;width:100%!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;}
 html body.erp-system-ui .ob-dialog .fb-order-center-product{display:flex!important;gap:12px!important;align-items:center!important;justify-content:center!important;min-width:0!important;width:100%!important;}
 html body.erp-system-ui .ob-dialog .legacy-cell-lines{flex:1!important;min-width:0!important;max-width:100%!important;line-height:1.8!important;text-align:left!important;}
 html body.erp-system-ui .ob-dialog :is(.sku-single-line,.offer-single-line){min-width:0!important;display:flex!important;align-items:baseline!important;gap:4px!important;white-space:normal!important;}
 html body.erp-system-ui .ob-dialog .product-name-line{display:flex!important;min-width:0!important;align-items:baseline!important;}
 html body.erp-system-ui .ob-dialog .product-name-label{flex-shrink:0!important;}
 html body.erp-system-ui .ob-dialog .legacy-prod-title{display:block!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:inherit!important;}
 html body.erp-system-ui .ob-dialog .fb-order-quantity{display:block!important;margin-top:3px!important;color:var(--ui-accent,#2878ef)!important;font-size:12px!important;}
 html body.erp-system-ui .ob-dialog .delivery-service-card{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:4px!important;max-width:100%!important;margin:auto!important;padding:10px 8px!important;border:1px solid var(--ui-border-soft,#e6edf5)!important;border-radius:9px!important;background:var(--ui-field-surface,#f8faff)!important;text-align:center!important;}
 html body.erp-system-ui .ob-dialog .delivery-service-label{display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;margin:0!important;font-size:11px!important;color:var(--dlg-muted,#7d8da5)!important;}
 html body.erp-system-ui .ob-dialog .delivery-service-label svg{width:14px!important;height:14px!important;}
 html body.erp-system-ui .ob-dialog .delivery-service-name{width:100%!important;min-width:0!important;margin:0!important;white-space:normal!important;overflow-wrap:anywhere!important;font-size:12px!important;line-height:1.65!important;color:var(--ui-text,#344054)!important;}
 html body.erp-system-ui .ob-dialog .delivery-service-name+.delivery-service-label{margin-top:6px!important;}
 html body.erp-system-ui .ob-dialog .ob-list-pager{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;margin-top:12px!important;font-size:12px!important;}
 @media(max-width:700px){
  html body.erp-system-ui .ob-dialog .ob-order-list :is(table,tbody){display:block!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list :is(colgroup,thead){display:none!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list tr{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr)!important;padding:6px!important;border-bottom:1px solid var(--ui-border-soft,#e6edf5)!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list td{display:block!important;padding:9px!important;border:0!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list td::before{content:attr(data-label)!important;display:block!important;margin-bottom:7px!important;color:var(--dlg-muted,#7d8da5)!important;font-size:11px!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list :is(td.ob-product,td.ob-delivery,td.ob-empty){grid-column:1/-1!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list td.ob-product{border-top:1px solid var(--ui-border-soft,#e6edf5)!important;}
  html body.erp-system-ui .ob-dialog .ob-order-list .ob-product::before{display:none!important;}
  html body.erp-system-ui .ob-dialog .ob-product-item{padding:4px 0!important;}
 }
}

/* Keep layout overrides in the shared media layer. Native order state classes
 * supply status colors; legacy-thumb/legacy-ph supply ERP's 3:4 image frame. */
@layer erpColorMode.overrides {
 html body.erp-system-ui .ob-dialog .ob-order-identity{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:8px!important;width:100%!important;min-width:0!important;min-height:80px!important;height:auto!important;margin:0!important;padding:0!important;text-align:center!important;}
 html body.erp-system-ui .ob-dialog .ob-order-identity :is(.posting-main,.status-main){width:100%!important;min-width:0!important;margin:0!important;line-height:1.7!important;text-align:center!important;}
 html body.erp-system-ui .ob-dialog .ob-order-identity .posting-main{display:flex!important;align-items:center!important;justify-content:center!important;}
 html body.erp-system-ui .ob-dialog .ob-order-identity .fb-order-copy{display:inline-block!important;flex:0 1 auto!important;min-width:0!important;width:auto!important;max-width:100%!important;min-height:0!important;height:auto!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;font:inherit!important;line-height:1.7!important;text-align:center!important;white-space:normal!important;overflow-wrap:anywhere!important;}
 html body.erp-system-ui .ob-dialog .fb-thumb-button{box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;align-self:center!important;flex:none!important;width:var(--erp-list-image-width,60px)!important;min-width:var(--erp-list-image-width,60px)!important;max-width:var(--erp-list-image-width,60px)!important;height:calc(var(--erp-list-image-width,60px) * 4 / 3)!important;min-height:calc(var(--erp-list-image-width,60px) * 4 / 3)!important;max-height:calc(var(--erp-list-image-width,60px) * 4 / 3)!important;margin:0!important;padding:0!important;border:0!important;border-radius:7px!important;background:transparent!important;cursor:zoom-in!important;}
}
