/* Sales order entry: a compact document, with the same fields on mobile. */
.order-entry-overlay{padding:16px}
.modal.order-entry-modal{width:calc(100vw - 32px);max-width:1800px;height:calc(100dvh - 32px);max-height:calc(100dvh - 32px);border-radius:14px}
.order-entry-modal .modal-head{padding:15px 22px;border-bottom:1px solid var(--line);background:var(--surface)}
.order-entry-modal .modal-head h2{font-size:20px}
.order-entry-modal #modal-form{display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden}
.order-entry-modal .modal-body{padding:0 22px 18px;overflow:auto;min-height:0;flex:1}
.order-entry-modal .modal-foot{flex:none;gap:14px;justify-content:space-between;align-items:center;padding:14px 22px;background:var(--surface-muted);box-shadow:0 -3px 12px #1738450c;border-top:1px solid var(--line-strong);flex-wrap:wrap}
.order-entry-draft .draft-status{margin:0 -22px 16px;padding:8px 22px;border-radius:0;border:0;border-bottom:1px solid var(--line);background:var(--surface-muted);font-size:12px}
.order-entry-draft .notice{margin:12px 0 0;padding:8px 12px}
.order-header-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px 14px;margin-bottom:20px;align-items:start}
.order-header-grid .field{min-width:0;margin:0;gap:5px}
.order-header-grid label{font-size:14px;color:#354f5b}
.order-header-grid input,.order-header-grid select{height:38px;min-height:38px;padding:0 10px;font-size:14px;border-radius:6px}
.order-header-grid input[readonly]{background:#f5f7f8;color:var(--muted)}
.order-customer-field{grid-column:span 2;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;min-width:0}
.order-customer-field>.customer-picker{grid-column:1/-1;display:block}
.order-customer-field .customer-picker-filters{display:none}
.order-customer-field>.btn{grid-column:2;grid-row:2;font-size:12px;min-height:28px;padding:2px 8px}
.order-customer-info{grid-column:1;grid-row:2;font-size:12px;color:var(--muted);overflow-wrap:anywhere;align-self:center;line-height:1.65}
.order-collection-field [data-collection-day]{margin-top:8px}
.order-address-field{grid-column:span 3;min-width:0}
.order-remark-field{grid-column:span 3;min-width:0}
.order-line-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line-strong);border-bottom:0;border-radius:8px 8px 0 0;background:var(--surface-muted)}
.order-line-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.order-key-help{font-size:12px;max-width:520px}
.order-key-help summary{color:var(--teal);cursor:pointer;text-align:right}
.order-key-help p{margin:8px 0 0;color:var(--muted);line-height:1.7}
.order-entry-table-wrap{border-color:var(--line-strong);border-radius:0 0 8px 8px}
.order-entry-table{min-width:1415px;table-layout:fixed;font-size:14px}
.order-entry-table th{position:sticky;top:0;z-index:1;font-size:14px;background:var(--table-head);color:var(--ink);padding:10px 8px;border-right:1px solid var(--line);white-space:normal}
.order-entry-table td{vertical-align:top;padding:9px 8px;border-right:1px solid var(--line);height:74px;white-space:normal}
.order-entry-table th:nth-child(1){width:48px;text-align:center}
.order-entry-table th:nth-child(2){width:145px}
.order-entry-table th:nth-child(3){width:auto;min-width:260px}
.order-entry-table th:nth-child(4){width:86px}
.order-entry-table th:nth-child(5){width:148px}
.order-entry-table th:nth-child(6){width:106px}
.order-entry-table th:nth-child(7){width:112px}
.order-entry-table th:nth-child(8){width:132px}
.order-entry-table th:nth-child(9){width:175px}
.order-entry-table th:nth-child(10){width:124px}
.order-entry-table th:nth-child(n+5):nth-child(-n+8){text-align:right}
.order-entry-table .order-row-number{text-align:center;vertical-align:middle;color:var(--muted);font-variant-numeric:tabular-nums}
.order-entry-table .line-row:hover{background:#f5faf9}
.order-entry-table .line-row:focus-within{background:var(--teal-soft);box-shadow:inset 3px 0 0 var(--teal)}
.order-entry-table .line-row.order-gift-row{background:#f0f5fc}
.order-entry-table .line-product-cell{min-width:0;width:auto}
.order-entry-table input,.order-entry-table select{height:34px;width:100%;min-width:0;padding:5px 7px;border:1px solid var(--line-strong);border-radius:6px;background:var(--surface);font-size:14px}
.order-entry-table .line-qty,.order-entry-table .line-price{text-align:right;font-variant-numeric:tabular-nums}
.order-product-control{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px}
.order-product-control .line-brand-filters,.order-product-control>.line-stock{display:none}
.order-product-control>.line-product{grid-column:1;grid-row:1}
.order-product-control>.btn{grid-column:2;grid-row:1;padding:3px 7px;font-size:12px;min-height:34px}
.order-product-control>.line-product-warning{grid-column:1/-1}
.order-product-meta{display:block;margin-top:7px;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.order-entry-table .line-commerce-fields{padding:0;margin:0;border:0;gap:7px}
.order-entry-table .line-commerce-fields .check-field{font-size:13px;min-height:28px;margin:0;white-space:nowrap}
.order-entry-table .line-commerce-fields input[type=checkbox]{width:16px;height:16px;min-width:16px}
.order-entry-table details summary{font-size:12px;color:var(--teal);cursor:pointer;white-space:normal;line-height:1.6}
.order-entry-table details[open]>summary{margin-bottom:8px}
.order-entry-table .order-price-options{margin-top:5px}
.order-entry-table .line-low-reason-label{margin-top:8px}
.order-entry-table .line-low-reason,.order-entry-table .line-gift-reason{font-size:13px}
.order-entry-table .line-promotion{font-size:12px;margin-top:4px}
.order-entry-table .line-price-source{margin:0 0 4px}
.order-entry-table .line-amount{padding-top:16px;text-align:right;font-size:14px}
.order-stock-cell{text-align:right}
.order-stock-value{display:block;padding-top:7px;font-size:14px;font-variant-numeric:tabular-nums}
.order-stock-hint{display:block;margin-top:7px;color:var(--muted);font-size:12px;line-height:1.5}
.order-stock-shortage .order-stock-value,.order-stock-shortage .order-stock-hint{color:#975d0d}
.order-row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.order-entry-table .copy-row,.order-entry-table .delete-row{width:auto;min-width:0;padding:5px 7px;height:34px;font-size:12px;background:var(--surface);border:1px solid var(--line)}
.order-entry-table .copy-row{color:var(--teal)}
.order-entry-table .delete-row{color:var(--danger)}
.order-table-space{min-height:100px;background:repeating-linear-gradient(#fff,#fff 49px,#edf1f4 49px,#edf1f4 50px)}
.order-entry-extras .commerce-quote{margin-top:16px;padding:12px 14px;gap:8px 16px;background:#f5faf8}
.order-entry-extras .commerce-quote p{max-width:960px}
.order-rebate{margin:12px 0;padding:12px 14px;border:1px solid var(--teal-line);border-radius:var(--radius-sm);background:var(--teal-soft);color:var(--text)}
.order-rebate-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:4px 16px}
.order-rebate-heading h3{margin:0;font-size:14px;color:var(--ink)}
.order-rebate-heading>strong{color:var(--teal-hover);font-variant-numeric:tabular-nums}
.order-rebate-lines{display:grid;gap:5px;margin:7px 0 0;padding:0;max-height:146px;overflow:auto;list-style:none;font-size:13px}
.order-rebate-lines li{display:flex;flex-wrap:wrap;gap:3px 12px;overflow-wrap:anywhere}
.order-rebate>.page-note{margin:5px 0 0}
.order-entry-totals{display:flex;align-items:baseline;gap:8px 20px;flex-wrap:wrap;flex:1;min-width:220px}
.order-entry-totals>span:first-child{font-size:13px;color:var(--muted)}
.order-entry-totals .form-total{margin:0;font-size:14px}
.order-entry-totals .form-total strong{font-size:26px;color:var(--teal)}
.order-entry-totals>small{flex-basis:100%;font-size:12px;color:var(--muted)}
.order-entry-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.order-entry-actions .btn{font-size:14px;min-height:40px}
.order-low-ack{flex-basis:100%;display:flex;align-items:center;gap:8px;font-size:13px;color:#805913}
.order-low-ack input{width:18px;height:18px;accent-color:var(--teal)}
@media(min-width:1600px){.order-header-grid{grid-template-columns:repeat(7,minmax(0,1fr))}.order-remark-field{grid-column:span 2}}
@media(max-width:1100px) and (min-width:801px){.order-header-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.order-address-field,.order-remark-field{grid-column:span 2}.order-entry-totals{flex-basis:100%}.order-entry-actions{margin-left:auto}}
@media(max-width:800px){
 .order-entry-overlay{padding:0}
 .modal.order-entry-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0}
 .order-entry-modal .modal-head{padding:10px 14px}
 .order-entry-modal .modal-head h2{font-size:18px}
 .order-entry-modal .modal-body{padding:0 14px 16px}
 .order-entry-draft .draft-status{margin:0 -14px 14px;padding:8px 14px}
 .order-header-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .order-header-grid input,.order-header-grid select{min-height:44px;font-size:16px}
 .order-customer-field,.order-address-field,.order-remark-field{grid-column:1/-1}
 .order-customer-field>.btn{min-height:36px}
 .order-line-toolbar{flex-wrap:wrap;padding:10px}
 .order-key-help{display:none}
 .order-line-actions{width:100%}
 .order-line-actions .btn{min-height:44px}
 .order-entry-table-wrap{border:0;background:transparent;overflow:visible}
 .order-entry-table{display:block;min-width:0;width:100%;table-layout:auto}
 .order-entry-table thead{display:none}
 .order-entry-table tbody{display:grid;gap:12px}
 .order-entry-table .line-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);padding:12px}
 .order-entry-table .line-row td{display:block;border:0;padding:0;min-height:0;height:auto;min-width:0;text-align:left}
 .order-entry-table .line-row td::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;margin:0 0 5px}
 .order-entry-table .line-row .order-row-number{font-size:14px;font-weight:600;text-align:left;grid-column:1;display:flex;gap:5px}
 .order-entry-table .line-row .order-row-number::before{content:'商品';margin:0}
 .order-entry-table .line-row .order-property-cell{grid-column:1/-1}
 .order-entry-table .line-row .line-product-cell,.order-entry-table .line-row .line-remark-cell{grid-column:1/-1;width:auto}
 .order-entry-table input,.order-entry-table select{height:44px;min-height:44px;font-size:16px}
 .order-product-control{grid-template-columns:minmax(0,1fr) auto}
 .order-product-control>.btn{min-height:44px}
 .order-entry-table .line-row .line-delete{grid-column:2;grid-row:1;justify-self:end}
 .order-entry-table .line-row .line-delete::before{display:none}
 .order-entry-table .copy-row,.order-entry-table .delete-row{min-height:36px;padding:5px 10px}
 .order-entry-table .line-row .line-amount{padding:0;font-size:18px}
 .order-entry-table .line-row .order-stock-cell{grid-column:1/-1}
 .order-entry-table .order-stock-value{padding:0}
 .order-entry-table .line-commerce-fields{grid-template-columns:1fr}
 .order-entry-table .line-commerce-fields .check-field{font-size:14px;min-height:36px}
 .order-entry-table .line-commerce-fields input[type=checkbox]{min-height:20px;height:20px;width:20px;min-width:20px}
 .order-entry-table .line-low-reason,.order-entry-table .line-gift-reason,.order-entry-table .line-promotion{font-size:16px}
 .order-table-space{display:none}
 .order-entry-modal .modal-foot{padding:10px 14px calc(10px + env(safe-area-inset-bottom));gap:8px}
 .order-entry-totals{min-width:0;flex-basis:100%;gap:4px 12px;justify-content:space-between}
 .order-entry-totals>small{display:none}
 .order-entry-totals .form-total strong{font-size:22px}
 .order-entry-actions{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .order-entry-actions .btn{min-height:44px;font-size:13px;padding:6px}
 .order-entry-actions [data-order-intent=continue],.order-entry-actions [data-order-intent=print]{display:none}
 .order-entry-actions [data-order-primary]{grid-column:span 2}
 .order-entry-actions:has([data-order-intent=approve]) [data-order-primary]{grid-column:span 1}
}
