:root{--ink:#17211d;--muted:#718078;--line:#dfe6e1;--paper:#fff;--bg:#f3f6f3;--green:#176b4d;--green2:#e7f2ec;--orange:#d87924;--red:#c94b45;--shadow:0 10px 30px rgba(24,52,40,.08)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg)}button,input,select,textarea{font:inherit}.sidebar{position:fixed;inset:0 auto 0 0;width:220px;background:#122a21;color:white;padding:26px 16px;display:flex;flex-direction:column;z-index:10}.brand{display:flex;align-items:center;gap:12px;padding:0 8px 30px}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#e0b55a;color:#10271e;font-weight:900;font-size:20px}.brand strong,.brand small{display:block}.brand small{color:#8faf9f;margin-top:4px}nav{display:grid;gap:8px}.nav-item{border:0;color:#aac1b6;background:transparent;text-align:left;padding:13px 15px;border-radius:12px;cursor:pointer;font-weight:700}.nav-item span{margin-left:11px}.nav-item:hover,.nav-item.active{background:#234337;color:white}.server-state{margin-top:auto;color:#9db5aa;font-size:12px;padding:12px}.server-state i{display:inline-block;width:8px;height:8px;background:#4ad18c;border-radius:50%;margin-right:8px}main{margin-left:220px;min-height:100vh}header{height:90px;padding:20px 32px;display:flex;align-items:center;border-bottom:1px solid var(--line);background:rgba(255,255,255,.8);backdrop-filter:blur(15px);position:sticky;top:0;z-index:5}header h1{font-size:22px;margin:0}header p{font-size:12px;color:var(--muted);margin:5px 0 0}.header-actions{margin-left:auto;display:flex;gap:10px}.icon-btn,.avatar,.menu-btn{border:1px solid var(--line);background:white;border-radius:12px;height:42px;padding:0 14px}.menu-btn{display:none}.page{display:none;padding:30px}.page.active{display:block}.welcome{background:linear-gradient(120deg,#174e3b,#26755a);color:white;border-radius:22px;padding:28px 32px;display:flex;align-items:center;justify-content:space-between;box-shadow:var(--shadow)}.welcome span{color:#b9d5c8}.welcome h2{margin:7px 0 0;font-size:22px}.primary,.secondary,.text-btn{border:0;border-radius:11px;padding:12px 17px;cursor:pointer;font-weight:800}.primary{background:var(--green);color:white}.welcome .primary{background:#f2c463;color:#193126}.secondary{background:var(--green2);color:var(--green)}.text-btn{background:transparent;color:var(--green);padding:5px}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:18px 0}.stat-grid article,.panel{background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:0 3px 12px rgba(35,62,50,.03)}.stat-grid span,.stat-grid small{display:block;color:var(--muted)}.stat-grid strong{display:block;font-size:25px;margin:10px 0}.stat-grid small.up{color:var(--green)}.stat-grid small.warn{color:var(--orange)}.two-col{display:grid;grid-template-columns:1.2fr 1fr;gap:18px}.panel-head{display:flex;align-items:center;justify-content:space-between}.panel h3{margin:4px 0 16px}.eyebrow{text-transform:uppercase;letter-spacing:.1em;color:var(--muted);font-size:11px;font-weight:800}.product-row{display:flex;align-items:center;gap:15px;padding-top:12px;border-top:1px solid var(--line)}.product-photo{height:66px;width:66px;border-radius:16px;background:radial-gradient(circle at 35% 30%,#555,#090909 70%);color:#fff;display:grid;place-items:center;font-weight:900;box-shadow:inset 0 0 0 8px rgba(255,255,255,.08)}.product-photo small{display:none}.product-photo.large{width:92px;height:92px;flex:0 0 auto}.product-photo.hero{width:260px;height:260px;font-size:30px}.product-photo.hero small,.product-photo.large small{display:block;font-size:10px;font-weight:500;color:#ddd}.grow{flex:1}.grow span,.right span{display:block;color:var(--muted);font-size:12px;margin-top:5px}.right{text-align:right}.tasks{list-style:none;padding:0;margin:0}.tasks li{display:flex;align-items:center;gap:12px;padding:14px 0;border-top:1px solid var(--line)}.tasks i{width:9px;height:9px;border-radius:50%}.tasks i.red{background:var(--red)}.tasks i.orange{background:var(--orange)}.tasks div{flex:1}.tasks span{display:block;color:var(--muted);font-size:12px;margin-top:3px}.tasks b{font-size:12px;color:var(--green)}.sales-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px}.order-top{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:12px}label{display:grid;gap:7px;color:var(--muted);font-size:12px;font-weight:700}input,select,textarea{border:1px solid var(--line);background:#fbfcfb;border-radius:10px;padding:11px;color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{border-color:#6ba88d;box-shadow:0 0 0 3px #e3f0ea}.search-box{display:flex;align-items:center;gap:8px;border:2px solid #cddbd4;border-radius:14px;margin:18px 0;padding:0 14px}.search-box input{border:0;box-shadow:none;width:100%;background:transparent}.sku-card{display:flex;align-items:center;gap:18px;background:#f5f8f6;border-radius:16px;padding:14px}.sku-info{flex:1}.sku-info h3{margin:5px 0}.sku-info p{margin:5px 0;color:var(--muted)}.sku-info .stock{color:var(--green);font-weight:700}.pill{display:inline-block;font-size:10px;background:var(--green2);color:var(--green);padding:4px 8px;border-radius:20px;font-weight:800}.table-wrap{overflow:auto;margin-top:20px}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:12px 9px;border-bottom:1px solid var(--line);font-size:13px}th{color:var(--muted);font-size:11px}.line-input{width:82px;padding:8px}.remove{background:none;border:0;color:var(--red);cursor:pointer}.remark{width:100%;margin-top:14px;min-height:72px}.checkout{height:max-content;position:sticky;top:110px}.sum-row{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}.sum-row input{width:100px;text-align:right}.grand{background:#eef6f2;border-radius:13px;padding:16px;margin:16px 0;display:flex;justify-content:space-between}.grand strong{font-size:22px;color:var(--green)}.checkout label{margin-top:13px}.credit{border-left:3px solid var(--orange);background:#fff8ee;padding:12px;margin:16px 0;font-size:12px;line-height:1.7}.wide{width:100%}.product-detail{display:grid;grid-template-columns:280px 1fr;gap:32px;align-items:center}.product-detail h2{font-size:32px;margin:12px 0}.product-detail>div>p{color:var(--muted)}.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:22px 0}.detail-grid label{background:#f5f7f5;border-radius:12px;padding:12px}.detail-grid strong{color:var(--ink);font-size:14px}.button-row{display:flex;gap:10px;justify-content:flex-end}.placeholder{text-align:center;padding:100px 20px}.placeholder p{color:var(--muted)}.modal{display:none;position:fixed;inset:0;background:rgba(11,25,19,.55);z-index:20;place-items:center;padding:20px}.modal.open{display:grid}.modal-card{background:white;border-radius:20px;padding:24px;width:min(520px,100%);box-shadow:var(--shadow)}.modal-head{display:flex;justify-content:space-between;align-items:flex-start}.modal-head h3{margin:5px 0 18px}.close{border:0;background:#f1f3f1;width:35px;height:35px;border-radius:50%;font-size:22px;cursor:pointer}.label-preview{width:350px;height:250px;margin:auto;border:1px solid #222;padding:15px;display:grid;grid-template-columns:110px 1fr;gap:14px;align-items:center;background:white;color:#000}.label-photo{height:105px;border:2px solid #111;border-radius:50%;display:grid;place-items:center;text-align:center;font-size:19px;font-weight:900}.label-photo small{font-size:10px}.label-data h2{font-size:35px;margin:0}.label-data p{margin:7px 0}.barcode{font-family:monospace;font-weight:900;letter-spacing:2px;font-size:19px;margin-top:15px}.toggle{display:flex;align-items:center;gap:8px;margin:15px 0}.toggle input{width:auto}.label-price{text-align:center;font-weight:900}.order-preview{width:min(720px,100%)}.paper{border:1px solid var(--line);padding:25px;margin-bottom:15px}.paper h2{text-align:center}.paper>p{text-align:center;color:var(--muted)}.paper h3{text-align:right}
[hidden]{display:none!important}
@media(max-width:1000px){.stat-grid{grid-template-columns:repeat(2,1fr)}.sales-layout{grid-template-columns:1fr}.checkout{position:static}.product-detail{grid-template-columns:1fr}.product-photo.hero{width:100%;height:240px}.detail-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.sidebar{transform:translateX(-100%);transition:.25s}.sidebar.open{transform:none}.sidebar.open+main:after{content:"";position:fixed;inset:0;background:#0006;z-index:8}.menu-btn{display:block;margin-right:14px}main{margin-left:0}header{padding:15px 16px}.page{padding:16px}.welcome{align-items:flex-start;gap:22px;flex-direction:column}.stat-grid{grid-template-columns:1fr 1fr}.two-col{grid-template-columns:1fr}.order-top{grid-template-columns:1fr}.sku-card{align-items:flex-start;flex-wrap:wrap}.sku-info{min-width:160px}.product-photo.large{width:72px;height:72px}.detail-grid{grid-template-columns:1fr 1fr}.label-preview{width:280px;height:200px;grid-template-columns:85px 1fr;transform:scale(.9)}}
.text-input{width:118px}.process{width:140px}.table-wrap table{min-width:980px}
.item-entry-bar{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;margin:18px 0}.item-entry-bar .search-box{margin:0}.manual-entry{display:none;background:#fffaf0;border:1px solid #efd8ad;border-radius:16px;padding:18px;margin-bottom:18px}.manual-entry.open{display:block}.manual-head{display:flex;align-items:flex-start;justify-content:space-between}.manual-head h3{margin:4px 0 14px}.temporary-note,.temporary-tag{background:#f6e8c9;color:#8b5b12;border-radius:20px;padding:5px 9px;font-size:11px;font-weight:800}.temporary-tag{margin-left:7px;padding:3px 6px;font-style:normal}.manual-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.manual-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
@media(max-width:1000px){.manual-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.item-entry-bar{grid-template-columns:1fr}.manual-grid{grid-template-columns:1fr}}
.style-card{cursor:pointer}.variant-panel{display:none;background:#f7faf8;border:1px solid var(--line);border-radius:16px;padding:18px;margin-top:12px}.variant-panel.open{display:block}.variant-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.variant-head h3{margin:4px 0}.variant-tools{display:flex;gap:8px}.variant-tip{color:var(--muted);font-size:12px}.variant-picker{display:grid;grid-template-columns:1fr 1fr .9fr .8fr .9fr auto;gap:10px;align-items:end;background:white;border:1px solid var(--line);border-radius:14px;padding:14px}.custom-variant-field{display:none}.custom-variant-field.open{display:grid}.variant-add-one{height:42px;white-space:nowrap}.variant-queue{display:grid;gap:8px;margin-top:12px}.empty-queue{color:var(--muted);font-size:12px;text-align:center;border:1px dashed var(--line);border-radius:12px;padding:14px;margin:0}.queued-variant{display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:center;background:#edf5f1;border-radius:12px;padding:11px 13px}.queued-variant span{display:block;color:var(--muted);font-size:11px;margin-top:3px}.queued-variant b{color:var(--green);font-size:12px}.fee-toolbar{display:flex;align-items:center;justify-content:space-between;border-top:1px dashed var(--line);margin-top:18px;padding-top:16px}.fee-toolbar span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.fee-entry{display:none;grid-template-columns:1.2fr 1fr .8fr .8fr auto;gap:10px;align-items:end;background:#fff8ee;border:1px solid #efd8ad;border-radius:14px;padding:14px;margin-top:12px}.fee-entry.open{display:grid}.fee-line{display:grid;grid-template-columns:1fr 110px 110px 100px 50px;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin-top:8px}.fee-line>div span{display:block;color:var(--muted);font-size:11px;margin-top:3px}.fee-line input{padding:8px;width:100%}.fee-line .fee-amount{text-align:right}.paper-fees{margin-top:16px;border-top:1px solid var(--line)}.paper-fees h4{margin-bottom:8px}.paper-fees p{display:flex;justify-content:space-between;margin:6px 0}
@media(max-width:1100px){.variant-picker{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.fee-entry{grid-template-columns:repeat(2,1fr)}.fee-line{grid-template-columns:1fr 100px 100px}.fee-line .remove{grid-column:3}.variant-head{flex-direction:column}.variant-picker{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.fee-entry{grid-template-columns:1fr}.fee-line{grid-template-columns:1fr 1fr}.fee-line>div{grid-column:1/-1}.fee-line .remove{grid-column:auto}.variant-tools{width:100%;justify-content:space-between}.variant-picker{grid-template-columns:1fr}.queued-variant{grid-template-columns:1fr auto}.queued-variant .remove{grid-column:2}}
.paper-meta{display:grid;grid-template-columns:repeat(2,1fr);gap:7px 24px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:12px 0;margin:6px 0 14px}.paper-meta p,.paper-payment p{display:flex;justify-content:space-between;gap:14px;margin:0;font-size:12px}.paper-meta span,.paper-payment span{color:var(--muted)}.paper-payment{display:grid;gap:8px;width:280px;margin:16px 0 16px auto;border-top:1px solid var(--line);padding-top:12px}.paper-payment .paper-grand{font-size:17px;border-top:1px solid var(--line);padding-top:10px}.paper-payment .paper-grand strong{color:var(--green)}
.paper-remark{margin:16px 300px 16px 0;border-top:1px solid var(--line);padding-top:12px;display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:start;font-size:12px}.paper-remark span{color:var(--muted);white-space:nowrap}.paper-remark strong{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}.paper-remark.is-empty{display:none}
@media(max-width:600px){.paper-meta{grid-template-columns:1fr}.paper-payment{width:100%}}
.search-result{display:none}.search-result.visible{display:flex}.search-hint{display:grid;gap:5px;background:#f7faf8;border:1px dashed #cddbd4;border-radius:16px;padding:20px;color:var(--muted)}.search-hint strong{color:var(--ink)}.search-hint span{font-size:12px}.search-hint.hidden{display:none}.search-hint.no-result{display:none;background:#fff8ee;border-color:#e8c994}.search-hint.no-result.visible{display:grid}
.history-search{max-width:420px;margin:8px 0 16px}.history-search input{width:100%}.history-table table{min-width:850px}.empty-history{text-align:center;color:var(--muted);padding:35px 0}
.export-note{color:var(--muted);font-size:12px;margin:0 0 12px;text-align:right}
.order-brand{display:grid;grid-template-columns:1fr auto;align-items:end;gap:18px;border-bottom:1px solid var(--line);padding-bottom:12px}.order-brand h2{margin:0 0 8px;text-align:left}.order-brand p{margin:3px 0;color:var(--muted);font-size:12px}.order-number{text-align:right}.order-number span{display:block;color:var(--muted);font-size:11px;margin-bottom:5px}.order-number strong{font-size:14px}.wechat-block{display:grid;grid-template-columns:repeat(3,minmax(0,112px));justify-content:center;gap:22px;border-top:1px solid var(--line);margin-top:18px;padding-top:18px}.wechat-block div{display:grid;justify-items:center;gap:8px;background:#fafcfb;border:1px solid #edf1ee;border-radius:10px;padding:8px 7px 9px}.wechat-block img{display:block;width:94px;aspect-ratio:1/1;height:auto;object-fit:contain}.wechat-block span{font-size:9px;color:var(--muted);white-space:nowrap}
@media(max-width:600px){.order-brand{grid-template-columns:1fr}.order-number{text-align:left}.wechat-block{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.wechat-block div{padding:5px 3px}.wechat-block img{width:100%;max-width:78px}.wechat-block span{font-size:7px}}

.brand-mark{
  display:block;
  width:48px;
  height:48px;
  border-radius:14px;
  object-fit:cover;
  background:#fff;
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}
.brand strong{
  font-size:16px;
  line-height:1.15;
}
.server-state{
  display:grid;
  gap:5px;
}
.server-state>div{
  display:flex;
  align-items:center;
}
.server-state small{
  display:block;
  margin-left:16px;
  color:#6f9989;
  font-size:11px;
  font-weight:800;
  letter-spacing:0;
}
.dashboard-clock{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 14px;
  padding:12px 16px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 3px 12px rgba(35,62,50,.03);
}
.dashboard-clock span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.dashboard-clock strong{
  color:var(--green);
  font-size:16px;
  letter-spacing:0;
}
.dashboard-layout-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 14px;
  padding:12px 16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 3px 12px rgba(35,62,50,.03);
}
.dashboard-layout-bar strong,
.dashboard-layout-bar span{
  display:block;
}
.dashboard-layout-bar span{
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
}
.dashboard-layout-bar>div:last-child{
  display:flex;
  gap:10px;
  align-items:center;
}
.nav-item{
  cursor:grab;
  user-select:none;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease,color .16s ease,opacity .16s ease;
}
.nav-item[hidden]{display:none!important}
.nav-item:active{
  cursor:grabbing;
  transform:translateY(1px);
}
.nav-item.dragging{
  opacity:.62;
  box-shadow:0 14px 30px rgba(0,0,0,.22);
}
.data-backup-btn{
  width:100%;
  margin:14px 0 10px;
  border:0;
  border-radius:12px;
  padding:12px 14px;
  background:linear-gradient(180deg,#285844,#1b6f52);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 12px 24px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.16);
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}
.data-backup-btn:hover{
  filter:brightness(1.05);
  box-shadow:0 16px 28px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.2);
}
.data-backup-btn:active{
  transform:translateY(1px);
  box-shadow:0 8px 18px rgba(0,0,0,.16),inset 0 2px 4px rgba(0,0,0,.16);
}
.backup-center{
  display:grid;
  gap:18px;
}
.backup-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:24px;
}
.backup-head h3{
  margin:5px 0 18px;
  font-size:22px;
}
.backup-head p,.backup-grid p{
  margin:0;
  color:var(--muted);
  line-height:1.7;
}
.backup-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.backup-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.backup-stats article,.backup-grid article{
  background:#f7faf8;
  border:1px solid #dfeae4;
  border-radius:16px;
  padding:18px;
}
.backup-stats span,.backup-stats small{
  display:block;
  color:var(--muted);
}
.backup-stats strong{
  display:block;
  margin:8px 0 4px;
  font-size:24px;
}
.backup-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.backup-grid article{
  min-height:156px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}
.backup-grid h3{
  margin:0 0 12px;
}
.backup-grid .primary,.backup-grid .secondary,.backup-file-button{
  margin-top:auto;
}
.backup-file-button{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.backup-file-button input{
  display:none;
}
@media(max-width:900px){
  .backup-head{flex-direction:column}
  .backup-actions{justify-content:flex-start}
  .backup-stats,.backup-grid{grid-template-columns:1fr}
}
.ai-layout{
  display:grid;
  grid-template-columns:360px minmax(0,1fr);
  gap:18px;
  align-items:start;
}
.ai-config-panel,.ai-chat-panel{
  display:grid;
  gap:14px;
}
.ai-config-panel textarea,.ai-input-row textarea{
  resize:vertical;
}
.ai-config-actions,.ai-chat-head,.ai-quick-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.ai-config-actions button{
  flex:1;
}
.ai-safe-note{
  margin:0;
  padding:12px;
  border-radius:12px;
  background:#fff8ee;
  color:#9a5b14;
  line-height:1.6;
  font-size:12px;
}
.field-help{
  display:block;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
  font-weight:700;
}
.ai-chat-head{
  justify-content:space-between;
}
.ai-chat-head h3{
  margin:5px 0 4px;
}
.ai-chat-head p{
  margin:0;
  color:var(--muted);
  font-size:12px;
}
.ai-chat-messages{
  min-height:420px;
  max-height:58vh;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:16px;
  background:#f8fbf9;
  padding:16px;
  display:grid;
  align-content:start;
  gap:12px;
}
.ai-message{
  max-width:78%;
  display:grid;
  gap:5px;
}
.ai-message span{
  color:var(--muted);
  font-size:11px;
  font-weight:900;
}
.ai-message p{
  margin:0;
  padding:12px 14px;
  border-radius:14px;
  line-height:1.7;
  background:white;
  border:1px solid #e1ebe5;
}
.ai-message.user{
  justify-self:end;
}
.ai-message.user span{
  text-align:right;
}
.ai-message.user p{
  background:var(--green);
  color:white;
  border-color:var(--green);
}
.ai-empty{
  align-self:center;
  justify-self:center;
  color:var(--muted);
}
.ai-input-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 120px;
  gap:10px;
  align-items:stretch;
}
.ai-input-row button{
  min-height:64px;
}
@media(max-width:980px){
  .ai-layout{grid-template-columns:1fr}
  .ai-chat-messages{max-height:none}
}
@media(max-width:620px){
  .ai-input-row{grid-template-columns:1fr}
  .ai-message{max-width:100%}
}
.order-actions{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin:12px 0 2px;color:var(--muted);font-size:12px}.order-actions strong{color:var(--ink)}.danger-btn{border:1px solid #e6b6b2;background:#fff4f3;color:#b43d37;border-radius:10px;padding:9px 14px;font-weight:800;cursor:pointer}.danger-btn:hover{background:#fbe5e3}
.history-actions{display:flex;align-items:center;gap:8px}.history-view.active{background:var(--green2);border-radius:9px}.order-link{border:0;background:none;color:var(--green);font-weight:800;cursor:pointer;padding:0}.record-actions{white-space:nowrap}.record-actions button{border:0;background:none;color:var(--green);cursor:pointer;margin-right:9px}.record-actions .delete-order{color:var(--red)}.history-detail{max-height:65vh;overflow:auto}.detail-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 20px;background:#f6f8f6;border-radius:12px;padding:14px;margin-bottom:14px}.detail-summary p,.detail-fees p{display:flex;justify-content:space-between;margin:0}.detail-summary span,.detail-remark span{color:var(--muted)}.detail-fees{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}.detail-fees p{padding:5px 0}.detail-remark{border-top:1px solid var(--line);padding-top:12px}.confirm-card p{color:var(--muted);line-height:1.6}.confirm-card label{margin:18px 0}
@media(max-width:600px){.history-actions{flex-wrap:wrap}.detail-summary{grid-template-columns:1fr}}
.detail-edit-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;background:#f6f8f6;border-radius:12px;padding:14px;margin-bottom:14px}.history-edit-table{min-width:900px}.history-edit-table input{width:100%;min-width:105px;padding:8px}.history-remark{margin-top:14px}.history-remark textarea{min-height:70px}.section-note{color:var(--muted);font-size:13px}.customer-table table{min-width:720px}.view-customer-orders{border:0;background:var(--green2);color:var(--green);border-radius:9px;padding:8px 11px;font-weight:800;cursor:pointer}
@media(max-width:800px){.detail-edit-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:520px){.detail-edit-grid{grid-template-columns:1fr}}
.history-editor-modal{width:min(1500px,98vw);max-height:94vh}.history-editor-modal .history-detail{max-height:78vh}.history-editor-modal .detail-edit-grid{grid-template-columns:repeat(4,minmax(180px,1fr))}.history-editor-modal .button-row{position:sticky;bottom:0;background:white;padding-top:12px;border-top:1px solid var(--line)}.customer-orders-modal{width:min(1050px,94vw)}.customer-order-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px}.customer-order-summary div{background:#f4f8f5;border-radius:12px;padding:13px}.customer-order-summary span,.customer-order-summary strong{display:block}.customer-order-summary span{color:var(--muted);font-size:11px;margin-bottom:6px}.customer-orders-table{min-width:850px}.customer-view-order{border:0;background:var(--green2);color:var(--green);border-radius:8px;padding:7px 10px;font-weight:800;cursor:pointer}
@media(max-width:1000px){.history-editor-modal .detail-edit-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:650px){.history-editor-modal .detail-edit-grid,.customer-order-summary{grid-template-columns:1fr}}
.overview-modal{width:min(1050px,94vw);max-height:90vh}.order-overview{max-height:68vh;overflow:auto}.order-overview table{min-width:820px}
.customer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px}.customer-toolbar .history-search{flex:1}.customer-form-modal{width:min(760px,94vw)}.customer-form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.address-head{display:flex;align-items:center;justify-content:space-between;margin:20px 0 10px}.customer-addresses{display:grid;gap:8px}.address-row{display:grid;grid-template-columns:1fr auto;gap:8px}.address-row .remove{border:0;background:#fff1f0;color:var(--red);border-radius:9px;padding:0 12px}.paper-payment .paper-balance{font-size:15px;font-weight:800;border-top:1px solid var(--line);padding-top:8px}.paper-payment .paper-balance strong{color:var(--red)}
@media(max-width:600px){.customer-toolbar{align-items:stretch;flex-direction:column}.customer-form-grid{grid-template-columns:1fr}}
.unpaid-row strong{color:var(--orange)}
.customer-toolbar-actions{display:flex;align-items:center;gap:8px}.customer-view.active{background:var(--green2);border-radius:9px}.customer-form-modal .primary,.customer-form-modal .secondary,.customer-form-modal .remove{min-height:42px;padding:10px 16px;white-space:nowrap}.customer-form-modal #save-customer{min-width:120px}.customer-form-modal #add-address-field{min-width:116px}.address-row .remove{min-width:64px}.address-count{border:0;background:#f0f6f3;color:var(--green);border-radius:8px;padding:7px 10px;cursor:pointer}.customer-row-actions{white-space:nowrap}.customer-row-actions button{border:0;border-radius:8px;padding:8px 10px;font-weight:800;cursor:pointer;margin-right:6px}.customer-row-actions .view-customer-orders,.customer-row-actions .restore-customer{background:var(--green2);color:var(--green)}.customer-row-actions .delete-customer{background:#fff1f0;color:var(--red)}.address-list{display:grid;gap:10px}.customer-contact-card{background:#f5f8f6;border-radius:12px;padding:13px}.customer-contact-card p{display:flex;justify-content:space-between;margin:6px 0}.customer-contact-card span{color:var(--muted)}.address-card{display:grid;grid-template-columns:30px 1fr;align-items:start;gap:10px;border:1px solid var(--line);border-radius:12px;padding:12px}.address-card>span{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--green2);color:var(--green);font-weight:800}.address-card p{margin:3px 0;line-height:1.55}.history-actions .text-btn,.history-actions .secondary{height:38px;padding:0 13px;border-radius:9px}.record-actions button{min-width:44px;margin-right:5px;padding:7px 9px;border-radius:8px!important}.record-actions .view-order{background:var(--green2)!important}.record-actions .edit-order{background:#eef3ff!important;color:#4365a8!important}.record-actions .delete-order{background:#fff1f0!important}.toast{position:fixed;left:50%;top:28px;transform:translate(-50%,-20px);z-index:100;background:#173f31;color:white;padding:12px 20px;border-radius:12px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:.25s;font-weight:800}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:700px){.customer-toolbar-actions{flex-wrap:wrap}.customer-toolbar-actions #add-customer{width:100%}}
.customer-combobox{position:relative}.customer-suggestions{display:none;position:absolute;z-index:15;left:0;right:0;top:68px;background:white;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:6px;max-height:310px;overflow:auto}.customer-suggestions.open{display:grid}.customer-suggestions button{border:0;background:white;text-align:left;border-radius:9px;padding:10px 12px;cursor:pointer}.customer-suggestions button:hover{background:var(--green2)}.customer-suggestions strong,.customer-suggestions span{display:block}.customer-suggestions span{color:var(--muted);font-size:11px;margin-top:4px}.customer-suggestions p{color:var(--muted);font-size:12px;padding:8px;margin:0}
.order-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;background:#f6f8f6;border-radius:14px;padding:12px 14px;margin:12px 0}.order-filters label{min-width:150px}.date-presets{display:flex;align-items:center;gap:6px}.date-presets button{height:38px;padding:0 11px}.date-group td{background:#edf5f1!important;padding:10px 12px!important}.date-group strong{color:var(--green);font-size:14px}.date-group span{color:var(--muted);font-size:12px;margin-left:14px}.pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:18px}.pagination button{height:38px;padding:0 16px}.pagination button:disabled{opacity:.4;cursor:not-allowed}.pagination span{color:var(--muted);font-size:13px}
@media(max-width:650px){.order-filters{display:grid;grid-template-columns:1fr 1fr}.date-presets{grid-column:1/-1;flex-wrap:wrap}}
.finance-period{display:flex;gap:7px;margin:16px 0 10px}.finance-period-btn{border:0;background:#eef3ef;color:var(--muted);border-radius:9px;padding:9px 15px;font-weight:800;cursor:pointer}.finance-period-btn.active{background:var(--green);color:white}.finance-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}.finance-stats article{border:1px solid var(--line);background:#fafcfb;border-radius:14px;padding:15px}.finance-stats span{display:block;color:var(--muted);font-size:12px}.finance-stats strong{display:block;font-size:21px;margin-top:8px}.finance-stats article:nth-child(3) strong{color:var(--green)}.finance-stats article:nth-child(4) strong{color:var(--orange)}.staff-table table{min-width:800px}.staff-status{display:inline-block;background:var(--green2);color:var(--green);border-radius:20px;padding:5px 9px;font-size:11px;font-weight:800}.staff-status.off{background:#f1f1f1;color:var(--muted)}
@media(min-width:1001px){.order-top{grid-template-columns:1.4fr repeat(2,1fr)}}@media(max-width:800px){.finance-stats{grid-template-columns:repeat(2,1fr)}}@media(max-width:480px){.finance-stats{grid-template-columns:1fr}}
.checkout #preview-order{margin-top:18px}.checkout #payment-method{margin-bottom:2px}.customer-order-summary{grid-template-columns:repeat(3,1fr)}.customer-order-summary .summary-wide{grid-column:span 3}.warn-money{color:var(--orange)}
.line-warehouse{min-width:98px!important;width:98px!important;background:#eef7f2!important;color:var(--green);font-weight:900}
@media(max-width:700px){.customer-order-summary{grid-template-columns:repeat(2,1fr)}.customer-order-summary .summary-wide{grid-column:span 2}}@media(max-width:460px){.customer-order-summary{grid-template-columns:1fr}.customer-order-summary .summary-wide{grid-column:span 1}}
.payment-status{display:inline-block;border-radius:18px;padding:5px 9px;font-size:11px;font-weight:800}.payment-status.paid{background:var(--green2);color:var(--green)}.payment-status.unpaid{background:#fff3e8;color:var(--orange)}.record-actions .receive-order,.account-receive{background:#fff3df!important;color:#a65d13!important}.account-table table{min-width:850px}.receipt-modal{width:min(760px,94vw)}.allocation-preview{margin-top:16px;border:1px solid var(--line);border-radius:13px;padding:13px}.allocation-preview h4{margin:0 0 10px}.allocation-preview p{display:flex;justify-content:space-between;gap:15px;margin:7px 0;font-size:12px}.allocation-preview span{color:var(--muted)}.account-stats article:first-child strong{color:var(--orange)}
#receipt-modal .receipt-modal{max-height:88vh;display:flex;flex-direction:column;padding-bottom:0;overflow:hidden}
#receipt-modal .modal-head{flex:0 0 auto}
#receipt-modal .customer-form-grid,#receipt-modal #receipt-note{flex:0 0 auto}
#receipt-modal .allocation-preview{flex:1 1 auto;min-height:138px;max-height:360px;overflow:auto;margin:16px 0 0;padding:16px 18px;background:#fff;border-color:#dce8e2}
#receipt-modal .allocation-preview p{padding:5px 0;margin:0;border-bottom:1px solid #edf3ef}
#receipt-modal .allocation-preview p:last-child{border-bottom:0}
#receipt-modal .button-row{flex:0 0 auto;position:sticky;bottom:0;z-index:2;margin:0 -24px;padding:14px 24px 18px;background:linear-gradient(180deg,rgba(255,255,255,.86),#fff 38%);border-top:1px solid var(--line)}
#receipt-modal #save-receipt{min-width:118px;height:48px;border-radius:13px}
.receipt-customer-picker{grid-column:span 1}.receipt-customer-picker select{width:100%}.receipt-actions .restore-debt-receipt{background:#fff3df;color:#a65d13}.receipt-restored-badge{display:inline-flex;align-items:center;border-radius:8px;padding:7px 9px;background:#fff3df;color:#a65d13;font-weight:900;margin-right:5px}
.history-total{height:42px;display:flex;align-items:center;padding:0 12px;border-radius:10px;background:#eaf4ef;color:var(--green);font-size:18px;font-weight:900}.history-editor-toolbar{display:flex;align-items:center;justify-content:space-between;margin:10px 0}.history-edit-table{min-width:1120px}.history-edit-table .he-amount{white-space:nowrap;color:var(--green)}.history-edit-table .he-remove{background:#fff1f0;border-radius:8px;padding:7px 9px}.account-actions{white-space:nowrap}.account-actions button,.account-order-receive{border:0;border-radius:8px;padding:8px 10px;font-weight:800;cursor:pointer;margin-right:6px}.account-orders{background:var(--green2);color:var(--green)}
.history-edit-table{min-width:1480px}.history-edit-table td{vertical-align:bottom;padding-top:8px}.history-edit-table input,.history-edit-table select{min-width:104px}.history-edit-table .history-field-hint{display:block;height:30px;margin:0 0 6px;color:var(--green);font-size:10px;font-weight:800;line-height:1.35;white-space:normal}.history-edit-table .history-stock-hint.warn{color:var(--orange)}#delete-order-stock-field[hidden]{display:none!important}
.sales-product-cell{min-width:125px;vertical-align:middle}.sales-variant-cell{min-width:112px;vertical-align:middle}.sales-variant-cell .line-input{width:100%;min-width:96px;padding:8px}.sales-line-sku{display:block;margin-top:5px;color:var(--green);font-size:10px;white-space:nowrap}
.history-shipped-warning{margin:8px 0 12px;padding:10px 12px;border:1px solid #efcf91;border-radius:10px;background:#fff8e8;color:#9a5a00;font-size:12px;line-height:1.6}
.he-size-custom{display:none;margin-top:6px}.he-size-custom.open{display:block}.history-edit-table .he-size-select{min-width:105px;width:100%;padding:8px}
.customer-form-modal .primary,.customer-form-modal .secondary,.customer-form-modal .remove{height:40px!important;min-height:40px!important;padding:0 14px!important;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}.customer-form-modal #save-customer{width:116px}.customer-form-modal #add-address-field{width:116px}.customer-form-modal .address-row .remove{width:64px;min-width:64px}.customer-form-modal .button-row{margin-top:16px}
.account-export{background:#edf2ff!important;color:#4365a8!important}
.root-admin-row{background:#fbfdfb}
.root-admin-lock{display:inline-block;border-radius:9px;background:#fff4d8;color:#9a6418;font-size:12px;font-weight:900;padding:8px 10px;margin-left:6px}
.account-page-actions{display:flex;align-items:center;gap:12px}.account-page-tabs{display:flex;background:#f0f4f1;border-radius:11px;padding:4px}.account-page-tab{border:0;background:transparent;color:var(--muted);border-radius:8px;padding:9px 15px;font-weight:800;cursor:pointer}.account-page-tab.active{background:white;color:var(--green);box-shadow:0 2px 8px rgba(24,52,40,.08)}.account-pane{display:none}.account-pane.active{display:block}
.account-pane .receipt-log-head{margin-top:18px;padding-top:0;border-top:0}
.receipt-log-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-top:30px;padding-top:22px;border-top:1px solid var(--line)}
.receipt-log-head h3{margin-bottom:0}
.receipt-log-head .history-search{width:min(430px,100%);margin:0}
.receipt-log-tools{display:flex;align-items:end;justify-content:flex-end;gap:8px;flex-wrap:wrap}.receipt-log-tools .history-search{flex:1;min-width:280px}.receipt-log-tools label{min-width:92px}.receipt-view.active{background:var(--green2);border-radius:9px}
.receipt-log-table table{min-width:1050px}
.receipt-log-table td{vertical-align:top}
.received-money{color:var(--green)}
.receipt-detail-toggle{border:0;background:transparent;color:var(--green);font-weight:900;cursor:pointer;padding:0;white-space:nowrap}
.receipt-detail-row{display:none}
.receipt-detail-row.open{display:table-row}
.receipt-detail-row>td{padding:0 10px 18px;background:#f8faf8}
.receipt-detail-panel{border:1px solid #cfe0d7;border-radius:14px;background:white;padding:14px}
.receipt-detail-caption{font-weight:900;color:var(--green);margin-bottom:10px}
.receipt-order-block{border-top:1px dashed var(--line);padding-top:13px;margin-top:13px}
.receipt-order-block:first-of-type{border-top:0;padding-top:0;margin-top:0}
.receipt-order-title{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:8px}
.receipt-order-title>div{display:flex;align-items:center;gap:12px}
.receipt-order-title span{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.receipt-order-title b{color:var(--green);font-size:12px;white-space:nowrap}
.receipt-bom-wrap{margin-top:8px}
.receipt-bom-table{min-width:900px!important}
.receipt-bom-table th,.receipt-bom-table td{padding:8px}
.receipt-order-remark{font-size:12px;margin:10px 0 0}.receipt-order-remark span{color:var(--muted)}
.receipt-actions{white-space:nowrap}.receipt-actions button{border:0;border-radius:8px;padding:7px 9px;font-weight:800;cursor:pointer;margin-right:5px}.receipt-actions .delete-receipt{background:#fff1f0;color:var(--red)}.receipt-actions .restore-receipt{background:var(--green2);color:var(--green)}.receipt-actions .permanent-delete-receipt{background:#8c2f2b;color:white}
.record-actions .permanent-delete-order,.customer-row-actions .permanent-delete-customer{background:#8c2f2b!important;color:white!important}
.trash-retention-note{color:#a55d18;background:#fff8ee;border-left:3px solid var(--orange);padding:8px 11px;margin:8px 0 12px;font-size:12px}
.export-confirm-card{width:min(560px,94vw)}
.export-confirm-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:16px 0 20px}
.export-confirm-summary p{display:grid;gap:5px;background:#f5f8f6;border-radius:11px;padding:12px;margin:0}
.export-confirm-summary span{color:var(--muted);font-size:11px}
.export-confirm-summary strong{font-size:14px}
@media(max-width:700px){.account-page-actions{align-items:stretch;flex-direction:column}.account-page-tabs{width:100%}.account-page-tab{flex:1}.receipt-log-head{align-items:stretch;flex-direction:column}.receipt-log-tools{align-items:stretch;flex-direction:column}.receipt-log-tools .history-search{min-width:0;width:100%}.export-confirm-summary{grid-template-columns:1fr}.receipt-order-title,.receipt-order-title>div{align-items:flex-start;flex-direction:column}}
@media(max-width:700px){#receipt-modal .receipt-modal{max-height:92vh}#receipt-modal .allocation-preview{max-height:300px}#receipt-modal .button-row{justify-content:stretch}#receipt-modal #save-receipt{width:100%}}
.delivery-info-grid{display:grid;grid-template-columns:1fr 2fr;gap:12px;margin-top:12px;padding:12px;background:#f6f8f6;border-radius:13px}
.delivery-photo-field{grid-column:1/-1;display:grid;gap:9px;color:var(--muted);font-size:12px;font-weight:700}.delivery-photo-actions{display:flex;align-items:center;gap:8px}.delivery-photo-upload,.history-delivery-upload{display:inline-flex!important;align-items:center;justify-content:center;cursor:pointer;padding:10px 14px}.delivery-photo-upload input,.history-delivery-upload input{display:none}.delivery-photo-preview{min-height:78px;border:1px dashed #c9d8d0;border-radius:12px;background:white;display:flex;align-items:center;gap:12px;padding:10px;color:var(--muted)}.delivery-photo-preview img{width:92px;height:68px;object-fit:cover;border-radius:8px}.delivery-photo-view{border:0;background:transparent;color:var(--green);font-weight:800;cursor:pointer}.delivery-photo-modal{width:min(920px,94vw);max-height:92vh}.delivery-photo-modal>img{display:block;max-width:100%;max-height:78vh;margin:auto;border-radius:12px;object-fit:contain}.order-delivery-photo{margin:16px 0;border-top:1px solid var(--line);padding-top:14px}.view-saved-delivery-photo{display:flex;align-items:center;gap:12px;margin-top:10px;border:1px solid var(--line);background:#f8faf8;border-radius:12px;padding:9px;cursor:pointer;color:var(--green);font-weight:800}.view-saved-delivery-photo img{width:110px;height:80px;object-fit:cover;border-radius:8px}.history-delivery-photo{display:grid;gap:7px;color:var(--muted);font-size:12px;font-weight:700}.history-delivery-photo>div{min-height:42px;border:1px dashed var(--line);border-radius:9px;padding:6px}.history-delivery-photo img{width:82px;height:58px;object-fit:cover;border-radius:7px}
.bom-order-card,.customer-bom-order{border:1px solid #d4e2da;border-radius:14px;background:#fff;padding:14px}.bom-order-head,.customer-bom-order-head{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;background:#f3f8f5;border-radius:11px;padding:12px;margin-bottom:12px}.bom-order-head span,.customer-bom-order-head span{display:block;color:var(--muted);font-size:10px;margin-bottom:5px}.bom-table-wrap{margin-top:8px}.bom-table{min-width:920px!important}.bom-table th,.bom-table td{padding:9px}.bom-type{display:inline-block;background:var(--green2);color:var(--green);border-radius:15px;padding:4px 8px;font-size:10px;font-weight:900}.bom-type.fee{background:#fff3df;color:#a65d13}.bom-pagination{margin:10px 0}.customer-bom-toolbar{display:flex;align-items:end;justify-content:space-between;margin:12px 0}.customer-bom-toolbar label{min-width:120px}.customer-order-bom{display:grid;gap:14px;max-height:56vh;overflow:auto;padding-right:3px}.customer-bom-order-head{grid-template-columns:1fr 1.2fr 1fr 1fr 1.5fr}.customer-bom-order .bom-table-wrap{margin-bottom:4px}
@media(max-width:850px){.bom-order-head,.customer-bom-order-head{grid-template-columns:repeat(2,1fr)}}@media(max-width:520px){.bom-order-head,.customer-bom-order-head{grid-template-columns:1fr}.customer-bom-toolbar{align-items:stretch;flex-direction:column;gap:8px}}
.fulfillment-filters{display:flex;gap:7px;margin:4px 0 12px}.fulfillment-filter{border:0;background:#eef3ef;color:var(--muted);border-radius:9px;padding:8px 13px;font-weight:800;cursor:pointer}.fulfillment-filter.active{background:var(--green);color:white}
.fulfillment-status{display:inline-block;border-radius:18px;padding:5px 9px;font-size:11px;font-weight:900;white-space:nowrap}
.fulfillment-status.pending{background:#fff3e8;color:var(--orange)}
.fulfillment-status.partial{background:#fff8df;color:#a65d13}
.fulfillment-status.done{background:var(--green2);color:var(--green)}
.readonly-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:18px;padding:6px 10px;background:#eef3ef;color:var(--muted);font-size:11px;font-weight:900;white-space:nowrap}
.record-actions .toggle-fulfillment{background:#eef3ff!important;color:#4365a8!important}
.dashboard-complete{border:0;background:var(--green2);color:var(--green);border-radius:8px;padding:7px 10px;font-weight:800;cursor:pointer}
.dashboard-empty-task{justify-content:center;color:var(--muted)}
@media(max-width:600px){.delivery-info-grid{grid-template-columns:1fr}}
.customer-bom-toolbar{gap:14px}
.customer-bom-search{display:grid;grid-template-columns:auto minmax(260px,460px);align-items:center;gap:12px;flex:1}
.customer-bom-search input{height:40px}
.order-edit-header label{min-width:0}
.order-edit-header input,.order-edit-header select{height:42px}
.order-edit-logistics{grid-column:span 2;background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px}
.history-delivery-photo{grid-template-columns:1fr auto;align-items:center;gap:8px}
.history-delivery-photo>span{grid-column:1/-1}
.history-delivery-photo-preview{grid-column:1/-1;min-height:78px;border:1px dashed #c9d8d0;border-radius:10px;background:white;display:flex;align-items:center;gap:12px;padding:8px;color:var(--muted);cursor:pointer;text-align:left}
.history-delivery-photo-preview img{width:96px;height:68px;object-fit:cover;border-radius:8px}
.history-delivery-photo-preview span{color:var(--green);font-weight:800}
.account-debt-actions{white-space:nowrap}
.account-debt-actions button{border:0;border-radius:8px;padding:7px 9px;font-weight:800;cursor:pointer;margin-right:5px}
.account-debt-actions .account-view-order{background:var(--green2);color:var(--green)}
.account-debt-actions .account-order-receive{background:#fff3df;color:#a65d13}
@media(max-width:700px){.customer-bom-search{grid-template-columns:1fr}.order-edit-logistics{grid-column:1/-1}}
.nested-pagination{margin:12px 0 2px;gap:10px}
.nested-pagination button{height:34px;padding:0 13px;font-size:12px}
.nested-pagination span{font-size:12px}
#account-orders-modal .modal-card{max-height:90vh;overflow:auto}
#account-orders-modal .table-wrap{max-height:54vh}
.sales-layout{grid-template-columns:minmax(0,1fr) 320px;align-items:start}
.sales-main-panel{padding:0;overflow:visible;background:transparent;border:0;box-shadow:none;display:grid;gap:0}
.sales-order-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;background:linear-gradient(120deg,#123f30,#1d7253);color:white;border-radius:19px;padding:15px 18px;margin-bottom:18px;box-shadow:0 12px 28px rgba(18,63,48,.16)}
.sales-order-identity{display:flex;align-items:center;gap:12px}.sales-order-identity>div{display:grid;gap:3px}.sales-order-identity small{color:#b9d9cb;font-size:11px}.sales-order-identity strong{font-size:18px;letter-spacing:.025em}
.order-live-dot{width:11px;height:11px;border-radius:50%;background:#55dda0;box-shadow:0 0 0 6px rgba(85,221,160,.13)}
.sales-order-toolbar-actions{display:flex;align-items:center;gap:9px}.sales-order-toolbar .secondary{background:#fff;color:#17553f;padding:9px 14px}.sales-order-toolbar .danger-btn{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.34);color:#fff;padding:9px 14px}.sales-order-toolbar .danger-btn:hover{background:rgba(255,255,255,.18)}
.sales-main-panel>.order-top,.sales-main-panel>.delivery-info-grid,.sales-main-panel>.item-entry-bar,.sales-main-panel>.manual-entry,.sales-main-panel>.search-hint,.sales-main-panel>.sku-card,.sales-main-panel>.variant-panel,.sales-main-panel>.table-wrap,.sales-main-panel>.fee-toolbar,.sales-main-panel>.fee-entry,.sales-main-panel>.remark{background:#fff;border:1px solid var(--line);box-shadow:0 4px 18px rgba(24,52,40,.035)}
.sales-section-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:0 5px 10px}
.sales-section-title>div{display:flex;align-items:center;gap:10px}.sales-section-title strong{font-size:16px}.sales-section-title small{color:var(--muted);font-size:11px}
.sales-step{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:#dceee5;color:var(--green);font-size:10px;font-weight:900}
.sales-section-title.customer-title{color:#176b4d}
.sales-section-title.logistics-title{color:#315caa}
.sales-section-title.product-entry-title{color:#a65d13}
.sales-section-title.customer-title .sales-step{background:#dceee5;color:#176b4d}
.sales-section-title.logistics-title .sales-step{background:#e7efff;color:#315caa}
.sales-section-title.product-entry-title .sales-step{background:#fff1d6;color:#a65d13}
.sales-main-panel>.order-top{border-radius:17px;padding:18px;grid-template-columns:1.5fr repeat(2,1fr);border-color:#cfe7dc;border-top:4px solid #62b58d;background:linear-gradient(180deg,#fbfffd,#ffffff)}
.sales-main-panel>.order-top input,.sales-main-panel>.order-top select{height:44px;background:#fff}
.logistics-title,.product-entry-title{margin-top:22px}
.sales-main-panel>.delivery-info-grid{margin:0;border-radius:17px;padding:18px;background:linear-gradient(180deg,#f8fbff,#ffffff);border-color:#d7e3fb;border-top:4px solid #7fa4e8}
.sales-main-panel .delivery-photo-field{grid-template-columns:auto 1fr;align-items:center}
.sales-main-panel .delivery-photo-field>span{grid-column:1/-1}
.sales-main-panel .delivery-photo-actions{align-self:start}
.sales-main-panel .delivery-photo-preview{min-height:64px}
.sales-main-panel>.order-actions{background:transparent;border:0;box-shadow:none;padding:3px 5px;margin:10px 0 0}
.sales-main-panel>.item-entry-bar{border-radius:17px;padding:13px;margin:0;border-color:#f0ddad;border-top:4px solid #dca448;background:linear-gradient(180deg,#fffdf8,#ffffff)}
.sales-main-panel>.item-entry-bar .search-box{height:48px;background:#fbfdfc}
.sales-main-panel>.manual-entry,.sales-main-panel>.variant-panel{border-radius:17px;margin-top:10px;border-color:#f0ddad;background:linear-gradient(180deg,#fffdf8,#ffffff)}
.sales-main-panel>.search-hint{border-radius:17px;margin-top:10px;border-color:#f0ddad}
.sales-main-panel>.sku-card{border-radius:17px;margin-top:10px;border-color:#f0ddad}
.sales-main-panel>.table-wrap{border-radius:17px;padding:4px 14px 14px;margin-top:14px;min-height:74px}
.sales-main-panel>.fee-toolbar{border-radius:17px;padding:16px 17px;margin-top:16px}
.sales-main-panel>.fee-entry{border-radius:17px}
.sales-main-panel>.remark{border-radius:17px;padding:15px;margin-top:12px;min-height:84px}
.sales-checkout{border:1px solid #d8e4dd;padding:22px;border-radius:20px;box-shadow:0 14px 35px rgba(23,74,54,.09);overflow:hidden}
.sales-checkout:before{content:"结算";display:block;margin:-22px -22px 15px;padding:14px 22px;background:#173f31;color:white;font-size:15px;font-weight:900}
.sales-checkout>.eyebrow{display:block;padding-bottom:13px;border-bottom:1px solid var(--line);color:var(--green)}
.sales-checkout .sum-row{padding:14px 2px}.sales-checkout .grand{padding:18px;background:linear-gradient(135deg,#e8f4ee,#f4faf7)}
.sales-checkout input,.sales-checkout select{height:44px;background:#fff}
.sales-checkout #preview-order{height:48px;border-radius:13px;box-shadow:0 8px 18px rgba(23,107,77,.18)}
.variant-stock-hint{display:block;margin:0 0 6px;color:#176b4d;font-size:12px;font-weight:900;line-height:1.25}
.variant-stock-hint.empty{color:#a65d13}
@media(max-width:1100px){.sales-layout{grid-template-columns:1fr}.sales-checkout{position:static}.sales-main-panel>.order-top{grid-template-columns:repeat(2,1fr)}}
@media(max-width:1400px){.sales-layout{grid-template-columns:minmax(0,1fr)}.sales-checkout,.checkout{position:static;top:auto;width:100%;max-width:100%}}
@media(max-width:650px){.sales-order-toolbar{align-items:flex-start;flex-direction:column}.sales-order-toolbar-actions{width:100%}.sales-order-toolbar-actions button{flex:1}.sales-section-title{align-items:flex-start;flex-direction:column}.sales-main-panel>.order-top{grid-template-columns:1fr}.sales-main-panel .delivery-photo-field{grid-template-columns:1fr}.sales-main-panel .delivery-photo-actions{flex-wrap:wrap}}
.product-center{display:grid;gap:18px}.product-center-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.product-center-head h3{margin:5px 0 7px}.product-center-head p{margin:0;color:var(--muted)}.product-center-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}.product-center-actions .active{background:#fff4df;color:#a65d13}.product-file-button{display:inline-flex!important;align-items:center;justify-content:center;cursor:pointer}.product-file-button input{display:none}.product-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.product-stats article{background:#f5f9f7;border:1px solid #e1ebe5;border-radius:14px;padding:15px}.product-stats span{display:block;color:var(--muted);font-size:11px}.product-stats strong{display:block;margin-top:7px;font-size:20px}.product-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px}.product-list-toolbar .history-search{margin:0;flex:1}.product-style-list{display:grid;gap:12px}.product-style-card{display:grid;grid-template-columns:82px minmax(220px,1.5fr) minmax(150px,.7fr) minmax(170px,.8fr) auto;align-items:center;gap:16px;border:1px solid var(--line);border-radius:16px;padding:14px;background:#fff}.product-style-card.open{border-color:#cfe6db}.product-style-image{width:76px;height:76px;object-fit:cover;border-radius:14px;background:#122a21;color:#fff;display:grid;place-items:center;font-weight:900}.product-style-info h3{margin:6px 0}.product-style-info p{margin:0;color:var(--muted)}.product-style-info small,.product-style-price span,.product-style-price small,.product-style-stock span,.product-style-stock small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.product-style-price strong,.product-style-stock strong{display:block;margin-top:5px}.product-style-actions{display:flex;gap:7px}.product-sku-list{display:none;grid-column:1/-1;border-top:1px dashed var(--line);padding-top:5px}.product-style-card.open .product-sku-list{display:block}.product-sku-list table{min-width:1240px}.product-inline-input{width:100%;min-width:90px;padding:8px}.product-inline-input[readonly],.product-inline-input:disabled{background:#eef4f0;color:#315b49;font-weight:700}.product-sku-actions{display:flex;gap:6px;white-space:nowrap}.product-sku-actions button{border:0;border-radius:8px;padding:7px 9px;font-weight:800;cursor:pointer}.product-sku-actions .remove{background:#fff1f0;color:#c94c43}.product-thumb{width:44px;height:44px;object-fit:cover;border-radius:9px}.product-thumb-empty{background:#173f31;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:900}.product-form-modal{width:min(1280px,97vw);max-height:92vh;overflow:auto}.product-master-form{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.product-price-tip{display:flex;align-items:center;gap:12px;background:#fff8ee;border-left:3px solid var(--orange);padding:11px 13px;margin:16px 0;color:var(--muted);font-size:12px}.product-price-tip strong{color:#9a5718}.product-sku-toolbar{display:flex;align-items:center;justify-content:space-between;margin:12px 0}.product-sku-toolbar>div:first-child{display:grid;gap:4px}.product-sku-toolbar small{color:var(--muted)}.product-sku-editor table{min-width:980px}.product-sku-editor input{width:100%;min-width:95px;padding:8px}.pf-barcode[readonly]{background:#eef4f0;color:#315b49;font-weight:700;cursor:not-allowed}.product-sku-pagination{margin:12px 0 2px}.table-subtext{display:block;color:var(--muted);font-size:10px;margin-top:4px}.product-catalog-photo{background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important}
.product-image-field{display:grid;gap:7px}.product-image-actions{display:flex;gap:8px;align-items:center}.product-form-image-preview{min-height:74px;border:1px dashed #bfd4c9;border-radius:12px;background:#f7faf8;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:10px;overflow:hidden}.product-form-image-preview img{width:76px;height:68px;object-fit:cover;border-radius:9px}.product-form-image-preview.has-image{cursor:zoom-in}.product-zoomable{cursor:zoom-in}.pf-image-cell{width:116px;display:grid;grid-template-columns:1fr 1fr;gap:4px}.pf-image-preview{grid-column:1/-1;height:60px;border:1px dashed #c8d9d0;border-radius:9px;background:#f6faf8;color:var(--muted);font-size:10px;overflow:hidden;cursor:zoom-in}.pf-image-preview img{width:100%;height:100%;object-fit:cover}.pf-image-upload,.pf-image-remove{border:0;border-radius:7px;padding:5px 3px;text-align:center;font-size:10px;cursor:pointer}.pf-image-upload{background:#e8f4ee;color:var(--green)}.pf-image-upload input{display:none}.pf-image-remove{background:#fff0ee;color:#c94c43}.inventory-scan-panel{display:grid;grid-template-columns:minmax(220px,1.2fr) repeat(3,minmax(100px,.45fr)) minmax(240px,1fr) auto;gap:10px;align-items:end;background:#f4f9f6;border:1px solid #dbe9e1;border-radius:15px;padding:14px;margin:14px 0}.inventory-scan-panel>div{align-self:center}.inventory-scan-panel strong,.inventory-scan-panel small{display:block}.inventory-scan-panel small{margin-top:5px;color:var(--muted)}.inventory-scan-panel label{display:grid;gap:5px;color:var(--muted);font-size:11px}.inventory-scan-panel input,.inventory-scan-panel select{width:100%}.inventory-scan-panel p{grid-column:1/-1;margin:0;padding-top:8px;border-top:1px dashed #cbdcd3}.scan-success{color:var(--green);font-weight:700}.scan-error{color:#c94c43;font-weight:700}
.inventory-warehouse-tabs{display:flex;padding:4px;background:#edf4f0;border-radius:12px}.inventory-warehouse-tab{border:0;background:transparent;color:var(--muted);padding:10px 20px;border-radius:9px;font-weight:800;cursor:pointer}.inventory-warehouse-tab.active{background:#176b4d;color:#fff;box-shadow:0 5px 12px rgba(23,107,77,.18)}.inventory-style-list{display:grid;gap:12px;margin-top:14px}.inventory-style-card{border:1px solid var(--line);border-radius:16px;background:#fff;overflow:hidden}.inventory-style-summary{display:grid;grid-template-columns:68px minmax(190px,1.2fr) repeat(4,minmax(110px,.65fr)) auto;align-items:center;gap:16px;padding:15px}.inventory-style-image{width:62px;height:62px;object-fit:cover;border-radius:12px;background:#173f31;color:#fff;display:grid;place-items:center;font-weight:900}.inventory-style-summary span{display:block;color:var(--muted);font-size:11px}.inventory-style-summary strong{display:block;margin-top:5px}.inventory-style-name h3{margin:5px 0}.inventory-style-name p{margin:0;color:var(--muted);font-size:12px}.inventory-style-bom{display:none;padding:0 15px 15px;border-top:1px dashed var(--line);background:#fbfdfc}.inventory-style-card.open .inventory-style-bom{display:block}.inventory-style-bom table{min-width:1080px}.inventory-style-bom .table-wrap{margin-top:12px}.inventory-line-actions{display:flex;gap:6px;white-space:nowrap}.inventory-line-actions button{border:0;border-radius:8px;padding:7px 9px;background:#e8f4ee;color:var(--green);font-weight:800;cursor:pointer}.inventory-line-actions button[data-action="out"]{background:#fff4df;color:#a35a00}.inventory-line-actions button[data-action="count"]{background:#eef3ff;color:#315caa}
.inventory-manual-panel{display:grid;grid-template-columns:minmax(220px,1fr) minmax(260px,1.2fr) repeat(4,minmax(120px,.55fr)) auto;gap:10px;align-items:end;background:#fffaf0;border:1px solid #f2d9a6;border-radius:15px;padding:14px;margin:14px 0}.inventory-manual-panel>div{align-self:center}.inventory-manual-panel strong,.inventory-manual-panel small{display:block}.inventory-manual-panel small{margin-top:5px;color:var(--muted)}.inventory-manual-panel label{display:grid;gap:5px;color:var(--muted);font-size:11px}.inventory-manual-panel input,.inventory-manual-panel select{width:100%}.manual-inventory-note{grid-column:2/5}.inventory-manual-panel p{grid-column:1/-1;margin:0;padding-top:8px;border-top:1px dashed #e6d2a6}.inventory-log-section{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}.inventory-log-table table{min-width:1060px}.inventory-log-table .pill{background:#e8f4ee;color:var(--green)}
.picking-center{display:grid;gap:16px}.picking-center .panel-head p{margin:6px 0 0}.picking-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.picking-stats article{background:#f5f9f7;border:1px solid #e1ebe5;border-radius:14px;padding:15px}.picking-stats span{display:block;color:var(--muted);font-size:11px}.picking-stats strong{display:block;margin-top:7px;font-size:20px}.picking-filters{align-items:end}.picking-filters .history-search{margin:0;min-width:320px}.picking-status.active{background:var(--green);color:white;border-radius:9px}.picking-task-list{display:grid;gap:14px}.picking-task-card{border:1px solid #dbe9e1;border-radius:16px;background:#fff;padding:16px;box-shadow:0 4px 16px rgba(24,52,40,.035)}.picking-task-card.done{background:#fbfdfc}.picking-task-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.picking-task-head h3{margin:4px 0 6px}.picking-task-head p{margin:0;color:var(--muted);font-size:12px}.picking-task-actions{display:flex;align-items:center;gap:9px;white-space:nowrap}.picking-lines{margin-top:12px}.picking-lines table{min-width:920px}.picking-stock-hint{display:inline-block;border-radius:16px;background:#eef6f2;color:var(--green);font-size:11px;font-weight:900;padding:5px 8px}.picking-remark{margin:10px 0 0;color:var(--muted);font-size:12px}.dashboard-open-picking{border:0;background:var(--green2);color:var(--green);border-radius:8px;padding:7px 10px;font-weight:800;cursor:pointer}
@media(max-width:900px){.picking-stats{grid-template-columns:repeat(2,1fr)}.picking-task-head{flex-direction:column}.picking-task-actions{width:100%;justify-content:flex-end}}@media(max-width:560px){.picking-stats{grid-template-columns:1fr}.picking-filters .history-search{min-width:0}.picking-task-actions{flex-wrap:wrap}}
@media(max-width:1050px){.product-center-head{flex-direction:column}.product-center-actions{justify-content:flex-start}.product-style-card{grid-template-columns:72px 1fr 1fr}.product-style-actions{grid-column:2/-1}.product-master-form{grid-template-columns:repeat(2,1fr)}}
@media(max-width:1250px){.inventory-style-summary{grid-template-columns:62px minmax(170px,1fr) repeat(2,minmax(110px,.6fr)) auto}.inventory-style-summary>div:nth-of-type(4),.inventory-style-summary>div:nth-of-type(5){display:none}}
@media(max-width:850px){.inventory-scan-panel,.inventory-manual-panel{grid-template-columns:1fr 1fr}.inventory-scan-panel>div,.inventory-scan-panel p,.inventory-manual-panel>div,.inventory-manual-panel p,.manual-inventory-note{grid-column:1/-1}.inventory-style-summary{grid-template-columns:58px 1fr auto}.inventory-style-summary>div:not(.inventory-style-name){display:none}.inventory-warehouse-tabs{width:100%}.inventory-warehouse-tab{flex:1}.panel-head:has(.inventory-warehouse-tabs){align-items:flex-start;flex-direction:column}}
@media(max-width:650px){.product-stats{grid-template-columns:repeat(2,1fr)}.product-list-toolbar{align-items:flex-start;flex-direction:column}.product-style-card{grid-template-columns:60px 1fr}.product-style-price,.product-style-stock,.product-style-actions{grid-column:1/-1}.product-master-form{grid-template-columns:1fr}.product-sku-toolbar{align-items:flex-start;gap:10px;flex-direction:column}.product-sku-toolbar button{width:100%}}
.inventory-scan-panel,.inventory-manual-panel{grid-template-columns:minmax(220px,1.1fr) minmax(260px,1.35fr) minmax(160px,.55fr) minmax(260px,1fr) minmax(160px,.7fr) auto}
.inventory-action-tabs{display:flex;gap:8px;align-items:center;align-self:end;background:#eef6f2;border:1px solid #dbe9e1;border-radius:14px;padding:6px}
.inventory-action-tabs button{border:0;border-radius:10px;background:transparent;color:var(--green);font-weight:900;padding:12px 18px;cursor:pointer;white-space:nowrap}
.inventory-action-tabs button.active{background:var(--green);color:#fff;box-shadow:0 6px 16px rgba(23,107,77,.18)}
.inventory-action-tabs button[data-action="out"].active{background:#c77712}
.inventory-action-tabs button[data-action="count"].active{background:#315caa}
.inventory-warehouse-tabs,.picking-warehouse-tabs,.inventory-mode-tabs{gap:8px;background:#edf4f0;border:1px solid #dcebe3;padding:6px;border-radius:16px;display:flex}
.inventory-warehouse-tab,.picking-warehouse-tab,.inventory-mode-tab{border:0;background:transparent;color:var(--green);padding:12px 26px;border-radius:12px;font-weight:900;cursor:pointer}
.inventory-warehouse-tab.active,.picking-warehouse-tab.active,.inventory-mode-tab.active{background:var(--green);color:#fff;box-shadow:0 8px 20px rgba(23,107,77,.18)}
.inventory-manual-panel{grid-template-columns:minmax(220px,.9fr) minmax(340px,1.25fr) minmax(330px,1fr) minmax(150px,.45fr) minmax(180px,.55fr) minmax(180px,.55fr)!important;align-items:end}
.inventory-manual-panel #manual-inventory-action-tabs{justify-self:stretch}
.inventory-manual-panel .manual-inventory-note{grid-column:2/5}
.inventory-action-log-section{display:none;margin:14px 0 18px;padding:14px;border:1px solid #dbe9e1;border-radius:15px;background:#fbfdfc}
.inventory-action-log-tools{display:flex;align-items:center;justify-content:flex-end;gap:10px;color:var(--muted);font-size:12px}.inventory-action-log-tools .remove{border:0;border-radius:9px;padding:9px 12px;background:#fff1f0;color:#c94c43;font-weight:800;cursor:pointer}.inventory-action-log-tools .remove:disabled{opacity:.45;cursor:not-allowed}.inventory-action-log-delete-note{margin:10px 0}.inventory-log-select-cell{width:42px;text-align:center!important}.inventory-log-select-cell input{width:18px;height:18px;accent-color:var(--green);cursor:pointer}
.receipt-log-head.compact{margin-top:0;padding-top:0;border-top:0}
.inline-warning{margin:12px 0 14px;padding:10px 14px;border-left:3px solid #d98221;background:#fff8ec;color:#9a5a12;border-radius:10px;font-weight:700}
.inline-inventory-row td{padding:0!important;background:#fbfdfc}.inline-inventory-panel{display:grid;grid-template-columns:minmax(220px,1.1fr) minmax(240px,.9fr) minmax(120px,.45fr) minmax(150px,.55fr) minmax(220px,1fr) auto;gap:12px;align-items:end;margin:8px 0 14px;padding:16px;border:1px solid #d8ebe2;border-radius:14px;background:linear-gradient(180deg,#ffffff,#f6fbf8);box-shadow:inset 0 0 0 1px rgba(255,255,255,.75)}.inline-inventory-title strong,.inline-inventory-title small{display:block}.inline-inventory-title small{margin-top:4px;color:var(--muted)}.inline-inventory-panel label{display:grid;gap:5px;color:var(--muted);font-size:11px}.inline-inventory-panel input{width:100%}.inline-inventory-action-tabs{align-self:end}.inline-inventory-actions{display:flex;gap:8px;justify-content:flex-end}.inline-inventory-help{grid-column:1/-1;margin:0;color:var(--muted);font-size:12px}.muted-pill{background:#eef1ef!important;color:#758279!important}
@media(max-width:900px){.inline-inventory-panel{grid-template-columns:1fr}.inline-inventory-actions{justify-content:stretch}.inline-inventory-actions button{flex:1}}
.picking-center{gap:18px}.picking-stats article{padding:18px 20px}.picking-stats span{font-size:13px}.picking-stats strong{font-size:24px}.picking-task-card{padding:20px;border-radius:18px}.picking-task-head h3{font-size:22px}.picking-task-head p{font-size:13px}.picking-lines table{min-width:820px}.picking-lines th{font-size:12px}.picking-lines td{font-size:15px;padding:14px 12px}.picking-need{font-size:18px;color:#10231b}.picking-stock-hint{font-size:15px;padding:9px 13px;border-radius:999px;background:#e7f5ee;color:var(--green);font-weight:1000}.picking-task-actions .primary,.picking-task-actions .secondary{padding:13px 18px;border-radius:12px;font-size:15px}
@media(max-width:850px){.inventory-scan-panel,.inventory-manual-panel{grid-template-columns:1fr}.inventory-action-tabs{width:100%;justify-content:space-between}.inventory-action-tabs button{flex:1}.picking-warehouse-tab,.inventory-warehouse-tab,.inventory-mode-tab{flex:1}.inventory-mode-tabs{width:100%}}
@media(max-width:850px){.inventory-manual-panel #execute-manual-inventory{grid-column:1/-1;width:100%}.inventory-action-log-section .receipt-log-head{align-items:stretch}.inventory-action-log-tools{justify-content:space-between}.inventory-action-log-tools .remove{min-height:44px}}
@media(max-width:720px){
  html,body{max-width:100%;overflow-x:hidden}
  main{width:100%;max-width:100%;overflow-x:hidden}
  .sidebar{z-index:1000;box-shadow:18px 0 42px rgba(12,31,22,.25)}
  .sidebar.open{transform:translateX(0)!important}
  .sidebar.open+main:after{z-index:900}
  .menu-btn{position:relative;z-index:1001;touch-action:manipulation}
  .page,.panel,.inventory-center,.inventory-scan-panel,.inventory-manual-panel,.inventory-batch-panel{max-width:100%;min-width:0}
  .inventory-scan-panel,.inventory-manual-panel{grid-template-columns:minmax(0,1fr)!important;width:100%;overflow:hidden}
  .inventory-scan-panel label,.inventory-manual-panel label,.manual-inventory-note{grid-column:1/-1!important;min-width:0}
  .inventory-scan-panel input,.inventory-manual-panel input,.inventory-scan-panel select,.inventory-manual-panel select{min-width:0;width:100%}
  .inventory-batch-actions,.inventory-warehouse-tabs,.picking-warehouse-tabs,.inventory-mode-tabs{max-width:100%;overflow-x:auto}
  .inventory-batch-actions{flex-wrap:wrap}
  .inventory-action-tabs{width:100%;min-width:0}
}
@media print{
  @page{size:A4 portrait;margin:0}
  html{width:auto!important;height:auto!important;margin:0!important;overflow:hidden!important;background:#fff!important}
  body.printing-order{width:210mm!important;height:296.4mm!important;min-height:0!important;margin:0!important;overflow:hidden!important;background:#fff!important}
  body.printing-order.printing-order-a4{width:210mm!important;height:296.4mm!important}
  body.printing-order > *:not(#order-modal){display:none!important}
  body.printing-order *{visibility:hidden!important}
  body.printing-order #order-modal,
  body.printing-order #order-modal .modal-card,
  body.printing-order #order-modal .paper,
  body.printing-order #order-modal .paper *{visibility:visible!important}
  body.printing-order #order-modal{display:block!important;position:absolute!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;width:210mm!important;height:296.4mm!important;min-height:0!important;background:white!important;padding:0!important;margin:0!important;overflow:hidden!important;box-shadow:none!important;break-inside:avoid!important;page-break-inside:avoid!important;break-after:avoid!important;page-break-after:avoid!important}
  body.printing-order #order-modal .modal-card{display:block!important;position:static!important;box-shadow:none!important;filter:none!important;width:210mm!important;height:296.4mm!important;max-height:296.4mm!important;min-height:0!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;background:white!important;break-inside:avoid!important;page-break-inside:avoid!important}
  body.printing-order #order-modal .modal-head,
  body.printing-order #order-modal .button-row,
  body.printing-order #order-modal .export-note{display:none!important}
  body.printing-order #order-modal .paper{display:block!important;position:static!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;width:210mm!important;height:296.4mm!important;max-height:296.4mm!important;min-height:0!important;border:0!important;margin:0!important;padding:12mm 14mm 12mm!important;overflow:hidden!important;box-shadow:none!important;filter:none!important;background:white!important;break-inside:avoid!important;page-break-inside:avoid!important;break-after:avoid!important;page-break-after:avoid!important}
  body.printing-order #order-modal .paper,
  body.printing-order #order-modal .paper *{box-shadow:none!important;filter:none!important;text-shadow:none!important}
  body.printing-order #order-modal .paper h2{font-size:19px!important;line-height:1.15!important;margin:0 0 4px!important}
  body.printing-order #order-modal .order-brand{padding-bottom:7px!important;gap:8px!important}
  body.printing-order #order-modal .order-brand p{font-size:9px!important;line-height:1.25!important;margin:1px 0!important}
  body.printing-order #order-modal .order-number span{font-size:8px!important}
  body.printing-order #order-modal .order-number strong{font-size:10.5px!important}
  body.printing-order #order-modal .paper-meta{padding:7px 0!important;margin:4px 0 8px!important;gap:3px 18px!important}
  body.printing-order #order-modal .paper-meta p,
  body.printing-order #order-modal .paper-payment p{font-size:9px!important;line-height:1.3!important}
  body.printing-order #order-modal table{table-layout:fixed!important;width:100%!important}
  body.printing-order #order-modal th,
  body.printing-order #order-modal td{font-size:8.6px!important;line-height:1.2!important;padding:4px 3px!important;word-break:break-word!important}
  body.printing-order #order-modal th:nth-child(1),
  body.printing-order #order-modal td:nth-child(1){width:22%}
  body.printing-order #order-modal th:nth-child(2),
  body.printing-order #order-modal td:nth-child(2){width:14%}
  body.printing-order #order-modal th:nth-child(3),
  body.printing-order #order-modal td:nth-child(3){width:13%}
  body.printing-order #order-modal th:nth-child(4),
  body.printing-order #order-modal td:nth-child(4){width:18%}
  body.printing-order #order-modal th:nth-child(5),
  body.printing-order #order-modal td:nth-child(5){width:10%;text-align:right}
  body.printing-order #order-modal th:nth-child(6),
  body.printing-order #order-modal td:nth-child(6){width:11%;text-align:right}
  body.printing-order #order-modal th:nth-child(7),
  body.printing-order #order-modal td:nth-child(7){width:12%;text-align:right}
  body.printing-order #order-modal .paper-payment{width:43mm!important;margin:8px 0 7px auto!important;padding-top:7px!important;gap:4px!important}
  body.printing-order #order-modal .paper-payment .paper-grand{font-size:11px!important;padding-top:6px!important}
  body.printing-order #order-modal .wechat-block{grid-template-columns:repeat(3,24mm)!important;gap:7mm!important;margin-top:8px!important;padding-top:8px!important}
  body.printing-order #order-modal .wechat-block div{padding:2mm 1.5mm!important;border-radius:6px!important;gap:2px!important}
  body.printing-order #order-modal .wechat-block img{width:18mm!important}
  body.printing-order #order-modal .wechat-block span{font-size:6.5px!important}
  body.printing-order #order-modal .paper small{display:block!important;font-size:8px!important;margin-top:4px!important}
  body.printing-order #order-modal .paper.paper-compact{padding:6mm 8mm 5mm!important}
  body.printing-order #order-modal .paper.paper-compact .order-brand{padding-bottom:5px!important}
  body.printing-order #order-modal .paper.paper-compact h2{font-size:17px!important}
  body.printing-order #order-modal .paper.paper-compact .order-brand p{font-size:8.1px!important}
  body.printing-order #order-modal .paper.paper-compact .paper-meta{padding:5px 0!important;margin:3px 0 6px!important}
  body.printing-order #order-modal .paper.paper-compact th,
  body.printing-order #order-modal .paper.paper-compact td{font-size:7.9px!important;padding:3px 2px!important}
  body.printing-order #order-modal .paper.paper-compact .paper-payment{margin-top:6px!important;margin-bottom:5px!important}
  body.printing-order #order-modal .paper.paper-compact .wechat-block{margin-top:6px!important;padding-top:6px!important;gap:5mm!important}
  body.printing-order #order-modal .paper.paper-compact .wechat-block img{width:15mm!important}
  body.printing-order #order-modal .paper.paper-compact .wechat-block span{font-size:5.8px!important}
  body.printing-order #order-modal .paper.paper-dense .wechat-block{display:none!important}
  body.printing-order.printing-order-a4 #order-modal{width:210mm!important;height:296.4mm!important}
  body.printing-order.printing-order-a4 #order-modal .modal-card{width:210mm!important;height:296.4mm!important;max-height:296.4mm!important}
  body.printing-order.printing-order-a4 #order-modal .paper{width:210mm!important;height:296.4mm!important;max-height:296.4mm!important;padding:12mm 14mm 12mm!important}
  body.printing-order.printing-order-a4 #order-modal .paper h2{font-size:34px!important;line-height:1.06!important;margin-bottom:8px!important}
  body.printing-order.printing-order-a4 #order-modal .order-brand{padding-bottom:14px!important;gap:22px!important}
  body.printing-order.printing-order-a4 #order-modal .order-brand p{font-size:13px!important;line-height:1.45!important}
  body.printing-order.printing-order-a4 #order-modal .order-number span{font-size:11px!important}
  body.printing-order.printing-order-a4 #order-modal .order-number strong{font-size:17px!important}
  body.printing-order.printing-order-a4 #order-modal .paper-meta{padding:14px 0!important;margin:9px 0 14px!important;gap:9px 44px!important}
  body.printing-order.printing-order-a4 #order-modal .paper-meta p,
  body.printing-order.printing-order-a4 #order-modal .paper-payment p{font-size:13px!important;line-height:1.45!important}
  body.printing-order.printing-order-a4 #order-modal th,
  body.printing-order.printing-order-a4 #order-modal td{font-size:12.2px!important;line-height:1.35!important;padding:7px 5px!important}
  body.printing-order.printing-order-a4 #order-modal .paper-payment{width:74mm!important;margin:16px 0 13px auto!important;padding-top:12px!important;gap:7px!important}
  body.printing-order.printing-order-a4 #order-modal .paper-payment .paper-grand{font-size:18px!important}
  body.printing-order.printing-order-a4 #order-modal .wechat-block{grid-template-columns:repeat(3,35mm)!important;gap:12mm!important;margin-top:16px!important;padding-top:14px!important}
  body.printing-order.printing-order-a4 #order-modal .wechat-block div{padding:3mm 2mm!important}
  body.printing-order.printing-order-a4 #order-modal .wechat-block img{width:30mm!important}
  body.printing-order.printing-order-a4 #order-modal .wechat-block span{font-size:8px!important}
  body.printing-order.printing-order-a4 #order-modal .paper small{font-size:10px!important;margin-top:8px!important}
  body.printing-order.printing-order-a4 #order-modal .paper.paper-compact{padding:11mm 13mm 10mm!important}
  body.printing-order.printing-order-a4 #order-modal .paper.paper-compact th,
  body.printing-order.printing-order-a4 #order-modal .paper.paper-compact td{font-size:10.5px!important;padding:5px 4px!important}
  body.printing-order.printing-order-a4 #order-modal .paper.paper-compact .wechat-block img{width:26mm!important}
}

.inventory-sku-pagination{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:12px 0 0}
.inventory-log-view.active{background:var(--green2);border-radius:9px;color:var(--green)}
.inventory-log-trash-note{margin:10px 0 0}
.inventory-log-table .remove{border:0;border-radius:8px;padding:7px 9px;background:#fff1f0;color:#c94c43;font-weight:800;cursor:pointer;margin-left:6px}
.inventory-scan-panel #scan-action-tabs,.inventory-manual-panel #manual-inventory-action-tabs{display:none!important}
.inventory-scan-panel{grid-template-columns:minmax(260px,1fr) 120px minmax(260px,1.2fr) 180px!important}
.inventory-manual-panel{grid-template-columns:minmax(240px,.9fr) minmax(280px,1.2fr) 120px 170px minmax(220px,1fr) 180px!important}
.inventory-scan-panel .inventory-item-preview,.inventory-manual-panel .inventory-item-preview{grid-column:1/-1}
.inventory-item-preview:empty{display:none}
.inventory-preview-card{display:flex;align-items:center;gap:12px;border-top:1px dashed #cbdcd3;padding-top:12px}
.inventory-preview-image{width:58px;height:58px;object-fit:cover;border-radius:12px;background:#123b2c;color:#fff;display:grid;place-items:center;font-size:12px;font-weight:900;flex:0 0 auto}
.inventory-preview-card strong,.inventory-preview-card span{display:block}
.inventory-preview-card span{color:var(--muted);font-size:12px;margin-top:4px}
@media (min-width:851px) and (max-width:1366px){
  .inventory-manual-panel{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%;max-width:100%;overflow:visible}
  .inventory-manual-panel>div:first-child,.inventory-manual-panel label:has(#manual-inventory-search),.inventory-manual-panel .manual-inventory-note,.inventory-manual-panel .inventory-item-preview,.inventory-manual-panel p{grid-column:1/-1!important;min-width:0}
  .inventory-manual-panel input{min-width:0;width:100%}
  .inventory-manual-panel #execute-manual-inventory{grid-column:1/-1;width:100%;min-width:0}
}
.inventory-batch-panel{border:1px solid #dbe9e1;border-radius:16px;background:#fbfdfc;padding:14px;margin:14px 0}
.inventory-batch-actions{display:flex;gap:8px;align-items:center}
.inventory-batch-table table{min-width:1100px}
.inventory-batch-table input{width:100%;min-width:90px;padding:8px}
.inventory-batch-table .product-thumb{width:48px;height:48px}
.inventory-batch-table .remove-inventory-batch{border:0;border-radius:9px;background:#fff1f0!important;color:#c94c43!important;padding:8px 12px;font-weight:900;cursor:pointer;box-shadow:0 6px 14px rgba(201,76,67,.08),inset 0 1px 0 rgba(255,255,255,.55)}
.inventory-batch-table .remove-inventory-batch:hover{transform:translateY(-1px);box-shadow:0 9px 18px rgba(201,76,67,.14),inset 0 1px 0 rgba(255,255,255,.65)}
.inventory-batch-summary-modal{width:min(860px,94vw);max-height:86vh;overflow:auto}
.inventory-summary-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:4px 0 14px}
.inventory-summary-stats article{border:1px solid #dbe9e1;background:#f5f9f7;border-radius:12px;padding:13px}
.inventory-summary-stats span,.inventory-summary-stats strong{display:block}
.inventory-summary-stats span{color:var(--muted);font-size:11px;margin-bottom:6px}
.inventory-summary-table table{min-width:760px}
#inventory-style-pagination{margin-top:14px}
.inventory-style-summary{grid-template-columns:68px minmax(190px,1.2fr) repeat(4,minmax(110px,.65fr)) minmax(96px,auto)!important}
.inventory-style-bom table{table-layout:fixed;min-width:1160px}
.inventory-style-bom th:nth-child(1),.inventory-style-bom td:nth-child(1){width:70px}
.inventory-style-bom th:nth-child(2),.inventory-style-bom td:nth-child(2),.inventory-style-bom th:nth-child(3),.inventory-style-bom td:nth-child(3){width:90px}
.inventory-style-bom th:nth-child(4),.inventory-style-bom td:nth-child(4){width:220px}
.inventory-style-bom th:nth-child(9),.inventory-style-bom td:nth-child(9){width:200px;text-align:center}
.inventory-style-bom td:nth-child(9){padding-left:10px;padding-right:10px;vertical-align:middle}
.inventory-actions-cell{white-space:nowrap}
.inventory-line-actions{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%}
.inventory-line-actions button{min-width:52px;text-align:center;padding:8px 10px;line-height:1}
.inline-inventory-row td{padding:0 9px 14px!important}

#order-modal .modal-card.order-preview{width:min(760px,96vw);max-height:92vh;display:flex;flex-direction:column;overflow:hidden}
#order-modal .modal-head{gap:12px}
#order-modal .print-size-tools{margin-left:auto;display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--line);border-radius:12px;background:#f6fbf8}
#order-modal .print-size-tools span{font-size:12px;color:var(--muted);font-weight:800;white-space:nowrap}
#order-modal .modal-head{flex:0 0 auto}
#order-modal .paper{overflow:auto;max-height:calc(92vh - 190px);margin-bottom:12px}
#order-modal .export-note{flex:0 0 auto}
#order-modal .button-row{flex:0 0 auto;position:sticky;bottom:0;background:#fff;padding-top:12px;border-top:1px solid var(--line);z-index:2}
body.printing-order #order-modal .paper{overflow:hidden!important;max-height:none!important}
@media print{
  body.printing-label *{visibility:hidden!important}
  body.printing-label #label-modal,
  body.printing-label #label-modal .label-batch,
  body.printing-label #label-modal .label-batch *{visibility:visible!important}
  body.printing-label #label-modal{display:block!important;position:static;background:white;padding:0}
  body.printing-label #label-modal .modal-card{box-shadow:none;width:100%;padding:0}
  body.printing-label #label-modal .modal-head,
  body.printing-label #label-modal .toggle,
  body.printing-label #label-modal .label-price,
  body.printing-label #label-modal #print-label{display:none!important}
  body.printing-label #label-modal .label-batch{position:absolute;left:0;top:0;display:block;max-height:none;overflow:visible;padding:0}
  body.printing-label #label-modal .label-preview{break-inside:avoid;page-break-inside:avoid;margin:0 0 2mm 0}
}
.inventory-mode-tab[data-mode="count"]{display:none!important}
.picking-thumb{width:48px;height:48px;object-fit:cover;border-radius:12px;border:1px solid var(--line);background:#123b2c;color:#fff;display:grid;place-items:center;font-size:12px;font-weight:900}
.picking-lines th:first-child,.picking-lines td:first-child{width:70px}
.picking-log-table table{min-width:960px}
.picking-log-action{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;background:#eaf7f0;color:var(--green);font-weight:900;white-space:nowrap}
.picking-log-detail{color:var(--muted);max-width:280px;white-space:normal}
.picking-log-pagination{margin-top:14px}
.picking-log-table .delete-picking-log,.picking-task-actions .permanent-delete-picking-task{border:0;border-radius:11px;padding:10px 13px;background:#fff1f0;color:#c94c43;font-weight:900;cursor:pointer;box-shadow:0 8px 18px rgba(201,76,67,.08);white-space:nowrap}
.picking-task-actions .permanent-delete-picking-task{display:inline-flex;align-items:center;justify-content:center;min-height:42px}
.picking-log-table .delete-picking-log:hover,.picking-task-actions .permanent-delete-picking-task:hover{background:#ffe4e1;transform:translateY(-1px)}
.picking-status{position:relative;display:inline-flex;align-items:center;gap:6px}
.picking-task-card.partial{border-color:#f1d6a6;background:#fffdf8}
.picking-partial-note{margin-top:7px!important;color:#a65d13!important;font-weight:800}
.picking-tab-badge{display:none;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#fff3e8;color:var(--orange);font-size:12px;font-weight:900;line-height:22px;align-items:center;justify-content:center;box-shadow:inset 0 0 0 1px rgba(216,121,36,.24)}
.picking-status.active .picking-tab-badge{background:#fff;color:var(--orange)}
/* 缺货中心：第一版基础页，不接业务联动 */
.shortage-center {
  display: grid;
  gap: 18px;
}

.shortage-head {
  align-items: flex-start;
}

.shortage-head .section-note {
  margin: 6px 0 0;
  color: var(--muted);
}

.shortage-badge {
  background: #fff4df;
  color: #a65d13;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 900;
}

.shortage-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.shortage-stats article {
  background: #f5f9f7;
  border: 1px solid #e1ebe5;
  border-radius: 16px;
  padding: 16px;
}

.shortage-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shortage-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.shortage-stats small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.shortage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f6f9f7;
  border-radius: 16px;
  padding: 12px;
}

.shortage-search {
  flex: 1;
  max-width: 560px;
  margin: 0;
}

.shortage-search input {
  width: 100%;
}

.shortage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shortage-tab {
  border: 0;
  background: #eaf4ef;
  color: var(--green);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.shortage-tab.active {
  background: var(--green);
  color: #fff;
}

.shortage-threshold {
  display: grid;
  grid-template-columns: auto 110px auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shortage-threshold input {
  width: 110px;
}

.shortage-list {
  display: grid;
  gap: 12px;
}

.shortage-card {
  display: grid;
  grid-template-columns: 36px 68px minmax(220px, 1.15fr) repeat(4, minmax(110px, .55fr)) minmax(170px, .75fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.shortage-card.done {
  background: #f8faf9;
}

.shortage-card.trash {
  background: #fffafa;
  border-color: #f1d1cd;
}

.shortage-card strong,
.shortage-card span,
.shortage-card small {
  display: block;
}

.shortage-card small,
.shortage-card span {
  color: var(--muted);
}

.shortage-qty-box {
  border: 1px solid #dfe9e3;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 76px;
}

.shortage-qty-box.local {
  background: #edf8f2;
  border-color: #cfe8da;
}

.shortage-qty-box.local span,
.shortage-qty-box.local strong {
  color: #176b4d;
}

.shortage-qty-box.remote {
  background: #eef3ff;
  border-color: #d5def6;
}

.shortage-qty-box.remote span,
.shortage-qty-box.remote strong {
  color: #315caa;
}

.shortage-qty-box.demand {
  background: #fff7e8;
  border-color: #f1d8a7;
}

.shortage-qty-box.demand span,
.shortage-qty-box.demand strong {
  color: #a65d13;
}

.shortage-qty-box.total {
  background: #f5f8f6;
}

.shortage-card h4 {
  margin: 5px 0;
  font-size: 17px;
}

.shortage-card .product-thumb,
.shortage-card .product-thumb-empty {
  width: 58px;
  height: 58px;
  border-radius: 12px;
}

.shortage-status {
  display: inline-flex!important;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff4df;
  color: #a65d13!important;
  font-size: 12px;
  font-weight: 900;
}

.shortage-status[data-status="跨仓可调"] {
  background: #eef3ff;
  color: #315caa!important;
}

.shortage-status[data-status="待补货"] {
  background: #fff7e8;
  color: #b56200!important;
}

.shortage-status[data-status="已处理"] {
  background: #e8f4ee;
  color: var(--green)!important;
}

.shortage-status[data-status="回收站"] {
  background: #fff1f0;
  color: #c94c43!important;
}

.shortage-advice strong {
  color: var(--ink);
}

.shortage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.shortage-actions button {
  border: 0;
  border-radius: 9px;
  padding: 9px 11px;
  background: #e8f4ee;
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.shortage-actions .shortage-restock-action {
  background: #fff4df;
  color: #a65d13;
}

.shortage-actions .shortage-restore-action {
  background: #eef1ef;
  color: #6a756f;
}

.shortage-actions .shortage-delete-action,
.shortage-actions .shortage-permanent-delete-action {
  background: #fff1f0;
  color: #c94c43;
}

.shortage-actions .shortage-restore-trash-action {
  background: var(--green2);
  color: var(--green);
}

.shortage-empty {
  border: 1px dashed #c8dcd1;
  background: linear-gradient(180deg, #fff, #f7fbf8);
  border-radius: 18px;
  padding: 34px;
  text-align: center;
}

.shortage-empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff4df;
  color: #b56200;
  font-size: 22px;
  font-weight: 1000;
}

.shortage-empty h3 {
  margin: 0 0 8px;
}

.shortage-empty p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
}

.shortage-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  text-align: left;
}

.shortage-flow article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.shortage-flow b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green2);
  color: var(--green);
}

.shortage-flow span {
  font-weight: 900;
}

.shortage-flow small {
  grid-column: 2;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .shortage-stats,
  .shortage-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shortage-card {
    grid-template-columns: 58px minmax(200px, 1fr) repeat(2, minmax(110px, .7fr));
  }

  .shortage-advice,
  .shortage-actions {
    grid-column: 2 / -1;
  }

  .shortage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .shortage-search {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .shortage-stats,
  .shortage-flow {
    grid-template-columns: 1fr;
  }

  .shortage-threshold {
    grid-template-columns: 1fr;
  }

  .shortage-threshold input {
    width: 100%;
  }

  .shortage-card {
    grid-template-columns: 54px 1fr;
    align-items: start;
  }

  .shortage-card > div:not(.shortage-main) {
    grid-column: 2;
  }

  .shortage-actions {
    justify-content: stretch;
  }

  .shortage-actions button {
    flex: 1;
  }

  .shortage-empty {
    padding: 24px 16px;
  }
}

.label-photo{overflow:hidden}
.label-photo img{width:100%;height:100%;object-fit:cover}
.label-data .barcode{display:block;width:100%;height:62px;margin-top:10px;fill:#000;font-family:initial;letter-spacing:0}
.label-batch{display:grid;gap:12px;max-height:62vh;overflow:auto;padding:2px}
.label-batch .label-preview{page-break-inside:avoid}
.label-batch .label-preview{position:relative;grid-template-columns:1fr;width:350px;height:250px;padding:0;overflow:hidden}
.label-batch .label-data{text-align:left}
.label-batch .label-data h2{position:absolute;right:20px;top:13px;width:150px;text-align:right;font-size:53px;line-height:1;margin:0}
.label-batch .label-data p{font-size:16px;margin:0}
.label-batch .label-meta{position:absolute;left:20px;top:69px;display:flex;align-items:baseline;gap:14px;width:210px;margin:0}
.label-batch .label-meta strong{font-size:18px}
.label-batch .label-sku{position:absolute;left:20px;top:95px;max-width:290px;font-size:15px;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.label-batch .label-unit-price{display:none;position:absolute;left:20px;top:116px;font-weight:900;color:#111;line-height:1.05}
.label-batch .label-preview.show-price .label-unit-price{display:block}
.label-batch .barcode{position:absolute;left:20px;top:155px;width:310px;height:66px;margin:0;overflow:hidden}
.label-batch .label-data small{position:absolute;left:20px;top:141px;width:310px;font-size:13px;line-height:1;white-space:nowrap;overflow:hidden}
.product-sku-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:10px 12px;background:#f6faf8;border:1px solid #e0ede6;border-bottom:0;border-radius:12px 12px 0 0}
.product-sku-list .table-wrap{margin-top:0;border:1px solid #e0ede6;border-radius:0 0 12px 12px;overflow:auto;background:#fff}
.product-sku-table th,.product-sku-table td{height:56px;vertical-align:middle;border-bottom:1px solid #e4eee8}
.product-sku-table tbody tr:last-child td{border-bottom:0}
.product-sku-table .sku-check-col{width:38px;text-align:center}
.product-sku-table .sku-check-col input{width:auto}
.product-sku-table .product-thumb,.product-sku-table .product-thumb-empty{width:42px;height:42px}
.product-sku-table .product-inline-input{height:36px;padding:7px 9px}
.product-sku-table .product-sku-actions{align-items:center}
.sku-non-stock-cell{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-weight:800;color:#0f6b4d}
.sku-non-stock-cell input{width:16px;height:16px;accent-color:#137a5b}
.product-sku-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.variant-stock-hint{display:block;width:max-content;max-width:100%;margin:0 0 8px;padding:6px 10px;border-radius:999px;background:#e8f4ee;color:#0f6b4d;font-size:13px;font-weight:1000;line-height:1.25;white-space:normal;box-shadow:inset 0 0 0 1px #cfe5d9}
.variant-stock-hint.empty{background:#fff7e8;color:#a65d13;box-shadow:inset 0 0 0 1px #f0d9aa}
.variant-stock-hint.non-stock{background:#e8f4ee;color:#0f6b4d;box-shadow:inset 0 0 0 1px #bfe0cf}
.product-style-actions .delete-product-style{background:#fff1f0;color:#c94c43;border-radius:11px;padding:12px 17px;font-weight:800}
.toast{left:50%!important;top:50%!important;transform:translate(-50%,-50%) scale(.96)!important;padding:16px 24px!important;border-radius:16px!important;box-shadow:0 22px 50px rgba(18,42,33,.22)!important}
.toast{z-index:120!important}
.toast.show{transform:translate(-50%,-50%) scale(1)!important}
.primary,.secondary,.text-btn,.danger-btn,.product-sku-actions button,.record-actions button,.customer-row-actions button,.receipt-actions button,.inventory-line-actions button,.shortage-actions button{transition:transform .12s ease,box-shadow .12s ease,filter .12s ease;background-image:linear-gradient(180deg,rgba(255,255,255,.18),rgba(0,0,0,.035));box-shadow:0 7px 16px rgba(20,66,49,.08),inset 0 1px 0 rgba(255,255,255,.35)}
.primary:hover,.secondary:hover,.text-btn:hover,.danger-btn:hover,.product-sku-actions button:hover,.record-actions button:hover,.customer-row-actions button:hover,.receipt-actions button:hover,.inventory-line-actions button:hover,.shortage-actions button:hover{transform:translateY(-1px);filter:saturate(1.05);box-shadow:0 10px 22px rgba(20,66,49,.13),inset 0 1px 0 rgba(255,255,255,.45)}
.primary:active,.secondary:active,.text-btn:active,.danger-btn:active,.product-sku-actions button:active,.record-actions button:active,.customer-row-actions button:active,.receipt-actions button:active,.inventory-line-actions button:active,.shortage-actions button:active{transform:translateY(1px);box-shadow:0 3px 8px rgba(20,66,49,.12),inset 0 2px 5px rgba(0,0,0,.08)}
.app-confirm-card{text-align:center;width:min(430px,94vw)}
.app-confirm-card .modal-head{justify-content:center}
.app-confirm-card .modal-head .close{position:absolute;right:18px;top:18px}
.app-confirm-card p{font-size:14px;margin:6px 0 22px}
#app-confirm-modal{z-index:60}
#delete-order-modal{z-index:55}
.dashboard-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:18px;margin-top:18px;align-items:start}
.dashboard-panel{min-height:0}
.dashboard-priority{grid-column:span 7}
.dashboard-debt{grid-column:span 5}
.dashboard-recent,.dashboard-shortage,.dashboard-today{grid-column:span 4}
.dashboard-quick{grid-column:span 12}
.dashboard-priority{order:1}
.dashboard-debt{order:2}
.dashboard-recent{order:3}
.dashboard-shortage{order:4}
.dashboard-today{order:5}
.dashboard-quick{order:6}
.dashboard-panel[data-dashboard-size="small"]{grid-column:span 4}
.dashboard-panel[data-dashboard-size="medium"]{grid-column:span 5}
.dashboard-panel[data-dashboard-size="large"]{grid-column:span 7}
.dashboard-panel[data-dashboard-size="full"]{grid-column:1/-1}
.dashboard-card-tools{display:none;gap:6px;margin-left:auto}
.dashboard-card-tools button{border:0;border-radius:10px;background:#eef7f2;color:var(--green);font-weight:900;padding:7px 9px;cursor:pointer}
.dashboard-arrange-mode .dashboard-panel{outline:2px dashed #a8d6c2;outline-offset:4px;cursor:grab;position:relative}
.dashboard-arrange-mode .dashboard-panel:active{cursor:grabbing}
.dashboard-arrange-mode .dashboard-card-tools{display:flex}
.dashboard-dragging{opacity:.55;transform:scale(.99)}
.dashboard-arrange-mode .dashboard-panel::after{content:"拖动调整位置";position:absolute;right:14px;bottom:10px;color:#8aa69a;font-size:11px;font-weight:800;pointer-events:none}
.dashboard-product-list,.dashboard-list{display:grid;gap:10px}
.dashboard-product-row,.dashboard-mini-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid #e3eee8;border-radius:14px;background:#fff;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease}
.dashboard-product-row:hover,.dashboard-mini-row:hover{transform:translateY(-1px);border-color:#cfe6da;box-shadow:0 12px 28px rgba(20,66,49,.08)}
.dashboard-product-image,.dashboard-product-row .product-thumb-empty{width:48px;height:48px;border-radius:12px;object-fit:cover;background:#0d3a2b;color:#fff;display:grid;place-items:center;font-weight:900}
.dashboard-product-row strong,.dashboard-mini-row strong{display:block;font-size:15px;color:var(--ink)}
.dashboard-product-row span,.dashboard-mini-row span{display:block;margin-top:4px;color:var(--muted);font-size:13px}
.dashboard-row-right{text-align:right;display:grid;gap:5px;justify-items:end}
.dashboard-row-right button,.dashboard-task-list button,.dashboard-actions button{border:0;border-radius:12px;background:#eaf6f0;color:var(--green);font-weight:900;padding:9px 12px;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,filter .12s ease;background-image:linear-gradient(180deg,rgba(255,255,255,.22),rgba(0,0,0,.035));box-shadow:0 7px 16px rgba(20,66,49,.08),inset 0 1px 0 rgba(255,255,255,.35)}
.dashboard-row-right button:hover,.dashboard-task-list button:hover,.dashboard-actions button:hover{transform:translateY(-1px);filter:saturate(1.05);box-shadow:0 10px 22px rgba(20,66,49,.13),inset 0 1px 0 rgba(255,255,255,.45)}
.dashboard-row-right button:active,.dashboard-task-list button:active,.dashboard-actions button:active{transform:translateY(1px);box-shadow:0 3px 8px rgba(20,66,49,.12),inset 0 2px 5px rgba(0,0,0,.08)}
.dashboard-task-list{display:grid;gap:10px;padding:0;margin:0;list-style:none}
.dashboard-task-list li{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid #e3eee8;border-radius:14px;background:#fff}
.dashboard-task-list i{width:9px;height:9px;border-radius:50%;background:#e0822a}
.dashboard-task-list i.red{background:#dc5046}
.dashboard-task-list i.orange{background:#e0822a}
.dashboard-task-list strong{display:block;color:var(--ink)}
.dashboard-task-list span{display:block;margin-top:4px;color:var(--muted);font-size:13px}
.dashboard-actions{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.dashboard-actions button{min-height:46px;text-align:center;padding:12px 14px;background:#f2faf6}
.dashboard-actions button:first-child{background:var(--green);color:#fff}
.dashboard-empty{min-height:104px;display:grid;place-content:center;text-align:center;color:var(--muted);border:1px dashed #d8e8df;border-radius:14px;background:#f8fcfa}
.dashboard-empty strong{display:block;margin-bottom:6px;color:var(--ink)}
.dashboard-stock-row{grid-template-columns:minmax(0,1fr) auto}
.danger-text{color:#c94c43!important}
@media (max-width:1200px){
  .dashboard-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
  .dashboard-panel[data-dashboard-size="small"],.dashboard-panel[data-dashboard-size="medium"],.dashboard-panel[data-dashboard-size="large"],.dashboard-panel[data-dashboard-size="full"]{grid-column:span 6}
  .dashboard-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:720px){
  .dashboard-layout-bar{align-items:stretch;flex-direction:column}
  .dashboard-layout-bar>div:last-child{justify-content:stretch}
  .dashboard-layout-bar button{flex:1}
  .dashboard-product-row,.dashboard-mini-row,.dashboard-task-list li{grid-template-columns:1fr;align-items:start}
  .dashboard-row-right{justify-items:start;text-align:left}
  .dashboard-actions{grid-template-columns:1fr}
}

.login-screen{
  position:fixed;
  inset:0;
  z-index:100;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 15% 15%,rgba(240,196,99,.18),transparent 30%),
    linear-gradient(135deg,#10271f,#174b38 58%,#f3f6f3 58%);
}
.login-screen.hidden{display:none}
.login-card{
  width:min(460px,100%);
  background:#fff;
  border:1px solid #dce8e1;
  border-radius:22px;
  box-shadow:0 30px 80px rgba(9,31,22,.28);
  padding:26px;
}
.login-brand{
  display:flex;
  align-items:center;
  gap:14px;
  padding-bottom:22px;
  margin-bottom:22px;
  border-bottom:1px solid var(--line);
}
.login-brand img{
  width:54px;
  height:54px;
  border-radius:15px;
  object-fit:cover;
  box-shadow:0 10px 24px rgba(18,42,33,.14);
}
.login-brand strong,.login-brand span{display:block}
.login-brand strong{font-size:20px}
.login-brand span{color:var(--muted);margin-top:4px}
.login-pane{display:none}
.login-pane.active{display:grid;gap:14px}
.login-pane h2{margin:0;font-size:24px}
.login-pane p{margin:0;color:var(--muted);line-height:1.7}
.login-pane .wide{width:100%;margin-top:4px}
.login-switch{justify-self:center}
.login-tip{
  display:none;
  margin-top:4px;
  padding:12px;
  border-radius:12px;
  color:#9a651d;
  background:#fff7e8;
  line-height:1.6;
}
.header-actions{
  align-items:center;
}
.header-actions .avatar{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  height:42px;
  padding:0 15px;
  border:1px solid #dce8e1;
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  cursor:default;
  box-shadow:0 8px 20px rgba(20,66,49,.07),inset 0 1px 0 rgba(255,255,255,.8);
}
.header-actions .avatar span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.header-actions .avatar strong{
  color:var(--green);
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}
#logout-button{
  height:42px;
  padding:0 16px;
  border-radius:14px;
  box-shadow:0 8px 20px rgba(20,66,49,.08),inset 0 1px 0 rgba(255,255,255,.45);
}
.role-warehouse #product-form-modal .product-price-tip,
.role-warehouse #product-form-modal .product-form-price-head,
.role-warehouse #product-form-modal .warehouse-price-cell{
  display:none!important;
}
.price-hidden{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:70px;
  border-radius:9px;
  background:#eef4f0;
  color:#6e8178;
  font-weight:900;
  padding:7px 10px;
}
.sample-order-panel{
  display:none;
  grid-template-columns:minmax(260px,1fr) minmax(220px,.65fr) minmax(180px,.45fr);
  gap:14px;
  align-items:end;
  margin:14px 0 18px;
  padding:18px;
  border:1px solid #f0d5a8;
  border-radius:18px;
  background:#fff8ed;
}
.sample-order-panel h3{
  margin:5px 0 6px;
  font-size:18px;
}
.sample-order-panel p{
  margin:0;
  color:#8a6a3a;
  line-height:1.6;
}
#sales.sample-order-mode .sample-order-panel{
  display:grid;
}
#sales.sample-order-mode .logistics-title,
#sales.sample-order-mode .delivery-info-grid,
#sales.sample-order-mode .product-entry-title,
#sales.sample-order-mode .item-entry-bar,
#sales.sample-order-mode #manual-entry,
#sales.sample-order-mode #search-hint,
#sales.sample-order-mode #search-empty,
#sales.sample-order-mode #sku-result,
#sales.sample-order-mode #variant-panel,
#sales.sample-order-mode .table-wrap,
#sales.sample-order-mode .fee-toolbar,
#sales.sample-order-mode #fee-entry,
#sales.sample-order-mode #fee-lines{
  display:none!important;
}
#sales.sample-order-mode .remark{
  min-height:120px;
  margin-top:0;
}
.sample-hidden-summary{
  display:none!important;
}
@media(max-width:900px){
  .sample-order-panel{
    grid-template-columns:1fr;
  }
}

/* Mobile UI v3: portrait-first cards for sales and warehouse workflows. */
@media(max-width:760px){
  body.mobile-v3-active{
    --mobile-card-radius:18px;
    --mobile-gap:12px;
    font-size:16px;
    line-height:1.55;
    overflow-x:hidden!important;
  }
  body.mobile-v3-active *{
    max-width:100%;
    box-sizing:border-box;
  }
  body.mobile-v3-active .page{
    padding:10px;
  }
  body.mobile-v3-active .panel{
    padding:14px;
    border-radius:var(--mobile-card-radius);
  }
  body.mobile-v3-active .panel-head{
    gap:12px;
  }
  body.mobile-v3-active .panel-head h3,
  body.mobile-v3-active .shortage-head h3,
  body.mobile-v3-active .sales-section-title h3{
    font-size:21px;
    line-height:1.25;
  }
  body.mobile-v3-active input,
  body.mobile-v3-active select,
  body.mobile-v3-active textarea{
    width:100%;
    min-height:50px;
    border-radius:14px;
    font-size:16px;
  }
  body.mobile-v3-active button,
  body.mobile-v3-active .primary,
  body.mobile-v3-active .secondary,
  body.mobile-v3-active .text-btn,
  body.mobile-v3-active .danger-btn{
    min-height:48px;
    border-radius:14px;
    font-size:15px;
    touch-action:manipulation;
  }
  body.mobile-v3-active .table-wrap{
    overflow:visible!important;
  }
  body.mobile-v3-active .table-wrap table{
    min-width:0!important;
  }

  body.mobile-v3-active .toast{
    left:14px!important;
    right:14px!important;
    top:auto!important;
    bottom:calc(18px + env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-height:86px!important;
    padding:12px 14px!important;
    border-radius:16px!important;
    font-size:14px!important;
    line-height:1.45!important;
    text-align:center!important;
  }
  body.mobile-v3-active.mobile-sales-open .toast,
  body.mobile-v3-active:has(.mobile-action-bar.open) .toast{
    bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }

  body.mobile-v3-active .mobile-workbench{
    margin:10px;
    border-radius:20px;
    box-shadow:0 12px 28px rgba(20,66,49,.08);
  }
  body.mobile-v3-active .mobile-workbench-grid{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  body.mobile-v3-active .mobile-workbench-grid button{
    min-height:96px;
    padding:14px;
  }

  body.mobile-v3-active .sales-layout,
  body.mobile-v3-active .product-center,
  body.mobile-v3-active .picking-center,
  body.mobile-v3-active .shortage-center{
    display:grid;
    grid-template-columns:1fr!important;
    gap:12px;
  }
  body.mobile-v3-active .sales-main-panel,
  body.mobile-v3-active .sales-checkout,
  body.mobile-v3-active .inventory-scan-panel,
  body.mobile-v3-active .inventory-manual-panel,
  body.mobile-v3-active .inventory-batch-panel{
    border-radius:20px!important;
  }
  body.mobile-v3-active .sales-checkout{
    position:static!important;
    margin-top:12px;
  }
  body.mobile-v3-active .checkout-row,
  body.mobile-v3-active .checkout-total{
    font-size:16px;
  }
  body.mobile-v3-active #preview-order{
    min-height:58px;
    font-size:17px;
  }
  body.mobile-v3-active .order-top,
  body.mobile-v3-active .delivery-info-grid,
  body.mobile-v3-active .manual-grid,
  body.mobile-v3-active .fee-entry,
  body.mobile-v3-active .sample-order-panel{
    grid-template-columns:1fr!important;
  }
  body.mobile-v3-active .item-entry-bar{
    grid-template-columns:1fr!important;
  }
  body.mobile-v3-active .search-box{
    margin:0;
  }
  body.mobile-v3-active #sku-result{
    grid-template-columns:62px minmax(0,1fr)!important;
  }
  body.mobile-v3-active #sku-result .secondary{
    grid-column:1/-1;
    width:100%;
  }

  body.mobile-v3-active #order-lines,
  body.mobile-v3-active #order-lines tr,
  body.mobile-v3-active #order-lines td,
  body.mobile-v3-active #fee-lines,
  body.mobile-v3-active #fee-lines tr,
  body.mobile-v3-active #fee-lines td{
    display:block;
    width:100%;
  }
  body.mobile-v3-active #order-lines tr,
  body.mobile-v3-active #fee-lines tr{
    margin:0 0 12px;
    padding:12px;
    border:1px solid #dfece5;
    border-radius:18px;
    background:#fff;
  }
  body.mobile-v3-active #order-lines td,
  body.mobile-v3-active #fee-lines td{
    display:grid;
    grid-template-columns:78px minmax(0,1fr);
    gap:10px;
    align-items:center;
    min-height:44px;
    padding:8px 0!important;
    border-bottom:1px solid #eef4f0;
  }
  body.mobile-v3-active #order-lines td:last-child,
  body.mobile-v3-active #fee-lines td:last-child{
    border-bottom:0;
  }
  body.mobile-v3-active #order-lines td::before,
  body.mobile-v3-active #fee-lines td::before{
    content:attr(data-mobile-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  body.mobile-v3-active #order-lines td:first-child,
  body.mobile-v3-active #fee-lines td:first-child{
    grid-template-columns:1fr;
  }
  body.mobile-v3-active #order-lines td:first-child::before,
  body.mobile-v3-active #fee-lines td:first-child::before{
    display:none;
  }
  body.mobile-v3-active #order-lines input,
  body.mobile-v3-active #order-lines select,
  body.mobile-v3-active #fee-lines input{
    min-height:44px;
  }
  body.mobile-v3-active #order-lines .remove,
  body.mobile-v3-active #fee-lines .remove{
    width:100%;
    min-height:46px;
  }

  body.mobile-v3-active .picking-stats,
  body.mobile-v3-active .shortage-stats,
  body.mobile-v3-active .product-stats{
    grid-template-columns:1fr 1fr!important;
    gap:10px;
  }
  body.mobile-v3-active .picking-stats article,
  body.mobile-v3-active .shortage-stats article,
  body.mobile-v3-active .product-stats article{
    padding:13px;
    border-radius:16px;
  }
  body.mobile-v3-active .picking-filters,
  body.mobile-v3-active .shortage-toolbar,
  body.mobile-v3-active .product-center-head,
  body.mobile-v3-active .product-list-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  body.mobile-v3-active .picking-status-list,
  body.mobile-v3-active .shortage-tabs,
  body.mobile-v3-active .inventory-mode-tabs,
  body.mobile-v3-active .inventory-warehouse-tabs,
  body.mobile-v3-active .picking-warehouse-tabs{
    display:flex!important;
    gap:8px;
    overflow-x:auto;
    padding:4px;
    scroll-snap-type:x mandatory;
  }
  body.mobile-v3-active .picking-status,
  body.mobile-v3-active .shortage-tab,
  body.mobile-v3-active .inventory-mode-tab,
  body.mobile-v3-active .inventory-warehouse-tab,
  body.mobile-v3-active .picking-warehouse-tab{
    flex:0 0 auto;
    min-width:94px;
    scroll-snap-align:start;
  }

  body.mobile-v3-active .picking-task-card{
    padding:14px!important;
    border-radius:20px!important;
  }
  body.mobile-v3-active .picking-task-head h3{
    font-size:20px!important;
    line-height:1.22;
    word-break:break-word;
  }
  body.mobile-v3-active .picking-task-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  body.mobile-v3-active .picking-task-actions button,
  body.mobile-v3-active .picking-task-actions span{
    width:100%;
    margin:0!important;
  }
  body.mobile-v3-active .picking-lines table,
  body.mobile-v3-active .picking-lines thead,
  body.mobile-v3-active .picking-lines tbody,
  body.mobile-v3-active .picking-lines tr,
  body.mobile-v3-active .picking-lines td{
    display:block;
    width:100%;
  }
  body.mobile-v3-active .picking-lines thead{
    display:none;
  }
  body.mobile-v3-active .picking-lines tr{
    display:grid;
    grid-template-columns:64px minmax(0,1fr);
    gap:10px;
    margin-top:12px;
    padding:12px;
    border:1px solid #dfece5;
    border-radius:18px;
    background:#fbfdfc;
  }
  body.mobile-v3-active .picking-lines td{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    gap:8px;
    align-items:center;
    min-height:32px;
    padding:5px 0!important;
    border:0;
  }
  body.mobile-v3-active .picking-lines td::before{
    content:attr(data-mobile-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  body.mobile-v3-active .picking-lines td:first-child{
    grid-row:1 / span 4;
    grid-column:1;
    display:block;
    padding:0!important;
  }
  body.mobile-v3-active .picking-lines td:first-child::before{
    display:none;
  }
  body.mobile-v3-active .picking-lines td:not(:first-child){
    grid-column:2;
  }
  body.mobile-v3-active .picking-lines td:nth-child(2) strong,
  body.mobile-v3-active .picking-need{
    font-size:18px;
    line-height:1.25;
    word-break:break-word;
  }
  body.mobile-v3-active .picking-thumb{
    width:58px;
    height:58px;
    border-radius:16px;
  }
  body.mobile-v3-active .picking-stock-hint{
    width:100%;
    justify-content:center;
    text-align:center;
  }

  body.mobile-v3-active .shortage-list{
    gap:12px;
  }
  body.mobile-v3-active .shortage-card{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    padding:14px!important;
    border-radius:20px!important;
  }
  body.mobile-v3-active .shortage-main{
    display:grid;
    grid-template-columns:58px minmax(0,1fr);
    gap:12px;
    align-items:center;
  }
  body.mobile-v3-active .shortage-card h4{
    margin:0 0 4px;
    font-size:19px;
    line-height:1.25;
    word-break:break-word;
  }
  body.mobile-v3-active .shortage-card .product-thumb,
  body.mobile-v3-active .shortage-card .product-thumb-empty{
    width:58px!important;
    height:58px!important;
    border-radius:16px!important;
  }
  body.mobile-v3-active .shortage-card > div:not(.shortage-main):not(.shortage-advice):not(.shortage-actions){
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  body.mobile-v3-active .shortage-qty-box{
    min-height:82px;
    padding:12px;
    border-radius:16px;
  }
  body.mobile-v3-active .shortage-qty-box strong{
    font-size:20px;
  }
  body.mobile-v3-active .shortage-advice{
    padding:12px;
    border-radius:16px;
    line-height:1.55;
  }
  body.mobile-v3-active .shortage-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  body.mobile-v3-active .shortage-actions button,
  body.mobile-v3-active .shortage-actions span{
    width:100%;
  }

  body.mobile-v3-active .inventory-action-layout,
  body.mobile-v3-active .inventory-scan-panel,
  body.mobile-v3-active .inventory-manual-panel{
    grid-template-columns:1fr!important;
  }
  body.mobile-v3-active .inventory-style-list,
  body.mobile-v3-active .product-style-list{
    gap:12px;
  }
  body.mobile-v3-active .inventory-style-card,
  body.mobile-v3-active .product-style-card{
    display:block!important;
    padding:0!important;
    border-radius:20px!important;
    overflow:hidden;
  }
  body.mobile-v3-active .inventory-style-summary,
  body.mobile-v3-active .product-style-card{
    grid-template-columns:none!important;
  }
  body.mobile-v3-active .inventory-style-summary{
    display:grid!important;
    grid-template-columns:62px minmax(0,1fr);
    gap:12px;
    padding:14px!important;
  }
  body.mobile-v3-active .inventory-style-summary > div:not(.inventory-style-name){
    display:block!important;
    grid-column:auto;
  }
  body.mobile-v3-active .inventory-style-name{
    min-width:0;
  }
  body.mobile-v3-active .inventory-style-name h3{
    font-size:22px;
    margin:4px 0;
    word-break:break-word;
  }
  body.mobile-v3-active .inventory-style-summary > div:nth-of-type(2),
  body.mobile-v3-active .inventory-style-summary > div:nth-of-type(3),
  body.mobile-v3-active .inventory-style-summary > div:nth-of-type(4),
  body.mobile-v3-active .inventory-style-summary > div:nth-of-type(5){
    grid-column:1/-1;
    display:grid!important;
    grid-template-columns:1fr auto;
    gap:8px;
    padding:10px 12px;
    border-radius:14px;
    background:#f7fbf9;
  }
  body.mobile-v3-active .inventory-style-summary .toggle-inventory-bom{
    grid-column:1/-1;
    width:100%;
  }
  body.mobile-v3-active .inventory-style-bom{
    padding:0 12px 14px!important;
  }
  body.mobile-v3-active .inventory-style-bom table,
  body.mobile-v3-active .inventory-style-bom thead,
  body.mobile-v3-active .inventory-style-bom tbody,
  body.mobile-v3-active .inventory-style-bom tr,
  body.mobile-v3-active .inventory-style-bom td{
    display:block;
    width:100%;
  }
  body.mobile-v3-active .inventory-style-bom thead{
    display:none;
  }
  body.mobile-v3-active .inventory-style-bom tbody tr:not(.inline-inventory-row){
    margin:0 0 12px;
    padding:12px;
    border:1px solid #dfece5;
    border-radius:18px;
    background:#fff;
  }
  body.mobile-v3-active .inventory-style-bom tbody tr:not(.inline-inventory-row) td{
    display:grid;
    grid-template-columns:82px minmax(0,1fr);
    gap:10px;
    align-items:center;
    padding:8px 0!important;
    border-bottom:1px solid #eef4f0;
  }
  body.mobile-v3-active .inventory-style-bom tbody tr:not(.inline-inventory-row) td:last-child{
    border-bottom:0;
  }
  body.mobile-v3-active .inventory-style-bom tbody tr:not(.inline-inventory-row) td::before{
    content:attr(data-mobile-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  body.mobile-v3-active .inventory-style-bom tbody tr:not(.inline-inventory-row) td:first-child{
    grid-template-columns:1fr;
  }
  body.mobile-v3-active .inventory-style-bom tbody tr:not(.inline-inventory-row) td:first-child::before{
    display:none;
  }
  body.mobile-v3-active .inventory-line-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr 1fr!important;
    gap:8px;
  }
  body.mobile-v3-active .inventory-line-actions button{
    min-height:46px;
    padding:0 8px;
  }
  body.mobile-v3-active .inline-inventory-row td{
    display:block!important;
    padding:0!important;
  }
  body.mobile-v3-active .inline-inventory-panel{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px;
    padding:12px!important;
    border-radius:18px!important;
  }
  body.mobile-v3-active .inline-inventory-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  body.mobile-v3-active .product-center-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:8px;
    width:100%;
  }
  body.mobile-v3-active .product-center-actions button,
  body.mobile-v3-active .product-file-button{
    width:100%;
  }
  body.mobile-v3-active .product-style-card{
    display:grid!important;
    grid-template-columns:64px minmax(0,1fr)!important;
    gap:12px!important;
    padding:14px!important;
  }
  body.mobile-v3-active .product-style-image{
    width:60px!important;
    height:60px!important;
    border-radius:16px!important;
  }
  body.mobile-v3-active .product-style-info h3{
    font-size:22px;
    margin:4px 0;
    word-break:break-word;
  }
  body.mobile-v3-active .product-style-price,
  body.mobile-v3-active .product-style-stock,
  body.mobile-v3-active .product-style-actions,
  body.mobile-v3-active .product-sku-list{
    grid-column:1/-1;
  }
  body.mobile-v3-active .product-style-price,
  body.mobile-v3-active .product-style-stock{
    display:grid;
    grid-template-columns:1fr auto;
    gap:8px;
    padding:10px 12px;
    border-radius:14px;
    background:#f7fbf9;
  }
  body.mobile-v3-active .product-style-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  body.mobile-v3-active .product-style-actions button{
    width:100%;
  }
  body.mobile-v3-active .product-sku-tools{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }
  body.mobile-v3-active .product-sku-table,
  body.mobile-v3-active .product-sku-table thead,
  body.mobile-v3-active .product-sku-table tbody,
  body.mobile-v3-active .product-sku-table tr,
  body.mobile-v3-active .product-sku-table td{
    display:block;
    width:100%;
  }
  body.mobile-v3-active .product-sku-table thead{
    display:none;
  }
  body.mobile-v3-active .product-sku-table tr{
    margin:0 0 12px;
    padding:12px;
    border:1px solid #dfece5;
    border-radius:18px;
    background:#fff;
  }
  body.mobile-v3-active .product-sku-table td{
    display:grid;
    grid-template-columns:82px minmax(0,1fr);
    gap:10px;
    align-items:center;
    height:auto!important;
    min-height:44px;
    padding:8px 0!important;
    border-bottom:1px solid #eef4f0;
  }
  body.mobile-v3-active .product-sku-table td:last-child{
    border-bottom:0;
  }
  body.mobile-v3-active .product-sku-table td::before{
    content:attr(data-mobile-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  body.mobile-v3-active .product-sku-table .product-sku-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  body.mobile-v3-active .mobile-v3-order-modal.modal{
    padding:0!important;
    align-items:stretch!important;
  }
  body.mobile-v3-active .mobile-v3-order-modal .overview-modal{
    width:100%!important;
    min-height:100vh!important;
    margin:0!important;
    padding:14px!important;
    border-radius:0!important;
    overflow:auto!important;
  }
  body.mobile-v3-active .mobile-v3-order-modal .modal-head{
    position:sticky;
    top:0;
    z-index:3;
    margin:-14px -14px 12px;
    padding:12px 14px;
    background:rgba(255,255,255,.97);
    border-bottom:1px solid #e2ede7;
  }
  body.mobile-v3-active .mobile-v3-order-modal .modal-head h3{
    font-size:20px;
    line-height:1.25;
    word-break:break-word;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-order-card{
    padding:0;
    border:0;
    background:transparent;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-order-head{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding:0!important;
    background:transparent!important;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-order-head > div{
    padding:14px;
    border:1px solid #dfece5;
    border-radius:18px;
    background:#f7fbf9;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-order-head span,
  body.mobile-v3-active .mobile-v3-order-modal .detail-summary span{
    font-size:13px!important;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-order-head strong{
    display:block;
    margin-top:6px;
    font-size:22px;
    line-height:1.2;
    word-break:break-word;
  }
  body.mobile-v3-active .mobile-v3-order-modal .detail-summary{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    margin:12px 0;
  }
  body.mobile-v3-active .mobile-v3-order-modal .detail-summary p{
    display:grid!important;
    grid-template-columns:88px minmax(0,1fr);
    gap:10px;
    align-items:start;
    margin:0!important;
    padding:12px;
    border:1px solid #e4eee8;
    border-radius:16px;
    background:#fff;
  }
  body.mobile-v3-active .mobile-v3-order-modal .detail-summary strong{
    word-break:break-word;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table,
  body.mobile-v3-active .mobile-v3-order-modal .bom-table thead,
  body.mobile-v3-active .mobile-v3-order-modal .bom-table tbody,
  body.mobile-v3-active .mobile-v3-order-modal .bom-table tr,
  body.mobile-v3-active .mobile-v3-order-modal .bom-table td{
    display:block;
    width:100%;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table thead{
    display:none;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table tr{
    margin:0 0 12px;
    padding:12px;
    border:1px solid #dfece5;
    border-radius:18px;
    background:#fff;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table td{
    display:grid;
    grid-template-columns:86px minmax(0,1fr);
    gap:10px;
    align-items:center;
    padding:8px 0!important;
    border-bottom:1px solid #eef4f0;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table td:last-child{
    border-bottom:0;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table td::before{
    content:attr(data-mobile-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-table td strong{
    font-size:17px;
    word-break:break-word;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-pagination{
    position:sticky;
    bottom:0;
    margin:12px -14px -14px;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom));
    background:rgba(255,255,255,.97);
    border-top:1px solid #e2ede7;
  }
  body.mobile-v3-active .mobile-v3-order-modal .bom-pagination button{
    flex:1;
  }
  body.mobile-v3-active .mobile-v3-order-modal .detail-remark{
    padding:12px;
    border-radius:16px;
    background:#fff8ed;
    line-height:1.6;
  }
}

@media(max-width:420px){
  body.mobile-v3-active .picking-stats,
  body.mobile-v3-active .shortage-stats,
  body.mobile-v3-active .product-stats{
    grid-template-columns:1fr!important;
  }
  body.mobile-v3-active .product-center-actions,
  body.mobile-v3-active .product-style-actions,
  body.mobile-v3-active .inventory-line-actions{
    grid-template-columns:1fr!important;
  }
  body.mobile-v3-active .mobile-sales-bar.open{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.mobile-v3-active.mobile-sales-open{
    padding-bottom:136px;
  }
  body.mobile-v3-active .shortage-card > div:not(.shortage-main):not(.shortage-advice):not(.shortage-actions){
    grid-template-columns:1fr;
  }
}

.nav-item.dragging,
.nav-item.touch-dragging{
  opacity:.72;
  outline:2px solid rgba(74,209,140,.75);
  background:#2b5a48!important;
  color:#fff!important;
  transform:scale(.985);
}
.sidebar nav{touch-action:pan-y}

@media(max-width:760px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{font-size:15px}
  input,select,textarea{min-height:46px;font-size:16px}
  button,.primary,.secondary,.text-btn,.danger-btn{min-height:44px}
  .login-screen{align-items:flex-start;padding:18px 12px;overflow:auto}
  .login-card{width:100%;max-width:430px;margin:7vh auto 24px;padding:22px 18px;border-radius:18px}
  .login-brand{align-items:center}
  .login-brand img{width:48px;height:48px}
  .login-pane h2{font-size:22px;margin-bottom:8px}
  .login-pane p{line-height:1.55}
  header{height:auto;min-height:64px;padding:10px 12px;gap:8px}
  header h1{font-size:20px}
  .header-actions{gap:6px;min-width:0}
  .header-actions .avatar{max-width:150px;padding:0 10px}
  .header-actions .avatar span{display:none}
  .header-actions .avatar strong{overflow:hidden;text-overflow:ellipsis}
  #logout-button{padding:0 11px}
  .page{padding:12px}
  .panel,.stat-grid article{border-radius:14px;padding:16px}
  .welcome{border-radius:16px;padding:20px}
  .stat-grid,.finance-stats{grid-template-columns:1fr}
  .sales-layout{grid-template-columns:1fr}
  .checkout{position:static}
  .sales-order-toolbar,.sales-order-toolbar-actions,.panel-head,.receipt-log-head,.receipt-log-tools,.history-actions,.customer-toolbar,.customer-toolbar-actions,.account-page-actions,.button-row,.manual-actions,.delivery-photo-actions{align-items:stretch;flex-direction:column}
  .sales-order-toolbar-actions button,.customer-toolbar-actions button,.receipt-log-tools button,.history-actions button,.account-page-actions button,.button-row button,.manual-actions button,.delivery-photo-actions button{width:100%}
  .order-top,.delivery-info-grid,.manual-grid,.customer-form-grid,.receipt-customer-picker,.sample-order-panel{grid-template-columns:1fr!important}
  .item-entry-bar{display:grid;grid-template-columns:1fr;gap:10px}
  .search-box{min-height:48px;margin:10px 0}
  .sku-card{display:grid;grid-template-columns:72px 1fr;gap:12px}
  .sku-card .secondary{grid-column:1/-1;width:100%}
  .product-photo.large{width:72px;height:72px}
  .modal{padding:10px;place-items:start center;overflow:auto}
  .modal-card{width:100%;max-width:100%;max-height:none;margin:12px 0;padding:18px;border-radius:16px}
  .modal-head{gap:10px}
  .close{flex:0 0 38px}
  .toast{left:12px;right:12px;top:auto;bottom:18px;transform:translateY(18px);max-width:none;text-align:center;line-height:1.45;white-space:normal}
  .toast.show{transform:translateY(0)}
  .table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table-wrap table{min-width:720px}
  .account-table table,.receipt-log-table table,.history-table table,.staff-table table{min-width:760px}
  .record-actions,.receipt-actions,.customer-row-actions{white-space:normal}
  .record-actions button,.receipt-actions button,.customer-row-actions button{margin:3px;min-height:38px}
  .finance-period,.account-page-tabs,.receipt-view-tabs,.inventory-mode-tabs,.inventory-warehouse-tabs,.picking-warehouse-tabs,.date-presets{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}
  .finance-period-btn,.account-page-tab,.receipt-view,.inventory-mode-tab,.inventory-warehouse-tab,.picking-warehouse-tab{flex:0 0 auto;white-space:nowrap}
  .inventory-action-layout,.inventory-manual-grid,.inventory-scan-grid{grid-template-columns:1fr!important}
  .inventory-style-summary{display:grid;grid-template-columns:64px 1fr;gap:12px}
  .inventory-style-summary>div:not(.inventory-style-name),.inventory-style-summary .toggle-inventory-bom{grid-column:1/-1}
  .inventory-line-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .inventory-line-actions button{margin:0;min-width:0}
  .batch-list,.inventory-batch-list,.picking-batch-list{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .receipt-order-title,.receipt-order-title>div{align-items:flex-start;flex-direction:column}
  #receipt-modal .receipt-modal{max-height:calc(100vh - 20px)}
  #receipt-modal .allocation-preview{max-height:260px}
  #receipt-modal .button-row{margin:0 -18px;padding:12px 18px 16px}
}

@media(max-width:420px){
  .header-actions .avatar{max-width:116px}
  .page{padding:10px}
  .panel{padding:14px}
  .sku-card{grid-template-columns:58px 1fr}
  .product-photo.large{width:58px;height:58px;border-radius:14px}
  .table-wrap table{min-width:660px}
}

.inventory-manual-panel label:has(#manual-inventory-search),
.manual-inventory-search-field{
  position:relative;
}
.manual-inventory-suggestions{
  display:none;
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 6px);
  z-index:80;
  max-height:330px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  padding:7px;
  border:1px solid #cfe0d8;
  border-radius:14px;
  background:#1f1f1f;
  box-shadow:0 18px 36px rgba(13,37,28,.22);
}
.manual-inventory-suggestions.open{
  display:grid;
  gap:5px;
}
.manual-inventory-suggestions button{
  width:100%;
  min-height:54px;
  border:0;
  border-radius:10px;
  padding:10px 12px;
  text-align:left;
  background:transparent;
  color:white;
  cursor:pointer;
}
.manual-inventory-suggestions button:active,
.manual-inventory-suggestions button.active,
.manual-inventory-suggestions button:hover{
  background:rgba(255,255,255,.1);
}
.manual-inventory-suggestions strong,
.manual-inventory-suggestions span{
  display:block;
}
.manual-inventory-suggestions span{
  margin-top:5px;
  color:#cbd5d0;
  font-size:11px;
}
.manual-inventory-suggestions .suggest-stock{
  color:#7de0aa;
  font-weight:800;
}
.manual-inventory-suggestions p{
  margin:0;
  padding:10px 12px;
  color:#dbe7e1;
}

@media(max-width:760px){
  .inventory-manual-panel{
    overflow:visible;
  }
  .manual-inventory-suggestions{
    position:static;
    width:100%;
    max-height:260px;
    margin-top:6px;
    grid-column:1/-1;
  }
  .manual-inventory-suggestions button{
    min-height:62px;
    font-size:15px;
  }
  .inventory-manual-panel #execute-manual-inventory,
  .inventory-scan-panel #execute-inventory-scan,
  .inventory-batch-actions button,
  .inline-inventory-actions button,
  .pagination button{
    min-height:52px;
    font-size:16px;
  }
  .inventory-batch-actions,
  .inline-inventory-actions,
  .pagination{
    gap:10px;
    flex-wrap:wrap;
  }
  .inventory-batch-actions button,
  .inline-inventory-actions button{
    flex:1 1 150px;
  }
  .nav-item{
    min-height:48px;
  }
}

.mobile-workbench,
.mobile-action-bar{
  display:none;
}

@media(max-width:760px){
  body.mobile-workbench-enabled{
    padding-bottom:74px;
  }
  .mobile-workbench{
    display:block;
    margin:12px;
    padding:14px;
    border:1px solid #d9e8e0;
    border-radius:18px;
    background:#fff;
    box-shadow:0 8px 22px rgba(20,66,49,.08);
  }
  .mobile-workbench-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }
  .mobile-workbench-head span,
  .mobile-workbench-grid span{
    display:block;
    color:var(--muted);
    font-size:12px;
    margin-top:4px;
  }
  .mobile-workbench-head strong{
    display:block;
    font-size:17px;
  }
  .mobile-workbench-toggle{
    border:0;
    border-radius:12px;
    background:#eef6f2;
    color:var(--green);
    font-weight:900;
    padding:0 13px;
    min-height:40px;
  }
  .mobile-workbench.collapsed .mobile-warehouse-switch,
  .mobile-workbench.collapsed .mobile-workbench-grid{
    display:none;
  }
  .mobile-warehouse-switch{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding:12px 0 10px;
  }
  .mobile-warehouse-switch button{
    flex:1 0 auto;
    min-height:42px;
    border:0;
    border-radius:12px;
    padding:0 14px;
    background:#eef4f0;
    color:var(--green);
    font-weight:900;
  }
  .mobile-warehouse-switch button.active{
    background:var(--green);
    color:#fff;
  }
  .mobile-workbench-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .mobile-workbench-grid button{
    min-height:86px;
    border:1px solid #d9e8e0;
    border-radius:16px;
    padding:12px;
    text-align:left;
    background:#f8fbf9;
    color:var(--ink);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
  }
  .mobile-workbench-grid button strong{
    display:block;
    color:var(--green);
    font-size:17px;
  }
  .mobile-action-bar{
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:90;
    gap:8px;
    padding:8px;
    border:1px solid rgba(255,255,255,.35);
    border-radius:18px;
    background:rgba(18,42,33,.96);
    box-shadow:0 18px 40px rgba(0,0,0,.24);
  }
  .mobile-action-bar.open{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .mobile-action-bar button{
    min-height:50px;
    border:0;
    border-radius:13px;
    background:#fff;
    color:var(--green);
    font-size:15px;
    font-weight:900;
  }
  .mobile-action-bar button:last-child{
    background:#f2c463;
    color:#193126;
  }
  .inventory-batch-table table,
  .inventory-batch-table thead,
  .inventory-batch-table tbody,
  .inventory-batch-table tr,
  .inventory-batch-table td{
    display:block;
    width:100%;
    min-width:0!important;
  }
  .inventory-batch-table table{
    border-collapse:separate;
    border-spacing:0;
  }
  .inventory-batch-table thead{
    display:none;
  }
  .inventory-batch-table tr{
    margin:0 0 12px;
    padding:12px;
    border:1px solid #dfece5;
    border-radius:16px;
    background:#fff;
  }
  .inventory-batch-table td{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    align-items:center;
    gap:10px;
    padding:8px 0;
    border-bottom:1px solid #eef4f0;
  }
  .inventory-batch-table td:last-child{
    border-bottom:0;
  }
  .inventory-batch-table td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  .inventory-batch-table td:first-child{
    grid-template-columns:1fr;
  }
  .inventory-batch-table td:first-child::before{
    display:none;
  }
  .inventory-batch-table input{
    width:100%;
  }
  .inventory-batch-table .remove{
    width:100%;
    min-height:44px;
    border-radius:12px;
    background:#fff1f0;
  }
}

.mobile-sales-bar{
  display:none;
}

@media(max-width:760px){
  :root{
    --mobile-pad:12px;
  }
  body{
    background:#f3f7f4;
  }
  body.mobile-sales-open{
    padding-bottom:78px;
  }
  main{
    width:100%;
    overflow:hidden;
  }
  header{
    position:sticky;
    top:0;
    z-index:70;
    background:rgba(255,255,255,.96);
    box-shadow:0 6px 22px rgba(18,42,33,.08);
  }
  .page{
    overflow:hidden;
  }
  .panel{
    box-shadow:0 8px 24px rgba(20,66,49,.07);
  }
  .mobile-workbench{
    margin:10px var(--mobile-pad);
    padding:12px;
    border-radius:16px;
  }
  body[data-mobile-page="sales"] .mobile-workbench{
    display:none;
  }
  .mobile-workbench-grid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .mobile-workbench-grid button{
    min-height:74px;
    padding:10px;
    border-radius:14px;
  }
  .mobile-workbench-grid button strong{
    font-size:16px;
  }
  .mobile-workbench-grid button span{
    font-size:11px;
  }
  .toast{
    left:14px!important;
    right:14px!important;
    top:auto!important;
    bottom:86px!important;
    width:auto!important;
    max-width:none!important;
    min-height:0!important;
    max-height:96px!important;
    overflow:auto!important;
    transform:translateY(18px)!important;
    padding:12px 14px!important;
    border-radius:14px!important;
    font-size:14px!important;
    line-height:1.45!important;
    text-align:center!important;
    white-space:normal!important;
  }
  .toast.show{
    transform:translateY(0)!important;
  }
  .picking-task-card{
    padding:14px!important;
    border-radius:18px!important;
    overflow:hidden;
  }
  .picking-task-head{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  .picking-task-head h3{
    font-size:20px!important;
    line-height:1.25;
    word-break:break-word;
  }
  .picking-task-head p{
    line-height:1.55;
  }
  .picking-task-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:8px!important;
    width:100%;
  }
  .picking-task-actions button,
  .picking-task-actions .fulfillment-status,
  .picking-task-actions .readonly-badge{
    width:100%;
    min-height:48px;
    margin:0!important;
    display:flex!important;
    align-items:center;
    justify-content:center;
    border-radius:13px!important;
    font-size:15px;
  }
  .picking-task-actions .complete-picking{
    grid-column:1/-1;
    min-height:54px;
  }
  .picking-lines{
    overflow:visible!important;
  }
  .picking-lines table,
  .picking-lines thead,
  .picking-lines tbody,
  .picking-lines tr,
  .picking-lines td{
    display:block;
    width:100%;
    min-width:0!important;
  }
  .picking-lines thead{
    display:none;
  }
  .picking-lines tr{
    margin:10px 0 0;
    padding:10px;
    border:1px solid #e2eee8;
    border-radius:14px;
    background:#fff;
  }
  .picking-lines td{
    display:grid;
    grid-template-columns:70px minmax(0,1fr);
    align-items:center;
    gap:10px;
    padding:7px 0!important;
    border-bottom:1px solid #eef4f0;
  }
  .picking-lines td:last-child{
    border-bottom:0;
  }
  .picking-lines td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  .picking-lines td:first-child{
    grid-template-columns:1fr;
  }
  .picking-lines td:first-child::before{
    display:none;
  }
  .picking-thumb{
    width:58px;
    height:58px;
  }
  #sales .sales-layout{
    display:block;
  }
  #sales .sales-main-panel,
  #sales .sales-checkout{
    padding:14px;
    border-radius:18px;
  }
  #sales .sales-main-panel{
    margin-bottom:12px;
  }
  .sales-order-toolbar{
    gap:10px;
  }
  .sales-order-identity{
    width:100%;
    min-width:0;
  }
  .sales-order-identity strong{
    font-size:18px;
    word-break:break-word;
  }
  .sales-section-title{
    align-items:flex-start!important;
    gap:6px;
    margin-top:12px;
  }
  .delivery-info-grid,
  .order-top,
  .variant-picker,
  .manual-grid,
  .fee-entry{
    grid-template-columns:1fr!important;
  }
  .delivery-photo-field{
    grid-column:1/-1;
  }
  .item-entry-bar .search-box{
    margin:0;
  }
  #sku-result{
    grid-template-columns:64px 1fr!important;
    align-items:center;
  }
  #sku-result .product-photo{
    width:64px;
    height:64px;
  }
  .variant-panel,
  .manual-entry,
  .search-hint,
  .fee-toolbar,
  .fee-entry,
  #fee-lines,
  .sales-main-panel>.table-wrap,
  .sales-main-panel>.remark{
    border-radius:16px!important;
  }
  #order-lines,
  #order-lines tr,
  #order-lines td{
    display:block;
    width:100%;
  }
  #order-lines tr{
    margin:0 0 12px;
    padding:12px;
    border:1px solid #e1ece6;
    border-radius:16px;
    background:#fff;
  }
  #order-lines td{
    display:grid;
    grid-template-columns:78px minmax(0,1fr);
    align-items:center;
    gap:10px;
    padding:8px 0!important;
    border-bottom:1px solid #edf4f0;
  }
  #order-lines td:last-child{
    border-bottom:0;
  }
  #order-lines td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:12px;
    font-weight:900;
  }
  #order-lines .line-input,
  #order-lines input,
  #order-lines select{
    width:100%;
  }
  #order-lines .remove{
    width:100%;
    min-height:44px;
    border-radius:12px;
    background:#fff1f0;
  }
  .sales-main-panel>.table-wrap table{
    min-width:0!important;
  }
  .sales-main-panel>.table-wrap thead{
    display:none;
  }
  .sales-checkout{
    position:static!important;
  }
  .sales-checkout .wide{
    min-height:54px;
    font-size:16px;
  }
  .mobile-sales-bar{
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:92;
    gap:7px;
    padding:8px;
    border-radius:18px;
    background:rgba(18,42,33,.96);
    box-shadow:0 18px 40px rgba(0,0,0,.24);
  }
  .mobile-sales-bar.open{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .mobile-sales-bar button{
    min-height:48px;
    border:0;
    border-radius:13px;
    background:#fff;
    color:var(--green);
    font-size:13px;
    font-weight:900;
    padding:0 5px;
  }
  .mobile-sales-bar button:last-child{
    background:#f2c463;
    color:#193126;
  }
  .modal.open{
    align-items:flex-start;
  }
  .overview-modal,
  .history-editor-modal,
  .customer-orders-modal,
  #order-modal .modal-card.order-preview{
    width:100%!important;
    max-width:100%!important;
    max-height:none!important;
    border-radius:16px!important;
  }
  .order-overview,
  #order-modal .paper{
    max-height:none!important;
    overflow:visible!important;
  }
}

@media(max-width:390px){
  .mobile-workbench-grid button{
    min-height:68px;
  }
  .mobile-workbench-grid button strong{
    font-size:15px;
  }
  .picking-task-actions{
    grid-template-columns:1fr;
  }
  .mobile-sales-bar button{
    font-size:12px;
  }
}

/* Mobile UI v4 final guard: keep every phone screen vertical and readable. */
@media(max-width:760px){
  html,
  body,
  main,
  .page,
  .panel,
  .modal,
  .modal-card{
    max-width:100vw!important;
    overflow-x:hidden!important;
  }
  body.mobile-v4-active{
    width:100%;
    background:#f4f8f5;
    touch-action:pan-y;
  }
  body.mobile-v4-active main{
    margin-left:0!important;
  }
  body.mobile-v4-active .page.active{
    display:block;
    padding:10px!important;
  }
  body.mobile-v4-active .panel,
  body.mobile-v4-active .sales-main-panel,
  body.mobile-v4-active .sales-checkout,
  body.mobile-v4-active .inventory-scan-panel,
  body.mobile-v4-active .inventory-manual-panel,
  body.mobile-v4-active .inventory-batch-panel,
  body.mobile-v4-active .shortage-card,
  body.mobile-v4-active .picking-task-card,
  body.mobile-v4-active .product-style-card,
  body.mobile-v4-active .inventory-style-card{
    width:100%!important;
    max-width:100%!important;
    border-radius:18px!important;
  }
  body.mobile-v4-active input,
  body.mobile-v4-active select,
  body.mobile-v4-active textarea{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body.mobile-v4-active button{
    max-width:100%;
    white-space:normal;
  }

  body.mobile-v4-active .inventory-scan-panel,
  body.mobile-v4-active .inventory-manual-panel{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    padding:14px!important;
  }
  body.mobile-v4-active .inventory-scan-panel > *,
  body.mobile-v4-active .inventory-manual-panel > *,
  body.mobile-v4-active .manual-inventory-note{
    grid-column:1/-1!important;
    min-width:0!important;
  }
  body.mobile-v4-active .inventory-scan-panel .primary,
  body.mobile-v4-active .inventory-manual-panel .primary{
    width:100%!important;
    min-height:56px!important;
    font-size:17px!important;
  }
  body.mobile-v4-active .manual-inventory-suggestions{
    position:static!important;
    width:100%!important;
    max-height:260px!important;
    margin-top:8px!important;
  }
  body.mobile-v4-active .mobile-action-bar{
    left:8px!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom))!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.mobile-v4-active .mobile-action-bar button{
    min-width:0!important;
    padding:0 8px!important;
  }
  body.mobile-v4-active:has(.mobile-action-bar.open){
    padding-bottom:86px!important;
  }

  body.mobile-v4-active .history-table,
  body.mobile-v4-active .account-table,
  body.mobile-v4-active .customer-table,
  body.mobile-v4-active .staff-table,
  body.mobile-v4-active .receipt-log-table,
  body.mobile-v4-active .inventory-log-table,
  body.mobile-v4-active .inventory-batch-table,
  body.mobile-v4-active .inventory-summary-table,
  body.mobile-v4-active .product-sku-editor,
  body.mobile-v4-active .product-sku-list .table-wrap,
  body.mobile-v4-active .bom-table-wrap,
  body.mobile-v4-active .picking-lines{
    width:100%!important;
    overflow:visible!important;
    margin-left:0!important;
    margin-right:0!important;
  }
  body.mobile-v4-active .history-table table,
  body.mobile-v4-active .account-table table,
  body.mobile-v4-active .customer-table table,
  body.mobile-v4-active .staff-table table,
  body.mobile-v4-active .receipt-log-table table,
  body.mobile-v4-active .inventory-log-table table,
  body.mobile-v4-active .inventory-batch-table table,
  body.mobile-v4-active .inventory-summary-table table,
  body.mobile-v4-active .product-sku-editor table,
  body.mobile-v4-active .product-sku-table,
  body.mobile-v4-active .bom-table,
  body.mobile-v4-active .picking-lines table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
  }
  body.mobile-v4-active .history-table thead,
  body.mobile-v4-active .account-table thead,
  body.mobile-v4-active .customer-table thead,
  body.mobile-v4-active .staff-table thead,
  body.mobile-v4-active .receipt-log-table thead,
  body.mobile-v4-active .inventory-log-table thead,
  body.mobile-v4-active .inventory-batch-table thead,
  body.mobile-v4-active .inventory-summary-table thead,
  body.mobile-v4-active .product-sku-editor thead,
  body.mobile-v4-active .product-sku-table thead,
  body.mobile-v4-active .bom-table thead,
  body.mobile-v4-active .picking-lines thead{
    display:none!important;
  }
  body.mobile-v4-active .history-table tbody,
  body.mobile-v4-active .account-table tbody,
  body.mobile-v4-active .customer-table tbody,
  body.mobile-v4-active .staff-table tbody,
  body.mobile-v4-active .receipt-log-table tbody,
  body.mobile-v4-active .inventory-log-table tbody,
  body.mobile-v4-active .inventory-batch-table tbody,
  body.mobile-v4-active .inventory-summary-table tbody,
  body.mobile-v4-active .product-sku-editor tbody,
  body.mobile-v4-active .product-sku-table tbody,
  body.mobile-v4-active .bom-table tbody,
  body.mobile-v4-active .picking-lines tbody{
    display:grid!important;
    width:100%!important;
    gap:12px!important;
  }
  body.mobile-v4-active .history-table tr,
  body.mobile-v4-active .account-table tr,
  body.mobile-v4-active .customer-table tr,
  body.mobile-v4-active .staff-table tr,
  body.mobile-v4-active .receipt-log-table tr,
  body.mobile-v4-active .inventory-log-table tr,
  body.mobile-v4-active .inventory-batch-table tr,
  body.mobile-v4-active .inventory-summary-table tr,
  body.mobile-v4-active .product-sku-editor tr,
  body.mobile-v4-active .product-sku-table tr,
  body.mobile-v4-active .bom-table tr,
  body.mobile-v4-active .picking-lines tr{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:12px!important;
    border:1px solid #dfece5!important;
    border-radius:18px!important;
    background:#fff!important;
  }
  body.mobile-v4-active .history-table td,
  body.mobile-v4-active .account-table td,
  body.mobile-v4-active .customer-table td,
  body.mobile-v4-active .staff-table td,
  body.mobile-v4-active .receipt-log-table td,
  body.mobile-v4-active .inventory-log-table td,
  body.mobile-v4-active .inventory-batch-table td,
  body.mobile-v4-active .inventory-summary-table td,
  body.mobile-v4-active .product-sku-editor td,
  body.mobile-v4-active .product-sku-table td,
  body.mobile-v4-active .bom-table td,
  body.mobile-v4-active .picking-lines td{
    display:grid!important;
    grid-template-columns:86px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:42px!important;
    padding:8px 0!important;
    border:0!important;
    border-bottom:1px solid #eef4f0!important;
    word-break:break-word!important;
  }
  body.mobile-v4-active .history-table td:last-child,
  body.mobile-v4-active .account-table td:last-child,
  body.mobile-v4-active .customer-table td:last-child,
  body.mobile-v4-active .staff-table td:last-child,
  body.mobile-v4-active .receipt-log-table td:last-child,
  body.mobile-v4-active .inventory-log-table td:last-child,
  body.mobile-v4-active .inventory-batch-table td:last-child,
  body.mobile-v4-active .inventory-summary-table td:last-child,
  body.mobile-v4-active .product-sku-editor td:last-child,
  body.mobile-v4-active .product-sku-table td:last-child,
  body.mobile-v4-active .bom-table td:last-child,
  body.mobile-v4-active .picking-lines td:last-child{
    border-bottom:0!important;
  }
  body.mobile-v4-active .history-table td::before,
  body.mobile-v4-active .account-table td::before,
  body.mobile-v4-active .customer-table td::before,
  body.mobile-v4-active .staff-table td::before,
  body.mobile-v4-active .receipt-log-table td::before,
  body.mobile-v4-active .inventory-log-table td::before,
  body.mobile-v4-active .inventory-batch-table td::before,
  body.mobile-v4-active .inventory-summary-table td::before,
  body.mobile-v4-active .product-sku-editor td::before,
  body.mobile-v4-active .product-sku-table td::before,
  body.mobile-v4-active .bom-table td::before,
  body.mobile-v4-active .picking-lines td::before{
    content:attr(data-mobile-label)!important;
    color:var(--muted)!important;
    font-size:12px!important;
    font-weight:900!important;
    line-height:1.35!important;
  }
  body.mobile-v4-active .record-actions,
  body.mobile-v4-active .receipt-actions,
  body.mobile-v4-active .customer-row-actions,
  body.mobile-v4-active .product-sku-actions,
  body.mobile-v4-active .inventory-line-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    white-space:normal!important;
    width:100%!important;
  }
  body.mobile-v4-active .record-actions button,
  body.mobile-v4-active .receipt-actions button,
  body.mobile-v4-active .customer-row-actions button,
  body.mobile-v4-active .product-sku-actions button,
  body.mobile-v4-active .inventory-line-actions button{
    width:100%!important;
    margin:0!important;
  }

  body.mobile-v4-active .product-style-card{
    grid-template-columns:64px minmax(0,1fr)!important;
  }
  body.mobile-v4-active .product-style-actions,
  body.mobile-v4-active .product-center-actions{
    grid-template-columns:1fr 1fr!important;
  }
  body.mobile-v4-active .product-style-actions button,
  body.mobile-v4-active .product-center-actions button,
  body.mobile-v4-active .product-file-button{
    min-width:0!important;
    width:100%!important;
  }

  body.mobile-v4-active .modal.open{
    display:block!important;
    padding:0!important;
    overflow:auto!important;
  }
  body.mobile-v4-active .modal-card,
  body.mobile-v4-active .overview-modal,
  body.mobile-v4-active .history-editor-modal,
  body.mobile-v4-active .customer-orders-modal,
  body.mobile-v4-active .receipt-modal,
  body.mobile-v4-active .product-form-modal,
  body.mobile-v4-active #order-modal .modal-card.order-preview,
  body.mobile-v4-active #account-orders-modal .modal-card{
    width:100%!important;
    max-width:100%!important;
    min-height:100dvh!important;
    max-height:none!important;
    margin:0!important;
    padding:14px!important;
    border-radius:0!important;
    overflow:visible!important;
  }
  body.mobile-v4-active .modal-head{
    position:sticky!important;
    top:0!important;
    z-index:5!important;
    margin:-14px -14px 12px!important;
    padding:12px 14px!important;
    background:rgba(255,255,255,.97)!important;
    border-bottom:1px solid #e2ede7!important;
  }
  body.mobile-v4-active .modal-head h3{
    font-size:20px!important;
    line-height:1.25!important;
    word-break:break-word!important;
  }
  body.mobile-v4-active .close{
    flex:0 0 44px!important;
    width:44px!important;
    height:44px!important;
  }
  body.mobile-v4-active .paper,
  body.mobile-v4-active #order-modal .paper,
  body.mobile-v4-active .order-overview,
  body.mobile-v4-active .history-detail,
  body.mobile-v4-active .customer-order-bom{
    width:100%!important;
    max-width:100%!important;
    max-height:none!important;
    overflow:visible!important;
    padding:0!important;
    border:0!important;
  }
  body.mobile-v4-active #order-modal .paper h2,
  body.mobile-v4-active #order-modal .paper h3,
  body.mobile-v4-active #order-modal .paper p{
    text-align:left!important;
    word-break:break-word!important;
  }
  body.mobile-v4-active #order-modal .paper table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }

  body.mobile-v4-active .shortage-toolbar,
  body.mobile-v4-active .order-filters,
  body.mobile-v4-active .history-actions,
  body.mobile-v4-active .date-range{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  body.mobile-v4-active .date-presets,
  body.mobile-v4-active .shortage-tabs,
  body.mobile-v4-active .picking-status-list{
    width:100%!important;
    overflow-x:auto!important;
    padding-bottom:6px!important;
  }

  .mobile-copy-panel{
    display:none;
    position:fixed;
    inset:0;
    z-index:160;
    padding:14px;
    background:rgba(10,29,22,.58);
  }
  .mobile-copy-panel.open{
    display:grid;
    place-items:end center;
  }
  .mobile-copy-card{
    width:100%;
    padding:14px;
    border-radius:20px 20px 0 0;
    background:#fff;
    box-shadow:0 -18px 42px rgba(0,0,0,.18);
  }
  .mobile-copy-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
  }
  .mobile-copy-head strong{
    font-size:18px;
  }
  .mobile-copy-close{
    border:0;
    background:#eef6f2;
    color:var(--green);
    padding:0 14px;
  }
  .mobile-copy-card textarea{
    min-height:150px;
    line-height:1.6;
  }
  .mobile-copy-card p{
    margin:10px 0 0;
    color:var(--muted);
    font-size:13px;
  }
}

@media(max-width:420px){
  body.mobile-v4-active .product-style-actions,
  body.mobile-v4-active .product-center-actions,
  body.mobile-v4-active .mobile-action-bar.open{
    grid-template-columns:1fr!important;
  }
  body.mobile-v4-active:has(.mobile-action-bar.open){
    padding-bottom:200px!important;
  }
  body.mobile-v4-active .history-table td,
  body.mobile-v4-active .account-table td,
  body.mobile-v4-active .customer-table td,
  body.mobile-v4-active .staff-table td,
  body.mobile-v4-active .receipt-log-table td,
  body.mobile-v4-active .inventory-log-table td,
  body.mobile-v4-active .inventory-batch-table td,
  body.mobile-v4-active .inventory-summary-table td,
  body.mobile-v4-active .product-sku-editor td,
  body.mobile-v4-active .product-sku-table td,
  body.mobile-v4-active .bom-table td,
  body.mobile-v4-active .picking-lines td{
    grid-template-columns:74px minmax(0,1fr)!important;
  }
}

/* Mobile UI v5 refinements: shortage center, sales quick bar, order edit drawer. */
@media(max-width:760px){
  body.mobile-v4-active .shortage-list{
    display:grid!important;
    gap:12px!important;
  }
  body.mobile-v4-active .shortage-card{
    display:grid!important;
    grid-template-columns:64px minmax(0,1fr)!important;
    grid-template-areas:
      "photo main"
      "local local"
      "remote remote"
      "demand demand"
      "advice advice"
      "actions actions"!important;
    gap:12px!important;
    padding:14px!important;
    overflow:hidden!important;
  }
  body.mobile-v4-active .shortage-card > .product-thumb,
  body.mobile-v4-active .shortage-card > .product-thumb-empty{
    grid-area:photo!important;
    width:58px!important;
    height:58px!important;
    margin:0!important;
    border-radius:16px!important;
    align-self:start!important;
  }
  body.mobile-v4-active .shortage-main{
    grid-area:main!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    min-width:0!important;
    align-self:start!important;
  }
  body.mobile-v4-active .shortage-main .shortage-status{
    width:max-content!important;
    max-width:100%!important;
    padding:7px 10px!important;
    font-size:13px!important;
    line-height:1.2!important;
  }
  body.mobile-v4-active .shortage-main h4{
    margin:0!important;
    font-size:20px!important;
    line-height:1.25!important;
    word-break:break-word!important;
  }
  body.mobile-v4-active .shortage-main small{
    font-size:13px!important;
    line-height:1.45!important;
    word-break:break-word!important;
  }
  body.mobile-v4-active .shortage-qty-box{
    display:grid!important;
    grid-template-columns:1fr auto!important;
    gap:6px 10px!important;
    width:100%!important;
    min-height:0!important;
    padding:13px!important;
    border-radius:16px!important;
    margin:0!important;
  }
  body.mobile-v4-active .shortage-qty-box.local{grid-area:local!important}
  body.mobile-v4-active .shortage-qty-box.remote{grid-area:remote!important}
  body.mobile-v4-active .shortage-qty-box.demand,
  body.mobile-v4-active .shortage-qty-box.total{grid-area:demand!important}
  body.mobile-v4-active .shortage-qty-box span{
    font-size:15px!important;
  }
  body.mobile-v4-active .shortage-qty-box strong{
    font-size:24px!important;
    text-align:right!important;
  }
  body.mobile-v4-active .shortage-qty-box small{
    grid-column:1/-1!important;
    font-size:13px!important;
  }
  body.mobile-v4-active .shortage-advice{
    grid-area:advice!important;
    padding:13px!important;
    border-radius:16px!important;
    margin:0!important;
  }
  body.mobile-v4-active .shortage-advice span,
  body.mobile-v4-active .shortage-advice strong,
  body.mobile-v4-active .shortage-advice small{
    display:block!important;
    line-height:1.55!important;
  }
  body.mobile-v4-active .shortage-advice strong{
    font-size:16px!important;
    word-break:break-word!important;
  }
  body.mobile-v4-active .shortage-actions{
    grid-area:actions!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    margin:0!important;
  }
  body.mobile-v4-active .shortage-actions button{
    width:100%!important;
    min-height:52px!important;
    font-size:16px!important;
  }

  .mobile-v4-sales-bar{
    display:none;
    position:fixed;
    left:10px;
    right:10px;
    bottom:calc(10px + env(safe-area-inset-bottom));
    z-index:118;
    gap:8px;
    padding:8px;
    border-radius:18px;
    background:rgba(18,42,33,.96);
    box-shadow:0 18px 40px rgba(0,0,0,.25);
  }
  .mobile-v4-sales-bar.open{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .mobile-v4-sales-bar button{
    min-height:50px;
    border:0;
    border-radius:14px;
    background:#fff;
    color:var(--green);
    font-weight:900;
    font-size:14px;
    padding:0 6px;
  }
  .mobile-v4-sales-bar button:last-child{
    background:#f2c463;
    color:#183126;
  }
  body.mobile-v4-sales-bar-open{
    padding-bottom:86px!important;
  }
  body.mobile-v4-sales-bar-open .toast{
    bottom:calc(92px + env(safe-area-inset-bottom))!important;
  }

  body.mobile-v4-active .history-editor-modal .history-detail{
    display:grid!important;
    gap:12px!important;
    padding:0!important;
  }
  body.mobile-v4-active .history-editor-modal .detail-edit-grid,
  body.mobile-v4-active .history-editor-modal .order-edit-header{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    padding:12px!important;
    border-radius:18px!important;
  }
  body.mobile-v4-active .history-editor-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    align-items:stretch!important;
  }
  body.mobile-v4-active .history-editor-toolbar button,
  body.mobile-v4-active .history-editor-toolbar .history-total{
    width:100%!important;
    min-height:50px!important;
    justify-content:center!important;
  }
  body.mobile-v4-active .history-edit-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  body.mobile-v4-active .history-edit-table thead{
    display:none!important;
  }
  body.mobile-v4-active .history-edit-table tbody{
    display:grid!important;
    gap:0!important;
    width:100%!important;
  }
  body.mobile-v4-active .history-edit-table tr{
    display:block!important;
    width:100%!important;
    padding:12px!important;
    border:1px solid #dfece5!important;
    border-radius:18px!important;
    background:#fff!important;
  }
  body.mobile-v4-active .history-edit-table .history-data-row{margin-bottom:12px!important}
  body.mobile-v4-active .history-edit-table .history-field-hint{height:auto!important;min-height:18px!important;margin-bottom:5px!important}
  body.mobile-v4-active .history-edit-table td{
    display:grid!important;
    grid-template-columns:86px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
    width:100%!important;
    min-height:48px!important;
    padding:8px 0!important;
    border:0!important;
    border-bottom:1px solid #eef4f0!important;
  }
  body.mobile-v4-active .history-edit-table td:last-child{
    border-bottom:0!important;
  }
  body.mobile-v4-active .history-edit-table td::before{
    content:attr(data-mobile-label)!important;
    color:var(--muted)!important;
    font-size:12px!important;
    font-weight:900!important;
  }
  body.mobile-v4-active .history-edit-table input,
  body.mobile-v4-active .history-edit-table select{
    min-width:0!important;
    width:100%!important;
    min-height:48px!important;
    font-size:16px!important;
  }
  body.mobile-v4-active .history-edit-table .he-amount{
    font-size:18px!important;
  }
  body.mobile-v4-active .history-edit-table .he-remove{
    width:100%!important;
    min-height:48px!important;
  }
  body.mobile-v4-active .history-editor-modal .button-row{
    position:sticky!important;
    bottom:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    margin:0 -14px -14px!important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.98)!important;
    border-top:1px solid #e2ede7!important;
  }
  body.mobile-v4-active .history-editor-modal .button-row button{
    width:100%!important;
    min-height:52px!important;
  }
}

/* Mobile inventory search suggestions: keep dense SKU lists readable. */
.manual-inventory-suggestions.open{
  align-content:start;
}
.manual-inventory-suggestions button{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
  min-height:auto;
  height:auto;
  line-height:1.35;
}
.manual-inventory-suggestions strong{
  font-size:15px;
  line-height:1.35;
  white-space:normal;
  word-break:break-word;
}
.manual-inventory-suggestions span{
  line-height:1.35;
  white-space:normal;
  word-break:break-word;
}
.manual-inventory-suggestions .suggest-stock{
  margin-top:2px;
  line-height:1.4;
  white-space:normal;
}
@media(max-width:760px){
  .manual-inventory-suggestions,
  body.mobile-v4-active .manual-inventory-suggestions{
    max-height:min(42vh,360px)!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  .manual-inventory-suggestions.open,
  body.mobile-v4-active .manual-inventory-suggestions.open{
    display:grid!important;
    gap:8px!important;
  }
  .manual-inventory-suggestions button,
  body.mobile-v4-active .manual-inventory-suggestions button{
    min-height:96px!important;
    padding:13px 14px!important;
    line-height:1.35!important;
  }
  .manual-inventory-suggestions strong,
  body.mobile-v4-active .manual-inventory-suggestions strong{
    font-size:16px!important;
    line-height:1.35!important;
  }
  .manual-inventory-suggestions span,
  body.mobile-v4-active .manual-inventory-suggestions span{
    font-size:12px!important;
    line-height:1.4!important;
  }
  .manual-inventory-suggestions .suggest-stock,
  body.mobile-v4-active .manual-inventory-suggestions .suggest-stock{
    font-size:13px!important;
    line-height:1.45!important;
  }
}

@media(max-width:420px){
  .mobile-v4-sales-bar.open{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.mobile-v4-sales-bar-open{
    padding-bottom:140px!important;
  }
  body.mobile-v4-active .shortage-card{
    grid-template-columns:58px minmax(0,1fr)!important;
  }
  body.mobile-v4-active .history-edit-table td{
    grid-template-columns:76px minmax(0,1fr)!important;
  }
}

.inventory-action-product-line{display:block;font-size:13px;font-weight:700;color:var(--ink);line-height:1.45;white-space:normal}

@media (min-width:721px) and (max-width:1180px){
  html,body{max-width:100%;overflow-x:hidden}
  main,.page,.panel,.card,.sales-main-panel,.sales-layout,.product-center,.product-style-list{max-width:100%;min-width:0;overflow-x:hidden}
  .page{padding:20px}
  .sales-layout{grid-template-columns:minmax(0,1fr)!important}
  .sales-checkout,.checkout{position:static!important;width:100%;max-width:100%;top:auto}
  .sales-main-panel>.order-top{grid-template-columns:repeat(2,minmax(0,1fr))}
  .product-style-card{grid-template-columns:72px minmax(0,1fr) minmax(140px,.55fr);max-width:100%;overflow:hidden}
  .product-style-actions{grid-column:1/-1;justify-content:flex-start;flex-wrap:wrap}
  .product-sku-list{max-width:100%;min-width:0;overflow-x:auto}
  .product-sku-list .table-wrap,.product-sku-editor,.inventory-style-bom{max-width:100%;overflow-x:auto}
  .product-sku-list table{min-width:980px;width:max-content}
  .product-inline-input{min-width:72px}
  .sku-card,.variant-panel,.search-result,.inventory-style-card,.inventory-style-summary{max-width:100%;min-width:0}
}

@media (hover:none) and (pointer:coarse) and (min-width:721px){
  html,
  body{
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  main{
    width:auto!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  .page,
  .panel,
  .card,
  .sales-main-panel,
  .sales-layout,
  .search-result,
  .variant-panel,
  .sku-card,
  .inventory-style-card,
  .inventory-style-summary,
  .product-style-card{
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
  }
  .sales-layout{
    display:block!important;
  }
  .sales-checkout,
  .checkout{
    position:static!important;
    width:100%!important;
    max-width:100%!important;
    margin:16px 0 0!important;
    transform:none!important;
  }
  .sales-main-panel>.order-top,
  .variant-grid,
  .quick-style-grid,
  .manual-product-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
  }
  .variant-panel,
  .quick-style-panel{
    padding:14px!important;
  }
  .variant-panel input,
  .variant-panel select,
  .quick-style-panel input,
  .quick-style-panel select,
  .manual-product-grid input,
  .manual-product-grid select{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .sales-line-table,
  .table-wrap,
  .product-sku-list,
  .product-sku-editor,
  .inventory-style-bom{
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .sales-line-table table,
  .table-wrap table{
    width:max-content!important;
    min-width:760px!important;
  }
  .product-style-card{
    grid-template-columns:76px minmax(0,1fr)!important;
  }
  .product-style-actions,
  .product-style-stock{
    grid-column:1/-1!important;
    justify-content:flex-start!important;
    flex-wrap:wrap!important;
  }
}

/* Picking task cards: clearer order, customer, status, and exception hierarchy. */
.picking-task-card{
  position:relative;
  overflow:hidden;
  border-radius:8px;
  border-color:#dbe7e0;
  border-left:4px solid #2a7b5d;
  box-shadow:0 5px 16px rgba(24,52,40,.045);
}
.picking-task-card.partial{border-left-color:#d88722;background:#fffdfa}
.picking-task-card.done{border-left-color:#8aa398;background:#fbfdfc}
.picking-task-summary{min-width:0;display:grid;gap:8px;flex:1}
.picking-task-badges{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.picking-warehouse-badge,.picking-status-badge{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  line-height:1;
  font-weight:900;
  white-space:nowrap;
}
.picking-warehouse-badge{background:#eef3f0;color:#486257;border:1px solid #dde8e2}
.picking-status-badge.pending{background:#fff2dd;color:#a75c08;border:1px solid #f2d39d}
.picking-status-badge.partial{background:#fff0e7;color:#b6531b;border:1px solid #f0c5aa}
.picking-status-badge.done{background:#e7f4ed;color:#176b4d;border:1px solid #cce5d8}
.picking-task-identity{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.picking-task-head .picking-order-number{
  margin:0;
  color:#10231b;
  font-size:21px;
  line-height:1.25;
  font-weight:950;
}
.picking-customer-name{
  color:#176b4d;
  font-size:16px;
  line-height:1.25;
  font-weight:900;
}
.picking-task-meta{display:flex;align-items:center;gap:0;flex-wrap:wrap;color:#748178;font-size:12px}
.picking-task-meta span,.picking-task-meta time{display:inline-flex;align-items:center;white-space:nowrap}
.picking-task-meta span+span:before,.picking-task-meta span+time:before,.picking-task-meta time:before{
  content:"";
  width:3px;
  height:3px;
  margin:0 8px;
  border-radius:50%;
  background:#aebbb4;
}
.picking-lines{margin-top:16px;border-top:1px solid #e6eee9;padding-top:4px}
.picking-lines th{color:#758279;font-weight:800;background:#fbfdfc}
.picking-lines tbody tr:hover{background:#f8fbf9}
.picking-stock-hint.shortage{background:#fff0e8;color:#b94f1d;box-shadow:inset 0 0 0 1px #f2c6b0}

@media(max-width:900px){
  .picking-task-card{border-left-width:3px}
  .picking-task-head .picking-order-number{font-size:19px}
  .picking-customer-name{font-size:15px}
}

@media(max-width:560px){
  .picking-task-identity{display:grid;gap:5px}
  .picking-task-meta{line-height:1.8}
  .picking-task-actions{justify-content:stretch}
  .picking-task-actions button{flex:1}
}
.bulk-select-bar{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:42px;
  margin:12px 0;
  padding:8px 12px;
  border:1px solid #dce8e2;
  border-radius:10px;
  background:#f7fbf9;
  color:#52645c;
}
.bulk-select-control{display:inline-flex;align-items:center;gap:8px;font-weight:700;cursor:pointer}
.bulk-select-control input,.record-select,.selection-column input{width:18px;height:18px;accent-color:#176b4d;cursor:pointer}
.bulk-select-control input:disabled{cursor:not-allowed;opacity:.5}
.bulk-action-group{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-left:auto}
.bulk-action-button{margin-left:0;min-height:38px;padding:9px 14px;white-space:nowrap}
.bulk-action-button:disabled{cursor:not-allowed;opacity:.45}
.selection-column{width:52px;text-align:center}
.customer-table td.selection-column{text-align:center}
.picking-card-select,.shortage-card-select{display:flex;align-items:flex-start;justify-content:center;padding-top:4px}
.picking-task-card.selection-active,.shortage-card.selection-active{outline:2px solid #2b8a68;outline-offset:-2px}

@media(max-width:760px){
  .bulk-select-bar{align-items:center;flex-wrap:wrap}
  .bulk-action-group{width:100%;margin-left:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .bulk-action-button{width:100%;margin-left:0;min-height:46px}
  body.mobile-v4-active .shortage-card{
    grid-template-columns:36px 64px minmax(0,1fr)!important;
    grid-template-areas:
      "select photo main"
      "local local local"
      "remote remote remote"
      "demand demand demand"
      "advice advice advice"
      "actions actions actions"!important;
  }
  body.mobile-v4-active .shortage-card-select{grid-area:select!important;align-self:start!important}
  body.mobile-v4-active .bulk-select-control input,
  body.mobile-v4-active .record-select{width:22px!important;min-height:22px!important;height:22px!important}
}
.picking-log-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;white-space:nowrap}
.picking-log-actions .secondary,.picking-log-actions .danger-btn{min-height:38px;padding:9px 13px;border-radius:11px;font-weight:900;white-space:nowrap}

/* Keep the record/customer destructive bulk action anchored to the toolbar edge. */
#batch-delete-orders,
#batch-delete-customers{
  width:auto;
  margin-left:auto;
}

/* Public-site compliance and production login security. */
.login-compliance{
  margin-top:18px;
  padding-top:15px;
  border-top:1px solid var(--line);
  text-align:center;
  font-size:12px;
}
.login-compliance a{
  color:#5f746a;
  text-decoration:none;
}
.login-compliance a:hover,
.login-compliance a:focus-visible{
  color:var(--green);
  text-decoration:underline;
}
.server-state .sidebar-icp{
  display:block;
  margin:3px 0 0 16px;
  color:#8faf9f;
  font-size:11px;
  line-height:1.45;
  text-decoration:none;
}
.server-state .sidebar-icp:hover,
.server-state .sidebar-icp:focus-visible{
  color:#fff;
  text-decoration:underline;
}
