.orders-panel .stock-table{min-width:900px}.order-edit-form .control{min-width:100px}.order-edit-rates,.order-history-values{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}.order-edit-form label{display:block;margin:12px 0}.order-edit-form textarea{width:100%;min-height:80px}.order-history{border-bottom:1px solid var(--border,#ddd);padding:16px 0}.order-history-values>div{padding:12px;background:var(--surface,#f7f7f7);border-radius:8px}.order-history-values strong{display:block;margin-bottom:12px}@media(max-width:640px){.order-history-values,.order-edit-rates{grid-template-columns:1fr}.orders-panel .stock-table{min-width:800px}}

.purchase-form label{display:block;margin:12px 0}.purchase-form .fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}.purchase-form .control{width:100%;box-sizing:border-box}.purchase-form textarea{min-height:80px}.invoice-products strong{white-space:normal}

.job-dialog.wide-dialog{width:min(1320px,calc(100vw - 32px));max-width:calc(100vw - 32px);box-sizing:border-box}.orders-panel{width:100%;min-width:0}.external-work-choice{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:14px;border:1px solid var(--border,#ddd);border-radius:10px}.external-work-choice input{width:18px;height:18px}.external-work-choice small{flex-basis:100%;margin-left:28px}.external-job-badge{padding:7px 10px;border-radius:8px;background:var(--surface,#f3f3f3);font-weight:600}.archive-approval-panel{padding:18px;margin-bottom:18px}.archive-approval-panel article{padding:16px 0;border-bottom:1px solid var(--border,#ddd)}.order-edit-form textarea{width:100%;box-sizing:border-box}@media(max-width:640px){.job-dialog.wide-dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);padding:14px}.archive-approval-panel{padding:12px}}

.orders-view .layout{display:block}.orders-view #left-widgets,.orders-view #right-widgets{display:none}.orders-view #main{width:100%;box-sizing:border-box}

/* External work remains readable on every board lane and in dialogs. */
.external-job-badge{background:#e4f2ef;color:#235d54;border:1px solid #a8cec5}
html[data-theme="dark"] .external-job-badge{background:#203f3b;color:#d5fff1;border-color:#598e80}
html[data-theme="dark"] .external-work-choice{background:#20343f;color:#e4edf6;border-color:#567183}
html[data-theme="dark"] .external-work-choice small{color:#c1d1df}

/* Keep the replacement selector inside its table track. */
.order-edit-form .stock-table{table-layout:fixed;width:100%;min-width:720px}.order-edit-form .stock-table th:first-child{width:40%}.order-edit-form .stock-table .control{width:100%;max-width:100%;box-sizing:border-box}.order-edit-form .stock-table td{overflow-wrap:anywhere}.order-edit-form .stock-table label{min-width:0}
.order-edit-form .stock-table td{vertical-align:bottom;padding:14px 18px 14px 0}.order-edit-form .stock-table th{padding-right:18px}.order-edit-form .stock-table td:first-child,.order-edit-form .stock-table th:first-child{padding-left:12px}.order-edit-form .stock-table th:first-child{width:44%}.order-edit-form .order-edit-name{display:block;font-weight:600;overflow-wrap:anywhere}.order-edit-form .order-edit-product label{margin:10px 0 0}.order-edit-form .order-edit-product label small{margin:2px 0 6px;overflow-wrap:anywhere}.order-edit-form .order-edit-product select{display:block;margin-top:6px;text-overflow:ellipsis}
@media(max-width:640px){.order-edit-form .stock-table{min-width:0;table-layout:auto}.order-edit-form .stock-table thead{display:none}.order-edit-form .stock-table tr,.order-edit-form .stock-table td{display:block;width:100%;box-sizing:border-box}.order-edit-form .stock-table tr{padding:12px 0;border-bottom:1px solid var(--border,#dce5f0)}.order-edit-form .stock-table td,.order-edit-form .stock-table td:first-child{padding:0;border:0}.order-edit-form .stock-table td+td{margin-top:14px}.order-edit-form .stock-table td[data-label]:not(:first-child)::before{content:attr(data-label);display:block;font-size:12px;margin-bottom:6px}}
.order-edit-form .stock-table td{white-space:normal}.order-edit-form .order-edit-product small{max-width:none}@media(max-width:640px){.order-edit-form .stock-table-wrap{overflow-x:visible;width:100%}.order-edit-form .stock-table,.order-edit-form .stock-table tbody{display:block;width:100%;min-width:0}.order-edit-form .stock-table .control{width:100%;min-width:0}}
