/* Purchases composition; controls, cards, tables and statuses stay canonical. */
.ws-purchases-workspace{display:grid;gap:var(--ws-space-5);min-width:0}
.ws-purchases-workspace>.page-heading{margin-bottom:0}
.ws-purchases-filters{margin-bottom:var(--ws-space-4)}
.ws-purchase-basis{font:var(--ws-type-small);color:var(--ws-color-muted);margin-block:var(--ws-space-3)}
.ws-purchase-link,.ws-purchase-back{display:inline-flex;align-items:center;gap:var(--ws-space-2);min-height:var(--ws-control-height)}
.ws-purchase-back{justify-self:start}
.ws-purchases-workspace .ws-table small{display:block;color:var(--ws-color-muted);font:var(--ws-type-small);margin-top:var(--ws-space-1)}
.ws-purchases-workspace .ws-table td:first-child{min-width:11rem}
.ws-purchases-workspace .ws-status{white-space:normal}
.ws-purchases-workspace .ws-actions{flex-wrap:wrap}
.ws-purchase-states{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--ws-space-4)}
.ws-purchase-state{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ws-space-2);border:1px solid var(--ws-color-line);border-radius:var(--ws-card-radius);padding:var(--ws-space-4);min-width:0}
.ws-purchase-state h2{margin:0;font:var(--ws-type-small);font-weight:600;color:var(--ws-color-muted)}
.ws-purchase-state p{font:var(--ws-type-small);color:var(--ws-color-muted);margin:0}
.ws-purchase-note{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
@media(max-width:760px){.ws-purchase-states{grid-template-columns:minmax(0,1fr)}.ws-purchases-workspace .ws-table-region{max-width:100%}}
.ws-purchase-document{display:grid;gap:var(--ws-space-2);min-width:0}
.ws-purchase-document h2,.ws-purchase-document p{margin:0}
.ws-purchase-document h2{font:var(--ws-type-body);font-weight:600}
.ws-purchase-list-controls{display:flex;align-items:end;justify-content:space-between;gap:var(--ws-space-4);flex-wrap:wrap}
.ws-purchase-list-controls .ws-tab-list{flex-wrap:wrap}
.ws-purchase-empty{padding:var(--ws-space-4);color:var(--ws-color-muted);margin:0}
.ws-purchase-scroll-help{display:none;color:var(--ws-color-muted);font:var(--ws-type-small);margin:var(--ws-space-2) var(--ws-space-4)}
@media(max-width:760px){.ws-purchase-scroll-help{display:block}}

/* Purchase detail (board 8): main record on the wide side, balance/data/history beside it. */
.ws-purchase-chips{display:flex;flex-wrap:wrap;gap:var(--ws-space-2);margin-top:calc(var(--ws-space-3) * -1)}
.ws-purchase-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(16rem,22rem);gap:var(--ws-space-5);align-items:start;min-width:0}
.ws-purchase-detail-main,.ws-purchase-detail-side{display:grid;gap:var(--ws-space-4);min-width:0}
.ws-purchase-muted{color:var(--ws-color-muted)}
.ws-purchase-facts{display:grid;gap:var(--ws-space-3);margin:0}
.ws-purchase-facts dt{font:var(--ws-type-small);color:var(--ws-color-muted)}
.ws-purchase-facts dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.ws-purchase-history{list-style:none;margin:0;padding:0;display:grid;gap:var(--ws-space-2);font:var(--ws-type-small)}
.ws-purchase-docs{list-style:none;margin:0;padding:0;display:flex;gap:var(--ws-space-3);overflow-x:auto}
.ws-purchase-docs li{flex:0 0 13rem;display:grid;gap:var(--ws-space-1);padding:var(--ws-space-3);border:1px solid var(--ws-color-line);border-radius:var(--ws-card-radius);min-width:0;overflow-wrap:anywhere}
.ws-purchase-docs small{color:var(--ws-color-muted);font:var(--ws-type-small)}
.ws-purchase-detail-side .ws-table-region{max-width:100%}
@media(max-width:1100px){.ws-purchase-detail-layout{grid-template-columns:minmax(0,1fr)}}
.ws-purchase-balance{display:grid;gap:var(--ws-space-2);margin:0;font:var(--ws-type-small)}
.ws-purchase-balance div{display:flex;justify-content:space-between;gap:var(--ws-space-3)}
.ws-purchase-balance dd{margin:0;font-variant-numeric:tabular-nums lining-nums;white-space:nowrap}
.ws-purchase-balance-total{border-top:1px solid var(--ws-color-line);padding-top:var(--ws-space-2);font-weight:600}
@media(max-width:760px){.ws-purchase-chips{margin-top:0}}
