:root {
  --bg: #f3f0e7;
  --card: #fffdf8;
  --ink: #17231f;
  --ink-soft: #42534b;
  --muted: #7c8a82;
  --muted-2: #a3ada6;
  --line: #e5e1d5;
  --green: #1d5c46;
  --green-dark: #123b31;
  --green-deep: #0d2b23;
  --green-soft: #eaf3ec;
  --lime: #d8f36b;
  --lime-soft: #eef8cf;
  --amber: #8a5f12;
  --amber-soft: #fff4d9;
  --red: #a53b34;
  --red-soft: #fbeae7;
  --shadow: 0 8px 24px rgba(23, 48, 39, .08);
  --shadow-lg: 0 18px 50px rgba(23, 48, 39, .14);
  --radius: 16px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--green-deep); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select { font-size: 16px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
.eyebrow {
  margin: 0 0 7px;
  color: #86a48e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.2px;
}

/* Login */
.login-screen {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 480px at 100% -5%, rgba(216, 243, 107, .20), transparent 62%),
    radial-gradient(700px 520px at -20% 32%, rgba(74, 133, 106, .36), transparent 65%),
    linear-gradient(160deg, #0d2b23 0%, #123b31 55%, #174a3c 100%);
  color: #f5f8ef;
  box-shadow: 0 0 80px rgba(0, 0, 0, .35);
}
.login-glow {
  position: absolute;
  width: 320px; height: 320px;
  right: -170px; top: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 243, 107, .26), transparent 68%);
  pointer-events: none;
}
.login-brand { position: relative; display: flex; align-items: center; gap: 11px; }
.brand-mark, .m-logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(216, 243, 107, .13);
  border: 1px solid rgba(216, 243, 107, .28);
}
.brand-mark svg, .m-logo svg { width: 29px; height: 29px; }
.login-brand strong { display: block; font-size: 15px; letter-spacing: .5px; }
.login-brand small { display: block; margin-top: 3px; color: rgba(245, 248, 239, .52); font-size: 7px; letter-spacing: 2px; }
.login-copy { position: relative; margin-top: clamp(40px, 11vh, 86px); }
.login-copy h1 {
  margin: 0;
  font-size: clamp(38px, 10vw, 50px);
  line-height: 1.06;
  letter-spacing: -2.2px;
  font-weight: 750;
}
.login-copy > p:last-child { margin-top: 14px; max-width: 310px; color: rgba(245, 248, 239, .60); font-size: 11px; line-height: 1.7; }
.login-copy .eyebrow { color: var(--lime); }
.login-card {
  position: relative;
  margin-top: clamp(26px, 5vh, 46px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 19px;
  background: rgba(255, 255, 255, .075);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .16);
}
.login-card .m-field span { color: rgba(245, 248, 239, .62); }
.login-card input {
  height: 46px;
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #f5f8ef;
}
.login-card input::placeholder { color: rgba(245, 248, 239, .35); }
.login-card input:focus { border-color: rgba(216, 243, 107, .6); box-shadow: 0 0 0 3px rgba(216, 243, 107, .09); }
.login-error { margin: 10px 0 0; color: #ffb7a8; font-size: 10px; }
.login-card .m-btn { margin-top: 14px; height: 46px; background: var(--lime); color: var(--green-deep); border-color: var(--lime); }
.demo-login { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.demo-login > span { display: block; color: rgba(245, 248, 239, .42); font-size: 8px; letter-spacing: 1px; margin-bottom: 8px; }
.demo-login > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.demo-account {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  color: rgba(245, 248, 239, .76);
  font-size: 9px;
  font-weight: 600;
}
.demo-account:active { background: rgba(216, 243, 107, .16); color: var(--lime); }
.login-foot { position: relative; margin-top: auto; padding-top: 22px; text-align: center; color: rgba(245, 248, 239, .35); font-size: 8px; }

/* App shell */
.app-screen {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
  background: var(--bg);
  box-shadow: 0 0 60px rgba(0, 0, 0, .14);
}
.m-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 17px 12px;
  background: rgba(243, 240, 231, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 225, 213, .8);
}
.m-brand { display: flex; align-items: center; gap: 9px; }
.m-logo { width: 33px; height: 33px; border-radius: 9px; background: var(--green); }
.m-logo svg { width: 24px; height: 24px; }
.m-brand strong { display: block; font-size: 13px; letter-spacing: .2px; }
.m-brand small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 7px; }
.m-user {
  position: relative;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #fffdf8;
  box-shadow: 0 2px 8px rgba(18, 59, 49, .18);
}
.m-user i { position: absolute; right: -1px; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); border: 2px solid var(--bg); }
.m-main { padding: 19px 16px 12px; }
.m-view { animation: viewIn .22s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.view-head h2 { margin: 0; font-size: 29px; line-height: 1.05; letter-spacing: -1.5px; font-weight: 750; color: var(--green-deep); }
.sync-dot { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 600; }
.sync-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #58a274; }
.role-note { max-width: 145px; color: var(--muted-2); font-size: 8px; text-align: right; line-height: 1.45; }

/* Stats */
.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 15px; }
.m-stat {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(23, 48, 39, .04);
}
.m-stat.dark { background: linear-gradient(145deg, #123b31, #0d2b23); border-color: #123b31; color: #f5f8ef; }
.m-stat span { display: block; color: var(--muted-2); font-size: 8px; }
.m-stat.dark span { color: rgba(245, 248, 239, .55); }
.m-stat strong { display: block; margin-top: 8px; font-size: 26px; line-height: 1; letter-spacing: -1px; font-family: var(--mono); }
.m-stat.dark strong { color: var(--lime); }
.m-stat small { display: block; margin-top: 7px; color: var(--muted-2); font-size: 7.5px; }
.m-stat.dark small { color: rgba(245, 248, 239, .45); }

/* Search / list */
.m-search {
  display: flex; align-items: center; gap: 8px;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}
.m-search svg { width: 17px; height: 17px; color: var(--muted-2); flex: 0 0 auto; }
.m-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.m-list-head { display: flex; justify-content: space-between; margin: 15px 2px 8px; color: var(--muted); font-size: 9px; }
.m-product-list { display: flex; flex-direction: column; gap: 9px; }
.m-product {
  display: flex;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 3px 12px rgba(23, 48, 39, .035);
}
.m-product:active { background: #fbfaf4; }
.m-product-img { width: 71px; height: 82px; flex: 0 0 auto; border-radius: 10px; background: #f5f2e9; border: 1px solid #eee9dc; overflow: hidden; display: grid; place-items: center; }
.m-product-img img { width: 100%; height: 100%; object-fit: contain; }
.m-product-img svg { width: 25px; height: 25px; color: var(--muted-2); }
.m-product-body { min-width: 0; flex: 1; }
.m-product-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.m-product-top strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.35; font-weight: 650; }
.m-product-top small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stock-pill { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; font-family: var(--mono); font-size: 10px; font-weight: 700; background: var(--green-soft); color: var(--green); }
.m-stock-pill.low { background: var(--amber-soft); color: var(--amber); }
.m-stock-pill.out { background: var(--red-soft); color: var(--red); }
.m-product-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 7px; color: var(--muted); font-size: 8px; }
.m-product-meta b { color: var(--ink-soft); font-weight: 600; }
.m-product-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 8px; }
.m-price { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.m-price strong { color: var(--green); font-family: var(--mono); font-size: 15px; }
.m-price span { color: var(--muted-2); font-size: 8px; }
.m-price span b { color: var(--ink-soft); font-family: var(--mono); font-weight: 600; }
.m-mini-btn { flex: 0 0 auto; height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid #d7e4d3; background: var(--lime-soft); color: #45602b; font-size: 9px; font-weight: 650; }
.m-mini-btn:active { transform: scale(.97); }

/* Buttons and forms */
.m-btn {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .1px;
}
.m-btn.primary { background: var(--green-dark); color: #f5f8ef; }
.m-btn.primary:active { background: var(--green); }
.m-btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.m-btn.block { width: 100%; }
.m-btn:disabled { opacity: .55; cursor: wait; }
.m-form { display: flex; flex-direction: column; gap: 11px; }
.m-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.m-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.m-field > span { color: var(--muted); font-size: 9px; font-weight: 550; }
.m-field > span em { color: var(--muted-2); font-style: normal; font-weight: 400; }
.m-field input, .m-field select {
  width: 100%;
  height: 43px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--card);
  color: var(--ink);
  appearance: none;
}
.m-field select {
  background-image: linear-gradient(45deg, transparent 50%, #8c9a92 50%), linear-gradient(135deg, #8c9a92 50%, transparent 50%);
  background-position: calc(100% - 15px) 19px, calc(100% - 10px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.m-field input:focus, .m-field select:focus { border-color: #9eb8a7; box-shadow: 0 0 0 3px rgba(29, 92, 70, .07); }
.m-field input:disabled { background: #f3f1ea; color: var(--muted); }
.m-money { position: relative; }
.m-money i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-size: 11px; }
.m-money input { padding-left: 22px; }
.form-hint { color: var(--muted-2); font-size: 8px; line-height: 1.5; }

/* Scan */
.scan-card {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #dbe6cc;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5faec, #fffdf8);
}
.scan-icon { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: var(--lime-soft); color: #557326; }
.scan-icon svg { width: 20px; height: 20px; }
.scan-copy { flex: 1; min-width: 0; }
.scan-copy strong { display: block; font-size: 11px; color: var(--ink); }
.scan-copy span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.scan-arrow { color: var(--muted-2); font-size: 22px; line-height: 1; }
.scan-preview { width: 100%; max-height: 130px; object-fit: contain; margin-bottom: 11px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }

/* Restock */
.m-restock-summary { padding: 11px; border-radius: 10px; background: var(--green-soft); border: 1px solid #d5e5d9; color: var(--green); font-size: 9px; line-height: 1.55; }
.m-restock-summary strong { font-family: var(--mono); font-size: 13px; }
.m-restock-summary .shelf { display: block; margin-top: 3px; color: #52745c; }
.m-restock-empty { color: var(--muted-2); font-size: 9px; padding: 20px; text-align: center; }

.barcode-restock { margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.barcode-restock-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.barcode-restock-icon { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 7px; display: grid; place-items: center; background: #f2f0e8; color: #65746b; }
.barcode-restock-icon svg { width: 17px; height: 17px; }
.barcode-restock-head strong { display: block; color: var(--ink); font-size: 10.5px; }
.barcode-restock-head small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.barcode-restock-row { display: flex; gap: 7px; }
.barcode-restock-row input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fffdf8; color: var(--ink); font-family: var(--mono); letter-spacing: .5px; }
.barcode-restock-row input:focus { border-color: #9eb8a7; box-shadow: 0 0 0 3px rgba(29, 92, 70, .07); }
.barcode-restock-row button { flex: 0 0 auto; height: 40px; padding: 0 11px; border: 1px solid #d6e5c9; border-radius: 8px; background: var(--lime-soft); color: #526c26; font-size: 9px; font-weight: 650; }
.barcode-restock-row .barcode-scan-btn { display: inline-flex; align-items: center; gap: 3px; border-color: #d5e3d0; background: #eff5e8; color: #3f6d4e; }
.barcode-scan-btn svg { width: 13px; height: 13px; }

/* Restock list */
.restock-list-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
.restock-list-actions .m-btn { height: 45px; font-size: 12px; }
.restock-list-actions .submit-list { background: var(--green-dark); color: #fff; }
.restock-list-actions .submit-list:disabled { background: #d8d5ca; color: #989e97; }
.draft-meta { color: var(--muted); font-size: 9px; font-family: var(--mono); }
.restock-draft-list { display: flex; flex-direction: column; gap: 8px; }
.restock-draft-card { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.restock-draft-index { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); font-family: var(--mono); font-size: 8px; }
.restock-draft-body { min-width: 0; flex: 1; }
.restock-draft-body strong { display: block; color: var(--ink); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.restock-draft-body span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.restock-draft-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.restock-draft-actions strong { color: var(--green); font-family: var(--mono); font-size: 12px; }
.restock-draft-actions button { border: 0; background: transparent; color: var(--muted); font-size: 8px; padding: 1px 0; }
.restock-draft-actions button.danger { color: var(--red); }
.restock-draft-empty { padding: 28px 16px; border: 1px dashed #d7d3c5; border-radius: 12px; text-align: center; color: var(--muted-2); font-size: 9px; line-height: 1.7; background: rgba(255, 253, 248, .5); }
.restock-list-hint { margin: 11px 2px 0; color: var(--muted-2); font-size: 8px; line-height: 1.55; }
.restock-demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 8px 9px; border: 1px solid #ecd9ab; border-radius: 8px; background: #fff8e9; color: #8a6424; font-size: 8.5px; line-height: 1.4; }
.restock-demo-banner button { border: 0; background: transparent; color: var(--green); font-size: 8px; font-weight: 650; white-space: nowrap; }
.draft-demo-tag { display: inline-block; margin-left: 5px; padding: 2px 4px; border-radius: 3px; background: #fff0c8; color: #8a6424; font-style: normal; font-size: 7px; vertical-align: 1px; }
.demo-load-btn { margin-top: 9px; border: 1px solid #d6e5c9; border-radius: 7px; background: var(--lime-soft); color: #526c26; padding: 6px 10px; font-size: 8.5px; font-weight: 600; }
.restock-form-back { border: 0; background: transparent; padding: 0; color: var(--green); font-size: 9px; font-weight: 650; margin-bottom: 10px; }

/* Restock evidence / stock count */
.evidence-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 3px; }
.evidence-head span { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.evidence-head small { color: var(--muted-2); font-size: 8px; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.evidence-card {
  position: relative;
  min-height: 115px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 8px 5px;
  border: 1px dashed #d7d3c5;
  border-radius: 10px;
  background: var(--card);
  text-align: center;
  overflow: hidden;
}
.evidence-card input { display: none; }
.evidence-visual { width: 31px; height: 31px; display: grid; place-items: center; color: var(--muted-2); border-radius: 8px; background: #f4f1e8; overflow: hidden; }
.evidence-visual svg { width: 18px; height: 18px; }
.evidence-visual img { width: 100%; height: 100%; object-fit: cover; }
.evidence-card strong { color: var(--ink-soft); font-size: 9px; font-weight: 600; }
.evidence-card small { color: var(--muted-2); font-size: 7.5px; }
.evidence-card em { display: none; position: absolute; top: 5px; right: 5px; padding: 2px 4px; border-radius: 3px; background: var(--green); color: #fff; font-style: normal; font-size: 7px; }
.evidence-card.has-image { border-style: solid; border-color: #c7ddc2; background: #f7fbf1; }
.evidence-card.has-image .evidence-visual { width: 100%; height: 68px; background: #eee; }
.evidence-card.has-image .evidence-visual svg { display: none; }
.evidence-card.has-image em { display: inline-block; }
.count-button {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  margin-top: 2px; padding: 10px;
  border: 1px solid #dbe6cc; border-radius: 11px;
  background: #f7fbf1; text-align: left;
}
.count-button.done { border-color: #b8d5b8; background: #eef8e9; }
.count-check { width: 29px; height: 29px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #e6efdf; color: #637c3d; }
.count-check svg { width: 16px; height: 16px; }
.count-button.done .count-check { background: var(--green); color: var(--lime); }
.count-copy { flex: 1; min-width: 0; }
.count-copy strong { display: block; font-size: 10px; color: var(--ink); }
.count-copy small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.count-go { flex: 0 0 auto; color: var(--green); font-size: 8.5px; font-weight: 650; }
.count-button.done .count-go { color: var(--green); }
.count-system { margin-bottom: 12px; color: var(--muted); font-size: 10px; }
.count-system strong { color: var(--green); font-family: var(--mono); font-size: 17px; }
.count-warning { margin-bottom: 11px; padding: 9px 10px; border: 1px solid #f0d3a8; border-radius: 8px; background: #fff6e8; color: #916327; font-size: 9px; line-height: 1.5; }
.count-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.count-option { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 11px; border: 1px solid #dbe6cc; border-radius: 10px; background: #f7fbf1; text-align: left; }
.count-option.mismatch { border-color: #eedfc6; background: #fffaf0; }
.count-option-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #e4f0dd; color: #567431; }
.count-option.mismatch .count-option-icon { background: #fff0d2; color: #9a6a16; }
.count-option-icon svg { width: 16px; height: 16px; }
.count-option strong { font-size: 11px; color: var(--ink); }
.count-option small { color: var(--muted-2); font-size: 8px; line-height: 1.35; }
.count-mismatch { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.count-mismatch .m-field { gap: 6px; }
.count-inputs { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 10px; }
.count-inputs .m-field { gap: 6px; }
.count-note { margin: 0 0 12px; color: var(--muted-2); font-size: 9px; line-height: 1.6; }
.approval-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 9px 0; }
.approval-compare > div { padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf4; }
.approval-compare span { display: block; color: var(--muted-2); font-size: 8px; }
.approval-compare strong { display: inline-block; margin-top: 3px; color: var(--ink); font-family: var(--mono); font-size: 15px; }
.approval-compare small { margin-left: 2px; color: var(--muted-2); font-size: 8px; }
.approval-check-note { margin: -3px 0 9px; color: #916327; font-size: 8.5px; line-height: 1.5; }

/* Profile */
.profile-card { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.profile-avatar { width: 47px; height: 47px; border-radius: 50%; display: grid; place-items: center; background: var(--green-dark); color: var(--lime); font-size: 17px; font-weight: 700; }
.profile-card > div:nth-child(2) { flex: 1; }
.profile-card strong { display: block; font-size: 15px; }
.profile-card span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.role-badge { flex: 0 0 auto !important; display: inline-block !important; padding: 4px 7px; border-radius: 5px; background: var(--lime-soft); color: #526c26 !important; font-size: 8px !important; font-weight: 650; }
.permission-list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.permission-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 9.5px; }
.permission-row span:last-child { color: var(--green); font-size: 8.5px; font-weight: 650; }
.permission-row.denied span:last-child { color: var(--red); }
.profile-panel { margin-bottom: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.profile-panel h3 { margin: 0 0 7px; font-size: 11px; }
.profile-panel p { color: var(--muted); font-size: 9px; line-height: 1.7; }
.profile-panel b { color: var(--ink-soft); font-family: var(--mono); font-weight: 600; }
.version-note { margin: 16px 0 4px; text-align: center; color: var(--muted-2); font-size: 8px; }

/* Approvals */
.approval-tools {
  position: sticky; top: 70px; z-index: 8;
  margin-bottom: 10px; padding: 9px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255, 253, 249, .96); box-shadow: 0 5px 18px rgba(23, 48, 39, .06);
  backdrop-filter: blur(12px);
}
.approval-filters { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.approval-filters::-webkit-scrollbar { display: none; }
.approval-filter {
  flex: 0 0 auto; min-height: 36px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--muted);
  font-size: 10.5px; font-weight: 650; white-space: nowrap;
}
.approval-filter b {
  display: inline-block; min-width: 16px; margin-left: 3px; padding: 1px 4px;
  border-radius: 999px; background: #f0ede3; color: var(--muted); font-size: 9px;
}
.approval-filter.active { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.approval-filter.active b { background: rgba(255, 255, 255, .16); color: #fff; }
.approval-batch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.approval-select-all { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; color: var(--ink-soft); font-size: 10.5px; font-weight: 650; }
.approval-select-all input { width: 19px; height: 19px; margin: 0; accent-color: var(--green); }
.approval-selected { margin-right: auto; color: var(--muted); font-size: 10px; }
.approval-retention { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.approval-retention select { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fffdf8; color: var(--green); padding: 0 5px; font-size: 10px; }
.approval-batch-btn {
  min-height: 36px; padding: 0 11px; border: 1px solid var(--green-dark);
  border-radius: 7px; background: var(--green-dark); color: #fff;
  font-size: 10.5px; font-weight: 700;
}
.approval-batch-btn:disabled { border-color: var(--line); background: #e7e5dc; color: #9ca49d; }
.approval-check {
  width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center;
  margin-right: 3px; border-radius: 8px;
}
.approval-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.approval-card-top { align-items: flex-start; }
.approval-card-top .approval-card-product { flex: 1; }
.approval-status-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
  border: 1px solid transparent;
}
.approval-status-pill i {
  width: 14px; height: 14px; display: inline-grid; place-items: center;
  border-radius: 50%; font-size: 9px; font-style: normal; line-height: 1;
}
.approval-status-pill.ok { background: #e6f3e7; color: #176b45; border-color: #cbe4ce; }
.approval-status-pill.ok i { background: #176b45; color: #fff; }
.approval-status-pill.error { background: #fde8e4; color: #a33a32; border-color: #f1ccc5; }
.approval-status-pill.error i { background: #a33a32; color: #fff; }
.approval-status-pill.movement { background: #fff4d9; color: #8a5f12; border-color: #efddb2; }
.approval-status-pill.movement i { background: #8a5f12; color: #fff; }
.approval-status-detail {
  margin-top: -2px; font-size: 9.5px; font-weight: 650;
}
.approval-status-detail.ok { color: var(--green); }
.approval-status-detail.error { color: var(--red); }
.approval-status-detail.movement { color: #8a5f12; }
.approval-card-items { display: flex; flex-wrap: wrap; gap: 5px; }
.approval-item-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 6px; border-radius: 5px;
  background: #f4f1e8; color: var(--ink-soft); font-size: 9.5px;
}
.approval-item-tag em { font-style: normal; font-weight: 700; }
.approval-item-tag em.ok { color: var(--green); }
.approval-item-tag em.error { color: var(--red); }
.approval-item-tag em.movement { color: #8a5f12; }
.approval-check:focus-within { outline: 2px solid var(--green); outline-offset: 1px; }
.approval-card.is-demo { border-color: #e7d2a2; background: #fffdf6; }
.approval-demo-tag { display: inline-block; margin-right: 5px; padding: 2px 4px; border-radius: 3px; background: #fff0c8; color: #8a6424; font-style: normal; font-size: 7px; vertical-align: 1px; }
.approval-warning.demo-warning { background: #fff0c8; color: #8a6424; }
.approval-note { margin-bottom: 11px; padding: 9px 10px; border: 1px solid #ecd9ab; border-radius: 8px; background: #fff8e9; color: #8a6424; font-size: 8.5px; line-height: 1.5; }
.approval-head-actions { display: flex; gap: 5px; }
.approval-refresh { border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--green); padding: 5px 9px; font-size: 8.5px; font-weight: 600; }
.approval-card { display: flex; flex-direction: column; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.approval-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.approval-card-product { min-width: 0; }
.approval-card-product strong { display: block; font-size: 11px; color: var(--ink); }
.approval-card-product span { display: block; margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.approval-card-qty { flex: 0 0 auto; color: var(--green); font-family: var(--mono); font-size: 15px; font-weight: 700; }
.approval-card-qty small { display: block; color: var(--muted-2); font-family: var(--font); font-size: 7px; font-weight: 400; text-align: right; }
.approval-card-info { display: flex; flex-wrap: wrap; gap: 3px 9px; color: var(--muted); font-size: 8px; }
.approval-card-info b { color: var(--ink-soft); font-weight: 600; }
.approval-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid #f0ede5; }
.approval-meta { color: var(--muted-2); font-size: 7.5px; }
.approval-open { border: 0; background: transparent; color: var(--green); font-size: 8.5px; font-weight: 650; }
.approval-empty { padding: 35px 14px; border: 1px dashed #d7d3c5; border-radius: 12px; text-align: center; color: var(--muted-2); font-size: 9px; line-height: 1.6; }
.approval-badge { position: absolute; top: -2px; right: 21%; min-width: 13px; height: 13px; padding: 0 3px; border-radius: 7px; background: var(--red); color: #fff; font-size: 7px; line-height: 13px; font-style: normal; text-align: center; }
.approval-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.approval-item:first-of-type { border-top: 0; }
.approval-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.approval-item-head strong { color: var(--ink); font-size: 10px; line-height: 1.4; }
.approval-item-head span { flex: 0 0 auto; color: var(--green); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.approval-mismatch { margin: 9px 0; padding: 9px 10px; border: 1px solid #e7c99c; border-radius: 8px; background: #fff8e9; }
.approval-mismatch strong { display: block; color: #8a6424; font-size: 9px; }
.approval-mismatch > span { display: block; margin-top: 3px; color: #9a7330; font-size: 8px; line-height: 1.45; }
.approval-mismatch-fields { display: grid; grid-template-columns: .7fr 1.3fr; gap: 7px; margin-top: 7px; }
.approval-mismatch-fields label { display: flex; flex-direction: column; gap: 3px; color: #8a6424; font-size: 7.5px; }
.approval-mismatch-fields input { height: 34px; min-width: 0; border: 1px solid #e7d2a2; border-radius: 6px; background: #fffdf8; padding: 0 7px; color: var(--ink); font-size: 10px; }
.approval-sales {
  margin: 9px 0; padding: 9px 10px;
  border: 1px solid #d9e4d5; border-radius: 9px; background: #f7fbf3;
}
.approval-sales-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.approval-sales-head strong { color: var(--ink-soft); font-size: 10.5px; }
.approval-sales-head span { color: var(--green); font-size: 9.5px; font-weight: 650; }
.sale-order-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sale-order-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 5px 4px 7px; border-radius: 5px;
  background: #fff; border: 1px solid #d7e4d3;
  color: var(--ink-soft); font-size: 9.5px;
}
.sale-order-tag button {
  width: 20px; height: 20px; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); font-size: 14px; line-height: 1;
}
.sale-order-tag button:active { background: var(--red-soft); color: var(--red); }
.sale-order-empty { color: var(--muted); font-size: 9.5px; }
.sale-order-add { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 5px; margin-top: 7px; }
.sale-order-add select, .sale-order-add input {
  min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 6px;
  background: #fffdf8; padding: 0 6px; color: var(--ink); font-size: 10.5px;
}
.sale-order-add button {
  height: 36px; padding: 0 9px; border: 1px solid #bad3b5; border-radius: 6px;
  background: var(--lime-soft); color: #45602b; font-size: 10px; font-weight: 700;
}
.approval-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 9px 0 12px; }
.approval-photo { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #f6f3ea; }
.approval-photo img { width: 100%; height: 92px; object-fit: cover; display: block; }
.approval-photo span { display: block; padding: 5px 7px; color: var(--muted); font-size: 7.5px; }
.approval-save-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 2px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.approval-save-row span { color: var(--ink-soft); font-size: 9px; font-weight: 600; }
.approval-save-row select { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fffdf8; color: var(--green); font-size: 10px; padding: 0 7px; }
.doc-archive-note { margin-bottom: 11px; color: var(--muted-2); font-size: 8.5px; line-height: 1.55; }
.document-list { display: flex; flex-direction: column; gap: 8px; }
.document-card { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.document-icon { width: 31px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: #eef4e7; color: #52704a; font-size: 12px; font-weight: 700; }
.document-body { flex: 1; min-width: 0; }
.document-body strong { display: block; font-size: 9.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-body span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.document-download { flex: 0 0 auto; border: 1px solid #d6e5c9; border-radius: 7px; background: var(--lime-soft); color: #526c26; padding: 6px 8px; font-size: 8px; font-weight: 650; }
.document-empty { padding: 25px 12px; border: 1px dashed #d7d3c5; border-radius: 10px; text-align: center; color: var(--muted-2); font-size: 9px; }
.approval-info { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 8.5px; color: var(--muted); }
.approval-info b { display: block; color: var(--ink-soft); font-weight: 600; margin-bottom: 2px; }
.approval-warning { margin: 9px 0; padding: 8px 9px; border-radius: 7px; background: var(--amber-soft); color: var(--amber); font-size: 8.5px; line-height: 1.5; }
.approval-doc { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 35px; margin-top: 10px; border: 1px solid #d6e5c9; border-radius: 8px; background: var(--lime-soft); color: #526c26; font-size: 9px; font-weight: 650; }
.approval-actions { display: flex; gap: 7px; margin-top: 12px; }
.approval-actions .m-btn { flex: 1; }
.approval-actions .reject { background: var(--red-soft); border-color: #f0d4cf; color: var(--red); }
.approval-actions .approve { background: var(--green-dark); color: #fff; }

/* Bottom nav */
.m-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 30;
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.m-nav-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--muted-2); font-size: 8px; }
.m-nav-item svg { width: 21px; height: 21px; }
.m-nav-item.active { color: var(--green); }
.m-nav-item.active svg { filter: drop-shadow(0 2px 4px rgba(29, 92, 70, .12)); }
.m-nav-item.active span { font-weight: 700; }

/* Sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(10, 28, 22, .42); backdrop-filter: blur(2px); }
.m-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 41;
  width: min(100%, 480px);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 20px 17px calc(22px + env(safe-area-inset-bottom));
  border-radius: 21px 21px 0 0;
  background: var(--bg);
  box-shadow: 0 -18px 50px rgba(9, 26, 21, .2);
  animation: sheetUp .25s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-grab { width: 36px; height: 4px; border-radius: 4px; background: #d6d1c3; margin: 0 auto 17px; }
.sheet-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #e8e4d8; color: var(--ink-soft); font-size: 20px; line-height: 1; }
.m-sheet h2 { margin: 0 0 13px; font-size: 23px; letter-spacing: -1px; color: var(--green-deep); }
.m-sheet .eyebrow { margin-bottom: 4px; }
.sheet-product { display: flex; gap: 11px; margin-bottom: 13px; }
.sheet-product .m-product-img { width: 76px; height: 88px; }
.sheet-product-body { min-width: 0; flex: 1; }
.sheet-product-body h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.sheet-product-body p { margin: 4px 0 0; color: var(--muted-2); font-size: 9px; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.sheet-tag { padding: 3px 6px; border-radius: 4px; background: #f0ede4; color: var(--muted); font-size: 8px; }
.sheet-price-row { display: flex; gap: 8px; margin-bottom: 12px; }
.sheet-price-box { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.sheet-price-box span { display: block; color: var(--muted-2); font-size: 7.5px; }
.sheet-price-box strong { display: block; margin-top: 4px; font-family: var(--mono); font-size: 14px; color: var(--green); }
.sheet-section-title { display: flex; align-items: center; justify-content: space-between; margin: 15px 0 7px; color: var(--muted); font-size: 9px; }
.sheet-section-title b { font-weight: 650; color: var(--ink-soft); }
.sheet-batch { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #ebe7db; font-size: 8.5px; color: var(--muted); }
.sheet-batch:last-child { border-bottom: 0; }
.sheet-batch strong { color: var(--ink-soft); font-family: var(--mono); font-size: 9.5px; min-width: 68px; }
.sheet-batch span { flex: 1; }
.sheet-batch b { color: var(--green); font-family: var(--mono); white-space: nowrap; }
.sheet-actions { display: flex; gap: 7px; margin-top: 14px; }
.sheet-actions .m-btn { flex: 1; }
.sheet-actions .danger { background: var(--red-soft); color: var(--red); border-color: #f0d4cf; }

/* Toast */
.m-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 40px);
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--green-deep);
  color: #f5f8ef;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease both;
}
.m-toast.error { background: #6f2a24; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 700px) {
  body { background: #0b2620; }
  .app-screen, .login-screen { margin-top: 0; }
}

/* ─────────────────────────────────────────────────────────────
   DESIGN PASS · quiet ledger, mobile
   Thumb-first, legible Chinese labels, calmer hierarchy.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #eef1e9;
  --card: #fffdf9;
  --ink: #14221c;
  --ink-soft: #37463e;
  --muted: #536158;
  --muted-2: #5f6d64;
  --line: #dfdbcf;
  --green: #1b5a44;
  --green-dark: #102b23;
  --green-soft: #e7f1ea;
  --lime-soft: #eef7d2;
}
html { color-scheme: light; }
body { font-size: 14px; line-height: 1.5; text-rendering: optimizeLegibility; }
button, a { -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.985); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(29, 92, 70, .55); outline-offset: 1px; }
.eyebrow { display: none !important; }
.m-view { animation: none; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--lime); color: var(--green-dark); }

.m-top { padding-top: calc(13px + env(safe-area-inset-top)); padding-bottom: 13px; }
.m-brand strong { font-size: 15px; }
.m-brand small { color: var(--muted); font-size: 9.5px; letter-spacing: .04em; }
.m-user { width: 44px; height: 44px; font-size: 13px; }
.m-main { padding: 18px 16px 14px; }
.view-head { align-items: center; margin-bottom: 18px; }
.view-head h2 { font-size: 30px; line-height: 1.04; letter-spacing: -.045em; }
.sync-dot { padding: 6px 9px; font-size: 11px; }
.role-note { color: var(--muted); font-size: 10px; }

.m-stats { gap: 10px; margin-bottom: 17px; }
.m-stat { min-height: 100px; padding: 14px; border-radius: 14px; }
.m-stat strong, .m-price strong, .m-stock-pill { font-variant-numeric: tabular-nums; }
.m-stat span { color: var(--muted); font-size: 11px; }
.m-stat strong { margin-top: 9px; font-size: 30px; letter-spacing: -.045em; }
.m-stat small { color: var(--muted-2); font-size: 10.5px; margin-top: 8px; }
.m-stat.dark span { color: rgba(245, 248, 239, .72); }
.m-stat.dark small { color: rgba(245, 248, 239, .64); }

.m-search { height: 48px; border-radius: 12px; }
.m-search input { font-size: 16px; }
.m-list-head { margin: 17px 2px 9px; color: var(--muted); font-size: 11.5px; }
.m-product-list { gap: 10px; }
.m-product { gap: 12px; padding: 12px; border-radius: 14px; }
.m-product-img { width: 76px; height: 88px; border-radius: 9px; }
.m-product-top strong { font-size: 14.5px; line-height: 1.35; }
.m-product-top small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.m-stock-pill { padding: 4px 7px; font-size: 11px; }
.m-product-meta { gap: 5px 9px; margin-top: 8px; color: var(--muted); font-size: 10.5px; }
.m-product-bottom { margin-top: 9px; }
.m-price strong { font-size: 16px; }
.m-price span { color: var(--muted); font-size: 10px; }
.m-mini-btn { min-height: 34px; padding: 0 10px; font-size: 11px; }

.m-btn { min-height: 46px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.m-btn.primary:active { background: var(--green); }
.m-form { gap: 13px; }
.m-field > span { color: var(--muted); font-size: 11.5px; }
.m-field input, .m-field select { height: 48px; border-radius: 8px; }
.form-hint { color: var(--muted); font-size: 10px; }
.scan-copy strong { font-size: 12px; }
.scan-copy span { color: var(--muted); font-size: 10px; }
.scan-icon { width: 38px; height: 38px; border-radius: 10px; }

.m-restock-summary { padding: 12px; }
.m-restock-summary strong { font-size: 14px; }
.barcode-restock-head strong { font-size: 12px; }
.barcode-restock-head small { font-size: 9.5px; }
.barcode-restock-row input, .barcode-restock-row button { height: 44px; }
.barcode-restock-row button { font-size: 10.5px; }

.restock-list-actions .m-btn { height: 46px; font-size: 13px; }
.draft-meta { color: var(--muted); font-size: 10px; }
.restock-draft-card { padding: 12px; }
.restock-draft-body strong { font-size: 12px; }
.restock-draft-body span { color: var(--muted); font-size: 10px; }
.restock-draft-actions strong { font-size: 13px; }
.restock-draft-actions button { min-height: 32px; padding: 0 4px; font-size: 10.5px; }
.restock-list-hint { color: var(--muted); font-size: 10px; }
.restock-demo-banner { font-size: 10px; }

.evidence-head span { color: var(--ink-soft); font-size: 11.5px; }
.evidence-head small { color: var(--muted); font-size: 10px; }
.evidence-card { padding: 8px 7px; border-radius: 10px; }
.evidence-card strong { font-size: 10.5px; }
.evidence-card small { color: var(--muted); font-size: 9px; }
.evidence-card em { min-height: 18px; padding: 3px 5px; font-size: 8px; }
.evidence-card.has-image .evidence-visual { height: 72px; }
.count-button { min-height: 58px; padding: 11px; }
.count-copy strong { font-size: 11.5px; }
.count-copy small { color: var(--muted); font-size: 10px; }
.count-go { font-size: 10px; }
.count-option { min-height: 76px; padding: 12px; }
.count-option strong { font-size: 12px; }
.count-option small { color: var(--muted); font-size: 10px; }
.count-warning { font-size: 10.5px; }

.approval-card { padding: 12px; }
.approval-card-product strong { font-size: 12px; }
.approval-card-product span { color: var(--muted); font-size: 10px; }
.approval-card-qty { font-size: 16px; }
.approval-card-qty small { font-size: 9px; }
.approval-card-info { color: var(--muted); font-size: 10px; }
.approval-meta { color: var(--muted); font-size: 9.5px; }
.approval-open { min-height: 34px; font-size: 10.5px; }
.approval-badge { top: -4px; right: 16%; min-width: 16px; height: 16px; line-height: 16px; font-size: 9px; }
.approval-item-head strong { font-size: 11.5px; }
.approval-item-head span { font-size: 13px; }
.approval-info { color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.approval-warning { font-size: 10.5px; line-height: 1.55; }
.approval-mismatch strong { font-size: 11px; }
.approval-mismatch > span { font-size: 10.5px; line-height: 1.55; }
.approval-mismatch > span b { font-size: 11.5px; }
.approval-photo img { height: 104px; }
.approval-photo span { color: var(--muted); font-size: 9.5px; }
.approval-save-row span { font-size: 10.5px; }
.approval-save-row select { height: 40px; font-size: 12px; }
.approval-doc { min-height: 42px; font-size: 10.5px; }
.doc-archive-note { color: var(--muted); font-size: 10px; }
.document-card { padding: 12px; }
.document-body strong { font-size: 11px; }
.document-body span { color: var(--muted); font-size: 9.5px; }
.document-download { min-height: 36px; padding: 0 9px; font-size: 9.5px; }
.document-empty { color: var(--muted); font-size: 10.5px; }

.m-sheet { padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); }
.m-sheet h2 { margin-bottom: 14px; font-size: 26px; letter-spacing: -.04em; }
.sheet-close { width: 44px; height: 44px; font-size: 22px; }
.sheet-product-body h3 { font-size: 17px; }
.sheet-product-body p { color: var(--muted); font-size: 10.5px; }
.sheet-tag { color: var(--muted); font-size: 9.5px; }
.sheet-price-box span { color: var(--muted); font-size: 10px; }
.sheet-price-box strong { font-size: 15px; }
.sheet-section-title { color: var(--muted); font-size: 10.5px; }
.sheet-batch { color: var(--muted); font-size: 10.5px; }
.sheet-batch strong { font-size: 11px; }
.sheet-actions .m-btn { min-height: 44px; }

.m-nav { padding: 8px 9px calc(8px + env(safe-area-inset-bottom)); }
.m-nav-item { min-height: 52px; justify-content: center; color: var(--muted); font-size: 10px; }
.m-nav-item svg { width: 22px; height: 22px; }
.m-nav-item.active { color: var(--green); }
.app-screen { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.m-toast { bottom: calc(106px + env(safe-area-inset-bottom)); padding: 10px 14px; font-size: 11.5px; line-height: 1.5; }

.login-brand strong { font-size: 16px; }
.login-brand small { color: rgba(245, 248, 239, .68); font-size: 9.5px; }
.login-copy > p:last-child { color: rgba(245, 248, 239, .72); font-size: 12px; }
.login-card .m-field span { color: rgba(245, 248, 239, .76); font-size: 11.5px; }
.login-card input { height: 48px; }
.login-error { color: #ffc7bb; font-size: 11.5px; }
.demo-login > span { color: rgba(245, 248, 239, .62); font-size: 10px; }
.demo-account { min-height: 44px; font-size: 10.5px; }
.login-foot { color: rgba(245, 248, 239, .58); font-size: 9.5px; }

/* Keep functional labels legible without losing the compact, thumb-first rhythm. */
.m-brand small { font-size: 11px; }
.m-product-top small { font-size: 12px; }
.m-product-meta { font-size: 11px; }
.m-price span { font-size: 11px; }
.m-mini-btn { min-height: 44px; }
.m-nav-item { font-size: 11px; }
.approval-info { font-size: 11px; }
.approval-open { min-height: 44px; }
.document-download { min-height: 44px; }
.restock-draft-actions button { min-height: 40px; }
.login-brand small { font-size: 11px; }
.demo-login > span { font-size: 11px; }
.demo-account { font-size: 11px; }
.login-foot { font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Result dialog / manager notification */
.m-alert {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(16, 32, 26, .55);
}
.m-alert[hidden] { display: none; }
.m-alert-card {
  width: 100%; max-width: 320px;
  padding: 22px 18px 16px;
  border-radius: 18px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: alertIn .22s ease both;
}
.m-alert-icon {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
}
.m-alert-icon.ok { background: #e9f4df; color: #3f6b2c; }
.m-alert-icon.warn { background: #fff1d6; color: #9a6a16; }
.m-alert-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--ink); }
.m-alert-card p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.m-alert-meta { margin-top: 9px; padding: 8px 10px; border-radius: 8px; background: #f4f1e6; color: var(--muted); font-size: 10px; line-height: 1.6; }
.m-alert-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
@keyframes alertIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Restock history */
.restock-head { align-items: flex-start; }
.m-btn.small { flex: 0 0 auto; width: auto; min-width: 84px; padding: 0 13px; height: 36px; font-size: 11px; border-radius: 10px; }
.restock-filter { display: flex; gap: 8px; margin: 4px 0 12px; }
.restock-filter-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 11px; font-weight: 650; }
.restock-filter-btn b { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.restock-filter-btn.active { border-color: var(--green); background: #eef4e6; color: var(--green); }
.restock-filter-btn.active b { color: var(--green); }
.restock-history { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.history-group-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 7px; color: var(--ink-soft); font-size: 11px; }
.history-group-head span { color: var(--muted-2); font-size: 9px; }
.history-card { position: relative; padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.history-card strong { display: block; padding-right: 60px; font-size: 12px; line-height: 1.45; color: var(--ink); }
.history-card > span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.history-status { position: absolute; top: 10px; right: 10px; padding: 3px 7px; border-radius: 6px; font-size: 8.5px; font-weight: 650; }
.history-status.ok { background: #e9f4df; color: #3f6b2c; }
.history-status.warn { background: #fff1d6; color: #9a6a16; }
.history-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; color: var(--muted); font-size: 9px; }
.restock-history-empty { padding: 34px 16px; text-align: center; color: var(--muted-2); font-size: 10px; line-height: 1.8; }

.m-offline-tag { color: #5f7a35 !important; font-weight: 650; }

.m-load-more { width: 100%; margin: 12px 0 22px; padding: 12px; border-radius: 12px; border: 1px solid #cfdccf; background: #fff; color: var(--green); font-weight: 650; }

.role-badge.plain { background: transparent !important; color: var(--muted) !important; padding: 0 !important; font-weight: 600; }

.restock-bottom { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(246, 248, 242, 0), var(--bg) 35%); }

#view-restock { display: flex; flex-direction: column; min-height: calc(100vh - 190px); }
#view-restock .restock-history { flex: 1; }

.evidence-thumbs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.evidence-thumbs img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.evidence-card .no-damage { display: grid; place-items: center; height: 100%; color: var(--green); font-size: 10px; font-weight: 700; }
.m-choice { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .38); display: flex; align-items: flex-end; }
.m-choice[hidden] { display: none !important; }
.m-choice-panel { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.m-choice-panel strong { font-size: 13px; margin-bottom: 2px; }
.m-choice-panel button { padding: 13px; border-radius: 12px; border: 1px solid #dfe8da; background: #f7fbf1; font-weight: 650; font-size: 14px; }
.m-choice-panel button.cancel { background: #fff; color: #7a8a80; }

.evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.evidence-card { min-height: 148px; }

.restock-product-empty { padding: 14px; border: 1px dashed #cfdccf; border-radius: 12px; color: var(--muted); font-size: 11px; text-align: center; }
.restock-product-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #cfdccf; border-radius: 12px; background: #fff; text-align: left; }
.restock-product-card img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #f4f6ef; }
.restock-product-copy { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.restock-product-copy strong { font-size: 12px; line-height: 1.35; }
.restock-product-copy small { color: var(--muted); font-size: 10px; }
.restock-product-arrow { color: var(--muted); font-size: 20px; }
.restock-info-layer { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; }
.restock-info-layer[hidden] { display: none !important; }
.restock-info-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .4); }
.restock-info-panel { position: relative; width: 100%; max-height: 82vh; overflow: auto; background: #fff; border-radius: 18px 18px 0 0; padding: 16px; }
.restock-info-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.restock-info-panel header button { border: 0; background: transparent; font-size: 22px; color: var(--muted); }
.restock-info-images { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.restock-info-images figure { margin: 0; border: 1px solid #e4ebdf; border-radius: 12px; overflow: hidden; background: #f7faf3; }
.restock-info-images img { width: 100%; height: 150px; object-fit: contain; display: block; }
.restock-info-images figcaption { padding: 6px; text-align: center; font-size: 10px; color: var(--muted); }
.restock-info-panel p { font-size: 12px; line-height: 1.5; margin: 10px 0 6px; }
.restock-info-code { font-size: 11px; color: var(--muted); }
.restock-info-code b { color: var(--ink); font-family: var(--mono); }

.restock-info-images figure.empty::after { content: "未上传"; display: grid; place-items: center; height: 150px; color: var(--muted); font-size: 11px; }

.restock-product-copy strong { white-space: normal; word-break: break-word; }

.restock-search-list { max-height: 45vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.restock-search-item { text-align: left; padding: 10px; border-radius: 10px; border: 1px solid #e4ebdf; background: #fff; display: flex; flex-direction: column; gap: 3px; }
.restock-search-item strong { font-size: 12px; line-height: 1.35; }
.restock-search-item small { color: var(--muted); font-size: 10px; }

.barcode-restock-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr; }
.barcode-restock-row input { width: 100%; }
.barcode-restock-row button { width: 100%; padding: 0 6px; }

.barcode-restock-row button { display: flex; align-items: center; justify-content: center; text-align: center; }

.restock-info-specs { margin-top: 14px; border-top: 1px solid #eef2ea; padding-top: 10px; }
.restock-info-spec-title { font-size: 12px; font-weight: 650; margin-bottom: 6px; }
.restock-info-spec { width: 100%; display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px; border: 1px solid #e4ebdf; border-radius: 10px; background: #fff; margin-bottom: 6px; text-align: left; }
.restock-info-spec span { font-weight: 600; font-size: 12px; }
.restock-info-spec small { color: var(--muted); font-size: 10px; }

.batch-scan-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 10px; border: 1px dashed #cfdccf; border-radius: 12px; background: #f7fbf1; }
.batch-scan-icon { width: 32px; height: 32px; border-radius: 8px; background: #e9f3df; color: #3f6d4e; display: grid; place-items: center; }
.batch-scan-icon svg { width: 18px; height: 18px; }
.batch-scan-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.batch-scan-copy strong { font-size: 11px; }
.batch-scan-copy small { font-size: 9px; color: var(--muted); }
.batch-scan-arrow { color: var(--muted); font-size: 18px; }

.scan-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scan-card-compact { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px; text-align: center; min-height: 122px; }
.scan-card-compact strong { font-size: 12px; }
.scan-compact-hint { font-size: 9px; color: var(--muted); line-height: 1.4; text-align: center; }

.batch-confirm-field { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.batch-confirm-field span { width: 44px; color: var(--muted); font-size: 12px; }
.batch-confirm-field input { flex: 1; height: 40px; border: 1px solid #dfe8da; border-radius: 8px; padding: 0 10px; background: #fff; }

.restock-info-price { margin-top: 6px; font-size: 12px; color: var(--ink); }
.restock-info-price b { color: #0f766e; font-size: 14px; }

.m-stat.clickable { cursor: pointer; }
.m-stat.clickable:active { transform: scale(.99); }
.m-dash-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef2ea; }
.m-dash-row strong { font-size: 12px; line-height: 1.4; }
.m-dash-row small { color: var(--muted); font-size: 10px; }
.m-dash-row b { text-align: right; font-size: 14px; white-space: nowrap; }
.m-dash-row b.pos { color: #15803d; }
.m-dash-row b.neg { color: #d64545; }

.m-dash-clear { border: 0; background: #eef5e6; color: #526c26; border-radius: 6px; padding: 3px 8px; font-size: 10px; }
.m-stat.active { outline: 2px solid #d9f27d; }
.m-dash-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #eef2ea; }
.m-dash-item strong { font-size: 12px; line-height: 1.4; }
.m-dash-item small { color: var(--muted); font-size: 10px; }
.m-dash-item b { text-align: right; font-size: 14px; white-space: nowrap; }
.m-dash-item b.pos { color: #15803d; }
.m-dash-item b.neg { color: #d64545; }
