:root {
  --do: #D7141A; --do-dam: #B10F14; --do-nhat: #FDECEC; --hong: #FBE3E4; --vang: #FFC72C; --xanh: #1F9D55; --xanh-nhat: #E7F6EE;
  --nen: #EEF0F3; --chu: #1F2328; --mo: #6B7280; --vien: #E2E4E8; --vien-dam: #C9CDD3;
  --bo: 8px; --bong: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 "Be Vietnam Pro", system-ui, "Segoe UI", sans-serif; color: var(--chu); background: var(--nen); -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h2, h3, h4, p { margin: 0; }
h2 { font-size: 19px; font-weight: 700; white-space: nowrap; }
kbd { font: 600 11px/1 inherit; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.07); color: var(--mo); margin-left: 3px; }
.mo { color: var(--mo); font-size: 13px; }
.phai { text-align: right; }
a { color: var(--do); }

/* ───── Khung trên ───── */
#app { height: 100dvh; display: flex; flex-direction: column; }
.dau { flex: none; }
.giua-trang { max-width: 1320px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 12px; height: 100%; }
.dau-tren { background: #fff; height: 42px; border-bottom: 1px solid var(--vien); }
.che-ban .dau-tren { display: none; }
.dau-menu { background: var(--do); color: #fff; height: 40px; }
.che-ban .dau-menu .giua-trang { max-width: none; padding: 0 8px 0 6px; }
.ten-ch { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.ten-ch img { width: 26px; height: 26px; border-radius: 7px; }
.ten-ch b { color: var(--do); font-weight: 800; }
#nav { display: flex; gap: 2px; flex: 1; min-width: 0; align-self: stretch; align-items: center; }
#nav button { background: none; border: 0; color: #fff; padding: 0 13px; height: 30px; border-radius: 6px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
#nav button i { font-style: normal; display: none; }
#nav button:hover { background: rgba(0,0,0,.14); }
#nav button.chon { background: var(--do-dam); }
#pos-thanh { display: none; flex: 1; min-width: 0; align-items: center; gap: 12px; align-self: stretch; }
.che-ban #pos-thanh { display: flex; } .che-ban #nav { display: none; }
.dau-phai { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.nut-dau { height: 30px; border: 1px solid rgba(255,255,255,.75); background: none; color: #fff; font-weight: 700; border-radius: 6px; padding: 0 12px; white-space: nowrap; }
.nut-dau:hover { background: rgba(255,255,255,.16); }
.nut-dau.noi { background: #fff; border-color: #fff; color: var(--do); }
.nut-dau.noi:hover { background: #FFF3C4; }
.che-ban #nut-ban, body:not(.che-ban) #nut-ql { display: none; }
.nut-tk { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.18); color: #fff; font-size: 15px; padding: 0; }
.mang { font-size: 12.5px; font-weight: 600; white-space: nowrap; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.18); }
.mang::before { content: "●"; margin-right: 5px; color: #7dffb0; }
.mang.cho::before { color: var(--vang); } .mang.mat::before { color: #ffb4b4; }
.mang.loi { background: #fff; color: var(--do); cursor: pointer; } .mang.loi::before { color: var(--do); }
main { flex: 1; min-height: 0; }
.v { display: none; height: 100%; }
.v.hien { display: block; }
.trang { overflow: auto; }

/* ───── Ô tìm hàng + gợi ý ───── */
.o-tim { position: relative; flex: none; }
#pos-thanh .o-tim { width: min(320px, 40%); }
.o-tim input { width: 100%; height: 28px; border: 0; border-radius: 6px; padding: 0 10px 0 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") 8px center/15px no-repeat; outline: 0; text-overflow: ellipsis; color: var(--chu); }
.o-tim input:focus { box-shadow: 0 0 0 2px var(--vang); }
.tieu-de-trai .o-tim { width: min(340px, 100%); }
.tieu-de-trai .o-tim input { height: 34px; border: 1px solid var(--vien-dam); }
.goi-y { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: max(100%, 350px); max-width: 94vw; max-height: 70vh; overflow: auto; background: #fff; color: var(--chu); border-radius: 6px; box-shadow: 0 10px 34px rgba(0,0,0,.26); }
.gy { display: flex; align-items: flex-start; gap: 12px; padding: 9px 14px; cursor: pointer; }
.gy.hl, .gy:hover { background: var(--do-nhat); }
.gy-ten { flex: 1; min-width: 0; }
.gy-ten b, .gy-ten small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gy-ten b { font-weight: 600; } .gy-ten small { color: #4b5057; font-size: 12px; margin-top: 2px; }
.gy-ten em, .d-dvt em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--do); background: var(--do-nhat); border-radius: 4px; padding: 1px 6px; }
.gy-gia { font-weight: 700; color: var(--do); white-space: nowrap; }

/* ───── Tab hóa đơn ───── */
.don-tabs { display: flex; gap: 2px; align-self: flex-end; overflow-x: auto; min-width: 0; flex: 1; scrollbar-width: none; }
.dt { border: 0; background: none; color: #fff; height: 33px; padding: 0 16px; border-radius: 8px 8px 0 0; font-weight: 600; white-space: nowrap; flex: none; }
.dt:hover { background: rgba(0,0,0,.14); }
.dt.chon { background: var(--nen); color: var(--chu); font-weight: 700; }
.dt em { font-style: normal; font-size: 11px; background: var(--vang); color: #5a1a00; border-radius: 99px; padding: 1px 6px; margin-left: 6px; }
.dt.them { padding-inline: 12px; font-size: 18px; line-height: 1; }

/* ───── Màn bán hàng + nhập hàng ───── */
#v-ban.hien, #v-nhap.hien { display: grid; grid-template-columns: minmax(0, 1fr) 342px; gap: 8px; padding: 8px; }
#v-nhap.hien { max-width: 1320px; margin: 0 auto; padding: 12px 16px; }
.ban-trai { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.tieu-de-trai { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gio { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.gio-rong { flex: 1; min-height: 200px; display: grid; place-content: center; text-align: center; color: #9aa0a8; font-size: 17px; font-weight: 600; text-wrap: balance; padding: 20px; }
.gio-rong small { font-weight: 400; font-size: 13.5px; }
.dong { display: grid; grid-template-columns: 22px 28px 130px minmax(0, 1fr) 62px 104px 104px 96px; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; background: #fff; border: 1px solid transparent; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.05); flex: none; }
.dong:hover, .dong:focus-within { border-color: #f0a3a6; }
.dong.moi { animation: nhay .9s; }
@keyframes nhay { from { background: #FFF3C4; } }
.stt { text-align: center; }
.d-ma, .d-ten { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.het { color: var(--do); font-style: normal; font-size: 12px; font-weight: 600; margin-left: 6px; }
.d-dvt { text-align: right; white-space: nowrap; overflow: hidden; }
.d-sl { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: center; gap: 4px; }
.d-sl button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: #F0F1F3; font-size: 16px; line-height: 1; padding: 0; color: #555; }
.d-sl button:hover { background: var(--do-nhat); color: var(--do); }
.d-sl input, .d-gia { height: 28px; border: 0; border-bottom: 1px solid var(--vien-dam); background: none; outline: 0; padding: 0 2px; border-radius: 0; min-width: 0; width: 100%; }
.d-sl input { text-align: center; } .d-gia { text-align: right; }
.d-sl input:focus, .d-gia:focus { border-bottom: 2px solid var(--do); }
.d-tien { text-align: right; white-space: nowrap; font-weight: 700; }
.xoa { width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: #4b5057; display: grid; place-items: center; padding: 0; }
.xoa:hover { background: var(--do-nhat); color: var(--do); }
.ban-duoi { flex: none; background: #fff; border-radius: 8px; padding: 0 14px; height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: 0 1px 1px rgba(0,0,0,.05); white-space: nowrap; overflow: hidden; }
.phim { color: var(--mo); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; } .phim kbd { margin-left: 10px; }
.in-chk { display: flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer; flex: none; }
.in-chk input { width: 16px; height: 16px; accent-color: var(--do); margin: 0; }

.ban-phai { background: #fff; border-radius: 8px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.tt-dau { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; color: #4b5057; font-size: 13px; }
.khach-hop { display: flex; gap: 6px; }
.chon-khach { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 30px; border: 0; background: #F0F1F3; border-radius: 6px; padding: 0 10px; text-align: left; color: var(--mo); }
.chon-khach i { font-style: normal; color: var(--chu); font-size: 15px; }
.chon-khach:hover { background: #e6e8eb; }
.chon-khach.co { background: var(--do-nhat); color: var(--chu); }
.ck-ten { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .co .ck-ten { font-weight: 700; }
.ck-no { color: var(--do); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.bo-khach { width: 30px; border: 0; background: #F0F1F3; border-radius: 6px; color: var(--mo); padding: 0; }
.tt-dong { display: grid; grid-template-columns: minmax(0, 1fr) 40px 124px; align-items: center; gap: 8px; min-height: 30px; white-space: nowrap; }
.tt-dong > :first-child { grid-column: 1 / 3; } .tt-dong > :first-child:has(+ em) { grid-column: 1; }
.tt-dong em { font-style: normal; text-align: center; }
.tt-dong > b, .tt-dong > input { text-align: right; justify-self: stretch; font-size: 15px; }
.tt-dong > b { font-weight: 500; }
.tt-dong input { height: 30px; border: 0; border-bottom: 1px solid var(--vien-dam); outline: 0; background: none; padding: 0 2px; border-radius: 0; min-width: 0; width: 100%; }
.tt-dong input:focus { border-bottom: 2px solid var(--do); }
.tt-dong input::placeholder { color: #a9adb5; }
.can-tra { font-weight: 700; } .can-tra > b { color: var(--do); font-weight: 700; font-size: 17px; }
.ht { display: flex; gap: 14px; flex-wrap: wrap; min-height: 28px; align-items: center; }
.ht button { border: 0; background: none; padding: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.ht button i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #8b9098; flex: none; }
.ht button.chon i { border: 5px solid var(--do); }
#vung-dua { display: flex; flex-direction: column; gap: 6px; }
.nhanh { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: #F0F1F3; border-radius: 6px; padding: 8px; }
.nhanh button { height: 28px; border: 1px solid var(--vien); background: #fff; border-radius: 99px; font-size: 13px; white-space: nowrap; padding: 0; }
.nhanh button:hover { border-color: var(--do); color: var(--do); }
.thua > b { font-weight: 700; } .thua > b.thieu { color: var(--do); }
.tt-day { flex: 1; }
.nut-tt { height: 40px; flex: none; border: 0; border-radius: 8px; background: var(--do); color: #fff; font-size: 15px; font-weight: 700; white-space: nowrap; }
.nut-tt:hover { background: var(--do-dam); }
.nut-tt:disabled { opacity: .6; }
.nut-tt kbd { background: rgba(255,255,255,.22); color: #fff; margin-left: 8px; }
.tt-tong { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--do-nhat); border-radius: 8px; font-weight: 700; white-space: nowrap; margin-top: 4px; }
.tt-tong b { font-size: 20px; color: var(--do); font-weight: 800; }
#v-nhap .het { display: none; }
#v-nhap .ban-phai { gap: 10px; }
.truong { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mo); font-weight: 500; }
h3.phu { font-size: 15px; font-weight: 700; margin-top: 14px; margin-bottom: 8px; }
.ds-phieu { display: flex; flex-direction: column; }
.ds-phieu button { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid #eef0f2; background: none; padding: 8px 2px; white-space: nowrap; font-size: 13px; }
.ds-phieu button:hover { background: var(--do-nhat); }
.ds-phieu .dai { overflow: hidden; text-overflow: ellipsis; color: var(--mo); }

/* ───── Trang quản lý: cột lọc trái + nội dung phải ───── */
.khung { max-width: 1320px; margin: 0 auto; padding: 14px 16px 28px; display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 14px; align-items: start; }
.loc { display: flex; flex-direction: column; gap: 10px; }
.loc h2 { height: 34px; display: flex; align-items: center; }
.loc-the { background: #fff; border-radius: 8px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.loc-the h4 { font-size: 13.5px; font-weight: 700; }
.chip { display: flex; gap: 6px; flex-wrap: wrap; }
.chip button, .khoang > button { height: 28px; padding: 0 12px; border: 1px solid var(--vien-dam); background: #fff; border-radius: 99px; font-size: 13px; white-space: nowrap; }
.chip button.chon, .khoang > button.chon { background: var(--do); border-color: var(--do); color: #fff; font-weight: 600; }
.khoang { display: flex; gap: 6px; flex-wrap: wrap; }
.kn-o { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px; width: 100%; }
.kn-o i { font-style: normal; color: var(--mo); }
.khoang .o.ngay { height: 30px; text-align: center; padding: 0; font-size: 12.5px; }
.nd { min-width: 0; }
.thanh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; min-height: 34px; }
.thanh .day { flex: 1; }
.o { height: 34px; border: 1px solid var(--vien-dam); border-radius: 6px; padding: 0 10px; background: #fff; outline: 0; min-width: 0; width: 100%; }
.o:focus { border-color: var(--do); box-shadow: 0 0 0 3px rgba(215,20,26,.12); }
.thanh .o.tim { width: min(320px, 100%); padding-left: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") 8px center/15px no-repeat; }
select.o { padding-right: 4px; }
input[type=file].o { padding: 6px; height: auto; }
.nut { height: 34px; padding: 0 13px; border: 1px solid var(--vien-dam); background: #fff; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.nut:hover { border-color: var(--do); color: var(--do); }
.nut.chinh { background: var(--do); border-color: var(--do); color: #fff; } .nut.chinh:hover { background: var(--do-dam); color: #fff; }
.nut.do { color: var(--do); border-color: #f0b4b6; } .nut.do:hover { background: var(--do-nhat); }
.nut.to { height: 46px; font-size: 16px; width: 100%; }
.nut:disabled { opacity: .6; cursor: default; }
.tom { margin-bottom: 10px; color: #3d434b; text-wrap: pretty; }
.trong { background: #fff; border-radius: 8px; padding: 40px 20px; text-align: center; color: var(--mo); text-wrap: balance; }
.bang-cuon { overflow-x: auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
table.b { width: 100%; border-collapse: collapse; }
.b th, .b td { padding: 9px 12px; white-space: nowrap; text-align: left; vertical-align: middle; border-bottom: 1px solid #eef0f2; }
.b th.phai, .b td.phai { text-align: right; }
.b th { background: var(--hong); font-size: 12.5px; font-weight: 700; color: #3d434b; }
.b tbody tr:last-child td { border-bottom: 0; }
.b td.dai { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.b.bam tbody tr { cursor: pointer; } .b.bam tbody tr:hover { background: #FFF6F6; }
.b tr.huy td { color: #a0a4ab; } .b tr.huy td b { font-weight: 500; }
.canh-bao { color: var(--do); font-weight: 700; } .tot { color: var(--xanh); font-weight: 700; }
.nhan { font-style: normal; font-size: 11.5px; font-weight: 600; background: #eceef1; color: var(--mo); border-radius: 99px; padding: 2px 8px; margin-left: 6px; }
.nhan.do { background: var(--do-nhat); color: var(--do); }
.the-luoi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.the { background: #fff; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.the span { color: var(--mo); font-size: 13px; font-weight: 500; white-space: nowrap; }
.the b { font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.the small { color: var(--mo); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 17px; }
.the.chinh { background: var(--do); } .the.chinh span, .the.chinh small { color: rgba(255,255,255,.85); } .the.chinh b { color: #fff; }
.cot-hop { background: #fff; border-radius: 8px; padding: 14px 14px 8px; overflow-x: auto; }
.cot-bd { display: grid; grid-template-columns: repeat(var(--n), minmax(26px, 1fr)); gap: 6px; height: 170px; align-items: end; }
.cot { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.cot i { width: 100%; max-width: 44px; background: var(--do); border-radius: 4px 4px 0 0; }
.cot:hover i { background: var(--vang); }
.cot span { font-size: 11px; color: var(--mo); white-space: nowrap; }
.hai-cot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ───── Hộp thoại ───── */
#nen-modal, .nen-hoi { position: fixed; inset: 0; z-index: 50; background: rgba(20,22,26,.5); display: grid; place-items: center; padding: 14px; }
.nen-hoi { z-index: 60; }
.modal { background: #fff; border-radius: 10px; width: min(520px, 100%); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.rong { width: min(760px, 100%); } .modal.nho { width: min(400px, 100%); }
.m-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--vien); }
.m-dau h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; color: var(--mo); font-size: 15px; flex: none; padding: 0; }
.x:hover { background: var(--nen); }
.m-than { padding: 14px 16px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.m-than .tom { margin: 0; } .m-than .bang-cuon { border: 1px solid var(--vien); box-shadow: none; flex: none; }
.m-nut { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.cau-hoi { font-size: 15px; text-wrap: pretty; }
.luoi2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.luoi2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mo); font-weight: 500; }
.luoi2 .ca { grid-column: 1 / -1; }
.luoi2 label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--chu); font-size: 14px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--do); margin: 0; }
.ds-khach { display: flex; flex-direction: column; max-height: 300px; overflow: auto; border: 1px solid var(--vien); border-radius: 8px; flex: none; }
.ds-khach button { display: grid; grid-template-columns: minmax(0, 1fr) 106px 116px; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid #eef0f2; background: none; padding: 9px 12px; white-space: nowrap; }
.ds-khach button:hover { background: var(--do-nhat); }
.ds-khach .mo { padding: 14px; }
.k-ten { font-weight: 600; overflow: hidden; text-overflow: ellipsis; } .k-sdt { color: var(--mo); } .k-no { color: var(--do); font-weight: 600; text-align: right; }
.them-khach summary { cursor: pointer; font-weight: 600; color: var(--do); padding: 4px 0; }
.them-khach[open] summary { margin-bottom: 10px; } .them-khach .m-nut { margin-top: 12px; }
.ke-tong { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; justify-items: end; white-space: nowrap; }
.ke-tong span { color: var(--mo); } .ke-tong .to { font-size: 16px; font-weight: 700; color: var(--chu); } .ke-tong b.to { color: var(--do); }
.no-lon { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--do-nhat); border-radius: 8px; padding: 10px 14px; font-weight: 600; white-space: nowrap; }
.no-lon b { font-size: 22px; color: var(--do); font-weight: 800; }
.no-lon.het-no { background: var(--xanh-nhat); } .no-lon.het-no b { color: var(--xanh); }
.thu-no { display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr) auto; gap: 8px; }
.thu-no .tien { text-align: right; font-weight: 700; }
.m-than h3.phu { margin: 0; }
.buoc { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; text-wrap: pretty; }
.tk-nut { display: flex; flex-direction: column; gap: 8px; } .tk-nut .nut { width: 100%; }
.don-loi { border: 1px solid #f0b4b6; background: var(--do-nhat); border-radius: 8px; padding: 8px 12px; } .don-loi span { color: var(--do); font-size: 13px; }

/* ───── Thông báo ───── */
#bao { position: fixed; z-index: 80; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 94vw; }
.tb { background: #24282e; color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--bong); text-align: center; text-wrap: balance; animation: len .2s; }
.tb.ok { background: var(--xanh); font-size: 16px; } .tb.loi { background: var(--do); }
@keyframes len { from { transform: translateY(10px); opacity: 0; } }

/* ───── Đăng nhập ───── */
#vao { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--do) 0 46%, var(--nen) 46.2%); }
.the-vao { width: min(360px, 100%); background: #fff; border-radius: 16px; padding: 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.22); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.the-vao img { width: 64px; height: 64px; border-radius: 16px; }
.the-vao h1 { margin: 0; font-size: 22px; font-weight: 700; white-space: nowrap; } .the-vao h1 b { color: var(--do); font-weight: 800; }
.the-vao p { color: var(--mo); text-wrap: balance; }
.pin { text-align: center; font-size: 22px; letter-spacing: 6px; height: 50px; font-weight: 700; }
.pin::placeholder { font-size: 15px; letter-spacing: 0; font-weight: 400; }
.vao-loi { color: var(--do); font-weight: 600; min-height: 20px; font-size: 13.5px; }

/* ───── Màn vừa ───── */
@media (max-width: 1180px) {
  #v-ban.hien, #v-nhap.hien { grid-template-columns: minmax(0, 1fr) 320px; }
  .dong { grid-template-columns: 20px 26px 126px minmax(0, 1fr) 52px 96px 92px 88px; gap: 8px; }
  .the-luoi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khung { grid-template-columns: 204px minmax(0, 1fr); }
  .phim { display: none; }
}
/* ───── Điện thoại ───── */
@media (max-width: 760px) {
  .giua-trang { padding: 0 10px; gap: 8px; }
  .dau-menu { height: auto; min-height: 44px; }
  .che-ban .dau-menu .giua-trang { flex-wrap: wrap; padding: 8px 10px 0; }
  #pos-thanh { order: 5; flex: 0 0 100%; flex-direction: column; align-items: stretch; gap: 6px; }
  #pos-thanh .o-tim { width: 100%; } #pos-thanh .o-tim input { height: 36px; } .don-tabs { align-self: stretch; flex: none; }
  .goi-y { width: 100%; }
  #nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--vien); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); }
  #nav button { color: var(--mo); flex-direction: column; gap: 1px; padding: 6px 0 5px; height: auto; font-size: 11px; justify-content: center; border-radius: 0; }
  #nav button i { display: block; font-size: 19px; line-height: 1.2; }
  #nav button.chon { background: none; color: var(--do); }
  body:not(.che-ban) main { padding-bottom: 58px; }
  .mang { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  #v-ban.hien, #v-nhap.hien { display: block; overflow: auto; padding: 8px; }
  .ban-trai { margin-bottom: 8px; } .gio { overflow: visible; min-height: 120px; flex: none; }
  .ban-phai { overflow: visible; } .ban-duoi { height: 40px; }
  .stt, .d-ma, .d-dvt { display: none; }
  .dong { grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr) 28px; grid-template-areas: "ten ten ten xoa" "sl gia tien tien"; gap: 6px 10px; padding: 9px 10px; }
  .d-ten { grid-area: ten; font-weight: 600; } .d-sl { grid-area: sl; } .d-gia { grid-area: gia; } .d-tien { grid-area: tien; } .xoa { grid-area: xoa; }
  .d-sl button { width: 28px; height: 28px; } .d-sl { grid-template-columns: 28px minmax(0, 1fr) 28px; }
  .khung { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 20px; gap: 10px; }
  .loc h2 { height: auto; }
  .kn-o { max-width: 260px; }
  .thanh .o.tim { width: 100%; flex: 1 1 100%; } .thanh .day { display: none; } .thanh .nut { flex: 1; padding: 0 8px; }
  .an-dt { display: none; }
  .b th, .b td { padding: 8px 9px; } .b td.dai { max-width: 44vw; }
  .hai-cot { grid-template-columns: minmax(0, 1fr); }
  .the b { font-size: 18px; }
  .thu-no { grid-template-columns: minmax(0, 1fr) auto; }
  .ds-khach button { grid-template-columns: minmax(0, 1fr) 96px auto; }
  #bao { bottom: 72px; }
}

/* ───── In hóa đơn ───── */
#in-hd { display: none; }
@media print {
  @page { margin: 0; size: 80mm auto; }
  html, body { height: auto; background: #fff; }
  body > *:not(#in-hd) { display: none !important; }
  #in-hd { display: block; width: 72mm; margin: 0 auto; padding: 3mm 0 6mm; font: 12px/1.35 Arial, sans-serif; color: #000; }
  #in-hd.kho-58 { width: 48mm; font-size: 10.5px; }
  .hd-ten { text-align: center; font-weight: 800; font-size: 1.3em; } .hd-giua { text-align: center; }
  .hd-td { text-align: center; font-weight: 700; font-size: 1.15em; margin: 2mm 0 1mm; }
  .hd-2 { display: flex; justify-content: space-between; gap: 3mm; } .hd-2 span:last-child { white-space: nowrap; }
  .hd-mon { font-weight: 600; margin-top: 1mm; }
  .hd-ke { border-top: 1px dashed #000; margin: 1.5mm 0; }
  .hd-tong { font-weight: 800; font-size: 1.25em; }
}
