/* =========================================================
   通单宝 · 批发开单管理
   ========================================================= */
:root {
  --ink: #17342c;
  --ink-2: #24453b;
  --sidebar: #12362d;
  --sidebar-deep: #0d2b23;
  --paper: #f4f1ea;
  --paper-2: #ece7dc;
  --card: #fffefb;
  --line: #e5dfd2;
  --line-strong: #d7cfbf;
  --text: #26332d;
  --muted: #7c857e;
  --muted-2: #a2a89f;
  --green: #0e7a5c;
  --green-2: #0a6048;
  --green-soft: #e4f4ec;
  --amber: #b9791f;
  --amber-soft: #fbf0da;
  --red: #bf4a3d;
  --red-soft: #fbeae7;
  --blue: #3f6f8c;
  --blue-soft: #e8f1f6;
  --gold: #e8b45f;
  --gold-soft: #f7e8c9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(36, 45, 36, 0.04), 0 4px 12px rgba(36, 45, 36, 0.04);
  --shadow-md: 0 18px 50px rgba(23, 42, 34, 0.12);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 78% -10%, rgba(232, 180, 95, 0.09), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(14, 122, 92, 0.05), transparent 60%),
    var(--paper);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
::selection { background: var(--gold-soft); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none;
  background:
    radial-gradient(400px 260px at 20% 0%, rgba(232, 180, 95, 0.12), transparent 65%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
  color: #f3efe4;
  display: flex; flex-direction: column;
  padding: 22px 16px 18px;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
  overflow-y: auto; overscroll-behavior: contain;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 19px; letter-spacing: 3px; color: #fffdf6; font-weight: 700; }
.brand-text span { font-size: 10.5px; color: rgba(243, 239, 228, 0.55); letter-spacing: 2px; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 10.5px; letter-spacing: 2.5px; color: rgba(243, 239, 228, 0.35); padding: 8px 12px 6px; }
.nav-label-2 { margin-top: 16px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(243, 239, 228, 0.72);
  font-size: 14px; letter-spacing: .4px;
  transition: background .15s, color .15s, transform .15s;
  position: relative;
}
.nav-item .icon { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: var(--gold); color: var(--ink); font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.nav-item.active .icon { opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.save-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: rgba(243,239,228,.65);
  background: rgba(255,255,255,.06); padding: 5px 10px; border-radius: 999px;
}
.save-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #65c9a1; box-shadow: 0 0 0 3px rgba(101,201,161,.12); }
.save-pill.saving .dot { background: var(--gold); animation: pulse 1s infinite; }
.save-pill.error .dot { background: #ef6d60; }
@keyframes pulse { 50% { opacity: .3; } }
.sidebar-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 10.5px; color: rgba(243,239,228,.38); line-height: 1.5; }
.sidebar-note .icon { width: 13px; height: 13px; margin-top: 1px; }
.version { font-size: 10px; color: rgba(243,239,228,.22); margin-top: 10px; letter-spacing: .5px; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { padding: 30px 34px 60px; max-width: 1480px; width: 100%; margin: 0 auto; outline: none; }
.mobile-top { display: none; }
.scrim { display: none; }

/* ---------- Typography / page head ---------- */
.eyebrow { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--amber); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--gold); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.15; margin: 5px 0 4px; letter-spacing: -.6px; color: var(--ink); font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; margin: 0; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 17px; color: var(--ink); margin: 0; letter-spacing: .2px; }
h3 { font-size: 15px; color: var(--ink); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.money { font-family: var(--num); font-variant-numeric: tabular-nums; }
.money::before { content: "¥"; font-size: .78em; margin-right: 1px; opacity: .75; }
.danger-text { color: var(--red); }
.green-text { color: var(--green); }
.amber-text { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { background: #fbf9f3; border-color: #c9c0ae; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(14, 122, 92, .2); }
.btn-primary:hover { background: var(--green-2); border-color: var(--green-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); box-shadow: 0 4px 12px rgba(196, 137, 42, .2); }
.btn-gold:hover { background: #dfa84a; border-color: #dfa84a; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #0e2720; border-color: #0e2720; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(23, 52, 44, .06); color: var(--ink); border-color: transparent; }
.btn-outline { background: transparent; }
.btn-danger { color: var(--red); border-color: #eccbc5; background: #fff; }
.btn-danger:hover { background: var(--red-soft); border-color: #e3b1a8; }
.btn-sm { height: 32px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; gap: 5px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(23,52,44,.06); color: var(--ink); }
.icon-btn .icon { width: 18px; height: 18px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--green); font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.link-btn:hover { text-decoration: underline; }
.link-btn .icon { width: 14px; height: 14px; }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.section-head .hint { font-size: 12px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .3px; line-height: 1.6; white-space: nowrap; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-self { background: var(--green-soft); color: #0a6b50; }
.badge-purchase { background: var(--amber-soft); color: #a36716; }
.badge-gray { background: #f0eee8; color: #7c8078; }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-gold { background: var(--gold-soft); color: #8d6217; }
.type-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.type-dot.self { background: var(--green); box-shadow: 0 0 0 3px rgba(14,122,92,.12); }
.type-dot.purchase { background: var(--amber); box-shadow: 0 0 0 3px rgba(185,121,31,.13); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 12px; color: #59645d; font-weight: 600; letter-spacing: .3px; display: flex; align-items: center; gap: 5px; }
.field .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fffdf9; border-radius: 9px;
  padding: 9px 12px; height: 38px; font-size: 13.5px; color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 70px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(14,122,92,.1); background: #fff; }
.input::placeholder, .textarea::placeholder { color: #b5b7ad; }
.input-lg { height: 46px; font-size: 15px; border-radius: 11px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c857e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field-note { font-size: 11px; color: var(--muted-2); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .input { flex: 1; }
.input-group .select { flex: 1; min-width: 0; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--green); width: 16px; height: 16px; }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search-box .input { padding-left: 40px; }
.search-box .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- Tabs / segmented ---------- */
.segmented { display: inline-flex; background: #eee9dd; border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 12.5px; color: #6c756e; font-weight: 500;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { border: 0; background: none; padding: 10px 2px 12px; color: var(--muted); font-size: 14px; position: relative; font-weight: 500; }
.tab.active { color: var(--ink); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--green); }
.tab .count { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-box { width: 300px; max-width: 100%; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  border-radius: 999px; height: 32px; padding: 0 13px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: #bcb3a1; color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .swatch { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Empty ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 54px; height: 54px; border-radius: 16px; background: #f2eee5; color: #a8a293; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.empty .empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.empty p { margin: 0 0 16px; font-size: 12.5px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); }
.stat-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-ic .icon { width: 19px; height: 19px; }
.stat-ic.green { background: var(--green-soft); color: var(--green); }
.stat-ic.amber { background: var(--amber-soft); color: var(--amber); }
.stat-ic.blue { background: var(--blue-soft); color: var(--blue); }
.stat-ic.gold { background: var(--gold-soft); color: #8d6217; }
.stat-val { font-family: var(--num); font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--ink); letter-spacing: -.3px; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- Style list ---------- */
.style-list { display: flex; flex-direction: column; gap: 8px; }
.style-row {
  display: grid; grid-template-columns: 58px minmax(160px, 1.25fr) 120px 130px 110px 132px;
  gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 10px 14px 10px 10px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative;
}
.style-row:hover { border-color: #cdc4b1; box-shadow: 0 8px 24px rgba(36,45,36,.07); transform: translateY(-1px); }
.style-row.is-zero { opacity: .78; }
.thumb { width: 58px; height: 68px; border-radius: 9px; object-fit: cover; background: #f0ece2; border: 1px solid rgba(0,0,0,.04); flex: none; }
.thumb-wrap { width: 58px; height: 68px; position: relative; flex: none; }
.thumb-fallback { width: 100%; height: 100%; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #ede7da, #f7f4ec); color: #a9a190; font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.row-main { min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-source { font-size: 10px; color: #69766d; background: #f4f1e9; border: 1px solid #e8e2d5; border-radius: 5px; padding: 1px 6px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-source .muted { color: var(--muted); }
.row-title .no { font-family: var(--num); font-size: 15.5px; font-weight: 700; letter-spacing: .4px; color: var(--ink); }
.row-name { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips-mini { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.chips-mini span { font-size: 10px; background: #f2eee5; color: #7c7c70; padding: 1px 6px; border-radius: 4px; }
.row-supplier { font-size: 12px; color: #5d675f; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-supplier .wx { color: var(--muted-2); font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-stock { text-align: right; }
.stock-num { font-family: var(--num); font-size: 19px; font-weight: 600; color: var(--ink); }
.stock-num small { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stock-zero { color: var(--red); }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; opacity: .3; transition: opacity .15s; }
.style-row:hover .row-actions { opacity: 1; }
.type-line { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.type-line.self { color: var(--green); }
.type-line.purchase { color: var(--amber); }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 346px; gap: 22px; align-items: start; }
.pos-main { min-width: 0; }
.pos-search { position: relative; margin-bottom: 18px; z-index: 12; }
.pos-search .input {
  height: 54px; border-radius: 14px; font-size: 16px; padding-left: 46px; padding-right: 130px;
  background: #fffdf9; border-color: var(--line-strong); box-shadow: var(--shadow-sm);
}
.pos-search .icon { position: absolute; top: 50%; left: 16px; transform: translateY(-50%); width: 21px; height: 21px; color: var(--muted); pointer-events: none; }
.pos-search .search-hint { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; }
.search-results {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 6px; max-height: 410px; overflow: auto; display: none;
}
.search-results.open { display: block; animation: dropIn .14s ease-out; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-5px); } }
.result-row { display: flex; gap: 11px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.result-row:hover, .result-row.active { background: #f6f2e9; }
.result-row .thumb { width: 42px; height: 50px; border-radius: 7px; }
.result-info { flex: 1; min-width: 0; }
.result-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.result-title .no { font-family: var(--num); font-weight: 700; font-size: 14px; letter-spacing: .4px; }
.result-title .no mark { background: var(--gold-soft); color: inherit; padding: 0 2px; border-radius: 2px; }
.result-sub { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-stock { text-align: right; font-size: 10.5px; color: var(--muted); flex: none; }
.result-stock b { display: block; font-family: var(--num); font-size: 14px; color: var(--ink); }
.search-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

.customer-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(100deg, #fffdf8, #faf7ef);
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px; margin-bottom: 14px;
}
.customer-strip .field { flex-direction: row; align-items: center; gap: 8px; flex: 1; min-width: 160px; }
.customer-strip .field-label { flex: none; }
.customer-strip .input { border: 0; background: transparent; height: 30px; padding: 0 2px; font-size: 13.5px; border-bottom: 1px dashed transparent; border-radius: 0; }
.customer-strip .input:focus { box-shadow: none; border-bottom-color: var(--green); background: transparent; }
.customer-strip .sep { width: 1px; height: 20px; background: var(--line); }
.customer-strip .mini-order { font-family: var(--num); font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.customer-picker { position: relative; flex: 1; min-width: 0; }
.customer-picker > .input { width: 100%; }
.customer-results {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 35;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 5px; max-height: 300px; overflow: auto; display: none;
}
.customer-results.open { display: block; animation: dropIn .14s ease-out; }
.customer-result { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; cursor: pointer; }
.customer-result:hover, .customer-result.active { background: #f6f2e9; }
.customer-result .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.customer-result .info { flex: 1; min-width: 0; }
.customer-result .name { font-size: 12.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 5px; }
.customer-result .meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-result .star { color: var(--amber); }
.customer-result .star .icon { width: 12px; height: 12px; fill: currentColor; }
.customer-empty { padding: 14px; text-align: center; font-size: 11.5px; color: var(--muted); }

.cart-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.cart-head .left { display: flex; align-items: baseline; gap: 9px; }
.cart-head h2 { font-size: 15px; }
.cart-head .count-pill { font-size: 11px; color: var(--muted); background: #ece7dc; border-radius: 999px; padding: 1px 8px; }
.cart-list { display: flex; flex-direction: column; gap: 12px; min-height: 30px; }
.cart-empty { border: 1.5px dashed var(--line-strong); border-radius: 16px; padding: 46px 20px; text-align: center; background: rgba(255,255,255,.4); }
.cart-empty .big-plus { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: var(--muted); }
.cart-empty h3 { font-size: 14px; margin-bottom: 3px; }
.cart-empty p { font-size: 12px; color: var(--muted); margin: 0; }

.cart-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; box-shadow: var(--shadow-sm); }
.cart-top { display: flex; gap: 12px; padding: 13px 15px; align-items: flex-start; border-bottom: 1px solid #f0ece2; }
.cart-top .thumb { width: 46px; height: 55px; border-radius: 8px; }
.cart-title { flex: 1; min-width: 0; }
.cart-title .line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-title .no { font-family: var(--num); font-size: 15px; font-weight: 700; letter-spacing: .4px; }
.cart-title .name { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cart-price { display: flex; align-items: center; gap: 5px; flex: none; }
.cart-price .cur { font-size: 12px; color: var(--muted); }
.cart-price input { width: 78px; height: 32px; border: 1px solid var(--line-strong); background: #fffdf9; border-radius: 7px; padding: 0 8px; font-family: var(--num); font-size: 13.5px; text-align: right; }
.cart-price input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(14,122,92,.09); }
.cart-remove { color: var(--muted-2); }
.cart-remove:hover { color: var(--red); background: var(--red-soft); }

.matrix-scroll { overflow-x: auto; }
.matrix-mobile-hint { display: none; }
.hand-btn.hand-inline { display: none; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 480px; }
.matrix th, .matrix td { padding: 7px 5px; text-align: center; }
.matrix thead th { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .5px; padding-top: 10px; padding-bottom: 6px; background: #fcfaf5; }
.matrix thead th.color-col { text-align: left; padding-left: 15px; }
.matrix .color-head { text-align: left; padding-left: 15px; min-width: 118px; position: sticky; left: 0; background: var(--card); z-index: 2; border-right: 1px solid #f2eee5; }
.color-head .cname { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.swatch { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: none; }
.color-head small { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; font-weight: 400; margin-left: 16px; }
.matrix tbody tr:hover td { background: #fdfbf7; }
.matrix tbody tr:hover .color-head { background: #fdfbf7; }
.qty-cell { vertical-align: middle; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.stepper button { width: 22px; height: 30px; border: 0; background: transparent; color: #8a9087; display: flex; align-items: center; justify-content: center; padding: 0; }
.stepper button:hover { background: #f2eee5; color: var(--ink); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper .icon { width: 13px; height: 13px; }
.stepper input { width: 34px; border: 0; text-align: center; font-family: var(--num); font-size: 13.5px; font-weight: 600; height: 30px; padding: 0; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: #f6fbf8; }
.stock-hint { display: block; font-size: 9px; color: var(--muted-2); margin-top: 2px; }
.stock-hint.low { color: var(--red); }
.qty-cell.over .stepper { border-color: #d98d81; background: #fdf2f0; box-shadow: 0 0 0 2px rgba(191, 74, 61, .08); }
.qty-cell.over .stock-hint { color: var(--red); }
.cart-card.flash { animation: cardFlash 0.9s ease-out; }
@keyframes cardFlash { 0% { box-shadow: 0 0 0 3px rgba(14,122,92,.35); } 100% { box-shadow: var(--shadow-sm); } }
.hand-btn {
  border: 1px dashed #c9bfa9; color: #8b6a2c; background: #fdf9ef;
  height: 28px; padding: 0 8px; border-radius: 7px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 2px;
}
.hand-btn:hover { background: var(--gold-soft); border-color: #d3a64e; color: #7c5713; }
.hand-btn .icon { width: 12px; height: 12px; }
.hand-col { width: 74px; }
.cart-foot { display: flex; align-items: center; justify-content: space-between; padding: 9px 15px; background: #fbf8f1; border-top: 1px solid #f0ece2; gap: 10px; flex-wrap: wrap; }
.cart-foot .totals { font-size: 11.5px; color: var(--muted); display: flex; gap: 14px; align-items: center; }
.cart-foot .totals b { color: var(--ink); font-family: var(--num); font-size: 13px; }
.cart-foot .quick { display: flex; gap: 4px; }

/* checkout side */
.pos-side { position: sticky; top: 24px; }
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(30,42,34,.08); overflow: visible; }
.ticket-head { padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; }
.ticket-head .t { font-size: 12px; letter-spacing: 2px; color: var(--muted); font-weight: 600; }
.ticket-head .order-no { font-family: var(--num); font-size: 10.5px; color: var(--muted-2); letter-spacing: .5px; }
.ticket-body { padding: 0 18px 16px; }
.ticket-customer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ticket-customer .input { height: 34px; font-size: 12.5px; padding: 0 9px; }
.ticket-customer .add-customer-btn { height: 32px; font-size: 12px; justify-content: center; }
.ticket-customer .full { grid-column: 1 / -1; }
.summary-lines { border-top: 1px dashed var(--line-strong); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sum-line { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #5d675f; gap: 12px; }
.sum-line .v { font-family: var(--num); font-size: 13px; color: var(--ink); }
.sum-line.discount .input { width: 92px; height: 30px; text-align: right; padding: 0 8px; font-family: var(--num); }
.sum-line.receivable { border-top: 1px dashed var(--line-strong); margin-top: 3px; padding-top: 11px; }
.sum-line.receivable .v { font-size: 25px; font-weight: 700; color: var(--green); letter-spacing: -.4px; }
.sum-line.receivable .v::before { font-size: 14px; }
.sum-line.paid .input { width: 128px; height: 32px; text-align: right; font-family: var(--num); }
.ticket-note { margin-top: 12px; }
.ticket-note .textarea { min-height: 56px; font-size: 12px; }
.ticket-actions { padding: 14px 18px 18px; background: #fbf8f1; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ticket-actions .row2 { display: flex; gap: 8px; }
.ticket-actions .row2 .btn { flex: 1; }
.ticket-actions .btn-lg { height: 48px; font-size: 15px; }
.ticket-suffix { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-strong); }
.ticket-suffix label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.ticket-suffix .select { height: 34px; font-size: 12px; }
.ticket-suffix .field-note { margin-top: 4px; }
.ticket-actions .print-note { text-align: center; font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.ticket-empty { opacity: .55; }

/* ---------- Inbound ---------- */
.inbound-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 22px; align-items: start; }
.form-section { padding: 20px 22px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.step-no { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--gold); font-family: var(--num); font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.form-section-title h3 { font-size: 14px; }
.form-section-title .hint { font-size: 11px; color: var(--muted); margin-left: auto; }
.uploader { display: flex; gap: 16px; align-items: flex-start; }
.upload-box {
  width: 132px; height: 158px; border-radius: 12px; border: 1.5px dashed #c9c0ad; background: #faf7f0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  color: var(--muted); font-size: 11px; text-align: center; cursor: pointer; overflow: hidden; position: relative; flex: none;
  transition: border-color .15s, background .15s;
}
.upload-box:hover { border-color: var(--green); background: #f4faf6; color: var(--green); }
.upload-box .icon { width: 24px; height: 24px; }
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.upload-box .overlay { position: absolute; inset: 0; background: rgba(17,40,32,.5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; opacity: 0; transition: opacity .15s; }
.upload-box:hover .overlay { opacity: 1; }
.upload-tips { font-size: 11.5px; color: var(--muted); line-height: 1.75; padding-top: 4px; }
.upload-tips b { color: #4f5a53; font-weight: 600; }
.upload-actions { display: flex; gap: 8px; margin-top: 9px; }
.chip-input { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line-strong); background: #fffdf9; border-radius: 9px; padding: 6px; min-height: 38px; }
.chip-input:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14,122,92,.1); }
.chip-input input { border: 0; outline: none; background: transparent; min-width: 70px; flex: 1; height: 24px; padding: 0 4px; font-size: 12.5px; }
.chip-tag { display: inline-flex; align-items: center; gap: 3px; background: #f0ece2; border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px; color: #56615a; }
.chip-tag button { border: 0; background: transparent; color: #9a9c92; width: 18px; height: 18px; padding: 0; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.chip-tag button:hover { background: #e3dccd; color: var(--red); }
.chip-tag .icon { width: 11px; height: 11px; }
.preset-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.preset-row .lbl { font-size: 10.5px; color: var(--muted-2); margin-right: 2px; }
.preset-chip { border: 1px solid #e6dfd2; background: #fbf9f4; color: #7b8178; border-radius: 5px; font-size: 10.5px; padding: 2px 8px; }
.preset-chip:hover { border-color: #c8bfae; color: var(--ink); }
.preset-chip.preset-add { border-style: dashed; border-color: #b9a98a; color: var(--amber); background: #fffdf7; font-weight: 600; }
.preset-chip.preset-add:hover { border-color: var(--amber); background: var(--amber-soft); }
.preset-chip.preset-custom { border-color: #b9dccb; color: var(--green); background: #f4fbf7; }
.preset-chip.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.type-select { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-option { position: relative; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option label {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 12px; cursor: pointer; background: #fffdf9; transition: all .15s;
}
.type-option label .ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.type-option label .ic .icon { width: 16px; height: 16px; }
.type-option label b { display: block; font-size: 12.5px; font-weight: 600; }
.type-option label span { display: block; font-size: 10px; color: var(--muted); }
.type-option.self label .ic { background: var(--green-soft); color: var(--green); }
.type-option.purchase label .ic { background: var(--amber-soft); color: var(--amber); }
.type-option input:checked + label { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; background: #fff; }
.type-option.self input:checked + label { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.type-option.purchase input:checked + label { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.qty-matrix-panel { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty-matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; background: #fbf8f1; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.qty-matrix-head .hint { font-size: 10.5px; color: var(--muted); }
.qty-matrix-panel .matrix { background: #fffdf9; }
.inbound-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.preview-card { overflow: hidden; }
.preview-img { aspect-ratio: 3 / 3.6; background: #f0ece2; position: relative; }
.preview-img img { width: 100%; height: 100%; object-fit: cover; }
.preview-img .empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.preview-body { padding: 14px 16px 16px; }
.preview-no { font-family: var(--num); font-size: 19px; font-weight: 700; letter-spacing: .5px; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.preview-name { font-size: 12px; color: var(--muted); margin-top: 2px; }
.preview-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.inbound-actions { padding: 14px 16px; background: #fbf8f1; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.save-tips { font-size: 10.5px; color: var(--muted-2); text-align: center; }

/* restock */
.restock-picker { max-width: 520px; }
.picked-style { display: flex; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf9; }
.picked-style .thumb { width: 48px; height: 57px; }
.picked-style .info { flex: 1; min-width: 0; }
.picked-style .actions { display: flex; gap: 4px; }
.add-color-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.add-color-row .input { height: 30px; width: 130px; font-size: 12px; }
.add-color-row .btn { height: 30px; }
.stock-value { font-family: var(--num); font-size: 13px; color: var(--ink); }
.stock-value.zero { color: var(--red); }

/* ---------- Orders ---------- */
.order-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-row {
  display: grid; grid-template-columns: 1.1fr .9fr 1.2fr .7fr .8fr .8fr .8fr 100px;
  gap: 12px; align-items: center; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.order-row:hover { border-color: #cdc4b1; box-shadow: 0 6px 18px rgba(36,45,36,.06); }
.order-row.voided { opacity: .55; }
.order-no { font-family: var(--num); font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.order-date { font-family: var(--num); font-size: 11.5px; color: var(--muted); }
.order-customer { font-size: 13px; }
.order-customer small { color: var(--muted); font-size: 10.5px; display: block; }
.order-amount { text-align: right; font-family: var(--num); font-size: 15px; font-weight: 600; }
.order-paid { text-align: right; font-family: var(--num); font-size: 12px; color: var(--muted); }
.order-due { text-align: right; font-family: var(--num); font-size: 12px; }
.order-due.has-due { color: var(--red); font-weight: 600; }
.order-actions { display: flex; justify-content: flex-end; gap: 2px; }
.order-type-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); }
.orders-empty { padding: 60px 20px; }

/* ---------- Suppliers ---------- */
.supplier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.supplier-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 16px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
.supplier-card:hover { border-color: #cdc4b1; box-shadow: 0 10px 26px rgba(36,45,36,.07); }
.supplier-top { display: flex; gap: 11px; align-items: center; }
.supplier-avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex: none; }
.supplier-name { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supplier-sub { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supplier-wx { display: flex; align-items: center; gap: 6px; background: #f6f2e9; border-radius: 8px; padding: 7px 9px; margin-top: 12px; font-size: 12px; color: #5a655d; }
.supplier-wx .icon { width: 15px; height: 15px; color: #4a9b6e; }
.supplier-wx span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplier-stats { display: flex; gap: 18px; margin-top: 12px; font-size: 10.5px; color: var(--muted); }
.supplier-stats b { display: block; font-family: var(--num); font-size: 15px; color: var(--ink); }
.supplier-actions { display: flex; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0ece2; }
.supplier-actions .btn { flex: 1; }

/* customer list */
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.customer-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 15px; box-shadow: var(--shadow-sm); }
.customer-top { display: flex; gap: 10px; align-items: center; }
.customer-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex: none; }
.customer-main { flex: 1; min-width: 0; }
.customer-name { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.customer-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.star-btn { border: 0; background: transparent; color: #c9c2b3; padding: 5px; border-radius: 7px; flex: none; }
.star-btn .icon { width: 20px; height: 20px; fill: none; }
.star-btn:hover { background: var(--amber-soft); color: var(--amber); }
.star-btn.on { color: var(--amber); }
.star-btn.on .icon { fill: currentColor; }
.customer-lines { margin-top: 11px; display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: #5d675f; line-height: 1.55; }
.customer-lines .icon { width: 13px; height: 13px; color: var(--muted); margin-right: 4px; vertical-align: -2px; }
.customer-note { color: var(--muted); background: #fbf8f1; border-radius: 7px; padding: 6px 8px; }
.customer-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0ece2; }
.customer-actions .btn { flex: 1; }
.inv-suffix { margin-top: 9px; padding-top: 7px; border-top: 1px dashed #b9c1b8; text-align: center; font-size: 10.5px; line-height: 1.6; color: #3f4a43; white-space: pre-line; }
.wx-copy { border: 0; background: transparent; color: var(--green); font-size: 11px; padding: 2px 4px; }
.wx-copy:hover { text-decoration: underline; }

/* ---------- Settings ---------- */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 6px; }
.settings-nav button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.settings-nav button:hover { background: #f7f3ea; color: var(--ink); }
.settings-nav button.active { background: var(--green-soft); color: var(--green); font-weight: 600; }
.settings-nav .icon { width: 16px; height: 16px; }
.settings-content { display: flex; flex-direction: column; gap: 18px; }
.setting-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; box-shadow: var(--shadow-sm); }
.setting-head { padding: 16px 20px; border-bottom: 1px solid #f0ece2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setting-head h2 { font-size: 15px; }
.setting-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.setting-body { padding: 18px 20px; }
.setting-actions { padding: 13px 20px; background: #fbf8f1; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.radio-cards { display: flex; gap: 9px; flex-wrap: wrap; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); padding: 9px 13px; border-radius: 9px; cursor: pointer; font-size: 12.5px; background: #fffdf9; }
.radio-card input:checked + label { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; }
.radio-card .paper-ic { border: 1px solid currentColor; border-radius: 2px; opacity: .7; }
.data-path { font-family: Consolas, monospace; font-size: 11px; background: #f6f2e9; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; word-break: break-all; color: #5d675f; }
.danger-zone { border-color: #edcfc9; }
.danger-zone .setting-head { background: #fdf7f5; }
.backup-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.backup-item { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 9px 11px; background: #fbf9f4; border-radius: 8px; border: 1px solid #eee8dc; }
.backup-item .icon { width: 16px; height: 16px; color: var(--green); }
.backup-item .meta { flex: 1; }
.backup-item .meta small { display: block; color: var(--muted); font-size: 10.5px; }
.about-list { font-size: 12px; color: var(--muted); line-height: 1.9; }
.about-list b { color: var(--ink); }
.kbd { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: #fff; font-size: 9.5px; color: #8a9087; padding: 1px 5px; font-family: var(--num); line-height: 1.5; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 35, 29, 0.42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .18s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 540px;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  box-shadow: 0 30px 90px rgba(10, 25, 20, .35);
  transform: translateY(10px) scale(.99); transition: transform .18s;
  overflow: hidden;
}
.modal-overlay.show .modal { transform: none; }
.modal.modal-md { max-width: 660px; }
.modal.modal-lg { max-width: 880px; }
.modal.modal-xl { max-width: 1000px; }
.modal.modal-paper { max-width: 900px; background: #f3efe7; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { font-size: 17px; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-close { width: 32px; height: 32px; border: 0; background: #f4f0e7; border-radius: 8px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #eae4d7; color: var(--ink); }
.modal-body { padding: 20px; overflow: auto; }
.modal-body.flush { padding: 0; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: #fbf8f1; flex: none; }
.modal-foot.split { justify-content: space-between; }
.modal-enter { animation: none; }
.modal-wide { max-width: 760px; }
.form-error { color: var(--red); font-size: 11.5px; background: var(--red-soft); border-radius: 7px; padding: 7px 10px; display: none; }
.form-error.show { display: block; }

/* style detail */
.detail-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.detail-photo { width: 100%; aspect-ratio: 3/3.7; border-radius: 13px; object-fit: cover; background: #f0ece2; border: 1px solid var(--line); }
.detail-photo.thumb-fallback { height: auto; }
.detail-photo-fallback { width: 100%; aspect-ratio: 3/3.7; border-radius: 13px; background: linear-gradient(145deg, #ece6d9, #f8f5ec); display: flex; align-items: center; justify-content: center; color: #aaa290; }
.detail-photo-fallback .icon { width: 44px; height: 44px; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title .no { font-family: var(--num); font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 15px; }
.meta-item label { display: block; font-size: 10px; color: var(--muted-2); letter-spacing: .5px; margin-bottom: 2px; }
.meta-item div { font-size: 12.5px; color: var(--text); }
.detail-stock { margin-top: 18px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.detail-stock .matrix { min-width: 0; }
.detail-stock .matrix th, .detail-stock .matrix td { border-bottom: 1px solid #f2eee5; }
.detail-stock .matrix tbody tr:last-child td, .detail-stock .matrix tbody tr:last-child th { border-bottom: 0; }
.detail-stock .matrix td { font-family: var(--num); font-size: 13px; }
.detail-stock .matrix td.zero { color: var(--red); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.movement-list { margin-top: 18px; }
.movement-row { display: flex; align-items: center; gap: 9px; font-size: 11.5px; padding: 6px 0; border-bottom: 1px dashed #eee8dc; }
.movement-row:last-child { border-bottom: 0; }
.movement-row .m-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.movement-row.out .m-dot { background: var(--amber); }
.movement-row .m-text { flex: 1; color: #5d675f; }
.movement-row .m-qty { font-family: var(--num); font-weight: 600; }
.movement-row .m-date { color: var(--muted-2); font-size: 10px; width: 64px; text-align: right; }

/* ---------- Invoice preview / paper ---------- */
.paper-modal .modal-body { background: #e9e4d8; padding: 22px; }
.paper-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.paper-toolbar .paper-tabs { display: flex; gap: 4px; background: #e4ded1; border-radius: 8px; padding: 3px; }
.paper-toolbar .paper-tabs button { border: 0; background: transparent; border-radius: 6px; font-size: 11px; padding: 4px 10px; color: #75796f; }
.paper-toolbar .paper-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.paper-stage { margin-top: 18px; overflow: auto; max-height: 68vh; padding-bottom: 6px; }
.paper-stage .sheet { min-height: 0; }
.sheet {
  background: #fff; color: #1b241f; width: 210mm; min-height: 290mm; margin: 0 auto; padding: 14mm 13mm;
  box-shadow: 0 12px 40px rgba(23, 35, 28, .2); font-size: 12px; line-height: 1.5;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.inv-void {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-18deg);
  font-size: 64px; font-weight: 700; letter-spacing: 14px; color: rgba(191, 74, 61, .16);
  border: 5px solid rgba(191, 74, 61, .16); border-radius: 10px; padding: 8px 26px 8px 40px;
  white-space: nowrap; pointer-events: none; z-index: 2;
}
.sheet.receipt .inv-void { font-size: 28px; border-width: 3px; padding: 4px 10px 4px 18px; letter-spacing: 6px; }
.sheet.a5 { width: 148mm; min-height: 200mm; padding: 10mm 9mm; font-size: 10.5px; }
.sheet.receipt { width: 80mm; min-height: 0; padding: 5mm 4mm; font-size: 10px; box-shadow: 0 12px 40px rgba(23,35,28,.18); }
.inv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 2px solid #1b241f; padding-bottom: 10px; }
.inv-shop { min-width: 0; flex: 1; }
.inv-shop h1 { margin: 0; font-size: 22px; letter-spacing: 2px; color: #14251e; line-height: 1.25; }
.sheet.a5 .inv-shop h1, .sheet.receipt .inv-shop h1 { font-size: 16px; letter-spacing: 1px; }
.inv-shop .contact { font-size: 10.5px; color: #646d66; margin-top: 4px; line-height: 1.6; word-break: break-word; }
.inv-title { text-align: right; flex: none; }
.inv-title .cn { font-size: 25px; font-weight: 700; letter-spacing: 8px; color: #14251e; line-height: 1.1; }
.inv-title .en { font-size: 8px; letter-spacing: 2px; color: #949a92; margin-top: 3px; }
.sheet.a5 .inv-title .cn, .sheet.receipt .inv-title .cn { font-size: 18px; letter-spacing: 5px; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; padding: 9px 0; border-bottom: 1px solid #cfd4cc; font-size: 11px; color: #35423b; }
.sheet.receipt .inv-meta { grid-template-columns: 1fr; gap: 2px; }
.inv-meta b { font-weight: 500; color: #78817a; margin-right: 6px; }
.inv-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.inv-table th { background: #f1f0ea; border-bottom: 1px solid #aeb5ad; border-top: 1px solid #aeb5ad; padding: 6px 5px; font-size: 10px; font-weight: 600; color: #3a453e; text-align: center; white-space: nowrap; }
.inv-table td { border-bottom: 1px solid #e3e6e0; padding: 5px; font-size: 10.5px; text-align: center; color: #2a352f; }
.inv-table .tl { text-align: left; }
.inv-table .tr { text-align: right; }
.inv-table .style-cell { font-family: var(--num); font-weight: 700; font-size: 11px; }
.inv-table .style-cell small { display: block; font-family: var(--font); font-weight: 400; color: #858d86; font-size: 8.5px; margin-top: 1px; }
.inv-table tr.total-row td { border-top: 1px solid #aeb5ad; font-weight: 600; }
.inv-foot { margin-top: auto; padding-top: 10px; }
.inv-summary { display: flex; justify-content: flex-end; }
.inv-sum-box { width: 260px; font-size: 11px; }
.inv-sum-line { display: flex; justify-content: space-between; padding: 3px 0; color: #4c574f; }
.inv-sum-line b { font-family: var(--num); color: #1b241f; font-weight: 600; }
.inv-sum-line.grand { border-top: 1px solid #aeb5ad; margin-top: 4px; padding-top: 6px; font-size: 13px; color: #14251e; }
.inv-sum-line.grand b { font-size: 17px; }
.inv-note { margin-top: 12px; font-size: 10px; color: #6c746e; border-top: 1px dashed #ccd2ca; padding-top: 7px; line-height: 1.7; white-space: pre-wrap; }
.inv-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 22px; font-size: 10px; color: #6c746e; }
.inv-sign div { flex: 1; border-bottom: 1px solid #b7bdb5; padding-bottom: 4px; }
.inv-thanks { text-align: center; font-size: 9px; color: #9aa198; margin-top: 14px; letter-spacing: 1px; }
.sheet.receipt .inv-head { border-bottom-width: 1px; padding-bottom: 5px; display: block; text-align: center; }
.sheet.receipt .inv-title { text-align: center; margin-top: 4px; }
.sheet.receipt .inv-table th, .sheet.receipt .inv-table td { padding: 3px 2px; font-size: 8px; }
.sheet.receipt .inv-table th:nth-child(5), .sheet.receipt .inv-table td:nth-child(5) { display: none; }
.sheet.receipt .inv-sum-box { width: 100%; }
.sheet.receipt .inv-sign { margin-top: 10px; }
.sheet.receipt .inv-note { margin-top: 6px; }
.sheet.receipt .inv-foot { margin-top: 6px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; z-index: 300; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  background: #17342c; color: #fff; border-radius: 10px; padding: 10px 15px; font-size: 12.5px;
  box-shadow: 0 14px 40px rgba(15,30,24,.28); display: flex; align-items: center; gap: 8px;
  animation: toastIn .22s ease-out; max-width: 400px; pointer-events: auto;
}
.toast.error { background: #8e342b; }
.toast.gold { background: #7a571c; }
.toast .icon { width: 16px; height: 16px; color: #85d8b2; }
.toast.error .icon { color: #ffc2b9; }
.toast.gold .icon { color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Misc ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.search-highlight { background: var(--gold-soft); color: inherit; border-radius: 2px; }
.loading-screen { position: fixed; inset: 0; background: var(--paper); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; z-index: 500; }
.loading-logo { width: 64px; height: 64px; border-radius: 17px; overflow: hidden; box-shadow: 0 12px 30px rgba(21,60,51,.2); }
.loading-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loading-screen p { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(23,52,44,.15); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fatal { max-width: 560px; margin: 80px auto; background: #fff; border: 1px solid #eccbc5; border-radius: 16px; padding: 28px; }
.fatal h1 { color: #8e342b; font-size: 20px; margin: 0 0 8px; }
.fatal code { background: #f6f2e9; padding: 2px 5px; border-radius: 4px; }
.pill-label { font-size: 10px; letter-spacing: 1px; color: var(--muted-2); text-transform: uppercase; }
.hr-dashed { border: 0; border-top: 1px dashed var(--line-strong); margin: 14px 0; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }

/* ---------- Auth ---------- */
body.auth-mode { overflow: hidden; }
body.auth-mode .app-shell { display: none; }
body.auth-mode .toast-wrap { display: none; }
.auth-screen {
  position: fixed; inset: 0; z-index: 1000; overflow: auto;
  display: grid; grid-template-columns: 1.08fr .92fr; background: var(--paper);
}
.auth-visual {
  background:
    radial-gradient(600px 420px at 80% 10%, rgba(232, 180, 95, .18), transparent 65%),
    radial-gradient(500px 500px at 0% 100%, rgba(255, 255, 255, .06), transparent 60%),
    linear-gradient(145deg, #12362d, #0a241d 70%);
  color: #f6f1e4; padding: 42px 48px 28px; display: flex; flex-direction: column; min-height: 100vh;
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-logo { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.auth-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-brand strong { display: block; font-size: 19px; letter-spacing: 3px; }
.auth-brand span { display: block; font-size: 10px; letter-spacing: 2px; color: rgba(246,241,228,.5); margin-top: 2px; }
.auth-copy { margin: auto 0; max-width: 560px; padding: 40px 0; }
.auth-eyebrow { font-size: 10px; letter-spacing: 3px; color: var(--gold); font-weight: 700; }
.auth-copy h1 { font-size: clamp(36px, 4.4vw, 60px); line-height: 1.18; letter-spacing: -1px; margin: 16px 0 18px; color: #fffdf6; font-weight: 700; }
.auth-copy p { font-size: 14px; color: rgba(246,241,228,.65); line-height: 1.9; max-width: 430px; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.auth-points div { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(246,241,228,.72); }
.auth-points .icon { width: 17px; height: 17px; color: var(--gold); }
.auth-foot { font-size: 10px; letter-spacing: .5px; color: rgba(246,241,228,.28); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 36px 28px; min-height: 100vh; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 32px; box-shadow: 0 24px 70px rgba(23,42,34,.12); }
.auth-card-brand { display: none; align-items: center; gap: 8px; margin-bottom: 20px; }
.auth-card-brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.auth-card-brand strong { letter-spacing: 2px; font-size: 16px; }
.auth-card h2 { font-size: 22px; letter-spacing: -.3px; color: var(--ink); margin: 0 0 6px; }
.auth-sub { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.auth-error { display: none; background: var(--red-soft); color: var(--red); border: 1px solid #eed0ca; border-radius: 8px; padding: 8px 10px; font-size: 11.5px; margin-bottom: 12px; line-height: 1.6; }
.auth-error.show { display: block; }
.auth-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.auth-field label { font-size: 11.5px; color: #59645d; font-weight: 600; }
.auth-field .input { height: 42px; background: #fffdf9; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-submit { width: 100%; height: 44px; margin-top: 6px; font-size: 14px; }
.auth-hint { font-size: 10.5px; color: var(--muted-2); line-height: 1.7; margin: -4px 0 12px; }
.auth-hint code { background: #f2eee5; border-radius: 3px; padding: 1px 4px; font-size: 10px; }
.auth-hint.ok { color: var(--green); }
.auth-hint.bad { color: var(--red); }
.auth-login-tip { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 14px; }
.auth-login-tip button { border: 0; background: none; color: var(--green); font-size: 11.5px; padding: 0 3px; font-weight: 600; }
.auth-login-tip button:hover { text-decoration: underline; }
.auth-fatal { display: flex; align-items: center; justify-content: center; }
.auth-fatal .auth-card { max-width: 460px; }
@media (max-width: 900px) {
  .auth-screen { display: block; background: linear-gradient(160deg, #12362d 0%, #0a241d 26%, var(--paper) 26.1%, var(--paper) 100%); }
  .auth-visual { background: transparent; min-height: 0; padding: 26px 22px 0; display: block; }
  .auth-copy, .auth-foot { display: none; }
  .auth-panel { min-height: 0; padding: 22px 16px 36px; align-items: flex-start; }
  .auth-card { padding: 24px 22px; border-radius: 16px; }
  .auth-card-brand { display: flex; }
  .auth-card h2 { font-size: 20px; }
}
@media (max-width: 480px) {
  .auth-row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Cloud user / sync ---------- */
.user-card { display: flex; align-items: center; gap: 9px; padding: 10px 4px 4px; margin-bottom: 6px; }
.user-avatar { width: 32px; height: 32px; border-radius: 9px; background: rgba(232,180,95,.18); color: var(--gold); border: 1px solid rgba(232,180,95,.35); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.user-meta { flex: 1; min-width: 0; line-height: 1.3; }
.user-meta strong { display: block; font-size: 12px; color: #f6f1e4; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { display: block; font-size: 9.5px; color: rgba(246,241,228,.4); margin-top: 2px; }
.user-logout { border: 0; background: transparent; color: rgba(246,241,228,.35); padding: 4px; border-radius: 6px; display: flex; }
.user-logout:hover { background: rgba(255,255,255,.07); color: #fff; }
.user-logout .icon { width: 15px; height: 15px; }
.sync-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 70; background: #17342c; color: #fff; border-radius: 999px; padding: 7px 8px 7px 14px; font-size: 11.5px; display: flex; align-items: center; gap: 9px; box-shadow: 0 10px 30px rgba(15,30,24,.25); }
.sync-banner button { border: 0; background: var(--gold); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 10.5px; font-weight: 600; }
.sync-banner .icon { width: 14px; height: 14px; color: #85d8b2; }
.cloud-only { display: none; }
@media (max-width: 900px) {
  .sync-banner { top: 10px; }
}

/* ---------- Cloud staff / account ---------- */
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.account-item label { display: block; font-size: 10px; color: var(--muted-2); letter-spacing: .4px; margin-bottom: 3px; }
.account-item div { font-size: 13px; color: var(--text); }
.staff-area { margin-top: 4px; }
.staff-list { display: flex; flex-direction: column; gap: 7px; }
.staff-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: #fbf9f4; border: 1px solid #eee8dc; border-radius: 10px; }
.staff-row.disabled { opacity: .65; }
.staff-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex: none; }
.staff-info { flex: 1; min-width: 0; }
.staff-name { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.staff-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.invite-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f5fbf7; border: 1px solid #cfe9dc; border-radius: 11px; padding: 12px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.invite-code { font-family: var(--num); font-size: 28px; font-weight: 700; letter-spacing: 5px; color: var(--green); line-height: 1.2; }
.invite-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.invite-active { background: #fbf9f4; border: 1px solid #eee8dc; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.invite-line { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.invite-code-sm { font-family: var(--num); font-weight: 700; letter-spacing: 2px; color: var(--ink); background: #f0ece2; border-radius: 5px; padding: 2px 7px; font-size: 12px; }
.invite-line .tiny { flex: 1; }
.temp-password { font-family: var(--num); font-size: 30px; letter-spacing: 5px; text-align: center; background: #f5fbf7; border: 1px dashed #b9dccb; border-radius: 10px; color: var(--green); padding: 14px; margin: 14px 0; }
.audit-details { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.audit-details summary { font-size: 11.5px; color: var(--muted); cursor: pointer; }
.audit-row { display: grid; grid-template-columns: 130px 90px 1fr; gap: 8px; font-size: 10.5px; padding: 4px 0; border-bottom: 1px dashed #f0ece2; }
.audit-row:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .account-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .staff-row { align-items: flex-start; flex-wrap: wrap; }
  .staff-actions { width: 100%; justify-content: flex-start; margin-left: 45px; }
  .invite-code { font-size: 24px; }
  .audit-row { grid-template-columns: 1fr 1fr; }
  .audit-row span:last-child { grid-column: 1 / -1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .view { padding: 26px 26px 54px; }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .style-row { grid-template-columns: 58px minmax(150px, 1.2fr) 110px 116px 100px 120px; }
  .inbound-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .order-row { grid-template-columns: 1.1fr .8fr 1.1fr .6fr .8fr .7fr .7fr 92px; gap: 8px; }
}
@media (max-width: 1120px) {
  .sidebar { width: 208px; padding-left: 12px; padding-right: 12px; }
  .pos-layout, .inbound-layout { grid-template-columns: 1fr; }
  .pos-side, .inbound-side { position: static; }
  .inbound-side { display: grid; grid-template-columns: 220px 1fr; align-items: start; }
  .preview-img { aspect-ratio: 3/3.3; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .order-row { grid-template-columns: 1.2fr .9fr 1.1fr .7fr .8fr 92px; }
  .order-row .order-paid, .order-row .order-due { display: none; }
  .settings-layout { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 250px;
    transform: translateX(-105%); transition: transform .22s ease; z-index: 90;
    box-shadow: 20px 0 60px rgba(10,25,20,.3);
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(12,28,22,.42); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    height: 54px; padding: 0 14px; position: sticky; top: 0; z-index: 50;
    background: rgba(244,241,234,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .mobile-brand { font-weight: 700; letter-spacing: 3px; color: var(--ink); }
  .mobile-save { font-size: 10.5px; color: var(--muted); }
  .mobile-top-actions { display: flex; align-items: center; gap: 6px; }
  .view { padding: 18px 16px 60px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 24px; }
  .page-head .sub { font-size: 12px; }
  .style-row { grid-template-columns: 52px minmax(0, 1fr) 92px 92px; }
  .style-row .row-supplier, .style-row .row-price, .style-row .order-type-tag { display: none; }
  .thumb, .thumb-wrap { width: 52px; height: 61px; }
  .row-actions { opacity: 1; }
  .order-row { grid-template-columns: minmax(0,1fr) .8fr .7fr 76px; }
  .order-row .order-date, .order-row .order-paid, .order-row .order-due, .order-row .order-items { display: none; }
  .order-row .order-amount { font-size: 13px; }
  .supplier-grid { grid-template-columns: 1fr; }
  .customer-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav button { flex: none; }
  .detail-grid { grid-template-columns: 180px minmax(0,1fr); gap: 16px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-overlay.show .modal { transform: none; }
  .toast-wrap { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; gap: 9px; }
  .stat-val { font-size: 18px; }
  .stat-ic { width: 32px; height: 32px; border-radius: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .inbound-side { grid-template-columns: 1fr; }
  .preview-card { display: none; }
  .type-select { grid-template-columns: 1fr; }
  .customer-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; padding: 9px 12px; }
  .customer-strip .field { flex-direction: column; align-items: stretch; gap: 1px; min-width: 0; }
  .customer-strip .field-label { font-size: 9.5px; letter-spacing: .4px; color: var(--muted-2); }
  .customer-strip .field-label .icon { width: 12px; height: 12px; }
  .customer-strip .input { height: 24px; font-size: 12.5px; padding: 0; }
  .customer-strip .sep, .customer-strip .grow, .customer-strip .mini-order { display: none; }
  .pos-head-actions { width: 100%; justify-content: space-between; }
  .page-actions.pos-head-actions .btn { flex: none; height: 34px; padding: 0 12px; font-size: 12px; }
  .matrix-mobile-hint { display: block; font-size: 9px; color: var(--muted-2); padding: 6px 10px 0; letter-spacing: .3px; }
  .matrix .hand-col { display: none; }
  .hand-btn.hand-inline { display: inline-flex; margin-top: 5px; height: 28px; font-size: 10.5px; padding: 0 8px; }
  .hand-inline .icon { width: 11px; height: 11px; }
  .stepper button { width: 26px; height: 34px; }
  .stepper input { width: 30px; height: 34px; font-size: 14px; }
  .matrix { min-width: 360px; }
  .paper-stage .sheet { zoom: .46; }
  .paper-stage .sheet.a5 { zoom: .62; }
  .paper-stage .sheet.receipt { zoom: 1; }
  .pos-search .input { height: 48px; font-size: 15px; padding-right: 52px; }
  .pos-search .search-hint .kbd { display: none; }
  .cart-price input { width: 64px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-photo, .detail-photo-fallback { max-width: 220px; margin: 0 auto; }
  .style-row { grid-template-columns: 48px minmax(0,1fr) 72px; padding: 8px; gap: 9px; }
  .style-row .row-actions { display: none; }
  .thumb, .thumb-wrap { width: 48px; height: 57px; }
  .row-title .no { font-size: 14px; }
  .toolbar .search-box { width: 100%; }
  .order-row { grid-template-columns: minmax(0,1fr) .7fr 70px; }
  .order-row .order-customer { display: none; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .ticket-customer { grid-template-columns: 1fr; }
  .ticket-customer .full { grid-column: auto; }
  .settings-content { gap: 12px; }
  .setting-body { padding: 14px; }
  .setting-head { padding: 13px 14px; }
  .setting-actions { padding: 11px 14px; }
  .modal-head { padding: 13px 15px; }
  .modal-body { padding: 15px; }
  .modal-foot { padding: 11px 15px; }
  .paper-modal .modal-body { padding: 12px; }
  .inv-title .cn { font-size: 20px; letter-spacing: 5px; }
  .inv-shop h1 { font-size: 18px; }
  .detail-actions .btn { flex: 1; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 9px 12px; }
  .customer-strip .mini-order { display: none; }
  .cart-price { flex-direction: column; align-items: flex-end; gap: 2px; }
  .cart-price .cur { display: none; }
  .cart-foot { align-items: flex-start; flex-direction: column; }
  .matrix .color-head { min-width: 92px; }
  .stepper input { width: 32px; }
}

/* ---------- 订单状态 / 详情 / 改单 ---------- */
.order-row { grid-template-columns: minmax(0, 1.35fr) .8fr .55fr .8fr minmax(120px, 1.1fr) 98px; }
.order-customer b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-customer small { color: var(--muted); font-size: 10.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-status { display: block; width: 100%; min-width: 140px; }
.order-progress { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.progress-order { font-size: 9.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.order-progress.compact { gap: 4px; }
.progress-row { min-width: 0; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 9.5px; line-height: 1.3; margin-bottom: 2px; }
.progress-name { color: var(--muted); flex: none; }
.progress-text { color: #5d675f; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-track { height: 5px; border-radius: 99px; background: #ebe7de; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; transition: width .25s ease; }
.progress-fill.pay { background: var(--red); }
.progress-fill.ship { background: var(--blue); }
.progress-fill.unpaid, .progress-fill.unshipped { background: transparent; }
.order-progress:not(.compact) .progress-head { font-size: 11px; margin-bottom: 4px; }
.order-progress:not(.compact) .progress-track { height: 7px; }
.order-detail-payinfo { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin-top: 10px; padding: 8px 10px; background: #fbf8f1; border-radius: 8px; font-size: 11.5px; color: var(--muted); }
.order-detail-payinfo b { color: var(--ink); font-family: var(--num); margin-left: 3px; }
.order-pay-summary { display: flex; flex-wrap: wrap; gap: 7px 14px; align-items: baseline; padding: 9px 11px; background: #fbf8f1; border-radius: 9px; font-size: 12px; color: var(--muted); }
.order-pay-summary b { color: var(--ink); font-family: var(--num); }
.order-pay-history { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 4px; }
.order-pay-history-row, .order-history-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 11px; color: var(--muted); }
.order-pay-history-row b, .order-history-row b { font-family: var(--num); color: var(--ink); }
.order-history { margin-top: 9px; border-top: 1px dashed var(--line); padding-top: 6px; }
.order-history-title { font-size: 10px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.order-ship-list { border-top: 1px dashed var(--line); }
.order-ship-row { display: grid; grid-template-columns: minmax(0,1fr) 88px 64px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #f0ece2; font-size: 12px; }
.order-ship-row small { display: block; color: var(--muted); font-size: 10.5px; }
.order-ship-row .input { height: 32px; text-align: center; padding: 0 4px; }
.ship-stepper { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.ship-stepper .input { width: 42px; flex: none; }
.ship-step { width: 26px; height: 32px; border: 1px solid var(--line-strong); background: #fffdf9; border-radius: 7px; color: var(--ink); font-size: 16px; line-height: 1; padding: 0; flex: none; }
.ship-step:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.ship-step:disabled { opacity: .35; }
.order-row { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.quick-order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action { border: 1px solid var(--line); background: #fffdf9; border-radius: 12px; padding: 14px 12px; text-align: left; }
.quick-action:hover { border-color: var(--green); background: #f7fcf9; }
.quick-action:disabled { opacity: .45; }
.quick-action b { display: block; font-size: 15px; color: var(--ink); margin-top: 8px; }
.quick-action small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; line-height: 1.5; }
.quick-action .icon { width: 20px; height: 20px; color: var(--green); }
@media (max-width: 720px) {
  .order-status { min-width: 126px; }
  .order-detail-payinfo { grid-template-columns: 1fr 1fr; }
  .order-ship-row { grid-template-columns: minmax(0,1fr) 74px 92px; gap: 5px; }
  .ship-stepper .input { width: 34px; }
  .ship-step { width: 22px; }
}
@media (max-width: 720px) {
  .order-status { min-width: 126px; }
  .order-detail-payinfo { grid-template-columns: 1fr 1fr; }
  .order-ship-row { grid-template-columns: minmax(0,1fr) 74px 58px; gap: 5px; }
}
.order-detail-head { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; padding: 10px 12px; background: #fbf8f1; border-radius: 10px; }
.order-detail-head label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 1px; }
.order-detail-head b { font-size: 13px; color: var(--ink); }
.order-detail-status { display: flex; gap: 6px; flex-wrap: wrap; margin: 11px 0 4px; }
.order-detail-items { margin-top: 10px; border-top: 1px dashed var(--line); }
.order-detail-item { display: grid; grid-template-columns: minmax(0,1fr) 55px 80px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #f0ece2; font-size: 12px; }
.order-detail-item .odi-main { min-width: 0; }
.order-detail-item .odi-main small { display: block; color: var(--muted); font-size: 10.5px; }
.order-detail-item .odi-qty { text-align: right; color: #5d675f; }
.order-detail-item .odi-amount { text-align: right; font-family: var(--num); color: var(--ink); }
.order-detail-totals { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 12px; }
.order-detail-totals div { display: flex; justify-content: space-between; gap: 12px; color: #5d675f; }
.order-detail-totals b { font-family: var(--num); color: var(--ink); }
.order-detail-totals .grand { padding-top: 5px; border-top: 1px dashed var(--line-strong); color: var(--ink); font-weight: 600; }
.order-detail-totals .grand b { font-size: 17px; color: var(--green); }
.order-detail-note { margin-top: 10px; padding: 7px 9px; border-radius: 7px; background: #fbf8f1; font-size: 11.5px; color: #5d675f; }
.order-detail-buttons { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.order-edit-list { margin: 12px 0 4px; }
.order-edit-row { display: grid; grid-template-columns: minmax(0,1fr) 62px 82px 30px; gap: 7px; align-items: center; padding: 7px 0; border-bottom: 1px dashed #e9e3d6; font-size: 12px; }
.order-edit-row .oe-main { min-width: 0; }
.order-edit-row .oe-main small { display: block; color: var(--muted); font-size: 10.5px; }
.order-edit-row .oe-qty { height: 32px; text-align: center; padding: 0 3px; }
.order-edit-row .oe-amount { text-align: right; font-family: var(--num); }
.order-edit-total { text-align: right; font-size: 13px; color: var(--muted); margin-top: 10px; }
.order-edit-total b { font-family: var(--num); font-size: 18px; color: var(--green); }
@media (max-width: 1120px) {
  .order-row { grid-template-columns: minmax(0, 1.25fr) .75fr .55fr .75fr minmax(110px, 1fr) 92px; gap: 8px; }
}
@media (max-width: 900px) {
  .order-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .order-row .order-date, .order-row .order-items, .order-row .order-amount { display: none; }
  .order-status { justify-content: flex-end; }
  .order-detail-head { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .order-row { grid-template-columns: minmax(0, 1fr) auto; }
  .order-row .order-customer { display: block; }
  .order-row .order-actions { display: none; }
  .order-status { justify-content: flex-end; }
  .order-detail-head { grid-template-columns: 1fr; }
  .order-detail-item { grid-template-columns: minmax(0,1fr) 45px 72px; }
  .order-edit-row { grid-template-columns: minmax(0,1fr) 54px 72px 26px; gap: 5px; }
}

/* ---------- 手机入库表单 ---------- */
.mobile-savebar { display: none; }
@media (max-width: 900px) {
  .inbound-layout { padding-bottom: 88px; }
  .inbound-side { display: none; }
  .form-section { padding: 16px 14px; }
  .customer-strip { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .customer-strip .field { min-width: 0; }
  .customer-strip .sep, .customer-strip .grow { display: none; }
  .customer-strip .mini-order { display: none; }
  .uploader { flex-direction: column; gap: 14px; }
  .upload-box { width: 100%; height: 150px; }
  .uploader > div { width: 100%; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid .span-2 { grid-column: auto !important; }
  .type-select { grid-template-columns: 1fr; }
  .type-option label { padding: 11px 12px; align-items: flex-start; }
  .type-option label b { font-size: 13px; }
  .type-option label span { font-size: 11px; line-height: 1.5; }
  .type-option label > span:last-child { min-width: 0; }
  .input-group { flex-wrap: wrap; }
  .input-group .select { flex: 1 1 100%; width: 100%; }
  .input-group .btn { flex: 0 0 auto; }
  .qty-matrix-head { align-items: flex-start; }
  .mobile-savebar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    background: rgba(244,241,234,.96); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 26px rgba(20,35,28,.12); backdrop-filter: blur(10px);
  }
  .mobile-savebar .btn { width: 100%; height: 46px; font-size: 14px; }
}
@media (max-width: 420px) {
  .form-section { padding: 14px 12px; }
  .upload-box { height: 132px; }
}

/* ---------- 订单左滑删除 ---------- */
.order-swipe { position: relative; border-radius: 12px; overflow: hidden; background: var(--red); }
.order-swipe-delete {
  position: absolute; right: 0; top: 0; bottom: 0; width: 88px; border: 0;
  background: var(--red); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600;
  border-radius: 0 12px 12px 0;
}
.order-swipe-delete .icon { width: 18px; height: 18px; }
.order-row { position: relative; z-index: 1; background: var(--card); transition: transform .2s ease; touch-action: pan-y; }
.order-swipe.swipe-open .order-row { transform: translateX(-88px); }
.order-swipe.swipe-open .order-row:hover { box-shadow: none; }

/* ---------- 发货弹窗手机排版 ---------- */
.order-ship-row { grid-template-columns: minmax(0, 1fr) 112px 100px; }
@media (max-width: 720px) {
  .order-ship-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "info stepper" "counts stepper";
    align-items: center;
    gap: 3px 8px;
    padding: 9px 0;
  }
  .order-ship-row > div:first-child { grid-area: info; min-width: 0; }
  .order-ship-row > div:nth-child(2) { grid-area: counts; min-width: 0; white-space: normal; }
  .order-ship-row .ship-stepper { grid-area: stepper; }
  .order-ship-row .input { height: 34px; }
  .ship-stepper .input { width: 36px; }
  .ship-step { width: 24px; height: 34px; }
}

/* ---------- 款式编辑：颜色/尺码 ---------- */
.style-edit-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.edit-option-block { border: 1px solid var(--line); background: #fbfaf5; border-radius: 10px; padding: 8px; min-width: 0; }
.edit-option-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.edit-option-head b { font-size: 11.5px; color: var(--ink); }
.edit-option-head span { font-size: 9.5px; color: var(--muted); }
.edit-option-block .chip-input { background: #fffdf9; }
.edit-option-block .preset-row { gap: 4px; margin-top: 6px; }
@media (max-width: 720px) {
  .style-edit-options { grid-template-columns: 1fr; gap: 9px; }
}

/* ---------- 加工订单 / 面辅料 / 生产 / 财务 ---------- */
.red { color: var(--red); }
.green { color: var(--green); }
.stat-ic.red { background: var(--red-soft); color: var(--red); }
.stat-ic.muted { background: #f0ede6; color: var(--muted); }
.progress-track > i { display: block; height: 100%; border-radius: inherit; transition: width .25s ease; }
.processing-toolbar { align-items: flex-start; }
.filter-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip-filter { border: 1px solid var(--line); background: #fffdf9; color: var(--muted); border-radius: 99px; padding: 4px 10px; font-size: 11px; }
.chip-filter.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.po-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.po-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, transform .15s; }
.po-card:hover { border-color: #b9d7c7; transform: translateY(-1px); }
.po-card.is-void { opacity: .6; }
.po-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.po-customer { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.po-style { font-size: 12px; color: var(--muted); margin-top: 3px; }
.po-qty { text-align: right; flex: none; }
.po-qty b { font-family: var(--num); font-size: 21px; color: var(--ink); display: block; line-height: 1; }
.po-qty span { font-size: 9.5px; color: var(--muted); }
.po-risk { font-size: 9px; color: var(--red); background: var(--red-soft); border-radius: 4px; padding: 1px 4px; }
.po-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 10px; color: var(--muted); }
.po-meta span { display: inline-flex; align-items: center; gap: 3px; }
.po-meta .icon { width: 11px; height: 11px; }
.po-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed #eee9de; }
.mini-progress { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 5px; }
.mini-label { font-size: 9px; color: var(--muted); }
.mini-track { height: 5px; background: #eeeae1; border-radius: 99px; overflow: hidden; }
.mini-track i { display: block; height: 100%; border-radius: inherit; }
.mini-track i.blue { background: var(--blue); }
.mini-track i.amber { background: var(--amber); }
.mini-track i.red { background: var(--red); }
.mini-text { font-size: 9px; color: var(--muted); white-space: nowrap; }
.po-card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 9.5px; color: var(--muted-2); }
.po-no { font-family: var(--num); letter-spacing: .3px; }
.po-open { display: inline-flex; align-items: center; gap: 1px; color: var(--green); font-size: 10px; }
.po-open .icon { width: 12px; height: 12px; }
.pill { display: inline-block; border-radius: 99px; padding: 1px 6px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.pill-blue { color: #3c6f8a; background: var(--blue-soft); }
.pill-green { color: var(--green); background: var(--green-soft); }
.pill-amber { color: #96651b; background: var(--amber-soft); }
.pill-red { color: var(--red); background: var(--red-soft); }
.pill-muted { color: var(--muted); background: #f0ede6; }

.po-detail-head { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; background: #fbf8f1; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; }
.po-detail-customer { font-size: 17px; font-weight: 700; color: var(--ink); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.po-detail-style { font-size: 12px; color: var(--muted); margin-top: 3px; }
.po-detail-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.po-detail-meta b { color: var(--ink); }
.po-detail-money { display: flex; gap: 18px; flex: none; text-align: right; }
.po-detail-money span { display: block; font-size: 9.5px; color: var(--muted); }
.po-detail-money b { display: block; font-family: var(--num); font-size: 16px; color: var(--red); margin-top: 2px; }
.po-detail-money b.green { color: var(--green); }
.po-progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.big-progress { background: #fffdf9; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; }
.big-progress-top { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.big-progress-top b { color: var(--ink); font-family: var(--num); }
.progress-track i.blue { background: var(--blue); }
.progress-track i.amber { background: var(--amber); }
.progress-track i.red { background: var(--red); }
.progress-track i.green { background: var(--green); }
.po-tabs { margin-bottom: 10px; gap: 20px; }
.po-tab-body { min-height: 140px; }
.po-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; background: #fffdf9; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.po-info-grid div { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.po-info-grid span { color: var(--muted); flex: none; }
.po-info-grid b { color: var(--ink); font-weight: 500; text-align: right; }
.po-warnings { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.po-warning { display: flex; gap: 5px; align-items: flex-start; font-size: 10.5px; color: #8a6428; background: #fff9ef; border: 1px solid #f0dfc0; border-radius: 7px; padding: 6px 8px; line-height: 1.5; }
.po-warning .icon { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.po-ok { margin-top: 9px; font-size: 10.5px; color: var(--green); background: #f5fbf7; border: 1px solid #d6ebdf; border-radius: 7px; padding: 7px 9px; }
.po-note { font-size: 10.5px; color: var(--muted); margin-top: 9px; white-space: pre-wrap; }
.po-quick-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.po-section-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 7px; }
.po-section-head b { display: block; font-size: 12px; color: var(--ink); }
.po-section-head .tiny { display: block; margin-top: 2px; }
.po-subhead { margin: 13px 0 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.mat-list { display: flex; flex-direction: column; }
.mat-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto 52px; gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #eee9de; }
.mat-name { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.mat-sub { font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.mat-meta { font-size: 9px; color: var(--muted-2); margin-top: 1px; }
.mat-nums { display: flex; gap: 8px; font-size: 9px; color: var(--muted); }
.mat-nums b { color: var(--ink); font-family: var(--num); }
.mat-money { text-align: right; font-size: 10px; white-space: nowrap; }
.mat-money b { display: block; color: var(--ink); }
.mat-money span { font-size: 9px; color: var(--muted-2); }
.mat-actions { display: flex; gap: 1px; justify-content: flex-end; }
.mat-actions .icon-btn { width: 25px; height: 25px; }
.mat-actions .icon { width: 13px; height: 13px; }
.run-list { display: flex; flex-direction: column; gap: 7px; }
.run-card { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fffdf9; }
.run-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.run-top b { color: var(--ink); margin-right: 5px; }
.run-nums { display: flex; gap: 12px; font-size: 9.5px; color: var(--muted); margin: 4px 0; }
.run-nums b { color: var(--ink); font-family: var(--num); }
.run-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; color: var(--muted-2); margin-top: 3px; }
.run-actions { display: flex; gap: 4px; margin-top: 6px; }
.output-list { display: flex; flex-direction: column; }
.output-row { display: flex; align-items: center; gap: 8px; font-size: 9.5px; color: var(--muted); padding: 4px 0; border-bottom: 1px dashed #f0ece2; }
.output-row b { color: var(--ink); font-size: 10px; }
.output-row .icon-btn { margin-left: auto; width: 23px; height: 23px; }
.output-row .icon { width: 12px; height: 12px; }
.finance-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 10px; }
.finance-summary div { background: #fffdf9; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; }
.finance-summary span { display: block; font-size: 9px; color: var(--muted); }
.finance-summary b { display: block; font-family: var(--num); font-size: 13px; color: var(--ink); margin-top: 2px; }
.finance-summary b.green { color: var(--green); }
.finance-summary b.red { color: var(--red); }
.payment-list { display: flex; flex-direction: column; }
.payment-row { display: grid; grid-template-columns: 80px 100px 1fr; gap: 6px; font-size: 10px; padding: 5px 0; border-bottom: 1px dashed #eee9de; color: var(--muted); }
.payment-row b { color: var(--ink); }
.pick-list { display: flex; flex-direction: column; gap: 5px; }
.pick-row { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fffdf9; border-radius: 8px; padding: 8px 10px; font-size: 10px; color: var(--muted); }
.pick-row:hover { border-color: var(--green); background: var(--green-soft); }
.pick-row b { color: var(--ink); }

.line-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.line-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; box-shadow: var(--shadow-sm); }
.line-card.is-idle { opacity: .78; }
.line-head { display: flex; justify-content: space-between; gap: 8px; }
.line-name { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; gap: 5px; align-items: center; }
.line-today { text-align: right; flex: none; }
.line-today b { display: block; font-family: var(--num); font-size: 20px; color: var(--green); line-height: 1; }
.line-today span { font-size: 9px; color: var(--muted); }
.line-run { border-top: 1px dashed #eee9de; margin-top: 8px; padding-top: 7px; }
.line-run-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.line-run-title { border: 0; background: none; padding: 0; color: var(--green); font-size: 10.5px; font-weight: 600; text-align: left; }
.line-run-nums { display: flex; gap: 8px; flex-wrap: wrap; font-size: 9px; color: var(--muted); margin-top: 3px; }
.line-run-nums b { color: var(--ink); font-family: var(--num); }
.line-run-foot { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-top: 5px; font-size: 9px; color: var(--muted-2); }
.line-idle { font-size: 10px; color: var(--muted); padding: 14px 0; text-align: center; }
.line-foot { display: flex; gap: 5px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #f0ece2; }
.line-foot .btn { flex: 1; }
.mat-overview-head { font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.mat-overview-list { display: flex; flex-direction: column; }
.mat-overview-row { display: grid; grid-template-columns: minmax(0, 1.6fr) auto 100px 80px 122px; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px dashed #eee9de; }
.mat-ov-title { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.mat-ov-sub { font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.mat-ov-meta { font-size: 9px; color: var(--muted-2); margin-top: 1px; }
.mat-ov-nums { display: flex; gap: 7px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.mat-ov-nums b { color: var(--ink); font-family: var(--num); }
.mat-ov-date { font-size: 9px; color: var(--muted); }
.mat-ov-money { text-align: right; font-family: var(--num); font-size: 11px; color: var(--ink); }
.mat-ov-actions { display: flex; gap: 4px; justify-content: flex-end; }
.fin-list { display: flex; flex-direction: column; }
.fin-row { display: grid; grid-template-columns: minmax(0, 1.7fr) auto 120px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px dashed #eee9de; }
.fin-main b { display: block; font-size: 12px; color: var(--ink); }
.fin-main span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.fin-main small { display: block; font-size: 9px; color: var(--muted-2); margin-top: 1px; }
.fin-nums { display: flex; gap: 10px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.fin-nums b { color: var(--ink); font-family: var(--num); }
.fin-actions { display: flex; gap: 4px; justify-content: flex-end; }
.prod-log { margin-top: 6px; }

@media (max-width: 1100px) {
  .line-grid { grid-template-columns: 1fr 1fr; }
  .mat-overview-row { grid-template-columns: minmax(0, 1.4fr) auto 80px 76px; }
  .mat-ov-date { display: none; }
}
@media (max-width: 900px) {
  .po-list { grid-template-columns: 1fr; }
  .line-grid { grid-template-columns: 1fr; }
  .po-detail-head { flex-direction: column; gap: 8px; }
  .po-detail-money { text-align: left; gap: 20px; }
  .finance-summary { grid-template-columns: 1fr 1fr; }
  .po-meta { font-size: 10.5px; gap: 7px 10px; }
  .mini-label, .mini-text { font-size: 9.5px; }
  .mat-overview-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 11px 0;
  }
  .mat-ov-main { min-width: 0; }
  .mat-ov-nums { flex-wrap: wrap; font-size: 10px; }
  .mat-ov-date { display: block; font-size: 9.5px; white-space: nowrap; }
  .mat-ov-money { text-align: left; font-size: 12px; }
  .mat-ov-actions { justify-content: flex-start; flex-wrap: wrap; }
  .fin-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fin-nums { grid-column: 1; flex-wrap: wrap; font-size: 9.5px; }
  .fin-actions { grid-column: 2; grid-row: 1; }
  .mat-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mat-money { grid-column: 1; text-align: left; }
  .mat-actions { grid-column: 2; grid-row: 1; }
  .po-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .po-progress-grid { grid-template-columns: 1fr; }
  .po-detail-meta { gap: 7px 10px; }
  .mat-nums { flex-wrap: wrap; }
  .fin-nums { gap: 7px; }
  .po-qty b { font-size: 18px; }
  .po-tabs { gap: 12px; overflow-x: auto; }
}

/* ---------- 帮助中心 ---------- */
.help-page { max-width: 1040px; }
.help-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.help-search { flex: 1; min-width: 240px; max-width: 560px; margin: 0; }
.help-tools { display: flex; gap: 6px; }
.help-toc { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.help-toc button { border: 1px solid var(--line); background: #fffdf9; color: #5d675f; border-radius: 99px; padding: 4px 10px; font-size: 11px; }
.help-toc button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.help-grid { display: flex; flex-direction: column; gap: 10px; }
.help-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); overflow: hidden; scroll-margin-top: 16px; }
.help-card.help-hidden { display: none; }
.help-card summary { list-style: none; display: flex; align-items: center; gap: 11px; padding: 13px 15px; cursor: pointer; user-select: none; }
.help-card summary::-webkit-details-marker { display: none; }
.help-card summary > span:nth-child(2) { flex: 1; min-width: 0; }
.help-card summary b { display: block; font-size: 13.5px; color: var(--ink); }
.help-card summary small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.help-card[open] summary { border-bottom: 1px solid #f0ece2; background: #fffdf9; }
.help-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.help-ic .icon { width: 17px; height: 17px; }
.help-ic.green { background: var(--green-soft); color: var(--green); }
.help-ic.amber { background: var(--amber-soft); color: var(--amber); }
.help-ic.blue { background: var(--blue-soft); color: var(--blue); }
.help-chev { color: var(--muted-2); display: flex; flex: none; transition: transform .15s; }
.help-chev .icon { width: 16px; height: 16px; }
.help-card[open] .help-chev { transform: rotate(180deg); }
.help-body { padding: 13px 16px 15px; font-size: 12.5px; color: #46524b; line-height: 1.8; }
.help-body h3 { font-size: 12.5px; color: var(--ink); margin: 12px 0 4px; }
.help-body h3:first-child { margin-top: 0; }
.help-body p { margin: 4px 0; }
.help-body ul, .help-body ol { margin: 3px 0 8px; padding-left: 18px; }
.help-body li { margin: 3px 0; }
.help-body b { color: var(--ink); }
.help-body code { background: #f4f1e9; border: 1px solid #e8e2d5; border-radius: 4px; padding: 0 4px; font-family: var(--num); font-size: 11.5px; color: #5c4b2e; overflow-wrap: anywhere; }
.help-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 10px; }
.help-step { background: #fbf8f1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.help-step b { display: block; font-size: 12px; color: var(--green); }
.help-step span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.help-callout { background: #f5fbf7; border: 1px solid #d6ebdf; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 11.5px; line-height: 1.75; color: #456153; }
.help-callout.warn { background: #fff9ef; border-color: #f0dfc0; color: #6f5a36; }
.help-faq h3 { margin-top: 11px; }
.help-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
@media (max-width: 720px) {
  .help-toolbar { align-items: stretch; }
  .help-search { min-width: 100%; }
  .help-tools { width: 100%; }
  .help-tools .btn { flex: 1; }
  .help-steps { grid-template-columns: 1fr 1fr; }
  .help-body { padding: 12px 13px 14px; }
  .help-card summary { padding: 11px 12px; }
  .help-footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- Print ---------- */
#printRoot { display: none; }
@media print {
  html, body { background: #fff !important; }
  body > * { display: none !important; }
  #printRoot { display: block !important; }
  .print-root { position: static; }
  .print-root .sheet {
    box-shadow: none !important; margin: 0 !important; width: auto !important; min-height: 0 !important;
    padding: 0 !important; max-width: none !important;
  }
  .print-root .sheet.receipt { width: 72mm !important; }
  .no-print { display: none !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
