/* TD-043 (8.0.0): Sản xuất – QC. Chỉ áp trong lớp .sx (không đổi kiểu chung của app: nút quay lại, bảng, thẻ).
   Màn đứng máy (QC, khai cụm, tổ trưởng – chặng sau): chữ ≥ 16px, nút ≥ 48px, nút chính ≥ 56px (lệnh TD-043, ràng buộc chung). */
.sx { --sx-ok: #1B6B45; --sx-bad: #A1261A; --sx-warn: #7A5000; --sx-info: #1E4E8C; --sx-brand: #B4530A; }
.sx .bk-btn { min-width: 48px; min-height: 48px; }
.sx .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sx .chips .chip { min-height: 40px; display: inline-flex; align-items: center; }
.sx .sx-bang { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.sx .sx-dong { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sx .sx-dong input { min-height: 40px; }
@media (max-width: 760px) { .sx .sx-dong input { width: 42% !important; } }
/* TD-043 Chặng 1: nạp Excel có rà soát (quyết định 84), báo SAM */
.sx .sx-buoc { margin: 0 0 10px 18px; padding: 0; line-height: 1.6; }
.sx .sx-loi { color: var(--sx-bad); }
.sx .sx-canh { color: var(--sx-warn); }
.sx .sx-bao { border-left: 4px solid var(--sx-warn); background: rgba(122, 80, 0, .06); padding: 8px 12px; margin: 8px 0; border-radius: 6px; }
.sx .sx-bao p { margin: 0 0 6px; }
.sx .chips button.chip { min-height: 40px; cursor: pointer; }

/* TD-043 Chặng 3: màn QC Endline – nút lớn (≥ 56 px), số đếm lớn, dùng được trên máy tính bảng và điện thoại 390 px */
.sxq { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }
.sxq .sxq-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.sxq .sxq-chip { font-size: 16px; padding: 6px 12px; border-radius: 999px; }
.sxq .sxq-chip.ok { background: #e6f4ea; color: #1b5e34; }
.sxq .sxq-chip.cho { background: #fff1d6; color: #7a4b00; }
.sxq .sxq-doi { min-height: 48px; padding: 0 16px; border-radius: 10px; font-size: 16px; font-weight: 700; }
.sxq .sxq-chuyen { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.sxq .sxq-to { min-height: 56px; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 12px; border: 2px solid #c9c4b8; font-size: 20px; font-weight: 700; color: inherit; text-decoration: none; }
.sxq .sxq-to.on { border-color: #b35a00; background: #fdf1e4; }
.sxq .sxq-nhac { background: #fdeee0; border-left: 6px solid #d9730d; padding: 10px 14px; border-radius: 8px; font-size: 16px; margin: 8px 0; }
.sxq .sxq-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.sxq .sxq-so > div { background: #fff; border: 2px solid #e2dfd7; border-radius: 12px; padding: 8px 10px; text-align: center; }
.sxq .sxq-so small { display: block; font-size: 14px; color: #5b6170; }
.sxq .sxq-so b { font-size: 40px; line-height: 1.1; }
.sxq .sxq-so b.ok { color: #1f7a4a; }
.sxq .sxq-so b.bad { color: #a3271d; }
.sxq .sxq-che-hang { display: flex; gap: 8px; margin: 8px 0; }
.sxq .sxq-che { min-height: 48px; flex: 1; border-radius: 10px; border: 2px solid #c9c4b8; background: #fff; font-size: 17px; font-weight: 700; }
.sxq .sxq-che.on { border-color: #1f4f7a; background: #e8f0f8; }
.sxq .sxq-nut-hang { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.sxq .sxq-nut-hang.dk { grid-template-columns: 1fr 1fr; }
.sxq .sxq-nut { min-height: 110px; border-radius: 16px; border: none; color: #fff; font-size: 34px; font-weight: 800; letter-spacing: .5px; }
.sxq .sxq-nut.ok { background: #1f7a4a; }
.sxq .sxq-nut.bad { background: #a3271d; }
.sxq .sxq-nut:disabled { opacity: .45; }
.sxq .sxq-phu { display: flex; justify-content: center; }
.sxq .sxq-nut-phu { min-height: 56px; padding: 0 24px; border-radius: 12px; border: 2px solid #1f4f7a; background: #fff; color: #1f4f7a; font-size: 18px; font-weight: 700; }
.sxq .sxq-vua { margin-top: 14px; }
.sxq .sxq-dong { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #e2dfd7; font-size: 16px; }
.sxq .sxq-hoan { min-height: 48px; padding: 0 14px; border-radius: 10px; border: 2px solid #a3271d; background: #fff; color: #a3271d; font-weight: 700; }
.sxq .sxq-cuoi { margin-top: 12px; }
.sxq-hop { display: flex; flex-direction: column; gap: 10px; }
.sxq-hop input { min-height: 52px; font-size: 18px; padding: 8px 12px; }
.sxq-loi-hang { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sxq-loi-nut { min-height: 56px; text-align: left; padding: 8px 12px; border-radius: 10px; border: 2px solid #c9c4b8; background: #fff; font-size: 16px; }
.sxq-doi-hang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #e2dfd7; }
.sxq-doi-nuts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sxq-doi-nut { min-height: 48px; padding: 0 12px; border-radius: 10px; border: 2px solid #1f4f7a; background: #fff; color: #1f4f7a; font-weight: 700; }
.sxq-dang { color: #1b5e34; font-weight: 700; }
@media (max-width: 480px) { .sxq .sxq-so b { font-size: 30px; } .sxq .sxq-nut { min-height: 96px; font-size: 30px; } .sxq-loi-hang { grid-template-columns: 1fr; } }

/* TD-043 Chặng 4: khai báo sản lượng cụm (người khai trên điện thoại; tổ trưởng: bảng cụm × giờ) */
.sxc { max-width: 980px; margin: 0 auto; padding: 0 16px 24px; }
.sxc .sxc-chon-hang { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.sxc select, .sxc input[type=date], .sxc input[type=text] { min-height: 44px; font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid #b8c4d0; background: #fff; }
/* TD-184 QĐ 24 (9.7.0): ô ngày trên điện thoại hiện dd/mm/yyyy, ô gốc trong suốt phủ lên trên để vẫn mở bộ chọn ngày của máy */
.sxc .sxc-ngay { position: relative; display: inline-flex; }
.sxc .sxc-ngay-chu { min-height: 44px; min-width: 140px; display: inline-flex; align-items: center; font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid #b8c4d0; background: #fff; }
.sxc .sxc-ngay input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; min-height: 0; padding: 0; border: 0; }
.sxc .sxc-tab { display: flex; gap: 8px; margin: 8px 0 12px; }
.sxc .sxc-t { flex: 1; text-align: center; padding: 12px; border-radius: 10px; background: #eef3f8; color: inherit; text-decoration: none; font-weight: 600; min-height: 48px; line-height: 24px; }
.sxc .sxc-t.on { background: #1f6fb2; color: #fff; }
.sxc .sxc-cuon, .sxc .sxc-cuon-ngoai { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.sxc table.sxc-bang { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 15px; }
.sxc .sxc-bang th, .sxc .sxc-bang td { border: 1px solid #d5dde6; padding: 8px 10px; min-width: 52px; min-height: 48px; text-align: center; background: #fff; }
.sxc .sxc-bang th.sxc-ten { position: sticky; left: 0; background: #f6f8fb; text-align: left; min-width: 150px; z-index: 1; }
.sxc .sxc-bang td.bam { cursor: pointer; }
.sxc .sxc-bang td.sua { background: #e3f0ff; }
.sxc .sxc-bang td.duoi { background: #fde7e7; color: #a11; }
.sxc .sxc-bang td.cho { background: #fff4d6; }
.sxc .sxc-bang td.trong { color: #9aa5b1; }
.sxc .sxc-bang .sxc-muc th, .sxc .sxc-bang .sxc-muc td { background: #f1f5f9; font-weight: 600; }
.sxc .sxc-lk { font-weight: 700; }
.sxc .sxc-the { background: #fff; border: 1px solid #d5dde6; border-radius: 12px; padding: 14px; margin: 10px 0; }
.sxc .sxc-the select.sxc-chon { width: 100%; margin-top: 8px; }
.sxc .sxc-so { width: 100%; min-height: 64px; font-size: 26px; text-align: center; border-radius: 10px; border: 2px solid #1f6fb2; margin: 8px 0; }
.sxc .sxc-moc { min-height: 56px; font-size: 18px; width: 100%; }
.sxc .sxc-ghi { min-height: 64px; width: 100%; font-size: 20px; }
.sxc .sxc-ly { min-height: 48px; padding: 8px 12px; margin: 4px; border-radius: 10px; border: 1px solid #b8c4d0; background: #fff; font-size: 16px; }
.sxc .sxc-ly.on { background: #1f6fb2; color: #fff; border-color: #1f6fb2; }
.sxc .sxc-ly-hang { display: flex; flex-wrap: wrap; margin: 6px 0; }
.sxkpc .sxkpc-xuong { margin: 16px 0 4px; font-size: 16px; color: #1E4E8C; }   /* TD-105 */
.sxkpc .sxkpc-the select.sxc-chon { width: 100%; margin-top: 6px; }
.sxc .sxc-vua { margin: 12px 0; }
.sxc .sxc-ra { font-weight: 600; margin: 10px 0; }

/* TD-043 Chặng 4 (sửa theo soi): bản bị máy chủ từ chối, chờ người ghi xử lý */
.sxq-chip.loi { background: #fde7e7; color: #a11; }
.sxq-canxuly { border: 2px solid #d9534f; border-radius: 12px; padding: 12px; margin: 10px 0; background: #fff; }
.sxq-cx-tieu { font-weight: 700; margin-bottom: 6px; }
.sxq-cx-dong { border-top: 1px solid #eee; padding: 8px 0; }
.sxq-cx-nut { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.sxq-cx-nut button { min-height: 48px; padding: 8px 14px; border-radius: 10px; border: 1px solid #b8c4d0; background: #fff; font-size: 16px; }
.sxq-cx-thu { background: #1f6fb2 !important; color: #fff; border-color: #1f6fb2 !important; }

/* TD-043 Chặng 5: màn QC Inline trên điện thoại 390 px (sx-il.js) – nút ≥ 44 px, nút chính ≥ 56 px, thẻ lượt ghi tổ trước (≥ 18 px, màu tổ) */
.sxi .sxi-pt { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid #e2dfd7; border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.sxi .sxi-pt b { font-size: 18px; }
.sxi .sxi-doi { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--sx-brand); background: #fdf1e4; color: #8a3f00; font-size: 16px; font-weight: 700; flex: 0 0 auto; }
.sxi .sxi-loc { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sxi .sxi-chip { min-height: 48px; min-width: 84px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 12px; border: 2px solid #c9c4b8; background: #fff; color: inherit; font-size: 17px; font-weight: 700; text-decoration: none; }
.sxi .sxi-chip.on { border-color: var(--sx-brand); background: #fdf1e4; color: #8a3f00; }
.sxi .sxi-o-hang { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.sxi .sxi-o-hang.bon { grid-template-columns: repeat(4, 1fr); }
.sxi .sxi-o { min-height: 64px; display: flex; flex-direction: column; justify-content: center; padding: 6px 10px; border-radius: 12px; border: 2px solid transparent; text-decoration: none; }
.sxi .sxi-o span { font-size: 16px; font-weight: 700; }
.sxi .sxi-o b { font-size: 28px; line-height: 1.1; }
.sxi .sxi-o.qua_han { background: #fbe9e7; color: var(--sx-bad); }
.sxi .sxi-o.den_han { background: #fff4d6; color: var(--sx-warn); }
.sxi .sxi-o.da_kiem { background: #e6f4ea; color: var(--sx-ok); }
.sxi .sxi-o.lo { background: #eceae4; color: #4a4f5a; }
.sxi .sxi-o.on { border-color: currentColor; }
.sxi .sxi-luot { width: 100%; min-height: 72px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; margin: 8px 0; border-radius: 14px; border: 2px solid #e2dfd7; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.sxi .sxi-luot.qua_han { border-color: #e8a59c; }
.sxi .sxi-luot.den_han { border-color: #e5c97a; }
.sxi .sxi-luot.lo { opacity: .75; }
.sxi .sxi-luot-gio b { font-size: 22px; }
.sxi .sxi-luot-ten { display: block; font-size: 18px; font-weight: 800; }
.sxi .sxi-luot-phu { display: block; font-size: 16px; color: #5b6170; }
.sxi .sxi-tt { font-size: 16px; font-weight: 700; padding: 6px 10px; border-radius: 999px; white-space: nowrap; background: #eceae4; color: #4a4f5a; }
.sxi .sxi-tt.qua_han { background: var(--sx-bad); color: #fff; }
.sxi .sxi-tt.den_han { background: #fff1d6; color: #7a4b00; }
.sxi .sxi-tt.da_kiem { background: #e6f4ea; color: #1b5e34; }
.sxi .sxi-do { background: #fff8e8; border: 2px dashed #d9a400; border-radius: 14px; padding: 10px 12px; margin: 8px 0; font-size: 16px; }
.sxi .sxi-do-ten { font-size: 18px; font-weight: 800; margin: 2px 0 8px; }
.sxi .sxi-do-nut { display: flex; gap: 8px; }
.sxi .sxi-them { min-height: 48px; padding: 0 18px; border-radius: 12px; border: none; background: var(--sx-ok); color: #fff; font-size: 16px; font-weight: 700; }
.sxi .sxi-lui, .sxi-lop .sxi-lui { min-height: 48px; min-width: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid #c9c4b8; background: #fff; color: inherit; font-size: 18px; font-weight: 700; }
.sxi .sxi-dk-hop { margin: 12px 0; background: #fff; border: 1px solid #e2dfd7; border-radius: 14px; padding: 0 12px; }
.sxi .sxi-dk-hop summary { min-height: 48px; display: flex; align-items: center; font-size: 17px; font-weight: 700; cursor: pointer; }
.sxi .sxi-dk { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; padding: 8px 0; border-top: 1px solid #eee; font-size: 16px; }
.sxi .sxi-hoan { min-height: 48px; min-width: 96px; padding: 0 14px; border-radius: 10px; border: 2px solid #a3271d; background: #fff; color: #a3271d; font-size: 16px; font-weight: 700; }
.sxi .sxi-mo { border: 2px solid #e8a59c; background: #fff; border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 16px; }
.sxi .sxi-mo b { color: var(--sx-bad); }
.sxi .sxi-day-dinh { position: sticky; bottom: 0; z-index: 3; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(rgba(245, 244, 241, 0), var(--bg, #F5F4F1) 30%); }
/* Điện thoại: nút dính đáy nằm trên thanh dưới của app (64 px) và thanh gợi ý cài app (body.has-nb), không bị che */
@media (max-width: 899px) { .sxi .sxi-day-dinh { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; } body.has-nb .sxi .sxi-day-dinh { bottom: calc(122px + env(safe-area-inset-bottom, 0px)); } }
.sxi .sxi-kiem-ngay { width: 100%; min-height: 60px; border: none; border-radius: 14px; background: var(--sx-ok); color: #fff; font-size: 18px; font-weight: 800; padding: 0 12px; }
/* Thẻ 7 SP: lớp phủ cả màn (dưới hộp thoại z-index 60) */
.sxi-lop { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--bg, #F5F4F1); padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
.sxi-lop .sxi-lop-dau { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 0; background: var(--bg, #F5F4F1); border-bottom: 1px solid #e2dfd7; }
.sxi-lop .sxi-lop-tieu { flex: 1; min-width: 0; }
.sxi-lop h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.sxi-lop .sxi-trang { font-size: 17px; margin: 10px 0; }
.sxi-lop .sxi-sp-luoi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sxi-lop .sxi-sp { min-height: 72px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; border-radius: 14px; border: 2px dashed #b9b3a6; background: #fff; color: #3d4350; font: inherit; }
.sxi-lop .sxi-sp b { font-size: 21px; }
.sxi-lop .sxi-sp small { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sxi-lop .sxi-sp.dat { border: 2px solid #9fd0b3; background: #e6f4ea; color: var(--sx-ok); }
.sxi-lop .sxi-sp.loi { border: 2px solid #e8a59c; background: #fbe9e7; color: var(--sx-bad); }
.sxi-lop .sxi-sp.chon { outline: 4px solid var(--sx-brand); outline-offset: 1px; }
/* Quyết định 114: số lỗi đã chọn của SP ở góc ô */
.sxi-lop .sxi-sp { position: relative; }
.sxi-lop .sxi-sp-dem { position: absolute; top: 4px; right: 4px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--sx-bad); color: #fff; font-size: 16px; font-weight: 800; line-height: 26px; }
.sxi-lop .sxi-chon { background: #fff; border: 1px solid #e2dfd7; border-radius: 16px; padding: 12px; margin: 12px 0; }
.sxi-lop .sxi-chon-tieu { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.sxi-lop .sxi-chon-phu { margin: -4px 0 8px; }
.sxi-lop .sxi-xong { width: 100%; min-height: 56px; margin-top: 8px; border: 2px solid var(--sx-brand); border-radius: 14px; background: #fff; color: var(--sx-brand); font: inherit; font-size: 18px; font-weight: 800; }
.sxi-lop .sxi-dat { width: 100%; min-height: 64px; border: none; border-radius: 14px; background: var(--sx-ok); color: #fff; font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.sxi-lop .sxi-loi-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sxi-lop .sxi-loi-nut, .sxq-hop .sxi-loi-nut { min-height: 56px; display: flex; flex-direction: column; justify-content: center; text-align: left; padding: 6px 12px; border-radius: 12px; border: 2px solid #ecc9c4; background: #fff8f7; color: inherit; font: inherit; font-size: 17px; font-weight: 700; }
.sxi-lop .sxi-loi-nut.mo { border-color: #c0392b; }
.sxi-lop .sxi-loi-nut.on { background: #a3271d; border-color: #a3271d; color: #fff; }
.sxi-lop .sxi-loi-nut.on .sxi-mo-nhan { color: #fff; }
.sxi-lop .sxi-mo-nhan { font-size: 16px; color: #a3271d; font-weight: 700; }
.sxi-lop .sxi-khac { width: 100%; align-items: center; text-align: center; border-style: dashed; background: #fff; }
.sxi-lop .sxi-day { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg, #F5F4F1); border-top: 1px solid #e2dfd7; }
.sxi-lop .sxi-day-nut { width: 100%; min-height: 60px; border-radius: 14px; border: 2px solid var(--sx-ok); font-size: 20px; font-weight: 800; }
.sxi-lop .sxi-day-nut.tat-ca { background: #e6f4ea; color: var(--sx-ok); }
.sxi-lop .sxi-day-nut.gui { background: var(--sx-ok); color: #fff; }
/* Bảng đổi / thêm chuyền (trong hộp thoại) */
.sxi-bang-doi .sxi-chuyen-nhom { margin-top: 6px; }
.sxi-chuyen-dong { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 12px; margin: 4px 0; border-radius: 12px; border: 2px solid #e2dfd7; background: #faf9f6; color: inherit; font: inherit; }
.sxi-chuyen-dong.on { border-color: #1B6B45; background: #e6f4ea; }
.sxi-chuyen-dong b { display: block; font-size: 18px; }
.sxi-chuyen-dong small { display: block; font-size: 16px; color: #5b6170; }
.sxi-o-chon { width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 2px solid #b9b3a6; background: #fff; color: #fff; font-weight: 800; }
.sxi-chuyen-dong.on .sxi-o-chon { background: #1B6B45; border-color: #1B6B45; }
.sxi-nhan { width: 100%; min-height: 56px; border: none; border-radius: 14px; background: #1B6B45; color: #fff; font-size: 18px; font-weight: 800; }
.sxi-nhan:disabled { opacity: .45; }
.sxi-canh p { margin: 4px 0; color: #7A5000; }
@media (max-width: 400px) { .sxi .sxi-luot { grid-template-columns: auto minmax(0, 1fr); } .sxi .sxi-luot-gio { grid-row: span 2; align-self: start; } .sxi .sxi-tt { grid-column: 2; justify-self: start; }
  .sxi .sxi-pt { flex-wrap: wrap; } .sxi .sxi-chip { min-width: 0; flex: 1 0 auto; } }

/* TD-043 Chặng 5 (bước 4): Cài đặt QC Inline theo cụm (ảnh 23, thẻ của Cài đặt sản xuất) – máy tính, và điện thoại cho QC Inline */
.sx .sxl-chon { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0 12px; }
.sx .sxl-chon label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; min-width: 0; }
.sx .sxl-chon-o { min-height: 48px; font-size: 16px; width: 100%; box-sizing: border-box; }
.sx .sxl-ma-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.sx .sxl-ma { display: flex; flex-direction: column; gap: 2px; min-height: 48px; padding: 10px 12px; border: 1px solid #e2dfd7; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; }
.sx .sxl-dau { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 4px 0 10px; }
.sx .sxl-dau h3 { margin: 0; }
.sx .sxl-dau-nut { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sx .sxl-nut { min-height: 48px; }
.sx .sxl-luoi { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.sx .sxl-trai { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid #e2dfd7; border-radius: 12px; padding: 10px; }
.sx .sxl-cum { min-height: 56px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border: 1px solid #e2dfd7; border-radius: 10px; background: #fff; font-size: 16px; text-align: left; cursor: pointer; }
.sx .sxl-cum small { color: #5b6170; font-size: 16px; }
.sx .sxl-cum.on { border: 2px solid var(--sx-brand); background: #fdf1e4; }
.sx .sxl-giua { background: #fff; border: 1px solid #e2dfd7; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.sx .sxl-giua-dau { display: flex; gap: 10px; align-items: center; }
.sx .sxl-giua-dau h3 { margin: 0; }
.sx .sxl-chung { background: #fdf6ee; border: 1px solid #f0d9bf; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.sx .sxl-chung p { margin: 6px 0 0; }
.sx .sxl-chung-o { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sx .sxl-chung-o label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 16px; }
.sx .sxl-o { min-height: 48px; font-size: 16px; width: 100%; box-sizing: border-box; }
.sx .sxl-o.rieng { border: 2px solid var(--sx-info); color: var(--sx-info); font-weight: 700; }
.sx .sxl-bang { display: flex; flex-direction: column; gap: 6px; }
.sx .sxl-loi { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(90px, .6fr) 48px; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid #ece9e2; border-radius: 10px; background: #faf9f6; }
.sx .sxl-loi.rieng { background: #eef3fa; border-color: #c4d4ea; }
.sx .sxl-loi-dau { background: none; border: none; padding: 0 8px; }
.sx .sxl-loi-ten { display: flex; flex-direction: column; min-width: 0; }
.sx .sxl-loi-ten small { color: #5b6170; }
.sx .sxl-x { min-height: 48px; min-width: 48px; border: 1px solid #d9d4c9; border-radius: 10px; background: #fff; font-size: 20px; cursor: pointer; }
.sx .sxl-them { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.sx .sxl-tim { flex: 1 1 260px; min-height: 48px; font-size: 16px; padding: 0 12px; border: 1px dashed var(--sx-brand); border-radius: 10px; }
.sx .sxl-goi-y { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.sx .sxl-goi-nut { min-height: 48px; padding: 0 12px; border: 1px solid #c9c4b8; border-radius: 10px; background: #fff; font-size: 16px; cursor: pointer; }
.sx .sxl-ghi { margin-top: 10px; }
.sxl-mau { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border: 1px solid #e2dfd7; border-radius: 10px; }
.sxl-mau.cung { border-color: #1B6B45; }
.sxl-mau .btn { align-self: flex-start; }
.sxl-hoi p { margin: 6px 0; }
/* Điện thoại: có thay đổi chưa lưu thì thanh Lưu dính đáy, trên thanh dưới của app (như .sxi-day-dinh); máy tính dùng nút Lưu ở đầu */
.sx .sxl-day { display: none; }
@media (max-width: 899px) {
  .sx .sxl-day { display: block; position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 3; padding: 10px 0; background: linear-gradient(rgba(245, 244, 241, 0), var(--bg, #F5F4F1) 30%); }
  .sx .sxl-day .sxl-nut { width: 100%; min-height: 56px; font-size: 17px; }
  body.has-nb .sx .sxl-day { bottom: calc(122px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 860px) {
  .sx .sxl-luoi { grid-template-columns: minmax(0, 1fr); }
  .sx .sxl-trai { flex-direction: row; overflow-x: auto; }
  .sx .sxl-trai > .small { display: none; }
  .sx .sxl-cum { flex: 0 0 auto; min-width: 170px; }
  .sx .sxl-chung-o { grid-template-columns: minmax(0, 1fr); }
  .sx .sxl-loi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px; }
  .sx .sxl-loi-ten { grid-column: 1 / 3; grid-row: 1; }
  .sx .sxl-loi > .sxl-x { grid-column: 3; grid-row: 1; }
  .sx .sxl-loi-dau { display: none; }
}

/* TD-043 Chặng 5 (bước 4): màn kỹ thuật "Lỗi Inline cần xử lý" (ảnh 50, điện thoại; ke-hoach-ky-thuat.md 13.5 C8): nút chính ≥ 56 px rộng hết thẻ */
.sxk .sxk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.sxk .sxk-tab { min-height: 48px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px 8px; line-height: 1.25; border: 2px solid #c9c4b8; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; font-size: 17px; font-weight: 700; }
.sxk .sxk-tab.on { border-color: var(--sx-brand); background: #fdf1e4; color: #8a3f06; }
.sxk .sxk-ds { display: flex; flex-direction: column; gap: 12px; }
.sxk .sxk-the { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: #fff; border: 1px solid #e8b9b2; border-left: 6px solid var(--sx-warn); border-radius: 14px; cursor: pointer; }
.sxk .sxk-the.chua { border-left-color: var(--sx-bad); }
.sxk .sxk-the.dong { border-color: #cfe3d6; border-left-color: var(--sx-ok); }
.sxk .sxk-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 19px; }
.sxk .sxk-mo { font-size: 16px; font-weight: 700; color: var(--sx-warn); white-space: nowrap; }
.sxk .sxk-mo.do { color: var(--sx-bad); }
.sxk .sxk-mo.xong { color: var(--sx-ok); }
.sxk .sxk-mo.dung { color: var(--sx-muted, #5E5A52); }
.sxk .sxk-loi { font-size: 18px; }
.sxk .sxk-loi b { color: var(--sx-bad); }
.sxk .sxk-van-loi { align-self: flex-start; padding: 4px 10px; border-radius: 8px; background: var(--sx-bad); color: #fff; font-weight: 700; }
.sxk .sxk-leo { color: var(--sx-bad); font-weight: 600; }
/* Vòng 3 bước 3: dòng tổ trưởng đã nhận / chưa (thẻ kỹ thuật), kỹ thuật đã đến chuyền / chưa xem (thẻ tổ trưởng) */
.sxk .sxk-tt-nhan { font-size: 16px; font-weight: 600; color: var(--sx-warn, #b45309); }
.sxk .sxk-tt-nhan.ok { color: var(--sx-ok); }
.sxk .sxk-chan { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.sxk .sxk-tt { font-size: 16px; font-weight: 700; }
.sxk .sxk-tt.chua { color: var(--sx-bad); }
.sxk .sxk-tt.toi, .sxk .sxk-tt.khac { color: var(--sx-info); }
.sxk .sxk-tt.dong { color: var(--sx-ok); }
.sxk .sxk-xem { min-height: 56px; flex: 1 1 100%; border: none; border-radius: 12px; background: var(--sx-info); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .3px; cursor: pointer; }
.sxk .sxk-xem.phu { background: #fff; color: var(--sx-info); border: 2px solid var(--sx-info); font-weight: 700; }
.sxk .sxk-ghi { margin-top: 12px; }
.sxk-sp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.sxk-sp-o { display: flex; flex-direction: column; padding: 6px 8px; border: 1px solid #e2dfd7; border-radius: 10px; font-size: 16px; }
.sxk-sp-o.loi { border-color: #A1261A; background: #fbecea; color: #A1261A; }
.sxk-sp-o.khac { border-color: #7A5000; background: #fff4df; }
.sxk-sp-o.dat { color: #1B6B45; }

/* TD-043 Chặng 5 (bước 4): tổ trưởng khai tăng ca tổ mình hôm nay (quyết định 37) */
.sxc .sxc-tc { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 10px; margin: 8px 0; padding: 10px 12px; background: #fff; border: 1px solid #e2dfd7; border-radius: 12px; }
.sxc .sxc-tc-nhan { display: flex; flex-direction: column; gap: 4px; font-size: 16px; font-weight: 700; }
.sxc .sxc-tc-o { min-height: 48px; font-size: 18px; padding: 0 10px; border-radius: 8px; border: 1px solid #b8c4d0; background: #fff; }
.sxc .sxc-tc-luu { min-height: 48px; padding: 0 16px; border: none; border-radius: 10px; background: #1E4E8C; color: #fff; font-size: 16px; font-weight: 700; }
.sxc .sxc-tc-tt { grid-column: 1 / -1; }
/* TD-043 Chặng 5 – vòng 3 bước 4 (ke-hoach-ky-thuat.md 13.1: chữ ≥ 16 px, nút ≥ 48 px trong .sx): chữ phụ trên màn QC Inline, thẻ ghi lượt, bảng đổi chuyền, màn kỹ thuật;
   nhãn "Mới nhận" (13.3 bước 3); tiêu đề màn kỹ thuật không xuống dòng ở 375 px; nút Đổi tên / Xóa mẫu */
.sxi .small, .sxi-lop .small, .sxk .small, .sxi-bang-doi .small, .sxk-ct .small { font-size: 16px; }
.sxi .sxi-moi { display: inline-block; margin: 2px 0; padding: 2px 8px; border-radius: 999px; background: #e7eef8; color: var(--sx-info); font-size: 16px; font-weight: 700; }
.sxk .mhead .grow { min-width: 0; }
.sxk .mhead h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sxl-mau .sxl-mau-nut { display: flex; flex-wrap: wrap; gap: 8px; }
/* TD-043 bản 8.1.0 – quyết định 151g: dòng "Số lao động hôm nay: n (Tin Việt) – Sửa" của màn tổ trưởng (điện thoại); hộp sửa số lao động (chip lý do như hộp sửa cụm) */
.sxc .sxc-ld { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0; padding: 10px 12px; background: #fff; border: 1px solid #e2dfd7; border-radius: 12px; }
.sxc .sxc-ld-so { flex: 1 1 200px; font-size: 16px; font-weight: 700; }
.sxc .sxc-ld-sua { min-height: 48px; min-width: 88px; padding: 0 16px; border: none; border-radius: 10px; background: #1E4E8C; color: #fff; font-size: 16px; font-weight: 700; }
.sxc .sxc-ld-tt { flex: 1 0 100%; }
.sx-ld-hop .sxc-ly { min-height: 48px; padding: 8px 12px; margin: 4px; border-radius: 10px; border: 1px solid #b8c4d0; background: #fff; font-size: 16px; }
.sx-ld-hop .sxc-ly.on { background: #1f6fb2; color: #fff; border-color: #1f6fb2; }
.sx-ld-hop .sxc-ly-hang { display: flex; flex-wrap: wrap; margin: 6px 0; }
.sx-ld-hop input[type=text], .sx-ld-hop input[type=number] { min-height: 44px; font-size: 16px; width: 100%; box-sizing: border-box; }
/* TD-184B: số máy trên chuyền – dòng dưới số lao động (màn tổ trưởng), hộp sửa có nút − / + (chữ ≥ 16 px, nút ≥ 48 px) */
.sxc .sxc-may { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; padding-top: 10px; border-top: 1px solid #e2dfd7; }
.sxc .sxc-may-chu { flex: 1 1 260px; min-width: 0; font-size: 16px; }   /* điện thoại hẹp: nút xuống dòng dưới, chữ đủ rộng */
.sxc .sxc-may-chu .small { font-size: 16px; }
.sxc .sxc-may-dong { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.sxc .sxc-may-trong { color: #A1261A; }
.sxc .sxc-may-nhan { padding: 2px 8px; border-radius: 6px; background: #fff0d1; color: #7A5000; font-size: 16px; font-weight: 700; }
.sxc .sxc-may-sua { min-height: 48px; min-width: 88px; padding: 0 16px; border: none; border-radius: 10px; background: #1E4E8C; color: #fff; font-size: 16px; font-weight: 700; }
.sxc .sxc-may-sua.chua { background: #B4530A; }
.sx-may-hop .sx-may-nhan { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }
.sx-may-hop .sx-may-so { display: flex; gap: 8px; }
.sx-may-hop .sx-may-so input { flex: 1; min-width: 0; min-height: 52px; font-size: 26px; font-weight: 700; padding: 0 14px; box-sizing: border-box; }
.sx-may-hop .sx-may-buoc { min-height: 52px; min-width: 60px; border: 1px solid #b8c4d0; border-radius: 10px; background: #f6f5f1; font-size: 24px; font-weight: 700; cursor: pointer; }
.sx-may-hop .sx-may-chu-y { color: #7A5000; font-weight: 600; }
/* TD-073 (8.2.0): Quy trình mã hàng – ô IE đã sửa viền xanh, ô số nhỏ trên lưới */
.sx .sx-o-ie { outline: 2px solid var(--sx-info, #2563eb); outline-offset: -2px; }
.sx .sx-o-nho { max-width: 6.5em; min-height: 40px; }
.sx .sx-tong { font-weight: 600; margin-top: 8px; }

/* TD-098 (8.4.3): màn nhập cụm ít chạm – thẻ cụm lớn, bàn phím số trên màn, nút Gửi to (thiết kế docs/thiet-ke-nhap-cum) */
.sxn { display: flex; flex-direction: column; gap: 8px; }
.sxc .sxn-dau { margin: -4px 0 4px; }
.sxn-tom { display: flex; gap: 8px; }
.sxn-tom > div { flex: 1; background: #fff; border: 1px solid #e2dfd7; border-radius: 12px; padding: 8px 10px; min-width: 0; }
.sxn-tom span { display: block; font-size: 13px; color: #5f6b7a; }
.sxn-tom b { display: block; font-size: 22px; color: #1E4E8C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sxn-tom b.do { color: #B42A1C; }
.sxn-moc { background: #FFF3D3; border: 2px solid #E09A12; border-radius: 12px; padding: 8px 12px; font-size: 16px; color: #7A5000; font-weight: 600; }
.sxn-ds { display: flex; flex-direction: column; gap: 8px; }
.sxn-the { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #fff; border: 2px solid #e2dfd7; border-radius: 14px; padding: 10px 14px; min-height: 64px; font: inherit; color: inherit; cursor: pointer; }
.sxn-the.ht { border-color: #B4530A; }
.sxn-the.chon { border-color: #1E4E8C; background: #EEF4FC; box-shadow: 0 0 0 2px #1E4E8C33; }
.sxn-ten { flex: 1; min-width: 0; }
.sxn-ten b { display: block; font-size: 18px; text-transform: uppercase; }
.sxn-ten small { display: block; font-size: 12px; color: #6b7480; }
.sxn-so { font-size: 26px; font-weight: 700; color: #1E4E8C; min-width: 64px; text-align: right; }
.sxn-so.do { color: #B42A1C; }
.sxn-ok { color: #1B7A4A; font-size: 16px; font-weight: 700; }
.sxn-pad { position: sticky; bottom: 0; z-index: 2; background: #fff; margin: 4px -16px 0; padding: 10px 16px 12px; box-shadow: 0 -2px 8px #0002; border-radius: 14px 14px 0 0; }
.sxn-o { display: flex; align-items: center; gap: 8px; border: 2px solid #1E4E8C; border-radius: 12px; padding: 6px 12px; margin-bottom: 8px; min-height: 56px; }
.sxn-o-nhan { flex: 1; font-size: 13px; color: #5f6b7a; min-width: 0; }
.sxc .sxn-o select.sxn-mocchon { min-height: 36px; font-size: 15px; padding: 2px 6px; }
.sxn-o b { font-size: 30px; }
.sxn-o b.mo { color: #9aa5b1; font-size: 20px; font-weight: 600; }
.sxn-phim { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sxn-phim button { font-size: 22px; font-weight: 600; min-height: 52px; border: 0; border-radius: 10px; background: #EFECE6; color: #222; cursor: pointer; }
.sxn-phim button.p { background: #FBE3CC; font-size: 17px; }
.sxn-phim button:disabled { opacity: .45; }
.sxn-phim button:active { filter: brightness(.9); }
.sxn-gui { margin-top: 8px; width: 100%; min-height: 56px; font-size: 19px; font-weight: 700; border: 0; border-radius: 12px; background: #B4530A; color: #fff; cursor: pointer; }
.sxn-gui:disabled { opacity: .5; }
.sxn-gui.sua { background: #1E4E8C; }
@media (min-width: 900px) { .sxn-pad { margin: 4px 0 0; border-radius: 14px; } .sxn-phim button { min-height: 56px; } }
/* TD-122 (8.6.0): kỹ thuật Tự khắc phục / Chuyển bộ phận sau "Đã xem"; QC kiểm lại ngay / chờ lượt kế tiếp; dòng thời gian của lỗi Inline */
.sxk .sxk-kp-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sxk .sxk-kp-nut .sxk-xem { min-height: 52px; font-size: 16px; flex: none; }
.sxk .sxk-kp, .sxk-ct .sxk-kp { background: var(--soft, #f6f3ee); border-radius: 10px; padding: 8px 10px; line-height: 1.45; display: flex; flex-direction: column; gap: 2px; }
.sxk .sxk-tt.kp { color: var(--sx-info); font-weight: 700; }
.sxk-kp-form textarea { min-height: 84px; font-size: 16px; }
.sxk-dtg { list-style: none; margin: 6px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--line, #e2ddd3); }
.sxk-dtg li { display: flex; gap: 10px; padding: 5px 0; line-height: 1.4; }
.sxk-dtg li .g { min-width: 84px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.sxk-dtg li small { display: block; color: var(--muted); }
.sxk-dtg li.v-dong b { color: var(--sx-ok, #1B6B45); } .sxk-dtg li.v-mo_lai b { color: var(--sx-bad, #A1261A); } .sxk-dtg li.v-sv b { color: var(--brand); }
.sxk-dtg-hop { margin-top: 8px; }
.sxi .sxi-kp { border: 2px solid var(--sx-info, #1F5A85); background: #f3f8fc; border-radius: 14px; padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.sxi .sxi-kp-h { font-size: 16px; color: var(--sx-info, #1F5A85); }
.sxi .sxi-kp-the { background: #fff; border: 1px solid #d6e2ec; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.sxi .sxi-kp-the.da-chon { opacity: .9; }
.sxi .sxi-kp-ten { font-size: 16px; }
.sxi .sxi-kp-mo { color: var(--sx-bad, #A1261A); font-weight: 700; }
.sxi .sxi-kp-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.sxi .sxi-kp-nut .sxi-them { grid-column: 1 / -1; }
.sxi .sxi-kp-nut .sxi-lui { font-size: 15px; font-weight: 700; }
.sxi .sxi-kp-nut .sxi-lui.nho { font-weight: 600; }
/* TD-122 QĐ11: kỹ thuật đã xác nhận đóng (rời việc cần xử lý) – trạng thái riêng; bước QC riêng */
.sxk .sxk-the.ktd { border-left-color: var(--sx-info, #1F5A85); opacity: .96; }
.sxk .sxk-tt.ktd { color: var(--sx-info, #1F5A85); font-weight: 700; }
.sxk-ktd { display: flex; flex-direction: column; gap: 2px; }
.sxk-ktd b { color: var(--sx-info, #1F5A85); }
.sxk-anh { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--line, #e2ddd3); background-size: cover; background-position: center; margin-top: 4px; cursor: pointer; }
.sxk-qctt { font-weight: 600; } .sxk-qctt.da_dong { color: var(--sx-ok, #1B6B45); } .sxk-qctt.mo_lai { color: var(--sx-bad, #A1261A); } .sxk-qctt.cho_kiem { color: var(--muted); }
.sxi .sxi-xn { font-weight: 700; color: var(--sx-bad, #A1261A); } .sxi .sxi-xn.ok { color: var(--sx-info, #1F5A85); }   /* TD-122 QĐ13 */
