: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}
