@import url("hen-doi.css");
/* Chỉ backend mode; demo cũ giữ nguyên layout. */
.backend-mode main { padding: 20px 0 120px !important; }
.backend-mode #module-content { padding: 16px 16px 120px; }
.backend-mode .pilot-panel { padding: 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 16px; }
.backend-mode .pilot-toolbar, .backend-mode .pilot-nav { display:flex; gap:10px; flex-wrap:wrap; align-items:center; padding:12px; }
.backend-mode button, .backend-mode input:not([type="checkbox"]):not([type="radio"]), .backend-mode select { font:inherit; padding:10px; color:var(--text-main); background:var(--bg-input); border:1px solid var(--border-color); border-radius:6px; }
.backend-mode button { cursor:pointer; }
.backend-mode button:disabled { opacity:.5; cursor:wait; }
.backend-mode form { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.backend-mode label { display:grid; gap:5px; flex:1 1 180px; }
.backend-mode .pilot-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.backend-mode .pilot-device { border:1px solid var(--border-color); padding:16px; border-radius:10px; overflow-wrap:anywhere; }
.backend-mode .pilot-error { color:var(--color-red); white-space:pre-wrap; }
.backend-mode .pilot-muted { color:var(--text-muted); }
.backend-mode pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:60vh; overflow:auto; }
.backend-mode #app-header { height:auto; padding:14px; display:flex; gap:12px; flex-wrap:wrap; }
.backend-mode #app-nav { height:auto; display:flex !important; flex-wrap:wrap; white-space:normal; }
.backend-mode #role-control-bar { padding:10px; }
.backend-mode .pilot-brand { display:grid; }
.backend-mode .pilot-brand strong { color:var(--color-gold-light); font-size:22px; }
.backend-mode .pilot-brand small { color:var(--text-muted); }
.backend-mode .pilot-user { margin-left:auto; }
.backend-mode .pilot-panel h2 { font-size:23px; margin-bottom:18px; }
.backend-mode .pilot-panel form { padding:16px 0; }
.backend-mode button:hover { border-color:var(--color-gold); }
.backend-mode form > button, .backend-mode button[aria-current="page"] { background:var(--color-gold-bg); border-color:var(--color-gold); color:var(--color-gold-light); }
.backend-mode .pilot-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin:20px 0 8px; }
.backend-mode .pilot-summary article { border:1px solid var(--border-color); border-left:3px solid var(--color-gold); border-radius:10px; padding:16px; background:var(--bg-app); display:grid; gap:8px; }
.backend-mode .pilot-summary span { color:var(--text-muted); }
.backend-mode .pilot-summary strong { font-size:22px; }
.backend-mode .pilot-grid { margin-top:18px; }
.backend-mode .pilot-status { display:inline-block; padding:2px 8px; border:1px solid var(--border-color); border-radius:20px; color:var(--color-gold-light); }
.backend-mode .pilot-table-wrap { overflow:auto; margin-top:18px; }
.backend-mode .pilot-table { width:100%; border-collapse:collapse; }
.backend-mode .pilot-table caption { text-align:left; color:var(--text-muted); padding:8px 0; }
.backend-mode .pilot-table th, .backend-mode .pilot-table td { padding:12px; text-align:left; border-bottom:1px solid var(--border-color); vertical-align:top; white-space:pre-wrap; overflow-wrap:break-word; }
.backend-mode .pilot-table th { color:var(--color-gold-light); background:var(--bg-input); }
.backend-mode .pilot-table tr:hover { background:var(--bg-card-hover); }
.backend-mode .pilot-empty { text-align:center; padding:32px 12px; border:1px dashed var(--border-color); margin-top:18px; border-radius:10px; }
.backend-mode .pilot-empty p { color:var(--text-muted); margin-top:8px; }
.backend-mode .pilot-codes { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin:20px 0; }
.backend-mode .pilot-codes code { padding:16px; background:var(--bg-input); border-radius:8px; font-size:18px; }
.backend-mode .pilot-sale-notice { padding:12px 16px; border-left:4px solid var(--color-amber); background:var(--color-gold-bg); border-radius:6px; margin:12px 0; }
.backend-mode .pilot-price { display:block; font-size:24px; font-weight:700; color:var(--color-gold-light); margin:12px 0; overflow-wrap:anywhere; }
.backend-mode .pilot-imei { font-family:monospace; font-size:18px; letter-spacing:.05em; }
.backend-mode button, .backend-mode input:not([type="checkbox"]):not([type="radio"]), .backend-mode select { min-height:44px; min-width:44px; max-width:100%; }
/* Ô tick/radio giữ cỡ thật (QA 24/09: min 44px làm ô phình to); vùng bấm 44px đặt ở nhãn/dòng chứa nó */
.backend-mode input[type="checkbox"], .backend-mode input[type="radio"] { width:20px; height:20px; min-width:20px; min-height:20px; margin:0; flex:none; accent-color:var(--theme-accent-strong, var(--color-blue)); }
.backend-mode input:not([type="checkbox"]):not([type="radio"]), .backend-mode select { width:100%; }
.backend-mode label { min-width:0; }
.backend-mode [aria-invalid="true"] { border-color:var(--color-red); }
.backend-mode #module-content[aria-busy="true"] form { opacity:.65; }
.backend-mode :focus-visible { outline:3px solid var(--color-gold-light); outline-offset:3px; }
/* Demo mobile dùng thanh điều hướng đáy; backend đã có menu đầy đủ ở đầu trang.
   Ẩn container rỗng để không phủ ngang form bán hàng trên iPhone. */
.backend-mode .iphone-bottom-bar { display:none !important; }
@media(max-width:600px) {
 .backend-mode #module-content { padding:8px; }
 .backend-mode .pilot-panel { padding:12px; }
 .backend-mode .pilot-grid { grid-template-columns:1fr; }
 .backend-mode button { min-height:44px; }
 .backend-mode label { flex-basis:100%; }
 .backend-mode input, .backend-mode select { font-size:16px; }
 .backend-mode .pilot-user { margin-left:0; flex-basis:100%; }
 .backend-mode .pilot-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .backend-mode .pilot-table, .backend-mode .pilot-table tbody, .backend-mode .pilot-table tr { display:block; }
 .backend-mode .pilot-table caption { display:block; width:auto; }
 .backend-mode .pilot-table tr { border:1px solid var(--border-color); border-radius:10px; margin:12px 0; padding:8px; }
 .backend-mode .pilot-table td { display:grid; grid-template-columns:110px minmax(0,1fr); gap:8px; padding:8px; }
 .backend-mode .pilot-table td::before { content:attr(data-label); font-weight:600; color:var(--text-muted); }
}
/* Phiếu nhập nhiều IMEI cùng mã hàng (22/09/2026): mỗi máy một khối, thêm/bỏ dòng. */
.backend-mode .pilot-items { flex:1 1 100%; display:grid; gap:10px; }
.backend-mode .pilot-item { border:1px dashed var(--border-color); border-radius:10px; padding:10px 12px 12px; margin:0; display:flex; gap:10px; flex-wrap:wrap; align-items:end; min-width:0; }
.backend-mode .pilot-item legend { color:var(--color-gold-light); font-weight:600; padding:0 6px; }
.backend-mode .pilot-item label { flex:1 1 140px; }
.backend-mode .pilot-item label:first-of-type { flex:2 1 200px; }
.backend-mode .pilot-item button { flex:0 0 auto; color:var(--color-red); }
.backend-mode form > .pilot-toolbar { flex:1 1 100%; padding:0; }
/* Form nhập hàng theo bước (22/09/2026): sản phẩm → thông tin nhập → IMEI → lưu. */
.backend-mode .pilot-step { flex:1 1 100%; display:flex; gap:12px; flex-wrap:wrap; align-items:end; border:1px solid var(--border-color); border-radius:12px; padding:12px 14px 14px; margin:0; min-width:0; }
.backend-mode .pilot-step legend { color:var(--color-gold-light); font-weight:700; padding:0 8px; }
.backend-mode .pilot-step .pilot-items { flex:1 1 100%; }
.backend-mode .pilot-step .pilot-toolbar { flex:1 1 100%; padding:0; }
.backend-mode .pilot-step > button { background:var(--color-gold-bg); border-color:var(--color-gold); color:var(--color-gold-light); }
.backend-mode .pilot-new { border-left:3px solid var(--color-gold); padding-left:10px; }
.backend-mode .pilot-new[hidden] { display:none; }
.backend-mode .pilot-step label.wide { flex:1 1 100%; }

/* Màn đăng nhập (26/09/2026, phương án A anh Nghĩa chọn): giao diện ở dang-nhap.css; ở đây chỉ ẩn khung app khi đang ở màn đăng nhập. */
.backend-login #role-control-bar,
.backend-login #app-header,
.backend-login #app-nav,
.backend-login #stats-container,
.backend-login #iphone-bottom-bar { display:none !important; }
.itn-mark { display:inline-grid;place-items:center;min-width:40px;height:40px;padding:0 8px;border-radius:11px;background:#f28c28;color:#fff4e6;font-weight:800;font-size:16px;letter-spacing:-.02em;line-height:1;flex:none; }
.backend-dashboard-shell .login-legal { display:flex;justify-content:center;flex-wrap:wrap;gap:6px 16px;margin:16px auto 8px;font-size:13px; }
.backend-dashboard-shell .login-legal a { display:inline-flex;align-items:center;min-height:44px; }

/* Một shell duy nhất cho dashboard và mọi phân hệ thật (23/09/2026).
   Chỉ nội dung/quyền thay đổi; nhịp bố cục, màu, header và mobile nav phải đồng nhất. */
/* Bộ màu sáng mặc định chỉ dùng khi CHƯA có theme. Trước đây gán thẳng lên body nên đè token của theme tối
   (Sapphire/Graphite/Gold Noir): nội dung bị ép sáng còn thanh đầu tối → chữ "iTN Store" tối trên nền tối. */
.backend-mode.backend-dashboard-shell { min-height:100svh; color:var(--text-main); }
.backend-mode.backend-dashboard-shell:not([data-itn-theme]) {
  --bg-app:#f5f5fa;
  --bg-card:#ffffff;
  --bg-card-hover:#f7f8fc;
  --bg-input:#f8f8fc;
  --border-color:rgba(60,60,67,.13);
  --text-main:#17171b;
  --text-muted:#6e6e78;
  --text-dim:#8e8e98;
  background:linear-gradient(180deg,#f6f5fb 0,#f2f2f8 100%);
}
.backend-dashboard-shell .main-viewport { max-width:1400px;padding:18px 24px 96px; }
.backend-dashboard-shell #role-control-bar {
  min-height:38px;padding:7px 20px;background:#fff;border-bottom:1px solid rgba(60,60,67,.1);
  color:#3a3a42;box-shadow:0 1px 0 rgba(255,255,255,.8);
}
.backend-dashboard-shell .backend-identity { width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px; }
.backend-dashboard-shell .backend-identity a { color:#0071e3;text-decoration:none;font-weight:650; }
.backend-dashboard-shell #app-header {
  min-height:70px;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:14px;
  flex-wrap:wrap;background:#fff;border:1px solid rgba(60,60,67,.09);border-radius:18px 18px 0 0;
  box-shadow:0 5px 24px rgba(31,35,48,.06);
}
.backend-dashboard-shell .header-left,.backend-dashboard-shell .header-right { display:flex;align-items:center;gap:10px;min-width:0; }
.backend-dashboard-shell .header-brand { display:flex;align-items:center;gap:9px;color:var(--text-main,#17171b);text-decoration:none;font-size:18px;font-weight:750;letter-spacing:-.02em; }
.backend-dashboard-shell .header-logo-img { border-radius:10px;box-shadow:0 2px 8px rgba(0,113,227,.12); }
.backend-dashboard-shell .header-branch-pill {
  display:flex;align-items:center;gap:7px;min-height:42px;padding:7px 13px;border-radius:22px;
  background:#f4f4f8;border:1px solid rgba(60,60,67,.1);font-size:12px;white-space:nowrap;
}
.backend-dashboard-shell .branch-label-dim { color:var(--text-muted,#8e8e93); }
.backend-dashboard-shell .user-profile-badge { background:#fff;border-color:rgba(60,60,67,.14); }
.backend-dashboard-shell .user-name-exec { color:var(--text-main,#242429); }
.backend-dashboard-shell .backend-account-btn,.backend-dashboard-shell .backend-logout-btn {
  min-height:38px;padding:8px 12px;border-radius:11px;background:#fff;color:#34343a;border:1px solid rgba(60,60,67,.13);font-weight:600;
}
.backend-dashboard-shell #app-nav {
  display:flex !important;flex-wrap:nowrap;height:auto;min-height:48px;padding:3px 10px !important;gap:2px;
  background:#0066cc !important;border:0;border-radius:0 0 18px 18px;box-shadow:0 8px 20px rgba(0,102,204,.16);overflow-x:auto;white-space:nowrap;
}
.backend-dashboard-shell #app-nav .nav-tab-btn {
  min-height:40px;padding:7px 13px !important;margin:1px !important;border:0 !important;border-radius:9px !important;
  background:transparent !important;color:rgba(255,255,255,.88) !important;font-size:12px;font-weight:550;flex:0 0 auto;
}
.backend-dashboard-shell #app-nav .nav-tab-btn:hover { background:rgba(255,255,255,.14) !important;color:#fff !important; }
.backend-dashboard-shell #app-nav .nav-tab-btn[aria-current="page"] { background:#fff !important;color:#005bb8 !important;box-shadow:0 2px 8px rgba(0,44,88,.18); }
.backend-dashboard-shell main { padding:24px 0 100px !important; }
.backend-dashboard-shell #module-content { padding:0; }
.backend-dashboard-shell .pilot-panel {
  padding:24px;background:#fff;border:1px solid rgba(60,60,67,.1);border-radius:20px;
  box-shadow:0 8px 28px rgba(31,35,48,.06);animation:backend-scene-in .34s cubic-bezier(.16,1,.3,1) both;
}
@keyframes backend-scene-in { from { opacity:0;transform:translate3d(0,10px,0) scale(.992); } to { opacity:1;transform:none; } }
.backend-dashboard-shell .pilot-panel h2 { margin:0 0 18px;color:var(--text-main,#17171b);font-size:clamp(22px,2.4vw,30px);letter-spacing:-.025em; }
.backend-dashboard-shell .pilot-security-card,.backend-dashboard-shell .pilot-device,.backend-dashboard-shell .pilot-step {
  background:#fafafd;border-color:rgba(60,60,67,.12);border-radius:16px;
}
.backend-dashboard-shell button,.backend-dashboard-shell input,.backend-dashboard-shell select {
  color:#242429;background:#f7f7fb;border-color:rgba(60,60,67,.14);border-radius:11px;
}
.backend-dashboard-shell button:hover { border-color:rgba(0,113,227,.45); }
.backend-dashboard-shell form > button,.backend-dashboard-shell button[aria-current="page"] {
  background:#0071e3;border-color:#0071e3;color:#fff;
}
.backend-dashboard-shell .pilot-summary article { background:var(--bg-card-hover,#fafafd);border-color:var(--border-color,rgba(60,60,67,.1));border-left-color:var(--theme-accent-strong,#0071e3);border-radius:16px; }
.backend-dashboard-shell .pilot-status { color:var(--theme-accent-strong,#0071e3);background:var(--theme-accent-soft,rgba(0,113,227,.07));border-color:color-mix(in srgb,var(--theme-accent-strong,#0071e3) 25%,transparent); }
.backend-dashboard-shell .pilot-price,.backend-dashboard-shell .pilot-item legend,.backend-dashboard-shell .pilot-step legend { color:var(--theme-accent-strong,#0066cc); }
.backend-dashboard-shell .pilot-table th { color:var(--text-muted,#50505a);background:var(--bg-card-hover,#f4f4f8); }
.backend-dashboard-shell .iphone-bottom-bar { display:none !important; }

@media(max-width:768px) {
  .backend-dashboard-shell .main-viewport { padding:10px 10px 92px; }
  .backend-dashboard-shell #role-control-bar { padding:7px 12px; }
  .backend-dashboard-shell .backend-identity { font-size:11px; }
  .backend-dashboard-shell #app-header { padding:6px 8px;border-radius:16px;flex-wrap:nowrap !important;gap:4px !important; }
  .backend-dashboard-shell .header-brand-title { display:none; }
  .backend-dashboard-shell .header-left { min-width:0 !important;flex:1 1 auto !important;display:flex !important;align-items:center !important;gap:4px !important;overflow:hidden !important; }
  .backend-dashboard-shell .header-brand { flex-shrink:0 !important; }
  .backend-dashboard-shell .header-brand .itn-mark { width:34px !important;height:34px !important;min-width:34px !important; }
  .backend-dashboard-shell .header-branch-pill { max-width:152px !important;min-width:0 !important;flex:0 1 auto !important;padding:3px 6px !important;font-size:14px !important;letter-spacing:0 !important;white-space:nowrap !important;overflow:hidden !important;display:inline-flex !important;align-items:center !important; }
  .backend-dashboard-shell .header-branch-pill select { min-width:84px;max-width:136px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap; }
  .backend-dashboard-shell .header-branch-pill strong { overflow:hidden !important;text-overflow:ellipsis !important;white-space:nowrap !important;display:inline-block !important; }
  .backend-dashboard-shell .branch-label-dim,.backend-dashboard-shell .backend-account-btn,.backend-dashboard-shell .user-name-exec { display:none !important; }
  .backend-dashboard-shell .header-right { margin-left:auto;gap:3px !important;flex-shrink:0 !important;display:flex !important;align-items:center !important; }
  .backend-dashboard-shell .header-theme-btn { width:44px !important;min-width:44px !important;padding:0 !important; }
  .backend-dashboard-shell .header-theme-btn span, .backend-dashboard-shell .header-theme-btn strong { display:none !important; }
  .backend-dashboard-shell .backend-logout-btn { display:none !important; }   /* Đăng xuất nằm trong menu ảnh đại diện (27/09/2026) */
  .backend-dashboard-shell #app-nav { display:none !important; }
  .backend-dashboard-shell main { padding:14px 0 92px !important; }
  .backend-dashboard-shell .pilot-panel { padding:16px;border-radius:18px; }
  .backend-dashboard-shell .iphone-bottom-bar {
    position:fixed;z-index:1000;left:0;right:0;bottom:0;display:flex !important;align-items:center;justify-content:space-around;
    min-height:68px;padding:7px max(7px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));
    background:rgba(255,255,255,.94) !important;border-top:1px solid rgba(60,60,67,.12);box-shadow:0 -8px 24px rgba(31,35,48,.08);
    backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);
  }
  .backend-dashboard-shell .iphone-nav-item {
    min-width:54px;min-height:52px;padding:4px 5px;border:0;background:transparent;color:#8e8e93;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:9px;
  }
  .backend-dashboard-shell .iphone-nav-item.active { color:#0071e3; }
  .backend-dashboard-shell .iphone-nav-icon { font-size:19px;line-height:1; }
}

@media(prefers-reduced-motion:reduce) {
  .backend-dashboard-shell .pilot-panel { animation:none; }
}
/* Ô nhập nằm dưới header dính: chừa khoảng khi trình duyệt cuộn tới ô lỗi, bong bóng lỗi không bị che */
#module-content input,#module-content select,#module-content textarea{scroll-margin-top:150px}
#module-content input[aria-invalid="true"]{border-color:var(--color-red)}
/* Bảng Kho theo IMEI: số tiền canh phải, IMEI chữ đều, nút thao tác không xuống dòng lệch */
.backend-mode .pilot-kho table { min-width:860px; }
.backend-mode .pilot-kho th { white-space:nowrap; }
.backend-mode .pilot-kho td { white-space:normal; overflow-wrap:normal; word-break:normal; }
.backend-mode .pilot-kho td .pilot-status { white-space:nowrap; }
.backend-mode .pilot-num, .backend-mode th.pilot-num, .backend-mode .pilot-kho .pilot-num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.backend-mode .pilot-kho .pilot-imei { font-family:inherit; font-size:14px; font-variant-numeric:tabular-nums; letter-spacing:.02em; white-space:nowrap; }
.backend-mode .pilot-kho td:first-child { min-width:150px; }
.backend-mode .pilot-kho td[data-label="Pin / vị trí"] { min-width:104px; }
.backend-mode .pilot-kho th, .backend-mode .pilot-kho td { padding-left:10px; padding-right:10px; }
.backend-mode .pilot-kho .pilot-actions { white-space:nowrap; min-width:170px; }
/* Máy tính: nút thao tác nhỏ, xếp ngang (tối đa 2 hàng) để mỗi dòng máy thấp gọn như bảng Kiot */
.backend-mode .pilot-kho .pilot-actions > div { display:flex; flex-wrap:nowrap; gap:6px; }
.backend-mode .pilot-kho .pilot-actions button { min-height:34px; min-width:0; padding:4px 8px; font-size:13px; margin:0; }
.backend-mode .pilot-kho small { color:var(--text-muted); }
@media (max-width:600px) { .backend-mode .pilot-kho table { min-width:0; } .backend-mode .pilot-kho .pilot-num { text-align:left; } .backend-mode .pilot-kho .pilot-actions { white-space:normal; } .backend-mode .pilot-kho td:first-child, .backend-mode .pilot-kho td[data-label="Pin / vị trí"] { min-width:0; } .backend-mode .pilot-kho .pilot-actions > div { flex-wrap:wrap; } .backend-mode .pilot-kho .pilot-actions button { min-height:44px; padding:6px 12px; font-size:14px; } }
/* Nhận chuyển kho: thông tin máy bên trái, ô nhập + nút bên phải; điện thoại xếp dọc */
.backend-mode .pilot-receive { display:grid; grid-template-columns:minmax(220px,1.3fr) 1fr 1fr auto; gap:12px; align-items:end; padding:14px 0; border-bottom:1px solid var(--border-color); }
.backend-mode .pilot-receive-info { display:grid; gap:4px; align-self:center; }
.backend-mode .pilot-receive-info .pilot-imei { font-family:inherit; font-size:15px; font-variant-numeric:tabular-nums; }
@media (max-width:760px) { .backend-mode .pilot-receive { grid-template-columns:1fr; } }
.backend-mode .pilot-field-error { display:block; margin-top:4px; color:var(--color-red); font-size:13px; font-weight:500; }

.stocktake-summary { grid-template-columns:repeat(4,minmax(140px,1fr)); }
.stocktake-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:end; margin:16px 0; padding:12px; background:var(--bg-card-hover); border:1px solid var(--border-color); border-radius:12px; }
.stocktake-toolbar label { display:grid; gap:4px; min-width:180px; }
.stocktake-toolbar button { min-height:44px; }
.stocktake-groups { display:grid; gap:8px; }
.stocktake-model,.stocktake-storage,.stocktake-color { background:var(--bg-card); border:1px solid var(--border-color); border-radius:12px; overflow:hidden; }
.stocktake-model > summary,.stocktake-storage > summary,.stocktake-color > summary { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:48px; padding:10px 14px; cursor:pointer; list-style-position:inside; color:var(--text-main); }
.stocktake-model > summary { background:var(--bg-card-hover); font-size:20px; font-weight:700; min-height:56px; }
.stocktake-model > summary strong { font-size:20px; letter-spacing:-.01em; }
.stocktake-storage > summary strong { font-size:16px; }
.stocktake-storage > summary { font-size:14px; border-top:1px solid var(--border-color); }
.stocktake-color { margin:0 10px 10px; }
.stocktake-color > summary { font-size:13px; background:var(--bg-input); }
.stocktake-model > summary span,.stocktake-storage > summary span,.stocktake-color > summary span { color:var(--text-muted); font-size:12px; font-weight:500; }
.stocktake-imei-table { overflow:auto; }
.stocktake-imei-row { display:grid; grid-template-columns:36px 30px minmax(150px,1.2fr) 80px 210px 160px 100px 110px 105px minmax(90px,1fr); gap:12px; align-items:center; padding:9px 12px; border-top:1px solid var(--border-color); color:var(--text-main); font-size:12px; min-width:1150px; }
.stocktake-imei-row input[type="checkbox"] { width:22px; height:22px; min-width:22px; accent-color:var(--theme-accent-strong,var(--color-blue)); }
.stocktake-imei-row.stocktake-checked { background:var(--color-green-soft); }
.stocktake-imei-row code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px; color:var(--text-main); }
.stocktake-imei-row small { color:var(--text-muted); }
.stocktake-imei-row b { font-size:11px; }
.stocktake-matched b { color:var(--txt-ok,var(--theme-success)); }
.stocktake-missing b { color:var(--txt-bad,var(--theme-danger)); }
.stocktake-extra b { color:var(--txt-warn,var(--theme-warning)); }
.stocktake-transit b { color:var(--txt-accent,var(--theme-accent-strong)); }
.stocktake-warning { margin:8px 0; padding:10px 12px; color:var(--theme-warning,var(--color-amber)); background:var(--color-amber-soft); border:1px solid var(--border-color); border-radius:8px; font-size:12px; }
.stocktake-manual-note,.stocktake-manual-hint { margin:8px 0; color:var(--text-muted); font-size:12px; }
.stocktake-daily { margin:16px 0; padding:14px; background:var(--bg-card); border:1px solid var(--border-color); border-radius:12px; }
.stocktake-daily h3 { margin:0 0 6px; color:var(--text-main); }
.stocktake-daily-table { overflow:auto; margin-top:10px; }
.stocktake-daily-table table { width:100%; min-width:620px; border-collapse:collapse; color:var(--text-main); font-size:12px; }
.stocktake-daily-table th,.stocktake-daily-table td { padding:8px; border-bottom:1px solid var(--border-color); text-align:left; }
@media(max-width:700px) {
  .stocktake-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stocktake-toolbar { align-items:stretch; }
  .stocktake-toolbar label { flex:1 1 100%; }
  .stocktake-toolbar button { flex:1 1 calc(50% - 8px); }
  .stocktake-model > summary,.stocktake-storage > summary,.stocktake-color > summary { min-height:52px; padding:11px 12px; }
  .stocktake-imei-table { overflow-x:auto; }
}
/* Thuộc tính hidden phải thắng mọi display của component (vd .pilot-item display:flex làm nhóm "Hồ sơ trả góp" luôn hiện) */
.backend-mode [hidden] { display:none !important; }
.backend-mode .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.backend-mode .pilot-hd td[data-label="Thanh toán"] { min-width:220px; }
.backend-mode .pilot-hd .pilot-pay { display:block; white-space:nowrap; }
.backend-mode .pilot-hd .pilot-pay b { font-weight:600; font-variant-numeric:tabular-nums; }
@media (max-width:600px) { .backend-mode .pilot-hd td[data-label="Thanh toán"] { min-width:0; } .backend-mode .pilot-hd .pilot-pay { white-space:normal; } }
/* Chọn cách xem Kho: nút đang chọn nổi rõ bằng viền màu nhấn của theme */
.backend-mode .pilot-segment { margin-top:14px; gap:8px; }
.backend-mode .pilot-segment button[aria-pressed="true"] { border-color:var(--theme-accent); color:var(--theme-accent-strong, var(--text-main)); font-weight:600; box-shadow:inset 0 0 0 1px var(--theme-accent); }
/* Danh sách "Thêm" của thanh đáy iPhone: nổi phía trên thanh, mỗi mục cao ≥ 48px để bấm bằng ngón cái */
.backend-dashboard-shell .backend-more { position:fixed; left:10px; right:10px; bottom:calc(76px + env(safe-area-inset-bottom)); z-index:1001; display:grid; gap:2px; padding:8px; background:rgba(255,255,255,.98); border:1px solid rgba(60,60,67,.14); border-radius:18px; box-shadow:0 12px 32px rgba(31,35,48,.18); }
.backend-dashboard-shell .backend-more button { display:flex; align-items:center; gap:12px; min-height:48px; padding:10px 14px; border:0; border-radius:12px; background:transparent; color:#1d1d1f; font:inherit; font-size:15px; text-align:left; }
.backend-dashboard-shell .backend-more button.active { color:#0071e3; font-weight:600; background:rgba(0,113,227,.07); }
.backend-dashboard-shell .backend-more button:focus-visible { outline:2px solid #0071e3; outline-offset:0; }
.backend-mode .pilot-fill { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; font-size:13px; color:var(--text-muted); }
.backend-mode .pilot-fill:empty { display:none; }
.backend-mode .pilot-fill button { min-height:36px; padding:4px 12px; font-size:13px; }
/* Điện thoại: thẻ máy/hoá đơn gọn — tên làm tiêu đề, thông tin ngắn 2 cột (nhãn nhỏ phía trên), thao tác trải ngang.
   Trước đây mỗi máy 9 dòng nhãn–giá trị, cuộn rất dài. */
@media (max-width:600px) {
  .backend-mode .pilot-kho tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-auto-flow:row dense; gap:0 12px; padding:10px 12px; }
  .backend-mode .pilot-kho td { display:block; padding:6px 0; border-bottom:0; }
  .backend-mode .pilot-kho td::before { display:block; font-size:12px; font-weight:500; margin-bottom:2px; }
  .backend-mode .pilot-kho td:first-child, .backend-mode .pilot-kho td.pilot-actions, .backend-mode .pilot-kho td[data-label="Thanh toán"], .backend-mode .pilot-kho td[data-label="Máy / IMEI"] { grid-column:1 / -1; }
  .backend-mode .pilot-kho td:first-child::before, .backend-mode .pilot-kho td.pilot-actions::before { display:none; }
  .backend-mode .pilot-kho td:first-child strong { font-size:16px; }
  .backend-mode .pilot-kho td.pilot-actions { padding-top:10px; border-top:1px solid var(--border-color); margin-top:4px; }
}
/* Lỗi tại ô trong dòng máy (Nhập hàng): đặt dòng lỗi nổi bên dưới ô để các ô Giá nhập/Spa không bị đẩy lệch */
@media (min-width:601px) {
  .backend-mode .pilot-item label { position:relative; }
  .backend-mode .pilot-item .pilot-field-error { position:absolute; left:0; right:0; top:100%; }
  .backend-mode .pilot-item:has(.pilot-field-error) { padding-bottom:52px; }
}
/* Bộ lọc Kho: máy tính hiện thẳng hàng như cũ (ẩn tiêu đề "Bộ lọc"); điện thoại thu gọn, bấm để mở */
.backend-mode .pilot-loc { flex:3 1 460px; min-width:0; }
.backend-mode .pilot-loc-body { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.backend-mode .pilot-loc-body label { flex:1 1 140px; }
@media (min-width:601px) { .backend-mode .pilot-loc > summary { display:none; } }
@media (max-width:600px) {
  .backend-mode .pilot-loc { flex:1 1 100%; border:1px solid var(--border-color); border-radius:12px; padding:0 12px; }
  .backend-mode .pilot-loc > summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-weight:500; }
  .backend-mode .pilot-loc[open] { padding-bottom:12px; }
}
/* Nút chính của phiếu (Lưu phiếu nhập, Xác nhận lập hóa đơn, Lưu phiếu, Xác nhận nhận, Đối chiếu) phải nổi hơn nút phụ.
   themes.css làm phẳng mọi nút trong shell về màu ô nhập; dùng đúng mẫu nút chính của màn đăng nhập đã duyệt
   (--theme-accent-strong + chữ trắng) nên đúng cả 6 theme. Form tìm/lọc giữ nút thường. */
body.backend-dashboard-shell form:not([data-form="search"]):not([data-form="invoice-search"]):not([data-form="history-filter"]):not([data-form="sale-search"]):not([data-form="sale-void"]):not([data-form="huy-nhap"]) button:not([type="button"]) {
  background:var(--theme-accent-strong, #0071e3); border-color:var(--theme-accent-strong, #0071e3); color:#fff; font-weight:600;
}
body.backend-dashboard-shell form:not([data-form="search"]):not([data-form="invoice-search"]):not([data-form="history-filter"]):not([data-form="sale-search"]):not([data-form="sale-void"]):not([data-form="huy-nhap"]) button:not([type="button"]):disabled { opacity:.6; }
/* Graphite / Gold Noir: chữ trắng trên màu nhấn chỉ đạt 3.6–3.7:1 → dùng chữ tối (~5.6–5.9:1, đạt WCAG AA) */
html[data-itn-theme="graphite"] body.backend-dashboard-shell form:not([data-form="search"]):not([data-form="invoice-search"]):not([data-form="history-filter"]):not([data-form="sale-search"]):not([data-form="sale-void"]):not([data-form="huy-nhap"]) button:not([type="button"]),
html[data-itn-theme="gold-noir"] body.backend-dashboard-shell form:not([data-form="search"]):not([data-form="invoice-search"]):not([data-form="history-filter"]):not([data-form="sale-search"]):not([data-form="sale-void"]):not([data-form="huy-nhap"]) button:not([type="button"]) { color:#111; }
/* Hủy hóa đơn là thao tác phá hủy: không tô như nút lưu; viền + chữ đỏ để phân biệt */
body.backend-dashboard-shell form[data-form="sale-void"] button:not([type="button"]) { color:var(--txt-bad, #d70015); border-color:var(--txt-bad, #d70015); font-weight:600; }
.backend-view-switcher{display:flex;gap:4px;align-items:center;margin:12px 0}.backend-view-switcher button{min-height:36px;padding:7px 10px;border:1px solid var(--border-color,#d2d2d7);border-radius:8px;background:var(--card-bg,#fff);color:var(--text-main,#1d1d1f);cursor:pointer}.backend-view-switcher button[aria-pressed="true"]{background:#0071e3;color:#fff;border-color:#0071e3}.inventory-view-list .pilot-table td,.inventory-view-list .pilot-table th{padding-block:9px}.inventory-view-table .pilot-table td,.inventory-view-table .pilot-table th{padding:12px 10px}.inventory-view-table .pilot-table small,.inventory-view-list .pilot-table small{color:var(--text-muted,#6e6e73)}
/* Dòng máy bấm được để mở Thẻ kho (như Kiot bấm dòng hàng hoá) */
.backend-mode .pilot-kho:not(.pilot-hd) tbody tr:has([data-action="the-kho"]) { cursor:pointer; }
/* Tab hóa đơn nháp như Kiot (Hóa đơn 1, 2, +) */
.backend-mode .pilot-drafts { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 14px; padding-bottom:10px; border-bottom:1px solid var(--border-color); }
.backend-mode .pilot-draft { display:inline-flex; align-items:center; border:1px solid var(--border-color); border-radius:10px; overflow:hidden; }
.backend-mode .pilot-draft button { border:0; border-radius:0; min-height:38px; padding:6px 12px; background:transparent; }
.backend-mode .pilot-draft.is-active { border-color:var(--theme-accent-strong, #0071e3); box-shadow:inset 0 -2px 0 var(--theme-accent-strong, #0071e3); font-weight:600; }
.backend-mode .pilot-draft .pilot-draft-x { min-width:34px; padding:6px 8px; color:var(--text-muted); }
.backend-mode .pilot-draft-new { min-width:38px; min-height:38px; font-size:18px; }
/* Ô khách hàng (F4) */
.backend-mode .pilot-khach { flex-direction:column; align-items:stretch; }
.backend-mode .pilot-kh-results { display:grid; gap:4px; }
.backend-mode .pilot-kh-results button { text-align:left; min-height:40px; }
.backend-mode .pilot-kh-new:not([hidden]) { display:flex; flex-wrap:wrap; gap:10px; align-items:end; }
.backend-mode .pilot-khach-chon { margin:0; }
/* Kiểm theo skill itn-ui-quality (24/09):
   - Khung bảng làm mốc định vị: chữ sr-only (position:absolute) không thoát ra ngoài làm tràn ngang cả trang (Hóa đơn 1024px).
   - Nhãn trạng thái: chữ xanh #0071e3 trên nền xanh nhạt chỉ 4.27:1 → xanh đậm hơn (≥ 4.5:1).
   - Nút cách xem đang chọn: chữ màu nhấn chỉ 4.34:1 ở theme tối → chữ chính, giữ viền màu nhấn để nhận biết. */
.backend-mode .pilot-table-wrap { position:relative; }
/* #0058b0 đạt 4.5 trên nền sáng nhưng chìm trên theme tối → pha màu nhấn về màu chữ theme (đạt ở cả 7 theme). */
.backend-dashboard-shell .pilot-status { color:color-mix(in srgb, var(--theme-accent-strong, #0071e3) 62%, var(--text-main, #17171b)); }
.backend-mode .pilot-segment button[aria-pressed="true"] { color:var(--text-main); }

/* Bản kho cần ưu tiên quét nhanh: giảm lớp trang trí, tăng tương phản và phân cấp thao tác. */
.backend-dashboard-shell #role-control-bar { min-height:32px; padding:5px 16px; background:var(--bg-app); box-shadow:none; font-size:12px; }
.backend-dashboard-shell #app-header { min-height:62px; padding:8px 14px; border-radius:14px 14px 0 0; box-shadow:var(--shadow-sm); }
.backend-dashboard-shell #app-nav { min-height:50px; padding:5px 10px !important; gap:4px; background:var(--bg-card) !important; border:1px solid var(--border-color); border-top:0; border-radius:0 0 14px 14px; box-shadow:var(--shadow-sm); }
.backend-dashboard-shell #app-nav .nav-tab-btn { min-height:40px; padding:8px 12px !important; color:var(--text-muted) !important; font-size:13px; font-weight:650; }
.backend-dashboard-shell #app-nav .nav-tab-btn:hover { background:var(--bg-card-hover) !important; color:var(--text-main) !important; }
.backend-dashboard-shell #app-nav .nav-tab-btn[aria-current="page"] { background:var(--theme-accent-strong, #0071e3) !important; color:#fff !important; box-shadow:none; }
.backend-dashboard-shell main { padding:18px 0 84px !important; }
.backend-dashboard-shell .pilot-panel { padding:22px; border-radius:16px; }
.backend-dashboard-shell .pilot-panel h2 { margin-bottom:16px; font-size:clamp(24px,2.4vw,32px); }
.backend-dashboard-shell form[data-form="search"] { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)) minmax(230px,1.5fr) auto; gap:10px; align-items:end; padding:14px; background:var(--bg-card-hover); border:1px solid var(--border-color); border-radius:12px; }
.backend-dashboard-shell form[data-form="search"] label { min-width:0; flex:auto; }
.backend-dashboard-shell form[data-form="search"] > button { min-width:120px; white-space:nowrap; }
.backend-dashboard-shell .pilot-summary { margin:16px 0 6px; }
.backend-dashboard-shell .pilot-summary article { min-height:88px; padding:14px 16px; }
.backend-dashboard-shell .pilot-summary article span { font-size:13px; }
.backend-dashboard-shell .pilot-summary article strong { font-size:24px; line-height:1.1; }
.backend-dashboard-shell .pilot-table-wrap { margin-top:14px; border:1px solid var(--border-color); border-radius:12px; }
.backend-dashboard-shell .pilot-table { background:var(--bg-card); }
.backend-dashboard-shell .pilot-table caption { padding:12px 14px; font-size:13px; font-weight:650; color:var(--text-muted); }
.backend-dashboard-shell .pilot-table th { position:sticky; top:0; z-index:1; color:var(--text-main); font-size:12px; font-weight:700; letter-spacing:.01em; }
.backend-dashboard-shell .pilot-table td { color:var(--text-main); font-size:13px; }
.backend-dashboard-shell .pilot-table tbody tr:nth-child(even) { background:var(--bg-card-hover); }
.backend-dashboard-shell .pilot-table tbody tr:hover { background:var(--color-blue-soft); }
.backend-dashboard-shell .pilot-table small { color:var(--text-muted); }
.backend-dashboard-shell .backend-view-switcher { margin:14px 0 4px; }
@media (max-width:1100px) and (min-width:701px) {
  .backend-dashboard-shell .main-viewport { padding-inline:16px; }
  .backend-dashboard-shell #app-nav .nav-tab-btn { padding-inline:10px !important; font-size:12px; }
  .backend-dashboard-shell form[data-form="search"] { grid-template-columns:repeat(2,minmax(180px,1fr)); }
  .backend-dashboard-shell form[data-form="search"] > button { width:100%; }
}
@media (max-width:700px) {
  .backend-dashboard-shell .main-viewport { padding:8px 8px 92px; }
  .backend-dashboard-shell #role-control-bar { padding-inline:10px; }
  .backend-dashboard-shell #app-header { min-height:58px; }
  .backend-dashboard-shell main { padding:12px 0 92px !important; }
  .backend-dashboard-shell .pilot-panel { padding:14px; border-radius:14px; }
  .backend-dashboard-shell .pilot-panel h2 { font-size:24px; }
  .backend-dashboard-shell form[data-form="search"] { grid-template-columns:1fr; padding:12px; }
  .backend-dashboard-shell form[data-form="search"] > button { width:100%; }
  .backend-dashboard-shell .pilot-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .backend-dashboard-shell .pilot-summary article { min-height:78px; padding:11px 12px; }
  .backend-dashboard-shell .pilot-summary article strong { font-size:20px; }
  .backend-dashboard-shell .pilot-table-wrap { border:0; }
}

/* Khách quay lại / khách được giới thiệu (24/09/2026): ô tick + 2 lựa chọn, nhãn trong danh sách hoá đơn */
.backend-mode .pilot-khach-loai { display:grid; gap:10px; }
.backend-mode .pilot-khach-loai .pilot-check { display:flex; gap:10px; align-items:center; min-height:44px; font-weight:600; cursor:pointer; }
.backend-mode .pilot-khach-loai input[type="checkbox"], .backend-mode .pilot-khach-loai input[type="radio"] { width:20px; height:20px; accent-color:var(--theme-accent-strong, #0071e3); margin:0; }
.backend-mode .pilot-radio-row { display:flex; flex-wrap:wrap; gap:8px 20px; padding-left:30px; }
.backend-mode .pilot-radio-row label { display:flex; gap:8px; align-items:center; min-height:44px; cursor:pointer; }
.backend-mode .pilot-radio-row input:disabled + *, .backend-mode .pilot-radio-row label:has(input:disabled) { opacity:.55; cursor:default; }
.backend-mode .pilot-khach-tag { display:inline-block; margin-top:4px; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:600; color:var(--text-main); background:color-mix(in srgb, var(--theme-accent-strong, #0071e3) 14%, transparent); border:1px solid color-mix(in srgb, var(--theme-accent-strong, #0071e3) 35%, transparent); }

/* ══ BÁN HÀNG / HÓA ĐƠN — thiết kế lại 24/09/2026 (tiền tố .bh-, gốc #module-content để thắng quy tắc chung mà không cần !important). Chỉ dùng token theme (themes.css), không màu cứng,
   nên đổi theme là đổi theo. Mục tiêu: một màn thấy đủ máy – khách – tiền; số căn phải, trạng thái luôn có chữ. */
/* Màu chữ trạng thái pha về màu chữ chính của theme: giữ sắc xanh/cam/đỏ nhưng đạt ≥4.5:1 ở cả theme sáng lẫn tối
   (màu gốc --theme-success/--theme-accent-strong chỉ ~3.7–4.2 trên nền Sapphire; đo bởi phiên QA 24/09). */
#module-content { --bh-ok:color-mix(in srgb, var(--theme-success, #1f7a45) 62%, var(--text-main)); --bh-warn:color-mix(in srgb, var(--theme-warning, #935f00) 62%, var(--text-main)); --bh-bad:color-mix(in srgb, var(--theme-danger, #c0262d) 62%, var(--text-main)); --bh-link:color-mix(in srgb, var(--theme-accent-strong, #0071e3) 62%, var(--text-main)); }
#module-content .bh-sec > *, #module-content .bh-results, #module-content .bh-table-wrap { min-width:0; }
#module-content .bh-top { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:6px 16px; margin-bottom:12px; }
#module-content .bh-top h2 { margin:0; }
/* Tiêu đề nhận focus bằng code (tabindex=-1) để trình đọc màn hình đọc đúng chỗ, không phải ô bấm → không vẽ viền focus
   (27/09/2026: viền xanh quanh "Chi tiết hóa đơn" hiện cả trên iPhone, thấy khi chụp ảnh App Store). Giống .tb-cd .tb-dau h2:focus. */
#module-content .bh-top h2,
#module-content .bh-top h2:focus,
#module-content .bh-top h2:focus-visible,
#module-content .bh-top h2[tabindex="-1"]:focus,
#module-content .bh-top h2[tabindex="-1"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}
#module-content .bh-pilot { margin:0; font-size:13px; color:var(--text-muted); }
#module-content .bh-pilot strong { color:var(--bh-warn); letter-spacing:.02em; }
#module-content .bh-dim { color:var(--text-muted); font-weight:400; }
/* 124 (20/10/2026): cảnh báo Spa quá ngưỡng % giá nhập ngay dưới dòng vốn hoá đơn */
#module-content .bh-canh-bao { margin:4px 0 0; padding:6px 10px; border-radius:8px; background:#fef2f2; border:1px solid #fca5a5; color:#991b1b; font-weight:600; font-size:13px; }
html[data-itn-theme="graphite"] #module-content .bh-canh-bao, html[data-itn-theme="gold-noir"] #module-content .bh-canh-bao { background:#450a0a; border-color:#b91c1c; color:#fecaca; }
#module-content .bh-sub { display:block; color:var(--text-muted); font-size:13px; }
#module-content .bh-hint { margin:6px 0 0; font-size:13px; line-height:1.45; color:var(--text-muted); }
#module-content .bh-warn { color:var(--bh-warn); font-weight:600; }
#module-content kbd { display:inline-block; min-width:20px; padding:1px 5px; border:1px solid var(--border-color); border-bottom-width:2px; border-radius:5px; font:600 11px/1.4 var(--font-stack, system-ui); color:color-mix(in srgb, var(--text-muted) 65%, var(--text-main)); background:var(--bg-input); text-align:center; }
#module-content .bh-ico { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
#module-content .bh-link { background:transparent; border-color:transparent; color:var(--bh-link); font-weight:600; padding-inline:4px; justify-self:start; }
#module-content .bh-link:hover { text-decoration:underline; text-underline-offset:3px; }
#module-content .bh-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:600; line-height:1.6; white-space:nowrap; color:var(--text-main); background:color-mix(in srgb, var(--text-muted) 16%, transparent); }
#module-content .bh-badge.is-ok { color:var(--bh-ok); background:color-mix(in srgb, var(--theme-success, #1f7a45) 14%, transparent); }
#module-content .bh-badge.is-bad { color:var(--bh-bad); background:color-mix(in srgb, var(--theme-danger, #c0262d) 13%, transparent); }
#module-content .bh-tag { display:block; width:max-content; margin-top:4px; padding:1px 8px; border-radius:6px; font-size:12px; font-weight:600; color:var(--text-main); background:color-mix(in srgb, var(--theme-accent, #0a84ff) 12%, transparent); }
#module-content .bh-tag.is-warn { color:var(--bh-warn); background:color-mix(in srgb, var(--theme-warning, #935f00) 14%, transparent); }
#module-content .bh-imei { font-family:var(--font-stack, system-ui); font-variant-numeric:tabular-nums; letter-spacing:.03em; white-space:nowrap; color:var(--text-muted); }
#module-content .bh-imei b { color:var(--text-main); font-weight:700; }

/* Tab hóa đơn nháp: tên + máy đang chọn; chấm = đang nhập dở. */
#module-content .bh-drafts { display:flex; flex-wrap:wrap; gap:8px; align-items:stretch; }
#module-content .bh-draft { display:inline-flex; align-items:stretch; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-input); overflow:hidden; max-width:260px; }
#module-content .bh-draft > button { border:0; border-radius:0; background:transparent; min-height:48px; padding:6px 12px; text-align:left; display:grid; gap:1px; min-width:0; color:var(--text-main); }
#module-content .bh-draft-n { display:flex; align-items:center; gap:6px; font-weight:600; font-size:14px; }
#module-content .bh-draft-sub { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#module-content .bh-dot { width:7px; height:7px; border-radius:50%; background:var(--theme-warning, #b7791f); }
#module-content .bh-draft.is-active { border-color:var(--bh-link); box-shadow:inset 0 -3px 0 var(--theme-accent-strong, #0071e3); background:var(--bg-card); }
#module-content .bh-draft .bh-draft-x { display:grid; place-items:center; min-width:40px; padding:0; color:var(--text-muted); border-left:1px solid var(--border-color); }
#module-content .bh-draft .bh-draft-x:hover { color:var(--bh-bad); }
#module-content .bh-draft-new { display:inline-flex; align-items:center; gap:6px; min-height:48px; padding:0 14px; border-style:dashed; color:var(--text-muted); background:transparent; font-weight:600; }
#module-content .bh-draft-note { margin:6px 0 16px; font-size:12px; color:var(--text-muted); }

/* Bố cục: trái = tìm/chọn máy (+ gói), phải = khách, tiền, xác nhận. Hai cột từ 1024px, một cột theo thứ tự thao tác dưới đó. */
#module-content .bh { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(360px,1fr); gap:20px; align-items:start; margin-bottom:16px; }
#module-content .bh-col { display:grid; gap:0; min-width:0; }
#module-content form.bh-col { display:grid; gap:0; }
#module-content .bh-right { background:var(--bg-card-hover); border:1px solid var(--border-color); border-radius:16px; padding:4px 18px 18px; }
#module-content .bh-need { border:0; margin:0; padding:0; min-width:0; display:grid; }
#module-content .bh-need:disabled .bh-sec:not(.bh-confirm) { opacity:.55; }
#module-content .bh-sec { display:grid; gap:10px; padding:14px 0; border-top:1px solid var(--border-color); min-width:0; }
#module-content .bh-col > .bh-sec:first-child, #module-content .bh-right > .bh-sec:first-child { border-top:0; }
#module-content .bh-sec h3 { margin:0; font-size:15px; font-weight:650; letter-spacing:-.01em; color:var(--text-main); }
#module-content .bh-sec-h { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#module-content .bh-sec-h > button { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:6px 12px; font-weight:600; }
#module-content .bh-keys { font-size:12px; color:var(--text-muted); display:flex; gap:4px; align-items:center; flex-wrap:wrap; }
#module-content .bh-field { display:grid; gap:8px; font-size:13px; font-weight:600; color:var(--text-muted); flex:none; min-width:0; }
#module-content .bh-field input, #module-content .bh-field select { font-weight:400; color:var(--text-main); }
@media (max-width: 1023px), (pointer: coarse) {
  #module-content .bh-field input, #module-content .bh-field select,
  .backend-dashboard-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]) {
    min-height: 44px;
  }
}

/* Tìm máy */
#module-content form.bh-search { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; padding:0; }
#module-content form.bh-search input { font-size:16px; }
#module-content form.bh-search > button { min-width:150px; white-space:nowrap; }
#module-content .bh-results { min-height:120px; }
#module-content .bh-empty { margin:0; padding:18px 16px; border:1px dashed var(--border-color); border-radius:12px; color:var(--text-muted); font-size:14px; line-height:1.5; }
#module-content .bh-empty.is-bad { color:var(--bh-bad); display:grid; gap:10px; justify-items:start; }
#module-content .bh-empty.is-bad p { margin:0; }
#module-content .bh-count { margin:0 0 8px; font-size:13px; color:var(--text-muted); line-height:1.5; }
#module-content .bh-count strong { color:var(--text-main); font-variant-numeric:tabular-nums; }
#module-content .bh-table-wrap { border:1px solid var(--border-color); border-radius:12px; overflow:auto; max-height:min(58vh,560px); background:var(--bg-card); }
#module-content .bh-table { width:100%; border-collapse:collapse; font-size:14px; }
#module-content .bh-table th { position:sticky; top:0; z-index:1; text-align:left; font-size:12px; font-weight:600; color:var(--text-muted); background:var(--bg-card-hover); padding:8px 12px; border-bottom:1px solid var(--border-color); white-space:nowrap; }
#module-content .bh-table td { padding:8px 12px; border-bottom:1px solid var(--border-color); vertical-align:middle; color:var(--text-main); }
#module-content .bh-table tbody tr:last-child td { border-bottom:0; }
#module-content .bh-table tbody tr:hover, #module-content .bh-table tbody tr:focus-within { background:var(--theme-accent-soft, rgba(10,132,255,.08)); }
#module-content .bh-table td strong { font-weight:600; }
#module-content .bh-act { text-align:right; width:1%; }
#module-content .bh-act button { min-height:40px; min-width:72px; padding:6px 14px; font-weight:600; color:var(--bh-link); border-color:color-mix(in srgb, var(--theme-accent-strong, #0071e3) 45%, transparent); background:var(--bg-card); }
#module-content .bh-more { margin-top:10px; width:100%; min-height:44px; font-weight:600; color:var(--bh-link); }

/* Máy đã chọn */
#module-content .bh-picked-name { margin:0; font-size:20px; font-weight:650; letter-spacing:-.015em; color:var(--text-main); overflow-wrap:anywhere; }
#module-content .bh-kv { display:grid; gap:0; margin:4px 0 0; }
#module-content .bh-kv > div { display:grid; grid-template-columns:120px minmax(0,1fr); gap:12px; padding:7px 0; border-top:1px solid var(--border-color); }
#module-content .bh-kv dt { color:var(--text-muted); font-size:13px; }
#module-content .bh-kv dd { margin:0; color:var(--text-main); overflow-wrap:anywhere; }
#module-content .bh-picked .bh-imei { font-size:17px; }

/* Khách hàng */
#module-content .bh-kh { display:grid; gap:10px; }
#module-content .bh-kh-le { margin:0; display:flex; gap:8px; align-items:center; flex-wrap:wrap; font-size:13px; color:var(--text-muted); }
#module-content .bh-kh-le .bh-badge { color:var(--text-main); }
#module-content .bh-kh.is-chosen { grid-template-columns:minmax(0,1fr) auto; align-items:center; padding:10px 12px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card); }
#module-content .bh-kh-card strong { font-size:15px; }
#module-content .bh-kh-results { display:grid; gap:4px; }
#module-content .bh-kh-results:empty { display:none; }
#module-content .bh-kh-results button { display:grid; gap:1px; text-align:left; min-height:48px; padding:6px 12px; background:var(--bg-card); }
#module-content .bh-kh-results .bh-warn { margin:0; font-size:12px; }
#module-content .bh-kh-new:not([hidden]) { display:grid; grid-template-columns:1fr 1fr auto; gap:10px; align-items:end; }
/* Sửa khách tại chỗ (01/10/2026): nút Sửa cạnh Đổi khách; form 2 cột (tên · SĐT / địa chỉ · sinh nhật), nút Hủy · Lưu một hàng. */
#module-content .bh-kh-nut { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
#module-content .bh-kh-nut > button, #module-content .bh-kh-sua-mo, #module-content .bh-kh-sua-nut > button { min-height:44px; white-space:nowrap; font-weight:600; }
#module-content .bh-kh-new.bh-kh-sua { grid-template-columns:1fr 1fr; }
#module-content .bh-kh-sua-ghi { grid-column:1 / -1; margin:0; }
#module-content .bh-kh-sua-nut { grid-column:1 / -1; display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
#module-content .bh-kh-sua input:disabled { opacity:.7; cursor:not-allowed; }
#module-content [data-kh-hd] { display:grid; gap:8px; justify-items:start; }
#module-content [data-kh-hd] > p { margin:0; }
#module-content [data-kh-hd] > .bh-kh-sua { justify-self:stretch; }
#module-content .pilot-khach-loai.pilot-item { border:0; padding:0; margin:0; display:grid; gap:4px; }
#module-content .pilot-khach-loai legend { padding:0; margin-bottom:2px; font-size:13px; font-weight:600; color:var(--text-muted); }
#module-content .pilot-khach-loai .pilot-check { min-height:44px; font-weight:500; font-size:14px; color:var(--text-main); }
#module-content .pilot-khach-loai .pilot-radio-row { padding-left:28px; gap:0 20px; }
#module-content .pilot-khach-loai .pilot-radio-row label { flex:none; font-size:14px; color:var(--text-main); min-height:44px; }

/* Tiền: số căn phải, chữ số đều cột; giá bán to hơn để đối chiếu. */
#module-content .bh-money-f input { text-align:right; font-variant-numeric:tabular-nums; }
#module-content .bh-price { display:grid; gap:4px; }
#module-content .bh-price input { font-size:20px; font-weight:600; min-height:50px; }
#module-content .bh-price-out.pilot-price { margin:0; font-size:13px; font-weight:500; color:var(--text-muted); text-align:right; }
#module-content .bh-pays { border:0; margin:0; padding:0; min-width:0; }
#module-content .bh-pays legend { padding:0; margin-bottom:6px; font-size:13px; font-weight:600; color:var(--text-muted); }
#module-content .bh-pay-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 10px; }
#module-content .bh-pay-grid .bh-field { font-weight:500; }
#module-content .bh-inst.pilot-item { border-style:solid; background:var(--bg-card); margin-top:4px; }
#module-content .bh-inst label { flex:1 1 160px; font-size:13px; color:var(--text-muted); }
/* Thu máy khách + khoản vay 2 (25/09/2026) */
#module-content .bh-thu.pilot-item { border-style:solid; background:var(--bg-card); margin-top:4px; display:grid; gap:8px; align-items:stretch; }
#module-content .bh-thu .bh-field input, #module-content .bh-thu .bh-field select { min-height:44px; }
#module-content .bh-thu-row { display:grid; grid-template-columns:1fr 1fr; gap:8px 10px; }
#module-content .bh-thu [data-thu-nhan]:empty { display:none; }
#module-content .bh-thu [data-thu-nhan] { margin:0; font-weight:600; color:var(--text-main); }
#module-content .bh-thu .itn-scan-btn { min-height:44px; margin-top:6px; }
#module-content .bh-vay2 { flex:1 1 100%; border-top:1px solid var(--border-color); padding-top:6px; }
#module-content .bh-vay2 > summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-size:14px; font-weight:600; color:var(--txt-accent, var(--text-main)); }
#module-content .bh-vay2-body { display:flex; flex-wrap:wrap; gap:10px; align-items:end; padding-top:4px; }
#module-content .bh-vay2-body label { flex:1 1 160px; font-size:13px; color:var(--text-muted); }
/* Khách mới: "Thêm địa chỉ, sinh nhật" chiếm nguyên một hàng (không bóp ô Tên/SĐT), tiêu đề bấm ≥44pt */
#module-content .bh-kh-them { grid-column:1 / -1; }
#module-content .bh-kh-them > summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-size:14px; font-weight:600; color:var(--txt-accent, var(--text-main)); }
#module-content .bh-kh-them[open] { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:8px 10px; }
#module-content .bh-kh-them[open] > summary { grid-column:1 / -1; }
#module-content .bh-sum { margin:0; display:grid; gap:0; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card); overflow:hidden; }
#module-content .bh-sum > div { display:flex; justify-content:space-between; gap:12px; padding:8px 12px; border-top:1px solid var(--border-color); }
#module-content .bh-sum > div:first-child { border-top:0; }
#module-content .bh-sum dt { color:var(--text-muted); font-size:14px; }
#module-content .bh-sum dd { margin:0; font-variant-numeric:tabular-nums; font-weight:600; color:var(--text-main); text-align:right; }
#module-content .bh-sum-last { background:var(--bg-card-hover); }
#module-content .bh-sum-last dd { font-size:17px; }
#module-content .bh-sum-last.is-ok dd, #module-content .bh-sum-note.is-ok { color:var(--bh-ok); }
#module-content .bh-sum-last.is-warn dd, #module-content .bh-sum-note.is-warn { color:var(--bh-warn); }
#module-content .bh-sum-last.is-bad dd, #module-content .bh-sum-note.is-bad { color:var(--bh-bad); }
#module-content .bh-sum-note { margin:6px 0 0; font-size:13px; font-weight:600; color:var(--text-muted); }

/* Xác nhận */
#module-content .bh-recap { margin:0; display:grid; gap:0; font-size:13px; }
#module-content .bh-recap > div { display:grid; grid-template-columns:104px minmax(0,1fr); gap:10px; padding:4px 0; }
#module-content .bh-recap dt { color:var(--text-muted); }
#module-content .bh-recap dd { margin:0; color:var(--text-main); overflow-wrap:anywhere; }
#module-content .bh-primary { width:100%; min-height:52px; margin-top:6px; font-size:16px; font-weight:650; color:#fff; background:var(--theme-accent-strong, #0071e3); border-color:var(--bh-link); border-radius:12px; box-shadow:0 6px 16px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 28%, transparent); transition:transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s; }
#module-content .bh-primary:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 10px 22px color-mix(in srgb, var(--theme-accent-strong, #0071e3) 34%, transparent); }
#module-content .bh-primary:disabled { opacity:.45; box-shadow:none; cursor:not-allowed; }
#module-content .bh-ok-banner p { margin:0; }
#module-content .bh-alert { margin:0; padding:10px 12px; border-radius:10px; font-size:13px; font-weight:600; color:var(--bh-bad); background:color-mix(in srgb, var(--theme-danger, #c0262d) 10%, transparent); }
#module-content .bh-ok-banner { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin:0 0 14px; padding:12px 14px; border-radius:12px; color:var(--bh-ok); background:color-mix(in srgb, var(--theme-success, #1f7a45) 12%, transparent); }
#module-content .bh-results > *, #module-content [data-tong] > * { animation:bh-vao .2s cubic-bezier(.16,1,.3,1) both; }
@keyframes bh-vao { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }

/* Danh sách + chi tiết hóa đơn */
#module-content form.bh-filter { display:grid; grid-template-columns:minmax(220px,2fr) repeat(3,minmax(140px,1fr)) auto; gap:10px; align-items:end; padding:14px; margin-bottom:10px; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-card-hover); }
#module-content form.bh-filter > label { font-size:13px; font-weight:600; color:var(--text-muted); }
#module-content form.bh-filter > button { white-space:nowrap; min-width:120px; }
#module-content .bh-dates:not([hidden]) { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,220px)); gap:10px; }
#module-content .bh-chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 10px; }
#module-content .bh-chip { display:inline-flex; align-items:center; gap:2px; padding:0 0 0 12px; border:1px solid var(--border-color); border-radius:999px; font-size:13px; background:var(--bg-card); color:var(--text-main); }
#module-content .bh-chip button { min-height:36px; min-width:36px; padding:0; display:grid; place-items:center; border:0; background:transparent; color:var(--text-muted); border-radius:999px; }
#module-content .bh-chip button:hover { color:var(--bh-bad); }
#module-content .bh-chips .bh-link { min-height:36px; font-size:13px; }
#module-content .pilot-hd tbody tr { cursor:pointer; }
#module-content .bh-pager { justify-content:center; }
#module-content .bh-inv { display:grid; gap:14px; }
#module-content .bh-inv-h { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
#module-content .bh-inv-h h3 { margin:0; font-size:18px; overflow-wrap:anywhere; }
#module-content .bh-inv-h .bh-sub { flex-basis:100%; }
#module-content .bh-inv-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 24px; }
#module-content .bh-inv-sec h4 { margin:0 0 4px; font-size:13px; font-weight:650; color:var(--text-muted); }
#module-content .bh-inv-sec p { margin:4px 0; }
#module-content .bh-inv-sec .bh-kv > div:first-child { border-top:0; }
#module-content .bh-inv-sec .bh-kv > div { grid-template-columns:150px minmax(0,1fr); }

@media (max-width:1180px) { #module-content form.bh-filter { grid-template-columns:repeat(2,minmax(0,1fr)); } #module-content .bh-filter-q { grid-column:1 / -1; } }
/* Bố cục Bán hàng theo bề rộng KHUNG (container query) — có thanh bên thì vùng nội dung hẹp hơn cửa sổ. */
#module-content .pilot-panel:has(.bh) { container:bh / inline-size; }
@container bh (max-width:759px) { #module-content .bh { grid-template-columns:1fr; } #module-content .bh-right { position:static; } }
@media (max-width:1023px) { #module-content .bh-inv-grid { grid-template-columns:1fr; } }
@media (max-width:600px) {
  #module-content .bh-right { padding:2px 12px 14px; border-radius:14px; }
  #module-content form.bh-search { grid-template-columns:1fr; }
  #module-content form.bh-search > button { width:100%; }
  #module-content .bh-keys { display:none; }
  #module-content .bh-draft { max-width:calc(50% - 4px); }
  #module-content .bh-table-wrap { max-height:none; border:0; background:transparent; overflow:visible; }
  #module-content .bh-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #module-content .bh-table, #module-content .bh-table tbody { display:grid; gap:8px; }
  #module-content .bh-table tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 10px; padding:10px 12px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card); }
  #module-content .bh-table td { padding:0; border:0; }
  #module-content .bh-table td[data-label="Máy"] { grid-column:1; }
  #module-content .bh-table td.bh-act { grid-column:2; grid-row:1 / span 3; align-self:center; }
  #module-content .bh-table td[data-label="Chi nhánh"] { font-size:13px; color:var(--text-muted); }
  #module-content .pilot-fill button { min-height:44px; }
  #module-content .bh-pay-grid { grid-template-columns:1fr 1fr; }
  #module-content .bh-kh-new:not([hidden]) { grid-template-columns:1fr; }
  #module-content .bh-kv > div, #module-content .bh-inv-sec .bh-kv > div { grid-template-columns:96px minmax(0,1fr); }
  #module-content form.bh-filter { grid-template-columns:1fr; padding:12px; }
  #module-content .bh-dates:not([hidden]) { grid-template-columns:1fr 1fr; }
}

/* Gọn cho 1440×900: tiêu đề + tab cùng hàng, khách một hàng, thanh toán 3 cột, tóm tắt 2 cột. */
#module-content .bh-top h2, #module-content .bh-top h2[tabindex] { color:var(--text-main); }
#module-content .bh-top-sale { align-items:center; justify-content:flex-start; margin-bottom:14px; }
#module-content .bh-top-sale h2 { margin-right:8px; }
#module-content .bh-notes { margin-left:auto; display:grid; gap:2px; justify-items:end; text-align:right; }
#module-content .bh-notes .bh-draft-note { margin:0; }
#module-content .bh-lbl { display:flex; align-items:center; gap:6px; }
#module-content .bh-kh-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:end; }
#module-content .bh-kh-row > button { min-height:44px; white-space:nowrap; font-weight:600; }
#module-content .bh-pay-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
#module-content .bh-price { grid-template-columns:minmax(0,1fr); position:relative; }
#module-content .bh-price-out.pilot-price { position:absolute; top:0; right:0; }
#module-content .bh-recap { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:16px; }
#module-content .bh-recap > div { grid-template-columns:86px minmax(0,1fr); }
#module-content .bh-sec { padding:12px 0; gap:8px; }
#module-content .pilot-khach-loai .pilot-check { min-height:44px; }
#module-content .pilot-khach-loai .pilot-radio-row { padding-left:28px; }
#module-content .pilot-khach-loai legend { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
/* ≥1280px: ba cột — máy | khách + tiền | tổng + tóm tắt + nút. Form (cột phải) tự chia 2 cột trong; fieldset bọc phần cần máy
   dùng display:contents để hai mục của nó nằm ở hai cột khác nhau mà vẫn cùng bị khoá khi chưa chọn máy. */
@container bh (min-width:1200px) {
  #module-content .bh { grid-template-columns:minmax(320px,1fr) minmax(0,1.95fr); }
  #module-content form.bh-right { grid-template-columns:minmax(0,1.15fr) minmax(290px,.9fr); column-gap:22px; align-items:start; }
  #module-content .bh-right .bh-need { display:contents; }
  #module-content .bh-sec-kh, #module-content .bh-right .bh-need > :not(.bh-confirm) { grid-column:1; }
  #module-content .bh-right .bh-confirm { grid-column:2; grid-row:1 / span 6; border-top:0; position:sticky; top:12px; }
  #module-content .bh-recap { grid-template-columns:1fr; }
}
@media (max-width:1280px) { #module-content .bh-recap { grid-template-columns:1fr; } }
@media (max-width:600px) {
  #module-content .bh-top-sale h2 { flex-basis:100%; }
  #module-content .bh-notes { margin-left:0; justify-items:start; text-align:left; flex-basis:100%; }
  #module-content .bh-pay-grid { grid-template-columns:1fr 1fr; }
  #module-content .bh-kh-row { grid-template-columns:1fr; }
}
/* Nút chính trên nền nhấn sáng (Gold Noir, Graphite): chữ trắng chỉ ~3:1 → dùng chữ tối của theme (≥5:1). */
html[data-itn-theme="gold-noir"] #module-content .bh-primary, html[data-itn-theme="graphite"] #module-content .bh-primary { color:var(--bg-app); }
@media (prefers-reduced-motion:reduce) { #module-content .bh-results > *, #module-content [data-tong] > * { animation:none; } #module-content .bh-primary { transition:none; } }

/* Kiểm kho tay (QA 24/09): cả dòng máy là nhãn của ô tick (vùng bấm ≥ 44px), ô tick nhóm trong tiêu đề nhóm */
label.stocktake-imei-row { cursor:pointer; min-height:44px; }
.stocktake-group-check { margin-right:10px !important; vertical-align:middle; cursor:pointer; }
.stocktake-group-check:disabled { cursor:default; opacity:.4; }
.stocktake-daily-balance { margin:6px 0 10px; color:var(--text-main); }
.backend-mode .backend-identity a { display:inline-flex; align-items:center; min-height:44px; padding:0 10px; }

/* QA 24/09: nút Đăng xuất đủ vùng bấm 44px */
.backend-mode .backend-logout-btn { min-height:44px; }

/* ── Kiểm kho 25/09/2026: tab Cần kiểm / Đã kiểm; dòng vừa tick mờ dần rồi rời danh sách ── */
.stocktake-tabs { margin:12px 0 4px; }
.stocktake-imei-row { transition:opacity .24s ease, transform .24s ease; }
.stocktake-imei-row.stocktake-fading { opacity:0; transform:translateX(12px); pointer-events:none; }
@media(prefers-reduced-motion:reduce) { .stocktake-imei-row { transition:none; } .stocktake-imei-row.stocktake-fading { transform:none; } }

/* ── Vòng đời máy theo IMEI (nhập lại đợt 2, 3…) ── */
.vong-doi { margin:12px 0 16px; padding:12px 14px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card, transparent); }
.vong-doi h3 { margin:0 0 4px; font-size:15px; }
.vd-list { list-style:none; margin:8px 0 0; padding:0 0 0 14px; border-left:2px solid var(--border-color); }
.vd-muc { position:relative; display:flex; flex-wrap:wrap; gap:4px 10px; align-items:baseline; padding:6px 0 6px 6px; }
.vd-muc::before { content:""; position:absolute; left:-21px; top:12px; width:10px; height:10px; border-radius:50%; background:var(--text-muted); }
.vd-muc.vd-nhap::before { background:var(--color-blue, #0071e3); }
.vd-muc.vd-ban::before { background:var(--color-green, #34c759); }
.vd-muc.vd-tra-hang::before, .vd-muc.vd-huy-ban::before, .vd-muc.vd-doi-may-ve-kho::before { background:var(--color-orange, #ff9500); }
.vd-ngay { font-variant-numeric:tabular-nums; color:var(--text-muted); font-size:12px; min-width:84px; }
.vd-ct { color:var(--text-main); font-size:13px; flex-basis:100%; padding-left:94px; }
@media(max-width:600px) { .vd-ct { padding-left:0; } }
/* Lịch sử cũ từ file kho (27/09/2026): cùng dòng thời gian với Vòng đời; bo 8px theo luật mới, mốc xuất khác màu nhập. */
.vong-doi.vong-doi-cu { border-radius:8px; }
.vd-muc.vd-xuat::before { background:var(--text-muted); }
.lsc-may { margin:10px 0 0; font-size:14px; font-weight:600; }
/* Gợi ý dưới ô IMEI khi nhập hàng */
.pilot-goi-y { display:block; margin-top:4px; font-size:12px; color:var(--color-blue, #0071e3); font-weight:500; }
.pilot-goi-y.is-warn { color:var(--color-red, #d70015); }
/* Nhập hàng 25/09: tóm tắt giá từng máy trước khi lưu (máy sau để trống = theo máy 1) */
[data-inbound-summary] { flex:1 1 100%; grid-column:1 / -1; }
[data-inbound-summary]:empty { display:none; }
.pilot-tom-tat { margin:4px 0 8px; padding-left:18px; font-size:13px; line-height:1.6; }
.pilot-tom-tat .pilot-imei { font-size:13px; }
.pilot-tom-tat li.is-warn { color:var(--color-red, #d70015); }

/* Kiểm kho: IMEI không tràn sang cột bên cạnh; chữ màu = màu máy (anh Nghĩa 25/09). */
.stocktake-imei-row > * { min-width:0; overflow-wrap:anywhere; }
.stocktake-imei-row code { white-space:nowrap; }
.mau-chip { display:inline-block; padding:2px 10px; border-radius:999px; font-weight:600; border:1px solid rgba(127,127,127,.45); line-height:1.5; }

/* Kiểm kho (anh Nghĩa 25/09): tên máy + màu VIẾT HOA, chữ to hơn chút cho dễ dò. */
.stocktake-model > summary strong { font-size:22px; text-transform:uppercase; letter-spacing:.01em; }
.stocktake-storage > summary strong { font-size:17px; }
.stocktake-color > summary { font-size:15px; }
.stocktake-imei-row { font-size:14px; }
.stocktake-imei-row > strong { text-transform:uppercase; font-size:14px; }
.stocktake-imei-row code { font-size:14px; }
.stocktake-imei-row small, .stocktake-imei-row b { font-size:13px; }
.stocktake .mau-chip, .stocktake-groups .mau-chip { text-transform:uppercase; font-size:14px; letter-spacing:.02em; }

/* Kiểm kho: tên nhóm và ô màu thẳng hàng bên trái (không căn giữa lệch nhau). */
.stocktake-model > summary > strong, .stocktake-storage > summary > strong, .stocktake-color > summary > strong { flex:1 1 auto; text-align:left; }
.stocktake-imei-row > span:nth-child(5) { justify-self:start; }

/* Ô màu dùng toàn hệ thống (anh Nghĩa 25/09): cỡ theo chữ xung quanh, KHÔNG viết hoa (viết hoa chỉ ở Kiểm kho). */
.mau-chip { font-size:.92em; padding:1px 8px; vertical-align:baseline; white-space:nowrap; }
.stocktake-groups .mau-chip { font-size:14px; padding:2px 10px; }

/* Tên màu dài (XANH DƯƠNG PACIFIC…) không đè sang cột IMEI: ô màu gói trong cột, xuống dòng nếu cần. */
.stocktake-imei-row .mau-chip { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:center; line-height:1.3; }
/* Trạm in ở quầy (25/09/2026): link nhỏ "In tại máy này" cạnh nút In; dòng báo "Đang in ở quầy…" trong khung vừa lập hóa đơn. */
#module-content button.bh-in-tai-may { min-height:44px; padding:0 6px; border:0; background:none; color:var(--txt-accent, #0071e3); text-decoration:underline; font-size:13px; font-weight:500; box-shadow:none; cursor:pointer; }
#module-content .bh-dang-in-quay { margin:0; font-weight:600; }

/* ═════ Gói iTN* tự chọn nội dung (anh Nghĩa 26/09/2026): tick mục áp dụng → chọn 1/3/6/9/12 tháng. Ô bấm ≥44px. ═════ */
#module-content .bh-tc { border:0; margin:12px 0 0; padding:0; min-width:0; }
#module-content .bh-tc[hidden] { display:none; }
#module-content .bh-tc legend { font-weight:600; font-size:14px; color:var(--text-main); padding:0; margin:0 0 6px; }
#module-content .bh-tc-ds { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
#module-content .bh-tc-dong { border:1px solid var(--border-color); border-radius:12px; padding:0 10px; background:var(--bg-card); min-width:0; }
#module-content .bh-tc-dong:has(input[data-tc]:checked) { border-color:var(--theme-accent-strong, #0071e3); }
#module-content .bh-tc-chk { display:flex; gap:10px; align-items:center; min-height:44px; cursor:pointer; font-size:14px; color:var(--text-main); }
#module-content .bh-tc-chk input { width:20px; height:20px; flex:none; margin:0; accent-color:var(--theme-accent-strong, #0071e3); }
#module-content .bh-tc-chk span { min-width:0; overflow-wrap:break-word; }
#module-content .bh-tc-thang { display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:0 0 10px 30px; }
#module-content .bh-tc-thang[hidden] { display:none; }
#module-content .bh-tc-thang label { position:relative; display:block; flex:0 0 auto; }   /* .backend-mode label ép flex 180px / 100% trên điện thoại → chip tháng xếp một hàng */
#module-content .bh-tc-thang input { position:absolute; inset:0; opacity:0; margin:0; cursor:pointer; }
#module-content .bh-tc-thang label > span { display:grid; place-items:center; min-width:44px; min-height:44px; padding:0 6px; box-sizing:border-box; border:1px solid var(--border-color); border-radius:999px; font-weight:600; font-size:14px; color:var(--text-main); background:var(--bg-card); }
#module-content .bh-tc-thang input:checked + span { background:var(--theme-accent-strong, #0071e3); border-color:var(--theme-accent-strong, #0071e3); color:#fff; }
#module-content .bh-tc-thang input:focus-visible + span { outline:2px solid var(--theme-accent-strong, #0071e3); outline-offset:2px; }
#module-content .bh-tc-thang input[aria-invalid="true"] + span { border-color:var(--bh-bad, #c0262d); }
#module-content .bh-tc-don { font-size:13px; color:var(--text-muted); margin-left:2px; }

/* ═════ Phí hồ sơ MCREDIT/MIRAE (thu hộ) — 3 tab cách thu, ô bấm ≥44px (anh Nghĩa 26/09/2026) ═════ */
#module-content .bh-phi[hidden], #module-content .bh-phi-nguon[hidden] { display:none; }
#module-content .bh-phi-nguon { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 2px; }
#module-content .bh-phi-nguon label { position:relative; display:block; flex:1 1 0; min-width:0; }   /* 3 tab một hàng như thanh chọn */
#module-content .bh-phi-nguon input { position:absolute; inset:0; opacity:0; margin:0; cursor:pointer; }
/* Phí hồ sơ có 4 cách thu (156, 18/11/2026 — thêm "Cộng vào khoản vay"): mỗi nút tối thiểu 140px → cột hẹp (điện thoại, cột thanh toán máy tính ~400px) tự
   xếp 2 × 2, cột rộng ≥ 580px mới 4 nút một hàng — chữ không bị bóp 3 dòng, nút không cao thấp lệch nhau. Hàng nút phí quẹt thẻ giữ nguyên. */
#module-content .bh-phi-nguon[data-phi-nguon] label { flex:1 1 140px; }
#module-content .bh-phi-nguon label > span { display:flex; align-items:center; justify-content:center; text-align:center; min-height:44px; padding:6px 8px; line-height:1.25; box-sizing:border-box; border:1px solid var(--border-color); border-radius:12px; font-weight:600; font-size:14px; color:var(--text-main); background:var(--bg-card); }
#module-content .bh-phi-nguon input:checked + span { background:var(--theme-accent-strong, #0071e3); border-color:var(--theme-accent-strong, #0071e3); color:#fff; }
#module-content .bh-phi-nguon input:focus-visible + span { outline:2px solid var(--theme-accent-strong, #0071e3); outline-offset:2px; }
#module-content .bh-phi-nguon input[aria-invalid="true"] + span { border-color:var(--bh-bad, #c0262d); }
/* Graphite / Gold Noir: nền điểm nhấn sáng vừa → chữ tối (như nút chính của 2 theme này) để đủ tương phản 4.5:1. */
html[data-itn-theme="graphite"] #module-content :is(.bh-tc-thang, .bh-phi-nguon) input:checked + span,
html[data-itn-theme="gold-noir"] #module-content :is(.bh-tc-thang, .bh-phi-nguon) input:checked + span { color:var(--bg-app, #0d0d0e); }
/* 2 khoản vay (anh Nghĩa 26/09/2026): nhập tay khoản 1 + khoản 2, cộng lại = Trả góp */
#module-content .bh-vay-chia { flex:1 1 100%; display:flex; flex-wrap:wrap; gap:10px; }
#module-content .bh-vay-chia label { flex:1 1 160px; font-size:13px; color:var(--text-muted); }
#module-content .bh-vay2-body [data-vay1] { flex:1 1 100%; margin:0; }
/* Voucher = giảm giá (anh Nghĩa 26/09/2026): ô tick "Có voucher" dưới Giá bán; tick mới hiện ô số tiền + dòng Thành tiền */
#module-content .bh-voucher, .backend-mode .bh-voucher { display:grid; gap:6px; margin:8px 0 4px; }
#module-content .bh-voucher-o { display:grid; gap:4px; max-width:320px; }
#module-content .bh-voucher-o[hidden] { display:none; }
#module-content .bh-voucher > label.pilot-check, .backend-mode .bh-voucher > label.pilot-check { display:flex; flex-direction:row; align-items:center; gap:10px; min-height:44px; font-weight:600; color:var(--text-main); }
#module-content .bh-voucher > label.pilot-check input { width:20px; height:20px; margin:0; flex:none; }

/* Mục thay pin iTN*: lựa chọn "Trọn đời" cạnh 1/3/6/9/12 tháng (26/09/2026) — chữ dài hơn nên ô rộng theo chữ. */
#module-content .bh-tc-thang .bh-tc-tron > span { width:auto; padding:0 14px; white-space:nowrap; }

/* Đổi máy bảo hành (033, 27/09/2026): hạn bảo hành theo ngày bán gốc, các lần đổi máy trên hóa đơn, gói mua thêm — phân tách bằng đường kẻ, không thẻ lồng. */
#module-content .bh-han-ds, #module-content .bh-doi-ds { list-style:none; margin:0; padding:0; }
#module-content .bh-han-ds li { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid var(--border-color); font-size:14px; }
#module-content .bh-han-ds li:first-child, #module-content .bh-doi-ds li:first-child { border-top:0; }
#module-content .bh-han-het { color:var(--txt-bad, #c0262d); font-weight:600; }
#module-content .bh-doi-ds li { display:grid; gap:2px; padding:8px 0; border-top:1px solid var(--border-color); font-size:14px; }
#module-content .bh-goi-them { border:0; margin:0; padding:0; }
#module-content .bh-goi-them legend label { display:flex; flex-direction:row; align-items:center; gap:10px; min-height:44px; font-weight:600; color:var(--text-main); }
#module-content .bh-goi-them legend input { width:20px; height:20px; margin:0; flex:none; }
#module-content .bh-goi-them [data-goi-them-o] { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
#module-content .bh-goi-them [data-goi-them-o][hidden] { display:none; }

/* Menu tài khoản ở ảnh đại diện (27/09/2026, như màn Hóa đơn): Tài khoản / Chủ đề / Đăng xuất. Token theme, bo 8px, ô bấm 44px. */
.backend-dashboard-shell .be-tk-wrap { position:relative; display:flex; }
.backend-dashboard-shell .user-profile-badge[data-be-tk] { min-height:44px; min-width:44px; font:inherit; color:inherit; cursor:pointer; }
.backend-dashboard-shell #be-tk-menu { position:absolute; right:0; top:calc(100% + 6px); z-index:1100; min-width:240px; max-width:min(320px, calc(100vw - 24px)); padding:4px 0;
  background:var(--bg-card,#fff); color:var(--text-main,#242429); border:1px solid var(--border-color,rgba(60,60,67,.14)); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.12); }
.backend-dashboard-shell #be-tk-menu[hidden] { display:none; }
.backend-dashboard-shell #be-tk-menu button { display:flex; align-items:center; gap:8px; width:100%; min-height:44px; padding:10px 16px; margin:0; border:0; border-radius:0;
  background:transparent; color:inherit; font:inherit; font-size:14px; text-align:left; cursor:pointer; }
.backend-dashboard-shell #be-tk-menu button:hover { background:var(--bg-card-hover,rgba(0,0,0,.04)); }
.backend-dashboard-shell #be-tk-menu button:focus-visible { outline:2px solid var(--theme-accent-strong,#0071e3); outline-offset:-2px; }
.backend-dashboard-shell #be-tk-menu .be-tk-dau { flex-direction:column; align-items:flex-start; gap:2px; border-bottom:1px solid var(--border-color,rgba(60,60,67,.14)); }
.backend-dashboard-shell #be-tk-menu .be-tk-dau span { font-size:12px; color:var(--text-muted,#6e6e73); }
.backend-dashboard-shell #be-tk-menu .is-nguy { color:var(--txt-bad,#d70015); border-top:1px solid var(--border-color,rgba(60,60,67,.14)); }
/* Gợi ý phím tắt (F3 / F4 / ↓ / Esc) chỉ hiện khi có bàn phím + chuột: ẩn ở màn cảm ứng hoặc hẹp ≤760px (27/09/2026). Phím vẫn chạy. */
@media (max-width:760px), (hover:none), (pointer:coarse) { #module-content .bh-keys, #module-content .bh-lbl kbd { display:none; } }
/* Huỷ nhập máy nhập nhầm (053, 01/10/2026): nút phá huỷ màu đỏ; nút trong bảng là chữ đỏ, nút xác nhận nền đỏ chữ trắng (đạt AA). */
.backend-mode .pilot-nguy-nhe, body.backend-dashboard-shell #module-content button.pilot-nguy-nhe { color:var(--txt-bad, #c0262d); }
.backend-mode .pilot-huy-may .pilot-huy-imei { white-space:nowrap; font-variant-numeric:tabular-nums; letter-spacing:.02em; }
/* (form huy-nhap được loại khỏi luật nút chính xanh ở trên, như sale-void) */
.backend-mode form > button.pilot-nguy, body.backend-dashboard-shell form[data-form="huy-nhap"] button:not([type="button"]) { background:#c0262d; border-color:#c0262d; color:#fff; font-weight:600; }
.backend-mode form > button.pilot-nguy:hover, body.backend-dashboard-shell form[data-form="huy-nhap"] button:not([type="button"]):hover { background:#a51f25; border-color:#a51f25; }
.backend-mode .pilot-huy-may { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:8px 16px; margin:12px 0; }
.backend-mode .pilot-huy-may dt { font-size:13px; color:var(--text-muted); }
.backend-mode .pilot-huy-may dd { margin:2px 0 0; font-weight:600; overflow-wrap:anywhere; }
.backend-mode form[data-form="huy-nhap"] textarea { width:100%; box-sizing:border-box; font:inherit; padding:10px; color:var(--text-main); background:var(--bg-input); border:1px solid var(--border-color); border-radius:6px; min-height:88px; }
/* Sửa thông tin máy (nhap:sua, 01/10/2026): nút lưu dùng luật nút chính xanh Apple ở trên; phần "Trước → Sau" là danh sách gọn, không thẻ lồng thẻ. */
.backend-mode form[data-form="sua-may"] textarea { width:100%; box-sizing:border-box; font:inherit; padding:10px; color:var(--text-main); background:var(--bg-input); border:1px solid var(--border-color); border-radius:6px; min-height:64px; }
.backend-mode form[data-form="sua-may"] textarea:focus-visible { outline:2px solid var(--theme-accent-strong, #0071e3); outline-offset:2px; }
.backend-mode .pilot-sua-xem { margin:4px 0; }
.backend-mode .pilot-sua-tieu { margin:0 0 6px; font-weight:600; }
.backend-mode .pilot-sua-diff { list-style:none; margin:0; padding:0; border-top:1px solid var(--border-color); }
.backend-mode .pilot-sua-diff li { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:baseline; padding:8px 0; border-bottom:1px solid var(--border-color); }
.backend-mode .pilot-sua-k { min-width:96px; font-size:13px; color:var(--text-muted); }
.backend-mode .pilot-sua-cu { text-decoration:line-through; color:var(--text-muted); overflow-wrap:anywhere; }
.backend-mode .pilot-sua-diff strong { overflow-wrap:anywhere; }
.backend-mode [data-sua-loi] { margin:0 0 8px; }
/* 01/10/2026 — Ghi chú đơn hàng (Bán hàng + chi tiết hóa đơn) và Phí quẹt thẻ. Token theme, bo tối đa 8px, ô bấm ≥ 44px. */
#module-content .bh-field textarea, #module-content .bh-gc-f textarea { width:100%; box-sizing:border-box; min-height:44px; padding:10px 12px; font:inherit; font-weight:400; font-size:15px; line-height:1.4; color:var(--text-main); background:var(--bg-input, var(--bg-card)); border:1px solid var(--border-color); border-radius:8px; resize:vertical; }
#module-content .bh-field textarea:focus-visible, #module-content .bh-gc-f textarea:focus-visible { outline:2px solid var(--theme-accent-strong, #0071e3); outline-offset:1px; }
#module-content .bh-field textarea[aria-invalid="true"], #module-content .bh-gc-f textarea[aria-invalid="true"] { border-color:var(--txt-bad, #d70015); }
#module-content .bh-inv-gc .bh-gc-noi { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--text-main); }
#module-content .bh-inv-gc [data-ghi-chu] { min-height:44px; margin-top:6px; border-radius:8px; }
#module-content .bh-gc-f { display:grid; gap:6px; }
#module-content .bh-gc-nut { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
#module-content .bh-gc-nut > span { margin-right:auto; font-size:12px; }
#module-content .bh-gc-nut button { min-height:44px; border-radius:8px; }
#module-content .bh-err { margin:0; font-size:13px; color:var(--txt-bad, #d70015); }
#module-content .bh-the[hidden] { display:none; }
#module-content .bh-the.pilot-item { border-style:solid; background:var(--bg-card); margin-top:4px; }
#module-content .bh-the .bh-phi { display:grid; gap:4px; }
@media (prefers-reduced-motion: reduce) { #module-content .bh-gc-f textarea { transition:none; } }

/* Form Thao tác máy (01/10/2026, anh Nghĩa "ô không ngay hàng"): canh MÉP TRÊN thay vì mép dưới — ô có dòng hướng dẫn
   (Giá Spa) không bị đẩy lên; nhóm theo loại phiếu xếp ô như hàng ngoài, dòng hướng dẫn nằm ngay dưới ô. */
.backend-mode form[data-form="operation"] { align-items:flex-start; }
.backend-mode form[data-form="operation"] label { align-content:start; }
.backend-mode form[data-form="operation"] > [data-show-for]:not([hidden]) { display:flex; flex-wrap:wrap; gap:12px; flex:2 1 260px; min-width:0; }
.backend-mode form[data-form="operation"] > [data-show-for] > .pilot-muted { flex:1 0 100%; margin:-6px 0 0; font-size:13px; }
.backend-mode form[data-form="operation"] > button { flex:0 0 auto; margin-top:4px; }
/* Máy tính: nút Lưu phiếu nằm cùng hàng → hạ xuống đúng ngang ô nhập (bằng chiều cao dòng nhãn + khoảng cách nhãn–ô). */
@media (min-width:761px) { .backend-mode form[data-form="operation"] > button { margin-top:calc(1lh + 5px); } }
/* Đổi máy bảo hành — "Bảo hành sau khi đổi" (070, 03/10/2026): 2 lựa chọn dạng thẻ radio (≥ 44px), khối chỉnh lưới 2 cột (1 cột điện thoại). */
#module-content .bh-chinh { border:1px solid var(--border-color); border-radius:8px; margin:4px 0 0; padding:10px 12px; display:grid; gap:8px; }
#module-content .bh-chinh legend { font-weight:600; padding:0 4px; }
#module-content .bh-chinh .bh-chon { display:flex; flex-direction:row; align-items:flex-start; gap:10px; min-height:44px; padding:8px 0; cursor:pointer; }
#module-content .bh-chinh .bh-chon input { width:20px; height:20px; margin:2px 0 0; flex:none; accent-color:var(--theme-accent-strong, #0071e3); }
#module-content .bh-chinh .bh-chon span { display:grid; gap:2px; }
#module-content .bh-chinh .bh-chon small { color:var(--text-muted); font-size:12.5px; line-height:1.4; }
#module-content .bh-chinh-o { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px 14px; }
#module-content .bh-chinh-o[hidden] { display:none; }
#module-content .bh-chinh-o .wide { grid-column:1 / -1; margin:0; }
@media (max-width: 640px) { #module-content .bh-chinh-o { grid-template-columns:minmax(0, 1fr); } }
/* Giá vốn máy khi về kho (phiếu trả hàng, 12/10/2026): 2 nút chọn dạng thẻ — cùng radio của bh-chinh, viền nhấn khi đã chọn. */
#module-content .tra-gv { width:100%; box-sizing:border-box; min-width:0; }
#module-content .tra-gv .tra-gv-ds { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
#module-content .tra-gv .tra-gv-ds.is-mot { grid-template-columns:minmax(0, 1fr); }
#module-content .tra-gv .tra-gv-nut { border:1px solid var(--border-color); border-radius:8px; padding:10px 12px; min-height:44px; }
#module-content .tra-gv .tra-gv-nut:has(input:checked) { border-color:var(--theme-accent-strong, #0071e3); box-shadow:inset 0 0 0 1px var(--theme-accent-strong, #0071e3); }
#module-content .tra-gv .tra-gv-nut:focus-within { outline:2px solid var(--theme-accent-strong, #0071e3); outline-offset:2px; }
#module-content .tra-gv .tra-gv-ghi { margin:0; }
@media (max-width: 640px) { #module-content .tra-gv .tra-gv-ds { grid-template-columns:minmax(0, 1fr); } }
/* ── Chuyển kho nhiều máy (081, 05/10/2026 — anh Nghĩa duyệt demo itn-chuyen-kho-nhieu) ── dùng token theme (sáng / tối) như màn Kho, không màu cứng
   trừ chữ trắng trên nút chính. Hai cột ≥ 900px; điện thoại một cột, dải tổng dính đáy trên tab đáy để bấm Chuyển không phải cuộn. */
#module-content .ck-cn { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:12px; align-items:end; margin:16px 0; }
#module-content .ck-cn label { margin:0; }
#module-content .ck-doi { width:48px; min-height:44px; font-size:20px; line-height:1; }
#module-content .ck-cot { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; align-items:start; }
#module-content .ck-khoi { min-width:0; border:1px solid var(--border-color); border-radius:12px; padding:14px; background:var(--bg-app); display:grid; gap:12px; }
#module-content .ck-khoi h3 { font-size:17px; margin:0; }
#module-content .ck-khoi h3 .pilot-muted { font-size:14px; font-weight:500; }
#module-content .ck-seg { margin:0; padding:0; }
#module-content .ck-seg button { flex:1 1 auto; }
#module-content .ck-khoi textarea { width:100%; min-height:120px; font:inherit; font-family:monospace; padding:10px; color:var(--text-main); background:var(--bg-input); border:1px solid var(--border-color); border-radius:8px; resize:vertical; }
#module-content .ck-them { padding:0; }
#module-content .ck-chinh { color:#fff; font-weight:600; background:var(--theme-accent-strong, #0071e3); border-color:var(--theme-accent-strong, #0071e3); border-radius:10px; padding:10px 18px; }
#module-content .ck-chinh:disabled { opacity:.5; cursor:not-allowed; }
#module-content .ck-ton, #module-content .ck-ds { list-style:none; margin:0; padding:0; display:grid; gap:8px; max-height:min(60vh, 560px); overflow:auto; }
#module-content .ck-ton-dong { display:flex; align-items:center; gap:12px; min-height:56px; padding:8px 12px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-card); cursor:pointer; margin:0; }
#module-content .ck-ton-dong.is-khoa { opacity:.6; cursor:not-allowed; }
#module-content .ck-ton-dong input[type="checkbox"] { width:22px; height:22px; min-width:22px; min-height:22px; }
#module-content .ck-may { display:grid; gap:2px; min-width:0; flex:1 1 auto; overflow-wrap:anywhere; }
#module-content .ck-may strong { font-weight:600; }
#module-content .ck-may .pilot-imei { font-size:12.5px; letter-spacing:0; white-space:nowrap; color:var(--text-muted); }
#module-content .ck-may small { font-size:12.5px; color:var(--text-muted); }
#module-content .ck-chip { flex:none; padding:2px 10px; border-radius:20px; font-size:12.5px; font-weight:600; white-space:nowrap; border:1px solid var(--border-color); }
#module-content .ck-chip.is-ready { color:var(--color-green); background:var(--color-green-soft); }
#module-content .ck-chip.is-spa { color:var(--theme-warning, var(--color-amber)); background:var(--color-amber-soft); }
#module-content .ck-dong { display:flex; align-items:center; gap:10px; padding:8px 8px 8px 12px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-card); }
#module-content .ck-dau { flex:none; width:18px; text-align:center; color:var(--color-green); font-weight:700; }
#module-content .ck-dong.is-loi { border-color:color-mix(in srgb, var(--color-red) 55%, transparent); background:var(--color-red-soft); }
#module-content .ck-dong.is-loi .ck-dau, #module-content .ck-ly-do { color:var(--color-red); }
#module-content .ck-dong .ck-may small.ck-ly-do { color:var(--color-red); font-weight:500; }
#module-content .ck-bo { flex:none; width:44px; min-height:44px; padding:0; color:var(--text-muted); }
#module-content .ck-trong { margin:0; }
#module-content .ck-ghi-chu { display:grid; gap:5px; margin:16px 0 0; }
#module-content .ck-tong { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:16px; padding:14px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card); }
#module-content .ck-tong-chu { display:grid; gap:4px; min-width:0; flex:1 1 260px; }
#module-content .ck-tong-chu strong { font-size:17px; }
#module-content .ck-tong-chu span { color:var(--text-muted); font-size:14px; }
#module-content .ck-tong-chu .pilot-error { color:var(--color-red); }
#module-content .ck-tong .ck-chinh { min-height:48px; flex:0 1 auto; }
#module-content .ck-xong { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; padding:12px 14px; border-radius:12px; border:1px solid color-mix(in srgb, var(--color-green) 45%, transparent); background:var(--color-green-soft); }
#module-content .ck-xong strong { flex:1 1 240px; }
#module-content .ck-nen { position:fixed; inset:0; z-index:200; background:rgba(0,0,0,.45); }
#module-content .ck-hop { position:fixed; z-index:201; left:50%; top:50%; transform:translate(-50%,-50%); width:min(440px, calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto;
  padding:20px; border-radius:14px; background:var(--bg-card); color:var(--text-main); border:1px solid var(--border-color); box-shadow:0 20px 50px rgba(0,0,0,.35); display:grid; gap:10px; }
#module-content .ck-hop h3 { margin:0; font-size:18px; }
#module-content .ck-hop p { margin:0 0 8px; line-height:1.5; }
#module-content .ck-hop-nut { justify-content:flex-end; padding:0; }
@media (max-width: 899px) { #module-content .ck-cot { grid-template-columns:minmax(0,1fr); } }
#module-content .ck-chua-day { display:none; }
/* Thẻ màn có hiệu ứng vào (backend-scene-in, giữ transform sau khi chạy) → phần tử position:fixed bên trong (dải tổng điện thoại, hộp xác nhận)
   bị neo theo thẻ thay vì màn hình. Màn này bỏ hiệu ứng vào để hai phần đó neo đúng màn hình. */
#module-content .pilot-panel:has(.ck-cn) { animation:none; transform:none; }
/* Điện thoại: dải tổng CỐ ĐỊNH ngay trên tab đáy (sticky không dùng được — .main-viewport có overflow-x:hidden nên là khung cuộn riêng
   nhưng không tự cuộn). Khoảng trống cuối màn bằng chiều cao dải để ô Ghi chú / dòng cuối không bị che. */
@media (max-width: 1023px) {
  #module-content .ck-tong { position:fixed; left:max(8px, env(safe-area-inset-left, 0px)); right:max(8px, env(safe-area-inset-right, 0px)); bottom:calc(72px + env(safe-area-inset-bottom, 0px));
    z-index:40; margin:0; box-shadow:0 -6px 24px rgba(0,0,0,.18); }
  #module-content .ck-tong .ck-chinh { width:100%; }
  #module-content .ck-chua-day { display:block; height:170px; }
}
@media (max-width: 600px) { #module-content .ck-cn { gap:8px; } #module-content .ck-khoi { padding:12px; } }

/* Phiếu kho: thanh lọc dạng nút (09/10/2026) */
.backend-mode form.pilot-filter { display:flex; flex-direction:column; gap:12px; align-items:stretch; }
.backend-mode .pk-nhom { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
.backend-mode .pk-nhom[hidden] { display:none; }
.backend-mode .pk-nhan { min-width:104px; font-size:12px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }
.backend-mode .pk-nhom .pilot-segment { margin-top:0; flex-wrap:wrap; }
.backend-mode .pk-nhom .pilot-segment button { min-height:44px; padding:6px 14px; }
.backend-mode .pk-ngay label, .backend-mode .pk-tim label { display:flex; flex-direction:column; gap:4px; font-size:12px; }
.backend-mode .pk-ngay, .backend-mode .pk-tim { width:100%; min-width:0; }
.backend-mode .pk-ngay label, .backend-mode .pk-tim label { min-width:0; max-width:100%; }
.backend-mode .pk-ngay input, .backend-mode .pk-tim input, .backend-mode .pk-tim select { width:100%; min-width:0!important; max-width:100%; box-sizing:border-box; }
.backend-mode .pk-selects { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; width:100%; }
.backend-mode .pk-selects label { min-width:0; }
.backend-mode .pk-selects select { width:100%; min-width:0!important; min-height:44px; }
.backend-mode .pk-tim button { min-height:44px; }
@media(max-width:700px) { .backend-mode .pk-selects { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.backend-mode .pk-tim { align-items:flex-end; }
.backend-mode .pk-tim > label:first-child { flex:1 1 280px; }
@media (max-width: 700px) { .backend-mode .pk-nhan { min-width:100%; } .backend-mode .pk-nhom .pilot-segment { overflow-x:auto; flex-wrap:nowrap; max-width:100%; } .backend-mode .pk-nhom .pilot-segment button { flex:0 0 auto; } }

/* Chờ giá (10/10/2026): ô giá + nút Lưu trên dòng */
.backend-mode .cho-gia-o { display:flex; gap:8px; align-items:center; min-width:220px; }
.backend-mode .cho-gia-o input { flex:1 1 120px; min-width:0; min-height:44px; box-sizing:border-box; }
.backend-mode .cho-gia-o button { min-height:44px; }
/* Bộ lọc kho và cảnh báo giá chưa có (09/10): chỉ hiện khi mở danh sách. */
.pilot-cost-warning{color:#c62828!important;background:#fff1f1;border:1px solid #ffd3d3;border-radius:7px;padding:7px 10px;display:inline-block;font-size:13px;line-height:1.5}.pilot-inbound-history{margin-top:32px;padding-top:24px;border-top:1px solid #e2e8ef}.pilot-kho-filter details{position:relative}.pilot-kho-filter summary{cursor:pointer;border:1px solid #dce3ec;border-radius:10px;padding:12px 20px;list-style:none;background:#fff}.pilot-kho-filter details[open]{width:100%}.pilot-kho-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:18px;background:#f8fafc;border:1px solid #e3e9f0;border-radius:12px;margin:12px 0}.pilot-kho-filter-grid label{display:block}.pilot-kho-filter-grid input:not([type=checkbox]),.pilot-kho-filter-grid select{width:100%}.pilot-kho-filter-grid fieldset{border:0;padding:0}.pilot-kho-filter-grid input[type=checkbox]{width:auto;margin-right:8px}.pilot-kho-filter-grid legend{font-size:13px;margin-bottom:8px}@media(max-width:700px){.pilot-kho-filter-grid{grid-template-columns:1fr}.pilot-kho-filter .pilot-toolbar>label{width:100%}}

/* ══ Khung app A — Kho trên điện thoại (anh Nghĩa duyệt bản xem trước 13/10/2026, nhóm 4 + 5) ═══════════════════════════════
   Thẻ máy gọn 2 dòng + màn chi tiết máy (backend-ui renderTheMay / renderChiTietMay), trình đơn ⋯ "Thao tác máy" và hộp Huỷ nhập
   (<dialog>), Phiếu kho nhóm theo ngày + tấm lọc đáy, dải mục con dính dưới thanh đầu. Chỉ token theme (19 theme sáng / tối),
   bo ≤ 8px, ô bấm ≥ 44px, có prefers-reduced-motion. --be-dau-h / --be-mucon-h: chiều cao thật đo ở backend-ui (doKhung). */
@media (max-width:760px) {
  /* Dải mục con (Hàng hóa · Nhập hàng · Phiếu kho…) dính ngay dưới thanh đầu, vẫn cuộn ngang trong dải. */
  body.backend-dashboard-shell .itn-mucon:not([hidden]) { position:sticky; top:calc(env(safe-area-inset-top, 0px) + var(--be-dau-h, 62px)); z-index:40; background:var(--bg-app); }
  /* Danh sách / chi tiết nằm thẳng trên nền app (không thẻ lồng thẻ, rộng chỗ cho thẻ máy 2 dòng). */
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds, .kho-ct, .pk-ngay-nhom, form[data-form="history-filter"]) { padding:4px 0 0 !important; background:transparent !important; border-color:transparent !important; box-shadow:none !important; animation:none; }
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds) h2 { font-size:20px; margin-bottom:6px; }
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds) .pilot-summary { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:6px; margin:8px 0; }
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds) .pilot-summary article { min-height:0; padding:8px 10px; gap:2px; border-radius:8px; }
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds) .pilot-summary article span { font-size:11.5px; line-height:1.25; }
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds) .pilot-summary article strong { font-size:16px; line-height:1.2; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body.backend-dashboard-shell .pilot-panel:has(.kho-ds) form[data-form="search"] { padding:10px; gap:8px; border-radius:8px; }
  #module-content:has(.kho-ct) > .itn-mobile-backbar { display:none; }   /* chi tiết máy đã có nút "‹ Kho" (cùng đường Back) */
}
body.be-khoa-cuon { overflow:hidden; }   /* tấm lọc / hộp đang mở: trang nền không cuộn theo ngón tay */

/* Thẻ máy */
#module-content .kho-dem { margin:14px 0 8px; font-size:13px; color:var(--text-muted); }
#module-content .kho-dem strong { color:var(--text-main); font-weight:600; font-variant-numeric:tabular-nums; }
#module-content :is(.kho-ds, .kho-ct-ds, .pk-ds, .pk-may-ds) { list-style:none; margin:0; padding:0; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-card); overflow:hidden; }
#module-content :is(.kho-ds, .kho-ct-ds, .pk-ds, .pk-may-ds) > li + li { border-top:1px solid var(--border-color); }
body.backend-dashboard-shell #module-content :is(button.kho-the, button.kho-ct-dong, button.pk-dong) {
  display:flex; align-items:center; gap:12px; width:100%; min-width:0; min-height:56px; margin:0; padding:10px 12px 10px 14px; border:0; border-radius:0;
  background:transparent; color:var(--text-main); font:inherit; font-size:15px; text-align:left; box-shadow:none; cursor:pointer; transition:background-color .15s;
}
body.backend-dashboard-shell #module-content :is(button.kho-the, button.kho-ct-dong, button.pk-dong):is(:hover, :active) { background:var(--bg-card-hover); }
body.backend-dashboard-shell #module-content :is(button.kho-the, button.kho-ct-dong, button.pk-dong):focus-visible { outline:2px solid var(--theme-accent-strong); outline-offset:-2px; }
#module-content .kho-the-l { flex:1 1 auto; min-width:0; display:grid; gap:4px; }
#module-content .kho-the-ten { color:var(--text-muted); line-height:1.3; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
#module-content .kho-the-ten strong { color:var(--text-main); font-weight:600; }
#module-content .kho-the-phu { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; font-size:13px; color:var(--text-muted); }
#module-content .kho-the-imei { color:var(--text-main); font-variant-numeric:tabular-nums; letter-spacing:.02em; white-space:nowrap; }
#module-content .kho-the-imei b { font-weight:700; }
#module-content .kho-the-von { flex:0 0 auto; max-width:42%; font-size:14px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; text-align:right; }
#module-content .kho-the-von.is-thieu { color:var(--txt-bad); font-size:13px; white-space:normal; }
#module-content .kho-chev { flex:0 0 auto; width:8px; height:8px; margin:0 4px 0 2px; border-top:2px solid var(--text-muted); border-right:2px solid var(--text-muted); transform:rotate(45deg); opacity:.75; }
#module-content :is(.kho-tt, .kho-nhan) { display:inline-flex; align-items:center; gap:5px; min-height:20px; padding:0 7px; border:1px solid var(--border-color); border-radius:6px; font-size:12px; font-weight:500; line-height:1.2; white-space:nowrap; color:var(--text-muted); }
#module-content .kho-tt::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
#module-content .kho-tt.is-ready { color:var(--txt-ok); border-color:color-mix(in srgb, var(--txt-ok) 40%, transparent); background:color-mix(in srgb, var(--theme-success, #1f7a45) 9%, transparent); }
#module-content .kho-tt.is-spa { color:var(--txt-accent); border-color:color-mix(in srgb, var(--txt-accent) 40%, transparent); background:var(--theme-accent-soft); }
#module-content .kho-tt:is(.is-transit, .is-loan) { color:var(--txt-warn); border-color:color-mix(in srgb, var(--txt-warn) 40%, transparent); background:color-mix(in srgb, var(--theme-warning, #935f00) 9%, transparent); }
#module-content .kho-tt.is-out { color:var(--txt-bad); border-color:color-mix(in srgb, var(--txt-bad) 40%, transparent); }
#module-content .kho-them { justify-content:center; padding:12px 0 4px; }
#module-content .kho-them button, #module-content .pk-them button { min-height:44px; border-radius:8px; }

/* Chi tiết máy */
#module-content .kho-ct-thanh { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:8px; margin:0 0 12px; }
body.backend-dashboard-shell #module-content button.kho-ct-lui { display:inline-flex; align-items:center; gap:2px; min-height:44px; min-width:44px; padding:0 10px 0 4px; border:0; border-radius:8px; background:transparent; color:var(--txt-accent); font-weight:600; box-shadow:none; }
body.backend-dashboard-shell #module-content .kho-ct-tieu { display:grid; margin:0; font-size:16px; line-height:1.25; letter-spacing:0; text-align:center; overflow-wrap:anywhere; }
#module-content .kho-ct-tieu small { font-size:12px; font-weight:400; color:var(--text-muted); font-variant-numeric:tabular-nums; }
body.backend-dashboard-shell #module-content :is(button.kho-ct-them, button.kho-chep) { display:grid; place-items:center; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-card); color:var(--text-main); box-shadow:none; }
body.backend-dashboard-shell #module-content button.kho-chep { color:var(--txt-accent); }
#module-content span.kho-ct-them { display:block; width:44px; }
#module-content .kho-ct-dau { padding:14px 16px; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-card); }
#module-content .kho-ct-ten { margin:0; font-size:20px; font-weight:700; line-height:1.25; overflow-wrap:anywhere; }
#module-content .kho-ct-phu { margin:2px 0 0; font-size:14px; color:var(--text-muted); }
#module-content .kho-ct-nhan { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 0; }
#module-content .kho-ct-imei { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; }
#module-content .kho-ct-imei-so { font-size:18px; font-variant-numeric:tabular-nums; letter-spacing:.04em; -webkit-user-select:all; user-select:all; }
body.backend-dashboard-shell #module-content .kho-ct-h { margin:20px 0 8px; font-size:13px; font-weight:600; line-height:1.3; letter-spacing:.04em; text-transform:uppercase; color:var(--text-muted); }
body.backend-dashboard-shell #module-content .kho-ct-h.is-nguy { color:var(--txt-bad); }
#module-content .kho-ct-tt { margin:0; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-card); overflow:hidden; }
#module-content .kho-ct-tt > div { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:44px; padding:10px 14px; box-sizing:border-box; }
#module-content .kho-ct-tt > div + div { border-top:1px solid var(--border-color); }
#module-content .kho-ct-tt dt { flex:0 0 auto; font-size:14px; color:var(--text-muted); }
#module-content .kho-ct-tt dd { min-width:0; margin:0; text-align:right; font-weight:500; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; white-space:pre-line; }
#module-content .kho-thieu { color:var(--txt-bad); font-weight:600; }
#module-content .kho-ct-ic { flex:0 0 auto; display:grid; place-items:center; width:32px; height:32px; border-radius:8px; background:var(--theme-accent-soft); color:var(--txt-accent); }
#module-content .kho-ct-chu { flex:1 1 auto; min-width:0; display:grid; gap:2px; }
#module-content .kho-ct-chu strong { font-weight:500; }
#module-content .kho-ct-chu small { font-size:12.5px; line-height:1.35; color:var(--text-muted); }
#module-content .kho-ct-ds.is-nguy { border-color:color-mix(in srgb, var(--theme-danger, #c0262d) 45%, var(--border-color)); }
#module-content .kho-ct-dong.is-nguy .kho-ct-chu strong { color:var(--txt-bad); font-weight:600; }
#module-content .kho-ct-dong.is-nguy .kho-ct-ic { background:color-mix(in srgb, var(--theme-danger, #c0262d) 12%, transparent); color:var(--txt-bad); }

/* Trình đơn ⋯ / chi tiết phiếu (tấm đáy trên điện thoại, hộp giữa trên máy tính) và hộp Huỷ nhập */
#module-content dialog:is(.kho-tam, .kho-hop) { margin:auto; padding:0; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-card); color:var(--text-main); box-shadow:0 16px 48px rgba(0,0,0,.28); overscroll-behavior:contain; }
#module-content dialog:is(.kho-tam, .kho-hop)::backdrop { background:rgba(0,0,0,.4); }
#module-content dialog.kho-tam { width:min(480px, calc(100vw - 32px)); max-width:none; max-height:min(80dvh, 720px); overflow:auto; }
#module-content .kho-tam-dau { position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:14px 16px 10px; background:var(--bg-card); border-bottom:1px solid var(--border-color); }
body.backend-dashboard-shell #module-content .kho-tam-dau h3 { margin:0; font-size:17px; line-height:1.3; }
#module-content .kho-tam-dau p { margin:2px 0 0; font-size:13px; color:var(--text-muted); overflow-wrap:anywhere; }
body.backend-dashboard-shell #module-content button.kho-tam-dong { flex:0 0 auto; min-height:44px; min-width:64px; padding:0 14px; border-radius:8px; }
#module-content .kho-tam-than { padding:12px 16px 16px; }
#module-content .kho-tam .kho-ct-h { margin-top:16px; }
#module-content .pk-may-ds > li { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:44px; padding:8px 14px; box-sizing:border-box; }
#module-content .pk-may-l { display:grid; gap:2px; min-width:0; }
#module-content .pk-may-l .pilot-imei { font-family:inherit; font-size:14px; font-variant-numeric:tabular-nums; letter-spacing:.02em; }
#module-content .pk-may-l small { font-size:12px; color:var(--text-muted); }
#module-content dialog.kho-hop { width:min(440px, calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); overflow:auto; padding:18px 18px 16px; box-sizing:border-box; }
body.backend-dashboard-shell #module-content dialog.kho-hop h2 { margin:0 0 6px; font-size:19px; letter-spacing:0; }
#module-content dialog.kho-hop .pilot-huy-may { grid-template-columns:repeat(2, minmax(0,1fr)); margin:10px 0; }
#module-content dialog.kho-hop .pilot-muted { margin:0 0 12px; font-size:13.5px; line-height:1.45; }
#module-content dialog.kho-hop form { display:grid; gap:10px; padding:0; }
#module-content dialog.kho-hop form textarea { border-radius:8px; }
#module-content .kho-hop-loi[hidden] { display:none; }
#module-content .kho-hop-nut { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
body.backend-dashboard-shell #module-content .kho-hop-nut button { min-height:44px; margin:0; border-radius:8px; font-weight:600; }
@media (max-width:760px) {
  #module-content dialog.kho-tam { position:fixed; inset:auto 0 0 0; width:100%; max-height:85dvh; margin:0; border-bottom:0; border-radius:8px 8px 0 0; padding-bottom:env(safe-area-inset-bottom, 0px); animation:kho-tam-len .22s cubic-bezier(.2,.8,.2,1); }
  /* Hộp Huỷ nhập đặt cao trên màn: bàn phím iOS mở (con trỏ ở ô lý do) không che ô và hai nút. */
  #module-content dialog.kho-hop { margin:calc(env(safe-area-inset-top, 0px) + 16px) auto auto; max-height:calc(100dvh - 32px - env(safe-area-inset-top, 0px)); }
}
@keyframes kho-tam-len { from { transform:translateY(24px); opacity:.6; } to { transform:none; opacity:1; } }

/* Phiếu kho: hàng tìm + nút Bộ lọc, chip đang lọc, tấm lọc đáy (điện thoại); máy tính giữ hàng ô chọn như cũ */
.backend-mode .pk-tam { display:flex; flex-direction:column; gap:12px; }
.backend-mode .pk-tim-hang { display:flex; align-items:flex-end; gap:8px; width:100%; min-width:0; }
.backend-mode .pk-tim-hang > .pk-tim { flex:1 1 auto; min-width:0; }
.backend-mode :is(.pk-tam-dau, .pk-tam-chan, .pk-nen, .pk-mo-loc, .pk-chip) { display:none; }
#module-content .pk-dem-dt { margin:2px 0 4px; font-size:13px; color:var(--text-muted); }
#module-content .pk-ngay-nhom { margin-top:10px; }
body.backend-dashboard-shell #module-content .pk-ngay-h { position:sticky; top:calc(env(safe-area-inset-top, 0px) + var(--be-dau-h, 0px) + var(--be-mucon-h, 0px)); z-index:5; display:flex; justify-content:space-between; gap:8px; margin:0; padding:8px 2px 6px; font-size:13px; font-weight:600; letter-spacing:0; color:var(--text-muted); background:var(--bg-app); }
#module-content .pk-ic { flex:0 0 auto; display:grid; place-items:center; width:32px; height:32px; border-radius:8px; background:var(--theme-accent-soft); color:var(--txt-accent); }
#module-content .pk-ic.is-inbound { background:color-mix(in srgb, var(--theme-success, #1f7a45) 12%, transparent); color:var(--txt-ok); }
#module-content .pk-ic:is(.is-sale-void, .is-supplier-return) { background:color-mix(in srgb, var(--theme-danger, #c0262d) 10%, transparent); color:var(--txt-bad); }
#module-content .pk-dong-l { flex:1 1 auto; min-width:0; display:grid; gap:3px; }
#module-content .pk-dong-t { font-weight:600; line-height:1.3; overflow-wrap:anywhere; }
#module-content .pk-dong-s { font-size:13px; line-height:1.35; color:var(--text-muted); overflow-wrap:anywhere; }
#module-content .pk-dong-r { flex:0 0 auto; display:grid; justify-items:end; gap:3px; max-width:40%; text-align:right; }
#module-content .pk-gio { font-size:13px; color:var(--text-muted); font-variant-numeric:tabular-nums; }
#module-content .pk-gt { font-size:13.5px; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#module-content .pk-gt.is-thieu { color:var(--txt-bad); }
@media (max-width:760px) {
  body.backend-dashboard-shell #module-content button.pk-mo-loc { position:relative; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; min-height:44px; min-width:88px; padding:0 14px; border-radius:8px; font-weight:600; }
  body.backend-dashboard-shell #module-content button.pk-mo-loc.is-loc { border-color:var(--theme-accent-strong); color:var(--txt-accent); background:var(--theme-accent-soft); }
  #module-content .pk-cham { position:absolute; top:7px; right:7px; width:8px; height:8px; border-radius:50%; background:var(--theme-accent-strong); }
  /* Ô tìm một hàng riêng; hàng dưới: Máy thu · Bộ lọc · chip đang lọc · Bỏ lọc (khối .pk-tim chỉ bỏ hộp, nút vẫn trong .pk-nhom). */
  .backend-mode .pk-tim-hang { flex-wrap:wrap; align-items:center; }
  .backend-mode .pk-tim-hang > .pk-tim { display:contents; }
  .backend-mode .pk-tim-hang .pk-tim > label:first-child { flex:1 1 100%; }
  .backend-mode .pk-tim-hang .pk-tim > button { flex:0 0 auto; white-space:nowrap; }
  #module-content .pk-chip { display:flex; flex:1 1 auto; flex-wrap:wrap; gap:6px; min-width:0; }
  #module-content .pilot-panel:has(form[data-form="history-filter"]) > p:first-of-type { margin:0 0 4px; font-size:13px; line-height:1.45; color:var(--text-muted); }
  body.backend-dashboard-shell #module-content .pk-chip button { min-height:44px; padding:0 12px; border-radius:8px; font-size:14px; }
  body.backend-dashboard-shell #module-content .pk-chip .pk-chip-o { border-color:var(--theme-accent-strong); color:var(--txt-accent); background:var(--theme-accent-soft); }
  .backend-mode .pk-tam { position:fixed; left:0; right:0; bottom:0; z-index:10060; max-height:85dvh; overflow:auto; overscroll-behavior:contain; gap:14px; margin:0; padding:0 16px;
    background:var(--bg-card); color:var(--text-main); border:1px solid var(--border-color); border-bottom:0; border-radius:8px 8px 0 0; box-shadow:0 -12px 40px rgba(0,0,0,.22);
    transform:translateY(100%); visibility:hidden; transition:transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s linear .22s; }
  .backend-mode .pk-tam.is-mo { transform:none; visibility:visible; transition:transform .22s cubic-bezier(.2,.8,.2,1); }
  .backend-mode .pk-tam-dau { position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center; gap:12px; margin:0 -16px; padding:12px 8px 8px 16px; background:var(--bg-card); border-bottom:1px solid var(--border-color); }
  body.backend-dashboard-shell #module-content .pk-tam-dau h3 { margin:0; font-size:17px; }
  body.backend-dashboard-shell #module-content button.pk-tam-x { display:grid; place-items:center; width:44px; height:44px; min-width:44px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--text-main); }
  .backend-mode .pk-tam .pk-selects { grid-template-columns:1fr; }
  .backend-mode .pk-tam-chan { position:sticky; bottom:0; display:flex; gap:10px; margin:0 -16px; padding:10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background:var(--bg-card); border-top:1px solid var(--border-color); }
  body.backend-dashboard-shell #module-content .pk-tam-chan button { flex:1 1 0; min-height:44px; border-radius:8px; font-weight:600; }
  body.backend-dashboard-shell #module-content .pk-tam-chan button.pk-tam-xong { background:var(--theme-accent-strong); border-color:var(--theme-accent-strong); color:#fff; }
  /* Graphite / Gold Noir: chữ trắng trên màu nhấn chỉ 3.6–3.7:1 → chữ tối như nút chính của phiếu (đạt WCAG AA) */
  html:is([data-itn-theme="graphite"], [data-itn-theme="gold-noir"]) body.backend-dashboard-shell #module-content .pk-tam-chan button.pk-tam-xong { color:#111; }
  .backend-mode .pk-nen { display:block; position:fixed; inset:0; z-index:10055; background:rgba(0,0,0,.4); opacity:0; visibility:hidden; transition:opacity .2s, visibility 0s linear .2s; }
  .backend-mode .pk-tam.is-mo + .pk-nen { opacity:1; visibility:visible; transition:opacity .2s; }
}
@media (prefers-reduced-motion: reduce) {
  body.backend-dashboard-shell #module-content :is(button.kho-the, button.kho-ct-dong, button.pk-dong) { transition:none; }
  #module-content dialog.kho-tam { animation:none !important; }
  .backend-mode :is(.pk-tam, .pk-tam.is-mo, .pk-nen, .pk-tam.is-mo + .pk-nen) { transition:none !important; }
}
