:root{font-family:system-ui,-apple-system,"Noto Sans",sans-serif;color:#18332c;background:#f3f6f4;font-size:17px;--green:#11664d;--border:#dce5df}*{box-sizing:border-box}body{margin:0}header{background:#123b30;color:white;padding:24px max(20px,calc((100vw - 1180px)/2)) 16px}.head{display:flex;align-items:center;justify-content:space-between;gap:12px}.head>div{display:flex;gap:14px;align-items:center}.logo{font-weight:850;font-size:32px;background:#d5f4a3;color:#163b2c;padding:8px 12px;border-radius:12px}h1{font-size:27px;margin:0}small{color:#c0d5ca}.snapshot{font-size:13px;border-top:1px solid #466557;padding-top:12px;margin-top:18px;color:#d9e6de}#sync{font-size:13px;color:#d5f4a3}main{max-width:1220px;margin:auto;padding:20px}h2{font-size:24px;margin:18px 0}h3{margin-top:0;font-size:21px}p{line-height:1.6}input,select,textarea,button{font:inherit;border:1px solid #c3d3c9;border-radius:8px;padding:12px;min-height:48px;color:inherit;background:white}input,select,textarea{max-width:100%;min-width:0}button{cursor:pointer;font-weight:650}button:hover{border-color:var(--green);background:#eaf5ed}button:disabled{opacity:.45;cursor:wait}label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600}nav{display:flex;gap:8px;margin:18px 0;border-bottom:1px solid var(--border);padding-bottom:12px}nav button{flex:1;max-width:220px;border:0;background:transparent}nav .active,.primary{background:var(--green);color:white}.primary:hover{background:#0e503c}.identity{display:flex;align-items:center;gap:22px;flex-wrap:wrap}.identity label{flex-direction:row;align-items:center}.identity input{width:180px}.identity span,.muted{font-size:14px;color:#63756c}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}#summary{font-size:14px;color:#5c7164}.filters{display:flex;gap:12px;margin:8px 0 20px;flex-wrap:wrap}.filters input[type=search]{flex:1;min-width:200px}.check{flex-direction:row;align-items:center}.check input{min-height:22px;width:22px}.stock-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.stock-card,article,.history-card,.preview-line{background:white;border:1px solid var(--border);border-radius:12px;padding:20px}.stock-card h3{font-size:17px;margin:10px 0 16px;overflow-wrap:anywhere;min-height:44px}.badge{font-size:11px;font-weight:800;letter-spacing:.7px;background:#e8f2e9;color:#21624e;padding:4px 7px;border-radius:5px}.stock-card .top{display:flex;justify-content:space-between;align-items:center}.total{font-size:14px;color:#52715d}.sizes{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.size-chip{background:#eaf3ec;text-align:center;border-radius:6px;padding:8px 2px}.size-chip small{display:block;font-size:11px;color:#617468}.size-chip b{display:block;margin-top:6px;font-size:18px;color:#155e42}.size-chip.zero{background:#f4f5f4}.size-chip.zero b{color:#a5afa7}.stock-card .manage-link{margin-top:14px;padding:7px 10px;min-height:34px;font-size:13px;width:100%}article{margin-bottom:18px}.form-grid{display:grid;grid-template-columns:2fr 3fr 1fr 1fr;gap:12px}.form-grid select{width:100%}.current{background:#edf6ee;border-radius:8px;padding:12px;font-weight:700}.actions{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.actions input{width:165px}.subtract,.danger{background:#fff3ef;color:#a33725;border-color:#edc4b9}.actions button{min-width:68px}textarea{width:100%;resize:vertical;margin:0 0 14px;line-height:1.6}#notice:not(:empty){padding:22px 24px;border-radius:14px;margin:8px 0 22px;background:#b7e8b8;border:3px solid #157a4a;white-space:pre-line;font-size:26px;font-weight:800;line-height:1.45;color:#0b3a28;letter-spacing:.2px}#notice.error{background:#ffd8ce;border-color:#c44732;color:#8a2416}#preview{margin:18px 0;display:grid;gap:10px}.preview-line{padding:14px;background:#f5faf6}.preview-line.bad{background:#fff3ef;border-color:#edc4b9}.preview-line strong{display:block;overflow-wrap:anywhere}.preview-line p{margin:7px 0}.preview-line label{display:flex;flex-direction:row;align-items:center;gap:12px}.preview-line select{min-height:40px;padding:7px}.history-card{margin:12px 0}.history-card h3{font-size:17px;margin:8px 0}.history-card small{color:#63756c}.history-card p{margin:8px 0}.history-card .delta{font-weight:800;color:var(--green)}.history-card .delta.down{color:#a33725}.history-section{font-size:20px;margin:22px 0 10px}.history-card.stock{border:2px solid #abd0b0}.history-card.stock h3{font-size:20px}a{color:var(--green);font-size:14px;font-weight:650}footer{font-size:12px;color:#6e7e72;border-top:1px solid var(--border);margin-top:35px;padding:20px 0;line-height:1.8}#more{display:block;margin:20px auto}#more[hidden],[hidden]{display:none!important}.empty{padding:30px;background:white;border-radius:12px;color:#708075}#historySearch{width:100%}@media(max-width:1000px){.stock-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid{grid-template-columns:1fr 1fr}}@media(max-width:600px){main{padding:14px}header{padding:18px 16px 14px}h1{font-size:23px}.head{align-items:flex-start}#sync{max-width:90px}.stock-grid{grid-template-columns:1fr}.filters select{flex:1}.identity{gap:8px}.identity span{font-size:12px}.identity input{width:170px}nav button{padding:12px 6px}.stock-card{padding:17px}.form-grid{grid-template-columns:1fr}.actions{align-items:end}.actions label{flex:1}.actions input{width:100%}.actions #custom{width:100%}.section-title .actions{width:100%;margin-bottom:10px}.preview-line{padding:12px}.snapshot{font-size:12px}.stock-card h3{min-height:0}article{padding:16px}}

.jumps{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.jumps a{background:white;border:1px solid var(--border);border-radius:999px;padding:8px 12px;text-decoration:none;font-size:14px;min-height:0;color:#184437}
.jumps a:hover{background:#eaf5ed;border-color:var(--green)}
.stock-table-wrap{overflow:auto;max-height:calc(100vh - 280px);border:1px solid var(--border);border-radius:12px;background:white}
.stock-table{width:100%;border-collapse:separate;border-spacing:0;font-size:16px}
.stock-table thead th{position:sticky;top:0;z-index:2;background:#123b30;color:white;font-weight:700;padding:10px 8px;text-align:center}
.stock-table thead .name-col{text-align:left;min-width:240px;z-index:3;left:0;background:#123b30;color:white}
.stock-table th,.stock-table td{border-bottom:1px solid #e6eee8;padding:8px 6px;text-align:center;white-space:nowrap}
.stock-table .name-col{position:sticky;left:0;text-align:left;background:white;font-weight:650;padding-left:14px;padding-right:16px}
.stock-table .series-row td{position:sticky;left:0;background:#e7f1ea;text-align:left;font-weight:750;padding:10px 14px;border-top:1px solid #cfe0d4}
.stock-table .style-row{cursor:pointer}
.stock-table .style-row:hover td,.stock-table .style-row:hover .name-col{background:#f3faf4}
.stock-table td.zero{color:#b0b8b3}
.stock-table .row-total{font-weight:750;color:#155e42;background:#f4faf5}
@media(max-width:600px){
 .stock-table-wrap{max-height:calc(100vh - 240px)}
 .stock-table{font-size:14px}
 .stock-table thead .name-col,.stock-table .name-col{min-width:160px}
 .jumps a{padding:6px 10px;font-size:13px}
}

.filters select#sizeFilter{min-width:110px}
.stock-table .photo-col{width:52px;padding:6px 8px}
.stock-table thead .photo-col{background:#123b30}
.sku-photo{width:40px;height:40px;object-fit:cover;border-radius:8px;display:block;background:#eef3ef;cursor:zoom-in}
.no-photo{display:block;width:40px;height:40px;border-radius:8px;background:#eef2ef}
.stock-table th.hi,.stock-table td.hi{background:#d5f4a3;color:#123b30;font-weight:800}
.stock-table thead th.hi{background:#d5f4a3;color:#123b30}
#lightbox{position:fixed;inset:0;background:rgba(12,28,22,.78);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;z-index:20;padding:24px}
#lightbox[hidden]{display:none!important}
#lightbox img{max-width:min(720px,92vw);max-height:80vh;border-radius:16px;background:white}
#lightboxClose{background:white;min-width:120px}

#login{position:fixed;inset:0;background:rgba(12,28,22,.72);display:flex;align-items:center;justify-content:center;z-index:30;padding:24px}
#login[hidden]{display:none!important}
#login form{background:white;border-radius:16px;padding:28px 24px;width:min(420px,100%);display:grid;gap:14px}
#login h2{margin:0}
#loginError{color:#a13524;background:#fff1ed;border:1px solid #e7b1a6;border-radius:8px;padding:10px 12px;margin:0}
#whoText{font-weight:700}
#logout{min-height:40px;padding:8px 14px}

.quick-adjust{display:flex;align-items:stretch;gap:10px;margin:12px 0 4px}
.sell-one{flex:0 0 auto;min-width:96px;width:auto;padding:12px 22px;font-size:18px;font-weight:800;letter-spacing:0;background:#fff3ef;color:#a33725;border-color:#edc4b9}
.actions.custom-qty{padding-top:14px;margin-top:8px;border-top:1px dashed var(--border);align-items:end;justify-content:flex-start;flex-wrap:nowrap;gap:8px}
.actions.custom-qty label{flex:0 1 165px;min-width:0}
.custom-qty #custom{flex:0 0 auto;min-width:88px;background:#f7faf7}
.stock-table .name-col .sku-photo,.stock-table .name-col .no-photo{float:left;margin:0 8px 0 0}
.stock-table .name-col span{display:block;white-space:normal;line-height:1.3;overflow-wrap:anywhere}
.stock-table .name-col,.stock-table .series-row td{white-space:normal}
.stock-table thead .name-col,.stock-table .name-col{min-width:280px}
@media(max-width:600px){
 .quick-adjust{flex-wrap:nowrap}
 .sell-one{min-height:52px;font-size:17px}
 .actions.custom-qty #custom{width:auto;min-width:88px}
 .jumps{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;gap:6px;padding-bottom:8px}
 .jumps a{flex:0 0 auto;white-space:nowrap}
 .stock-table{table-layout:fixed;width:100%;font-size:13px}
 .stock-table-wrap{overflow-x:hidden;max-height:calc(100vh - 220px)}
 .stock-table thead .name-col,.stock-table .name-col{min-width:0;width:36%;padding:8px 6px}
 .stock-table .name-col span{font-size:12px;line-height:1.25}
 .stock-table .sku-photo,.stock-table .no-photo{width:28px;height:28px}
 .stock-table th,.stock-table td{padding:8px 2px}
 .stock-table thead th{padding:8px 2px;font-size:12px}
 .stock-table .row-total,.stock-table thead th.row-total{display:none}
 .stock-table .series-row td{padding:8px 10px;font-size:13px;line-height:1.35}
}

#flashToast:not([hidden]){position:fixed;left:50%;top:42%;transform:translate(-50%,-50%);z-index:80;background:#0c5a36;color:#fff;padding:24px 26px;border-radius:18px;font-size:26px;font-weight:800;line-height:1.45;text-align:center;box-shadow:0 18px 50px rgba(0,0,0,.38);pointer-events:none;max-width:min(420px,92vw);white-space:pre-line;animation:toast-pop .22s ease}
@keyframes toast-pop{from{transform:translate(-50%,-40%);opacity:0}to{transform:translate(-50%,-50%);opacity:1}}
#notice:not(:empty){position:sticky;top:0;z-index:15;box-shadow:0 8px 24px rgba(12,48,34,.18)}
#current.just-changed{background:#fff3b0;border:3px solid #c9a227}
button.just-clicked{transform:scale(.98);background:#0c5a36!important;color:#fff!important;border-color:#0c5a36!important}

.mode-switch{display:flex;gap:8px;margin:0 0 16px}
.mode-switch button{flex:1;max-width:200px;background:white}
.mode-switch button.active{background:var(--green);color:white}
.restock-one{flex:1;min-width:140px;font-size:22px;font-weight:800;letter-spacing:.4px;background:#d5f4a3;color:#0c5a36;border-color:#8fbf6a}
.preview-line.new{background:#eef8e6;border-color:#8fbf6a}
.preview-line .new-tag{font-weight:800;color:#0c5a36}
@media(max-width:600px){
 .mode-switch button{max-width:none}
 .restock-one{min-height:56px;font-size:20px}
}

#manage{display:flex;flex-direction:column}
#manage h2{order:0}
#manage .mode-switch{order:1}
#restockBanner{order:2}
#manualPanel{order:3}
#pastePanel{order:4}
#recentPanel{order:5}
.restock-banner{background:#fff4d6;border:1px solid #e0a844;color:#7a4b00;border-radius:12px;padding:14px 16px;margin:0 0 16px;font-weight:700;line-height:1.5}
#modeRestock.active{background:#c05621;color:#fff}
#modeRestock.active:hover{background:#9a4318;border-color:#9a4318}
#manage.restock-view #pastePanel{order:3;border:2px solid #c05621;background:#fffaf3}
#manage.restock-view #manualPanel{order:4;background:#f6f7f5;border-style:dashed}
#manage.restock-view #pasteTitle{font-size:26px}
#manage.restock-view #paste{min-height:220px}
#manage.restock-view #parse{min-height:56px;font-size:18px;background:#c05621}
#manage.restock-view #parse:hover{background:#9a4318;border-color:#9a4318}
#manage.restock-view #commit.primary{background:#c05621}
#manage.restock-view .restock-one{flex:0 0 auto;width:auto;min-width:96px;min-height:44px;font-size:15px;font-weight:700;padding:8px 16px}
@media(max-width:600px){
 #manage.restock-view #pasteTitle{font-size:22px}
 #manage.restock-view #paste{min-height:180px}
}

#recentPanel h3{font-size:18px;margin-bottom:6px}
#recentPanel .muted{margin:0 0 10px;font-size:13px}
#recentUpdates{display:flex;flex-direction:column;gap:6px}
.recent-card{background:#fff;border:1px solid #c9decc;border-radius:8px;padding:8px 12px}
.recent-card .recent-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;font-size:14px;line-height:1.35}
.recent-card strong{font-size:14px;font-weight:750}
.recent-card .recent-when{font-size:12px;color:#63756c;white-space:nowrap}
.recent-card .recent-qty{font-size:13px}
.recent-card small{display:block;margin-top:2px;font-size:12px;color:#63756c}
.recent-card .delta{font-weight:800;color:var(--green)}
.recent-card .delta.down{color:#a33725}

#preview{display:block;margin:18px 0}
.preview-sum{margin:0 0 12px}
.preview-block{border-radius:12px;padding:12px 12px 8px;margin:0 0 14px}
.preview-block h4{margin:0 0 10px;font-size:16px}
.preview-block.ok{background:#e7f8ef;border:2px solid #1a9a6a}
.preview-block.ok h4{color:#0b5c3a}
.preview-block.fail{background:#fff1ee;border:2px solid #c44732}
.preview-block.fail h4{color:#8a2416}
.preview-block.warn{background:#fff8e6;border:2px solid #c47f12}
.preview-block.warn h4{color:#8a5a00}
.preview-block.warn ul{margin:0;padding-left:1.2em;font-weight:700;color:#8a5a00}
.preview-row.warn{background:#ffe9b8;border-color:#e0a84a}
.preview-table{overflow-x:auto}
.preview-head,.preview-row{display:grid;grid-template-columns:44px minmax(180px,2.4fr) 88px 52px 92px 100px minmax(150px,1.5fr) 120px;gap:8px;align-items:center;min-width:760px}
.preview-head{font-size:12px;font-weight:700;color:#4d6258;padding:0 10px 8px;border-bottom:1px solid rgba(0,0,0,.08)}
.preview-row{background:#fff;border:1px solid transparent;border-radius:8px;padding:8px 10px;margin:6px 0}
.preview-row.ok{background:#d4f3e2;border-color:#7dcea0}
.preview-row.fail{background:#ffd6cc;border-color:#e3a090}
.preview-row .c-no{font-weight:700;color:#4d6258}
.preview-row .c-name{font-weight:750;overflow-wrap:anywhere}
.preview-row .c-msg{font-size:13px}
.preview-row .new-tag{display:block;margin-top:3px;font-size:12px;font-weight:800;color:#0c5a36}
.preview-row select{min-height:36px;padding:4px 8px;width:100%}
.preview-block .empty{padding:12px;background:transparent}
@media(max-width:600px){
 .preview-head,.preview-row{font-size:13px}
}

.online-now{font-size:13px;color:#21624e;font-weight:700}
.pick-row{margin:0 0 14px}
.pick-row input{width:100%}
.form-grid{grid-template-columns:1.6fr 1.6fr 1fr}
.batch-channel{display:flex;flex-direction:column;gap:6px;max-width:280px;margin:0 0 12px;font-size:14px;font-weight:600}
#current{margin:16px 0 14px;border:2px solid #11664d;background:#e8f6ea;border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;font-weight:600}
#current .chosen-label{font-size:12px;font-weight:700;color:#4d6a58;letter-spacing:.3px}
#current strong{font-size:22px;font-weight:800;color:#0b3a28;line-height:1.3}
#current .chosen-name{font-size:14px;color:#355246;font-weight:650}
.log-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px;align-items:center}
.log-filters input,.log-filters select{min-height:40px;padding:8px 10px;font-size:14px}
.log-filters input[type=search]{flex:1;min-width:180px}
.log-filters input[type=date]{min-width:150px}
button.recent-card{display:block;width:100%;text-align:left;cursor:pointer;font:inherit;color:inherit}
button.recent-card:hover{border-color:#11664d;background:#eef8f1}
#history .history-card{padding:8px 12px;margin:6px 0;border-radius:8px}
#history .history-card h3{font-size:14px;margin:3px 0;font-weight:750}
#history .history-card p{margin:3px 0;font-size:13px}
#history .history-card small{font-size:12px}
#history .history-card.stock h3{font-size:14px}
#history .history-section{font-size:16px;margin:16px 0 8px}
#history .history-card.highlight{outline:2px solid #11664d;background:#e8f6ea}
@media(max-width:600px){
 .form-grid{grid-template-columns:1fr}
 #current strong{font-size:20px}
 .log-filters input,.log-filters select{flex:1;min-width:140px}
}

.custom-dates{display:flex;gap:8px;flex-wrap:wrap}
.undo-card{display:flex;justify-content:space-between;align-items:center;gap:12px}
.undo-card .undo-one{flex:0 0 auto;min-width:88px}
.undo-card.undone{opacity:.72}
nav button{max-width:160px}
@media(max-width:600px){
 .undo-card{flex-direction:column;align-items:stretch}
 nav button{max-width:none}
}

#undoModal{position:fixed;inset:0;background:rgba(20,10,8,.58);display:flex;align-items:center;justify-content:center;z-index:90;padding:20px}
#undoModal[hidden]{display:none!important}
.undo-modal-card{background:#fff6f3;border:4px solid #c44732;border-radius:18px;padding:28px 26px 22px;max-width:520px;width:100%;box-shadow:0 18px 50px rgba(0,0,0,.22)}
.undo-modal-card h2,.undo-lead{font-size:32px;line-height:1.25;color:#8a2416;margin:0 0 16px;font-weight:850}
.undo-modal-card #undoModalBody p{font-size:18px;margin:8px 0;line-height:1.45}
.undo-modal-actions{display:flex;gap:12px;margin-top:22px}
.undo-modal-actions button{flex:1;min-height:56px;font-size:18px}
#undoModalYes{background:#c44732;color:#fff;border-color:#9b2f1e}
#undoModalYes:hover{background:#9b2f1e}
.recent-card{display:flex;align-items:center;justify-content:space-between;gap:10px}
.recent-main{flex:1;min-width:0;text-align:left;background:transparent;border:0;padding:0;min-height:0;font:inherit;color:inherit;cursor:pointer}
.recent-card .undo-one{flex:0 0 auto;min-width:76px;min-height:40px;padding:8px 12px}
.undone-tag{flex:0 0 auto;font-size:13px;font-weight:700;color:#8a2416;background:#ffece7;border-radius:8px;padding:6px 10px}
.recent-card.undone{opacity:.78}

.restock-view .channel-field,.restock-view .batch-channel{display:none!important}
.restock-view .preview-head,.restock-view .preview-row{grid-template-columns:44px minmax(180px,2.4fr) 88px 52px 92px 100px minmax(150px,1.5fr)}

.recent-card.undone,.history-card.undone,.undo-card.undone{opacity:1;background:#ebe6e2;border-color:#b7aaa3;color:#5f5752}
.recent-card.undone .recent-main{color:#5f5752}
.recent-card.undone strong,.history-card.undone h3,.recent-card.undone .recent-qty,.history-card.undone p{color:#6a625c;text-decoration:line-through;text-decoration-color:#9a8f89}
.recent-card.undone .delta,.history-card.undone .delta,.recent-card.undone .delta.down,.history-card.undone .delta.down{color:#8a7f79!important}
.undone-tag{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:84px;min-height:44px;padding:7px 10px;border-radius:8px;background:#5c5551;color:#fff;font-size:13px;font-weight:800;line-height:1.2;text-align:center}
.undone-tag em{display:block;margin-top:3px;font-style:normal;font-size:15px;font-weight:850}
.undone-by{display:block;margin-top:4px;font-size:13px;font-weight:800;color:#8a2416}
.undo-card.undone{opacity:1}

.photo-edit{min-height:28px;padding:3px 8px;font-size:12px;margin-top:4px;font-weight:650}
.recent-card.photo-change,.history-card.photo-card{background:#eef3f8;border-color:#9bb4c7}
@media(max-width:600px){.photo-edit{font-size:11px;min-height:26px;padding:2px 6px}}

.identity{justify-content:space-between;width:100%}
.identity-left{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#online.online-now{margin-left:auto;background:#11664d;color:#fff;font-weight:800;font-size:14px;padding:8px 14px;border-radius:999px;line-height:1.2;white-space:nowrap}
#online.online-now.empty{background:#e4ece6;color:#6a7a70;font-weight:650}
@media(max-width:600px){#online.online-now{font-size:12px;padding:6px 10px;white-space:normal}}

.size-field{grid-column:1/-1}
.size-picks{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.size-pick{min-height:58px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:#fff;border:1px solid #c3d3c9}
.size-pick b{font-size:20px;line-height:1.1}
.size-pick small{font-size:12px;color:#63756c;font-weight:650}
.size-pick.active{background:var(--green);color:#fff;border-color:#0e503c}
.size-pick.active small{color:#d5f4a3}
.size-pick.zero,.size-pick.soldout{background:#f8e8e4;border-color:#e3a090;color:#8a2416}
.size-pick.zero b,.size-pick.soldout b{color:#a1190f}
.size-pick.zero small,.size-pick.soldout small{color:#a33725;font-weight:800}
.size-pick.zero.active,.size-pick.soldout.active{background:#c44732;color:#fff;border-color:#9b2f1e}
.size-pick.zero.active b,.size-pick.soldout.active b{color:#fff}
.size-pick.zero.active small,.size-pick.soldout.active small{color:#ffd8ce}
@media(max-width:600px){.size-pick{min-height:50px;padding:6px 2px}.size-pick b{font-size:17px}.size-pick small{font-size:11px}}

/* Recent-update multi-select; selection lives outside the history-jump button. */
.undo-toolbar{position:sticky;top:8px;z-index:12;display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#fff7f2;border:1px solid #d7b9aa;border-radius:10px;padding:10px;margin:10px 0;box-shadow:0 3px 10px #0001}
.undo-toolbar span{font-weight:750;margin-right:auto}
.undo-toolbar button{min-height:44px;padding:8px 12px;font-size:14px}
.undo-pick{flex:0 0 44px;min-height:44px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.undo-pick input{width:24px;height:24px;min-height:24px;margin:0;accent-color:#a33725;cursor:pointer}
.undo-modal-card{max-height:calc(100dvh - 32px);display:flex;flex-direction:column}
#undoModalBody{overflow-y:auto;min-height:0;max-height:55dvh;overscroll-behavior:contain}
.undo-modal-actions{flex-shrink:0}
.undo-item{border-top:1px solid #e1c0b4;padding:8px 0;overflow-wrap:anywhere}
@media(max-width:600px){.undo-toolbar{top:4px;padding:8px;gap:6px}.undo-toolbar span{font-size:14px}.undo-toolbar button{padding:8px;font-size:13px}.recent-card{gap:5px;padding:8px}.undo-pick{flex-basis:36px}.undo-modal-card{padding:18px 14px}.undo-modal-card h2{font-size:26px}}

/* Explicit new-stock column between shoe name and size, shared by both modes. */
.preview-row .c-new{text-align:center;min-width:0}
.preview-row .new-stock-alert{display:inline-block;color:#c00000;font-size:30px;font-weight:900;line-height:1.2;white-space:nowrap}
@media(max-width:600px){.preview-row .new-stock-alert{font-size:26px}}

/* A single visual style row, retaining each original size/quantity and stock value. */
.preview-head .c-sizeqty-head,.preview-row .c-sizeqty{grid-column:4 / span 2}
.size-qty-list{display:flex;flex-wrap:wrap;gap:5px}
.size-qty-chip{display:inline-block;white-space:nowrap;padding:4px 6px;border-radius:5px;background:#fff9;font-size:14px;font-weight:800}
.group-total{display:block;margin-top:8px;color:#42664f;font-size:12px}
.size-stock-list{display:flex;flex-wrap:wrap;gap:4px 8px;align-content:center}
.size-stock-chip{display:inline-block;white-space:nowrap;font-size:13px}
@media(max-width:600px){
 .preview-table .preview-head{display:none}
 .preview-table .preview-row{min-width:0;grid-template-columns:minmax(0,1fr) 78px;gap:10px;padding:12px}
 .preview-table .c-no{display:none}
 .preview-table .c-name{grid-column:1;grid-row:1}
 .preview-table .c-new{grid-column:2;grid-row:1}
 .preview-table .c-size,.preview-table .c-sizeqty,.preview-table .c-qty,.preview-table .c-stock,.preview-table .c-msg,.preview-table .c-src{grid-column:1 / -1}
 .preview-table .c-stock:before{content:'库存：';font-weight:700}
 .preview-table .c-size:not(.c-sizeqty):before{content:'尺码：'}
 .preview-table .c-src:empty{display:none}
 .preview-table .c-msg{font-weight:700}
 .preview-table .size-qty-chip{font-size:15px;padding:5px 8px}
}

/* Wider, flatter quantity and stock lanes; result sits after both. */
@media(min-width:601px){
 .preview-head,.preview-row{grid-template-columns:32px minmax(140px,1.15fr) 60px minmax(100px,.8fr) minmax(100px,.8fr) minmax(230px,1.6fr) minmax(100px,.65fr) 100px;gap:10px;min-width:960px}
 .restock-view .preview-head,.restock-view .preview-row{grid-template-columns:32px minmax(140px,1.15fr) 60px minmax(100px,.8fr) minmax(100px,.8fr) minmax(230px,1.6fr) minmax(100px,.65fr)}
 .preview-row .c-msg{padding-left:10px}
}
.preview-row .new-stock-alert{font-size:17px;line-height:1.3}
.restock-tag{display:inline-block;color:#287552;font-size:14px;white-space:nowrap}
.size-stock-list{gap:6px 12px}
.size-stock-chip{font-variant-numeric:tabular-nums}
.grouped-history .size-qty-list{margin:8px 0 6px}
.grouped-history .size-stock-list{margin:4px 0 8px}
.history-group-main{flex:1;min-width:0}
.grouped-history .size-undone{color:#847c76;background:#eee}
.grouped-history.undone .size-qty-chip{background:#eee;color:#847c76}
@media(max-width:600px){
 .preview-row .new-stock-alert{font-size:16px}
 .grouped-history .size-qty-chip{font-size:13px;padding:4px 6px}
}

/* Fixed left checkbox gutter; multi-size cards never shift the checkbox column. */
#history .grouped-history,#recentUpdates .grouped-history{position:relative;display:flex;flex-direction:row;align-items:flex-start;gap:10px;padding:8px 12px}
.grouped-history .history-record-anchor{position:absolute;top:0;left:0;pointer-events:none}
.grouped-history .undo-pick,.grouped-history .undo-gutter{box-sizing:border-box;flex:0 0 36px;width:36px;min-width:36px;max-width:36px;min-height:24px;margin:0;padding:0;align-self:flex-start;display:flex;align-items:flex-start;justify-content:flex-start}
.grouped-history .undo-pick input{margin:0}
.grouped-history .recent-main,.grouped-history .history-group-main{flex:1;min-width:0}
.grouped-history>.undo-one,.grouped-history>.undone-tag{flex:0 0 auto;align-self:flex-start}
@media(max-width:600px){
 #history .grouped-history,#recentUpdates .grouped-history{gap:8px;padding:8px 12px;flex-wrap:wrap}
 .grouped-history .recent-main,.grouped-history .history-group-main{flex-basis:calc(100% - 44px)}
 .grouped-history>.undo-one,.grouped-history>.undone-tag{margin-left:44px}
}

/* Neutral, touch-friendly reset controls live inside their own filter row. */
.filters .clear-filters,.log-filters .clear-filters{flex:0 0 auto;align-self:center;min-height:44px;padding:8px 12px;white-space:nowrap;background:#edf3ef;color:#315846;border:1px solid #bdcec3;font-size:14px;margin-left:auto}
.filters .clear-filters:hover,.log-filters .clear-filters:hover{background:#deebe2;border-color:#7e9e8b}
@media(max-width:600px){.filters .clear-filters,.log-filters .clear-filters{min-width:110px;min-height:44px}}

/* Manager + paging */
#navMgr{max-width:160px}
.mgr-table-wrap{overflow:auto;max-height:60vh;border:1px solid var(--border);border-radius:12px;background:white;margin-top:10px}
.mgr-table{width:100%;border-collapse:collapse;font-size:15px}
.mgr-table th,.mgr-table td{padding:8px 10px;border-bottom:1px solid #e6eee8;text-align:left;white-space:nowrap}
.mgr-table th{background:#123b30;color:white;position:sticky;top:0}
.mgr-table tr.red td{background:#fff1ec;color:#8a2416;font-weight:700}
.mgr-table tr.ok td{color:#155e42}
.mgr-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin:12px 0}
.mgr-kpi{background:#edf6ee;border:1px solid var(--border);border-radius:10px;padding:12px}
.mgr-kpi b{display:block;font-size:22px;margin-top:4px}
.load-more{display:block;margin:16px auto;min-width:160px}
.primary-link{display:inline-flex;align-items:center;padding:10px 12px;border-radius:8px;background:var(--green);color:white!important;text-decoration:none;font-weight:700;min-height:44px}
@media(max-width:600px){.mgr-table{font-size:13px}.mgr-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}


.soldout-table-wrap{overflow:auto;margin-top:10px}
.soldout-table{width:100%;border-collapse:collapse;font-size:14px;min-width:640px}
.soldout-table th,.soldout-table td{padding:8px 10px;border-bottom:1px solid #d7e0da;text-align:left;vertical-align:top}
.soldout-table th{background:#eef5f0;font-weight:750;color:#1f3d32;position:sticky;top:0}
.soldout-table tr.restocked td{background:#fff8e6}
.soldout-table .qty-now{font-weight:800}
.soldout-table .qty-now.zero{color:#a1190f}
.soldout-table .qty-now.ok{color:#0b5c3a}
.soldout-note{display:block;font-size:12px;color:#8a5a00;font-weight:700;margin-top:2px}
/* deploy 1794240569 */

.current.soldout{background:#ffe3db;border:2px solid #c44732;color:#8a2416}
.current .soldout-badge{display:inline-block;margin-left:8px;padding:4px 10px;border-radius:999px;background:#c44732;color:#fff;font-size:16px;font-weight:900;letter-spacing:.5px;vertical-align:middle}
.current .soldout-hint{display:block;margin-top:8px;font-size:15px;font-weight:800;color:#8a2416;line-height:1.4}

#soldoutHitModal{position:fixed;inset:0;background:rgba(80,8,0,.72);display:flex;align-items:center;justify-content:center;z-index:95;padding:20px}
#soldoutHitModal[hidden]{display:none!important}
.soldout-hit-card{background:#fff1ee;border:5px solid #c44732;border-radius:20px;padding:28px 26px 22px;max-width:560px;width:100%;box-shadow:0 20px 60px rgba(0,0,0,.3);max-height:calc(100dvh - 32px);display:flex;flex-direction:column}
.soldout-hit-card h2{font-size:40px;line-height:1.2;color:#a1190f;margin:0 0 14px;font-weight:950;letter-spacing:1px}
#soldoutHitBody{overflow-y:auto;min-height:0;max-height:45dvh}
.soldout-hit-list{margin:0;padding-left:1.2em;font-size:22px;font-weight:850;color:#8a2416;line-height:1.55}
.soldout-hit-reminder{margin:16px 0 0;padding:14px 16px;background:#c44732;color:#fff;border-radius:12px;font-size:20px;font-weight:900;line-height:1.4}
.soldout-hit-actions{display:flex;margin-top:22px;flex-shrink:0}
.soldout-hit-actions button{flex:1;min-height:60px;font-size:22px;font-weight:900;background:#8a2416;color:#fff;border-color:#6d1a10}
.soldout-hit-actions button:hover{background:#6d1a10}
@media(max-width:600px){.soldout-hit-card h2{font-size:32px}.soldout-hit-list{font-size:18px}.soldout-hit-reminder{font-size:17px}.soldout-hit-actions button{font-size:18px;min-height:54px}}

.soldout-table tr.pending-ack td{background:#ffe6de}
.soldout-table tr.pending-ack.restocked td{background:#ffe8c8}
.soldout-ack-cell{min-width:150px}
.soldout-ack-cell label{display:flex;align-items:flex-start;gap:8px;cursor:pointer;font-weight:750}
.soldout-ack-cell input{width:22px;height:22px;min-height:22px;margin-top:1px;accent-color:#0b5c3a;cursor:pointer;flex:0 0 auto}
.soldout-ack-sig{display:block;margin-top:4px;font-size:13px;font-weight:850;color:#0b5c3a}
.soldout-ack-pending{display:block;margin-top:4px;font-size:12px;font-weight:800;color:#a1190f}
.soldout-table th.ack-col,.soldout-table td.soldout-ack-cell{text-align:left}

#soldoutAckAll{white-space:nowrap}
@media(max-width:600px){#soldoutAckAll{width:100%;order:5}.log-filters #clearSoldoutFilters{width:100%}}

#notice:not(:empty){display:flex;align-items:flex-start;gap:12px}#notice .notice-text{flex:1;min-width:0;overflow-wrap:anywhere}#notice .notice-close{flex:none;min-height:44px;min-width:44px;padding:4px 10px;font-size:22px;line-height:1;border-radius:10px;background:rgba(255,255,255,.75);border:2px solid currentColor;color:inherit}
@media(max-width:600px){#notice:not(:empty){padding:12px 12px 12px 14px;font-size:18px;line-height:1.4;margin:6px 0 14px;border-width:2px;max-height:40vh;overflow:auto}#notice .notice-close{min-height:40px;min-width:40px;font-size:20px}}
#mgrSales{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
@media(max-width:600px){.soldout-table{min-width:0;display:block}.soldout-table thead{display:none}.soldout-table tbody{display:block}.soldout-table tr{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:10px 12px;margin:0 0 8px;border:1px solid #d7e0da;border-radius:10px;background:white}.soldout-table tr.pending-ack{background:#ffe6de;border-color:#f0b4a5}.soldout-table tr.restocked{background:#fff8e6}.soldout-table tr.pending-ack.restocked{background:#ffe8c8}.soldout-table td,.soldout-table tr.pending-ack td,.soldout-table tr.restocked td,.soldout-table tr.pending-ack.restocked td{padding:0;border:0;background:transparent}.soldout-table td:nth-child(2),.soldout-table td:nth-child(4){display:none}.soldout-table td:nth-child(3){grid-column:1;grid-row:1;font-weight:800;font-size:16px;overflow-wrap:anywhere}.soldout-table td:nth-child(5){grid-column:2;grid-row:1;font-weight:850;font-size:20px;text-align:right}.soldout-table td:nth-child(5)::after{content:"码";font-size:13px;margin-left:2px}.soldout-table td:nth-child(1){grid-column:1;grid-row:2;font-size:12px;color:#63756c}.soldout-table td:nth-child(6){grid-column:2;grid-row:2;text-align:right;font-size:13px}.soldout-table td:nth-child(6) .soldout-note{display:block}.soldout-table td.soldout-ack-cell{grid-column:1/-1;grid-row:3;min-width:0;margin-top:6px;padding-top:8px;border-top:1px dashed #d7e0da}.soldout-ack-cell input{width:28px;height:28px;min-height:28px}.soldout-ack-cell label{min-height:40px;align-items:center;flex-direction:row;justify-content:flex-start;text-align:left}}

/* BAG quantity-only list: one 数量 column, shoe size tables unchanged */
.stock-table.bag-table{width:auto;min-width:16rem;margin-bottom:1.25rem}
.stock-table.bag-table .row-total{min-width:4.5rem}
#manage .size-field.bag-mode .size-picks{grid-template-columns:1fr}
#manage .size-field.bag-mode .size-pick{min-width:6.5rem}


/* 查库存 备注栏 — compact: desktop narrow single-line; mobile inside the name cell */
.stock-table thead .note-col{text-align:left;min-width:88px;max-width:120px;width:6.5rem;font-weight:700;font-size:13px}
.stock-table td.note-col{text-align:left;white-space:normal;vertical-align:middle;min-width:88px;max-width:120px;width:6.5rem;padding:4px 6px;cursor:default}
.note-wrap{display:flex;flex-direction:column;gap:0;align-items:stretch;min-width:0}
.name-col .note-wrap{display:none}
.name-tools{display:block}
textarea.note-input{
  width:100%;
  height:26px;
  min-height:26px;
  max-height:26px;
  margin:0;
  padding:2px 6px;
  resize:none;
  font:inherit;
  font-size:12px;
  font-weight:600;
  line-height:20px;
  border:1px solid #d5dfd8;
  border-radius:4px;
  background:#fff;
  color:inherit;
  overflow:hidden;
}
.note-wrap.note-edit .note-input,
.note-input:focus{
  max-height:none;
  overflow:auto;
  outline:2px solid #157a4a;
  outline-offset:1px;
  border-color:#157a4a;
}
button.note-preview{
  display:block;
  width:100%;
  max-width:100%;
  height:22px;
  min-height:22px;
  margin:0;
  padding:1px 2px;
  border:0;
  border-radius:3px;
  background:transparent;
  color:#617468;
  font-size:12px;
  font-weight:600;
  line-height:20px;
  text-align:left;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  cursor:pointer;
}
.note-preview:hover{background:#eef4ef}
.note-meta{font-size:10px;font-weight:650;color:#617468;line-height:1.2;margin-top:1px}
.note-saved{font-size:10px;font-weight:800;color:#157a4a;line-height:1.2}
.stock-table .style-row:hover td.note-col{background:#f3faf4}
@media(max-width:600px){
  .stock-table-wrap{overflow-x:hidden}
  .stock-table{
    display:block;
    width:100%;
    table-layout:auto;
    font-size:13px;
  }
  .stock-table thead,.stock-table tbody{display:block;width:100%}
  .stock-table thead tr{
    display:grid;
    grid-template-columns:36% repeat(7,minmax(0,1fr));
    width:100%;
    background:#123b30;
    color:#fff;
    position:sticky;top:0;z-index:2;
  }
  .stock-table thead .note-col,
  .stock-table thead .row-total{display:none !important}
  .stock-table thead .name-col{
    width:auto !important;
    min-width:0 !important;
    position:static;
    text-align:left;
  }
  .stock-table thead th{
    position:static;
    width:auto;
    min-width:0;
    padding:8px 2px;
    font-size:12px;
  }
  .stock-table tbody tr.series-row{display:block;width:100%}
  .stock-table tbody tr.series-row td{
    display:block;
    width:100%;
    position:static;
    padding:8px 10px;
  }
  .stock-table tbody tr.style-row{
    display:grid;
    grid-template-columns:36% repeat(7,minmax(0,1fr));
    width:100%;
    align-items:center;
    border-bottom:1px solid #e6eee8;
  }
  .stock-table .style-row .name-col{
    grid-column:1;
    grid-row:1;
    width:auto !important;
    min-width:0 !important;
    position:static !important;
    left:auto;
    padding:6px 6px;
  }
  /* notes live in the name cell; hide the separate full-width row */
  .stock-table .style-row > .note-col{display:none !important}
  .name-col .name-tools{display:flex;align-items:center;gap:6px;clear:both;margin-top:2px;min-width:0}
  .name-col .photo-edit{flex:0 0 auto;margin-top:0}
  .name-col .note-wrap{display:flex;flex:1;min-width:0;margin:0}
  .name-col .note-input{
    height:24px;
    min-height:24px;
    max-height:24px;
    font-size:12px;
    font-weight:600;
    padding:1px 6px;
    border-color:#e0e8e3;
    background:#f7faf8;
    color:#5d6d66;
  }
  .name-col .note-wrap.note-edit .note-input,
  .name-col .note-input:focus{
    max-height:none;
    font-size:16px; /* avoid iOS zoom while editing */
    line-height:1.3;
    color:inherit;
    background:#fff;
  }
  .name-col .note-preview{
    height:24px;
    min-height:24px;
    padding:2px 0;
    color:#6a7a72;
  }
  .stock-table .style-row td:nth-child(3){grid-column:2;grid-row:1}
  .stock-table .style-row td:nth-child(4){grid-column:3;grid-row:1}
  .stock-table .style-row td:nth-child(5){grid-column:4;grid-row:1}
  .stock-table .style-row td:nth-child(6){grid-column:5;grid-row:1}
  .stock-table .style-row td:nth-child(7){grid-column:6;grid-row:1}
  .stock-table .style-row td:nth-child(8){grid-column:7;grid-row:1}
  .stock-table .style-row td:nth-child(9){grid-column:8;grid-row:1}
  .stock-table .style-row td.row-total{display:none !important}
  /* bags: keep 数量 visible; note stays in the name cell */
  .stock-table.bag-table thead tr{grid-template-columns:1fr auto}
  .stock-table.bag-table thead .row-total{display:block !important;text-align:right;padding-right:10px}
  .stock-table.bag-table tbody tr.style-row{grid-template-columns:1fr auto}
  .stock-table.bag-table .style-row .name-col{grid-column:1;grid-row:1}
  .stock-table.bag-table .style-row td.row-total{
    display:flex !important;
    align-items:center;
    justify-content:flex-end;
    grid-column:2;
    grid-row:1;
    min-width:4.5rem;
    padding-right:10px;
  }
}
/* ---- TEST BUILD: EasyStore link ---- */
.test-banner{position:sticky;top:0;z-index:50;background:#b00020;color:#fff;font-weight:700;padding:8px 12px;text-align:center;font-size:14px;line-height:1.4}
.test-banner a{color:#fff;text-decoration:underline;margin-left:8px}
.brand-tag{display:inline-block;font-size:11px;font-weight:700;padding:1px 6px;margin-right:6px;border-radius:4px;background:#e6e6e6;color:#333;vertical-align:middle}
.brand-tag.sync-brand{background:#1f4e78;color:#fff}
.sync-tag{display:inline-block;font-size:11px;font-weight:700;padding:1px 6px;margin-left:6px;border-radius:4px;vertical-align:middle}
.sync-tag.on{background:#d9f2e6;color:#0b6b3a}.sync-tag.off{background:#eee;color:#666}.sync-tag.bad{background:#b00020;color:#fff}
.preview-block.sync{border-left:4px solid #1f4e78;padding-left:8px}.preview-block.sync.fail{border-left-color:#b00020}
.sync-list{display:flex;flex-direction:column;gap:4px}.sync-row{display:grid;grid-template-columns:2fr 60px 1.4fr 2fr;gap:8px;font-size:13px;padding:4px 6px;border-radius:4px;background:#f3f8f5}
.sync-row.bad{background:#fde7ea;color:#8a0016}.sync-bad{color:#b00020}
@media (max-width:640px){.sync-row{grid-template-columns:1fr}}
td.nosize{color:#ccc;background:#fafafa}
nav .nav-link{display:inline-flex;align-items:center;padding:8px 12px;margin-left:4px;border-radius:8px;background:#1f4e78;color:#fff;text-decoration:none;font-weight:700}
