#ordering{max-width:1500px;margin:auto;padding:16px 20px;}
.ordering-tabs,.ordering-toolbar,.ordering-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.ordering-tabs{border-bottom:1px solid #bdcbd5;padding-bottom:12px;}
.ordering-tabs button{background:#e5ecf1;color:#34546c;border:1px solid #aebfcd;}
.ordering-tabs button[aria-selected=true]{background:#3b5e78;color:white;}
.ordering-toolbar{padding:12px 0;align-items:end;}
.ordering-toolbar label{flex:1;min-width:180px;}
.ordering-toolbar input,.ordering-toolbar select{width:100%;}
.ordering-toolbar label:first-child{flex:2;}
.ordering-actions{justify-content:flex-end;margin:12px 0;}
.ordering-actions strong{margin-right:auto;}
.ordering-table{width:100%;border-collapse:collapse;}
.ordering-table th,.ordering-table td{padding:10px 12px;border-bottom:1px solid #d0dae2;vertical-align:top;}
.ordering-table th{text-align:left;background:#edf2f5;font-size:13px;}
.ordering-table .supplier th{background:#dce6ed;color:#2e495d;}
.supplier-select{display:flex;align-items:center;gap:12px;min-height:24px;cursor:pointer;}
.supplier-select input{flex:none;margin:0;}
.ordering-table small{display:block;margin-top:3px;color:#536575;}
.ordering-table .number{text-align:right;white-space:nowrap;}
.ordering-table .requested-date{white-space:nowrap;}
.ordering-table button{min-height:30px;padding:4px 9px;font-size:13px;}
.ordering-table .column-sort{display:inline-flex;align-items:center;gap:8px;background:transparent;color:inherit;border:0;border-radius:3px;padding:4px 0;font:inherit;font-weight:700;white-space:nowrap;cursor:pointer;}
.ordering-table .column-sort span{display:inline-block;width:14px;text-align:center;}
.ordering-table .column-sort:hover{color:#375875;text-decoration:underline;}
.ordering-table .column-sort:focus-visible{outline:2px solid #6488a6;outline-offset:3px;}
html[data-alpine-theme=dark] .ordering-table .column-sort:hover{color:#c5e0f5;}
.ordering-table [data-order]{white-space:nowrap;}
.ordering-table input[type=checkbox]{width:18px;height:18px;}
.ordering-state{display:inline-block;font-size:13px;padding:4px 8px;border-radius:3px;background:#e3edf5;color:#294e6a;}
.ordering-state.partial{background:#fff0d1;color:#6c4d16;}.ordering-state.received{background:#e0eee2;color:#2f5535;}.ordering-state.cancelled{background:#eee;color:#555;}
#ordering-editor{width:min(850px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;}
#ordering-editor header{display:flex;align-items:center;justify-content:space-between;gap:14px;}
#ordering-editor h2{font-size:20px;margin:0;}
#ordering-editor label{display:block;margin:10px 0;}
#ordering-editor input,#ordering-editor select,#ordering-editor textarea{width:100%;}
#ordering-editor input[type=number]{max-width:120px;}
#ordering-editor [role=alert]{color:#923d34;}
#ordering-editor.request-popup{height:min(800px,calc(100dvh - 32px));overflow:hidden;}
#ordering-editor.request-popup[open]{display:flex;flex-direction:column;}
#ordering-editor.request-popup header{flex:none;padding-bottom:12px;}
#ordering-editor.request-popup form{display:none;}
#ordering-editor.request-popup iframe{display:block;flex:1;min-height:0;width:100%;border:0;}
.ordering-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;}
.ordering-footer{position:sticky;bottom:0;background:#f1f5f7;border-top:1px solid #bdcbd5;padding:12px;}
#order-email-editor{width:min(800px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;}
#order-email-editor header,#order-email-editor footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
#order-email-editor h2{font-size:20px;}
#order-email-editor label{display:block;margin:10px 0;}
#order-email-editor input,#order-email-editor textarea{width:100%;font:inherit;}
.order-confirmations{border-top:1px solid #bdcbd5;margin:16px 0;padding-top:8px;}
.order-confirmations h3{font-size:16px;}.order-confirmations ul{list-style:none;padding:0;}
.order-confirmations li{margin:8px 0;overflow-wrap:anywhere;}.order-confirmations small{display:block;margin-top:4px;}
.order-confirmations button{max-width:100%;overflow-wrap:anywhere;white-space:normal;}
#order-confirmation-viewer{width:min(850px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;}
#order-confirmation-viewer header{display:flex;align-items:center;justify-content:space-between;gap:12px;}
#order-confirmation-viewer h2{font-size:18px;overflow-wrap:anywhere;}
#order-confirmation-viewer iframe{width:100%;height:60vh;border:0;margin-top:12px;}
#order-confirmation-viewer img{display:block;width:100%;max-height:65vh;object-fit:contain;margin-top:12px;}
.brand .receiving-home{display:none}
html.receiving .brand .receiving-home{display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box;padding:8px 12px;border:1px solid var(--line);border-radius:10px;font-size:13px;font-weight:600;text-decoration:none;color:var(--blue);white-space:nowrap}
html[data-alpine-theme=dark].receiving .brand .receiving-home{color:#c3d8eb}
html[data-alpine-theme=dark] body.workshop-documents{background:#202327;color:#f3f3f5;min-height:100vh;}
html[data-alpine-theme=dark] body.workshop-documents :is(input,select,textarea){background:#292d32;color:#f3f3f5;border-color:#697d8e;}
html[data-alpine-theme=dark] body.workshop-documents input::placeholder{color:#b5c0c9;}
html[data-alpine-theme=dark] #ordering{color:#f3f3f5;background:#202327;}
html[data-alpine-theme=dark] .ordering-table th,html[data-alpine-theme=dark] .ordering-footer{background:#303b44;color:#e5edf5;}
html[data-alpine-theme=dark] .ordering-table .supplier th{background:#3a4a56;}
html[data-alpine-theme=dark] .ordering-table small{color:#bdccd7;}
@media(max-width:650px){#ordering{padding:12px;}.ordering-toolbar label{min-width:100%;}.ordering-table{min-width:900px;}.ordering-grid{grid-template-columns:1fr;}.ordering-tabs button,.ordering-table button{min-height:44px;}}
@media(max-width:650px){html.receiving .ordering-table{min-width:640px;}}
