.lab-commerce {--commerce-border:#3d474d;}
#section-orders #ordersMessage .ok {color:#a8e1c5;}
#section-orders #ordersMessage .error {color:#ffc2c6;}
.nav-button[data-section="purchase"],.nav-button[data-section="purchase"]>span:not(.ico) {min-width:0;white-space:normal!important;overflow-wrap:anywhere;}
.lab-commerce-breadcrumb {font-size:12px;color:#bac4cb;margin-bottom:8px;}
.lab-commerce .page-title {align-items:center;gap:12px;}
.lab-commerce .page-title p:empty {display:none;}
.lab-commerce h3 {font-size:20px;line-height:1.3;}
.lab-commerce-status {display:inline-block;font-size:12px;font-weight:600;border:1px solid #706241;background:#352f22;color:#f3d497;border-radius:4px;padding:3px 8px;margin-top:5px;}
.lab-commerce-status[data-state="sent"] {color:#bee7d4;background:#21392f;border-color:#426956;}
.lab-commerce-stages {display:flex;gap:6px;border-bottom:1px solid var(--commerce-border);padding:8px 0 12px;margin-bottom:14px;}
.lab-commerce-stages .btn {transition:none!important;}
.lab-commerce-stages [aria-selected="true"] {background:#f5a676!important;color:#191b1d!important;border-color:#f5a676!important;}
body.lab-workspace .lab-commerce .lab-order-fields {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;margin-bottom:8px;padding-bottom:12px;}
body.lab-workspace .lab-commerce .lab-order-fields .field:first-child {grid-column:auto;}
.lab-commerce-options {margin:4px 0 14px;}
.lab-commerce-options summary {font-size:12px;color:#d0d9de;cursor:pointer;padding:8px 0;}
.lab-commerce-options-fields {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:10px 0;}
.lab-commerce-options input,.lab-commerce-options select {width:100%;min-width:0;}
.lab-commerce-options input[type="checkbox"] {width:auto;}
.lab-commerce-options:has(#orderAmountMode option[value="auto"]:checked) .field:has(#orderManualAmountInput),
.lab-commerce-options:has(#orderDeliveryFeeCheckbox:not(:checked)) .field:has(#orderDeliveryFeeInput) {display:none;}
.lab-commerce .lab-order-fields .field {min-width:0;}
.lab-commerce .lab-order-fields input,.lab-commerce .lab-order-fields select {width:100%;min-width:0;}
.lab-commerce #orderSupplierInput {font-weight:700;color:#fff;}
.lab-commerce-documents {padding:4px 0 14px;border-bottom:1px solid var(--commerce-border);margin-bottom:14px;}
.lab-commerce-documents h4 {margin:0 0 10px;}
.lab-commerce-footer {display:flex;align-items:center;flex-wrap:wrap;gap:12px;position:sticky;bottom:0;background:#1b2125;border-top:1px solid var(--commerce-border);padding:10px 0;z-index:5;}
.lab-commerce-footer .lab-order-total {margin:0 0 0 auto!important;padding:0!important;border:0!important;display:flex!important;align-items:center;gap:10px;background:none!important;min-height:0!important;width:auto!important;flex:none!important;}
.lab-commerce-footer .lab-order-total b {font-size:20px!important;margin:0!important;}
.lab-commerce-footer .lab-order-total span {margin:0!important;}
.lab-commerce #labCommerceFooter {min-height:52px;}
.lab-commerce-amount {display:flex;flex-direction:row;align-items:center;gap:10px;margin-left:auto;}
.lab-commerce-amount span {font-size:12px;color:#c7d4dc;}
.lab-commerce-amount b {font-size:19px;white-space:nowrap;}
.lab-commerce-footer .lab-order-total span {font-size:12px;}
.lab-commerce-footer .toolbar {margin:0;}
.lab-commerce-more {position:relative;}
.lab-commerce-more summary,.lab-commerce-row-more {cursor:pointer;min-width:32px;min-height:32px;}
.lab-commerce-more summary {padding:7px 12px;border:1px solid #455057;border-radius:4px;}
.lab-commerce-more-actions {position:absolute;right:0;top:100%;z-index:9;min-width:220px;padding:10px;background:#252d32;border:1px solid #58636b;box-shadow:0 8px 24px #0006;}
.lab-commerce-more-actions .btn {width:100%;margin:4px 0;}
.lab-commerce #reopenOrderBtn {border-top:2px solid #a47834;color:#f2ce91;}
.lab-commerce-lines th:nth-child(1),.lab-commerce-lines td:nth-child(1),
.lab-commerce-lines th:nth-child(2),.lab-commerce-lines td:nth-child(2),
.lab-commerce-lines th:nth-child(4),.lab-commerce-lines td:nth-child(4),
.lab-commerce-lines th:nth-child(6),.lab-commerce-lines td:nth-child(6),
.lab-commerce-lines th:nth-child(10),.lab-commerce-lines td:nth-child(10),
.lab-commerce-lines th:nth-child(11),.lab-commerce-lines td:nth-child(11) {display:none!important;}
.lab-commerce-lines td[colspan] {display:table-cell!important;}
.lab-commerce-lines td {height:auto!important;padding:8px 6px!important;vertical-align:top!important;}
.lab-commerce-lines th {padding:8px 6px!important;font-size:12px;white-space:normal!important;}
.lab-commerce-lines input:not([type="checkbox"]),.lab-commerce-lines select {height:32px!important;min-height:32px!important;width:100%;min-width:0!important;padding:4px 6px!important;font-size:12px!important;}
.lab-commerce-product-top {display:flex;align-items:center;gap:8px;min-width:0;}
.lab-commerce-product-top input {flex:1;min-width:0!important;}
.lab-commerce-affair {font-size:12px;color:#c8d5dd;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:copy;}
.lab-commerce-product-detail {margin-top:4px;min-width:0;overflow:hidden;}
.lab-commerce-product-detail input {color:#c8d3da!important;font-size:12px!important;}
.lab-commerce-lines .lab-order-quantity-controls {display:flex!important;gap:4px!important;}
.lab-commerce-lines .lab-order-quantity-controls > * {width:50%!important;min-width:0!important;}
.lab-commerce-lines .lab-receipt-progress {display:flex!important;gap:5px!important;white-space:nowrap;margin-top:5px;font-size:12px!important;}
.lab-commerce-lines .lab-receipt-badge {display:inline-flex;padding:0!important;border:0!important;background:none!important;font-size:12px!important;margin-top:2px!important;}
.lab-commerce-lines .lab-receipt-progress {display:inline-flex!important;}
.lab-commerce-lines .lab-receipt-progress + .lab-receipt-badge {margin-left:5px;}
.lab-commerce-lines .lab-auto-price-note,.lab-commerce-lines .order-price-warning,.lab-commerce-lines .lab-last-price-hint {font-size:12px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lab-commerce-lines .lab-order-last-price {font-size:12px!important;margin:2px 0 0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.lab-commerce-lines .lab-order-last-price:not(.known) {display:none;}
.lab-commerce-lines .order-price-warning.hidden {display:none!important;}
.lab-commerce-lines .lab-price-confirm {min-width:32px;min-height:32px;padding:3px;}
.lab-commerce-lines .lab-commerce-receive-line {display:none!important;}
.lab-commerce-row-menu {position:fixed;inset:auto;margin:0;width:300px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto;padding:14px;background:#20272c;color:#edf2f5;border:1px solid #64717b;border-radius:6px;box-shadow:0 8px 30px #0008;z-index:1300;}
.lab-commerce-row-menu:popover-open {display:flex;flex-direction:column;gap:10px;}
.lab-commerce-row-menu .lab-commerce-line-action {width:100%;text-align:left;}
.lab-commerce-line-setting {display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:12px;}
.lab-commerce-line-setting input {max-width:80px;}
.lab-commerce-row-menu [data-return-supplier-line],.lab-commerce-row-menu [data-return-order-line] {border-top:1px solid #77603d;color:#edc68a;}
.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines th:nth-child(7),.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines td:nth-child(7),
.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines th:nth-child(8),.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines td:nth-child(8),
.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines th:nth-child(9),.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines td:nth-child(9) {display:none!important;}
.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines th:nth-child(10),.lab-commerce[data-commerce-stage="receive"] .lab-commerce-lines td:nth-child(10) {display:table-cell!important;}
.lab-commerce[data-commerce-stage="receive"] .lab-commerce-receive-line {display:inline-flex!important;font-size:12px;padding:4px 6px;}
.lab-commerce-received {display:flex;align-items:center;gap:6px;font-size:12px;}
.lab-commerce-confirm {background:#20272c;color:#edf2f5;border:1px solid #59656f;border-radius:6px;max-width:min(540px,calc(100vw - 24px));max-height:80vh;padding:22px;}
.lab-commerce-confirm::backdrop {background:#0009;}
.lab-commerce-confirm ul {padding-left:22px;max-height:45vh;overflow:auto;}
.lab-commerce-confirm li {padding:5px 0;}
#labPurchaseClose {float:right;}
#labCommerceSelection {margin:0 0 10px;}
.lab-commerce [hidden],.lab-commerce .hidden {display:none!important;}
@media(max-width:1200px){.lab-commerce .lab-order-fields {grid-template-columns:repeat(2,minmax(0,1fr));}.lab-commerce-affair {max-width:75px;}.lab-commerce .page-title {flex-wrap:wrap;}}
@media(max-width:700px){
 .lab-commerce-stages {flex-wrap:wrap;}.lab-commerce-stages .btn {flex:1;white-space:normal;min-height:44px;}
 body.lab-workspace .lab-commerce .lab-order-fields,.lab-commerce-options-fields {grid-template-columns:1fr!important;}
 .lab-commerce-lines {width:100%!important;min-width:0!important;max-width:100%!important;display:block;}
 .lab-commerce-lines thead {display:none;}.lab-commerce-lines tbody {display:block;}
 .lab-commerce-lines tr {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);border-bottom:1px solid #58616b;padding:8px 0;}
 .lab-commerce-lines td {display:block;min-width:0;border:0!important;}
 .lab-commerce-lines td:nth-child(3) {grid-column:1/-1;}
 .lab-commerce-lines td:nth-child(12) {grid-column:1/-1;text-align:right;}
 .lab-commerce-lines td:nth-child(7)::before {content:'PU HT';font-size:12px;}
 .lab-commerce-lines td:nth-child(8)::before {content:'Total HT';font-size:12px;}
 .lab-commerce-lines td:nth-child(9)::before {content:'Réception prévue';font-size:12px;}
 .lab-commerce-lines input:not([type="checkbox"]),.lab-commerce .btn,.lab-commerce summary {min-height:44px!important;}
 .lab-commerce-footer {padding-bottom:calc(8px + env(safe-area-inset-bottom));}
 .lab-commerce-row-more {min-width:44px;}
 .lab-commerce-affair {max-width:110px;}
}
