.ds-badge{margin-left:auto;background:#f5a623;color:#10201a;border-radius:10px;font-size:11px;font-weight:800;padding:1px 6px;min-width:18px;text-align:center}
.ds-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}.ds-toolbar input,.ds-toolbar select,.ds-toolbar button{font-size:12px;padding:7px 10px;border-radius:5px;height:33px}.ds-toolbar input{width:230px}.ds-toolbar #ds-count{font-size:12px;color:var(--muted)}.ds-toolbar #ds-save{width:auto;flex:0 0 auto;margin-left:auto}
#ds-message:empty{display:none}#ds-message{font-size:12px;margin:5px 0 10px;overflow-wrap:anywhere}.ds-alert{font-size:12px;padding:7px 10px;background:var(--warn);margin-bottom:8px}.ds-warning{color:var(--negative)}
#ds-message.ds-save-error{padding:10px;border:1px solid var(--negative);border-radius:6px;color:var(--negative);background:var(--surface)}
.ds-warehouse-date{display:grid;gap:4px}
.ds-warehouse-date>span{font-size:11px;color:var(--muted)}
.ds-sheet .ds-row-state{overflow-wrap:anywhere}
.ds-sheet-wrap{background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:auto;max-height:calc(100vh - 185px);scrollbar-gutter:stable;overscroll-behavior-x:contain}
.ds-sheet{width:100%;min-width:1120px;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:12px;line-height:1.35;font-variant-numeric:tabular-nums}.ds-order-col{width:84px}.ds-col-shoe{width:300px}.ds-col-quantity{width:48px}.ds-col-factory{width:174px}.ds-col-ordered_on{width:104px}.ds-col-status{width:144px}.ds-col-tracking_no{width:174px}.ds-col-delivered_on{width:116px}
.ds-sheet th,.ds-sheet td{padding:10px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);max-width:0;overflow:hidden;white-space:normal;text-align:left;vertical-align:middle}.ds-sheet th:last-child,.ds-sheet td:last-child{border-right:0}.ds-sheet tbody:last-child tr:last-child td{border-bottom:0}
.ds-sheet thead th{position:sticky;top:0;z-index:2;background:var(--tint);font-size:11px;letter-spacing:0;text-transform:none;font-weight:600;color:var(--ink);padding:10px;height:37px;white-space:nowrap}
.ds-sheet tbody tr{height:108px}.ds-sheet tbody:nth-of-type(even) td{background:color-mix(in srgb,var(--tint) 20%,var(--surface))}.ds-sheet tbody+tbody tr:first-child td,.ds-sheet tbody+tbody tr:first-child th{border-top:1px solid var(--line)}
.ds-sheet input,.ds-sheet select{display:block;width:100%;min-width:0;max-width:none;margin:0;border:1px solid var(--line);border-radius:5px;box-shadow:none;background:var(--surface);font:inherit;color:var(--ink);height:33px;padding:6px;outline:none}.ds-sheet input:focus,.ds-sheet select:focus{outline:2px solid var(--amber);outline-offset:1px}.ds-sheet input::placeholder{color:var(--muted);opacity:.65}.ds-factory{display:grid;gap:7px}
.ds-sheet .ds-order-cell{position:sticky;left:0;z-index:1;max-width:84px;padding:14px 9px;vertical-align:top;background:var(--surface);box-shadow:1px 0 0 var(--line);font-weight:400;letter-spacing:0;text-transform:none}.ds-sheet thead .ds-order-cell{z-index:3;background:var(--tint);padding:10px}.ds-order-cell strong{display:block;font-size:12px;line-height:20px}.ds-order-cell small{display:block;font-size:11px;color:var(--muted);line-height:17px}.ds-sheet .ds-new{border:0;border-radius:3px;background:var(--warn);color:var(--ink);font-size:9px;padding:1px 4px;line-height:13px;vertical-align:middle}
.ds-shoe{display:flex;gap:12px;align-items:center;min-width:0}.ds-photo{width:80px;height:80px;flex:0 0 80px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:7px;background:#fff;overflow:hidden}.ds-photo img{display:block;width:100%;height:100%;object-fit:contain}.ds-photo-fallback{font-size:10px;color:#66706a;text-align:center}.ds-shoe-info{display:grid;gap:4px;min-width:0}.ds-shoe-info strong{font-size:13px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ds-shoe-info span{font-size:11px;color:var(--muted);line-height:1.4}.ds-shoe-info small{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ds-sheet .ds-qty{text-align:center;font-size:16px;font-weight:600}
.ds-sheet .ds-row-state{display:block;font-size:10px;color:var(--muted);min-height:14px;margin-top:5px;line-height:15px}.ds-sheet .ds-dirty td{box-shadow:inset 0 -1px 0 var(--amber)}.ds-sheet .ds-row-error .ds-row-state{color:var(--negative)}.ds-row-state button{font-size:10px;padding:1px 4px;line-height:14px;border-radius:2px;margin-left:4px}.ds-sheet .ds-empty{padding:25px;max-width:none;color:var(--muted)}
.ds-pages{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.ds-pages:empty{display:none}.ds-pages button{font-size:12px;padding:5px 9px}
@media(max-width:1400px){.ds-sheet{min-width:1030px}.ds-order-col{width:76px}.ds-col-shoe{width:270px}.ds-col-factory{width:150px}.ds-col-ordered_on{width:100px}.ds-col-status{width:130px}.ds-col-tracking_no{width:150px}.ds-col-delivered_on{width:106px}.ds-sheet td{padding:8px}.ds-photo{width:70px;height:70px;flex-basis:70px}.ds-shoe{gap:9px}}
@media(max-width:700px){.ds-toolbar{gap:7px}.ds-toolbar input{width:170px}.ds-toolbar #ds-count{display:none}.ds-toolbar #ds-save{margin-left:auto}.ds-sheet-wrap{max-height:calc(100vh - 205px)}}
/* One supplier: keep only dates, tracking, factory cost and notes beside the shoe. */
.ds-sheet{min-width:1180px}.ds-order-col{width:76px}.ds-col-shoe{width:320px}.ds-col-quantity{width:44px}.ds-col-ordered_on{width:122px}.ds-col-status{width:126px}.ds-col-tracking_no{width:150px}.ds-col-delivered_on{width:112px}.ds-col-cost{width:94px}.ds-col-notes{width:156px}
.ds-sheet tbody tr{height:148px}.ds-sheet textarea{display:block;width:100%;min-width:0;height:86px;resize:vertical;font:inherit;font-size:12px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:7px;line-height:1.4}.ds-sheet textarea:focus{outline:2px solid var(--amber);outline-offset:1px}.ds-sheet input[type=date]{padding:6px 4px;font-size:12px;cursor:pointer}.ds-col-cost+col{width:156px}.ds-sheet input[data-ds-field=cost]{text-align:right;font-variant-numeric:tabular-nums}.ds-shoe-info .ds-erp{color:var(--ink);font-size:11px}.ds-shoe-info .ds-chinese{color:var(--ink);font-size:11px;overflow-wrap:anywhere;line-height:1.45}
@media(max-width:1400px){.ds-sheet{min-width:1070px}.ds-order-col{width:70px}.ds-col-shoe{width:270px}.ds-col-quantity{width:38px}.ds-col-ordered_on{width:116px}.ds-col-status{width:116px}.ds-col-tracking_no{width:132px}.ds-col-delivered_on{width:104px}.ds-col-cost{width:84px}.ds-col-notes{width:140px}.ds-col-cost+col{width:140px}}

/* Anchor all editable controls to one row baseline; status messages stay below it. */
.ds-sheet tbody td.ds-edit-cell{vertical-align:top;padding-top:20px}.ds-sheet td.ds-edit-cell>input,.ds-sheet td.ds-edit-cell>select,.ds-sheet td.ds-edit-cell>textarea{margin-top:0}.ds-sheet td.ds-edit-cell>textarea{padding:6px}
.ds-sheet tbody td.ds-qty{vertical-align:top;padding-top:25px}
.ds-cost-breakdown{display:grid;gap:3px;margin-top:6px;font-size:11px;line-height:1.3;font-variant-numeric:tabular-nums}.ds-cost-breakdown:empty{display:none}.ds-cost-breakdown small{font-size:10px;color:var(--muted)}.ds-cost-breakdown strong{font-size:11px;font-weight:600;white-space:nowrap}
.ds-toolbar #ds-export{margin-left:auto;flex:0 0 auto}.ds-toolbar #ds-save{margin-left:0}
/* Read-only label/amount cells inside the existing cost column. */
.ds-col-cost{width:150px}.ds-col-shoe{width:300px}.ds-col-notes,.ds-col-cost+col{width:144px}
.ds-sheet td.ds-cost-cell{padding-left:5px;padding-right:5px}
.ds-sheet .ds-cost-grid{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;border-spacing:0;font-size:11px;line-height:1.2}
.ds-sheet .ds-cost-grid tr{height:24px}
.ds-sheet .ds-cost-grid th,.ds-sheet .ds-cost-grid td{position:static;max-width:none;padding:4px;border:1px solid var(--line);background:var(--surface);font-size:11px;font-weight:400;letter-spacing:0;text-transform:none;white-space:nowrap;vertical-align:middle;overflow:visible}
.ds-sheet .ds-cost-grid th{width:60%;text-align:left}.ds-sheet .ds-cost-grid td{text-align:right;font-variant-numeric:tabular-nums}
.ds-sheet .ds-cost-grid .ds-cost-total th,.ds-sheet .ds-cost-grid .ds-cost-total td{font-weight:700;background:var(--tint)}
.ds-toolbar #ds-export,.ds-toolbar #ds-save{display:inline-flex;align-items:center;justify-content:center;align-self:center;box-sizing:border-box;height:33px;min-height:33px;margin-top:0;margin-bottom:0;line-height:1;padding:7px 10px}
.ds-toolbar #ds-export,.ds-toolbar #ds-save{width:120px;min-width:120px;flex:0 0 120px}
@media(max-width:1400px){.ds-col-cost{width:142px}.ds-col-shoe{width:254px}.ds-col-notes,.ds-col-cost+col{width:128px}}

/* Keep native date controls readable without iOS focus zoom. */
@media(max-width:700px){
 .ds-sheet input,.ds-sheet input[type=date],.ds-sheet select,.ds-sheet textarea{font-size:16px;min-height:40px}
 .ds-col-ordered_on,.ds-col-delivered_on{width:170px}
}
