/* Kho Lasanra — giao diện điện thoại trước: thẻ phiếu như tem kho, chữ hẹp in hoa cho nhãn */
:root {
  --paper: #f1f3f5;
  --card: #ffffff;
  --ink: #14202c;
  --muted: #5a6573;
  --line: #d5dbe1;
  --line-strong: #b7c0ca;
  --accent: #2246b0;
  --accent-ink: #ffffff;
  --accent-soft: #e3e9fb;
  --ok: #1c6c45;
  --ok-soft: #dff1e7;
  --warn: #8a4f00;
  --warn-soft: #fbeed6;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --top: #14202c;
  --top-ink: #eef2f6;
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --tabs-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1318; --card: #161d24; --ink: #e4e9ee; --muted: #9aa5b1; --line: #2a333d; --line-strong: #3b4652;
    --accent: #8ba7ff; --accent-ink: #0e1318; --accent-soft: #1d2747; --ok: #6fcf9b; --ok-soft: #12301f;
    --warn: #f1b85c; --warn-soft: #33260f; --bad: #ff8a80; --bad-soft: #3a1c1a; --top: #0a0e12; --top-ink: #e4e9ee;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink); font: 15px/1.5 var(--f-body);
  -webkit-text-size-adjust: 100%; min-height: 100vh;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
}
body.no-tabs { padding-bottom: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; }
h2 { font-size: 22px; letter-spacing: .01em; }
h3 { font-size: 18px; letter-spacing: .02em; }
p { margin: 0; }
.mono { font-family: var(--f-mono); font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label {
  font-family: var(--f-display); font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  font-size: 12.5px; color: var(--muted);
}

/* khung */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--top); color: var(--top-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: .08em; }
.brand-mark { width: 18px; height: 18px; border: 2px solid currentColor; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; background: currentColor; }
.who { color: inherit; text-decoration: none; font-size: 13px; text-align: right; line-height: 1.25; min-width: 0; }
.who b { display: block; font-weight: 600; }
.who span { opacity: .75; }
.banner {
  background: var(--warn-soft); color: var(--warn); font-size: 13px; text-align: center;
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px));
}
.banner.demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; text-align: left; }
.banner .demo-ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.banner .demo-ctl label { display: inline; margin: 0; font-size: 13px; }
.banner .demo-ctl select { width: auto; min-height: 0; font: inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid currentColor; background: var(--card); color: var(--ink); }
.banner .btn.sm { padding: 3px 10px; min-height: 0; font-size: 13px; }
.banner.demo[hidden] { display: none; }
main {
  max-width: 820px; margin: 0 auto; display: grid; gap: 18px; outline: none;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px));
}
/* Khối con của lưới không được to hơn màn hình: bảng rộng tự cuộn trong .tbl-wrap thay vì kéo cả trang */
main > * { min-width: 0; }
.loading { color: var(--muted); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.tabs a {
  display: grid; place-items: center; gap: 2px; height: var(--tabs-h); text-decoration: none; color: var(--muted);
  font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
}
.tabs a svg { width: 22px; height: 22px; }
.tabs a.on { color: var(--accent); }
.tabs a.plus span.ic { background: var(--accent); color: var(--accent-ink); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; }

/* khối */
.stack { display: grid; gap: 12px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.empty { color: var(--muted); font-size: 14px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 4px; text-align: center; }
.err { color: var(--bad); font-size: 14px; }

/* nút */
.btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 3px; padding: 10px 16px; font-weight: 600; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.light { color: #fff; border-color: rgba(255,255,255,.6); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 140px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.quick a {
  display: grid; gap: 4px; padding: 14px; border-radius: 4px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent);
}
.quick a b { font-family: var(--f-display); font-size: 18px; letter-spacing: .02em; }
.quick a span { font-size: 13px; color: var(--muted); }

/* biểu mẫu */
label.f { display: grid; gap: 4px; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--card); border-radius: 3px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 70px; resize: vertical; }
input[type=number] { font-variant-numeric: tabular-nums; }
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

/* trạng thái */
.pill {
  display: inline-block; font-family: var(--f-display); font-weight: 600; font-size: 12.5px; letter-spacing: .07em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 3px; background: var(--paper); color: var(--muted); white-space: nowrap;
}
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.strike { text-decoration: line-through; }

/* thẻ phiếu */
.tlist { display: grid; gap: 8px; }
.tcard {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 3px;
}
.tcard.s-dang_chuyen { border-left-color: var(--accent); }
.tcard.s-nhan_lech, .tcard.s-tra_lai { border-left-color: var(--bad); }
.tcard.s-cho_duyet, .tcard.s-cho_hau_kiem { border-left-color: var(--warn); }
.tcard.s-xong { border-left-color: var(--ok); }
.tcard.s-da_nhan, .tcard.s-da_duyet { border-left-color: var(--ok); }
.tcard .code { font-family: var(--f-mono); font-weight: 500; font-size: 14px; }
.tcard .route { font-size: 14px; }
.tcard .meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.tcard .qty { text-align: right; font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1; }
.tcard .qty small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 11px; color: var(--muted); }

/* chi tiết */
.head { display: grid; gap: 6px; }
.route-big { font-family: var(--f-display); font-weight: 700; font-size: 20px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.route-big .arr { color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.facts div { display: grid; gap: 1px; min-width: 0; }
.facts b { font-weight: 500; }
.tbl-wrap { overflow-x: auto; min-width: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--paper); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.minus { color: var(--bad); font-weight: 600; }
td.plus { color: var(--ok); font-weight: 600; }
td input[type=number] { width: 84px; min-height: 38px; padding: 6px 8px; text-align: right; }
td select { min-height: 38px; padding: 6px 8px; width: auto; }
.sku { font-family: var(--f-mono); font-size: 13px; }
.sub { font-size: 12.5px; color: var(--muted); }
.log { display: grid; gap: 0; border-left: 2px solid var(--line-strong); margin-left: 6px; }
.log div { position: relative; padding: 0 0 12px 16px; font-size: 14px; }
.log div::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.log time { font-size: 12.5px; color: var(--muted); }
details.payload summary { cursor: pointer; font-size: 13px; color: var(--muted); }
details.payload pre { font-family: var(--f-mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; background: var(--paper); padding: 8px; border-radius: 3px; }

/* chọn sản phẩm */
.lines { display: grid; gap: 6px; }
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 3px;
}
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--paper); cursor: pointer; font-size: 18px; }
.stepper input { width: 56px; min-height: 40px; border: 0; border-radius: 0; text-align: center; padding: 0; }
.results { display: grid; gap: 6px; }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; text-align: left; }
.res:hover { border-color: var(--accent); }
.matrix th, .matrix td { text-align: center; padding: 6px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 58px; min-height: 38px; text-align: center; padding: 4px; }
.matrix .st { display: block; font-size: 11px; color: var(--muted); }
.sticky-foot {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); z-index: 5;
  background: var(--paper); padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px;
}
.total { font-family: var(--f-display); font-weight: 700; font-size: 18px; }

/* bộ lọc */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chips button { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chips button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* Nhiều tab (quản trị) thì xuống dòng thay vì tràn ngang trên điện thoại */
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; }
.seg button { flex: 1 1 auto; border: 0; background: var(--card); padding: 10px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

/* đăng nhập */
.login { max-width: 380px; margin: 8vh auto 0; display: grid; gap: 16px; }
.login .brand { color: var(--ink); font-size: 26px; }

/* thông báo, quét */
.toast {
  pointer-events: none; /* không che nút Gửi / Lưu nháp bên dưới */
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 520px);
  bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 4px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.bad { background: var(--bad); color: #fff; }
.scan { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; place-items: center; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: min(78vw, 360px); height: 160px; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.scan-hint { position: absolute; top: calc(18% + env(safe-area-inset-top, 0px)); color: #fff; font-size: 15px; }
.scan .btn { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 760px) {
  h1 { font-size: 34px; }
  .tcard .route { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* bảng kê in kèm hàng */
.print-sheet { display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 18px; }
.print-sheet .qr { width: 112px; height: 112px; flex: 0 0 auto; }
.print-sheet .qr svg { width: 100%; height: 100%; }
.print-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.print-table th, .print-table td { border: 1px solid var(--line-strong); padding: 6px 8px; text-align: left; }
.print-table .r { text-align: right; }
.print-table td:last-child { min-width: 64px; }
.sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: center; font-size: 14px; }
body.print-mode .top, body.print-mode .tabs, body.print-mode .banner { display: none !important; }
body.print-mode { padding-bottom: 0; }
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #000; --muted: #333; --line: #999; --line-strong: #666; color-scheme: light; }
  .top, .tabs, .banner, .toast, .no-print { display: none !important; }
  body { padding: 0; background: #fff; }
  .print-sheet { border: 0; padding: 0; }
}

/* tiến độ kiểm mã */
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }
.warn { color: var(--warn); }
.km td { vertical-align: top; }
.km .sku { white-space: nowrap; font-size: 12px; }
.km td input[type=number] { width: 56px; min-height: 40px; text-align: center; padding: 4px; }
.km th, .km td { padding-left: 6px; padding-right: 6px; }
.km .pill { margin-top: 4px; }

/* iOS tự phóng to khi chạm ô nhập chữ nhỏ hơn 16px */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
}

/* Lưới màu × size: mỗi màu một hàng, mỗi size một ô có nhãn → đủ S, M, L, XL trên màn 360–390px */
.fam-card { gap: 12px; }
.fam-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fam { display: grid; gap: 10px; }
.fam-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; align-items: center; }
.fam.stack .fam-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.fam-color { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.2; min-width: 0; }
.fam-color span { overflow-wrap: anywhere; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 1px solid var(--line-strong); }
.dot.none { background: repeating-linear-gradient(45deg, var(--paper) 0 3px, var(--line-strong) 3px 6px); }
.fam-sizes { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.sz { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 5px 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); min-width: 0; }
label.sz { cursor: text; }
.sz b { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: .04em; line-height: 1; }
.sz input { width: 100%; min-height: 34px; padding: 2px; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; text-align: center; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.sz input::-webkit-outer-spin-button, .sz input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sz input::placeholder { color: var(--line-strong); font-weight: 400; }
.sz small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sz small.zero, .sz .two.neg { color: var(--bad); }
.sz .two.nil { color: var(--muted); font-weight: 500; }
.sz.has { border-color: var(--accent); background: var(--accent-soft); }
.sz.has b { color: var(--accent); }
.sz:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.sz.none { border-style: dashed; background: transparent; color: var(--line-strong); }
.sz.none span { font-size: 18px; line-height: 34px; }
.sz.ro { gap: 3px; }
.sz.off { opacity: .55; }
.sz .two { display: flex; gap: 4px; align-items: baseline; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sz .two em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }

/* Sổ đếm nhiều mã: kẻ ô như sổ tay kho, cột size hẹp đều nhau */
.book { font-variant-numeric: tabular-nums; }
.book th, .book td { padding: 4px; border-right: 1px solid var(--line); text-align: center; }
.book th:last-child, .book td:last-child { border-right: 0; }
.book th:first-child { text-align: left; padding-left: 8px; }
.book td.mc { text-align: left; padding-left: 4px; min-width: 96px; position: relative; }
.book .vk { font-family: var(--f-mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.book td input[type=number] { width: 48px; min-height: 42px; text-align: center; padding: 4px 2px; }
.book td.na { color: var(--line-strong); }
.book td.done { color: var(--ok); font-weight: 600; background: var(--ok-soft); }
.book tr.cht td { background: var(--paper); }
.book tr.cht td input[type=number] { min-height: 34px; }
.book .x { float: right; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px 4px 6px; cursor: pointer; }
.book .x:hover, .book .x:focus-visible { color: var(--bad); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Vai Kho Văn Điển: 5 tab việc ở thanh dưới (số đỏ = việc đang chờ) */
.tabs.vd a { font-size: 12px; letter-spacing: .04em; border-top: 3px solid transparent; }
.tabs.vd a.on { border-top-color: var(--accent); background: var(--accent-soft); }
.tabs a .ic { position: relative; display: flex; }
.tabs .badge { position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: var(--bad); color: #fff; font: 600 11px/18px var(--f-body); letter-spacing: 0; text-align: center; font-style: normal; }
.tabs .badge[hidden] { display: none; }
.vd-ask { background: var(--warn-soft); border-radius: 6px; padding: 12px; }
.vd-ask h2 { color: var(--warn); }
.vd-prog .row { align-items: baseline; gap: 8px; }
.vd-big { font-family: var(--f-display); font-weight: 700; font-size: 24px; }
.vd-big small { font-size: 15px; color: var(--muted); }
.vd-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12.5px; color: var(--muted); }
.vd-3 b { display: block; font-size: 17px; color: var(--ink); }
.vd-3 b.ok-t { color: var(--ok); }
.vd-3 b.warn-t { color: var(--warn); }
.vd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vd-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px; min-height: 76px; box-sizing: border-box; text-align: left; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: inherit; cursor: pointer; }
.vd-tile small { font-size: 12.5px; color: var(--muted); }
.vd-tile.main { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vd-tile.main small { color: inherit; opacity: .85; }
.vd-tile.main span { display: flex; flex-direction: column; gap: 2px; }
.vd-tile.main .ic svg { width: 28px; height: 28px; }
.vd-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Nhận hàng kiểu sổ: số nhỏ dưới ô = số gửi; ô khác số gửi viền đỏ */
.book.recv td small { display: block; font-size: 11px; color: var(--muted); line-height: 1.2; }
.book td input.lech { border: 2px solid var(--bad); background: var(--bad-soft); color: var(--bad); }
.recv-sum { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px 0; }
.recv-sum .minus { color: var(--bad); font-weight: 600; }
.recv-sum .ok-t { color: var(--ok); font-weight: 600; }

/* Trên phiếu dạng lưới */
#lview { justify-self: start; }
.book.lgrid td.sum { font-weight: 700; color: var(--ink); min-width: 40px; }

.fam-head .fam-sum { margin-left: auto; font-weight: 700; }
.fam-head .x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; cursor: pointer; }
.fam-head .x:hover, .fam-head .x:focus-visible { color: var(--bad); }
