/* Compact order workspace, colors are shared by status selectors and list badges. */
#editor.order-editor{width:min(1130px,94vw);max-width:1130px;max-height:88vh}
#editor.order-editor>header{padding:16px 20px 10px}.order-header #editor-title{font-size:24px}.order-header-action .button{padding:8px 12px;font-size:12px}
.order-editor .order-layout{grid-template-columns:minmax(0,1fr) 200px;min-height:48vh}.order-editor .order-main{padding:10px 20px 18px}.order-context{padding-bottom:10px}
.order-editor .order-card-tabs button{padding:10px 8px;font-size:13px}.order-editor .card-status{margin-bottom:18px}.order-block{margin-bottom:16px}
.order-editor .works-controls{grid-template-columns:minmax(190px,1.4fr) 32px minmax(150px,1fr);gap:8px 12px}.order-editor .works-controls input,.order-editor .works-controls select{height:36px;font-size:13px}.order-editor .works-controls>.button{min-height:36px;font-size:13px}.work-search-results{margin-top:8px}.work-search-results .button{padding:6px 10px;font-size:12px}
.order-editor .line-table{min-width:590px}.order-editor .line-table td,.order-editor .line-table th{padding:8px 6px;font-size:12px}.line-table [data-warranty]{width:80px}.order-editor .line-table input{padding:6px;font-size:12px}.lines-empty td{height:65px}.order-editor #master-note{min-height:70px}.order-editor .order-history{padding:18px 14px}.order-editor .order-history h3{font-size:21px;margin-bottom:18px}.order-editor>footer{padding:12px 20px;gap:10px}.order-footer-actions .button{font-size:12px;padding:8px 12px}.work-totals strong{font-size:16px}
.pill,#card-status{--status-bg:#e5f0ff;--status-text:#145ba3;--status-line:#b3d1f3}
.pill.work,#card-status[data-tone=work],#card-status option[data-tone=work]{--status-bg:#fff1cc;--status-text:#805800;--status-line:#e6c96e}
.pill.approval,#card-status[data-tone=approval],#card-status option[data-tone=approval]{--status-bg:#f0e7ff;--status-text:#6740a1;--status-line:#c8b1ef}
.pill.parts,#card-status[data-tone=parts],#card-status option[data-tone=parts]{--status-bg:#ffe8d9;--status-text:#98451c;--status-line:#eab896}
.pill.ready,#card-status[data-tone=ready],#card-status option[data-tone=ready]{--status-bg:#def4e6;--status-text:#196440;--status-line:#95d0ae}
.pill.closed,#card-status[data-tone=closed],#card-status option[data-tone=closed]{--status-bg:#edf0f4;--status-text:#596574;--status-line:#cbd3df}
.pill,.order-editor #card-status,.order-editor #card-status option{background:var(--status-bg);color:var(--status-text);border-color:var(--status-line)}.pill{border:1px solid var(--status-line)}
:root[data-theme=dark] .pill,:root[data-theme=dark] #card-status{--status-bg:#224c77;--status-text:#c9e3ff;--status-line:#5a8ab9}
:root[data-theme=dark] .pill.work,:root[data-theme=dark] #card-status[data-tone=work]{--status-bg:#675120;--status-text:#ffe4a0;--status-line:#b99842}
:root[data-theme=dark] .pill.approval,:root[data-theme=dark] #card-status[data-tone=approval]{--status-bg:#51406a;--status-text:#e4d2ff;--status-line:#9981bd}
:root[data-theme=dark] .pill.parts,:root[data-theme=dark] #card-status[data-tone=parts]{--status-bg:#683e29;--status-text:#ffd8be;--status-line:#ba835f}
:root[data-theme=dark] .pill.ready,:root[data-theme=dark] #card-status[data-tone=ready]{--status-bg:#24563e;--status-text:#bef1d3;--status-line:#61a77f}
:root[data-theme=dark] .pill.closed,:root[data-theme=dark] #card-status[data-tone=closed]{--status-bg:#424e5c;--status-text:#dae2ec;--status-line:#7d8b9d}
#part-choices{padding:12px;margin-top:10px}#part-query{width:100%;margin:8px 0}#part-search-status{font-size:12px;margin-bottom:6px}.part-search-results{max-height:220px;overflow:auto;border-radius:4px}.part-search-results .sale-product{width:100%;background:var(--field);color:var(--text);border-color:var(--line)}.part-search-results .sale-product:hover,.part-search-results [aria-selected=true]{background:var(--accent-soft)}.part-search-results .sale-product small{color:var(--muted)}.part-search-results .sale-product:disabled{opacity:.5;cursor:not-allowed}
#editor:has(#migration-upload){width:min(1100px,95vw);max-width:1100px}#migration-upload{border-bottom:1px solid var(--line);padding-bottom:15px;margin-bottom:20px}#migration-workspace table td{white-space:normal;min-width:130px}.migration-check-area{margin-top:20px}.migration-ack{display:flex;flex-direction:row;align-items:flex-start;gap:10px;font-weight:400;line-height:1.5;margin:16px 0}.migration-ack input{width:auto;margin-top:4px}#migration-options select{max-width:100%}.settings-card ol{line-height:1.8}.import-order-note{padding:10px 14px;margin:0 0 16px;border:1px solid var(--line);border-radius:5px;background:var(--surface-alt);font-size:12px;color:var(--muted)}
@media(max-width:850px){.order-editor .order-layout{grid-template-columns:1fr}.order-editor .order-history{max-height:180px;overflow:auto}.order-editor .order-main{padding:12px}.order-editor .order-history h3{font-size:18px}.order-editor .order-card-tabs button{font-size:11px}}
@media(max-width:560px){#editor.order-editor{width:98vw;max-height:94vh}.order-header #editor-title{font-size:21px}.order-editor .works-controls{grid-template-columns:1fr}.order-editor>footer{padding:10px}.order-footer-actions .button{font-size:11px;padding:8px}.order-editor .order-card-tabs button{padding:9px 4px}}

.history-event strong.pill{background:var(--status-bg);color:var(--status-text);border-color:var(--status-line)}
.order-editor #card-status option[data-tone=new]{--status-bg:#e5f0ff;--status-text:#145ba3;--status-line:#b3d1f3}
.pill.issued,#card-status[data-tone=issued],#card-status option[data-tone=issued]{--status-bg:#dcf3f6;--status-text:#176978;--status-line:#8ecbd6}
:root[data-theme=dark] .pill.issued,:root[data-theme=dark] #card-status[data-tone=issued]{--status-bg:#24525d;--status-text:#c0edf4;--status-line:#63a6b4}
