/* =============================================================================
   NamPhuongERP 1.64.5 — Sua 3 diem giao dien mobile
   =============================================================================
   NAP CUOI CUNG, sau namphuong-ui-sale-header-1.64.4.css.
   Chi dung toi trinh bay. Khong doi nghiep vu nao.

   Ghi chu ve @media: file nay dung class .np1645-mobile / .np1644-compact-head
   do patch gan (theo matchMedia) thay vi boc @media. Dieu kien man hinh khi do
   nam gon o mot cho trong JS, va quy tac kiem tra duoc bang jsdom — jsdom KHONG
   ap dung @media nen quy tac boc trong @media se khong the tu kiem.
   ============================================================================= */


/* =============================================================================
   A. THANH DIEU HUONG DUOI — bo mask, dung SVG that
   =============================================================================
   Nguyen nhan icon MAT (khong phai mo): namphuong-ui-pages-1.53.0-clean7.css:70
   ve icon bang CSS mask —

       background-color:currentColor; mask-image:var(--np3-i-...)

   Neu mask khong ve ra gi thi o icon rong hoan toan, du mau chu co dam den dau.
   Doi color/opacity nhu hai ban truoc da lam la vo ich.

   Patch 1.64.5 chen SVG that vao trong span va gan class .np1645-ico. Khoi duoi
   day tra span ve mot hop binh thuong: bo mask, bo background, tra lai kich
   thuoc tu nhien. Con lai la SVG voi stroke="currentColor" — mau tu bam theo
   mau chu cua nut, khong con phu thuoc mask hay bien --np3-i-*.

   Do chuyen sang duong khac han, quy tac nay KHONG phan biet sang/toi: ca hai
   che do deu lay mau chu cua nut, dung nhu truoc. Mau chu thi giu nguyen tu
   1.64.4 (sang: --npui-text, toi: --npui-text-3).
   ============================================================================= */
body .mobile-bottom-nav .mnav-icon.np1645-ico,
body .mobile-bottom-nav .mnav-plus.np1645-ico{
  -webkit-mask-image:none !important;
          mask-image:none !important;
  background-color:transparent !important;
  background:none !important;
  width:auto !important;
  height:auto !important;
  min-width:0 !important;
  flex:0 0 auto !important;
  font-size:0 !important;
  line-height:0 !important;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  color:inherit !important;
  opacity:1 !important;
}
body .mobile-bottom-nav .np1645-ico > svg.np1645-svg{
  display:block;
  width:22px;
  height:22px;
  color:inherit;
  overflow:visible;
}
/* Nut Ban hang o giua noi len, icon to hon mot chut cho can. */
body .mobile-bottom-nav .mnav-sale .np1645-ico > svg.np1645-svg{
  width:24px;
  height:24px;
}


/* =============================================================================
   B. NUT "BO LOC" tren mobile -> nut vuong co icon
   =============================================================================
   Giu nguyen nut, onclick va o dem so dieu kien. Chi an chu va thu thanh o vuong
   cao bang o tim kiem (44px) de hai cai thang hang.
   ============================================================================= */
body.np1645-mobile .np142-invoice-toolbar{
  grid-template-columns:minmax(0,1fr) 44px !important;
  gap:8px !important;
  align-items:center !important;
}
body.np1645-mobile .np142-invoice-toolbar .np142-filter-button{
  width:44px !important;
  min-width:44px !important;
  height:44px !important;
  min-height:44px !important;
  padding:0 !important;
  gap:0 !important;
  font-size:0 !important;      /* an chu "Bộ lọc" — loi ghi thang vao textNode */
  line-height:0 !important;
  border-radius:12px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  position:relative !important;
  overflow:visible !important;
}
body.np1645-mobile .np142-invoice-toolbar .np142-filter-button .np1645-ico{
  font-size:0 !important;
  line-height:0 !important;
  display:inline-flex !important;
}
body.np1645-mobile .np142-invoice-toolbar .np142-filter-button .np1645-ico > svg.np1645-svg{
  display:block;
  width:20px;
  height:20px;
  color:inherit;
}
/* O dem so dieu kien: dua len goc, khong lam nut cao them. */
body.np1645-mobile .np142-invoice-toolbar .np142-filter-button > i{
  position:absolute !important;
  top:-5px !important;
  right:-5px !important;
  min-width:17px !important;
  height:17px !important;
  padding:0 3px !important;
  border-radius:999px !important;
  font-size:10px !important;
  line-height:17px !important;
  font-weight:800 !important;
}
body.np1645-mobile .np142-invoice-toolbar .np142-filter-button > i.hidden{
  display:none !important;
}


/* =============================================================================
   C. NUT DONG trong header gon -> nut tron noi
   =============================================================================
   Vi sao ban 1.64.4 khong an: quy tac cu

       body.np-sales-compact .np-sale-close        (namphuong-app-1.51.0.css:4317)

   co do uu tien (0,2,1), trong khi quy tac moi

       .np1644-head .np-sale-close                 (1.64.4)

   chi (0,2,0). Ca hai deu !important nen quy tac cu thang, keo theo width 62px,
   font-size 11px va chu "✕ Đóng" van hien.

   Khac phuc bang do uu tien, khong sua core: bam vao ca hai class cua patch
   cong voi body —

       body.np1644-compact-head .np1644-head > .np-sale-close   = (0,3,1)

   thang (0,2,1) va cung thang ca body.np-ui-reference .np-sale-close (0,2,1).

   Chu "✕ Đóng" do enhanceSaleCloseButtons cua loi ghi bang textContent
   (namphuong-app-1.54.2.js:9389). Khong sua ham do; an chu bang font-size:0 roi
   ve lai dau ✕ bang ::before. onclick=np13716CloseCurrentSale giu nguyen.
   ============================================================================= */
body.np1644-compact-head .np1644-head > .np-sale-close{
  flex:0 0 auto !important;
  width:36px !important;
  min-width:36px !important;
  max-width:36px !important;
  height:36px !important;
  min-height:36px !important;
  padding:0 !important;
  margin:0 !important;
  display:grid !important;
  place-items:center !important;
  border-radius:999px !important;
  border:1px solid var(--npui-crit-line, #f0b5b5) !important;
  background:var(--npui-crit-weak, #fff4f4) !important;
  color:var(--npui-crit, #b42318) !important;
  box-shadow:0 1px 3px rgba(16,24,40,.10) !important;
  font-size:0 !important;          /* giau chu "✕ Đóng" cua loi */
  line-height:0 !important;
  white-space:nowrap !important;
  grid-column:auto !important;     /* huy grid-column/grid-row cua quy tac cu */
  grid-row:auto !important;
  grid-area:auto !important;
  align-self:center !important;
  overflow:hidden !important;
}
body.np1644-compact-head .np1644-head > .np-sale-close::before{
  content:'✕';
  font-size:15px !important;
  line-height:1 !important;
  font-weight:800 !important;
  color:inherit;
}
body.np1644-compact-head .np1644-head > .np-sale-close:active{
  transform:scale(.94);
  box-shadow:0 1px 2px rgba(16,24,40,.12) !important;
}
/* Quy tac cu con dat grid-template-columns cho ca .np-sale-wizard-head.
   Header gon dung display:block nen khong con anh huong, nhung ghi lai cho ro. */
body.np1644-compact-head .np-sale-wizard-head{
  grid-template-columns:none !important;
}
