.rep-orders-filter{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin-bottom:16px;padding:16px 16px 0}
.rep-orders-filter label{flex:1 1 140px;min-width:0}
.rep-orders-filter label:first-child{flex:2 1 220px}
.rep-orders-filter input,.rep-orders-filter select{width:100%;box-sizing:border-box}
#rep-orders-results{padding:0 16px 16px}
.rep-orders-filter+.hint{padding:0 16px}

/* Respond to the space left beside the sidebar, not just the window width. */
.rep-orders-list{container:rep-orders / inline-size;min-width:0}
.rep-orders-list table{width:100%;min-width:0;table-layout:fixed}
body:not(.signed-out) .rep-orders-list table{font-size:14px}
.rep-orders-list th,.rep-orders-list td{white-space:normal;overflow-wrap:break-word;vertical-align:top;border:1px solid #cad2dd;padding:12px;line-height:1.7}
body:not(.signed-out) .rep-orders-list td{border:1px solid #cad2dd;padding:12px;font-size:14px}
.rep-orders-list th:first-child{width:24%}
.rep-orders-list th:nth-child(2){width:15%}
.rep-orders-list th:nth-child(3){width:26%}
.rep-orders-list th:nth-child(4){width:18%}
.rep-orders-list th:last-child{width:17%}
.rep-orders-list td strong,.rep-orders-list td small{display:block;margin-bottom:6px}
.rep-orders-list small{font-size:12px}
.rep-orders-list button{white-space:normal;width:100%;padding:8px;line-height:1.6}
.rep-order-identity{overflow-wrap:anywhere}
.rep-order-value bdi{display:inline-block;direction:ltr;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:16px;font-weight:700}
.rep-order-progress{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:10px 0}
.rep-order-progress li{font-size:12px;border:1px solid #cbd5e1;background:#f8fafc;color:#64748b;padding:5px 8px;border-radius:6px;max-width:100%}
.rep-order-progress .done{background:#e5f5eb;color:#17663a;border-color:#acd4ba}
.rep-order-status{color:#805600}
.rep-order-status.approved{color:#17663a}
.rep-order-status.cancelled{color:#b42318}
.rep-order-change{display:block;background:#fff0d1;color:#795000;padding:6px;border:1px solid #e8bd5e;border-radius:5px;margin:6px 0;font-size:13px}
.rep-order-change.pending{background:#f0eaff;color:#633c95;border-color:#cab7e7}
.rep-order-totals{display:flex;gap:12px 24px;flex-wrap:wrap;background:#f4f7fa;padding:14px;margin:12px 0}
.rep-orders-pages{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px}
.rep-order-detail details{padding:12px 0;border-bottom:1px solid #ccd5df}
.rep-order-detail summary{cursor:pointer;font-weight:700}
.rep-order-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.rep-order-actions button{flex:1 1 140px;overflow-wrap:normal}
.rep-order-notes{padding:10px;background:#fff9e8;border:1px solid #d9bc6c;border-radius:6px;margin:8px 0;overflow-wrap:anywhere}
.rep-order-notes p{white-space:pre-wrap;margin:5px 0 0}
.rep-order-notes strong{font-size:13px}
#editor-form textarea[name="notes"]{width:100%;min-height:100px;box-sizing:border-box}

@container rep-orders (max-width:850px){
 .rep-orders-list table,.rep-orders-list tbody{display:block;width:100%}
 .rep-orders-list thead{display:none}
 .rep-orders-list tbody tr{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);border:2px solid #aab9c9;border-radius:8px;margin-bottom:16px;overflow:hidden;background:#fff}
 body:not(.signed-out) .rep-orders-list td{display:block;min-width:0;width:auto;border:0;border-bottom:1px solid #cad2dd;padding:12px}
 .rep-orders-list td::before{content:attr(data-label);display:block;font-size:12px;font-weight:700;line-height:1.6;color:#536477;margin-bottom:8px}
 body:not(.signed-out) .rep-orders-list .rep-order-value,body:not(.signed-out) .rep-orders-list .rep-order-updates{border-inline-start:1px solid #cad2dd}
 body:not(.signed-out) .rep-orders-list .rep-order-tools{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;border:0;background:#f8fafc}
 .rep-order-tools::before{grid-column:1/-1;margin-bottom:0}
 .rep-order-tools .rep-order-actions{display:contents}
 .rep-order-tools:has(.rep-order-actions:empty)>button{grid-column:1/-1}
 .rep-orders-list .rep-order-notes{margin:0}
}
@container rep-orders (max-width:480px){
 .rep-orders-list tbody tr{grid-template-columns:minmax(0,1fr)}
 body:not(.signed-out) .rep-orders-list .rep-order-value,body:not(.signed-out) .rep-orders-list .rep-order-updates{border-inline-start:0}
}
@media(max-width:700px){
 .rep-orders-filter button{flex:1}
 .rep-orders-filter label{flex-basis:40%}
 .rep-orders-filter label:first-child{flex-basis:100%}
}
