/* ===========================================================================
   NamPhuongERP 1.59.0 — Phan tich tien, canh bao offline, chip so luong
   Moi mau lay tu bien --npui-*. Moi selector gioi han trong html.np-ui-reference.
   =========================================================================== */

/* ---------- Dong phan tich tien o man thanh toan ---------- */

html.np-ui-reference .np159-breakdown{
  margin:10px 0 6px;
  padding:10px 12px;
  border:1px solid var(--npui-border);
  border-radius:10px;
  background:var(--npui-surface-2);
}
html.np-ui-reference .np159-breakdown.has-error{
  border-color:var(--npui-crit);
  background:var(--npui-crit-weak);
}

html.np-ui-reference .np159-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
  font-size:12.5px;
  padding:3px 0;
  color:var(--npui-text-2);
}
html.np-ui-reference .np159-row b{
  color:var(--npui-text);
  font-variant-numeric:tabular-nums;
}
html.np-ui-reference .np159-row.main{
  margin-top:4px;
  padding-top:7px;
  border-top:1px solid var(--npui-border);
  font-size:13.5px;
}
html.np-ui-reference .np159-row.main span{color:var(--npui-text)}
html.np-ui-reference .np159-row.main b{font-weight:700}

html.np-ui-reference .np159-verdict{
  margin-top:8px;
  padding:6px 9px;
  border-radius:8px;
  font-size:12.5px;
  font-weight:600;
  line-height:1.4;
}
html.np-ui-reference .np159-verdict.ok  {background:var(--npui-good-weak);color:var(--npui-good)}
html.np-ui-reference .np159-verdict.warn{background:var(--npui-warn-weak);color:var(--npui-warn)}
html.np-ui-reference .np159-verdict.over{background:var(--npui-info-weak);color:var(--npui-text-2)}
html.np-ui-reference .np159-verdict.bad {background:var(--npui-crit-weak);color:var(--npui-crit)}

/* ---------- Bang canh bao mat mang ---------- */

html.np-ui-reference .np159-offline{
  display:block;
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid var(--npui-crit);
  border-radius:10px;
  background:var(--npui-crit-weak);
}
html.np-ui-reference .np159-offline b{
  display:block;
  font-size:13px;
  color:var(--npui-crit);
  margin-bottom:2px;
}
html.np-ui-reference .np159-offline small{
  display:block;
  font-size:11.5px;
  line-height:1.45;
  color:var(--npui-text-2);
}

html.np-ui-reference button.np159-blocked{
  opacity:.55;
  cursor:not-allowed;
  filter:grayscale(.4);
}

/* ---------- Chip so luong nhanh ---------- */

html.np-ui-reference .np159-chips{
  display:flex;
  gap:5px;
  margin-top:5px;
}
html.np-ui-reference .np159-chips button{
  flex:1;
  min-width:0;
  padding:4px 0;
  font-size:12px;
  font-weight:600;
  border-radius:7px;
  border:1px solid var(--npui-border-strong);
  background:var(--npui-surface);
  color:var(--npui-text-2);
  cursor:pointer;
  font-variant-numeric:tabular-nums;
}
html.np-ui-reference .np159-chips button:hover{
  background:var(--npui-hover);
  color:var(--npui-text);
}

/* Tren may tinh ban chip khong can thiet — chi hien tren dien thoai */
@media (min-width:901px){
  html.np-ui-reference .np159-chips{display:none}
}

@media (max-width:380px){
  html.np-ui-reference .np159-row{font-size:12px}
  html.np-ui-reference .np159-chips button{font-size:11px}
}

/* ---------- SUA BO CUC CHIP SO LUONG (anh chup 19:43 ngay 27/08) ----------
   Chip 5/10/20 dang roi xuong mot hang RIENG ben duoi bo nut - 5 +, day o
   Don gia va Thanh tien lech sang phai va bi co lai.
   Nguyen nhan: .np159-chips duoc chen sau .qty-control nhung nam trong cung
   mot <label>, ma label do la mot o cua luoi .item-row.
   Sua: cho label SL chiem dung chieu rong cua no va xep doc gon lai.        */

@media (max-width:900px){
  html.np-ui-reference .item-row .qty-control{width:100%}
  html.np-ui-reference .np159-chips{
    margin-top:4px;
    gap:4px;
  }
  html.np-ui-reference .np159-chips button{
    padding:3px 0;
    font-size:11.5px;
    line-height:1.5;
  }
}
