/* Reference layout: a restrained order sheet with fixed bottom controls. */
#editor.order-editor{width:min(1130px,94vw);max-width:1130px;border-radius:4px;max-height:88vh;min-height:min(740px,88vh)}
#editor.order-editor>header{padding:19px 24px 17px;gap:14px;border-bottom:0}.order-header #editor-title{font-size:25px;line-height:1.2;font-weight:600}.order-header>[data-close]{font-size:26px;padding:3px;min-width:24px;width:24px;height:30px;color:var(--muted)}
.order-editor .order-layout{grid-template-columns:minmax(0,1fr) 210px;min-height:calc(min(740px,88vh) - 138px)}.order-editor .order-main{padding:12px 24px 28px}.order-main:has([data-tab=works].active)>.order-context{display:none}
.order-editor .order-card-tabs{width:96%;margin:0 auto 10px;border-radius:3px;grid-template-columns:1.15fr 1.15fr .65fr;background:var(--surface-alt)}.order-editor .order-card-tabs button{padding:10px 8px;font-size:13px;font-weight:500}.order-editor .card-status{margin:0 0 26px}.order-editor #card-status{min-width:110px;border-width:1px;padding:6px 12px;font-size:12px}
.order-editor .works-controls{grid-template-columns:minmax(200px,1.2fr) 64px minmax(200px,1fr);gap:10px 12px}.order-editor .works-controls>label:first-child{grid-column:1;grid-row:1}.order-editor .works-controls>label:nth-child(2){grid-column:1;grid-row:2}.order-editor .works-controls select,.order-editor .works-controls input{height:37px;font-size:13px;padding:8px 12px;font-weight:400}.order-editor .work-or{grid-column:2;grid-row:2;font-size:13px}.part-add-control{grid-column:3;grid-row:2;position:relative}.part-add-control>span{position:absolute;left:0;bottom:calc(100% + 5px);color:var(--muted);font-size:12px}.part-add-control>.button{width:100%;height:37px;padding:8px 12px;font-size:13px;border-radius:3px}.order-editor .works-controls+ .work-search-results:empty{display:none}.order-editor .work-search-results{margin-top:10px}
.order-editor .work-table-block{margin-top:18px;margin-bottom:28px}.order-editor .line-table{min-width:620px}.order-editor .line-table th{padding:9px 6px;font-size:13px;background:transparent;font-weight:600}.order-editor .line-table td{padding:10px 6px;background:transparent}.order-editor .lines-empty td{height:36px;line-height:1.5}.order-editor .lines-empty span{font-size:12px}.order-editor .lines-empty small{display:none}
.order-editor .work-totals{padding-top:13px;gap:34px}.order-editor .work-totals span,.order-editor .work-profit span{font-weight:600;color:var(--text)}.order-editor .work-totals strong{font-size:17px;font-weight:600;min-width:130px}.order-editor .work-profit{gap:34px;padding-top:8px}.order-editor .work-profit strong{font-size:14px;min-width:130px}.order-editor #tab-works>.order-block:last-child{margin-top:32px}.order-editor .order-block h3{font-size:13px;color:var(--text);font-weight:500;margin-bottom:9px}.order-editor #master-note{min-height:80px;resize:vertical;line-height:1.5;font-size:13px;border-radius:3px}
.order-editor .order-history{padding:17px 18px;background:var(--surface-alt);border-left:1px solid var(--line)}.order-editor .order-history h3{font-size:25px;font-weight:400;margin:0 0 25px}.order-editor .history-event{padding-left:12px;padding-bottom:20px}.order-editor .history-event strong{font-weight:500;font-size:12px}.order-editor .history-event time{font-size:12px;margin-top:10px}
#editor.order-editor>footer{padding:13px 24px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:nowrap;border-top:1px solid var(--line);background:var(--surface)}.order-window-buttons{display:flex;align-items:center;gap:10px}.order-window-buttons>.button{min-width:88px;font-size:12px;padding:9px 15px;border-radius:3px}.order-window-buttons [data-action="order.issue"]:disabled{opacity:.5}.order-footer-actions{display:flex;gap:9px;margin-left:auto;max-width:none;flex-wrap:nowrap;align-items:center}.order-footer-actions .button{font-size:12px;padding:9px 14px;border-radius:3px}.order-footer-actions .print-menu{order:5}.order-footer-actions [data-action="order.close"]{color:var(--text);background:var(--surface-alt);border-color:var(--line)}.order-footer-actions .print-menu>summary{display:flex;gap:8px;align-items:center}.order-footer-actions .print-menu .icon{height:17px;width:17px}
:root[data-theme=dark] #editor.order-editor{--surface:#35424e;--surface-alt:#2e3a45;--field:#283640;--line:#647787;--muted:#c1cdd8;--hover:#405361;--text:#f1f5f8;background:var(--surface)}:root[data-theme=dark] .order-editor .order-card-tabs{background:#445360}:root[data-theme=dark] .order-editor .order-card-tabs button.active{background:#536675;color:#fff;box-shadow:none}:root[data-theme=dark] .order-editor .order-card-tabs button{color:#e5ebf1}:root[data-theme=dark] .order-editor .history-event small{color:#b4c3cf}
@media(max-width:850px){#editor.order-editor{min-height:0}.order-editor .order-layout{grid-template-columns:1fr;min-height:0}.order-editor .order-history{max-height:200px;padding:16px 20px;border-left:0}.order-editor .order-main{padding:12px 18px 24px}.order-editor .works-controls{grid-template-columns:minmax(190px,1fr) 30px minmax(160px,1fr)}.order-editor .order-card-tabs{width:100%}.order-editor .order-card-tabs button{font-size:12px}}
@media(max-width:560px){#editor.order-editor{width:98vw;max-height:94vh}#editor.order-editor>header{padding:15px 12px;gap:10px}.order-header #editor-title{font-size:21px}.order-editor .order-main{padding:10px 12px 20px}.order-editor .works-controls{grid-template-columns:1fr;gap:10px}.part-add-control{grid-column:1;grid-row:3;margin-top:17px}.order-editor .work-or{display:none}.order-editor .order-card-tabs button{font-size:10px;padding:10px 4px}.order-editor .card-status{margin-bottom:18px}#editor.order-editor>footer{padding:10px 12px;flex-wrap:wrap}.order-window-buttons>.button{min-width:74px;padding:8px 11px}.order-footer-actions{margin-left:auto;flex-wrap:wrap;gap:6px}.order-footer-actions .button{font-size:11px;padding:8px 10px}.order-editor .order-history h3{font-size:20px}}

.warranty-banner{padding:12px 16px;border:1px solid #82c0dc;background:#edf8fe;color:#245977;border-radius:6px}.warranty-original{opacity:.8}:root[data-theme=dark] .warranty-banner{background:#243c4c;color:#c9e8fa;border-color:#46718a}

/* Step 46: мастер слева, единый выбор работ/услуг/запчастей справа. */
.order-editor .order-responsible{display:flex;justify-content:flex-end;margin:-10px 0 16px}
.order-editor .order-responsible label{width:min(230px,100%);font-size:11px;color:var(--muted)}
.order-editor .order-responsible select{margin-top:5px;font-size:12px;padding:5px 10px;max-width:100%;height:33px}
.order-editor .works-controls-46{display:grid;grid-template-columns:minmax(185px,.83fr) minmax(285px,1.8fr);align-items:start;gap:22px}
.order-editor .works-controls-46>.work-master-control{grid-column:1;grid-row:1}
.order-editor .works-controls-46>.work-catalog-control{grid-column:2;grid-row:1;position:relative}
.order-editor .works-controls-46 label,.order-editor .works-controls-46 .work-catalog-control>label{font-size:12px;color:var(--text);font-weight:600}
.order-editor .works-controls-46 select,.order-editor .works-controls-46 input{margin-top:8px;width:100%;min-height:40px;border-radius:5px}
.order-editor .work-catalog-results{display:block;position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:5;max-height:300px;overflow-y:auto;margin:0;padding:5px;background:var(--surface);border:1px solid var(--line);border-radius:6px;box-shadow:0 6px 26px #0002}
.order-editor .work-catalog-results:empty{display:none}
.order-editor .work-catalog-heading{padding:9px 11px 5px;font-size:11px;color:var(--muted);font-weight:700}
.order-editor .work-catalog-option{border:0;border-radius:3px;background:transparent;display:flex;justify-content:space-between;align-items:center;width:100%;gap:8px;text-align:left;padding:9px 11px;color:var(--text);font:inherit;cursor:pointer}
.order-editor .work-catalog-option span{min-width:0}.order-editor .work-catalog-option strong{display:block;font-weight:600;font-size:12px}.order-editor .work-catalog-option small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.order-editor .work-catalog-option b{white-space:nowrap;font-size:12px;font-weight:600}.order-editor .work-catalog-option:hover,.order-editor .work-catalog-option[aria-selected=true]{background:var(--surface-alt)}.order-editor .work-catalog-option:disabled{opacity:.4;cursor:default}
.order-editor .work-catalog-custom{background:transparent;border:0;border-top:1px solid var(--line);padding:10px 11px;text-align:left;color:var(--text);cursor:pointer;width:100%;font-size:12px}
.order-editor .order-work-master-header td{background:var(--surface-alt);padding:11px 9px!important;vertical-align:middle;border-bottom:1px solid var(--line);white-space:normal}
.order-editor .order-work-master-header strong{font-size:13px;font-weight:600}.order-editor .order-work-master-header small{display:inline;margin-left:9px}
.order-editor .order-master-avatar{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#438ee0;color:#fff;font-weight:600;margin-right:10px}
.order-editor .line-table td.line-name select{display:block;margin-top:8px;max-width:180px}
@media(max-width:700px){.order-editor .works-controls-46{grid-template-columns:1fr;gap:15px}.order-editor .works-controls-46>.work-master-control,.order-editor .works-controls-46>.work-catalog-control{grid-column:1;grid-row:auto}.order-editor .work-catalog-results{max-height:270px}.order-editor .order-responsible{justify-content:flex-start;margin-top:0}}

/* Step 47: no order-level master field; executor selection remains on the left. */
