.order-history{background:#fff;border:1px solid #dce5f3;border-radius:12px;margin:0 0 24px;overflow:hidden}.history-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px}.history-header h2{font-size:17px}.history-header p{font-size:12px;color:#77869d;margin:5px 0 0}.history-header .button{font-size:12px;min-height:36px}.history-form{padding:0 22px 18px;border-bottom:1px solid #edf1f6}.history-filters{display:grid;grid-template-columns:repeat(2,minmax(135px,1fr)) minmax(210px,2fr) repeat(2,minmax(110px,1fr));gap:12px}.history-filters label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#6d7d95;min-width:0}.history-filters input,.history-filters select{width:100%;min-width:0;min-height:38px;font-size:13px;border:1px solid #dce3ed;border-radius:6px;padding:8px;background:#fff;color:#30415c}.history-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:14px}.history-actions>div{display:flex;gap:17px}.history-actions .text-button{font-size:12px}.history-actions .button{font-size:13px;min-height:37px}.history-draft{font-size:12px;color:#996d23;margin:10px 0 0}.history-scope{padding:13px 22px 0;font-size:12px;color:#60738e;margin:0}.history-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:16px 22px;gap:12px}.history-summary-production{grid-template-columns:repeat(3,minmax(0,1fr))}.history-summary article{background:#f7f9fd;border:1px solid #e9eef6;border-radius:8px;padding:13px;min-width:0}.history-summary article>span{display:block;color:#6e7f97;font-size:12px}.history-summary strong{display:block;font-size:23px;color:#254c7f;font-variant-numeric:tabular-nums;margin:5px 0;overflow-wrap:anywhere}.history-summary small{font-size:11px;color:#8692a4}.history-quantities{display:flex;flex-wrap:wrap;align-items:center;gap:9px 14px;padding:0 22px 16px;font-size:12px;color:#667b97}.history-quantities strong{font-weight:500}.history-source-total{margin-left:auto;color:#8b98a9}.history-table{min-width:780px;width:100%}.history-table td{max-width:280px;overflow-wrap:anywhere}.history-table td small{display:block}.history-note{padding:11px 22px 15px;margin:0;font-size:11px;color:#8491a5;border-top:1px solid #edf1f6;background:#fafbfd;line-height:1.8}.order-history [data-history="error"]{margin:14px 22px}.order-history .table-footer{gap:12px;flex-wrap:wrap}@media(max-width:1250px){.history-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.history-search{grid-column:3/5}.history-summary strong{font-size:20px}}@media(max-width:760px){.history-header{padding:17px 15px;align-items:flex-start}.history-header p{max-width:260px}.history-form{padding:0 15px 15px}.history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.history-search{grid-column:1/-1}.history-summary{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px 15px;gap:9px}.history-summary-production{grid-template-columns:1fr}.history-scope,.history-note{padding-left:15px;padding-right:15px}.history-quantities{padding:0 15px 14px}.history-source-total{margin-left:0;width:100%}.history-header .button{padding:7px 10px}.history-actions>div{gap:12px}.order-history [data-history="error"]{margin:12px 15px}}
.order-history>.history-header{background:linear-gradient(110deg,#f8fafc,#fff)}.order-history .table-wrap{overflow:visible}.order-history .history-table{display:block;width:100%;min-width:0;table-layout:fixed}.history-table thead{display:none}.history-table tbody{display:grid;gap:12px;padding:0 22px 18px}.history-table tr{display:block}.history-table tr:hover{background:transparent}.history-table tr>td,.history-table tr>td:first-child{display:block!important;width:100%;max-width:none;min-width:0;padding:0!important;border:0}.history-order-card .order-surface-head{align-items:flex-start}.history-order-card h3{font-size:16px;line-height:1.5;overflow-wrap:anywhere}.history-order-products{margin:6px 0 0;color:#61778f;font-size:13px;line-height:1.7;overflow-wrap:anywhere}.history-order-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,1fr);align-items:center;gap:20px}.history-order-reference{min-width:0}.history-order-reference .order-link{max-width:100%;font-size:12px;line-height:1.7;white-space:normal;overflow-wrap:anywhere}.history-order-reference p{margin:5px 0 0}.history-order-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.history-order-metrics>div{min-width:0}.history-order-metrics dd{font-size:18px;font-variant-numeric:tabular-nums;white-space:normal;overflow-wrap:anywhere}.history-order-quantities{display:flex;flex-wrap:wrap;gap:5px 12px}.history-order-quantities>span{white-space:nowrap}.history-table .history-order-quantities small{display:inline;font-size:11px;font-weight:400;margin:0;color:#7b8b9b}.history-order-date{display:flex;flex-wrap:wrap;align-items:center;gap:7px 12px}.history-order-card .order-surface-footer .button{font-size:12px;min-height:34px;padding:7px 12px}.history-table .empty{padding:35px 18px!important}.order-history .history-summary article{border-radius:10px}.order-history .history-quantities{border-bottom:1px solid #eef2f6;margin-bottom:18px}
.history-order-metrics{margin:0;padding:0;border:0}.history-order-quantities>span{white-space:normal}
@media(max-width:1000px){.history-order-body{grid-template-columns:1fr;gap:14px}.history-order-metrics{padding-top:12px;border-top:1px solid #edf1f6}}
@media(max-width:760px){.history-table tbody{padding:0 12px 14px;gap:10px}.history-order-metrics{gap:12px}.history-order-metrics dd{font-size:17px}.history-order-card .order-surface-footer{align-items:flex-start}.history-order-date{gap:6px 10px}.history-actions{flex-wrap:wrap}.history-actions>div{flex-wrap:wrap}}
@media(max-width:520px){.history-order-card .order-surface-head{flex-wrap:wrap}.history-order-card .order-surface-heading{flex-basis:100%}.history-order-card .order-surface-head .order-surface-tags{margin:0}}

/* Historical orders use the same quiet surfaces as the active workspace. */
.order-history,.history-filters input,.history-filters select,
.history-summary article{border-color:var(--brand-border)}
.order-history>.history-header{background:linear-gradient(110deg,var(--brand-soft),#fff)}
.history-summary article,.history-note{background:var(--brand-soft)}
.history-summary strong{color:var(--brand)}
.history-filters input,.history-filters select{color:var(--brand-deep)}
.history-order-products,.history-scope,.history-quantities,
.history-filters label,.history-summary article>span{color:var(--muted)}
