/* POS Ky gui (QL Ban Le): man hinh ban tai quay toan man hinh, bo cuc theo POS Sapo + cac trang quan ly POS */
#pos-app { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; background: #f3f5f9; font-family: 'Be Vietnam Pro', 'Montserrat', 'Segoe UI', Arial, sans-serif; color: #1f2a3d; }
#pos-app * { box-sizing: border-box; }
.pos-top { flex: 0 0 52px; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 10px; background: #1760c9; color: #fff; }
.pos-logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; color: #1760c9; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; flex: 0 0 auto; }
.pos-search { position: relative; flex: 0 1 460px; min-width: 220px; }
.pos-search input { width: 100%; height: 36px; border-radius: 6px; border: 0; padding: 0 34px 0 34px; font-size: 14px; background: #fff; color: #1f2a3d; }
.pos-search > svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: #7a869a; pointer-events: none; }
.pos-clear { position: absolute; right: 8px; top: 8px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: #9aa5b8; color: #fff; font-size: 12px; line-height: 20px; padding: 0; cursor: pointer; display: none; }
.pos-results { position: absolute; z-index: 20; top: 42px; left: 0; width: 560px; max-width: 92vw; max-height: 70vh; overflow-y: auto; background: #fff; border-radius: 8px; box-shadow: 0 14px 34px rgba(15, 30, 60, .3); color: #1f2a3d; }
.pos-results[hidden] { display: none; }
.pos-res-new { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid #e8ecf3; background: #fff; color: #1760c9; font-size: 13.5px; cursor: pointer; text-align: left; }
.pos-res { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #eef1f6; cursor: pointer; }
.pos-res:hover, .pos-res.on { background: #eaf2ff; }
.pos-thumb { width: 44px; height: 44px; border-radius: 6px; background: #eef1f6 center/cover no-repeat; flex: 0 0 auto; }
.pos-res-main { flex: 1; min-width: 0; }
.pos-res-name { font-weight: 700; font-size: 14px; }
.pos-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #e9eef7; font-size: 12px; margin: 2px 0; }
.pos-res-sku { font-size: 12px; color: #6a778c; }
.pos-res-price { text-align: right; flex: 0 0 auto; font-weight: 700; font-size: 14px; }
.pos-res-price small { display: block; font-weight: 400; font-size: 12px; color: #6a778c; }
.pos-res-price small b { color: #1f9d55; } .pos-res-price small b.zero { color: #d93636; }
.pos-tabs { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pos-tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 6px 6px 0 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 13.5px; white-space: nowrap; cursor: pointer; border: 0; }
.pos-tab.on { background: #fff; color: #1760c9; font-weight: 600; }
.pos-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.pos-tab .x { border: 0; background: transparent; color: inherit; font-size: 15px; padding: 0 0 0 2px; cursor: pointer; opacity: .7; }
.pos-tab-add { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .22); color: #fff; font-size: 20px; line-height: 28px; padding: 0; cursor: pointer; flex: 0 0 auto; }
.pos-top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 12.5px; }
.pos-exit { white-space: nowrap; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; font-size: 13px; cursor: pointer; }
.pos-avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #1760c9; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pos-body { flex: 1 1 auto; display: flex; min-height: 0; }
.pos-rail { flex: 0 0 56px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: #fff; border-right: 1px solid #e3e8f0; }
.pos-rail button { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #7a869a; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.pos-rail button svg { width: 21px; height: 21px; }
.pos-rail button:hover { background: #eef3fb; color: #1760c9; }
.pos-rail button.on { background: #1760c9; color: #fff; }
.pos-rail button[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 48px; top: 8px; z-index: 30; background: #1f2a3d; color: #fff; font-size: 12.5px; padding: 5px 9px; border-radius: 5px; white-space: nowrap; }
.pos-rail .grow { flex: 1; }
.pos-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }
.pos-embed { flex: 1; overflow-y: auto; padding: 18px 22px 40px; background: #f3f5f9; }
.pos-embed > * { max-width: 1280px; margin-left: auto; margin-right: auto; }

.pos-sell { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; padding: 12px; min-height: 0; }
.pos-cart { display: flex; flex-direction: column; background: #fff; border-radius: 8px; min-height: 0; border: 1px solid #e3e8f0; }
.pos-cart-head { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px 120px 32px; gap: 8px; align-items: center; padding: 11px 16px; border-bottom: 1px solid #e8ecf3; font-size: 13.5px; font-weight: 600; color: #4a566b; }
.pos-cart-head label { font-weight: 400; display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; cursor: pointer; }
.pos-cart-head .r { text-align: right; } .pos-cart-head .c { text-align: center; }
.pos-lines { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px 120px 32px; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f0f2f7; }
.pos-line-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-line-name .pos-thumb { width: 36px; height: 36px; }
.pos-line-sub { font-weight: 400; font-size: 12.5px; color: #6a778c; }
.pos-line input.price { width: 100%; text-align: right; border: 1px solid transparent; border-radius: 5px; padding: 5px 6px; font-size: 14px; font-weight: 600; color: #1760c9; background: transparent; }
.pos-line input.price:hover, .pos-line input.price:focus { border-color: #c5d3ea; background: #fff; outline: none; }
.pos-qty { display: flex; align-items: center; justify-content: center; gap: 4px; }
.pos-qty button { width: 26px; height: 26px; border: 1px solid #d5dce9; background: #fff; border-radius: 5px; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; color: #4a566b; }
.pos-qty input { width: 48px; height: 28px; text-align: center; border: 1px solid #d5dce9; border-radius: 5px; font-size: 14px; }
.pos-line .tot { text-align: right; font-weight: 700; }
.pos-line .del { border: 0; background: transparent; color: #8a95a8; cursor: pointer; padding: 4px; border-radius: 5px; }
.pos-line .del:hover { color: #d93636; background: #fdeeee; }
.pos-line .warn { color: #d93636; font-size: 12px; font-weight: 500; }
.pos-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #6a778c; text-align: center; padding: 30px; }
.pos-empty svg { width: 120px; height: 120px; color: #cfd8e8; }
.pos-empty kbd, .pos-kbd { display: inline-block; padding: 0 6px; border-radius: 4px; background: #eef1f6; font-size: 11.5px; font-family: inherit; color: #4a566b; border: 1px solid #dbe1ec; }
.pos-cart-foot { padding: 10px 14px 12px; border-top: 1px solid #e8ecf3; display: flex; flex-direction: column; gap: 8px; }
.pos-cart-foot input.note { width: 100%; height: 38px; border: 1px solid #d5dce9; border-radius: 6px; padding: 0 12px; font-size: 14px; }
.pos-foot-row { display: flex; gap: 10px; align-items: center; }
.pos-foot-row select { flex: 1; height: 38px; border: 1px solid #d5dce9; border-radius: 6px; padding: 0 10px; font-size: 13.5px; background: #fff; min-width: 0; }
.pos-btn { height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid #1760c9; background: #fff; color: #1760c9; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pos-btn:hover { background: #eef4ff; }
.pos-btn.primary { background: #1760c9; color: #fff; }
.pos-btn.primary:hover { background: #124fa6; }
.pos-btn:disabled { opacity: .5; cursor: not-allowed; }

.pos-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.pos-cust { position: relative; background: #fff; border: 1px solid #e3e8f0; border-radius: 8px; padding: 12px; }
.pos-cust-row { display: flex; align-items: center; gap: 8px; border: 1px solid #d5dce9; border-radius: 6px; padding: 0 8px; height: 38px; }
.pos-cust-row input { flex: 1; border: 0; outline: none; font-size: 14px; min-width: 0; background: transparent; }
.pos-cust-row svg { width: 16px; height: 16px; color: #7a869a; flex: 0 0 auto; }
.pos-cust-add { width: 24px; height: 24px; border: 0; background: transparent; color: #1760c9; font-size: 20px; cursor: pointer; padding: 0; }
.pos-cust-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.pos-cust-pick b { font-weight: 700; } .pos-cust-pick span { color: #6a778c; font-size: 13px; }
.pos-cust-list { position: absolute; z-index: 15; left: 12px; right: 12px; top: 54px; background: #fff; border-radius: 8px; box-shadow: 0 12px 30px rgba(15, 30, 60, .25); max-height: 300px; overflow-y: auto; }
.pos-cust-list[hidden] { display: none; }
.pos-cust-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eef1f6; background: #fff; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.pos-cust-list button:hover { background: #eaf2ff; } .pos-cust-list small { display: block; color: #6a778c; }
.pos-pay { background: #fff; border: 1px solid #e3e8f0; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pos-pay h4 { margin: 0; font-size: 15px; font-weight: 700; }
.pos-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.pos-sum small { color: #6a778c; margin-left: 6px; }
.pos-sum.big { font-size: 15px; font-weight: 700; }
.pos-sum.big b { font-size: 18px; }
.pos-link { border: 0; background: transparent; color: #1760c9; font-size: 13.5px; cursor: pointer; padding: 0; }
.pos-pay-row { display: grid; grid-template-columns: 1fr 1fr 24px; gap: 8px; align-items: center; }
.pos-pay-row select, .pos-pay-row input { height: 38px; border: 1px solid #d5dce9; border-radius: 6px; padding: 0 10px; font-size: 14px; min-width: 0; background: #fff; }
.pos-pay-row input { text-align: right; font-weight: 600; }
.pos-pay-row .rm { border: 0; background: transparent; color: #8a95a8; cursor: pointer; font-size: 16px; padding: 0; }
.pos-change { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 6px; background: #f1f4f9; font-weight: 700; font-size: 14px; }
.pos-change.short { background: #fdeeee; color: #d93636; }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-quick button { border: 1px solid #d5dce9; background: #fff; border-radius: 14px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: #4a566b; }
.pos-quick button:hover { border-color: #1760c9; color: #1760c9; }
.pos-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.pos-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: auto; padding-top: 4px; }
.pos-actions .pos-btn { height: 46px; font-size: 15px; }
.pos-modal-bg { position: fixed; inset: 0; z-index: 5100; background: rgba(15, 30, 60, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pos-modal { width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); color: #1f2a3d; }
.pos-modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e8ecf3; font-size: 16px; font-weight: 700; }
.pos-modal header button { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: #6a778c; }
.pos-modal .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.pos-modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #e8ecf3; }
.pos-modal label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #4a566b; }
.pos-modal input, .pos-modal select, .pos-modal textarea { border: 1px solid #d5dce9; border-radius: 6px; padding: 8px 10px; font-size: 14px; font-family: inherit; }
.pos-seg { align-self: flex-start; display: inline-flex; border: 1px solid #1760c9; border-radius: 6px; overflow: hidden; }
.pos-seg button { border: 0; background: #fff; color: #1760c9; padding: 7px 18px; font-size: 14px; cursor: pointer; }
.pos-seg button.on { background: #1760c9; color: #fff; }
.pos-disc-box { border: 1px solid #e3e8f0; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pos-disc-head { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }

/* Trang quan ly POS (tra cuu don, ton kho, danh muc, nhap ky gui, nhan, bao cao) */
.pos-pg h2 { margin: 0 0 4px; }
.pos-pg .sub { color: #6a778c; margin: 0 0 14px; font-size: 14px; }
.pos-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 12px; }
.pos-bar .field { min-width: 150px; }
.pos-quickrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.pos-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 14px; }
.pos-stat { background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; padding: 12px 14px; }
.pos-stat .l { font-size: 12.5px; color: #6a778c; margin-bottom: 4px; }
.pos-stat .v { font-size: 20px; font-weight: 700; color: #1f2a3d; }
.pos-stat .v.blue { color: #1760c9; } .pos-stat .v.green { color: #1f9d55; } .pos-stat .v.red { color: #d93636; }
.pos-split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; align-items: start; }
.pos-list { background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; overflow: hidden; }
.pos-list .item { padding: 11px 14px; border-bottom: 1px solid #eef1f6; cursor: pointer; }
.pos-list .item:hover { background: #f5f8ff; } .pos-list .item.on { background: #eaf2ff; box-shadow: inset 3px 0 0 #1760c9; }
.pos-list .item .t { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.pos-list .item .s { display: flex; justify-content: space-between; color: #6a778c; font-size: 12.5px; margin-top: 2px; }
.pos-pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; background: #e9eef7; color: #3a4963; margin-right: 4px; }
.pos-pill.ok { background: #dcf5e6; color: #167a42; } .pos-pill.bad { background: #fde4e4; color: #b02a2a; } .pos-pill.warn { background: #fff0d6; color: #99620a; }
.pos-detail { background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; padding: 16px 18px; }
.pos-detail h3 { margin: 0 0 8px; font-size: 18px; }
.pos-kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 14px; margin: 10px 0; }
.pos-kv span:nth-child(odd) { color: #6a778c; }
.pos-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pos-tbl th { text-align: left; background: #f3f6fb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #5a6780; padding: 9px 10px; }
.pos-tbl td { padding: 9px 10px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.pos-tbl .r { text-align: right; font-variant-numeric: tabular-nums; } .pos-tbl .c { text-align: center; }
.pos-tbl tr.tot td { font-weight: 700; background: #f8fafd; }
.pos-tbl tr.off td { color: #9aa5b8; }
.pos-wrap { overflow-x: auto; background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; }
.pos-tabsbar { display: flex; gap: 4px; border-bottom: 2px solid #e3e8f0; margin: 0 0 14px; }
.pos-tabsbar button { border: 0; background: transparent; padding: 9px 16px; font-size: 14px; font-weight: 600; color: #6a778c; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.pos-tabsbar button.on { color: #1760c9; border-bottom-color: #1760c9; }
.pos-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 8px 4px 0; }
.pos-bars div { flex: 1; min-width: 10px; background: #8db4f0; border-radius: 4px 4px 0 0; position: relative; }
.pos-bars div:hover { background: #1760c9; }
.pos-pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; color: #6a778c; }
@media (max-width: 980px) {
  .pos-sell { grid-template-columns: 1fr; overflow-y: auto; }
  .pos-split { grid-template-columns: 1fr; }
  .pos-rail { flex-basis: 48px; }
  .pos-cart-head, .pos-line { grid-template-columns: minmax(0, 1fr) 90px 100px 28px; }
  .pos-cart-head .th-price, .pos-line .price-col { display: none; }
}
.pos-mbar { display: none; }

/* ===== DIEN THOAI (<= 720px): header 2 hang, thanh dieu huong ra day man hinh, gio hang dang the, thanh Thanh toan co dinh, trang quan ly 1 cot ===== */
@media (max-width: 720px) {
  html, body { overscroll-behavior: none; }
  #pos-app { height: 100dvh; font-size: 15px; }
  .pos-top { flex: 0 0 auto; flex-wrap: wrap; gap: 8px 8px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 0 10px; }
  .pos-logo { width: 32px; height: 32px; font-size: 12px; }
  .pos-search { flex: 1 1 0; min-width: 0; order: 1; }
  .pos-search input { height: 38px; font-size: 16px; }
  .pos-search > svg { top: 11px; }
  .pos-clear { top: 9px; }
  .pos-results { position: fixed; left: 8px; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 56px); width: auto; max-width: none; max-height: 60vh; }
  .pos-top-right { order: 2; gap: 6px; margin-left: 0; }
  .pos-top-right #pos-branch, .pos-avatar { display: none; }
  .pos-exit { height: 34px; padding: 0 9px; font-size: 12.5px; max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
  #pos-exit { display: none; }
  .pos-tabs { order: 3; flex: 0 0 100%; padding-top: 2px; }
  .pos-tabs[style*="hidden"] { display: none; }
  .pos-top:has(.pos-tabs[style*="hidden"]) { padding-bottom: 8px; }
  .pos-tab { height: 34px; padding: 0 12px; font-size: 13px; }
  .pos-body { flex-direction: column; }
  .pos-main { order: 1; }
  .pos-rail { order: 2; flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 0; padding: 4px 4px calc(env(safe-area-inset-bottom, 0px) + 4px); border-right: 0; border-top: 1px solid #e3e8f0; overflow-x: auto; scrollbar-width: none; }
  .pos-rail button { flex: 1 0 38px; width: auto; height: 42px; }
  .pos-rail .grow { display: none; }
  .pos-rail button[data-tip]:hover::after { display: none; }
  .pos-embed { padding: 12px 12px 24px; -webkit-overflow-scrolling: touch; }

  /* Man hinh ban: 1 cot, cuon doc, thanh Thanh toan dinh duoi */
  .pos-sell { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
  .pos-cart { flex: 0 0 auto; min-height: 0; }
  .pos-cart-head { display: block; padding: 10px 12px; }
  .pos-cart-head > div:not(:first-child) { display: none; }
  .pos-cart-head label { margin-left: 10px; }
  .pos-lines { overflow: visible; }
  .pos-empty { height: auto; padding: 26px 16px; }
  .pos-empty svg { width: 84px; height: 84px; }
  .pos-empty kbd { display: none; }
  .pos-line { row-gap: 8px; column-gap: 8px; padding: 10px 12px; }
  .pos-line .pos-line-name { grid-area: name; }
  .pos-line .price-col { display: block; grid-area: price; }
  .pos-line .pos-qty { grid-area: qty; justify-self: end; }
  .pos-line .tot { grid-area: tot; }
  .pos-line .del { grid-area: del; align-self: start; }
  .pos-line { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name name del" "price qty tot"; }
  .pos-line input.price { border-color: #d5dce9; background: #fff; height: 38px; max-width: 120px; font-size: 15px; text-align: left; }
  .pos-qty { gap: 6px; }
  .pos-qty button { width: 34px; height: 34px; font-size: 18px; }
  .pos-qty input { width: 46px; height: 34px; font-size: 16px; }
  .pos-line .tot { min-width: 82px; font-size: 15px; }
  .pos-cart-foot { padding: 10px 12px; }
  .pos-foot-row { flex-wrap: wrap; }
  .pos-foot-row select { flex: 1 1 100%; }
  .pos-foot-row .pos-btn { flex: 1 1 100%; }
  .pos-cart-foot input.note, .pos-foot-row select, .pos-cust-row input, .pos-pay-row select, .pos-pay-row input { font-size: 16px; height: 42px; }
  .pos-cust-row { height: 42px; }
  .pos-side { overflow: visible; flex: 0 0 auto; gap: 10px; }
  .pos-pay { padding: 12px; }
  .pos-pay-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 24px; }
  .pos-quick button { padding: 6px 12px; font-size: 13.5px; }
  .pos-actions { display: none; }
  .pos-kbd { display: none; }
  .pos-mbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; bottom: 0; z-index: 5; margin: 0 -10px; padding: 8px 12px; background: #fff; border-top: 1px solid #d5dce9; box-shadow: 0 -6px 16px rgba(15, 30, 60, .1); }
  .pos-mbar .lbl { font-size: 12px; color: #6a778c; line-height: 1.2; }
  .pos-mbar .lbl b { display: block; font-size: 19px; color: #1f2a3d; }
  .pos-mbar .pos-btn { height: 46px; font-size: 15px; flex: 0 0 auto; padding: 0 22px; }
  .pos-mbar .pos-btn.sec { padding: 0 14px; }

  /* Hop thoai: gan het man hinh, o nhap 16px de iPhone khong tu phong to */
  .pos-modal-bg { padding: 8px; align-items: flex-end; }
  .pos-modal, .pos-modal[style] { width: 100% !important; max-height: 92dvh; border-radius: 12px; }
  .pos-modal input, .pos-modal select, .pos-modal textarea { font-size: 16px; }
  .pos-modal footer { position: sticky; bottom: 0; background: #fff; flex-wrap: wrap; }
  .pos-modal footer .pos-btn { flex: 1 1 140px; }

  /* Trang quan ly: 1 cot, bang cuon ngang, o nhap khong bi phong to */
  .pos-pg h2 { font-size: 20px; }
  .pos-pg [style*="grid-template-columns"], .pos-split { grid-template-columns: minmax(0, 1fr) !important; }
  .pos-bar { gap: 8px; align-items: stretch; }
  .pos-bar .field { min-width: 0; flex: 1 1 140px; }
  .pos-bar .btn, .pos-bar button { flex: 0 0 auto; }
  .pos-pg input, .pos-pg select, .pos-pg textarea { font-size: 16px; max-width: 100%; }
  .pos-pg input[type="checkbox"], .pos-pg input[type="radio"] { font-size: inherit; }
  .pos-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pos-stat { padding: 10px 11px; } .pos-stat .v { font-size: 17px; word-break: break-word; }
  .pos-kv { grid-template-columns: 105px minmax(0, 1fr); font-size: 13.5px; }
  .pos-detail { padding: 12px; overflow-x: auto; min-width: 0; }
  .pos-split > *, .pos-pg > * { min-width: 0; }
  .pos-detail .pos-tbl { min-width: 480px; }
  .pos-wrap .pos-tbl { min-width: 620px; }
  .pos-embed table:not(.pos-tbl) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pos-tabsbar { overflow-x: auto; scrollbar-width: none; }
  .pos-tabsbar button { white-space: nowrap; padding: 9px 12px; }
  .pos-quickrow { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .pos-quickrow > * { flex: 0 0 auto; }
  .pos-pg [style*="max-width"] { max-width: 100% !important; }
  .pos-pager { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 380px) { .pos-stats { grid-template-columns: minmax(0, 1fr); } }
@media print { #pos-app, .pos-modal-bg { display: none !important; } }
