/* Use the same surfaces, fields and buttons as the Inventory dashboard. */
.wired-order { width:min(1100px,96vw); height:min(880px,94dvh); max-height:94dvh; background:var(--card); }
.wired-order .drawer-head, .wired-order .drawer-foot { flex-shrink:0; background:var(--card); }
.wired-order .drawer-foot { justify-content:space-between; gap:12px; border-top:1px solid var(--border); }
.wired-order .drawer-head h2 { margin:0; }
.wired-order .wired-navigation { flex-shrink:0; padding:12px 20px; border-bottom:1px solid var(--border); background:var(--card); }
.wired-order .wired-tabs { display:flex; width:100%; gap:4px; margin:0; }
.wired-order .wired-tabs button { flex:1; min-height:38px; }
.wired-order .modal-body { flex:1; min-height:0; padding:20px; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.wired-order [data-body] > .field { margin-bottom:16px; }
.wired-order .wired-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.wired-order .field { min-width:0; }
.wired-order input, .wired-order select { width:100%; min-width:0; min-height:38px; padding:8px 10px; border:1px solid var(--border-strong); border-radius:6px; background:var(--field-bg); color:var(--text); font:inherit; }
.wired-order input:focus-visible, .wired-order select:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.wired-order .field > span { display:block; margin-bottom:7px; color:var(--muted); font-size:11px; font-weight:750; text-transform:uppercase; }
.wired-order .wired-item { margin:12px 0; padding:16px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2); }
.wired-order .wired-row { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.wired-order .wired-row > div:first-child { flex:1; min-width:0; }
.wired-order .wired-muted { color:var(--muted); font-size:12px; }
.wired-order .wired-qty { width:120px; flex-shrink:0; }
.wired-order .wired-warning { color:var(--amber-text); }
.wired-order .wired-good { color:var(--green-text); }
.wired-order .wired-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.wired-order .wired-lot { display:grid; grid-template-columns:minmax(230px,1fr) 100px 100px 120px 36px; gap:12px; align-items:end; margin-top:14px; }
.wired-order .wired-check { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.wired-order .wired-check input { width:16px; min-height:16px; }
.wired-order .wired-packaged-confirmation .wired-check { min-height:44px; white-space:normal; }
.wired-order .wired-note { padding:12px 16px; margin:16px 0; border:1px solid var(--blue-border); border-radius:8px; background:var(--blue-soft); color:var(--text); }
.wired-order .wired-review-table { width:100%; border-collapse:collapse; font-size:12px; }
.wired-order .wired-review-table th, .wired-order .wired-review-table td { padding:12px 10px; text-align:left; border-bottom:1px solid var(--border); vertical-align:top; overflow-wrap:anywhere; }
.wired-order .wired-review-table th { background:var(--surface-2); color:var(--muted); font-size:11px; text-transform:uppercase; }
.wired-order .wired-package-measures { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:16px; }
.wired-order .wired-package-measures .field { flex:0 0 112px; }
.wired-order .number-stepper { width:100%; }
.wired-order details { margin-top:12px; }
.wired-order summary { color:var(--blue-text); cursor:pointer; }
.wired-order [hidden] { display:none!important; }
html[data-theme="dark"] .wired-order select { color-scheme:dark; }
html[data-theme="light"] .wired-order select { color-scheme:light; }
@media(max-width:750px) {
 .wired-order .modal-body { padding:14px; }
 .wired-order .wired-navigation { padding:10px 14px; }
 .wired-order .wired-grid { grid-template-columns:1fr 1fr; }
 .wired-order .wired-lot { grid-template-columns:1fr 1fr; }
 .wired-order .wired-lot > .field:first-child { grid-column:1/-1; }
 .wired-order .wired-row { flex-wrap:wrap; align-items:flex-start; }
 .wired-order .wired-row > div:first-child { flex-basis:100%; }
 .wired-order .drawer-foot > .wired-muted { max-width:140px; font-size:10px; }
 .wired-order .wired-review-table th, .wired-order .wired-review-table td { padding:8px 4px; font-size:10px; }
}
@media(prefers-reduced-motion:reduce) { .wired-order { animation:none; } }

.wired-order .field { margin-bottom:0; }
.wired-order .drawer-foot { flex-wrap:wrap; }
.wired-order .wired-draft-status { flex:1 0 100%; font-size:12px; color:var(--muted); }
.wired-order .wired-draft-status:empty { display:none; }
.wired-order .wired-grid .number-stepper { width:120px; }
.wired-order .wired-grid:has([data-config="preset"]) { grid-template-columns:1fr 2fr; }
.wired-order .wired-item p { margin:8px 0; }
.wired-order .wired-item > input { margin-top:4px; }


.wired-order .wired-submit-status { flex:1; min-width:0; min-height:42px; max-height:110px; overflow:auto; color:var(--red-text, #ef6b73); font-weight:600; font-size:12px; }
.wired-order .drawer-foot > .wired-actions { flex-shrink:0; }

.wired-order .wired-preset-row { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.wired-order .wired-preset-row > .field { flex:1 1 300px; }
.wired-order .wired-preset-row > .badge { align-self:center; margin-top:18px; }
.wired-order .wired-layout { display:flex; flex-wrap:wrap; gap:16px; margin:16px 0; }
.wired-order .wired-layout .field { flex:0 1 145px; }
.wired-order .wired-layout .number-stepper { width:112px; }
.wired-order .wired-preset-editor { border:1px solid var(--blue-border); border-radius:8px; padding:16px; margin-bottom:16px; background:var(--blue-soft); }
.wired-order .wired-preset-editor .wired-grid { grid-template-columns:1fr 1fr; }
.wired-order .wired-source { align-self:start; }
.wired-order .wired-source-picker { margin:0; border:1px solid var(--border-strong); border-radius:6px; background:var(--field-bg); }
.wired-order .wired-source-picker > summary { padding:10px; color:var(--text); cursor:pointer; overflow-wrap:anywhere; }
.wired-order .wired-source-picker > summary small { display:block; color:var(--muted); margin-top:5px; font-size:11px; }
.wired-order .wired-source-options { padding:10px; border-top:1px solid var(--border); max-height:320px; overflow:auto; }
.wired-order .wired-source-options > input { position:sticky; top:0; z-index:1; }
.wired-order [data-source-group] { margin-top:12px; border:1px solid var(--border); border-radius:6px; padding:10px; }
.wired-order [data-source-group] > header { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; font-size:12px; overflow-wrap:anywhere; }
.wired-order [data-source-group] > small { display:block; color:var(--muted); margin:8px 0; overflow-wrap:anywhere; }
.wired-order .wired-source-location { display:flex; width:100%; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border:0; border-top:1px solid var(--border); background:transparent; color:var(--text); text-align:left; font:inherit; font-size:12px; cursor:pointer; }
.wired-order .wired-source-location b { color:var(--blue-text); white-space:nowrap; }
.wired-order .wired-source-location:hover,.wired-order .wired-source-location[aria-pressed="true"] { background:var(--blue-soft); }
@media(max-width:750px){ .wired-order .wired-source{grid-column:1/-1;} .wired-order .wired-layout{gap:10px;} .wired-order .wired-layout .field{flex:1 1 110px;} .wired-order .wired-preset-editor .wired-grid{grid-template-columns:1fr;} }

/* Orders owns its scroll surface; dashboard controls must not bleed through. */
.wired-order-overlay { z-index:90; isolation:isolate; overscroll-behavior:none; --order-surface:#fff; }
:root[data-theme="dark"] .wired-order-overlay { --order-surface:#16202a; }
:root[data-theme="vaporwave"] .wired-order-overlay { --order-surface:#071b24; }
.wired-order-overlay .wired-order,
.wired-order-overlay .drawer-head,
.wired-order-overlay .wired-navigation,
.wired-order-overlay .modal-body,
.wired-order-overlay .drawer-foot { background:var(--order-surface); }
.wired-order .wired-source-options > input { background:var(--order-surface); }
@media(max-width:760px) {
 .wired-order-overlay { background:var(--order-surface); overflow:hidden; }
 .wired-order-overlay .wired-order { width:100%; max-width:none; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
 .wired-order-overlay .drawer-head { padding-top:calc(11px + env(safe-area-inset-top)); }
 .wired-order-overlay .modal-body { overscroll-behavior:none; }
}

.wired-rack-picker { margin: 12px 0; }
.wired-rack-picker .wired-source-location small { display: block; overflow-wrap: anywhere; }

.wired-collected { margin-top: 12px; min-height: 44px; cursor: pointer; }
.wired-exception { margin-top: 8px; color: var(--muted); }
.wired-exception summary { cursor: pointer; }
.wired-exception .wired-check { min-height: 44px; }

@media screen and (max-width:600px){
 .wired-order .wired-review-table,.wired-order .wired-review-table tbody {display:block}
 .wired-order .wired-review-table thead {display:none}
 .wired-order .wired-review-table tr {display:block;margin:12px 0;padding:10px;border:1px solid var(--border);border-radius:8px}
 .wired-order .wired-review-table td {display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;font-size:12px;padding:7px 0}
 .wired-order .wired-review-table td::before {content:attr(data-label);color:var(--muted);font-weight:600}
 .wired-order .wired-review-table td:first-child {display:block;color:var(--blue-text);font-weight:700}
 .wired-order .wired-review-table td:first-child::before {display:none}
 .wired-order .wired-review-table td:last-child {border-bottom:0}
}

.wired-order .shipping-package-measures table { width:100%;table-layout:fixed; }
.wired-order .shipping-package-measures td { overflow-wrap:anywhere;white-space:normal; }

@media(max-width:760px){
 .wired-order .wired-layout{display:grid;grid-template-columns:repeat(auto-fit,minmax(136px,1fr));gap:14px}
 .wired-order .wired-layout .field{min-width:0}
 .wired-order .wired-layout .number-stepper{width:136px;max-width:100%}
 .wired-order .wired-submit-status:empty{display:none}
 .wired-order .wired-submit-status{min-height:0}
}
