/* =============================================================================
   NamPhuongERP 1.64.7 C12 — Review Debt Consistency Fix
   =============================================================================
   NAP CUOI CUNG, sau namphuong-ui-sale-step1-1.64.6.css.
   Chi dung toi trinh bay. Khong doi ID/name/data-*. Khong dung toi desktop.

   Pham vi: <=900px, qua class .np1647-mobile do patch gan theo matchMedia.
   Desktop khong co class nay nen tuyet doi khong bi anh huong.
   ============================================================================= */


/* =============================================================================
   0. DESIGN TOKEN — bo sung co namespace, dat tren bo token co san
   =============================================================================
   Khong hard-code mau trang/den cho tung component. Moi thu doc tu day.
   Bien --npui-* la cua he thong san co; --np1647-* la bo sung cua vong nay,
   de vong sau (Chi tiet cong no) dung lai duoc.
   ============================================================================= */
:root{
  /* ---- C8: BANG MAU KHOA CUNG. Moi mau trong file nay phai lay tu day. ---- */
  --np1647-canvas:         #FFFFFF;
  --np1647-surface:        #FFFFFF;
  --np1647-surface-soft:   #F8FAFC;
  --np1647-text-primary:   #111827;
  --np1647-text-secondary: #475467;
  --np1647-text-muted:     #667085;
  --np1647-border-subtle:  #E5E7EB;
  --np1647-border-hair:    #EEF0F3;

  --np1647-primary:        #0B7FA4;
  --np1647-primary-strong: #086C8C;

  --np1647-success:        #16803D;
  --np1647-success-weak:   #F0FDF4;
  --np1647-success-line:   #BBF7D0;

  --np1647-warning:        #9A570C;
  --np1647-warning-weak:   #FFF7ED;
  --np1647-warning-line:   #FED7AA;

  --np1647-danger:         #B42318;
  --np1647-danger-weak:    #FEF3F2;
  --np1647-danger-line:    #FECDCA;

  --np1647-on-primary:     #FFFFFF;

  /* ---- Thang gian cach: chi 6 gia tri, khong rai so ngau nhien ---- */
  --np1647-sp-1: 4px;
  --np1647-sp-2: 6px;
  --np1647-sp-3: 8px;
  --np1647-sp-4: 12px;
  --np1647-sp-5: 16px;
  --np1647-sp-6: 20px;

  /* ---- Thang bo goc ---- */
  --np1647-r-ctrl: 8px;    /* control nho */
  --np1647-r-row:  10px;   /* hang / the thong tin */
  --np1647-r-card: 12px;   /* be mat ngoai cung */

  --np1647-radius:         var(--np1647-r-card);
  --np1647-tap:            44px;
  --np1647-page:           var(--np1647-canvas);
  --np1647-safe-bottom:    env(safe-area-inset-bottom, 0px);
  --np1647-navh:           var(--npui-mobilenav, 66px);
  --np1647-nav-offset:     max(6px, env(safe-area-inset-bottom, 0px));
  --np1647-nav-total:      calc(var(--np1647-navh) + var(--np1647-nav-offset));
}
/* Dark: chi doi gia tri token, khong doi mot dong bo cuc nao ben duoi. */
html[data-theme="dark"]{
  --np1647-canvas:         #0F1720;
  --np1647-surface:        #151E28;
  --np1647-surface-soft:   #1B2632;
  --np1647-text-primary:   #F5F7FA;
  --np1647-text-secondary: #CBD5E1;
  --np1647-text-muted:     #94A3B8;
  --np1647-border-subtle:  #334155;
  --np1647-border-hair:    #26313D;

  --np1647-primary:        #39A3C4;
  --np1647-primary-strong: #5AB8D6;

  --np1647-success:        #5CC98D;
  --np1647-success-weak:   rgba(92,201,141,.12);
  --np1647-success-line:   rgba(92,201,141,.38);

  --np1647-warning:        #E0A462;
  --np1647-warning-weak:   rgba(224,164,98,.12);
  --np1647-warning-line:   rgba(224,164,98,.38);

  --np1647-danger:         #F17C78;
  --np1647-danger-weak:    rgba(241,124,120,.12);
  --np1647-danger-line:    rgba(241,124,120,.38);

  --np1647-on-primary:     #06222C;
  --np1647-page:           var(--np1647-canvas);
}


/* =============================================================================
   1. MAN BAN HANG THEO TUYEN
   ============================================================================= */

/* --- 1a. Header mot hang: [‹]  Tan Lap  [•••] --------------------------------
   Markup san co (namphuong-app-1.54.2.js:15862):
     .np1480-route-toolbar > .np1480-route-title > button.np1480-back + div(small,h3,p)
                           > .np1480-route-actions > 3 nut
   Patch chuyen 3 nut do vao <details> ••• (di chuyen node that, khong clone). */
body.np1647-mobile .np1480-route-toolbar{
  display:flex !important;
  align-items:center;
  gap:8px;
  padding:6px 12px !important;
  margin:0 -10px 8px !important;
  border:0 !important;
  border-bottom:1px solid var(--np1647-border-subtle) !important;
  border-radius:0 !important;
  background:var(--np1647-surface) !important;
  box-shadow:none !important;
  min-height:48px;
}
body.np1647-mobile .np1480-route-title{
  display:flex !important;
  align-items:center;
  gap:6px;
  flex:1 1 auto;
  min-width:0;
}
body.np1647-mobile .np1480-route-title > div{min-width:0; text-align:center; flex:1 1 auto}
/* "Tuyen dang ban" va dong dem duoi tieu de: bo, vi da co khoi thong ke rieng. */
body.np1647-mobile .np1480-route-title small,
body.np1647-mobile .np1480-route-title p{display:none !important}
body.np1647-mobile .np1480-route-title h3{
  margin:0 !important;
  font-size:17px !important;
  font-weight:800 !important;
  line-height:1.25;
  color:var(--np1647-text-primary) !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.np1647-mobile .np1480-back{
  flex:0 0 auto;
  /* C2: 44x44 theo chuan touch target. Header van 48px nen khong cao them. */
  width:var(--np1647-tap) !important; height:var(--np1647-tap) !important;
  min-width:var(--np1647-tap) !important; min-height:var(--np1647-tap) !important;
  padding:0 !important;
  display:grid !important; place-items:center !important;
  font-size:22px !important; line-height:1 !important;
  border:0 !important; background:transparent !important;
  color:var(--np1647-text-primary) !important;
  border-radius:10px !important;
}

/* --- 1b. Menu ••• ----------------------------------------------------------- */
/* C3: namphuong-ui-mobile-sale-1.58.0.css:41 dat overflow-x:auto!important cho
   container nay (hoi do no chua 3 nut cuon ngang). Trong V2 menu ••• la con
   absolute cua chinh container do, nen bi cat mat. Ghi de o day, KHONG sua
   file 1.58. Dung 'html body.np1647-mobile' de chac chan thang (0,2,2) so voi
   'html.np-ui-reference .np1480-route-actions' (0,2,1). */
html body.np1647-mobile .np1480-route-actions{
  flex:0 0 auto !important;
  display:flex !important;
  gap:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible !important;
  overflow-x:visible !important;
  overflow-y:visible !important;
}
/* Toolbar cha cung khong duoc cat dropdown. */
html body.np1647-mobile .np1480-route-toolbar{overflow:visible !important}
.np1647-route-menu{position:relative}
.np1647-route-menu > summary{
  list-style:none;
  width:var(--np1647-tap); height:var(--np1647-tap);
  display:grid; place-items:center;
  border-radius:10px;
  cursor:pointer;
  color:var(--np1647-text-primary);
  font-size:20px; line-height:1; font-weight:800;
}
.np1647-route-menu > summary::-webkit-details-marker{display:none}
.np1647-route-menu > summary::after{content:'•••'; letter-spacing:1px}
.np1647-route-menu > summary:active{background:var(--np1647-surface-soft)}
.np1647-route-menu-body{
  position:absolute;
  top:calc(var(--np1647-tap) + 4px); right:0;
  z-index:60;
  min-width:210px;
  display:flex; flex-direction:column;
  padding:6px;
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-radius);
  background:var(--np1647-surface);
  box-shadow:0 10px 28px rgba(16,24,40,.16);
}
html[data-theme="dark"] .np1647-route-menu-body{box-shadow:0 10px 28px rgba(0,0,0,.5)}
.np1647-route-menu-body > button{
  width:100% !important;
  min-height:var(--np1647-tap) !important;
  margin:0 !important;
  padding:0 12px !important;
  text-align:left !important;
  border:0 !important;
  border-radius:8px !important;
  background:transparent !important;
  color:var(--np1647-text-primary) !important;
  font-size:14px !important;
  font-weight:600 !important;
  box-shadow:none !important;
}
.np1647-route-menu-body > button:active{background:var(--np1647-surface-soft) !important}

/* --- 1c. O tim khach trong tuyen -------------------------------------------- */
body.np1647-mobile .np1480-search-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:8px !important;
  padding:0 2px !important;
  margin:0 0 10px !important;
  border:0 !important; background:none !important; box-shadow:none !important;
}
body.np1647-mobile #np1480RouteSearch{
  min-height:var(--np1647-tap) !important;
  border-radius:var(--np1647-radius) !important;
  border:1px solid var(--np1647-border-subtle) !important;
  background:var(--np1647-surface-soft) !important;
  color:var(--np1647-text-primary) !important;
  font-size:15px !important;
}
body.np1647-mobile #np1480RouteSearch::placeholder{
  color:var(--np1647-text-secondary) !important;
  opacity:.85 !important;                  /* placeholder khong duoc qua mo */
}
body.np1647-mobile .np1480-search-row > button{
  min-height:var(--np1647-tap) !important;
  white-space:nowrap !important;
  border-radius:var(--np1647-radius) !important;
  font-size:13px !important;
}

/* --- 1d. Ba o thong ke ------------------------------------------------------
   Dung CHINH .np1480-filter-tabs: so lieu lay tu routeStatusSummary() cua loi,
   khong hard-code. Bam vao van loc nhu cu — khong mat chuc nang nao. */
body.np1647-mobile .np1480-filter-tabs{
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:8px !important;
  padding:0 2px !important;
  margin:0 0 14px !important;
  border:0 !important; background:none !important;
}
body.np1647-mobile .np1480-filter-tabs > button{
  display:flex !important;
  flex-direction:column-reverse !important;   /* so len tren, nhan xuong duoi */
  align-items:center !important;
  justify-content:center !important;
  gap:2px !important;
  min-height:60px !important;
  padding:8px 4px !important;
  border:1px solid var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-radius) !important;
  background:var(--np1647-surface) !important;
  color:var(--np1647-text-secondary) !important;
  font-size:11px !important;
  font-weight:600 !important;
  line-height:1.2 !important;
  box-shadow:none !important;
}
body.np1647-mobile .np1480-filter-tabs > button > b{
  font-size:22px !important;
  font-weight:800 !important;
  line-height:1.1 !important;
  color:var(--np1647-text-primary) !important;
  font-variant-numeric:tabular-nums;
}
/* C2: doi THU TU HIEN THI ma khong dung toi markup loi.
   Markup loi: [1]=Tat ca  [2]=Chua co don  [3]=Da co don
   Yeu cau hien: Tong khach - Da giao - Chua giao
   Dung 'order' cua grid: giu nguyen onclick/bo loc cua tung nut. */
body.np1647-mobile .np1480-filter-tabs > button:nth-child(1){order:1}
body.np1647-mobile .np1480-filter-tabs > button:nth-child(3){order:2}   /* Da co don */
body.np1647-mobile .np1480-filter-tabs > button:nth-child(2){order:3}   /* Chua co don */

/* Semantic: nut 2 = Chua co don (cam), nut 3 = Da co don (xanh). */
body.np1647-mobile .np1480-filter-tabs > button:nth-child(2){
  background:var(--np1647-warning-weak) !important;
  border-color:var(--np1647-warning-line) !important;
  color:var(--np1647-warning) !important;
}
body.np1647-mobile .np1480-filter-tabs > button:nth-child(2) > b{color:var(--np1647-warning) !important}
body.np1647-mobile .np1480-filter-tabs > button:nth-child(3){
  background:var(--np1647-success-weak) !important;
  border-color:var(--np1647-success-line) !important;
  color:var(--np1647-success) !important;
}
body.np1647-mobile .np1480-filter-tabs > button:nth-child(3) > b{color:var(--np1647-success) !important}
/* Tab dang chon: vien dam hon, khong doi mau nen. */
body.np1647-mobile .np1480-filter-tabs > button.active{
  border-width:2px !important;
  border-color:var(--np1647-primary) !important;
}
body.np1647-mobile .np1480-filter-tabs > button:nth-child(2).active{border-color:var(--np1647-warning) !important}
body.np1647-mobile .np1480-filter-tabs > button:nth-child(3).active{border-color:var(--np1647-success) !important}

/* --- 1e. Danh sach khach: row + divider, khong card ------------------------- */
body.np1647-mobile .np1480-customer-list{
  display:block !important;
  gap:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:1px solid var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-radius) !important;
  overflow:hidden !important;
  background:var(--np1647-surface) !important;
}
body.np1647-mobile .np1480-customer-card{
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  /* background-color day du (khong dung 'background' rut gon) de quy tac
     .np1647-selected ben duoi ghi de duoc dung theo do uu tien. */
  background-color:transparent !important;
  /* Viet day du thay vi rut gon: 'border:0' o tren cong voi 'border-bottom'
     rut gon co var() cho ket qua khong chac chan. Longhand thi ro rang. */
  border-bottom-width:1px !important;
  border-bottom-style:solid !important;
  border-bottom-color:var(--np1647-border-subtle) !important;
}
body.np1647-mobile .np1480-customer-card:last-child{border-bottom-width:0 !important}

/* Nut chinh van la button bao ca row (loi da lam san) -> khong them listener. */
body.np1647-mobile .np1480-customer-main{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:start !important;
  gap:8px !important;
  width:100% !important;
  min-height:var(--np1647-tap) !important;
  padding:11px 12px 4px !important;
  border:0 !important;
  background:transparent !important;
  text-align:left !important;
  box-shadow:none !important;
}
body.np1647-mobile .np1480-order-number{display:none !important}  /* so thu tu: bo cho gon */
body.np1647-mobile .np1480-customer-copy{
  display:block !important;
  min-width:0 !important;
}
body.np1647-mobile .np1480-customer-copy small{display:none !important}  /* ma KH: bo */
body.np1647-mobile .np1480-customer-copy b{
  display:block !important;
  font-size:15px !important;
  font-weight:700 !important;
  line-height:1.3 !important;
  color:var(--np1647-text-primary) !important;
  /* Ten dai duoc xuong 2 dong, khong cat som. */
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  display:-webkit-box !important;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden !important;
}
body.np1647-mobile .np1480-customer-copy em{display:none !important}   /* dia chi: bo */

/* Trang thai ben phai */
body.np1647-mobile .np1480-customer-state{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  gap:1px !important;
  flex:0 0 auto !important;
  text-align:right !important;
}
body.np1647-mobile .np1480-customer-state strong{
  font-size:12px !important;
  font-weight:700 !important;
  line-height:1.3 !important;
}
body.np1647-mobile .np1480-customer-state small{
  font-size:10px !important;
  color:var(--np1647-text-secondary) !important;
}
body.np1647-mobile .np1480-customer-card.pending .np1480-customer-state strong{
  color:var(--np1647-warning) !important;
}
body.np1647-mobile .np1480-customer-card.done .np1480-customer-state strong{
  color:var(--np1647-success) !important;
}
/* Chua giao: bo dong "Cham de ban hang" cho gon; da giao van giu so don. */
body.np1647-mobile .np1480-customer-card.pending .np1480-customer-state small{display:none !important}

/* Hang no / vo */
body.np1647-mobile .np1480-customer-meta{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  gap:4px 10px !important;
  padding:0 12px 11px !important;
  margin:0 !important;
  border:0 !important;
  background:transparent !important;
  font-size:12px !important;
  line-height:1.35 !important;
  color:var(--np1647-text-secondary) !important;
}
body.np1647-mobile .np1480-customer-meta .last{display:none !important}  /* "Lan gan nhat": bo */
body.np1647-mobile .np1480-customer-meta .bad{color:var(--np1647-danger) !important; font-weight:700}
body.np1647-mobile .np1480-customer-meta .credit{color:var(--np1647-primary) !important; font-weight:700}
body.np1647-mobile .np1480-customer-meta .ok{color:var(--np1647-text-secondary) !important}

/* Khach dang duoc chon: nen xanh rat nhat.
   C2: loi KHONG render .selected / data-selected — da kiem customerCard().
   Nen patch gan class hien thi rieng .np1647-selected doc tu
   state.np1480RouteContext.selectedCustomerId (hoac NP_SESSION). */
body.np1647-mobile .np1480-customer-card.np1647-selected{
  /* background-color day du: var() trong thuoc tinh viet tat cho ket qua
     khong chac chan (da gap o border-bottom). */
  background-color:var(--np1647-success-weak) !important;
  box-shadow:inset 3px 0 0 var(--np1647-success);
}

/* --- 1f. Thanh "Tiep theo" sticky ------------------------------------------- */
.np1647-nextbar{display:none}
body.np1647-mobile .np1647-nextbar{
  position:fixed;
  left:0; right:0;
  /* Nam ngay tren nav: chieu cao nav + khoang nav cach day man hinh.
     Chi cong safe-area MOT lan, qua --np1647-nav-offset. */
  bottom:var(--np1647-nav-total);
  box-sizing:border-box;
  z-index:55;
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  min-height:52px;
  padding:0 16px;
  border:0;
  border-top:1px solid var(--np1647-border-subtle);
  background:var(--np1647-surface);
  color:var(--np1647-text-primary);
  font-size:14px;
  font-weight:700;
  text-align:left;
  box-shadow:0 -4px 14px rgba(16,24,40,.08);
}
html[data-theme="dark"] .np1647-nextbar{box-shadow:0 -4px 14px rgba(0,0,0,.45)}
.np1647-nextbar-label{flex:0 0 auto; color:var(--np1647-text-secondary); font-weight:600}
.np1647-nextbar-name{
  flex:1 1 auto; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.np1647-nextbar-chev{flex:0 0 auto; color:var(--np1647-text-secondary); font-size:20px}
.np1647-nextbar:active{background:var(--np1647-surface-soft)}
/* Chua khach cuoi khong bi che. */
body.np1647-mobile.np1647-has-nextbar .np1480-workspace{
  /* Cung mot nguon chieu cao voi thanh o tren -> khong bao gio che row cuoi. */
  padding-bottom:calc(52px + var(--np1647-nav-total) + 12px) !important;
}


/* =============================================================================
   2. MAN THANH TOAN (buoc 3 cua wizard ban hang)
   ============================================================================= */

/* --- 2a. Khoi thong tin khach ----------------------------------------------
   .np158-payment-hero do patch_1_58_0 tao san, da co ten khach + no + vo. */
body.np1647-mobile .np158-payment-hero{
  display:grid !important;
  gap:6px !important;
  padding:12px !important;
  margin:0 0 12px !important;
  border:1px solid var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-radius) !important;
  background:var(--np1647-surface) !important;
}
body.np1647-mobile .np158-payment-hero small{
  font-size:15px !important;
  font-weight:800 !important;
  color:var(--np1647-text-primary) !important;
  line-height:1.3 !important;
}
body.np1647-mobile .np158-payment-hero strong{
  font-size:17px !important;
  font-weight:800 !important;
  color:var(--np1647-text-primary) !important;
}
body.np1647-mobile .np158-payment-hero span{
  font-size:13px !important;
  color:var(--np1647-text-secondary) !important;
}

/* --- 2b. Tom tat don -------------------------------------------------------
   #saleSummary do calcSale() cua loi ve. Giu nguyen chu nghiep vu:
   "Tien hang" / "Tien vo" / "Tong can thanh toan". */
body.np1647-mobile #saleSummary{
  padding:8px 12px !important;
  border:1px solid var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-radius) !important;
  background:var(--np1647-surface) !important;
}
body.np1647-mobile #saleSummary .summary-section{
  font-size:10px !important;
  letter-spacing:.5px;
  color:var(--np1647-text-secondary) !important;
  margin-bottom:4px !important;
}
body.np1647-mobile #saleSummary .summary-row{
  display:flex !important;
  align-items:baseline !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding:4px 0 !important;
  font-size:14px !important;
  font-weight:500 !important;
  color:var(--np1647-text-secondary) !important;
}
body.np1647-mobile #saleSummary .summary-row b{
  font-weight:600 !important;
  color:var(--np1647-text-primary) !important;
  font-variant-numeric:tabular-nums;
}
body.np1647-mobile #saleSummary .summary-row.total{
  margin-top:4px !important;
  padding-top:9px !important;
  border-top:1px solid var(--np1647-border-subtle) !important;
  font-size:15px !important;
  font-weight:800 !important;
  color:var(--np1647-danger) !important;
}
body.np1647-mobile #saleSummary .summary-row.total b{
  font-size:19px !important;
  font-weight:800 !important;
  color:var(--np1647-danger) !important;
}

/* --- 2c. Hinh thuc thanh toan — BAN C5 THU GON MANH -------------------------
   Ban C4 tren may that: moi hinh thuc la mot card cao ~100px, cong them cum
   "Tien mat thuc thu / Chuyen khoan thuc thu" tach roi ben duoi. Tong vung nay
   vuot 500px tren man 390px — phai cuon moi thay het.

   C5: patch gom NUT THAT va O NHAP THAT cua loi vao cung mot hang
   (.np1647-payrow). Bo cuc moi hang:

       [chi bao]  Tien mat du            [ 75.000 ]
       [chi bao]  Chuyen khoan du        [      0 ]
       [chi bao]  Ghi no
       [chi bao]  Khach thanh toan them cong no cu        >

   Chieu cao muc tieu: moi hang 48px, gap 6px.
   4 hang + nhan tieu de ≈ 48*4 + 6*3 + 26 = 236px. Trong khoang 230-270px.

   Van giu nguyen tac C4: chi to sang khi chung minh duoc khop chinh xac preset.
   ------------------------------------------------------------------------- */
body.np1647-mobile .np-payment-presets{
  display:flex !important;
  flex-direction:column !important;
  gap:6px !important;
  margin:0 0 6px !important;
  padding:0 !important;
  border:0 !important;
  background:none !important;
}

/* Hang: vien nam o hang, nut ben trong khong co vien rieng. */
body.np1647-mobile .np1647-payrow{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:48px;
  padding:0 6px 0 0;
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  background-color:var(--np1647-surface);
}

/* Nut that cua loi: chiem phan nhan, nen trong suot, khong vien. */
body.np1647-mobile .np1647-payrow > button{
  flex:1 1 auto !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  min-width:0 !important;
  min-height:48px !important;   /* touch target */
  margin:0 !important;
  padding:0 0 0 12px !important;
  border:0 !important;
  border-radius:var(--np1647-r-row) 0 0 var(--np1647-r-row) !important;
  background:transparent !important;
  background-color:transparent !important;
  box-shadow:none !important;
  text-align:left !important;
  font-size:15px !important;
  font-weight:600 !important;
  line-height:1.25 !important;
  color:var(--np1647-text-primary) !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.np1647-mobile .np1647-payrow > button::before{
  content:'';
  flex:0 0 auto;
  width:18px; height:18px;
  border-radius:999px;
  border:2px solid var(--np1647-border-subtle);
  background:transparent;
}

/* O nhap that cua loi, nam canh nut (KHONG long trong button). */
body.np1647-mobile .np1647-payrow > input{
  flex:0 0 auto !important;
  width:118px !important;
  min-width:118px !important;
  height:40px !important;
  min-height:40px !important;
  margin:0 !important;
  padding:0 10px !important;
  border:1px solid var(--np1647-border-subtle) !important;
  border-radius:8px !important;
  background-color:var(--np1647-surface-soft) !important;
  color:var(--np1647-text-primary) !important;
  font-size:16px !important;      /* >=16px de iOS khong tu phong to trang */
  font-weight:700 !important;
  line-height:1.2 !important;
  text-align:right !important;
  font-variant-numeric:tabular-nums;
}

/* Trang thai khop chinh xac preset: nhan, khong phu mang mau lon. */
body.np1647-mobile .np1647-payrow:has(> button.np1647-on){
  border-color:var(--np1647-success);
  background-color:var(--np1647-success-weak);
}
body.np1647-mobile .np1647-payrow > button.np1647-on{
  color:var(--np1647-success) !important;
  font-weight:700 !important;
}
body.np1647-mobile .np1647-payrow > button.np1647-on::before{
  border-color:var(--np1647-success);
  box-shadow:inset 0 0 0 4px var(--np1647-success);
}
/* Duong lui cho trinh duyet chua ho tro :has() — van co chi bao o cham tron
   va mau chu, chi thieu nen nhat cua ca hang. Khong vo bo cuc. */

/* Cum "Tien mat thuc thu / Chuyen khoan thuc thu" cu: hai o nhap da duoc
   chuyen sang hang tren, chi con nhan chu -> an ca cum. */
body.np1647-mobile .np-payment-card .mobile-two-fields{
  display:none !important;
}

/* Hang thu 4: thu no cu. Dong lai chi cao bang mot hang. */
body.np1647-mobile .np-old-debt-box{
  margin:0 0 6px !important;
  border:1px solid var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-r-row) !important;
  background-color:var(--np1647-surface) !important;
  overflow:hidden !important;
}
body.np1647-mobile .np-old-debt-box > summary{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  min-height:48px !important;
  padding:0 12px !important;
  list-style:none;
  cursor:pointer;
  font-size:15px !important;
  font-weight:600 !important;
  line-height:1.25 !important;
  color:var(--np1647-text-primary) !important;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
body.np1647-mobile .np-old-debt-box > summary::-webkit-details-marker{display:none}
body.np1647-mobile .np-old-debt-box > summary::before{
  content:'';
  flex:0 0 auto;
  width:18px; height:18px;
  border-radius:999px;
  border:2px solid var(--np1647-border-subtle);
}
body.np1647-mobile .np-old-debt-box > summary::after{
  content:'›';
  margin-left:auto;
  font-size:20px;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile .np-old-debt-box.np1647-on{border-color:var(--np1647-success) !important}
body.np1647-mobile .np-old-debt-box.np1647-on > summary::before{
  border-color:var(--np1647-success);
  box-shadow:inset 0 0 0 4px var(--np1647-success);
}
body.np1647-mobile .np-old-debt-box[open] > summary::after{content:'⌄'}
body.np1647-mobile .np-old-debt-box > div{padding:0 12px 10px !important}
body.np1647-mobile .np-old-debt-box .field-help{font-size:12px !important}

/* Nhan nhom + phan mo ta cua the buoc: gon lai, bo dong phu dai dong. */
body.np1647-mobile .np-payment-card{
  padding:12px !important;
  border-radius:12px !important;
  gap:8px !important;
}
body.np1647-mobile .np-payment-card .np-step-icon{display:none !important}
body.np1647-mobile .np-payment-card .np-step-copy b{
  font-size:14px !important;
  font-weight:700 !important;
  color:var(--np1647-text-primary) !important;
}
body.np1647-mobile .np-payment-card .np-step-copy span{display:none !important}

/* --- 2d. Nut Dong don sticky ------------------------------------------------
   #mobileSaveSaleBtn trong .mobile-sale-bar. Nhan chu do patch 1.58 dat
   ("Dong don" o buoc 4). Khong tao handler thu hai — onclick cua loi giu nguyen. */
/* C4: khi DANG BAN HANG, thanh dieu huong duoi bi an han:
       body.np1380-ui.mobile-sales-open .mobile-bottom-nav{display:none!important}
   Nhung shell van kê thanh luu don len bang chieu cao cua nav:
       body.np-ui-reference .mobile-sale-bar{bottom:var(--npui-mobilenav)!important}
   (da do bang phan tich tang CSS o 390px: quy tac shell thang, = 66px)
   Ket qua la mot khe trong 66px duoi CTA vi nav khong con o do nua.

   Chi ghi de trong DUNG trang thai mobile-sales-open. Do uu tien (0,3,1) so voi
   (0,2,1) cua shell nen thang chac. Ngoai trang thai do, thanh luu don van nam
   tren nav nhu cu.

   Safe-area CHI cong mot lan, o padding-bottom ben duoi. Khong cong vao bottom. */
body.np1647-mobile.mobile-sales-open .mobile-sale-bar{
  bottom:0 !important;
}
body.np1647-mobile .mobile-sale-bar{
  /* Vung CTA = 48 + 8 + 8 = 64px cong safe-area, trong khoang 56-64px. */
  padding:8px 12px calc(8px + var(--np1647-safe-bottom)) !important;
  border-top:1px solid var(--np1647-border-subtle) !important;
  background:var(--np1647-surface) !important;
  gap:10px !important;
}
body.np1647-mobile #mobileSaveSaleBtn{
  flex:1 1 auto !important;
  min-height:48px !important;
  border-radius:var(--np1647-radius) !important;
  font-size:16px !important;
  font-weight:800 !important;
  background:var(--np1647-success) !important;
  color:var(--np1647-on-primary) !important;
  border:0 !important;
}
body.np1647-mobile #mobileSaveSaleBtn[disabled],
body.np1647-mobile #mobileSaveSaleBtn.is-loading{
  opacity:.6 !important;                 /* giu nguyen hanh vi disabled cua loi */
}


/* =============================================================================
   3. CHONG TRAN NGANG
   ============================================================================= */
body.np1647-mobile .np1480-workspace,
body.np1647-mobile .np1480-customer-list,
body.np1647-mobile .np-payment-card{
  max-width:100% !important;
  overflow-x:hidden !important;
}


/* =============================================================================
   C6 — VISUAL POLISH
   =============================================================================
   Chi trinh bay. DOM cua C5 giu nguyen tuyet doi: khong move them node nao,
   khong doi cau truc, khong dung toi JS nghiep vu.

   Bon viec:
     1. Bo bot nen xanh-xam va card long nhau
     2. Bot vien
     3. Phan cap font ro rang
     4. Mau co ky luat: xanh la CHI cho trang thai chon/thanh cong,
        cam CHI o dong trang thai no, CTA dung mau thuong hieu
   ============================================================================= */

/* --- 1. Bot card long nhau -------------------------------------------------
   Truoc: .np-payment-card la mot card co vien + nen, ben trong lai la cac hang
   moi hang cung co vien + nen -> hai lop card long nhau, nhin duc va chat.
   Sau: the ngoai trong suot, chi con MOT lop la cac hang. */
/* C7 SUA LOI SCOPE:
   Ban C6 viet ".np-step-card" toan cuc. Da kiem lai ma nguon: lop nay duoc loi
   dung cho BON the khac nhau (namphuong-app-1.54.2.js):
       dong 801  buoc 1 Khach hang
       dong 814  buoc 2 Chon san pham
       dong 825  Giao nhan vo binh (.np-delivery-payment-card)
       dong 834  Khach thanh toan  (.np-payment-card)
   Quy tac cua C6 vi vay da lam phang CA BON, tuc la sua ca nhung buoc dang on
   ma vong nay khong duoc dung toi. Day la loi cua ban C6.

   C7 chi nham DUNG the thanh toan. Ba the con lai tro ve nguyen trang C5. */
body.np1647-mobile .np-payment-card{
  border:0 !important;
  border-radius:0 !important;
  background:none !important;
  background-color:transparent !important;
  box-shadow:none !important;
  padding:0 !important;
}
body.np1647-mobile .np-sale-step[data-step="3"]{
  padding:0 2px !important;
}

/* --- 2. Nhan nhom: nho, chu hoa nhe, khong bold ca man ---------------------- */
body.np1647-mobile .np-payment-card .np-step-copy{
  margin:2px 0 8px !important;
  padding:0 2px !important;
}
body.np1647-mobile .np-payment-card .np-step-copy b{
  font-size:13px !important;
  font-weight:700 !important;
  letter-spacing:.2px;
  color:var(--np1647-text-secondary) !important;
}

/* --- 3. Hang thanh toan: vien mong hon, nen trang sach ---------------------- */
body.np1647-mobile .np1647-payrow,
body.np1647-mobile .np-old-debt-box{
  border-color:var(--np1647-border-subtle) !important;
  background-color:var(--np1647-surface) !important;
  box-shadow:none !important;
}
/* Ten hinh thuc: 15px/600 — khong bold ca man hinh. */
body.np1647-mobile .np1647-payrow > button,
body.np1647-mobile .np-old-debt-box > summary{
  font-size:15px !important;
  font-weight:600 !important;
  color:var(--np1647-text-primary) !important;
}
/* O nhap: nen TRANG, chi phan biet bang vien — bo mang xam. */
body.np1647-mobile .np1647-payrow > input{
  background-color:var(--np1647-surface) !important;
  border-color:var(--np1647-border-subtle) !important;
  color:var(--np1647-text-primary) !important;
  font-weight:700 !important;
}
body.np1647-mobile .np1647-payrow > input:focus{
  border-color:var(--np1647-primary) !important;
  outline:none !important;
}

/* --- 4. Trang thai chon: XANH LA, va chi o day ------------------------------
   Nen xanh rat nhat + vien xanh, khong phu mang dam. */
body.np1647-mobile .np1647-payrow:has(> button.np1647-on){
  border-color:var(--np1647-success) !important;
  background-color:var(--np1647-success-weak) !important;
}
body.np1647-mobile .np1647-payrow:has(> button.np1647-on) > input{
  border-color:var(--np1647-success) !important;
  background-color:var(--np1647-surface) !important;
}

/* --- 5. Tom tat don: bo card, dung duong ke ---------------------------------
   Truoc: mot card nua long trong card. Sau: chi la mot khoi co duong ke tren. */
/* C7: khoi tom tat la khoi DUY NHAT duoc giu card, de tao phan cap:
       cac hang thanh toan = phang
       tom tat              = mot card nhe
       CTA                  = hanh dong chinh
   Ban C6 da lam phang ca khoi nay nen mat phan cap. Tra lai card nhe, dung nen
   trung tinh (surface-soft da bo sac xanh-xam o C6), khong long card, khong
   gradient, khong do bong. */
body.np1647-mobile #saleSummary{
  margin:10px 0 0 !important;
  padding:11px 12px !important;
  /* Viet day du: 'border' rut gon co var() cho ket qua khong chac chan. */
  border-width:1px !important;
  border-style:solid !important;
  border-color:var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-r-row) !important;
  background-color:var(--np1647-surface-soft) !important;
  box-shadow:none !important;
}
body.np1647-mobile #saleSummary .summary-section{display:none !important}
body.np1647-mobile #saleSummary .summary-row{
  font-size:14px !important;
  font-weight:500 !important;
  color:var(--np1647-text-secondary) !important;
}
body.np1647-mobile #saleSummary .summary-row b{
  font-size:14px !important;
  font-weight:600 !important;
  color:var(--np1647-text-primary) !important;
}
body.np1647-mobile #saleSummary .summary-row.total{
  margin-top:6px !important;
  padding-top:8px !important;
  border-top-width:1px !important;
  border-top-style:solid !important;
  border-top-color:var(--np1647-border-hair) !important;
  font-size:15px !important;
  font-weight:700 !important;
  color:var(--np1647-text-primary) !important;
}
body.np1647-mobile #saleSummary .summary-row.total b{
  font-size:18px !important;
  font-weight:800 !important;
  /* C9: DO chi danh cho loi / no / canh bao that. Tong tien can thu cua mot
     don binh thuong khong phai canh bao, nen dung mau chu chinh.
     Trang thai moi la cho noi semantic: "Da thu du" xanh, "Con no" cam. */
  color:var(--np1647-text-primary) !important;
}

/* --- 6. Thong tin khach: bo card, chi con chu ------------------------------- */
body.np1647-mobile .np158-payment-hero{
  padding:0 2px 10px !important;
  margin:0 0 10px !important;
  border:0 !important;
  border-bottom-width:1px !important;
  border-bottom-style:solid !important;
  border-bottom-color:var(--np1647-border-subtle) !important;
  border-radius:0 !important;
  background:none !important;
  background-color:transparent !important;
  gap:3px !important;
}
body.np1647-mobile .np158-payment-hero small{
  font-size:16px !important;
  font-weight:700 !important;
  color:var(--np1647-text-primary) !important;
}
body.np1647-mobile .np158-payment-hero span{
  font-size:13px !important;
  font-weight:500 !important;
  color:var(--np1647-text-secondary) !important;
}
body.np1647-mobile .np158-payment-hero strong{
  font-size:16px !important;
  font-weight:800 !important;
  color:var(--np1647-text-primary) !important;
}

/* --- 7. CAM chi dung o dong trang thai no, khong dung o dau khac ------------
   Truoc C6, o thong ke "Chua co don" phu ca nen cam. Gio chi con chu cam tren
   nen trang, giong "Da giao" chi con chu xanh. Nen mang mau lon bien mat. */
body.np1647-mobile .np1480-filter-tabs > button:nth-child(2),
body.np1647-mobile .np1480-filter-tabs > button:nth-child(3){
  background-color:var(--np1647-surface) !important;
  border-color:var(--np1647-border-subtle) !important;
}
body.np1647-mobile .np1480-filter-tabs > button{
  font-size:11px !important;
  font-weight:600 !important;
  color:var(--np1647-text-secondary) !important;
}

/* --- 8. CTA: mau thuong hieu, khong dung xanh la ---------------------------
   Xanh la da duoc danh RIENG cho trang thai chon/thanh cong. Neu CTA cung xanh
   la thi hai y nghia khac nhau dung chung mot mau. Nut chinh dung mau thuong
   hieu cua he thong (--npui-brand), dung mau ma ban da thay o Preview. */
body.np1647-mobile #mobileSaveSaleBtn{
  background-color:var(--np1647-primary) !important;
  background:var(--np1647-primary) !important;
  color:var(--np1647-on-primary) !important;
  font-size:16px !important;
  font-weight:700 !important;
  box-shadow:none !important;
}
/* Mau chu tren nut chinh do token --np1647-on-primary quyet dinh, da co
   gia tri rieng cho Dark, nen khong can quy tac dark rieng o day nua. */
body.np1647-mobile .mobile-sale-bar{
  border-top-width:1px !important;
  border-top-style:solid !important;
  border-top-color:var(--np1647-border-subtle) !important;
  box-shadow:none !important;
}
body.np1647-mobile .mobile-sale-bar > div > small{
  font-size:12px !important;
  font-weight:500 !important;
  color:var(--np1647-text-secondary) !important;
}
body.np1647-mobile .mobile-sale-bar > div > strong{
  font-size:20px !important;      /* C8: so tien CTA 20/800 */
  font-weight:800 !important;
  color:var(--np1647-text-primary) !important;
}

/* --- 9. Danh sach khach trong tuyen: bot vien, dung duong ke manh ----------- */
body.np1647-mobile .np1480-customer-list{
  border-color:var(--np1647-border-subtle) !important;
}
body.np1647-mobile .np1480-customer-card{
  border-bottom-color:var(--np1647-border-hair) !important;
}
body.np1647-mobile .np1480-customer-copy b{
  font-size:15px !important;
  font-weight:700 !important;
}
body.np1647-mobile .np1480-customer-meta{
  font-size:12px !important;
  font-weight:500 !important;
  color:var(--np1647-text-secondary) !important;
}
/* No: do. Vo: xanh duong. Trang thai chua giao: cam — CHI o chu. */
body.np1647-mobile .np1480-customer-meta .bad{color:var(--np1647-danger) !important}
body.np1647-mobile .np1480-customer-meta .credit{color:var(--np1647-primary) !important}
body.np1647-mobile .np1480-customer-card.pending .np1480-customer-state strong{
  color:var(--np1647-warning) !important;
  font-weight:700 !important;
}
body.np1647-mobile .np1480-customer-card.done .np1480-customer-state strong{
  color:var(--np1647-success) !important;
  font-weight:700 !important;
}

/* --- 10. O tim khach: nen trang, khong mang xam ----------------------------- */
body.np1647-mobile #np1480RouteSearch{
  background-color:var(--np1647-surface) !important;
  border-color:var(--np1647-border-subtle) !important;
}


/* =============================================================================
   C8 — MOBILE VISUAL SYSTEM LOCK
   =============================================================================
   Chi trinh bay. DOM cua C5/C7 giu nguyen tuyet doi.

   SCOPE — SUA LAI O C9:
   Ban C8 ghi ".np-sale-review-page nam NGOAI #saleForm". DIEU DO SAI.
   Da doc lai ma nguon (namphuong-app-1.54.2.js:845):

       <form id="saleForm" class="np-mobile-sale-wizard">
         <section class="np-sale-step active" data-step="1"> ... </section>
         <section class="np-sale-step" data-step="2"> ... </section>
         <section class="np-sale-step" data-step="3"> ... </section>
         <section class="np-sale-step" data-step="4">
           <div id="npSaleReview" class="np-sale-review-page"></div>
         </section>
       </form>

   #saleForm chua CA BON buoc, ke ca man Xem lai don. Vi vay chi dua vao
   #saleForm la KHONG du: cac quy tac chung (typography, label, input) se an
   sang ca buoc 1 Khach hang va buoc 4 Xem lai — hai phan ma vong nay khong
   duoc dung toi.

   C9 doi cach scope:
     - Quy tac CHUNG (np-step-copy, label, input, select, focus) chi ap cho
       .np-sale-step[data-step="2"] va [data-step="3"].
     - Quy tac RIENG cua tung component van giu #saleForm + class component,
       vi cac class do (np13715-*, np159-*, np-quick-products...) chi xuat hien
       o buoc 2/3 chu khong o buoc 1.
   Buoc 1 va buoc 4 tro lai dung nhu C7.

   Do uu tien (1,2,x) nho co #saleForm nen phan lon quy tac KHONG can
   !important — giu ngan sach cua vong nay.

   Thang chu:
     tieu de man    18/700     tieu de muc   15-16/700
     ten san pham   15-16/600  nhan thanh toan 15/600
     nhan truong    13/600     body          14/500
     phu            12-13/500  tien thuong   15-16/700
     tien quan trong 18-20/700 tien CTA      20/800
     trang thai     13-14/600-700
   700/800 CHI danh cho tieu de, tien quan trong, CTA va trang thai.
   ============================================================================= */

/* ---------- 1. Nhip doc chung cua wizard ---------------------------------- */
/* C9: bay gio khoa dung vao buoc 2 va buoc 3.
   Buoc 1 (Khach hang) va buoc 4 (Xem lai don) KHONG bi dung toi. */
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] .np-step-copy b,
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] .np-step-copy b{
  font-size:15px;
  font-weight:700;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] .np-step-copy span,
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] .np-step-copy span{
  font-size:13px;
  font-weight:500;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] label,
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] label{
  font-size:13px;
  font-weight:600;
  color:var(--np1647-text-secondary);
}
/* He o nhap dung chung cho buoc 2 va buoc 3: trang, vien trung tinh, 16/600. */
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] input:not([type="checkbox"]):not([type="radio"]),
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] select,
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] input:not([type="checkbox"]):not([type="radio"]),
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] select{
  background-color:var(--np1647-surface);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-ctrl);
  color:var(--np1647-text-primary);
  /* !important: loi dat font-size cho input bang quy tac co !important
     (do 14.5px) nen quy tac khong danh dau se thua. 16px la nguong de iOS
     khong tu phong to trang khi cham vao o nhap. */
  font-size:16px !important;
  font-weight:600 !important;
  box-shadow:none;
}
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] input:focus,
body.np1647-mobile #saleForm .np-sale-step[data-step="2"] select:focus,
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] input:focus,
body.np1647-mobile #saleForm .np-sale-step[data-step="3"] select:focus{
  border-color:var(--np1647-primary);
  outline:none;
}

/* ---------- 2. Chon san pham --------------------------------------------- */
/* "Sản phẩm nhanh": vo trang, vien nhe, khong mang xanh. */
body.np1647-mobile #saleForm .np-quick-products{
  background-color:var(--np1647-surface);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  box-shadow:none;
  margin-bottom:var(--np1647-sp-4);
}
body.np1647-mobile #saleForm .np-quick-products > summary{
  min-height:var(--np1647-tap);
  padding:0 var(--np1647-sp-4);
  font-size:14px;
  font-weight:600;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .np-quick-products > summary small{
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #saleForm .np-product-shortcuts button{
  background-color:var(--np1647-surface);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-ctrl);
  color:var(--np1647-text-primary);
  font-size:14px;
  font-weight:600 !important;   /* loi dat 700 co !important */
  box-shadow:none;
}

/* "Khách này hay lấy": khong sua chu, chi ha do noi bat. */
body.np1647-mobile #saleForm .np160-head{
  font-size:12px;
  font-weight:600;
  letter-spacing:.2px;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #saleForm .np160-chip{
  background-color:var(--np1647-surface);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-ctrl);
  color:var(--np1647-text-primary);
  font-size:13px;
  font-weight:600;
}
body.np1647-mobile #saleForm .np160-note{
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}

/* The san pham: ten la chinh, "Thanh tien" noi hon "Don gia". */
body.np1647-mobile #saleForm .item-row{
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  background-color:var(--np1647-surface);
  box-shadow:none;
  gap:var(--np1647-sp-3);
}
body.np1647-mobile #saleForm .item-row .item-product{
  font-size:15px !important;    /* loi dat 14.5px co !important */
  font-weight:600;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .qty-preset button{
  background-color:var(--np1647-surface);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-ctrl);
  color:var(--np1647-text-secondary);
  font-size:13px;
  font-weight:600;
  box-shadow:none;
}
body.np1647-mobile #saleForm .qty-step button{
  color:var(--np1647-primary);
  border-color:var(--np1647-border-subtle);
  background-color:var(--np1647-surface);
  font-weight:700;
}
body.np1647-mobile #saleForm .remove-item{
  color:var(--np1647-danger);
  border:1px solid var(--np1647-danger-line);
  background-color:var(--np1647-surface);
  font-weight:600;
  box-shadow:none;
}

/* ---------- 3. Giao nhan vo binh ----------------------------------------- */
/* "Đang tự động" khong phai hanh dong chinh -> dai thong tin nhe. */
body.np1647-mobile #saleForm .bottle-auto-button{
  background-color:var(--np1647-surface-soft);
  border:1px solid var(--np1647-border-hair);
  border-radius:var(--np1647-r-ctrl);
  color:var(--np1647-text-secondary);
  /* !important: loi dat 13px/700 co !important cho nut nay. C8 ha xuong 500
     de no thanh dai thong tin, khong canh tranh voi o nhap ben canh. */
  font-size:13px !important;
  font-weight:500 !important;
  box-shadow:none;
  min-height:36px;
}

/* ---------- 4. Thanh toan ------------------------------------------------- */
/* "Đã nhập tay — app không tự điền nữa": thong tin ho tro, khong phai loi. */
body.np1647-mobile #saleForm .np1532-hint{
  background:none;
  background-color:transparent;
  border:0;
  padding:var(--np1647-sp-1) 2px 0;
  font-size:12px;
  font-weight:500;
  color:var(--np1647-warning);
}
/* Thu no cu: hang neutral, khong nen xanh. */
body.np1647-mobile #saleForm .np-old-debt-box > summary{
  font-size:15px;
  font-weight:600;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .np-old-debt-box > summary::after{
  color:var(--np1647-text-muted);
}

/* Trang thai da thu du / con no: noi semantic ro nhat. */
body.np1647-mobile #saleForm .np159-verdict{
  min-height:38px;
  border-radius:var(--np1647-r-ctrl);
  border:0;
  font-size:14px;
  font-weight:700;
  box-shadow:none;
}
body.np1647-mobile #saleForm .np159-verdict.ok{
  background:var(--np1647-success-weak);
  color:var(--np1647-success);
}
/* Con no thuong la nghiep vu binh thuong -> AMBER, khong phai do. */
body.np1647-mobile #saleForm .np159-verdict.warn,
body.np1647-mobile #saleForm .np159-verdict.bad{
  background:var(--np1647-warning-weak);
  color:var(--np1647-warning);
}
body.np1647-mobile #saleForm .np159-row{
  font-size:14px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #saleForm .np159-row b{
  font-size:15px;
  font-weight:700;
  color:var(--np1647-text-primary);
}

/* ---------- 5. Chi tiet tien / cong no / so du ---------------------------- */
/* Tu "bang bao cao" thanh "danh sach chi tiet kieu app". */
body.np1647-mobile #saleForm .np-payment-breakdown{
  background:none;
  background-color:transparent;
  border:0;
  box-shadow:none;
  margin-top:var(--np1647-sp-4);
}
body.np1647-mobile #saleForm .np-payment-breakdown > summary{
  min-height:var(--np1647-tap);
  padding:0 2px;
  font-size:14px;
  font-weight:700;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .np13715-accounting-card{
  background:none;
  background-color:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
}
/* Tieu de phu dang IN HOA: giu nguyen chu, chi ha kich thuoc. */
body.np1647-mobile #saleForm .np13715-accounting-title b{
  font-size:12px;
  font-weight:700;
  letter-spacing:.3px;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #saleForm .np13715-accounting-title span{
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}
/* Dong du lieu: nhan lui, so noi. Duong ke lien mot net thay cho net dut. */
body.np1647-mobile #saleForm .np13715-history-row,
body.np1647-mobile #saleForm .np13715-payment-allocation > div{
  border-bottom-style:solid;
  border-bottom-width:1px;
  border-bottom-color:var(--np1647-border-hair);
  font-size:14px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #saleForm .np13715-history-row b,
body.np1647-mobile #saleForm .np13715-payment-allocation b{
  font-size:15px;
  font-weight:700;
  color:var(--np1647-text-primary);
}
/* Tong: bo nen chuyen sac va mau do — day khong phai canh bao. */
body.np1647-mobile #saleForm .np13715-grand-total{
  background:var(--np1647-surface-soft);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  box-shadow:none;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .np13715-grand-total b{
  font-size:18px;
  font-weight:800;
  color:var(--np1647-text-primary);
}

/* ---------- 6. Bo net dut trong vung thao tac ----------------------------- */
body.np1647-mobile #saleForm [style*="dashed"],
body.np1647-mobile #saleForm [style*="dotted"]{
  border-style:solid;
  border-color:var(--np1647-border-hair);
}

/* ---------- 7. Ghi chu giao hang ------------------------------------------ */
body.np1647-mobile #saleForm .np-optional-note{
  background-color:var(--np1647-surface);
  border:1px solid var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  box-shadow:none;
}
body.np1647-mobile #saleForm .np-optional-note > summary{
  min-height:var(--np1647-tap);
  padding:0 var(--np1647-sp-4);
  font-size:14px;
  font-weight:600;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #saleForm .np-optional-note > summary small{
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}

/* ---------- 8. Thanh CTA duoi cung ---------------------------------------- */
body.np1647-mobile .mobile-sale-bar > div > small{
  font-size:13px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile .mobile-sale-bar > div > strong{
  font-size:20px;
  font-weight:800;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #npMobileSaleBackBtn{
  background-color:var(--np1647-surface);
  /* Viet day du + !important: loi dat 'border' rut gon co !important. */
  border-width:1px !important;
  border-style:solid !important;
  border-color:var(--np1647-border-subtle) !important;
  border-radius:var(--np1647-r-ctrl);
  color:var(--np1647-text-secondary);
  box-shadow:none;
}


/* =============================================================================
   C10 — REVIEW SHEET (buoc 4)
   =============================================================================
   Chi trinh bay. Du lieu, cong thuc, luong gui duyet giu nguyen.

   Scope: body.np1647-mobile #npSaleReview ...
   #npSaleReview la ID rieng cua buoc 4 (namphuong-app-1.54.2.js:846) nen khong
   the ro sang buoc 1/2/3 — khac han cach dung #saleForm chung o C8.

   Muc tieu: doc nhu mot phieu kiem don, khong phai chuoi card noi tiep.
   Trinh tu doc: khach -> san pham -> vo -> thanh toan -> canh bao -> xac nhan.
   ============================================================================= */

/* --- 1. Vo ngoai: mot to phieu, khong phai nhieu card ---------------------- */
body.np1647-mobile #npSaleReview{
  display:flex;
  flex-direction:column;
  gap:0;
  padding:0 2px;
}
/* Moi section thanh mot nhom, phan cach bang duong ke manh thay vi vien card. */
body.np1647-mobile #npSaleReview > section,
body.np1647-mobile #npSaleReview > div{
  border:0;
  border-radius:0;
  background:none;
  background-color:transparent;
  box-shadow:none;
  margin:0;
  padding:var(--np1647-sp-4) 0;
  border-bottom-width:1px;
  border-bottom-style:solid;
  border-bottom-color:var(--np1647-border-hair);
}
body.np1647-mobile #npSaleReview > *:last-child{border-bottom-width:0}

/* --- 2. Thu tu doc: canh bao xuong gan cuoi, ngay truoc dong nhac ----------
   Loi ve .np-critical-notice o vi tri thu 2 (ngay sau khach hang). Phieu kiem
   don thi canh bao nen nam sau phan tien, truoc nut xac nhan. Doi bang 'order'
   cua flex — KHONG dong vao DOM. */
body.np1647-mobile #npSaleReview > .np-review-customer{order:1}
body.np1647-mobile #npSaleReview > .np1450-review-trip{order:2}
body.np1647-mobile #npSaleReview > .np-review-block{order:3}
body.np1647-mobile #npSaleReview > .np-review-grid{order:4}
body.np1647-mobile #npSaleReview > .np-review-total{order:5}
body.np1647-mobile #npSaleReview > .np1647-acc-fold{order:6}
body.np1647-mobile #npSaleReview > .np1647-qr-fold{order:7}
body.np1647-mobile #npSaleReview > .debt-alert{order:8}
body.np1647-mobile #npSaleReview > .np-critical-notice{order:9}
body.np1647-mobile #npSaleReview > .np-review-note{order:10}
body.np1647-mobile #npSaleReview > .np-review-reminder{order:11}

/* --- 3. Khach hang: ten la thu doc dau tien ------------------------------- */
body.np1647-mobile #npSaleReview .np-review-customer{
  display:flex;
  flex-wrap:wrap;
  gap:var(--np1647-sp-1) var(--np1647-sp-5);
}
body.np1647-mobile #npSaleReview .np-review-customer small{
  display:block;
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #npSaleReview .np-review-customer b{
  font-size:16px;
  font-weight:700;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #npSaleReview .np-review-customer span{
  font-size:13px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-review-creator b{
  font-size:13px;
  font-weight:600;
  color:var(--np1647-text-secondary);
}

/* --- 4. San pham: bang ke, khong phai card tung mon ----------------------- */
body.np1647-mobile #npSaleReview .np-review-heading{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom:var(--np1647-sp-3);
}
body.np1647-mobile #npSaleReview .np-review-heading b{
  font-size:13px;
  font-weight:700;
  letter-spacing:.3px;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-review-heading span{
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #npSaleReview .np-review-item{
  display:flex;
  align-items:baseline;
  gap:var(--np1647-sp-3);
  padding:var(--np1647-sp-2) 0;
  border:0;
  border-radius:0;
  background:none;
  background-color:transparent;
  box-shadow:none;
  border-bottom-width:1px;
  border-bottom-style:solid;
  border-bottom-color:var(--np1647-border-hair);
}
body.np1647-mobile #npSaleReview .np-review-item:last-child{border-bottom-width:0}
body.np1647-mobile #npSaleReview .np-review-item > span{      /* so thu tu */
  flex:0 0 auto;
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
  min-width:14px;
}
body.np1647-mobile #npSaleReview .np-review-item > div{flex:1 1 auto; min-width:0}
body.np1647-mobile #npSaleReview .np-review-item b{
  display:block;
  font-size:15px;
  font-weight:600;
  line-height:1.3;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #npSaleReview .np-review-item small{      /* SL x don gia */
  display:block;
  font-size:13px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-review-item strong{      /* thanh tien */
  flex:0 0 auto;
  font-size:15px;
  font-weight:700;
  color:var(--np1647-text-primary);
  font-variant-numeric:tabular-nums;
  text-align:right;
}

/* --- 5. Tien: bang tong ket, cac dong deu nhau ---------------------------- */
body.np1647-mobile #npSaleReview .np-review-grid{
  display:flex;
  flex-direction:column;
  gap:0;
}
body.np1647-mobile #npSaleReview .np-review-grid > div{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--np1647-sp-4);
  padding:var(--np1647-sp-2) 0;
  border:0;
  background:none;
  background-color:transparent;
}
body.np1647-mobile #npSaleReview .np-review-grid span{
  font-size:14px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-review-grid b{
  font-size:15px;
  font-weight:700;
  color:var(--np1647-text-primary);
  font-variant-numeric:tabular-nums;
}
/* Tong cong: dong noi bat nhat cua phan tien, nhung KHONG do. */
body.np1647-mobile #npSaleReview .np-review-total{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--np1647-sp-4);
  background-color:var(--np1647-surface-soft);
  border-width:1px;
  border-style:solid;
  border-color:var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  padding:var(--np1647-sp-4);
  margin:var(--np1647-sp-2) 0;
}
body.np1647-mobile #npSaleReview .np-review-total span{
  font-size:13px;
  font-weight:700;
  letter-spacing:.3px;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-review-total strong{
  font-size:20px;
  font-weight:800;
  color:var(--np1647-text-primary);
  font-variant-numeric:tabular-nums;
}

/* --- 6. Hai khoi dong san ------------------------------------------------- */
body.np1647-mobile #npSaleReview .np1647-qr-fold,
body.np1647-mobile #npSaleReview .np1647-acc-fold{
  border-bottom-width:1px;
  border-bottom-style:solid;
  border-bottom-color:var(--np1647-border-hair);
}
body.np1647-mobile #npSaleReview .np1647-qr-fold > summary,
body.np1647-mobile #npSaleReview .np1647-acc-fold > summary{
  display:flex;
  align-items:center;
  min-height:var(--np1647-tap);
  padding:0 2px;
  list-style:none;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #npSaleReview summary::-webkit-details-marker{display:none}
body.np1647-mobile #npSaleReview .np1647-qr-fold > summary::after,
body.np1647-mobile #npSaleReview .np1647-acc-fold > summary::after{
  content:'›';
  margin-left:auto;
  font-size:20px;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #npSaleReview .np1647-qr-fold[open] > summary::after,
body.np1647-mobile #npSaleReview .np1647-acc-fold[open] > summary::after{content:'⌄'}
/* Khoi QR khi bung: bo card long, anh vua phai. */
body.np1647-mobile #npSaleReview .np-payment-qr-review{
  border:0;
  background:none;
  background-color:transparent;
  box-shadow:none;
  padding:0 0 var(--np1647-sp-4);
}
body.np1647-mobile #npSaleReview .np-payment-qr-image{max-width:190px; height:auto}
/* Chi tiet ke toan khi bung: danh sach, khong phai bao cao nhieu hop. */
body.np1647-mobile #npSaleReview .np13715-review-accounting{
  display:flex;
  flex-direction:column;
  gap:0;
  border:0;
  background:none;
  background-color:transparent;
  box-shadow:none;
  padding:0 0 var(--np1647-sp-3);
}
body.np1647-mobile #npSaleReview .np13715-review-accounting > div{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--np1647-sp-4);
  padding:var(--np1647-sp-2) 0;
  border-bottom-width:1px;
  border-bottom-style:solid;
  border-bottom-color:var(--np1647-border-hair);
  font-size:14px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np13715-review-accounting > div:last-child{border-bottom-width:0}
body.np1647-mobile #npSaleReview .np13715-review-accounting b,
body.np1647-mobile #npSaleReview .np13715-review-accounting strong{
  font-size:15px;
  font-weight:700;
  color:var(--np1647-text-primary);
  font-variant-numeric:tabular-nums;
}

/* --- 7. Canh bao: MOT khoi duy nhat, mau amber ---------------------------- */
body.np1647-mobile #npSaleReview .np-critical-notice{
  background-color:var(--np1647-warning-weak);
  border-width:1px;
  border-style:solid;
  border-color:var(--np1647-warning-line);
  border-radius:var(--np1647-r-row);
  padding:var(--np1647-sp-4);
  margin:var(--np1647-sp-2) 0;
  box-shadow:none;
}
body.np1647-mobile #npSaleReview .np-critical-title{
  font-size:13px;
  font-weight:700;
  letter-spacing:.2px;
  color:var(--np1647-warning);
  margin-bottom:var(--np1647-sp-2);
}
body.np1647-mobile #npSaleReview .np-critical-grid{
  display:flex;
  flex-direction:column;
  gap:var(--np1647-sp-2);
}
body.np1647-mobile #npSaleReview .np-alert-chip{
  display:flex;
  align-items:center;
  gap:var(--np1647-sp-2);
  background:none;
  background-color:transparent;
  border:0;
  padding:0;
  box-shadow:none;
}
body.np1647-mobile #npSaleReview .np-alert-chip small{
  font-size:13px;
  font-weight:500;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-alert-chip strong{
  font-size:15px;
  font-weight:700;
  color:var(--np1647-warning);
  font-variant-numeric:tabular-nums;
}
/* "Nam Phuong no KH" la trang thai nguoc chieu -> giu neutral, khong canh bao. */
body.np1647-mobile #npSaleReview .np-alert-chip.business-owes strong,
body.np1647-mobile #npSaleReview .np-alert-chip.clear strong{
  color:var(--np1647-text-primary);
}

/* --- 8. Ghi chu + dong nhac cuoi ------------------------------------------ */
body.np1647-mobile #npSaleReview .np-review-note b{
  font-size:13px;
  font-weight:700;
  color:var(--np1647-text-secondary);
}
body.np1647-mobile #npSaleReview .np-review-note p{
  margin:var(--np1647-sp-1) 0 0;
  font-size:14px;
  font-weight:500;
  color:var(--np1647-text-primary);
}
body.np1647-mobile #npSaleReview .np-review-reminder{
  font-size:12px;
  font-weight:500;
  color:var(--np1647-text-muted);
}
body.np1647-mobile #npSaleReview .debt-alert{
  background-color:var(--np1647-surface-soft);
  border-width:1px;
  border-style:solid;
  border-color:var(--np1647-border-subtle);
  border-radius:var(--np1647-r-row);
  padding:var(--np1647-sp-3) var(--np1647-sp-4);
  font-size:13px;
  font-weight:500;
  color:var(--np1647-text-secondary);
  box-shadow:none;
}


/* --- C11: an canh bao no khi sau giao dich khong con no ---------------------
   Chi hai quy tac hien/an. Bo cuc phieu kiem don cua C10 giu nguyen. */
body.np1647-mobile #npSaleReview .np-critical-grid > .np1647-debt-hidden{display:none}
body.np1647-mobile #npSaleReview .np-critical-notice.np1647-notice-hidden{display:none}
