/* Kho Lạnh An An — bản điện thoại.
   Dùng trong kho lạnh, thường đeo găng: vùng bấm lớn (≥ 48px), chữ đậm, tương phản cao.
   Điểm nhấn duy nhất: con số "còn lại" của từng lô — to, đậm, căn phải. Mọi thứ khác giữ yên. */

:root {
  /* ===== CHẾ ĐỘ SÁNG (mặc định) — "Băng sạch" (bản mới, đồng bộ app PC C# 1.43+); trước đó Mẫu B (ĐT 1.43): trắng / đen chuẩn; trước đó là giao diện "Kho Lạnh" 5.0: nền xám-xanh nhạt, hành động chính xanh dương,
     màu trạng thái cố định (xanh lá = đủ / xong · vàng cam = chờ / sắp hết · đỏ = lỗi / xoá). Chữ / nền ≥ 4,5:1 (WCAG AA).
     Đổi chế độ: html[data-theme="dark"] (khối ngay dưới). Mọi màu trong file dùng các biến này —
     KHÔNG viết mã màu cứng mới, thêm biến ở cả 2 khối. Tên biến (--cobalt…) giữ nguyên cho đỡ phải sửa code. */
  --frost: #F4F6F9;     /* nền trang */
  --paper: #FFFFFF;     /* nền thẻ / ô */
  --ink: #1A2433;       /* chữ chính */
  --muted: #5D6B78;     /* chữ phụ (7,0:1) */
  --line: #DDE3EA;      /* viền */
  --cobalt: #1F6FD6;    /* hành động chính (6,4:1 trên trắng) */
  --on-cobalt: #FFFFFF;
  --cobalt-soft: #E6F0FC;
  --amber: #9A5B00;     /* chờ / sắp hết — vàng cam */
  --amber-soft: #FFF2D6;
  --on-amber: #FFFFFF;
  --green: #1E7B4A;
  --green-soft: #E3F4EA;
  --red: #B42318;
  --red-soft: #FDE8E6;
  /* thanh trên cùng — nền trắng, chữ đậm */
  --top-bg: #FFFFFF; --top-text: #1A2433; --top-muted: #5D6B78; --top-warn: #9A5B00; --top-press: rgba(0,0,0,.08); --top-line: #DDE3EA;
  --brand-a: #1F6FD6; --brand-b: #7FB3F0;
  /* khối "đảo màu" (thông báo nổi, chip đang chọn, thanh chọn nhiều) */
  --inverse-bg: #1A2433; --inverse-text: #FFFFFF;
  --seg-bg: #EDF1F6;        /* nền nhóm nút chuyển (segmented) */
  --chip-bg: #EDF1F6;       /* nhãn nhỏ (size…) */
  --field-bg: #FFFFFF;      /* ô nhập */
  --field-ph: #7A8797;      /* chữ gợi ý ô nhập (5,6:1) */
  --picked-bg: #E6F0FC;     /* dòng đang được chọn */
  --muted-bg: #F1F4F8;      /* ô mờ / không chọn được */
  --empty-text: #7A8797;    /* số của dòng hết hàng */
  --totalbar-bg: #FFFFFF;   /* thanh tổng dưới cùng */
  --btn-disabled: #E3E8EF; --btn-disabled-text: #5D6B78;
  --check-border: #7A8797;
  --shadow-rgb: 0,0,0;   /* bóng đổ */
  --ks-pass-border: #B5DEC6; --ks-pass-bg: #E3F4EA; --ks-fail-border: #F3BDB7; --ks-fail-bg: #FDE8E6;
  --ks-none-bg: #F1F4F8; --ks-pill-bg: #EDF1F6; --ks-pill-nd-bg: #F1F4F8; --ks-pill-nd-text: #5D6B78;
  --ks-pill-bad-bg: #FDE8E6; --ks-pill-bad-text: #B42318;
  --ks-pass: #1E7B4A; --ks-fail: #B42318; --ks-none: #5D6B78;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  color-scheme: light;
}

/* ===== CHẾ ĐỘ TỐI — mẫu "D · Chế độ tối" (đỡ chói trong kho) ===== */
html[data-theme="dark"] {
  /* Tối thiết kế riêng của "Băng sạch" (giống app PC C#: AppTheme.DesignedDark); trước đó Mẫu 5 "Đen than chì": nền gần đen, xám trung tính, màu nhấn / trạng thái dịu. */
  --frost: #12161C;
  --paper: #1A2028;
  --ink: #E5EAF0;
  --muted: #9AA4AF;
  --line: #333C47;
  --cobalt: #4C93EA;
  --on-cobalt: #0D1117;
  --cobalt-soft: #1C2E45;
  --amber: #E3A447;
  --amber-soft: #3A2C12;
  --on-amber: #000000;
  --green: #4CC287;
  --green-soft: #173327;
  --red: #F07468;
  --red-soft: #3E1D1A;
  --top-bg: #12161C; --top-text: #E5EAF0; --top-muted: #9AA4AF; --top-warn: #E3A447; --top-press: rgba(255,255,255,.10); --top-line: #333C47;
  --brand-a: #4C93EA; --brand-b: #E5EAF0;
  --inverse-bg: #E5EAF0; --inverse-text: #12161C;
  --seg-bg: #20272F;
  --chip-bg: #20272F;
  --field-bg: #12161C;
  --field-ph: #808C99;
  --picked-bg: #1C2E45;
  --muted-bg: #20272F;
  --empty-text: #808C99;
  --totalbar-bg: #1A2028;
  --btn-disabled: #2B333D; --btn-disabled-text: #808C99;
  --check-border: #808C99;
  --shadow-rgb: 0,0,0;
  --ks-pass-border: #2E6B4C; --ks-pass-bg: #173327; --ks-fail-border: #7A3A35; --ks-fail-bg: #3E1D1A;
  --ks-none-bg: #20272F; --ks-pill-bg: #20272F; --ks-pill-nd-bg: #1A2028; --ks-pill-nd-text: #808C99;
  --ks-pill-bad-bg: #3E1D1A; --ks-pill-bad-text: #F07468;
  --ks-pass: #4CC287; --ks-fail: #F07468; --ks-none: #808C99;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* body KHÔNG được cố định height:100% — nếu không, khối chứa của thanh trên (sticky) chỉ cao đúng 1 màn hình
   và thanh trên trôi mất khi cuộn, để thanh tìm kiếm dính lơ lửng giữa màn hình. */
html { margin: 0; height: 100%; }
body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: calc(16px * var(--fs, 1));
  line-height: 1.45;
  color: var(--ink);
  background: var(--frost);
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--top-bg); color: var(--top-text);
  padding: calc(var(--safe-top) + 8px) 16px 10px;
  border-bottom: 1px solid var(--top-line);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 14px; height: 14px; border-radius: 3px;
  background: linear-gradient(135deg, var(--brand-a) 0 50%, var(--brand-b) 50% 100%);
}
.brand-name { font-weight: 700; font-size: calc(18px * var(--fs, 1)); letter-spacing: -0.01em; }
.topbar-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 48px; height: 48px; border: 0; border-radius: 12px;
  background: transparent; color: var(--top-text); display: grid; place-items: center;
}
.icon-btn:active { background: var(--top-press); }
.icon-btn.is-busy svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.freshness { font-size: calc(13px * var(--fs, 1)); color: var(--top-muted); min-height: 18px; }
.freshness b { color: var(--top-text); font-weight: 700; }
.freshness .fr-miss { color: var(--top-warn); }
.freshness.is-stale { color: var(--top-warn); }

/* ---------- Khung chính ---------- */
main { padding: 12px 12px calc(var(--tabbar-h) + var(--safe-bottom) + 88px); max-width: 760px; margin: 0 auto; }
.search-row { position: sticky; top: var(--topbar-h, 86px); z-index: 10; padding: 4px 0 8px; background: var(--frost); }
.search {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper);
  font-size: calc(16px * var(--fs, 1));
}
.search:focus { border-color: var(--cobalt); outline: none; }
/* ---------- Lọc theo nhiều cột (nút cạnh ô tìm kiếm + chip + bảng trượt) ---------- */
.search-flex { display: flex; gap: 8px; align-items: center; }
.search-flex .search { flex: 1; min-width: 0; }
/* 2 ô tìm song song ở tab Kho: thu nhỏ đệm/chữ để vừa màn hình điện thoại cùng nút lọc */
#xuatSearch, #xuatSearch2 { padding: 0 10px; font-size: calc(15px * var(--fs, 1)); }
.filter-btn { position: relative; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); color: var(--muted); display: grid; place-items: center; }
.filter-btn svg { width: 22px; height: 22px; }
.filter-btn.has-filter { border-color: var(--cobalt); background: var(--cobalt-soft); color: var(--cobalt); }
.filter-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--cobalt); color: var(--on-cobalt); font-size: calc(11px * var(--fs, 1)); font-weight: 700; display: grid; place-items: center; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filter-chips:empty { margin-top: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 10px; border: 0; border-radius: 10px; background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; font-size: calc(13px * var(--fs, 1)); }
.filter-chip svg { width: 13px; height: 13px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.filter-grid .field { min-width: 0; }
.cf-pick { width: 100%; min-height: 50px; padding: 10px 12px 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font-size: calc(16px * var(--fs, 1)); text-align: left; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.cf-pick.has { border-color: var(--cobalt); background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; }
.cf-pick-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-pick-n { flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--cobalt); color: var(--on-cobalt); font-size: calc(12px * var(--fs, 1)); display: grid; place-items: center; }
.cf-pick svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.cfp-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin: 8px 0; }
.cfp-actions .btn, .cfp-actions .btn + .btn { min-height: 44px; font-size: calc(14px * var(--fs, 1)); margin: 0; }
.cfp-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 40vh; overflow: auto; border: 1.5px solid var(--line); border-radius: 12px; }
.cfp-list li + li { border-top: 1px solid var(--line); }
.cfp-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; }
.cfp-item input { flex: 0 0 auto; width: 22px; height: 22px; accent-color: var(--cobalt); }
.cfp-t { flex: 1; min-width: 0; word-break: break-all; font-size: calc(15px * var(--fs, 1)); }
.cfp-item em { font-style: normal; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.cfp-more { padding: 12px 14px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }

.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: calc(15px * var(--fs, 1)); color: var(--muted); }
.toggle input { width: 22px; height: 22px; accent-color: var(--cobalt); }
.list-meta { font-size: calc(13px * var(--fs, 1)); color: var(--muted); padding: 4px 4px 8px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: 14px; margin-bottom: 8px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented.three .seg { font-size: calc(14px * var(--fs, 1)); white-space: nowrap; padding: 0 4px; }
.seg { height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted); }
.seg.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.12); }

/* ---------- Danh sách ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; }
.list:empty { display: none; }
.row { border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-btn {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 14px 16px; border: 0; background: transparent; text-align: left; min-height: 72px;
}
.row-btn:active { background: var(--frost); }
.row-title { font-weight: 600; font-size: calc(15.5px * var(--fs, 1)); line-height: 1.35; }
.row-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.row-sub b { font-weight: 600; color: var(--ink); }
.row.is-empty .row-title { color: var(--muted); }
.row.in-cart { box-shadow: inset 4px 0 0 var(--cobalt); }

/* con số "còn lại" — điểm nhấn của ứng dụng */
.qty { text-align: right; min-width: 76px; }
.qty-num { font-size: calc(28px * var(--fs, 1)); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.qty-unit { font-size: calc(12px * var(--fs, 1)); color: var(--muted); margin-top: 2px; }
.qty-kg { font-size: calc(12px * var(--fs, 1)); color: var(--muted); margin-top: 1px; font-weight: 600; }
.qty-wait { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--amber); background: var(--amber-soft); white-space: nowrap; }
.row.is-empty .qty-num { color: var(--empty-text); }

.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; font-size: calc(13px * var(--fs, 1)); }

.details { margin: 0; padding: 0 16px 14px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: calc(14px * var(--fs, 1)); }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; }
/* ĐT 1.35 — chi tiết dòng phiếu Vị trí (M01VT): thẻ từng dòng đủ Mã · Vị trí · Đặc tính · Hợp đồng · SL · Net + nút đổi hiển thị mã */
.vtl-wrap { padding: 0 16px 14px; }
.ma-mode { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font-size: calc(13.5px * var(--fs, 1)); color: var(--muted); }
.ma-mode .segmented { flex: 1; margin: 0; }
.ma-mode .seg { height: 38px; font-size: calc(13.5px * var(--fs, 1)); padding: 0 6px; }
.vtl { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--paper); }
.vtl-top { display: flex; align-items: flex-start; gap: 10px; }
.vtl-n { flex: 0 0 auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--muted-bg); color: var(--muted); font-size: calc(12px * var(--fs, 1)); font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.vtl-code { flex: 1; min-width: 0; }
.vtl-code b { display: block; font-size: calc(15.5px * var(--fs, 1)); word-break: break-all; line-height: 1.3; }
.vtl-code small { display: block; margin-top: 2px; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); word-break: break-all; }
.vtl-qty { flex: 0 0 auto; text-align: right; }
.vtl-qty b { display: block; font-size: calc(20px * var(--fs, 1)); line-height: 1.1; }
.vtl-qty small { font-size: calc(11.5px * var(--fs, 1)); color: var(--muted); }
.vtl-kv { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: calc(13.5px * var(--fs, 1)); }
.vtl-kv span { word-break: break-word; }
.vtl-kv i { font-style: normal; color: var(--muted); margin-right: 5px; }
.vtl-tot { text-align: right; font-size: calc(14px * var(--fs, 1)); color: var(--muted); padding: 2px 2px 0; }
.vtl-tot b { color: var(--ink); }

.more-btn { display: block; width: 100%; height: 52px; margin-top: 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); font-weight: 600; color: var(--cobalt); }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--paper); border-radius: var(--radius-lg); }
.empty strong { display: block; color: var(--ink); font-size: calc(16px * var(--fs, 1)); margin-bottom: 4px; }

/* trạng thái phiếu */
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; white-space: nowrap; }
.status.wait { color: var(--amber); background: var(--amber-soft); }
.status.done { color: var(--green); background: var(--green-soft); }
.status.err { color: var(--red); background: var(--red-soft); }

/* ---------- Thanh phiếu đang soạn ---------- */
.cartbar {
  position: fixed; left: 12px; right: 12px; z-index: 25;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px);
  max-width: 736px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 10px 18px; border: 0; border-radius: 16px;
  background: var(--cobalt); color: var(--on-cobalt); text-align: left;
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb),.30);
}
.cartbar-text { font-size: calc(15px * var(--fs, 1)); }
.cartbar-text b { font-size: calc(17px * var(--fs, 1)); }
.cartbar-cta { font-weight: 700; white-space: nowrap; }

/* ---------- Dòng tổng số lượng ---------- */
.totalbar {
  position: fixed; left: 0; right: 0; z-index: 28;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 6px 18px;
  background: var(--totalbar-bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(var(--shadow-rgb),.08);
}
.totalbar-label { font-size: calc(14px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.totalbar-label small, .totalbar-value small { font-size: calc(12.5px * var(--fs, 1)); font-weight: 500; color: var(--muted); }
.totalbar-value { font-size: calc(20px * var(--fs, 1)); font-weight: 700; color: var(--cobalt); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* khi có dòng tổng: đẩy thanh phiếu đang soạn lên trên nó và chừa chỗ cuối danh sách */
body.has-totalbar .cartbar { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 58px); }
body.has-totalbar main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 88px + 48px); }

/* ---------- Thanh tab dưới ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; /* tự chia đều theo số tab đang hiện (phân quyền có thể ẩn tab) */
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--paper); border-top: 1px solid var(--line);
}
.tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--muted); white-space: nowrap; padding: 0 2px; }
.tab.is-on { color: var(--cobalt); }
.tab.is-on svg { stroke-width: 2.4; }

/* ---------- Bảng trượt ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(var(--shadow-rgb),.55); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 760px; margin: 0 auto; max-height: 88vh; overflow: auto;
  background: var(--paper); border-radius: 22px 22px 0 0;
  padding: 8px 18px calc(18px + var(--safe-bottom));
  animation: sheet-in .2s ease-out;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .icon-btn.is-busy svg { animation: none; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { font-size: calc(20px * var(--fs, 1)); margin: 0 0 4px; letter-spacing: -0.01em; }
.sheet .lead { color: var(--muted); font-size: calc(14px * var(--fs, 1)); margin: 0 0 16px; }

.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; margin: 12px 0 8px; }
.stepper button { height: 64px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--frost); font-size: calc(28px * var(--fs, 1)); font-weight: 600; }
.stepper input { height: 64px; text-align: center; font-size: calc(32px * var(--fs, 1)); font-weight: 700; border: 1.5px solid var(--cobalt); border-radius: 16px; font-variant-numeric: tabular-nums; width: 100%; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.quick button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: calc(14px * var(--fs, 1)); font-weight: 600; margin-bottom: 6px; }
.field small { display: block; font-size: calc(13px * var(--fs, 1)); color: var(--muted); margin-top: 4px; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font-size: calc(16px * var(--fs, 1)); }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--cobalt); outline: none; }

.btn { display: block; width: 100%; min-height: 56px; border-radius: 14px; border: 0; font-weight: 700; font-size: calc(16px * var(--fs, 1)); }
.btn + .btn { margin-top: 10px; }
.btn-primary { background: var(--cobalt); color: var(--on-cobalt); }
.btn-primary:disabled { background: var(--btn-disabled); color: var(--btn-disabled-text); }
.btn-ghost { background: var(--frost); color: var(--ink); }
/* Nút phụ: nền trắng, viền + chữ màu nhấn (Lưu = nút chính, Gửi qua… = nút phụ) */
.btn-outline { background: var(--paper); color: var(--cobalt); border: 2px solid var(--cobalt); }
.btn-danger { background: transparent; color: var(--red); min-height: 48px; }

.cart-items { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .ci-qty { display: flex; align-items: center; gap: 6px; }
.cart-item .ci-qty input { width: 76px; height: 48px; text-align: center; font-size: calc(18px * var(--fs, 1)); font-weight: 700; border: 1.5px solid var(--line); border-radius: 10px; }
.cart-item .ci-remove { width: 44px; height: 48px; border: 0; background: transparent; color: var(--red); display: grid; place-items: center; }
.cart-item.is-over input { border-color: var(--red); color: var(--red); }
.cart-item .ci-warn { grid-column: 1 / -1; font-size: calc(13px * var(--fs, 1)); color: var(--red); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; padding: 0 2px 14px; }

.notice { padding: 12px 14px; border-radius: 12px; font-size: calc(14px * var(--fs, 1)); margin-bottom: 14px; white-space: pre-line; }
.notice.err { background: var(--red-soft); color: var(--red); }
.notice.ok { background: var(--green-soft); color: var(--green); }

/* ---------- Thông báo nhanh ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 50;
  top: calc(var(--topbar-h, 86px) + 8px);
  max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 14px;
  background: var(--inverse-bg); color: var(--inverse-text); font-size: calc(15px * var(--fs, 1)); box-shadow: 0 8px 24px rgba(var(--shadow-rgb),.3);
}
.toast.is-err { background: var(--red); }

@media (min-width: 700px) {
  .row-btn { padding: 16px 20px; }
}

/* bỏ mũi tên tăng/giảm của ô số — đã có nút − / + to hơn */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* hàng chọn nguồn xuất (5 nguồn) — cuộn ngang được trên màn hình hẹp */
.src-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; scrollbar-width: none; }
.src-row::-webkit-scrollbar { display: none; }
.src-chip { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; color: var(--muted); white-space: nowrap; }
.src-chip small { font-weight: 500; font-size: calc(11px * var(--fs, 1)); opacity: .7; margin-left: 2px; }
.src-chip.is-on { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-text); }
.field select { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font-size: calc(16px * var(--fs, 1)); }
.field select:focus { border-color: var(--cobalt); outline: none; }
.fmt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.fmt-btn { min-height: 76px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.fmt-btn small { font-weight: 500; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.fmt-btn:disabled { opacity: .5; }
/* Trang Báo cáo (renderBaoCao): nhóm theo nguồn, 1 thẻ / file */
.bc-lead { color: var(--muted); font-size: calc(14px * var(--fs, 1)); margin: 4px 0 0; }
.bc-group { margin-bottom: 18px; }
.bc-group .sec-title small { font-weight: 500; color: var(--muted); font-size: calc(12px * var(--fs, 1)); margin-left: 6px; }
.bc-note { color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.rep-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; background: var(--paper); }
.rep-card h3 { margin: 0 0 4px; font-size: calc(16px * var(--fs, 1)); color: var(--ink, inherit); }
.rep-card .rep-sub { color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin: 0 0 10px; }
.rep-card .rep-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rep-card .rep-btns .btn { margin: 0; }
/* Xem trước báo cáo (chạm vào thẻ) */
.rep-card[data-rview] { cursor: pointer; }
.rep-card .rep-peek { float: right; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--cobalt); }
.rp-cap { font-size: calc(13px * var(--fs, 1)); color: var(--muted); margin: 0 0 8px; }
.rp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; max-height: 58vh; overflow-y: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--fs, 1)); }
.rp-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rp-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.rp-table tr.rp-head td { font-weight: 700; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); text-transform: uppercase; letter-spacing: .02em; }
.rp-table tr.rp-total td { font-weight: 800; color: var(--cobalt); }
.rp-table tr.rp-gap td { padding: 4px; border-bottom: 0; }
.rp-table tr.rp-group td { font-weight: 700; background: var(--cobalt-soft); }
.rp-sum td small { font-weight: 500; color: var(--muted); }
.rp-sum .rp-nil { color: var(--muted); font-weight: 400; }
.rp-grand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin: -2px 0 12px;
  border-radius: 12px; background: var(--cobalt); color: var(--on-cobalt); }
.rp-grand span { font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.rp-grand b { font-size: calc(18px * var(--fs, 1)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-grand small { font-size: calc(13px * var(--fs, 1)); font-weight: 500; opacity: .85; }
.rp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.rp-btns .btn { margin: 0; }
/* Chọn ngày báo cáo (openReport → renderAsk), 3 ô dd / mm / yyyy giống hộp PC */
.rep-date { display: flex; align-items: flex-end; gap: 8px; margin: 4px 0 10px; }
.rep-date label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.rep-date label.rep-y { flex: 1.6 1 0; }
.rep-date input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: inherit;
  font: inherit; font-size: calc(20px * var(--fs, 1)); font-weight: 600; text-align: center; padding: 0 6px; }
.rep-date > b { padding-bottom: 12px; color: var(--muted); font-size: calc(18px * var(--fs, 1)); }
.rep-date-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: calc(14px * var(--fs, 1)); color: var(--muted); margin-bottom: 14px; }
.rep-name { margin-bottom: 14px; }
.rep-name small .rep-link { padding: 0; font-size: inherit; }
.rep-link[hidden] { display: none; }
.rep-link { border: 0; background: none; color: var(--cobalt); font: inherit; font-weight: 600; padding: 6px 0; }
.file-name { font-size: calc(14px * var(--fs, 1)); word-break: break-all; padding: 10px 12px; background: var(--frost); border-radius: 10px; margin-bottom: 14px; }
.row-actions { padding: 0 16px 14px; }
.row-actions .btn { min-height: 46px; font-size: calc(15px * var(--fs, 1)); }

/* Tổng hợp (Module 08) */
.m8-sub { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: 14px; margin-bottom: 8px; }
.m8-sub .seg.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.12); }
.code-input { width: 100%; height: 56px; padding: 0 16px; border: 1.5px solid var(--cobalt); border-radius: 14px; background: var(--paper);
  font-size: calc(18px * var(--fs, 1)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.decode { list-style: none; margin: 10px 0 0; padding: 0; background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; }
.decode li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.decode li:last-child { border-bottom: 0; }
.decode .d-name { font-weight: 600; }
.decode .d-range { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.decode .d-code { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; font-size: calc(18px * var(--fs, 1)); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.decode .d-val { grid-column: 1; font-size: calc(15px * var(--fs, 1)); }
.decode .d-val.miss { color: var(--amber); }
.seg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.seg-chips button { min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.seg-chips button.is-on { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.kv b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ks-frame { width: 100%; border: 0; border-radius: var(--radius-lg); background: var(--paper);
  height: calc(100vh - var(--topbar-h, 86px) - var(--tabbar-h) - var(--safe-bottom) - 130px); min-height: 420px; }

/* =====================================================================================
   BỐ CỤC MỚI (4 tab: Trang chủ · Kho · Phiếu · Tra cứu) — xem PhacThao_BoCuc_DienThoai.html
   ===================================================================================== */
.tab { position: relative; }
.tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: var(--amber); color: var(--on-amber); font-size: calc(11px * var(--fs, 1)); font-weight: 700; display: grid; place-items: center; }
.sec-title { margin: 18px 4px 8px; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  display: flex; justify-content: space-between; align-items: baseline; }
.sec-title small { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: calc(12.5px * var(--fs, 1)); }

/* ---- Trang chủ ---- */
.home-search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 14px; color: var(--muted); }
.home-search:focus-within { border-color: var(--cobalt); }
.home-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: calc(16px * var(--fs, 1)); color: var(--ink); }
.home-search svg { flex: 0 0 auto; width: 20px; height: 20px; }
.home-search .home-scan { flex: 0 0 auto; width: 40px; height: 40px; margin-right: -8px; border: 0; border-radius: 10px; display: grid; place-items: center; background: var(--cobalt); color: #fff; cursor: pointer; }
.home-search .home-scan svg { width: 22px; height: 22px; }
.hsec { margin: 22px 2px 10px; font-size: calc(15px * var(--fs, 1)); font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; }
.hsec small { font-weight: 500; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.kho-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kho-tile { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 12px 14px; text-align: left;
  display: flex; flex-direction: column; gap: 3px; min-height: 96px; color: var(--ink); }
.kho-tile .kt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.kho-tile .kt-top b { font-size: calc(15px * var(--fs, 1)); }
.kho-tile .kt-top small { font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.kho-tile .kt-num { font-size: calc(20px * var(--fs, 1)); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kho-tile .kt-num small { font-size: calc(12px * var(--fs, 1)); font-weight: 500; color: var(--muted); }
.kho-tile .kt-sub { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.kho-tile.is-empty .kt-num { font-size: calc(14px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.pill { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; white-space: nowrap; }
.pill.wait { color: var(--amber); background: var(--amber-soft); }
.pill.soan { color: var(--cobalt); background: var(--cobalt-soft); }
/* Vị trí Bột: nhãn hạn dùng (đỏ = đã hết hạn, cam = còn < 10 ngày — như cột "HSD (ngày)" trên PC) */
.pill.hsd-het { color: var(--red); background: var(--red-soft); }
.pill.hsd-sap { color: var(--amber); background: var(--amber-soft); }
.pill.chuyen { color: var(--cobalt); background: var(--cobalt-soft); }
/* Vị trí Bột: 3 nút lọc nhanh theo hạn dùng */
.hsd-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: 14px; margin: 4px 0 6px; }
.hsd-quick[hidden] { display: none; }
.hsd-quick button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--muted); padding: 0 2px; }
.hsd-quick button b { font-weight: 800; }
.hsd-quick button.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.12); }
.hsd-quick button[data-hsdq="sap"].is-on { color: var(--amber); }
.hsd-quick button[data-hsdq="het"].is-on { color: var(--red); }
.home-hint { font-size: calc(13px * var(--fs, 1)); color: var(--muted); padding: 4px 4px 8px; }

/* ---- Kho: nút chọn kho + dòng hàng 1 dòng (Mã · Vị trí/Lô · SL) ---- */
.kho-picker { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; margin-bottom: 8px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; }
.kho-picker > svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--cobalt); }
.kho-picker .kp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kho-picker .kp-text b { font-size: calc(16px * var(--fs, 1)); }
.kho-picker .kp-text small { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.kho-picker .kp-chev { width: 20px; height: 20px; color: var(--muted); }
.list-head { display: grid; grid-template-columns: minmax(0, 1fr) var(--kp-w, 66px) var(--kq-w, 64px); gap: 6px; padding: 0 12px 6px; font-size: calc(11px * var(--fs, 1)); font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.list-head span:nth-child(2) { text-align: center; }
.list-head span:nth-child(3) { text-align: right; }
/* Bấm tiêu đề cột để sắp xếp: tăng dần → giảm dần → bỏ sắp xếp */
.list-head > [data-sort] { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; padding: 4px 0; }
.list-head > [data-sort].sorted { color: var(--cobalt); }
.list-head > [data-sort].sorted::after { content: attr(data-arrow); margin-left: 3px; }
.krow { width: 100%; border: 0; background: transparent; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; color: var(--ink); }
.krow:active { background: var(--frost); }
.krow .k1 { display: grid; grid-template-columns: minmax(0, 1fr) var(--kp-w, 66px) var(--kq-w, 64px); gap: 6px; align-items: center; }
.krow .k-code { font-weight: 700; font-size: calc(var(--k-fs, 12.5px) * var(--fs, 1)); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.krow .k-place { text-align: center; padding: 3px 5px; border-radius: 8px; background: var(--cobalt-soft); color: var(--cobalt); font-weight: 700; font-size: calc(var(--k-fs, 12.5px) * var(--fs, 1));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krow .k-place.none { background: transparent; color: var(--muted); font-weight: 500; }
.krow .k-qty { text-align: right; white-space: nowrap; }
.krow .k-qty b { font-size: calc(var(--kq-fs, 18px) * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.krow .k-qty small { font-size: calc(11px * var(--fs, 1)); color: var(--muted); }
.krow .k2 { display: flex; align-items: center; gap: 6px; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); min-width: 0; }
.krow .k-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.is-empty .krow .k-qty b, .row.is-empty .krow .k-code { color: var(--empty-text); }

/* ---- Bảng chọn kho ---- */
.kho-opt { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left; color: var(--ink); }
.kho-opt:last-child { border-bottom: 0; }
.kho-opt .ko-mark { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 14px; border: 2px solid var(--line); box-sizing: border-box; display: grid; place-items: center; }
.kho-opt.is-on .ko-mark { background: var(--cobalt); border-color: var(--cobalt); }
.kho-opt.is-on .ko-mark svg { width: 16px; height: 16px; color: var(--on-cobalt); stroke-width: 3; }
.kho-opt .ko-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kho-opt .ko-text b { font-size: calc(16px * var(--fs, 1)); }
.kho-opt .ko-text small { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.kho-opt .ko-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.kho-opt .ko-right b { font-variant-numeric: tabular-nums; }
.kho-opt .ko-right small { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }

/* ---- Chi tiết dòng hàng ---- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0 0 14px; }
.facts div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.facts dt { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: calc(14.5px * var(--fs, 1)); word-break: break-word; }
.q3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.q3 div { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.q3 small { font-size: calc(12px * var(--fs, 1)); }
.q3 b { font-size: calc(20px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.q3 .q-wait { background: var(--amber-soft); color: var(--amber); }
.q3 .q-con { background: var(--cobalt-soft); color: var(--cobalt); }

/* ---- Phiếu: 4 nhóm ---- */
.pseg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: 14px; margin-bottom: 10px; }
.pseg button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--muted); padding: 0 2px; }
.pseg button b { font-weight: 800; }
.pseg button.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.12); }
.draft-card { background: var(--paper); border: 1.5px solid var(--cobalt); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.draft-card .dc-top { display: flex; justify-content: space-between; gap: 10px; }
.draft-card .dc-top b { font-size: calc(16px * var(--fs, 1)); }
.draft-card .dc-lines { display: flex; flex-direction: column; gap: 4px; font-size: calc(13px * var(--fs, 1)); }
.draft-card .dc-lines div { display: flex; justify-content: space-between; gap: 10px; }
.draft-card .dc-lines span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-card .dc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.draft-card .dc-actions .btn, .draft-card .dc-actions .btn + .btn { min-height: 46px; margin: 0; font-size: calc(15px * var(--fs, 1)); }

/* Nhãn Size có tiền tố đọc từ mã hàng (BTP 50, TGC 51/60…) — đầu dòng 2 của dòng hàng */
.krow .k-size { flex-shrink: 0; padding: 1px 7px; border-radius: 6px; background: var(--chip-bg); color: var(--ink); font-weight: 700; font-size: calc(12px * var(--fs, 1)); white-space: nowrap; }

/* Nút dạng chữ trong dòng đếm (VD "hiện lại", "ẩn tất cả" ở danh sách phiếu) */
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opt-row .toggle { flex: 0 1 auto; min-width: 0; }
.sort-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--cobalt); font-weight: 600; font-size: calc(14px * var(--fs, 1)); }
.sort-pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600;
  padding: 0 16px 0 0; max-width: 170px; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 7px) 55%, calc(100% - 2px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.sort-pick.on { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.sort-pick.on select { color: var(--on-cobalt); }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta-row .list-meta { flex: 1 1 auto; min-width: 0; }
.multi-btn { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--cobalt); font: inherit; font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.multi-btn[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
/* Ô tick ở đầu dòng khi đang chọn nhiều */
body.multi .krow { position: relative; padding-left: 50px; }
body.multi .krow::before { content: ''; position: absolute; left: 14px; top: 50%; width: 24px; height: 24px; margin-top: -12px;
  border: 2px solid var(--check-border); border-radius: 7px; background: var(--paper); }
body.multi .row.picked .krow { background: var(--picked-bg); }
body.multi .row.picked .krow::before { border-color: var(--cobalt); background: var(--cobalt)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E") center/16px no-repeat; }
body.multi .row.no-pick .krow { opacity: .45; }
body.multi .row.no-pick .krow::before { background: var(--muted-bg); border-style: dashed; }
.multibar { position: fixed; left: 12px; right: 12px; z-index: 26; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px);
  max-width: 736px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 62px; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--inverse-bg); color: var(--inverse-text); box-shadow: 0 8px 24px rgba(var(--shadow-rgb),.35); }
body.has-totalbar .multibar { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 58px); }
.multibar-text { font-size: calc(14px * var(--fs, 1)); line-height: 1.3; min-width: 0; }
.multibar-text b, .multibar-text span { display: block; white-space: nowrap; }
.multibar-text b { font-size: calc(16px * var(--fs, 1)); }
.multibar-text span { font-size: calc(13px * var(--fs, 1)); opacity: .85; }
.multibar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.multibar-actions button { height: 42px; padding: 0 14px; border-radius: 12px; font: inherit; font-weight: 700; font-size: calc(14px * var(--fs, 1)); border: 0; }
.mb-ghost { background: color-mix(in srgb, var(--inverse-text) 14%, transparent); color: var(--inverse-text); }
.mb-main { background: var(--inverse-text); color: var(--inverse-bg); }
.mb-main:disabled { opacity: .5; }
.linkbtn { border: 0; background: none; padding: 2px 0; color: var(--cobalt); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Tra cứu kháng sinh (giao diện riêng điện thoại) ---------- */
.ks-top { margin-bottom: 4px; }
.ks-title { font-size: calc(20px * var(--fs, 1)); margin: 2px 2px 10px; color: var(--ink); }
.ks-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 12px; }
.ks-head { display: flex; align-items: center; justify-content: space-between; }
.ks-head b { font-size: calc(16px * var(--fs, 1)); }
.ks-hint { font-size: calc(13px * var(--fs, 1)); color: var(--muted); margin: 4px 0 10px; }
.ks-note { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); margin: 10px 4px; }
.ks-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ks-in { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ks-in span { font-size: calc(12.5px * var(--fs, 1)); font-weight: 700; color: var(--muted); text-align: center; }
.ks-in input { width: 100%; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--field-bg);
  text-align: center; font-size: calc(18px * var(--fs, 1)); font-weight: 700; color: var(--ink); padding: 0 4px; }
.ks-in input:focus { outline: none; border-color: var(--cobalt); background: var(--paper); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 22%, transparent); }
.ks-in input::placeholder { color: var(--field-ph); font-weight: 600; }
.ks-result { border-radius: var(--radius-lg); padding: 16px; border: 1px solid var(--line); background: var(--paper); }
.ks-result.pass { border-color: var(--ks-pass-border); background: linear-gradient(180deg, var(--ks-pass-bg), var(--paper) 60%); }
.ks-result.fail { border-color: var(--ks-fail-border); background: linear-gradient(180deg, var(--ks-fail-bg), var(--paper) 60%); }
.ks-result.none { background: var(--ks-none-bg); }
.ks-result p { margin: 8px 0 0; font-size: calc(14px * var(--fs, 1)); color: var(--ink); }
.ks-r-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ks-stt { font-size: calc(13px * var(--fs, 1)); color: var(--muted); font-weight: 600; }
.ks-code { font-size: calc(30px * var(--fs, 1)); font-weight: 800; letter-spacing: .01em; color: var(--ink); margin-top: 6px; line-height: 1.1; word-break: break-word; }
.ks-mk { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ks-mk span { padding: 5px 11px; border-radius: 999px; background: var(--inverse-bg); color: var(--inverse-text); font-size: calc(13px * var(--fs, 1)); font-weight: 700; }
.ks-dat { margin-top: 8px; font-weight: 700; color: var(--red); }
.ks-desc { color: var(--muted) !important; font-size: calc(13.5px * var(--fs, 1)) !important; }
.ks-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.ks-badge.pass { background: var(--ks-pass); color: #fff; }
.ks-badge.fail { background: var(--ks-fail); color: #fff; }
.ks-badge.none { background: var(--ks-none); color: #fff; }
.ks-pills { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.ks-pill { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border-radius: 8px; background: var(--ks-pill-bg);
  font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--ink); min-width: 0; overflow: hidden; }
.ks-pill small { font-size: calc(10px * var(--fs, 1)); font-weight: 700; color: var(--muted); text-transform: uppercase; }
.ks-pill.nd { background: var(--ks-pill-nd-bg); color: var(--ks-pill-nd-text); font-weight: 600; }
.ks-pill.bad { background: var(--ks-pill-bad-bg); color: var(--ks-pill-bad-text); }
.ks-notes { margin-top: 10px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.ks-notes summary { cursor: pointer; font-weight: 600; }
.ks-notes div { margin-top: 4px; }
.ks-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.ks-chips::-webkit-scrollbar { display: none; }
.ks-chips button { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font: inherit; font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.ks-chips button.is-on { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-text); }
.ks-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ks-rule { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--ks-pass); border-radius: 14px; padding: 12px 12px 12px 14px; }
.ks-rule.fail { border-left-color: var(--ks-fail); }
.ks-rule-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ks-rule-top b { font-size: calc(17px * var(--fs, 1)); }
.ks-rule-top { flex-wrap: wrap; }
.ks-rule-top b { flex: 1 1 auto; min-width: 0; }
.ks-top-r { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 100%; margin-left: auto; }
.ks-dtcode { display: inline-block; max-width: 100%; padding: 4px 10px; border-radius: 8px; font-size: calc(15px * var(--fs, 1)); line-height: 1.25; font-weight: 800; color: #fff; white-space: nowrap; overflow-wrap: anywhere; }
.ks-dtcode.pass { background: var(--ks-pass); }
.ks-dtcode.fail { background: var(--ks-fail); }
.ks-rule-dat { font-size: calc(13px * var(--fs, 1)); color: var(--muted); margin-top: 3px; }

/* Phân quyền theo token: tab / nút bị ẩn phải ẩn thật (các class trên đặt display riêng) */
.tab[hidden], .multi-btn[hidden], .kho-tile[hidden] { display: none !important; }
.me-card { padding: 10px 12px; border-radius: 12px; background: var(--cobalt-soft); color: var(--ink); font-size: calc(14px * var(--fs, 1)); margin: 0 0 12px; line-height: 1.45; }
.me-card b { font-weight: 700; }

/* Màn hẹp / cỡ chữ máy lớn: mã hàng xuống dòng thay vì bị cắt (setRowColWidths bật class k-wrap) */
.k-wrap .krow .k-code { white-space: normal; word-break: break-all; overflow: visible; text-overflow: clip; line-height: 1.25; }
.krow .k-place { min-width: 0; }

/* ---- Co giãn theo màn hình / cỡ chữ máy lớn (3.43) ---- */
.brand { min-width: 0; }
.brand-name { font-size: calc(clamp(15px, 4.6vw, 18px) * var(--fs, 1)); line-height: 1.2; } /* co theo bề ngang, không cắt tên */
/* Hàng "Chỉ lô còn hàng" + "Sắp xếp": không đủ chỗ thì xuống 2 hàng thay vì bóp chữ còn 3 dòng */
.opt-row { flex-wrap: wrap; row-gap: 6px; }
.opt-row .toggle { white-space: nowrap; }
.opt-row .sort-pick { flex: 1 1 150px; min-width: 0; max-width: 100%; justify-content: flex-end; } /* chỉ xuống hàng khi còn < 150px */
.opt-row .sort-pick select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
/* 3 nút lọc hạn dùng: chữ dài thì co cỡ chữ theo bề ngang màn hình */
.hsd-quick button { font-size: calc(clamp(11px, 3.4vw, 13px) * var(--fs, 1)); line-height: 1.2; padding: 4px 2px; }
.list-head { align-items: end; }

/* Bảng chọn kho (3.47): hàng 1 = tên kho (trái) + số tồn (phải) — không đủ chỗ thì số tồn tự xuống dòng
   dưới tên (flex-wrap), tên kho KHÔNG bao giờ bị bẻ chữ / cắt. Hàng 2 = Module · mô tả. Hàng 3 = kg · số
   dòng · ngày số liệu · giờ PC, chạy hết bề ngang. */
.kho-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
.kho-opt .ko-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kho-opt .ko-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 10px; row-gap: 2px; }
.kho-opt .ko-name { font-size: calc(16px * var(--fs, 1)); white-space: nowrap; }
.kho-opt .ko-qty { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: calc(17px * var(--fs, 1)); }
.kho-opt .ko-qty small { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); font-weight: 600; }
.kho-opt .ko-sub { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.kho-opt .ko-meta { font-size: calc(12px * var(--fs, 1)); color: var(--muted); line-height: 1.45; }
.kho-opt .ko-meta .qty-kg { color: var(--ink); font-weight: 700; }
.kho-opt .ko-meta .pill { margin-left: 4px; }

/* Dòng tổng tính TẤN (3.48) — dưới số kg ở ô kho Trang chủ; cạnh số kg ở bảng Chọn kho */
.qty-tan { display: block; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--cobalt); font-variant-numeric: tabular-nums; }
.kho-opt .ko-kg { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; font-size: calc(13px * var(--fs, 1)); }
.kho-opt .ko-kg .qty-kg { color: var(--ink); font-weight: 700; }
.kho-opt .ko-kg .qty-tan { display: inline; }

/* Cài đặt → Giao diện (Sáng / Tối) */
.theme-field .segmented { margin: 6px 0 4px; }

/* Quản lý người dùng (Cài đặt → Quản lý người dùng & phân quyền) */
.ua-item { display: block; width: 100%; margin: 0 0 8px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-align: left; font-size: calc(16px * var(--fs, 1)); }
.ua-item small { display: block; margin-top: 2px; font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.ua-item.is-off { opacity: .55; }
.ua-item.is-lock { opacity: .6; border-style: dashed; }
.ua-item small .role-xem, .ua-item small .role-xuat, .ua-item small .role-quanly, .ua-item small .role-quantri { font-weight: 600; }
.ua-id { color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.ua-row { display: flex; gap: 8px; margin: -6px 0 14px; }
.ua-row .btn { flex: 1; margin: 0; }
.ua-select { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: calc(16px * var(--fs, 1)); }
.ua-kho label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: calc(16px * var(--fs, 1)); }
.ua-kho input[type=checkbox] { width: 22px; height: 22px; }
.ua-kho label:has(input:disabled) { opacity: .6; }
.ua-row-tight { margin: 4px 0 8px; }
.ua-select + small, #uaHint { display: block; margin-top: 6px; line-height: 1.4; }
.ua-bat { margin: 0 0 14px; display: block; }

/* Kho › "Tổng" — bảng chi tiết 1 mã (app.js › openTongDetail) */
.td-code { word-break: break-all; }
.td-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.td-kho { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.td-k { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--paper); display: flex; flex-direction: column; gap: 2px; }
.td-k > span { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.td-k > b { font-size: calc(18px * var(--fs, 1)); color: var(--ink); }
.td-k small { font-weight: 500; }
.td-sum { margin: 10px 0 4px; color: var(--muted); }
.td-sum b { color: var(--ink); }
.td-list { margin-top: 6px; }

/* Thanh báo có bản mới (live-update.js) — nằm trên thanh tab dưới cùng */
.lu-banner { position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px;
  background: var(--inverse-bg); color: var(--inverse-text); box-shadow: 0 8px 24px rgba(var(--shadow-rgb), .28); font-size: calc(14px * var(--fs, 1)); }
.lu-banner[hidden] { display: none; }
.lu-text { flex: 1 1 180px; }
.lu-acts { display: flex; gap: 8px; }
.lu-btn { border: 1px solid rgba(255,255,255,.35); background: transparent; color: inherit; border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 600; }
.lu-btn.pri { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }

/* Trang chủ › ô tìm: tổng số lượng các dòng khớp (renderHomeSearch) */
.home-sum { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.hs-cell { flex: 1 1 140px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.hs-cell > small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.hs-cell > b { font-size: calc(22px * var(--fs, 1)); color: var(--ink); }
.hs-cell > b small { font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.hs-sep { color: var(--muted); font-weight: 500; font-size: calc(15px * var(--fs, 1)); }
.hs-note { flex: 1 1 100%; margin: 0; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }

/* Lọc phiếu theo tháng (bản 1.4) */
.px-month{ height: 34px; padding: 0 10px; margin-right: 6px; border: 1px solid var(--line, #cdd6e3); border-radius: 10px;
  background: var(--card, #fff); color: inherit; font: inherit; font-weight: 600; max-width: 100%; }

/* Chọn kho — Tồn vị trí An An (bản 1.5) */
.kho-pick[hidden]{ display: none !important; }
.kho-pick{ flex: 0 0 auto; }
.kho-pick select{ font-weight: 700; }
.meta-row.has-toggle{ gap: 10px; }
.meta-row.has-toggle .list-meta{ flex: 1 1 auto; text-align: right; }

/* Kết quả kháng sinh LẦN 2 (bản 1.6) */
.ks-lan2 { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ks-lan2-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ks-lan2-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--cobalt); color: var(--on-cobalt); font-size: calc(12px * var(--fs, 1)); font-weight: 700; }

/* Đếm ngày số liệu trên ô kho — Trang chủ (bản 1.7, mẫu A) */
.kho-tile .kt-age { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: calc(11.5px * var(--fs, 1)); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kho-tile .kt-age i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kho-tile .kt-age.ok { background: var(--green-soft); color: var(--green); }
.kho-tile .kt-age.warn { background: var(--amber-soft); color: var(--amber); }
.kho-tile .kt-age.old { background: var(--red-soft); color: var(--red); }

/* Sắp xếp Lô đã kiểm (bản 1.8) */
.ks-sort { margin: 8px 0 4px; align-self: flex-start; }

/* Đường dẫn Web App cài cố định (app-config.js): hiện nhưng làm mờ */
.field.is-locked input { opacity: .55; }
.field.is-locked small { opacity: .8; }


/* 4 VAI TRÒ — màu chữ: cấp 1 vàng · cấp 2 xanh lá · Quản lý xanh đậm · Quản trị đỏ */
.role-xem{ color:#facc15; font-weight:700; } .role-xuat{ color:#4ade80; font-weight:700; }
.role-quanly{ color:#15803d; font-weight:700; } .role-quantri{ color:#ef4444; font-weight:700; }

/* ---------- Lịch xuất nhập hàng (chỉ xem; bản 3.0: chỉ hôm nay, ở Trang chủ) ---------- */
.lx-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: calc(12px * var(--fs, 1)); font-weight: 700; background: var(--cobalt-soft); color: var(--cobalt); }
.lx-pill.st-ok { background: var(--green-soft); color: var(--green); }
.lx-pill.st-run { background: var(--amber-soft); color: var(--amber); }
.lx-pill.st-wait { background: var(--chip-bg); color: var(--muted); }
.lx-err { color: var(--red); font-size: calc(13px * var(--fs, 1)); margin: 8px 0 0; }
.lx-dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.lx-dh small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.lx-dh h3 { margin: 2px 0 0; font-size: calc(20px * var(--fs, 1)); color: var(--ink); overflow-wrap: anywhere; }
.lx-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: calc(14px * var(--fs, 1)); }
.lx-kv span { color: var(--muted); }
.lx-kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.lx-tw { overflow: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.lx-tw table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs, 1)); }
.lx-tw th { text-align: left; font-size: calc(12px * var(--fs, 1)); color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lx-tw td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.lx-tw tr:last-child td { border-bottom: 0; }
.lx-tw .r { text-align: right; }
.lx-none, .lx-note { color: var(--muted); font-size: calc(13px * var(--fs, 1)); text-align: center; margin: 10px 0; }

/* ---------- Lịch xuất nhập hàng: thẻ NHẬP (bản 2.9) ---------- */
.lx-tp{ display: inline-block; font-style: normal; font-size: calc(9px * var(--fs, 1)); font-weight: 800; letter-spacing: .04em; line-height: 1; padding: 2px 5px; border-radius: 4px; color: #0e7490; background: rgba(8,145,178,.14); border: 1px solid rgba(8,145,178,.4); margin-right: 4px; vertical-align: middle; }

/* ---------- Trang chủ › thẻ "Lịch xuất nhập hôm nay" (bản 3.0) ----------
   Điểm nhấn duy nhất của Trang chủ: tờ lịch nhỏ (tháng + ngày) bên trái, các lịch hôm nay xếp dọc bên dưới.
   Màu vạch trái = tình trạng (đã xong xanh lá · đang làm vàng · còn lại xanh dương / xám). */
#homeLx { margin: 2px 0 0; }
.lxt { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lxt-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.lxt-leaf { flex: 0 0 auto; width: 52px; border-radius: 10px; overflow: hidden; border: 1px solid var(--cobalt); background: var(--paper); text-align: center; }
.lxt-leaf i { display: block; font-style: normal; font-size: calc(12px * var(--fs, 1)); font-weight: 700; line-height: 1; padding: 5px 0 4px; background: var(--cobalt); color: var(--on-cobalt); }
.lxt-leaf b { display: block; font-size: calc(24px * var(--fs, 1)); font-weight: 800; line-height: 1; padding: 6px 0 7px; color: var(--ink); font-variant-numeric: tabular-nums; }
.lxt-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lxt-title b { font-size: calc(15.5px * var(--fs, 1)); font-weight: 700; color: var(--ink); }
.lxt-title span { font-size: calc(13px * var(--fs, 1)); color: var(--muted); }
.lxt-count { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; background: var(--cobalt-soft); color: var(--cobalt); font-size: calc(12.5px * var(--fs, 1)); font-weight: 700; white-space: nowrap; }
.lxt-list { border-top: 1px solid var(--line); }
.lxt-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 14px 8px 11px; border: 0; border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--cobalt); background: transparent; color: var(--ink); text-align: left; }
.lxt-row:last-child { border-bottom: 0; }
.lxt-row:active { background: var(--cobalt-soft); }
.lxt-row.st-ok { border-left-color: var(--green); }
.lxt-row.st-run { border-left-color: var(--amber); }
.lxt-row.st-wait { border-left-color: var(--muted); }
.lxt-dir { flex: 0 0 auto; min-width: 42px; padding: 3px 0; border-radius: 6px; background: var(--chip-bg); color: var(--ink); font-size: calc(12px * var(--fs, 1)); font-weight: 700; text-align: center; }
.lxt-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lxt-main b { font-size: calc(14.5px * var(--fs, 1)); font-weight: 700; overflow-wrap: anywhere; }
.lxt-main small { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); overflow-wrap: anywhere; }
.lxt-row .lx-pill { flex: 0 0 auto; white-space: nowrap; }
/* Các LSX chung 1 container: 1 thẻ chung, mỗi LSX 1 dòng con */
.lxt-grp { border-bottom: 1px solid var(--line); border-left: 4px solid var(--cobalt); background: var(--cobalt-soft); }
.lxt-grp:last-child { border-bottom: 0; }
.lxt-grp.st-ok { border-left-color: var(--green); }
.lxt-grp.st-run { border-left-color: var(--amber); }
.lxt-grp.st-wait { border-left-color: var(--muted); }
.lxt-gh { display: flex; align-items: center; gap: 10px; padding: 8px 14px 4px 11px; }
.lxt-gh b { flex: 1 1 auto; min-width: 0; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--ink); }
.lxt-gt { flex: 0 0 auto; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lxt-grp .lxt-row.in-grp { border-left: 0; border-bottom: 1px dashed var(--line); min-height: 50px; padding-left: 14px; }
.lxt-grp .lxt-row.in-grp:last-child { border-bottom: 0; }
.lxt-nav { display: flex; align-items: center; gap: 8px; padding: 0 14px 12px; }
.lxt-step { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lxt-step svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lxt-step:active { background: var(--cobalt-soft); }
.lxt-pick { position: relative; flex: 1 1 auto; min-width: 0; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip-bg); color: var(--ink); font-size: calc(14px * var(--fs, 1)); font-weight: 600; overflow: hidden; cursor: pointer; }
.lxt-pick svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--cobalt); }
.lxt-pick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lxt-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; margin: 0; font-size: calc(16px * var(--fs, 1)); }
.lxt-today { flex: 0 0 auto; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--cobalt); color: var(--on-cobalt); font-size: calc(14px * var(--fs, 1)); font-weight: 700; cursor: pointer; }
.lxt-today:active { opacity: .85; }
.lxt-empty { margin: 0; padding: 14px; border-top: 1px solid var(--line); font-size: calc(13.5px * var(--fs, 1)); color: var(--muted); }
.lxt-err { margin: 0; padding: 8px 14px 10px; border-top: 1px solid var(--line); }

/* Bản 3.9 — Lịch xuất nhập: thêm nhanh + chuyển ngày (Quản lý trở lên) */
.lxt-edit { padding: 0 14px 12px; }
.lxt-add { width: 100%; min-height: 44px; border: 1.5px dashed var(--cobalt); border-radius: 12px; background: var(--cobalt-soft); color: var(--cobalt); font-size: calc(14.5px * var(--fs, 1)); font-weight: 700; cursor: pointer; }
.lxt-add:active { opacity: .8; }
.lxt-bad { padding: 8px 8px 10px 14px; border-top: 1px solid var(--line); color: var(--red); font-size: calc(12.5px * var(--fs, 1)); overflow-wrap: anywhere; display: flex; align-items: flex-start; gap: 8px; }
.lxt-bad span { flex: 1; }
.lxt-bad-x { flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--red); font-size: calc(22px * var(--fs, 1)); line-height: 1; cursor: pointer; }
.lx-mvq { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.lx-mvq .btn { flex: 1 1 auto; width: auto; min-width: 84px; }
.lxq-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.lxq-tools { display: flex; gap: 8px; margin: -4px 0 12px; }
.lxq-tools .btn { flex: 1 1 0; width: auto; }
.lxq-notes { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: calc(12.5px * var(--fs, 1)); }
.lxq-list { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; max-height: 260px; overflow: auto; }
.lxq-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; border-bottom: 1px solid var(--line); }
.lxq-row:last-child { border-bottom: 0; }
.lxq-del { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--chip-bg); color: var(--red); font-size: calc(20px * var(--fs, 1)); line-height: 1; cursor: pointer; }

/* ĐT 4.8 — kiểm tra LSX trùng / kế hoạch thay đổi trong "Thêm nhanh lịch" */
.lxq-chk{ display:block; margin-top:4px; }
.lxq-ck{ display:inline-block; font-size: calc(12px * var(--fs, 1)); font-weight:600; line-height:1.35; padding:2px 8px; border-radius:8px; }
.lxq-ck.new{ color:#0f8a5f; background:rgba(15,138,95,.12); }
.lxq-ck.dup{ color:#9a6a00; background:rgba(224,165,61,.18); }
.lxq-ck.chg{ color:#c62828; background:rgba(229,72,77,.10); }
.lxq-act{ display:block; margin-top:6px; width:100%; max-width:100%; min-height:38px; font-size: calc(14px * var(--fs, 1)); border-radius:10px; }


/* ===================== 5.0 — GIAO DIỆN MỚI (11/10/2026) ===================== */
/* Thanh trên: logo công ty (icon-192.png) */
.topbar { box-shadow: 0 1px 0 var(--top-line); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; background: #fff; display: block; }
.brand-name { font-size: calc(17px * var(--fs, 1)); }
.icon-btn { width: 44px; height: 44px; background: var(--frost); }
/* Thanh tab dưới: chữ 11,5px, mục đang chọn có vạch trên */
.tab { font-size: calc(11.5px * var(--fs, 1)); min-height: 52px; }
.tab.is-on { font-weight: 700; }
.tab.is-on::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 3px; border-radius: 0 0 3px 3px; background: var(--cobalt); }
/* STT trong lịch xuất nhập (đánh lại từ 1 mỗi ngày, nhập + xuất chung 1 dãy) */
.lxt-stt { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; background: var(--cobalt-soft); color: var(--cobalt); font-size: calc(13px * var(--fs, 1)); font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.lxt-row { min-height: 64px; }
/* Thẻ tóm tắt "Lịch hôm nay" ở tab Tổng quan */
.hmini { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; font: inherit; }
.hmini[hidden] { display: none !important; }
.hmini:active { background: var(--cobalt-soft); }
.hmini .hm-t { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.hmini .hm-t b { font-size: calc(15px * var(--fs, 1)); font-weight: 700; }
.hmini .hm-t small { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.hmini .hm-k { display: flex; align-items: baseline; gap: 4px; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.hmini .hm-k i { font-style: normal; font-size: calc(24px * var(--fs, 1)); font-weight: 700; line-height: 1; margin-left: 6px; font-variant-numeric: tabular-nums; }
.hmini .hm-k i.out { color: var(--amber); } .hmini .hm-k i.in { color: var(--cobalt); }
.hmini .hm-k em { font-style: normal; }
.hmini > svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 20px; }

/* ===== ĐT 0.6: tab Công cụ + khối Phiếu trong Tổng quan ===== */
/* ĐT 0.9: thẻ công cụ dạng Ô VUÔNG, 2 cột — vùng bấm lớn (hợp đeo găng), icon trong ô bo tròn + nút chuyển ở hàng trên, tên + mô tả ở dưới; màu theo biến nên tự đổi Sáng / Tối */
.tl-title { margin: 6px 2px 2px; }
.tl-sub { margin: 0 2px 16px; font-size: calc(14.5px * var(--fs, 1)); color: var(--muted); }
.tl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tl-card { display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: 12px; width: 100%; aspect-ratio: 1 / 1; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); color: var(--ink);
  box-shadow: 0 2px 6px rgba(var(--shadow-rgb), .07), 0 8px 20px rgba(var(--shadow-rgb), .05); -webkit-tap-highlight-color: transparent; transition: transform .12s ease, background-color .12s ease, border-color .12s ease; }
.tl-card:active { transform: scale(.97); background: var(--cobalt-soft); border-color: var(--cobalt); }
.tl-card:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.tl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tl-ico { flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--cobalt-soft); color: var(--cobalt); }
.tl-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tl-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-txt b { font-size: calc(17px * var(--fs, 1)); font-weight: 700; line-height: 1.25; }
.tl-txt small { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-go { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--frost); color: var(--muted); }
.tl-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 330px) { .tl-list { grid-template-columns: 1fr; } .tl-card { aspect-ratio: auto; min-height: 120px; } } /* màn hình rất hẹp: về 1 cột */
@media (prefers-reduced-motion: reduce) { .tl-card { transition: none; } .tl-card:active { transform: none; } }
.tool-back { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin: 0 0 6px -4px; padding: 0 12px 0 6px; border: 0; border-radius: 12px; background: transparent; color: var(--cobalt); font-size: calc(15px * var(--fs, 1)); font-weight: 600; }
.tool-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#homePhieuWrap[hidden] { display: none !important; }

/* ĐT 0.17: Tạo mã QR — iframe phủ vùng giữa thanh trên và thanh tab (top / bottom do qr-phone.js đặt) */
.qr-frame{ position:fixed; left:0; right:0; top:56px; bottom:64px; width:100%; height:auto; border:0; background:var(--frost,#fff); z-index:5; }

/* bản 1.07 — nút "Lọc theo nhiều cột" của danh sách Phiếu (bộ lọc chung openFilterSheet) */
.pf-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.pf-filter[hidden] { display: none; }
.pf-filter .filter-btn { width: 44px; height: 44px; border-radius: 12px; }
.pf-filter-t { font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.pf-filter .filter-chips { flex-basis: 100%; margin-top: 0; }
.pf-filter .filter-chips:empty { display: none; }

/* ===== PHÂN LOẠI (ĐT 1.12) — trong tab Báo cáo: loại → tổng NET → từng Size → mã hàng. Vùng bấm ≥ 44px, chỉ dùng biến màu có sẵn. ===== */
.pl-seg { display: flex; gap: 4px; margin: 4px 16px 12px; padding: 4px; border-radius: 12px; background: var(--seg-bg); }
.pl-seg button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.pl-seg button.on { background: var(--paper); color: var(--cobalt); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .12); }
.pl-seg2 { margin-top: 0; }
.pl-upd { margin: 0 16px 10px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-cat { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px 10px; padding: 12px 14px; min-height: 64px; box-sizing: border-box; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font: inherit; }
.pl-dot { width: 10px; height: 38px; border-radius: 5px; flex: 0 0 10px; }
.pl-cat-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pl-cat-m b { font-size: calc(15px * var(--fs, 1)); }
.pl-cat-m small, .pl-cat-r small { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-cat-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pl-cat-r b { font-size: calc(17px * var(--fs, 1)); }
.pl-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: calc(11px * var(--fs, 1)); font-weight: 700; }
.pl-low { background: var(--amber-soft); color: var(--amber); }
.pl-head { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; }
.pl-head > div { display: flex; flex-direction: column; }
.pl-head b { font-size: calc(18px * var(--fs, 1)); }
.pl-head small { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-back { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--cobalt); font-size: calc(28px * var(--fs, 1)); line-height: 1; }
.pl-total { margin: 0 16px 10px; padding: 12px 14px; border-radius: 14px; background: var(--cobalt-soft); display: flex; flex-direction: column; gap: 2px; }
.pl-total small { font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.pl-total b { font-size: calc(30px * var(--fs, 1)); }
.pl-tools { display: flex; gap: 8px; margin: 0 16px 10px; }
.pl-q { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field-bg); color: var(--ink); font: inherit; font-size: calc(14px * var(--fs, 1)); }
.pl-q::placeholder { color: var(--field-ph); }
.pl-sortb { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 600; }
.pl-chips { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; flex-wrap: wrap; }
.pl-chips button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 600; }
.pl-chips button.on { background: var(--cobalt-soft); border-color: var(--cobalt); color: var(--cobalt); }
.pl-chips .pl-chip-low.on { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.pl-chips span { flex: 1; text-align: right; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-size { margin: 0 16px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.pl-size.is-low { border-color: var(--red); }
.pl-size-h { display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 56px; padding: 10px 14px; box-sizing: border-box; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; }
.pl-size-top { display: flex; align-items: baseline; gap: 8px; }
.pl-size-n { flex: 1; font-size: calc(15px * var(--fs, 1)); font-weight: 700; }
.pl-size-r { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-size-v { min-width: 86px; text-align: right; font-size: calc(16px * var(--fs, 1)); font-weight: 700; }
.pl-bar { display: block; height: 7px; border-radius: 4px; background: var(--chip-bg); }
.pl-bar span { display: block; height: 7px; border-radius: 4px; background: var(--cobalt); }
.pl-size.is-low .pl-bar span { background: var(--red); }
.pl-items { border-top: 1px solid var(--line); background: var(--frost); padding: 4px 14px 10px; }
.pl-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pl-item-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-item-l small { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-item-n { font-weight: 700; }
.pl-more { margin: 8px 0 0; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-go { min-height: 44px; margin-top: 4px; padding: 0; border: 0; background: transparent; color: var(--cobalt); font: inherit; font-weight: 600; }

/* ===== BẢNG CHÉO Size × Đặc tính (ĐT 1.13) ===== */
.pl-xwrap { margin: 0 16px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow-x: auto; }
.pl-x { border-collapse: collapse; width: 100%; font-size: calc(13px * var(--fs, 1)); font-variant-numeric: tabular-nums; }
.pl-x th, .pl-x td { padding: 10px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.pl-x thead th { background: var(--chip-bg); color: var(--muted); font-size: calc(12px * var(--fs, 1)); font-weight: 700; }
.pl-x thead th small { display: block; font-weight: 500; font-size: calc(10.5px * var(--fs, 1)); }
.pl-x .pl-x-s { position: sticky; left: 0; text-align: left; background: var(--paper); color: var(--ink); font-weight: 700; z-index: 1; }
.pl-x thead .pl-x-s { background: var(--chip-bg); color: var(--muted); }
.pl-x .pl-xc { min-width: 56px; cursor: pointer; }
.pl-x .pl-xc.z { color: var(--muted); }
.pl-x .pl-xc.sel { background: var(--cobalt-soft); color: var(--cobalt); font-weight: 700; box-shadow: inset 0 0 0 2px var(--cobalt); }
.pl-x .pl-xt { font-weight: 700; }
.pl-x tfoot th, .pl-x tfoot td { background: var(--cobalt-soft); color: var(--ink); font-weight: 700; border-bottom: 0; }
.pl-xhint { margin: 0 16px 10px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pl-xinfo { margin: 0 16px 14px; padding: 10px 14px; border: 1px solid var(--cobalt); border-radius: 14px; background: var(--paper); }
.pl-xinfo-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pl-xinfo-h b { font-size: calc(14px * var(--fs, 1)); }
.pl-xinfo-h span { font-weight: 700; color: var(--cobalt); }

/* Thanh kéo cỡ chữ (Cài đặt › Cỡ chữ) */
.fs-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.fs-row input[type=range] { flex: 1; min-width: 0; height: 44px; accent-color: var(--cobalt); }
.fs-a { font-weight: 800; color: var(--muted); line-height: 1; }
.fs-a-s { font-size: 13px; } .fs-a-l { font-size: 24px; }

/* ĐT 1.23 — huy hiệu tài khoản mới */
.role-badge { height: 28px; width: auto; vertical-align: middle; margin-right: 8px; flex: none; user-select: none; -webkit-user-drag: none; }
.me-card .role-badge { height: 34px; }
.ua-item .role-badge { float: left; height: 36px; margin: 0 10px 0 0; }
.ua-item small { overflow: hidden; }

/* ĐT 1.40: lọc phiếu Vị trí theo Size / mặt hàng */
.vtf { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.vtf-chip { border: 1px solid var(--line); background: var(--paper); color: inherit; border-radius: 16px; padding: 6px 12px; min-height: 36px; font-size: calc(13.5px * var(--fs, 1)); line-height: 1.2; }
.vtf-chip b { margin-left: 4px; }
.vtf-chip.is-on { background: var(--primary, #1d6fd0); border-color: transparent; color: #fff; }

/* ĐT 1.44 — dòng đã làm phiếu xuất hết: hiện số vốn có nhưng mờ, không chọn */
.row.is-done .krow { opacity: .5; pointer-events: none; }
.row.is-done .krow .k-qty b, .row.is-done .krow .k-code { color: var(--muted); }
.vt-stat { margin: 12px 0; }
.vt-stat h4 { margin: 0 0 6px; font-size: calc(14px * var(--fs, 1)); }
.vt-stat table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs, 1)); }
.vt-stat th, .vt-stat td { padding: 5px 6px; border-bottom: 1px solid var(--line, #8883); text-align: left; vertical-align: top; }
.vt-stat .n { text-align: right; white-space: nowrap; }

/* ---------- Bản mới (app PC C#) — "Băng sạch" ---------- */
.brand-tag {
  margin-left: 2px; padding: 2px 7px; border-radius: 999px;
  background: var(--cobalt-soft); color: var(--cobalt);
  font-size: calc(11px * var(--fs, 1)); font-weight: 700; letter-spacing: .04em;
}
/* Chưa có số liệu: thông báo rộng hết dòng, ẩn nút "Chọn nhiều" (trước bị ép nửa màn hình). */
.meta-row { flex-wrap: wrap; }
.meta-row .list-meta:has(.empty) { flex-basis: 100%; text-align: left; }
.meta-row:has(.list-meta .empty) .multi-btn { display: none; }
.empty { border: 1px solid var(--line); }
/* Đăng nhập bằng Google (bản web) */
