/* =========================================================
   SAM UI STANDARD V1 — 2026-11-26
   Một font, một thang chữ, nút/bảng thống nhất cho mọi trang.
   Chỉ trình bày giao diện; không đổi nghiệp vụ.
   ========================================================= */

:root{
  --sam-font:'Segoe UI',-apple-system,BlinkMacSystemFont,system-ui,Roboto,'Helvetica Neue',Arial,sans-serif;
  --sam-brown:#4a2a1a; --sam-brown-dark:#2f2017; --sam-line:#e6d9cf;
  --sam-fs-title:22px; --sam-fs-h2:17px; --sam-fs-h3:15px;
  --sam-fs-body:14px; --sam-fs-table:13px; --sam-fs-th:12px; --sam-fs-btn:13px; --sam-fs-small:12px;
}

@media screen{
  /* 1. Một font duy nhất */
  html,body,body *:not(code):not(pre):not(kbd):not(samp):not(.mono):not([class*="barcode"]):not(svg):not(svg *){
    font-family:var(--sam-font)!important;
  }
  body{font-size:var(--sam-fs-body);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;letter-spacing:0}

  /* 2. Tiêu đề trang thống nhất */
  .main .content h1, .main h1, .samv3-pagehead h1{font-size:var(--sam-fs-title)!important;font-weight:700!important;line-height:1.25!important;letter-spacing:-.2px}
  .main .content h2{font-size:var(--sam-fs-h2)!important;font-weight:700!important}
  .main .content h3{font-size:var(--sam-fs-h3)!important;font-weight:650!important}

  /* 3. Bảng: chữ 13px, tiêu đề cột 12px đậm, số canh phải */
  .main table:not(.sam-print-only) th{font-size:var(--sam-fs-th)!important;font-weight:650!important;letter-spacing:.1px;line-height:1.35!important}
  .main table:not(.sam-print-only) td{font-size:var(--sam-fs-table)!important;line-height:1.45!important}
  .main table td.num,.main table td.sam-col-number,.main table th.num{text-align:right;font-variant-numeric:tabular-nums}
  .main table td{font-variant-numeric:tabular-nums}

  /* 3b. Trong bảng: chữ con theo cỡ chữ của ô (13px), chữ dài tự xuống dòng thay vì đè sang ô bên */
  .main table:not(.sam-print-only) td *:not(svg):not(svg *):not(img):not(button):not(.btn):not(input):not(select):not([class*="badge"]):not([class*="dot"]):not([class*="pill"]){font-size:inherit!important}
  .main table:not(.sam-print-only) td{overflow-wrap:anywhere}
  .main table:not(.sam-print-only) td .sam-sku-internal,.main table:not(.sam-print-only) td small,.main table:not(.sam-print-only) td .meta{font-size:12px!important;opacity:.85}

  .main table:not(.sam-print-only) td .btn,.main table:not(.sam-print-only) td button,.main table:not(.sam-print-only) td a.btn{font-size:12px!important;min-height:30px}

  /* 4. Nút: cùng cỡ chữ, cùng bo góc */
  .main .btn,.main button:not(.sam-bill-plus-822g):not([class*="close"]):not([class*="plus"]):not(.sam-mob-menu-btn),
  .main input[type=submit],.main input[type=button]{
    font-size:var(--sam-fs-btn)!important;font-weight:650!important;letter-spacing:.1px;border-radius:9px
  }
  .main .btn{min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px}

  /* 5. Ô nhập & nhãn */
  .main input:not([type=checkbox]):not([type=radio]),.main select,.main textarea{font-size:14px}
  .main label,.main .field>label{font-size:var(--sam-fs-small)!important;font-weight:600}

  /* 6. Menu trái (desktop) đồng đều */
  .side .navitem-label,.side .navitem-main{font-size:13px!important;font-weight:550}
  .side .navitem-label{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.25!important}
  .side .navtitle{font-size:11.5px!important;letter-spacing:.6px;font-weight:700}

  /* 7. Thanh danh mục: mục đang chọn luôn đọc được */
  .category-tabs a.active,.samv3-cat.active,a.samv3-cat.active{color:#fff!important}
  .category-tabs a,.samv3-cat{font-size:13px!important}

  /* 8. Thẻ sản phẩm POS desktop: chữ phụ rõ hơn, bớt khoảng trống */
  .product-card .meta,.product-card small{font-size:12px!important}
  .product-card.modern.compact{min-height:0!important}

  /* 9. Bảng rộng: luôn có khung cuộn ngang */
  .sam-ui-scroll-x{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  .sam-ui-scroll-x>table{min-width:100%}

  /* 10. Ảnh hỏng: ẩn gọn */
  img.sam-ui-img-broken{visibility:hidden}
}

/* ================= MOBILE (≤ 820px) ================= */
@media screen and (max-width:820px){
  /* Header: chuông và MENU không bao giờ chồng nhau */
  html body header.top.sam-bell-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto 42px auto!important;column-gap:5px!important;align-items:center!important}
  html body header.top.sam-bell-header>#samNet{grid-column:2!important;grid-row:1!important}
  html body header.top.sam-bell-header>a.sam-bell-v2{grid-column:3!important;grid-row:1!important;justify-self:center!important}
  html body header.top.sam-bell-header>#samMobMenuV2{grid-column:4!important;grid-row:1!important;justify-self:end!important;min-width:50px!important;width:auto!important;white-space:nowrap!important;overflow:visible!important}
  /* Ô chọn quầy: luôn hiện đủ tên quầy (LITTLE DANANG) */
  html body header.top.sam-bell-header .stallbanner{width:auto!important;max-width:132px!important;flex:1 1 auto!important;min-width:0!important;overflow:hidden!important}
  html body header.top.sam-bell-header .stallbanner select{width:100%!important;min-width:0!important;max-width:132px!important;padding-left:6px!important;padding-right:16px!important;font-size:10px!important;letter-spacing:0!important;font-weight:700!important;text-overflow:clip!important;background-position:right 5px center!important}
  html body header.top.sam-bell-header>div:first-child{flex-wrap:nowrap!important;min-width:0!important}
  /* nội dung cuối trang không bị thanh Giỏ hàng che */
  .samv3-pos{padding-bottom:96px!important}

  .main .content h1,.samv3-pagehead h1{font-size:21px!important}

  /* Vùng bấm đủ lớn cho ngón tay (≥ 40px) */
  .main .btn,.main input[type=submit]{min-height:42px!important}
  .samv3-bills button,#samBillTabs822m button{height:40px!important;min-height:40px!important;font-size:13px!important;padding:0 12px!important}
  .samv3-bills .sam-bill-close-822g{padding:0 12px!important}
  .samv3-cat{min-height:38px!important;display:inline-flex!important;align-items:center}
  .samv3-pos .product-card button,.samv3-pos [class*="add"],.pos-products .product-card button{min-width:36px;min-height:36px}

  /* Bảng trên điện thoại */
  .main table:not(.sam-print-only) td{font-size:13px!important}
  .main table:not(.sam-print-only) th{font-size:12px!important}
}

/* NVL: nếu trang không có danh sách thẻ mobile thì không được ẩn bảng */
@media screen{
  .content:not(:has(.sam-mobile-ingredient-wrap)) .ingredient-fit{display:block!important}
}

/* ================= V1.2 — rà soát 26/11 (chữ dính, tràn khung, ô lệch) ================= */
@media screen{
  /* Nhãn "Tổng sản phẩm: 404" không dính chữ */
  .main .pill>b,.main .pill>strong,.main .badge>b,.main .chip>b,.main .pill>span:not(:first-child){margin-left:.35em}
  .main .pill{white-space:nowrap}

  /* Hàng lọc/công cụ bị tràn: tự xuống dòng gọn gàng (JS gắn lớp sam-ui-wrap khi tràn) */
  html body .main .sam-ui-wrap.sam-ui-wrap,html body .main form.sam-ui-wrap.sam-ui-wrap{display:flex!important;flex-wrap:wrap!important;gap:10px 12px!important;align-items:flex-end!important;grid-template-columns:none!important}
  html body .main .sam-ui-wrap.sam-ui-wrap>*{flex:1 1 150px;min-width:0!important;max-width:100%!important;width:auto!important}
  html body .main .sam-ui-wrap.sam-ui-wrap>.btn,html body .main .sam-ui-wrap.sam-ui-wrap>.field:has(>button:only-child),.main .sam-ui-wrap>button,.main .sam-ui-wrap>a.btn,.main .sam-ui-wrap>input[type=submit],.main .sam-ui-wrap>[class*="actions"]{flex:0 0 auto!important}
  .main .sam-ui-wrap>[class*="actions"]{display:flex!important;gap:8px!important;grid-template-columns:none!important;width:auto!important}

  /* Ô nhập, ô chọn, nút trong cùng một hàng cao bằng nhau: 40px */
  .main form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not(table *):not(.cart *):not(.pos-real-split *):not(.samv3-pos *),
  .main form select:not(table *):not(.cart *):not(.pos-real-split *):not(.samv3-pos *),
  .main form .btn:not(table *):not(.cart *):not(.pos-real-split *):not(.samv3-pos *),.main form button:not(table *):not(.cart *):not(.pos-real-split *):not(.samv3-pos *):not(.sam-bill-open-822g):not(.sam-bill-close-822g):not(.sam-bill-plus-822g):not(.sam-bill-held-822g),
  .main .toolbar>.btn,.main .toolbar>a.btn,.main .toolbar>label.btn{height:40px!important;min-height:40px!important;box-sizing:border-box!important}
  .main .qtybox,.main [class*="stepper"]:not(table *){height:40px!important;min-height:40px!important;box-sizing:border-box!important;overflow:hidden}
  .main .qtybox>*,.main [class*="stepper"]:not(table *)>*{height:100%!important;min-height:0!important}

  /* Cột thao tác trong bảng: nút không bao giờ tràn khỏi ô */
  .main td [class*="actions"]{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;grid-template-columns:none!important;max-width:none!important;width:auto!important;justify-content:flex-end}
  .main td [class*="actions"] .btn,.main td [class*="actions"] button{width:auto!important;min-width:0!important;padding-left:10px!important;padding-right:10px!important;white-space:nowrap!important}
  .main td:has(>[class*="actions"]),.main td:has(>form>button),.main td:has(>.btn){white-space:nowrap;width:1%}

  /* Bảng nào thiếu viền thì có khung viền bo góc (JS gắn lớp) */
  .main table.sam-ui-table-frame{border:1px solid #e6d9cf!important;border-radius:10px;border-collapse:separate!important;border-spacing:0!important;overflow:hidden;background:#fff}
  .main table.sam-ui-table-frame>thead th{border-bottom:1px solid #e6d9cf}
  .main table.sam-ui-table-frame>tbody>tr>td{border-top:1px solid #f1e8e1}
}
@media screen and (max-width:820px){
  .main .ingredient-fit{max-width:100%}
}

@media screen{
  /* Tiêu đề cột không bị cắt chữ */
  .main table th{white-space:normal!important;text-overflow:clip!important;overflow:visible!important;overflow-wrap:normal!important;word-break:normal!important}
}
@media screen{
  .main .sam-ui-wrap .qtybox{width:100%!important;grid-template-columns:36px minmax(0,1fr) 36px!important}
  .main table th>*{white-space:normal!important;text-overflow:clip!important;overflow:visible!important}
}
@media screen{
  /* Bảng NVL (máy tính): độ rộng cột cân đối, đủ chỗ cho Giá vốn BQ và 2 nút thao tác */
  .main table.sam-nvl-list th:nth-child(1){width:10%!important}
  .main table.sam-nvl-list th:nth-child(2){width:21%!important}
  .main table.sam-nvl-list th:nth-child(3){width:14%!important}
  .main table.sam-nvl-list th:nth-child(4){width:8%!important}
  .main table.sam-nvl-list th:nth-child(5){width:10%!important}
  .main table.sam-nvl-list th:nth-child(6){width:11%!important}
  .main table.sam-nvl-list th:nth-child(7){width:9%!important}
  .main table.sam-nvl-list th:nth-child(8){width:17%!important;text-align:right}
  .main table.sam-nvl-list td [class*="actions"] .btn,.main table.sam-nvl-list td [class*="actions"] button{font-size:12px!important;padding:0 9px!important;min-height:30px!important;height:30px!important}
}

/* ===== V1.2.1 REDESIGN: GÁN NCC CHO SẢN PHẨM ===== */
html body .smv2-list{display:grid;gap:12px}
html body .smv2-card{border:1px solid #e6ded6!important;border-left:4px solid #28734e!important;border-radius:12px!important;background:#fff!important;overflow:hidden;box-shadow:0 1px 2px rgba(40,25,15,.04)}
html body .smv2-card.sam-sm-unmapped{border-left-color:#c27a2c!important}
html body .smv2-card .smv2-head{display:grid!important;grid-template-columns:44px minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;padding:10px 14px!important;background:#faf8f6!important;border-bottom:1px solid #eee7e0!important}
html body .smv2-card .smv2-thumb-wrap,html body .smv2-card .smv2-thumb{width:44px!important;height:44px!important;grid-row:1/3!important;grid-column:1!important}
html body .smv2-card .smv2-code{grid-column:2!important;grid-row:1!important;font-size:12px!important;font-weight:700!important;color:#8a5a35!important;padding:0!important;background:none!important;border:0!important;line-height:1.3}
html body .smv2-card .smv2-product{grid-column:2!important;grid-row:2!important;font-size:15px!important;font-weight:650!important;line-height:1.35!important;color:#211b17}
html body .smv2-card .smv2-stall{grid-column:3!important;grid-row:1/3!important;display:flex;gap:6px;align-items:center;font-size:12px!important}
html body .smv2-card .sam-sm-badge{display:inline-block;font-size:12px;font-weight:650;padding:3px 9px;border-radius:999px;background:#e7f3ec;color:#28734e;white-space:nowrap}
html body .smv2-card.sam-sm-unmapped .sam-sm-badge{background:#fbefe2;color:#a4601c}
html body .smv2-card .smv2-title{font-size:12px!important;font-weight:700!important;color:#786b62!important;text-transform:uppercase!important;letter-spacing:.03em!important;margin:0 0 8px!important}
html body .smv2-card .smv2-left>.smv2-title+div:not(.smv2-supplier-row){font-size:13px;color:#a4601c}
html body .smv2-card .smv2-supplier-row{border:1px solid #eee7e0!important;border-radius:10px!important;padding:8px 10px!important;margin-bottom:6px!important;background:#fff}
html body .smv2-card .smv2-supplier-name{font-size:13px!important;font-weight:600!important}
html body .smv2-card .smv2-supplier-top{display:flex;gap:6px;align-items:center;margin-bottom:2px;font-size:12px}
html body .smv2-card .smv2-unmap{min-height:32px!important;height:32px!important;padding:0 12px!important;font-size:12px!important}
html body .smv2-card .smv2-add{border-top:0!important;margin-top:6px!important;padding-top:0!important}
html body .smv2-card .smv2-add summary{display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:13px!important;font-weight:650;color:#6f4023;padding:6px 10px;border:1px dashed #d8c9bb;border-radius:8px;list-style:none}
html body .smv2-card .smv2-add summary::-webkit-details-marker{display:none}
html body .smv2-card .smv2-add[open] summary{margin-bottom:8px}
html body .smv2-card .smv2-add-form{background:#faf8f6;border:1px solid #eee7e0;border-radius:10px}
html body .smv2-card .smv2-field label{display:block;font-size:12px!important;font-weight:650!important;color:#786b62!important;margin:0 0 4px!important;text-transform:none!important}
html body .smv2-card .smv2-save{display:flex;align-items:flex-end}
html body .smv2-card .smv2-save .btn{min-width:0!important;padding-left:6px!important;padding-right:6px!important;width:100%!important;height:40px!important;min-height:40px!important}
@media(min-width:1100px){
  html body .smv2-card .smv2-body{display:grid!important;grid-template-columns:minmax(260px,34%) minmax(0,1fr)!important;gap:0!important;padding:0!important}
  html body .smv2-card .smv2-left{padding:14px 16px!important;margin:0!important;border-bottom:0!important;border-right:1px solid #eee7e0!important}
  html body .smv2-card .smv2-right{padding:14px 16px!important}
  html body .smv2-card .smv2-left .smv2-add-form{grid-template-columns:1fr 1fr!important}
  html body .smv2-card .smv2-left .smv2-add-form>.smv2-field,html body .smv2-card .smv2-left .smv2-add-form>.smv2-save{grid-column:auto!important}
  html body .smv2-card .smv2-left .smv2-add-form>.smv2-field:nth-of-type(1),html body .smv2-card .smv2-left .smv2-add-form>.smv2-field:nth-of-type(3){grid-column:1/-1!important}
  html body .smv2-card .smv2-editor{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) 96px 130px 84px!important}
}
@media(max-width:760px){
  html body .smv2-card .smv2-head{grid-template-columns:40px minmax(0,1fr)!important;padding:10px 12px!important}
  html body .smv2-card .smv2-thumb-wrap,html body .smv2-card .smv2-thumb{width:40px!important;height:40px!important}
  html body .smv2-card .smv2-stall{grid-column:1/-1!important;grid-row:3!important;justify-content:flex-start}
  html body .content .smv2-list .smv2-card .smv2-body{padding:12px!important}
  html body .content .smv2-list .smv2-card .smv2-body form.smv2-editor,html body .content .smv2-list .smv2-card .smv2-body form.smv2-add-form{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 76px!important;gap:8px!important}
  html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form)>.smv2-field:has([name="supplier_id"]),html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form)>.smv2-field:has([name="canonical_key"]),html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form)>.smv2-field:has([name="purchase_name"]){grid-column:1/-1!important;grid-row:auto!important}
  html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form)>.smv2-field:has([name="purchase_unit"]){grid-column:1!important;grid-row:auto!important}
  html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form)>.smv2-field:has([name="default_price"]){grid-column:2!important;grid-row:auto!important}
  html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form)>.smv2-save{grid-column:3!important;grid-row:auto!important;width:auto!important}
  html body .content .smv2-list .smv2-card .smv2-body .smv2-add-form{padding:10px!important}
  html body .content .smv2-list .smv2-card .smv2-body :is(.smv2-editor,.smv2-add-form) :is(input,select){height:40px!important;font-size:14px!important}
  html body .content .smv2-list .smv2-card .smv2-body .smv2-field label{font-size:12px!important}
  html body .content .smv2-card .smv2-add summary{font-size:13px!important;padding:6px 10px!important}
  html body .content .smv2-card .smv2-supplier-name{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
}

/* ===== V1.2.1 REDESIGN: NHẬN HÀNG TẠI QUẦY (desktop) ===== */
@media(min-width:901px){
  html body .sam-recv-form .sam-recv-list{display:grid;gap:10px}
  html body .sam-recv-form .sam-recv-item{display:grid!important;grid-template-columns:minmax(220px,1fr) auto!important;column-gap:24px!important;row-gap:8px!important;align-items:center!important;padding:14px 16px!important;border:1px solid #e6ded6!important;border-left:4px solid #c27a2c!important;border-radius:12px!important;background:#fff!important;margin:0!important}
  html body .sam-recv-form .sam-recv-item[data-sam-rs="ok"]{border-left-color:#28734e!important}
  html body .sam-recv-form .sam-recv-item>.sam-recv-v24-metric{display:none!important}
  html body .sam-recv-form .sam-recv-title{grid-column:1!important;grid-row:1/span 2!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:6px!important;margin:0!important;align-self:center}
  html body .sam-recv-form .sam-recv-title>div:first-child{display:flex;flex-direction:column;gap:2px}
  html body .sam-recv-form .sam-recv-title .sam-recv-code{font-size:12px!important;color:#8a5a35!important;font-weight:700}
  html body .sam-recv-form .sam-recv-title strong{font-size:15px!important;font-weight:650!important;line-height:1.35}
  html body .sam-recv-form .sam-recv-giao{font-size:13px!important;color:#5f534b!important;background:#f5efe9;border-radius:999px;padding:3px 10px}
  html body .sam-recv-form .sam-recv-qty{grid-column:2!important;grid-row:1!important;display:grid!important;grid-template-columns:140px 140px 140px 110px 120px!important;gap:10px!important;align-items:start!important;margin:0!important}
  html body .sam-recv-form .sam-recv-qty>label{display:flex!important;flex-direction:column!important;gap:4px!important;margin:0!important;min-width:0}
  html body .sam-recv-form .sam-recv-qty>label>span:first-child{display:block;height:18px;line-height:18px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px!important;font-weight:650!important;color:#786b62!important}
  html body .sam-recv-form .sam-recv-qty .qtybox{height:40px!important;min-height:40px!important;width:100%!important;box-sizing:border-box!important}
  html body .sam-recv-form .sam-recv-qty input[readonly]{box-sizing:border-box!important;margin:0!important;width:100%!important;height:40px!important;text-align:center!important;background:#f7f4f1!important;font-weight:700!important}
  html body .sam-recv-form .sam-recv-qty .sam-recv-line-ok,html body .sam-recv-form .sam-recv-qty [id^="sam_recv_state_"]{height:40px;margin-top:26px!important;display:flex!important;align-items:center;justify-content:center;font-size:12px!important;font-weight:650;border-radius:8px;white-space:nowrap}
  html body .sam-recv-form .sam-recv-reason{grid-column:2!important;display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px;align-items:center;margin:0!important}
  html body .sam-recv-form .sam-recv-reason label{font-size:12px!important;font-weight:650;color:#786b62}
  html body .sam-recv-form .sam-recv-v24-detail{grid-column:2!important;display:block!important;padding:0!important;margin:0!important;border:0!important;background:none!important}
  html body .sam-recv-form .sam-recv-expiry{background:none!important;border:0!important;padding:0!important;margin:0!important}
  html body .sam-recv-form .sam-hsd-choice{display:flex!important;align-items:center!important;gap:8px!important;justify-content:flex-start!important;padding:0!important;background:none!important;border:0!important}
  html body .sam-recv-form .sam-hsd-choice strong{font-size:12px!important;font-weight:650!important;color:#786b62!important;margin-right:4px}
  html body .sam-recv-form .sam-hsd-option{height:32px!important;min-height:32px!important;padding:0 12px!important;font-size:12px!important;display:inline-flex!important;align-items:center;gap:6px}
  html body .sam-recv-form .sam-recv-v24-detail:has(input[value="track"]:checked){grid-column:1/-1!important;border-top:1px dashed #e6ded6!important;padding-top:10px!important}
  html body .sam-recv-form .sam-recv-qty [id^="sam_recv_state_"]{white-space:normal!important;text-align:center;line-height:1.25;padding:0 6px;color:#28734e;background:#eef7f1}
  html body .sam-recv-form .sam-recv-item[data-sam-rs="short"]{border-left-color:#c27a2c!important}
  html body .sam-recv-form .sam-recv-item[data-sam-rs="short"] [id^="sam_recv_state_"]{color:#a4601c!important;background:#fbefe2!important}
  html body .sam-recv-form .sam-recv-item[data-sam-rs="bad"]{border-left-color:#b33d37!important}
  html body .sam-recv-form .sam-recv-item[data-sam-rs="bad"] [id^="sam_recv_state_"]{color:#b33d37!important;background:#fbeaea!important}
  html body .sam-recv-form .sam-recv-guide{font-size:12px!important;padding:8px 16px!important}
}
@media(min-width:901px) and (max-width:1240px){
  html body .sam-recv-form .sam-recv-item{grid-template-columns:minmax(170px,1fr) auto!important;column-gap:16px!important}
  html body .sam-recv-form .sam-recv-qty{grid-template-columns:112px 112px 112px 100px 100px!important;gap:8px!important}
}
/* Nhận hàng mobile: nút xác nhận không tràn khung */
@media(max-width:900px){
  html body .sam-recv-form .sam-rx-footer-v2{grid-template-columns:minmax(0,1fr) minmax(0,1.5fr)!important;gap:10px!important}
  html body .sam-recv-form .sam-rx-footer-v2 .sam-recv-confirm{min-width:0!important;width:100%!important;padding-left:8px!important;padding-right:8px!important;white-space:normal!important;line-height:1.2!important}
}
/* ===== V1.2.1 MOBILE: TỒN KHO + THẺ KHO trong chi tiết SP/NVL ===== */
.sam-md-jump{position:sticky;top:0;z-index:5;display:flex;gap:6px;padding:8px 0;background:var(--bg,#f8f7f5);margin:0 0 4px}
.sam-md-jump a{flex:1 1 0;text-align:center;padding:8px 6px;border:1px solid #e3d9cf;border-radius:999px;background:#fff;font-size:13px;font-weight:650;color:#3a281d}
#sam-md-info,#sam-md-stock,#sam-md-card{scroll-margin-top:60px}
.sam-md-stock-list{display:grid;gap:0}
.sam-md-stock-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #f0eae4;font-size:14px}
.sam-md-stock-row:last-child{border-bottom:0}
.sam-md-stock-row b{font-weight:700;white-space:nowrap}
.sam-md-stock-row b.neg{color:#b33d37}
.sam-md-stock-row.total span{color:#786b62;font-size:13px}
.sam-md-card-list{display:grid}
.sam-md-card-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #f0eae4}
.sam-md-card-row[hidden]{display:none}
.sam-md-card-row .l{min-width:0;display:flex;flex-direction:column;gap:2px}
.sam-md-card-row .l b{font-size:14px;font-weight:650}
.sam-md-card-row small{font-size:12px;color:#786b62;overflow-wrap:anywhere}
.sam-md-card-row small a{color:#a66537;font-weight:650;text-decoration:underline}
.sam-md-card-row .r{text-align:right;display:flex;flex-direction:column;gap:2px;white-space:nowrap}
.sam-md-card-row .r b{font-size:15px;font-weight:700}
.sam-md-card-row.in .r b{color:#28734e}
.sam-md-card-row.out .r b{color:#b33d37}
.sam-md-more{width:100%;margin-top:8px;height:40px;border:1px dashed #d8c9bb;border-radius:10px;background:#fff;font-size:13px;font-weight:650;color:#6f4023}

.sam-lazy-loading{padding:18px;color:#786b62;font-size:13px;text-align:center}
/* ===== V1.2.3 THÔNG BÁO kiểu KiotViet ===== */
html body .sam-bell2 .sam-bell2-entry{display:flex!important;gap:12px;align-items:flex-start;padding:12px 14px!important;border:1px solid #ece4dc!important;border-radius:12px!important;background:#fff!important;margin:0 0 8px!important;color:inherit;text-decoration:none}
html body .sam-bell2 .sam-bell2-entry.unread{background:#fff8f1!important;border-color:#f0d9c2!important}
html body .sam-bell2 a.sam-bell2-link:hover{border-color:#d8c3ae!important}
.sam-bell2-ico{flex:0 0 34px;height:34px;border-radius:50%;background:#f3ede7;display:grid;place-items:center;font-size:16px;color:#6f4023}
.sam-bell2-ico.sale{background:#e9f4ee}
.sam-bell2-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px;font-size:14px;line-height:1.4}
html body .sam-bell2 .sam-bell2-title{font-size:14px!important;font-weight:400!important;line-height:1.4}
.sam-bell2-title b{font-weight:700}
html body .sam-bell2 .sam-bell2-meta{font-size:12px!important;color:#786b62!important}
.sam-bell2-change{font-size:12px;color:#5f534b;background:#f7f4f1;border-radius:6px;padding:4px 8px;overflow-wrap:anywhere}
.sam-bell2-go{flex:0 0 auto;align-self:center;font-size:20px;color:#a08b7a}
html body .sam-bell2 details.sam-bell2-group{display:block!important;padding:0!important}
.sam-bell2-group>summary{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;cursor:pointer;list-style:none}
.sam-bell2-group>summary::-webkit-details-marker{display:none}
.sam-bell2-group[open]>summary .sam-bell2-go{transform:rotate(180deg)}
html body .sam-bell2 .sam-bell2-invs{display:block!important;border-top:1px solid #ece4dc;padding:4px 14px 8px}
.sam-bell2-invhead{display:flex;justify-content:space-between;font-size:12px;font-weight:650;color:#786b62;padding:6px 0}
html body .sam-bell2 .sam-bell2-invs a.sam-bell2-inv{display:flex!important;width:auto!important;margin:0!important;font-weight:400!important;text-decoration:none!important;justify-content:space-between;gap:10px;padding:9px 0;border-top:1px solid #f3eee9;color:inherit;text-decoration:none}
a.sam-bell2-inv .i,a.sam-bell2-inv .m{display:flex;flex-direction:column;gap:2px;min-width:0}
a.sam-bell2-inv .m{text-align:right;white-space:nowrap}
a.sam-bell2-inv b{font-size:14px;font-weight:650;color:#2a6fb0}
a.sam-bell2-inv .m b{color:#211b17}
a.sam-bell2-inv small{font-size:12px;color:#786b62}

html body .main table td .pill,html body .main table td [class*="badge"],html body .main table td [class*="status"] span{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
html body .main table td [class*="actions"][style*="flex-wrap"]>*{flex:0 0 auto!important;width:auto!important}
/* Bảng NCC: chia cột hợp lý để nút thao tác không đè (màn 1180–1366) */
html body .main table:has(.supplier-row-actions) th:nth-child(1){width:8%!important}
html body .main table:has(.supplier-row-actions) th:nth-child(2){width:19%!important}
html body .main table:has(.supplier-row-actions) th:nth-child(3){width:9%!important}
html body .main table:has(.supplier-row-actions) th:nth-child(4){width:9%!important}
html body .main table:has(.supplier-row-actions) th:nth-child(5){width:auto!important}
html body .main table:has(.supplier-row-actions) th:nth-child(6){width:8%!important}
html body .main table:has(.supplier-row-actions) td .supplier-row-actions{display:flex!important;flex-wrap:nowrap!important;justify-content:flex-end!important;gap:6px!important}
html body .main table:has(.supplier-row-actions) th:nth-child(7){width:96px!important}
html body .main table:has(.supplier-row-actions) th:nth-child(8){width:232px!important}
html body .main .tablewrap table:has(.supplier-row-actions) .sam-col-action{max-width:none!important;width:232px!important}
/* ===== V1.3.2 Nhận hàng desktop: 4 ô bằng nhau, cùng kiểu ===== */
@media(min-width:901px){
  html body .sam-recv-form .sam-recv-qty{grid-template-columns:repeat(4,132px) 132px!important;gap:12px!important}
  html body .sam-recv-form .sam-recv-qty .qtybox{min-width:0!important;max-width:none!important;width:100%!important;border:1px solid #d8c8be!important;border-radius:8px!important;overflow:hidden!important;display:flex!important;align-items:stretch!important;gap:0!important}
  html body .sam-recv-form .sam-recv-qty .qtybox input{flex:1 1 0!important;max-width:none!important;min-width:0!important;width:auto!important;font-size:15px!important;font-weight:700!important;text-align:center!important}
  html body .sam-recv-form .sam-recv-qty .qtybox button{flex:0 0 36px!important;max-width:none!important;min-width:0!important;width:36px!important;height:auto!important;font-size:15px!important}
  html body .sam-recv-form .sam-recv-qty input[readonly]{border:1px solid #d8c8be!important;border-radius:8px!important;font-size:15px!important;color:#211b17!important}
  html body .sam-recv-form .sam-recv-qty [id^="sam_recv_state_"]{width:100%!important;border-radius:8px!important;box-sizing:border-box!important}
}
@media(min-width:901px) and (max-width:1240px){
  html body .sam-recv-form .sam-recv-qty{grid-template-columns:repeat(4,112px) 112px!important;gap:8px!important}
}
/* Nút ẩn (hidden) không được hiện ra do quy tắc .btn */
html body .main .btn[hidden],html body .main button[hidden]{display:none!important}
/* Hủy hàng: nút Chụp ảnh / Xóa ảnh có khoảng cách, cùng cao */
html body .main .sam-waste-evidence-actions{display:flex!important;flex-wrap:wrap;gap:8px!important;align-items:center}
html body .main .sam-waste-evidence-actions>.btn{height:40px!important;min-height:40px!important;margin:0!important;display:inline-flex!important;align-items:center;justify-content:center}
html body .main .sam-waste-evidence-actions>.btn[hidden]{display:none!important}
/* Sơ chế: ô Ghi chú + nút máy ảnh cân nhau */
html body .main .sam-preprocess-note-photo{display:flex!important;gap:8px!important;align-items:center!important;width:100%}
html body .main .sam-preprocess-note-photo>input[name="note"]{flex:1 1 auto!important;min-width:0!important;height:40px!important}
html body .main .sam-preprocess-note-photo .sam-preprocess-camera{flex:0 0 44px!important;width:44px!important;height:40px!important;min-height:40px!important;margin:0!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border:1px solid #d8c8be!important;border-radius:8px!important;background:#fff!important;font-size:18px!important;cursor:pointer;box-sizing:border-box!important}
@media(min-width:901px){
  html body .sam-recv-form .sam-recv-qty .qtybox{box-sizing:border-box!important;padding:0!important}
  html body .sam-recv-form .sam-recv-qty .qtybox>*{box-sizing:border-box!important;margin:0!important;border:0!important}
  html body .sam-recv-form .sam-recv-qty .qtybox button{padding:0!important;background:#f2eae5!important}
}
html body .main .sam-ui-wrap>div:not(.field):not([class]){display:flex!important;align-items:flex-end!important}
html body .main .sam-ui-wrap>div:not(.field):not([class])>.btn,html body .main .sam-ui-wrap>div:not(.field):not([class])>button{margin:0!important}
/* Mobile chi tiết: dòng Tồn kho / Thẻ kho và màn con */
html body .sam-md-links{display:grid!important;gap:8px!important}
html body .sam-md-links .sam-md-row-link{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:10px;padding:12px 14px!important;margin:0!important}
html body .sam-md-links .sam-md-row-link>span{display:flex!important;flex-direction:column!important;gap:2px;min-width:0}
html body .sam-md-links .sam-md-row-link>span>b{font-size:15px;font-weight:700;color:#211b17}
html body .sam-md-links .sam-md-row-link>span>small{font-size:13px;color:#786b62;font-weight:400}
html body .sam-md-links .sam-md-row-link>b{font-size:20px;color:#a08b7a}
html body .sam-md-sub .sam-md-subhead{display:flex!important;flex-direction:column!important;gap:2px}
html body .sam-md-sub .sam-md-subhead b{font-size:16px;font-weight:700}
html body .sam-md-sub .sam-md-subhead small{font-size:13px;color:#786b62}
html body .sam-md-sub .sam-md-bottom-actions .sam-md-btn{border:1px solid #d8c8be!important;background:#fff!important;color:#3a281d!important}
/* Thông báo: màn danh sách hóa đơn của nhóm */
html body .sam-bell2-invpage{max-width:720px;margin:0 auto}
.sam-bell2-invtop{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #ece4dc;border-radius:12px;padding:12px 14px;margin-bottom:10px}
.sam-bell2-invtop>div{display:flex;flex-direction:column;gap:2px}
.sam-bell2-invtop b{font-size:18px;font-weight:700}
.sam-bell2-invtop small{font-size:13px;color:#786b62}
html body .sam-bell2 .sam-bell2-back{flex:0 0 36px;height:36px;border-radius:50%;display:grid;place-items:center;font-size:24px;line-height:1;color:#3a281d;background:#f3ede7;text-decoration:none}
html body .sam-bell2-invpage .sam-bell2-invs{display:block!important;background:#fff;border:1px solid #ece4dc;border-radius:12px;padding:0 14px}
html body .sam-bell2-invpage .sam-bell2-invs a.sam-bell2-inv:first-child{border-top:0!important}
html body .sam-bell2 .sam-bell2-backbtn{display:flex!important;width:100%;height:44px;align-items:center;justify-content:center;margin-top:12px;text-decoration:none!important}
/* Nhận hàng: dòng Lý do / Hạn sử dụng thẳng cột với các ô số */
@media(min-width:901px){
  html body .sam-recv-form .sam-recv-reason{grid-template-columns:132px minmax(0,1fr)!important;gap:12px!important}
  html body .sam-recv-form .sam-recv-reason input{height:40px!important;box-sizing:border-box!important;border-radius:8px!important}
  html body .sam-recv-form .sam-hsd-choice{display:grid!important;grid-template-columns:132px auto auto 1fr!important;gap:12px!important;align-items:center!important}
  html body .sam-recv-form .sam-hsd-choice strong{margin:0!important}
}
@media(min-width:901px) and (max-width:1240px){
  html body .sam-recv-form .sam-recv-reason{grid-template-columns:112px minmax(0,1fr)!important;gap:8px!important}
  html body .sam-recv-form .sam-hsd-choice{grid-template-columns:112px auto auto 1fr!important;gap:8px!important}
}
/* ===== V1.3.6 Ô tăng/giảm (− số +): nút tô kín màu tới sát viền, không hở trắng ===== */
html body .main .qtybox{display:flex!important;align-items:stretch!important;gap:0!important;padding:0!important;overflow:hidden!important;box-sizing:border-box!important;border:1px solid #d8c8be!important;border-radius:8px!important;background:#fff!important}
html body .main .qtybox>button{flex:0 0 36px!important;width:36px!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#f2eae5!important;color:#3a281d!important;display:flex!important;align-items:center!important;justify-content:center!important;align-self:stretch!important;box-shadow:none!important}
html body .main .qtybox>button:first-child{border-right:1px solid #e6dad1!important}
html body .main .qtybox>button:last-child{border-left:1px solid #e6dad1!important}
html body .main .qtybox>input{flex:1 1 0!important;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;text-align:center!important;align-self:stretch!important;padding:0 4px!important}
html body .main .qtybox>button:hover{background:#eadfd7!important}
/* POS: ô ảnh trống của thẻ món luôn cùng màu nền, kể cả khi thẻ đang chọn (không còn ô trắng giữa thẻ màu) */
html body .samv3-product .samv3-thumb{background:#f3ede7!important;border-color:transparent!important}
/* POS desktop: ô ảnh trống cùng màu nền; nút + cùng tông nâu như toàn hệ thống */
html body .main .pos-real-split .pos-products .product-card.compact .product-thumb:not(:has(img)),html body .main .product-card .product-thumb:not(:has(img)){background:#f3ede7!important;border-radius:10px!important;color:#a08b7a!important}
html body .main .pos-real-split .pos-products .product-card.compact:not(.soldout) .product-plus,html body .main .product-card:not(.soldout) .product-plus{background:#3a281d!important;color:#fff!important;border:0!important}
html body .main .pos-real-split .pos-products .product-card.compact:not(.soldout) .product-plus:hover,html body .main .product-card:not(.soldout) .product-plus:hover{background:#5b3825!important}
/* ===== V1.4.0 Thẻ món CÓ ẢNH: ảnh phủ kín khung, cùng kích thước thẻ không ảnh ===== */
html body .samv3-product .samv3-thumb{height:80px!important;min-height:80px!important;overflow:hidden!important;padding:0!important;display:grid!important;place-items:center!important}
html body .samv3-product .samv3-thumb img{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:center!important;display:block!important;border-radius:0!important;margin:0!important}
html body .main .pos-real-split .pos-products .product-card.compact .product-thumb,html body .main .product-card .product-thumb{overflow:hidden!important;padding:0!important}
html body .main .pos-real-split .pos-products .product-card.compact .product-thumb img,html body .main .product-card .product-thumb img{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;display:block!important;margin:0!important;border-radius:0!important}
/* Danh sách SP/NVL mobile: chữ "SP" nằm giữa ô màu, ảnh phủ kín ô */
html body .sam-mp-media,html body .sam-mi-media{overflow:hidden!important;border-radius:10px!important;background:#f3ede7!important;padding:0!important}
html body .sam-mp-media .sam-mp-placeholder,html body .sam-mi-media [class*="placeholder"]{width:100%!important;height:100%!important;display:grid!important;place-items:center!important;margin:0!important;background:transparent!important;font-weight:700;color:#a08b7a}
html body .sam-mp-media img,html body .sam-mi-media img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;margin:0!important}
/* Chi tiết mobile: ảnh lớn phủ kín khung */
html body .sam-md-hero-media{overflow:hidden!important;background:#f3ede7!important}
html body .sam-md-hero-media .sam-md-hero-img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
html body .sam-md-hero-media .sam-md-hero-placeholder{width:100%!important;height:100%!important;display:grid!important;place-items:center!important}
/* ===== V1.4.1 BỘ LỌC: nhãn luôn nằm TRÊN ô (không lệch sang bên) ===== */
html body .main form>div:has(>label+:is(input,select,textarea)){display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:5px!important;min-width:0}
html body .main form>div:has(>label+:is(input,select,textarea))>label{margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px!important;font-weight:650!important;color:#5f534b}
/* Tồn kho: bộ lọc dạng lưới cân đối */
html body .main form.inventory-filter{display:grid!important;grid-template-columns:minmax(180px,1.6fr) repeat(4,minmax(120px,1fr)) auto!important;gap:12px!important;align-items:end!important;flex-wrap:nowrap!important}
html body .main form.inventory-filter>*{min-width:0!important;width:auto!important;flex:none!important}
html body .main form.inventory-filter input,html body .main form.inventory-filter select{width:100%!important;height:40px!important}
html body .main form.inventory-filter .inventory-filter-actions{display:flex!important;gap:8px!important;align-items:center!important;flex-wrap:nowrap!important}
html body .main form.inventory-filter .inventory-filter-actions .btn{height:40px!important;margin:0!important;white-space:nowrap}
@media(max-width:1300px) and (min-width:801px){
  html body .main form.inventory-filter{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body .main form.inventory-filter .inventory-filter-actions{grid-column:auto!important;justify-content:stretch!important}
  html body .main form.inventory-filter .inventory-filter-actions .btn{flex:1 1 0!important;padding-left:8px!important;padding-right:8px!important;justify-content:center}
}
@media(max-width:800px){
  html body .main form.inventory-filter{grid-template-columns:1fr 1fr!important}
  html body .main form.inventory-filter .inventory-search,html body .main form.inventory-filter .inventory-filter-actions{grid-column:1/-1!important}
  html body .main form.inventory-filter .inventory-filter-actions{justify-content:stretch!important}
  html body .main form.inventory-filter .inventory-filter-actions .btn{flex:1 1 0!important}
}
/* Xuất tồn tại thời điểm: thanh gọn dưới bộ lọc */
html body .main .sam-inv-asof{margin:8px 0 12px!important;padding:10px 14px!important;border:1px dashed #d8c8be!important;border-radius:12px!important;background:#fffdfb!important}
html body .main .sam-inv-asof-form{display:flex!important;flex-wrap:wrap!important;gap:8px 12px!important;align-items:center!important}
html body .main .sam-inv-asof-title{font-size:13px;font-weight:700;color:#3a281d}
html body .main .sam-inv-asof-form input[type=datetime-local]{height:40px!important;width:220px!important;max-width:100%}
html body .main .sam-inv-asof-form .btn{height:40px!important;margin:0!important}
html body .main .sam-inv-asof-hint{font-size:12px;color:#786b62}
/* Sổ kho: dòng tổng — số luôn canh phải đúng cột (không bị dính “0 0”) */
html body .main table td.sl-num,html body .main table th.sl-num{text-align:right!important}
html body .main table tr:has(>td[colspan]) td.sl-num{text-align:right!important;padding-right:10px!important}
/* Nút ‹ › chọn ngày: nút bị khóa vẫn cùng màu, chỉ mờ đi */
html body .main button:disabled,html body .main .btn[disabled],html body .main .btn.disabled{opacity:.45!important;cursor:not-allowed!important}
/* Mobile Sản phẩm: không hiện bảng kiểu máy tính trong lúc đang dựng thẻ (hết nhấp nháy giao diện cũ) */
@keyframes samRevealLate{to{visibility:visible}}
@media(max-width:800px){
  html body:not(.sam-mobile-product-cards-ready) .content .product-fit{visibility:hidden!important;animation:samRevealLate 0s linear 4s forwards}
}
/* ===== V1.4.4 rà soát toàn bộ ===== */
/* Ô tick/radio không bị kéo cao 40px */
html body .main input[type=checkbox],html body .main input[type=radio]{height:18px!important;min-height:0!important;width:18px!important;min-width:18px!important;flex:0 0 18px!important;padding:0!important;margin:0 6px 0 0!important;accent-color:#3a281d}
/* Mobile Sơ chế/Hủy: chỉ 1 thông báo "Chưa có dữ liệu" đủ rộng */
html body .content:has(>.card.empty.sam-ops-v11-empty) .sam-op-mobile-history.sam-ops-v11-empty{display:none!important}
html body .main .card.empty.sam-ops-v11-empty{width:100%!important;box-sizing:border-box!important}
/* Sổ kho: Loại và Mã không bị bẻ giữa chừng */
html body .main table td.sl-type,html body .main table th.sl-type{white-space:nowrap!important;width:74px}
html body .main table td.sl-code,html body .main table th.sl-code{white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important;width:104px}
/* Ô bảng bị cắt "..." -> hiện đủ, xuống dòng */
html body .main table td.sam-ui-unclip{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
/* Mobile: bảng rộng chuyển thành thẻ dễ đọc */
@media(max-width:800px){
  html body .main table.sam-mcard{display:block!important;width:100%!important;min-width:0!important;border:0!important;background:transparent!important;table-layout:auto!important}
  html body .main table.sam-mcard thead{display:none!important}
  html body .main table.sam-mcard tbody{display:grid!important;gap:8px!important}
  html body .main table.sam-mcard tr{display:block!important;background:#fff!important;border:1px solid #ece4dc!important;border-radius:12px!important;padding:8px 12px!important}
  html body .main table.sam-mcard td{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:12px!important;padding:5px 0!important;border:0!important;border-bottom:1px solid #f4efea!important;width:auto!important;max-width:none!important;white-space:normal!important;overflow:visible!important;text-align:right!important;font-size:14px!important}
  html body .main table.sam-mcard td:last-child{border-bottom:0!important}
  html body .main table.sam-mcard td::before{content:attr(data-label);flex:0 0 auto;max-width:45%;text-align:left;font-size:12px;font-weight:650;color:#786b62}
  html body .main table.sam-mcard td[data-label=""]::before{display:none}
  html body .main table.sam-mcard td:first-child{font-weight:700;font-size:15px!important}
  html body .main table.sam-mcard td:has(.btn,button,form){justify-content:flex-end!important;flex-wrap:wrap!important}
  html body .main table.sam-mcard td[colspan]{display:block!important;text-align:left!important}
  html body .main .sam-ui-scroll-x:has(>table.sam-mcard){overflow:visible!important}
  html body .main table.sam-mcard td:has(.btn,button,form)::before{display:none}
  html body .main table.sam-mcard td input:not([type=checkbox]):not([type=radio]){max-width:140px!important;text-align:center}
  html body .main table.sam-mcard td:empty{display:none!important}
}
/* In tem mobile: ô tìm kiếm chiếm cả dòng */
@media(max-width:800px){
  html body .main form[action="/labels"]{flex:1 1 100%!important;min-width:100%!important}
  html body .main form[action="/labels"] input[name=q]{flex:1 1 auto!important;min-width:0!important;width:auto!important}
  html body .main form[action="/labels"]~*,html body .main *:has(>form[action="/labels"]){flex-wrap:wrap!important}
}
/* ===== V1.4.8 Mobile Lịch sử đơn hàng gọn kiểu KiotViet ===== */
@media(max-width:800px){
  html body .main form.filters:has(input[name=q]){display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  html body .main form.filters:has(input[name=q])>input[name=q]{grid-column:1/-1!important}
  html body .main form.filters:has(input[name=q])>*{width:auto!important;min-width:0!important;margin:0!important}
  html body .main form.filters:has(input[name=q])>div{display:flex!important;gap:8px!important;flex-direction:row!important}
  html body .main form.filters:has(input[name=q])>div>select{flex:1 1 auto!important;min-width:0!important}
  html body .main form.filters:has(input[name=q]) input,html body .main form.filters:has(input[name=q]) select,html body .main form.filters:has(input[name=q]) .btn{height:40px!important;font-size:14px!important}
  html body .main table.sam-sales-m{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;border:0!important;background:transparent!important}
  html body .main table.sam-sales-m thead{display:none!important}
  html body .main table.sam-sales-m tbody{display:block!important;width:100%!important;min-width:0!important;background:#fff;border:1px solid #ece4dc;border-radius:12px;overflow:hidden}
  html body .main table.sam-sales-m tr.sam-sales-day{display:block!important;background:#f5efe9!important}
  html body .main table.sam-sales-m tr.sam-sales-day td{display:block!important;width:auto!important;max-width:none!important;white-space:nowrap!important;text-align:left!important;padding:7px 12px!important;font-size:12px!important;font-weight:700!important;color:#6f4023!important;border:0!important}
  html body .main table.sam-sales-m tr.sam-sales-row{display:grid!important;width:auto!important;min-width:0!important;max-width:100%!important;grid-template-columns:minmax(0,1fr) auto auto!important;grid-template-areas:"code code amt" "meta pay act"!important;column-gap:8px!important;row-gap:3px!important;align-items:center!important;padding:10px 12px!important;border-bottom:1px solid #f0eae4!important;cursor:pointer;background:#fff!important}
  html body .main table.sam-sales-m tr.sam-sales-row:active{background:#faf6f2!important}
  html body .main table.sam-sales-m tr.sam-sales-row td{display:block!important;padding:0!important;border:0!important;width:auto!important;max-width:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-align:left!important;font-size:13px!important;color:#786b62!important;background:none!important}
  html body .main table.sam-sales-m tr.sam-sales-row td::before{display:none!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-code{grid-area:code;font-size:15px!important;font-weight:700!important;color:#2a6fb0!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-number{grid-area:amt;font-size:15px!important;font-weight:700!important;color:#211b17!important;text-align:right!important}
  html body .main table.sam-sales-m tr.sam-sales-row td[data-f=d]{grid-area:meta;display:inline!important}
  html body .main table.sam-sales-m tr.sam-sales-row td[data-f=n],html body .main table.sam-sales-m tr.sam-sales-row td[data-f=k]{display:none!important}
  html body .main table.sam-sales-m tr.sam-sales-row td[data-f=p]{grid-area:pay;text-align:right!important}
  html body .main table.sam-sales-m tr.sam-sales-row td[data-f=s]{display:none!important}
  html body .main table.sam-sales-m tr.sam-sales-row.is-void td[data-f=s]{color:#b33d37!important;font-weight:650}
  html body .main table.sam-sales-m tr.sam-sales-row.is-void td.sam-col-number{text-decoration:line-through;color:#a08b7a!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-action{grid-area:act!important;overflow:visible!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-action .sam-sales-actions{display:flex!important;gap:6px!important;justify-content:flex-end!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-action a.btn{display:none!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-action .btn{height:26px!important;min-height:26px!important;padding:0 10px!important;font-size:12px!important}
  html body .main .sam-ui-scroll-x:has(>table.sam-sales-m),html body .main .tablewrap:has(>table.sam-sales-m){overflow:visible!important;border:0!important;background:none!important;box-shadow:none!important}
}
@media(max-width:800px){
  html body .main table.sam-sales-m tr.sam-sales-row.is-void td[data-f=d]{color:#b33d37!important}
  html body .main table.sam-sales-m tr.sam-sales-row td.sam-col-action .btn{height:24px!important;min-height:24px!important;padding:0 8px!important;font-size:11px!important}
}
@media(max-width:800px){html body .main form.filters:has(input[name=q]) select{font-size:13px!important;padding-left:8px!important;padding-right:22px!important}}
@media(max-width:800px){
  html body .main form.filters:has(input[name=q])>div{display:contents!important}
  html body .main form.filters:has(input[name=q])>div>.btn{grid-column:1/-1!important;width:100%!important}
}
/* Công thức mobile: nút lọc nhanh */
html body .sam-mf-chips{display:flex;gap:8px;margin:8px 0 10px;flex-wrap:wrap}
html body .sam-mf-chips button{flex:1 1 0;min-width:0;height:36px;border:1px solid #e3d9cf;border-radius:999px;background:#fff;color:#3a281d;font-size:13px;font-weight:650;padding:0 8px;white-space:nowrap}
html body .sam-mf-chips button.on{background:#3a281d;color:#fff;border-color:#3a281d}
html body .sam-mf-card.sam-mf-off{display:none!important}
/* Danh sách SP mobile: tên món hiện 2 dòng thay vì cắt "..." */
html body .sam-mp-card .sam-mp-name{white-space:normal!important;overflow:hidden!important;text-overflow:clip!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.3!important}
html body .sam-mf-card .sam-mf-main>b{white-space:normal!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important}
@media(max-width:800px){
  html body .main form.sam-search-inline-form.sam-status-auto{display:flex!important;width:100%!important}
  html body .main form.sam-search-inline-form.sam-status-auto .btn{display:none!important}
  html body .main form.sam-search-inline-form.sam-status-auto select{flex:1 1 auto!important;width:100%!important;max-width:none!important;height:40px!important}
}
@media(max-width:800px){
  html body .main .sam-mobile-compact-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;width:100%!important}
  html body .main .sam-mobile-compact-actions>*{width:100%!important;min-width:0!important}
  html body .main .sam-mobile-compact-actions>*>.btn,html body .main .sam-mobile-compact-actions>*>summary,html body .main .sam-mobile-compact-actions>*>a,html body .main .sam-mobile-compact-actions>*>button{width:100%!important;height:44px!important;display:flex!important;align-items:center;justify-content:center;box-sizing:border-box}
}
html body .main table th.sam-col-action,html body .main table td.sam-col-action{min-width:76px!important}
html body .main table td.sam-col-action form{max-width:none!important}
/* ===== V1.5.7 NVL màn hẹp: danh sách gọn, bấm mở chi tiết ===== */
@media(max-width:800px){
  html body .main table.sam-nvl-m{display:block!important;width:100%!important;min-width:0!important;border:0!important;background:transparent!important;table-layout:auto!important}
  html body .main table.sam-nvl-m thead{display:none!important}
  html body .main table.sam-nvl-m tbody{display:block!important;background:#fff;border:1px solid #ece4dc;border-radius:12px;overflow:hidden}
  html body .main table.sam-nvl-m tr.sam-nvl-detail{display:none!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main{display:grid!important;grid-template-columns:14px minmax(0,1fr) auto!important;grid-template-areas:"dot name qty" "dot meta cost"!important;column-gap:8px!important;row-gap:2px!important;align-items:center!important;padding:11px 12px!important;border-bottom:1px solid #f0eae4!important;cursor:pointer;background:#fff!important;width:auto!important;min-width:0!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main:active{background:#faf6f2!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td{display:block!important;padding:0!important;border:0!important;width:auto!important;max-width:none!important;min-width:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-align:left!important;font-size:13px!important;color:#786b62!important;background:none!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td::before{display:none!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(1){grid-area:meta}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(2){grid-area:name;font-size:15px!important;font-weight:650!important;color:#211b17!important;white-space:normal!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(3),html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(4){display:none!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(5){grid-area:qty;text-align:right!important;font-size:15px!important;font-weight:700!important;color:#211b17!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(6){grid-area:cost;text-align:right!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(7){grid-area:dot;display:flex!important;align-items:center;justify-content:center;overflow:visible!important}
  html body .main table.sam-nvl-m tr.sam-nvl-main td:nth-child(8){display:none!important}
  /* dong vua thao tac: to ca the, khong de vach le o 1 o */
  html body .main table:is(.sam-nvl-m,.sam-mcard) tr:is(.sam-recent-activity-v2,.sam-recent-edited){background:#fff6e0!important;box-shadow:inset 4px 0 0 #cd8526!important}
  html body .main table:is(.sam-nvl-m,.sam-mcard) tr:is(.sam-recent-activity-v2,.sam-recent-edited)>td{background:transparent!important;box-shadow:none!important;border-bottom:0!important}
  html body .main .tablewrap:has(>table.sam-nvl-m),html body .main .sam-ui-scroll-x:has(>table.sam-nvl-m){overflow:visible!important;border:0!important;background:none!important;box-shadow:none!important}
}
/* Chi tiết SP/NVL: 2 nút dưới cùng bằng nhau */
html body .sam-md-bottom-actions.two{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
html body .sam-md-bottom-actions.two>*{min-width:0;margin:0!important}
html body .sam-md-bottom-actions.two .sam-md-btn{width:100%!important;height:48px!important;display:flex!important;align-items:center;justify-content:center;border-radius:12px!important;font-size:15px!important;font-weight:700!important;box-sizing:border-box;text-decoration:none}
html body .sam-md-bottom-actions.two .sam-md-btn.danger{background:#fbeaea!important;color:#b33d37!important;border:1px solid #f0caca!important}
html body .sam-md-bottom-actions.two .sam-md-btn.ok{background:#e7f3ec!important;color:#28734e!important;border:1px solid #bfe0cc!important}
html body .sam-md-bottom-actions.two form{display:block}
html body .main .sam-md-bottom-actions.two form.sam-md-toggle-form button.sam-md-btn{height:48px!important;min-height:48px!important;width:100%!important;margin:0!important}

/* 1.5.9 dong vua thao tac: to dong mau kem, vach cam ben trai - dong nhat desktop/mobile */
html body .main table tr:is(.sam-recent-activity-v2,.sam-recent-edited)>td,html body .main .ingredient-fit table.sam-nvl-list tbody tr.sam-nvl-main:is(.sam-recent-activity-v2,.sam-recent-edited)>td{background:#fff6e0!important}

/* 1.5.9 laptop / cua so khong full man hinh (801-1440px) */
@media(min-width:801px) and (max-width:1440px){
  html body .main table.sam-lap{table-layout:auto!important}
  html body .main table.sam-lap :is(td,th).sam-lap-nw{white-space:nowrap!important;text-overflow:clip!important;overflow:visible!important;max-width:none!important}
  html body .main table.sam-lap :is(td,th).sam-lap-nw *{white-space:nowrap!important;text-overflow:clip!important;overflow:visible!important;max-width:none!important}
}
@media(min-width:801px) and (max-width:1279px){
  html body header.top.sam-bell-header .stall-label{display:none!important}
  html body header.top.sam-bell-header .stallbanner select{max-width:150px!important;min-width:0!important}
  html body header.top.sam-bell-header .userbox{font-size:0!important;white-space:nowrap!important}
  html body header.top.sam-bell-header .userbox>b,html body header.top.sam-bell-header .userbox>br,html body header.top.sam-bell-header .userbox .sam-user-sep{display:none!important}
  html body header.top.sam-bell-header .userbox .sam-logout{font-size:12px!important}
}
@media(min-width:801px) and (max-width:1300px){
  html body .main form.inventory-filter{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body .main form.inventory-filter .inventory-search{grid-column:span 2!important}
  html body .main form.inventory-filter .inventory-filter-actions{grid-column:span 2!important;justify-content:stretch!important}
  html body .main form.inventory-filter .inventory-filter-actions .btn{flex:1 1 0!important;padding-left:8px!important;padding-right:8px!important;justify-content:center}
  html body .main .inventory-kpis{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  html body .main .inventory-kpis>*{container-type:inline-size;min-width:0!important}
  html body .main .inventory-kpis .inventory-kpi-value.inventory-money{font-size:clamp(13px,10.5cqi,24px)!important;white-space:nowrap!important}
  html body .main form.sl-filter-card .sl-filter-main{display:grid!important;grid-template-columns:130px 190px 130px minmax(160px,1fr)!important;gap:12px!important;align-items:end!important}
  html body .main form.sl-filter-card .sl-filter-main>*{min-width:0!important;width:auto!important;grid-row:auto!important}
  html body .main form.sl-filter-card .sl-filter-main .sl-zero{grid-column:1/3!important;align-self:center!important}
  html body .main form.sl-filter-card .sl-filter-main .sl-actions{grid-column:3/5!important;display:flex!important;justify-content:flex-end!important;gap:8px!important;flex-wrap:nowrap!important}
  html body .main form.sl-filter-card .sl-filter-main :is(select,input:not([type=checkbox])){width:100%!important}
}
@media(min-width:801px) and (max-width:1300px){
  html body .main .sam-v41-table>:is(.sam-v41-head,.sam-req-v41-line){grid-template-columns:minmax(0,1.6fr) 108px minmax(0,1.5fr) minmax(0,1fr) 40px!important}
  html body .main .sam-v41-table>:is(.sam-v41-head,.sam-req-v41-line)>*{min-width:0!important}
  html body .main .sam-transfer-batch-form .sam-transfer-batch-entry{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.8fr) 105px 110px!important}
  html body .main .sam-transfer-batch-form .sam-transfer-batch-entry>*{min-width:0!important}
}
/* 1.6.1 nút hủy phiếu kiểm */
html body .main form.sam-stk-cancel{margin-top:10px;display:flex;justify-content:flex-start}
html body .main form.sam-stk-cancel .btn{min-height:40px}
/* 1.6.1 Đề nghị: ô sửa SL + nút LƯU nằm một hàng, không bị bóp chữ dọc */
html body .main td:has(> form.sam-req-qtyform){min-width:210px!important;white-space:nowrap!important}
html body .main form.sam-req-qtyform{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center!important;margin:0!important}
html body .main form.sam-req-qtyform .qtybox{flex:1 1 auto!important;min-width:120px!important}
html body .main form.sam-req-qtyform > .btn,html body .main form.sam-req-qtyform > button{flex:0 0 auto!important;white-space:nowrap!important;min-width:56px!important;writing-mode:horizontal-tb!important}
/* 1.6.2 Nhà cung cấp: 3 nút thao tác gọn, cùng cỡ, không tràn */
html body .main td.sam-col-action:has(.supplier-row-actions){width:1%!important;white-space:nowrap!important;min-width:0!important;max-width:none!important}
html body .main .supplier-row-actions{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center!important;justify-content:flex-end!important}
html body .main .supplier-row-actions form{margin:0!important;display:block!important}
html body .main .supplier-row-actions .btn,html body .main .supplier-row-actions button{height:30px!important;min-height:30px!important;min-width:0!important;width:auto!important;padding:0 10px!important;font-size:12px!important;line-height:28px!important;border-radius:8px!important;white-space:nowrap!important;flex:0 0 auto!important;box-shadow:none!important}
@media(max-width:800px){html body .main .supplier-row-actions{justify-content:flex-start!important;flex-wrap:wrap!important}}
html body .main table:has(.supplier-row-actions) td:nth-child(2){min-width:200px!important}
/* 1.6.4 Cần xử lý: ô lý do + DUYỆT + TỪ CHỐI nằm gọn 1 hàng, không đè nhau */
html body .main td:has(> form[action*="approval/action"]){width:1%!important;white-space:nowrap!important;min-width:300px!important;max-width:none!important}
html body .main form[action*="approval/action"]{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center!important;margin:0!important}
html body .main form[action*="approval/action"] input[name=reason]{flex:1 1 120px!important;width:120px!important;min-width:90px!important;height:32px!important;min-height:32px!important;font-size:13px!important;padding:0 8px!important}
html body .main form[action*="approval/action"] button{flex:0 0 auto!important;height:32px!important;min-height:32px!important;padding:0 12px!important;font-size:12px!important;white-space:nowrap!important;min-width:0!important;width:auto!important;border-radius:8px!important}
@media(max-width:800px){html body .main td:has(> form[action*="approval/action"]){min-width:0!important;white-space:normal!important}html body .main form[action*="approval/action"]{flex-wrap:wrap!important}}
/* 1.6.4 bỏ nhãn nổi "Cần xử lý" tràn ra ngoài bảng (dòng vẫn tô vàng + vạch trái) */
html body .main tr.sam-action-required::after,html body .main tr.sam-action-required>td:last-child::after{content:none!important;display:none!important}
/* 1.6.5 Phiếu sơ chế: các ô cao bằng nhau, thẳng hàng */
html body .main form[action*="preprocess/create"] :is(input:not([type=hidden]):not([type=file]),select){height:40px!important;min-height:40px!important;box-sizing:border-box!important}
html body .main form[action*="preprocess/create"] .qtybox{height:40px!important;min-height:40px!important;box-sizing:border-box!important}
html body .main form[action*="preprocess/create"] .qtybox input{height:100%!important;min-height:0!important;border:0!important}
html body .main form[action*="preprocess/create"] .qtybox button{height:100%!important;min-height:0!important}
html body .main form[action*="preprocess/create"]{align-items:end!important}
html body .main form[action*="preprocess/create"]>*{margin-top:0!important;margin-bottom:0!important}
html body .main form[action*="preprocess/create"] :is(input,button,.qtybox,label){margin-bottom:0!important;vertical-align:top!important}
html body .main form[action*="preprocess/create"] .qtybox button{margin:0!important}
html body .main form[action*="preprocess/create"] .field{display:flex!important;flex-direction:column!important;justify-content:flex-end!important;gap:5px!important}
html body .main form[action*="preprocess/create"] .field>label{height:20px!important;min-height:20px!important;line-height:20px!important;margin:0!important;padding:0!important;white-space:nowrap!important;display:block!important}
/* 1.6.6 Sơ chế: ô số đủ rộng hiện 0.895 */
html body .main form[action*="preprocess/create"] .qtybox{width:100%!important;min-width:0!important;max-width:none!important;display:flex!important;overflow:hidden!important}
html body .main form[action*="preprocess/create"] .qtybox input{flex:1 1 0!important;min-width:0!important;width:100%!important;max-width:none!important;text-align:center!important;font-size:14px!important;padding:0 2px!important}
html body .main form[action*="preprocess/create"] .qtybox button{flex:0 0 30px!important;width:30px!important;min-width:30px!important;padding:0!important}
html body .main form[action*="preprocess/create"]{grid-template-columns:minmax(200px,1.6fr) repeat(3,minmax(130px,1fr)) minmax(80px,.7fr) minmax(100px,1fr) auto auto!important}
/* Hủy hàng: các ô cao bằng nhau, thẳng hàng */
html body .main form[action*="waste/create"] .field{display:flex!important;flex-direction:column!important;justify-content:flex-start!important;gap:5px!important;margin:0!important}
html body .main form[action*="waste/create"] .field>label{height:20px!important;line-height:20px!important;margin:0!important;padding:0!important;white-space:nowrap!important;display:block!important}
html body .main form[action*="waste/create"] :is(input:not([type=hidden]):not([type=file]),select,.qtybox,.sam-autocomplete-inp){height:40px!important;min-height:40px!important;box-sizing:border-box!important;margin:0!important}
html body .main form[action*="waste/create"] .qtybox input,html body .main form[action*="waste/create"] .qtybox button{height:100%!important;min-height:0!important;margin:0!important}
html body .main form[action*="waste/create"] .qtybox input{border:0!important}
html body .main form[action*="waste/create"]{align-items:start!important}

/* 1.6.7 Báo cáo: nút XUẤT EXCEL / IN A4 / IN 80MM nằm cùng hàng với bộ lọc ngày */
html body .main form.sam-rep-filter-inline{display:flex!important;flex-wrap:wrap!important;align-items:flex-end!important;gap:10px!important}
html body .main form.sam-rep-filter-inline .sam-rep-exports{display:flex!important;gap:8px!important;margin-left:auto!important;align-items:flex-end!important}
html body .main form.sam-rep-filter-inline .sam-rep-exports .btn{height:40px!important;margin:0!important}
/* 1.6.7 Kiểm kho có ảnh sản phẩm */
html body .main .sam-stk-item{display:flex!important;align-items:center!important;gap:10px!important}
html body .main .sam-stk-item img,html body .main .sam-stk-noimg{width:40px!important;height:40px!important;flex:0 0 40px!important;border-radius:8px!important;object-fit:cover!important;background:#f3ece6!important}
html body .main .sam-stk-noimg{display:flex!important;align-items:center!important;justify-content:center!important;font-size:11px!important;font-weight:700!important;color:#8a7a6e!important}
html body .main .samv3-stkd-head:has(.sam-stk-thumb){display:flex!important;gap:10px!important;align-items:flex-start!important}
html body .main .samv3-stkd-head .sam-stk-thumb{width:48px!important;height:48px!important;flex:0 0 48px!important;border-radius:10px!important;object-fit:cover!important;background:#f3ece6!important}
html body .main .samv3-stkd-head:has(.sam-stk-thumb)>div:nth-of-type(1){flex:1 1 auto!important;min-width:0!important}

/* 1.6.9b: phiếu hủy nhiều mặt hàng + nút hủy/hoàn trên dòng */
.sam-waste-lines{grid-column:1/-1;display:flex;flex-direction:column;gap:8px;margin:2px 0}
.sam-waste-line{display:grid;grid-template-columns:minmax(0,1fr) 110px 40px;gap:8px;align-items:center}
@media(min-width:761px){.sam-waste-one-row .sam-waste-lines{display:grid!important;grid-template-columns:subgrid!important;column-gap:10px}.sam-waste-one-row .sam-waste-line{grid-column:1/-1;grid-template-columns:subgrid!important;column-gap:10px}.sam-waste-one-row .sam-waste-addline{grid-column:1;justify-self:start}.sam-waste-one-row .sam-wl-del{justify-self:start}}
.sam-waste-line select,.sam-waste-line input{width:100%;box-sizing:border-box;min-height:40px}
.sam-waste-line .sam-wl-del{min-height:40px;padding:0;width:40px}
.sam-waste-addline{align-self:flex-start;min-height:34px;padding:6px 12px;font-size:12px}
form.sam-row-act{margin:0;display:inline}
.sam-waste-native-history .sam-row-act-btn,table .sam-row-act-btn{height:28px!important;line-height:1!important;min-height:28px!important;padding:4px 10px!important;font-size:11px!important;white-space:nowrap}

/* bảng không bao giờ bẻ chữ từng ký tự */
table.sam-datatable td,table.sam-datatable th{word-break:normal!important;overflow-wrap:normal!important}
/* Quản trị tài khoản: tìm kiếm + form thêm tài khoản cân đối */
tr.sam-search-hidden{display:none!important}
@media(min-width:761px){
.sam-user-create form.formgrid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px 14px!important;align-items:end!important}
.sam-user-create form.formgrid>.field{grid-column:auto!important;min-width:0!important;margin:0!important}
.sam-user-create form.formgrid>.field.span2{grid-column:2/span 3!important}
.sam-user-create form.formgrid input,.sam-user-create form.formgrid select{width:100%!important;box-sizing:border-box!important;height:40px!important;min-height:40px!important}
.sam-user-create .sam-stall-checks{min-height:40px!important;box-sizing:border-box!important;display:flex!important;align-items:center!important;gap:18px!important}
.sam-user-create .sam-stall-checks input{width:auto!important;height:auto!important;min-height:0!important}
.sam-user-create form.formgrid>div:last-child{grid-column:1!important}
.sam-user-create form.formgrid>div:last-child .btn{width:100%!important;height:40px!important;min-height:40px!important}
}

#samNet{padding:4px 9px!important;font-size:10px!important;line-height:1.2!important;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
#samNet.sam-net-warn{background:#fff4e5!important;border-color:#f0b36b!important;color:#8a4b00!important}

.sam-bom-groups{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.sam-bom-groups .sam-bom-chip{display:inline-block;user-select:none;border:1px solid #e3d6c8!important;background:#fbf7f2!important;border-radius:999px!important;padding:2px 8px!important;min-height:22px!important;height:auto!important;font-size:11px!important;font-weight:600!important;line-height:1.4!important;cursor:pointer;color:#3b2416!important;box-shadow:none!important;width:auto!important}
.sam-bom-chip b{margin-left:3px}
.sam-bom-groups .sam-bom-chip.on{background:#3b2416!important;color:#fff!important;border-color:#3b2416!important}
.bom-product-scroll{overflow-y:scroll!important;scrollbar-width:thin;scrollbar-color:#bba892 #f3ede6}
.bom-product-scroll::-webkit-scrollbar{width:8px}
.bom-product-scroll::-webkit-scrollbar-thumb{background:#bba892;border-radius:8px}
.bom-product-scroll::-webkit-scrollbar-track{background:#f3ede6}
.inventory-kpi-split{font-size:11px;color:#6b5a4c;margin-top:3px;line-height:1.35}
.inventory-kpi-split b{color:#3b2416;font-weight:700}
.sam-preprocess-history-cell .sam-row-act{display:block;margin-top:3px}
.sam-preprocess-history-cell .sam-row-act-btn{height:24px!important;min-height:24px!important;padding:2px 8px!important;font-size:10px!important}

/* 1.7.0b: Hủy hàng — SL nhập tay, các dòng đồng nhất */
html body .main form[action^="/waste/create"] .qtybox{display:block!important;border:0!important;padding:0!important;background:none!important;width:100%!important}
html body .main form[action^="/waste/create"] .qtybox>button{display:none!important}
html body .main form[action^="/waste/create"] input[name="qty"],html body .main form[action^="/waste/create"] input[name^="qty_"],html body .main .sam-waste-line input{width:100%!important;height:40px!important;min-height:40px!important;box-sizing:border-box!important;text-align:left!important;border:1px solid #d9cfc6!important;border-radius:10px!important;padding:0 12px!important;background:#fff!important;font-size:14px!important}
.sam-waste-line .sam-wl-del{height:40px!important;min-height:40px!important;width:40px!important;padding:0!important}

/* Nút Hủy trên dòng phiếu: dạng chữ nhỏ, không làm lệch bảng */
button.sam-row-act-btn{all:unset;cursor:pointer;color:#b3261e!important;font-size:12px!important;font-weight:700!important;text-decoration:underline;text-underline-offset:2px;padding:0 2px!important;line-height:1.2!important;white-space:nowrap}
button.sam-row-act-btn:hover{color:#7f1912!important}
button.sam-row-act-btn:disabled{color:#999!important;text-decoration:none}
.sam-preprocess-history-cell .sam-row-act{display:inline;margin:0 0 0 6px}
.inventory-kpi-money{font-size:14px;font-weight:800;color:#6b4a32;margin-top:4px;white-space:nowrap}
.inventory-kpi-unit{font-size:11px;font-weight:600;color:#8a7868}
.sam-bom-toolbar{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px}
.sam-bom-groups.sam-bom-groups-top{margin:0 0 10px;flex-wrap:nowrap!important;overflow-x:auto;justify-content:flex-start;scrollbar-width:thin;white-space:nowrap}
html body .sam-preprocess-history-cell:has(.sam-row-act){white-space:normal!important;overflow:visible!important;text-overflow:clip!important;display:flex!important;flex-wrap:wrap;align-items:center;gap:2px 8px}
html body .sam-preprocess-history-cell .sam-row-act{margin:0!important}

/* 1.7.0c */
html body .main .sam-wl-pick::-webkit-calendar-picker-indicator{display:none!important;opacity:0}
html body .main .sam-waste-line .sam-wl-del{justify-self:start}
html body .sam-preprocess-history-cell:has(.sam-row-act){flex-wrap:nowrap!important;white-space:nowrap!important;gap:6px!important}
@media(min-width:801px){html body .main .sam-preprocess-history-row{grid-template-columns:1.05fr .9fr .9fr 1.3fr .8fr .85fr .7fr .6fr .9fr 1.35fr!important}}
.sam-nvl-search{display:flex;align-items:center;gap:10px;margin:0 0 10px}
.sam-nvl-search input{flex:0 1 420px;height:38px;border:1px solid #d9cfc6;border-radius:10px;padding:0 12px;font-size:14px;background:#fff}
.sam-nvl-search-count{font-size:12px;color:#7a6a5c}

/* Sơ chế nhiều NVL + bỏ nút -/+ */
html body .main form[action^="/preprocess/create"] .qtybox{display:block!important;border:0!important;padding:0!important;background:none!important;width:100%!important}
html body .main form[action^="/preprocess/create"] .qtybox>button{display:none!important}
html body .main form[action^="/preprocess/create"] input[type=number],html body .main .sam-pre-line input{font-weight:500!important;width:100%!important;height:40px!important;min-height:40px!important;box-sizing:border-box!important;text-align:left!important;border:1px solid #d9cfc6!important;border-radius:10px!important;padding:0 12px!important;background:#fff!important;font-size:14px!important}
html body .main .sam-pl-pick::-webkit-calendar-picker-indicator{display:none!important;opacity:0}
.sam-pre-lines{grid-column:1/-1;display:flex;flex-direction:column;gap:8px}
.sam-pre-line{display:grid;grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)) 40px;gap:8px;align-items:center}
@media(min-width:761px){html body .main .preprocess-form.sam-preprocess-one-row .sam-pre-lines{display:grid!important;grid-template-columns:subgrid!important;column-gap:8px}html body .main .preprocess-form.sam-preprocess-one-row .sam-pre-line{grid-column:1/-1;grid-template-columns:subgrid!important}html body .main .sam-pre-line .sam-wl-del{justify-self:start}html body .main .sam-pre-lines .sam-waste-addline{grid-column:1;justify-self:start}}
html body .main .sam-pre-line .sam-wl-del{height:40px!important;min-height:40px!important;width:40px!important;padding:0!important}
@media(min-width:761px){html body .main .preprocess-form.sam-preprocess-one-row>div:last-child{grid-row:1!important;grid-column:-2/-1!important}html body .main .preprocess-form.sam-preprocess-one-row>.sam-pre-lines{grid-row:2!important;grid-column:1/-1!important;width:auto!important;max-width:none!important}}

/* 1.7.2: bỏ nút −/+ toàn hệ thống (ô SL nhập tay) */
html body .main .qtybox{display:block!important;border:0!important;padding:0!important;background:none!important;width:100%!important;min-width:0!important}
html body .main .qtybox>button{display:none!important}
html body .main .qtybox>input{width:100%!important;max-width:none!important;height:40px!important;min-height:40px!important;box-sizing:border-box!important;text-align:right!important;border:1px solid #d9cfc6!important;border-radius:10px!important;padding:0 10px!important;background:#fff!important;font-size:14px!important;font-weight:600!important}
/* Sơ chế: dòng thêm có thu hồi %, ghi chú, ảnh */
html body .main .sam-pre-line .sam-pl-yield{background:#f7f3ef!important;color:#6b5a4c!important}
.sam-pl-notecell{display:flex;gap:6px;align-items:center;min-width:0}
.sam-pl-notecell .sam-pl-note{flex:1 1 auto;min-width:0}
.sam-pl-cam{flex:0 0 40px;width:40px;height:40px;display:inline-flex!important;align-items:center;justify-content:center;border:1px solid #d9cfc6;border-radius:10px;background:#fff;cursor:pointer}
.sam-pl-cam.has-photo{background:#e3f3e6;border-color:#8cc59a}
@media(max-width:760px){.sam-pre-line{grid-template-columns:1fr 1fr 1fr!important}.sam-pre-line .sam-pl-pick,.sam-pre-line .sam-pl-notecell{grid-column:1/-1}}

/* Thẻ kho NVL gọn trong 1 bảng */
table.sam-nvl-ledger{width:100%!important;table-layout:auto!important;border-collapse:collapse}
table.sam-nvl-ledger th,table.sam-nvl-ledger td{padding:7px 10px!important;font-size:13px!important;white-space:nowrap}
table.sam-nvl-ledger td:nth-child(3){white-space:normal;min-width:160px}
table.sam-nvl-ledger th:nth-child(5),table.sam-nvl-ledger th:nth-child(6),table.sam-nvl-ledger td:nth-child(5),table.sam-nvl-ledger td:nth-child(6){text-align:right}
.sam-nvl-ledger-wrap{overflow-x:auto}

/* Nhà cung cấp gọn */
.title.sam-sup-title{display:flex!important;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.title.sam-sup-title .sam-supplier-export-toolbar{margin:0!important}
html body .supplier-master-table table th,html body .supplier-master-table table td{font-size:13px!important;padding:8px 8px!important;vertical-align:middle}
html body .supplier-master-table table th:nth-child(1){width:72px!important}
html body .supplier-master-table table th:nth-child(2){width:22%!important}
html body .supplier-master-table table th:nth-child(3),html body .supplier-master-table table th:nth-child(4){width:118px!important}
html body .supplier-master-table table th:nth-child(6){width:110px!important}
html body .supplier-master-table table th:nth-child(7){width:96px!important}
html body .supplier-master-table table th:nth-child(8){width:236px!important}
html body .supplier-master-table table td:nth-child(3),html body .supplier-master-table table td:nth-child(4){white-space:nowrap!important}
html body .supplier-master-table table td:nth-child(5){font-size:12px!important;line-height:1.35}
tr.sam-sup-row{cursor:pointer}
tr.sam-sup-row:hover td{background:#fbf6f0!important}
/* Báo cáo: bộ lọc 1 hàng; cột NCC không bẻ từng chữ */
@media(min-width:900px){
html body .main form.report-filter{display:flex!important;flex-wrap:wrap!important;align-items:flex-end!important;gap:8px!important}
html body .main form.report-filter>label{display:flex!important;flex-direction:column!important;gap:3px;font-size:12px;font-weight:700;flex:0 0 150px!important;margin:0!important}
html body .main form.report-filter>label input{width:100%!important;height:40px!important}
html body .main form.report-filter>select,html body .main form.report-filter>input{flex:1 1 170px!important;width:auto!important;min-width:140px!important;max-width:320px!important;height:40px!important;margin:0!important}
html body .main form.report-filter>.btn{flex:0 0 auto!important;height:40px!important;margin:0!important}
}
html body .main table.sam-datatable td{word-break:normal!important;overflow-wrap:normal!important}
/* ===== SAM 1.8.0 (2026-11-30) ===== */
/* Lỗi 4: nhãn BÁN HÀNG/QUẢN LÝ dưới logo bị cắt mất dấu (khung cao 7px, overflow hidden) */
html body .sam-global-brand-copy-v1 span{line-height:1.45!important;height:auto!important;overflow:visible!important}
/* Lỗi 5: ô chọn kỳ ở thẻ Doanh thu theo giờ bị cắt chữ "Hôm na" */
html body:has(.dashboard-main-pair) select.dash-chart-period-select,html body select.dash-chart-period-select{width:128px!important;min-width:128px!important;max-width:128px!important}
html body:has(.dashboard-main-pair) .dash-chart-period-form{width:auto!important;max-width:none!important}
/* Lỗi 6: nút + thêm món trên điện thoại quá nhỏ (28px) */
@media(max-width:760px){html body .samv3-plus{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;font-size:22px!important}}
/* ===== SAM 2.0.0 (2026-11-30) — giỏ hàng mobile: 1 dòng/món, có nút − SL +, xóa cùng hàng, không che món ===== */
@media(max-width:760px){
html body .samv3-cartsheet .cart-lines{height:auto!important;max-height:46vh!important;overflow-y:auto!important}
html body .samv3-cartsheet .cart-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;padding:8px 10px!important;min-height:0!important}
html body .samv3-cartsheet .cart-line>div:last-child{display:flex!important;flex-direction:row!important;align-items:center!important;gap:6px!important}
html body .samv3-cartsheet .cart-line .qtybox{display:inline-grid!important;grid-template-columns:36px 50px 36px!important;height:38px!important;width:auto!important;border:1px solid #cfc6bd!important;border-radius:8px!important;overflow:hidden!important}
html body .samv3-cartsheet .cart-line .qtybox button{display:flex!important;align-items:center;justify-content:center;width:36px!important;height:38px!important;min-width:0!important;padding:0!important;font-size:20px!important;border:0!important;background:#eee8e2!important}
html body .samv3-cartsheet .cart-line .qtybox input{width:50px!important;min-width:0!important;height:38px!important;padding:0!important;border:0!important;text-align:center!important;font-size:16px!important}
html body .samv3-cartsheet .cart-line .sam-cart-remove{width:38px!important;height:38px!important;min-width:0!important;padding:0!important;margin:0!important}
html body .samv3-cartsheet .cart-line .nm{font-size:14px!important;line-height:1.3!important}
}

/* ===== SAM 2.0.3 — bảng vừa khung, form gọn (chỉ máy tính ≥ 900px; mobile giữ nguyên) ===== */
@media (min-width:900px){
  /* Lịch sử duyệt: vừa bảng, không kéo ngang, chi tiết 2 dòng */
  html body .sam-ap-history .tablewrap{overflow-x:hidden!important}
  html body .main .sam-ap-history table.sam-lap,html body .sam-ap-history table{table-layout:fixed!important;width:100%!important;min-width:0!important}
  html body .main .sam-ap-history table.sam-lap th,html body .main .sam-ap-history table.sam-lap td,html body .sam-ap-history th,html body .sam-ap-history td{white-space:normal!important;word-break:break-word;padding:7px 6px!important;vertical-align:middle}
  html body .sam-ap-history th:nth-child(1){width:4%}  html body .sam-ap-history th:nth-child(2){width:9%}
  html body .sam-ap-history th:nth-child(3){width:19%} html body .sam-ap-history th:nth-child(4){width:8%}
  html body .sam-ap-history th:nth-child(5){width:10%} html body .sam-ap-history th:nth-child(6){width:10%}
  html body .sam-ap-history th:nth-child(7){width:9%}  html body .sam-ap-history th:nth-child(8){width:13%}
  html body .sam-ap-history th:nth-child(9){width:18%}
  html body .sam-ap-history .sam-his-detail{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important;max-height:none!important;white-space:normal!important}
  html body .sam-ap-history .sam-col-status{display:table-cell}
  html body .sam-ap-history .sam-col-status .pill,html body .sam-ap-history .sam-col-status>div{display:inline-block;margin:2px 2px 2px 0}
  /* Sổ kho: 16 cột vừa khung; bảng dài thì thanh kéo luôn ở đáy màn hình + tiêu đề cột đứng yên */
  html body .sl-ledger-wrap .sam-ui-scroll-x{max-height:calc(100vh - 150px);overflow:auto!important}
  html body .main table.sl-ledger.sam-lap,html body table.sl-ledger{table-layout:fixed!important;width:100%!important;min-width:860px!important}
  html body .main table.sl-ledger.sam-lap th,html body table.sl-ledger th{white-space:normal!important;line-height:1.2;padding:6px 4px!important;position:sticky;top:0;z-index:3;background:#f4ede7}
  html body .main table.sl-ledger.sam-lap tbody tr td,html body .main table.sl-ledger.sam-lap td,html body table.sl-ledger td{white-space:normal!important;padding:6px 4px!important;word-break:break-word}
  html body table.sl-ledger th:nth-child(1){width:5.5%} html body table.sl-ledger th:nth-child(2){width:6.5%}
  html body table.sl-ledger th:nth-child(3){width:11.5%} html body table.sl-ledger th:nth-child(4){width:4.5%}
  html body table.sl-ledger th:nth-child(n+5){width:6%}
  /* Nhà cung cấp: vừa bảng */
  html body .supplier-master-table .tablewrap{overflow-x:hidden!important}
  html body .main .supplier-master-table table.sam-lap,html body .supplier-master-table table{table-layout:fixed!important;width:100%!important;min-width:0!important}
  html body .main .supplier-master-table table.sam-lap th,html body .main .supplier-master-table table.sam-lap td,html body .supplier-master-table th,html body .supplier-master-table td{white-space:normal!important;word-break:break-word;padding:7px 6px!important}
  html body .supplier-master-table th:nth-child(1){width:7%}  html body .supplier-master-table th:nth-child(2){width:20%}
  html body .supplier-master-table th:nth-child(3){width:10%} html body .supplier-master-table th:nth-child(4){width:10%}
  html body .supplier-master-table th:nth-child(5){width:22%} html body .supplier-master-table th:nth-child(6){width:8%}
  html body .supplier-master-table th:nth-child(7){width:8%}  html body .supplier-master-table th:nth-child(8){width:15%}
  html body .supplier-master-table td:last-child{display:table-cell}
  html body .supplier-master-table td:last-child .btn,html body .supplier-master-table td:last-child button{padding:4px 8px!important;font-size:11.5px!important;margin:2px!important;min-height:0!important}
  /* Nhập trực tiếp: 5 ô tổng 1 hàng, bộ lọc 1 hàng */
  html body .dp13-kpis{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:8px!important;margin:8px 0!important}
  html body .dp13-kpi{padding:8px 12px!important;min-height:0!important}
  html body .dp13-kpi-value{font-size:18px!important}
  html body .dp13-page>section.card>form.formgrid{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr)) auto auto!important;gap:8px!important;align-items:end}
  html body .dp13-page>section.card>form.formgrid>*{grid-column:auto!important;min-width:0}
  html body .dp13-page>section.card>form.formgrid .btn{padding:9px 14px!important;white-space:nowrap}
}
/* Trung tâm thông báo: gọn (mọi khổ màn) */
html body .sam-nt-test{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:8px 12px!important;margin:0 0 8px!important;font-size:12.5px}
html body .sam-nt-test .btn{padding:5px 10px!important;font-size:12px!important;min-height:0!important}
html body .sam-nt-test .sam-nt-rs:empty{display:none}
html body .sam-bell2-head{margin:0 0 4px!important;padding:0!important}
html body .sam-bell2-tabs{margin:0 0 6px!important}
html body .sam-bell2-tabs a{padding:6px 10px!important}
html body form.sam-bell2-filters{display:flex!important;flex-wrap:wrap;gap:8px!important;align-items:end;margin:0 0 8px!important}
html body form.sam-bell2-filters label{flex:1 1 200px;margin:0!important}
html body form.sam-bell2-filters select{height:36px!important;padding:4px 8px!important}
html body form.sam-bell2-filters .btn{height:36px;padding:0 16px!important}
html body .sam-bell2 h3{margin:6px 0!important;font-size:14px!important}
html body a.sam-bell2-entry{padding:8px 12px!important;margin:0 0 6px!important;min-height:0!important;gap:10px!important}
html body a.sam-bell2-entry .sam-bell2-ico{width:28px!important;height:28px!important;min-width:28px!important;font-size:14px!important}
html body a.sam-bell2-entry .sam-bell2-main{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:0;align-items:baseline;line-height:1.35}
html body a.sam-bell2-entry .sam-bell2-meta{flex-basis:100%;font-size:11.5px!important;margin:0!important}
/* Lịch sử duyệt: Nội dung bấm được + khung xem nhanh */
html body a.sam-his-open{color:#5a3216;font-weight:700;text-decoration:underline dotted;cursor:pointer}
#sam-doc-pop{position:fixed;inset:0;z-index:10000;background:rgba(30,20,14,.45);display:flex;align-items:center;justify-content:center;padding:16px}
#sam-doc-pop .box{background:#fff;border-radius:12px;max-width:520px;width:100%;max-height:88vh;overflow:auto;padding:16px 18px;box-shadow:0 12px 40px rgba(0,0,0,.25)}
#sam-doc-pop h3{margin:0 0 10px;font-size:16px}
#sam-doc-pop table{width:100%;border-collapse:collapse;font-size:13.5px}
#sam-doc-pop td{padding:6px 4px;border-bottom:1px solid #eee4dc;vertical-align:top}
#sam-doc-pop td:first-child{color:#7a6a5e;width:34%;white-space:nowrap}
#sam-doc-pop img{max-width:100%;border-radius:8px;margin-top:10px}
#sam-doc-pop .x{float:right;border:0;background:#efe7e1;border-radius:8px;padding:4px 10px;cursor:pointer;font-weight:700}

/* 2.0.3 bổ sung: thông báo — tăng độ ưu tiên */
html body .main .sam-bell2{max-width:none!important;margin-left:0!important;margin-right:0!important}
html body .main .sam-bell2 a.sam-bell2-entry.sam-bell2-link{padding:7px 12px!important;margin:0 0 6px!important}
html body .main .sam-bell2 a.sam-bell2-entry .sam-bell2-main{flex-direction:row!important;flex-wrap:wrap!important;align-items:baseline}
html body .main .sam-bell2 a.sam-bell2-entry .sam-bell2-main>div{flex:0 1 auto}
html body .main .sam-bell2 a.sam-bell2-entry .sam-bell2-main>div.sam-bell2-meta{flex:1 0 100%}
html body .main .sam-bell2 .sam-bell2-head{display:flex;justify-content:space-between;align-items:center}
html body .main .sam-bell2 .sam-bell2-head .btn{padding:6px 12px!important;font-size:12.5px!important;min-height:0!important}
@media (min-width:900px){html body .main .sam-bell2 .sam-bell2-tabs{display:inline-flex;margin-right:12px!important}}

/* ===== SAM 2.0.4 — MỌI bảng dữ liệu trên máy tính vừa khung (không để từng màn tự tràn) ===== */
@media (min-width:900px){
  html body .main table.sam-datatable,html body .main table.sam-lap,html body .main .sam-ui-scroll-x>table{min-width:0!important;max-width:100%}
  html body .main .tablewrap>table.sam-datatable,html body .main .tablewrap>table.sam-lap{width:100%!important}
  html body .main table.sam-datatable>thead>tr>th,html body .main table.sam-lap>thead>tr>th{white-space:normal!important;line-height:1.25;padding:7px 6px!important;vertical-align:bottom}
  html body .main table.sam-datatable>tbody>tr>td,html body .main table.sam-lap>tbody>tr>td{white-space:normal!important;overflow-wrap:break-word;padding:7px 6px!important}
  html body .main table.sam-datatable td .btn,html body .main table.sam-lap td .btn,html body .main table.sam-datatable td button,html body .main table.sam-lap td button{white-space:nowrap;padding:5px 9px!important;font-size:12px!important;min-height:0!important;margin:2px 2px 2px 0!important;line-height:1.2}
  html body .main table.sam-datatable td form,html body .main table.sam-lap td form{display:inline-block;margin:0}
}

/* 2.0.4: Hủy / hao hụt — bố cục như Sơ chế: dòng thêm thẳng cột, nút ✕ cùng hàng, GỬI DUYỆT ở hàng đầu bên phải */
@media (min-width:900px){
  html body form.sam-waste-one-row{display:grid!important;grid-template-columns:minmax(220px,2.2fr) 110px minmax(170px,1.6fr) minmax(170px,190px) auto!important;gap:8px 10px!important;align-items:end!important}
  html body form.sam-waste-one-row>.field{grid-column:auto!important;min-width:0;margin:0!important}
  html body form.sam-waste-one-row .qtybox>button{display:none!important}
  html body form.sam-waste-one-row .qtybox{display:block!important}
  html body form.sam-waste-one-row .sam-waste-evidence label[data-sam-opt]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0!important}
  html body form.sam-waste-one-row .sam-waste-evidence label[data-sam-opt]::after{content:"Ảnh (chung cả phiếu)";font-size:12px}
  html body form.sam-waste-one-row .sam-waste-evidence-actions .btn{padding:0 8px!important;height:40px;font-size:12px!important;width:100%;white-space:nowrap}
  html body form.sam-waste-one-row .sam-waste-evidence-status{display:none!important}
  html body form.sam-waste-one-row>div:last-child{grid-column:5!important;grid-row:1!important;align-self:end}
  html body form.sam-waste-one-row>div:last-child .btn{height:40px;padding:0 16px!important;font-size:12.5px!important;white-space:nowrap;min-height:0!important}
  html body form.sam-waste-one-row .sam-waste-lines{grid-column:1/5!important;display:grid!important;grid-template-columns:subgrid!important;row-gap:8px}
  html body form.sam-waste-one-row .sam-waste-line{grid-column:1/5;display:grid!important;grid-template-columns:subgrid!important;align-items:center;margin:0!important}
  html body form.sam-waste-one-row .sam-waste-line>*{min-width:0;width:100%!important;margin:0!important;height:40px}
  html body form.sam-waste-one-row .sam-waste-line>.sam-wl-tools{display:flex!important;gap:6px;height:auto;width:auto!important}
  html body form.sam-waste-one-row .sam-wl-tools>.btn{width:40px!important;height:40px;padding:0!important;display:inline-flex;align-items:center;justify-content:center;margin:0!important}
  html body form.sam-waste-one-row .sam-waste-addline{grid-column:1;justify-self:start;padding:7px 12px!important;font-size:12px!important;min-height:0!important}
}
/* 2.0.4: Báo cáo — ô lọc cao bằng nhau, thẳng hàng */
html body form.sam-rep-filter-inline{align-items:flex-end!important}
html body form.sam-rep-filter-inline input,html body form.sam-rep-filter-inline select,html body form.sam-rep-filter-inline .sam-autocomplete-input,html body form.sam-rep-filter-inline .btn{height:40px!important;min-height:40px!important;box-sizing:border-box!important;margin-top:0!important;margin-bottom:0!important;vertical-align:bottom}
html body form.sam-rep-filter-inline .sam-autocomplete{margin:0!important;align-self:flex-end;display:inline-block}
html body form.sam-rep-filter-inline input[type=date]{padding-top:0!important;padding-bottom:0!important;line-height:38px}
/* 2.0.4: Đơn NCC — gọn phần đầu */
@media (min-width:900px){
  html body .sam-po-list-guide{padding:6px 12px!important;margin:0 0 8px!important;font-size:12.5px}
  html body .sam-po-list-guide br{display:none}
  html body .sam-po-list-guide b{margin-right:8px}
  html body .sam-po-list-overview{padding:0!important;margin:0 0 8px!important;border:0!important;box-shadow:none!important;background:transparent!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:8px!important}
  html body .sam-po-list-overview>div{padding:7px 12px!important;min-height:0!important}
  html body .sam-po-list-overview>div b{font-size:17px!important}
  html body .sam-po-list-overview+.toolbar{margin:0 0 8px!important}
}

/* 2.0.6: nút 📷 / ✕ từng dòng hủy (mọi khổ) */
html body .sam-waste-line .sam-wl-tools{display:flex;gap:6px;align-items:center}
html body .sam-waste-line .sam-wl-cam.has-photo{background:#e9f5ed!important;border-color:#9bcfae!important}
@media (max-width:899px){html body .sam-waste-line{grid-template-columns:minmax(0,1fr) 92px!important}html body .sam-waste-line .sam-wl-tools{justify-content:flex-end}html body .sam-waste-line .sam-wl-tools .btn{width:42px;height:42px;padding:0!important;margin:0!important}}
@media (min-width:900px){
  html body form.sam-waste-one-row .sam-waste-evidence{position:relative}
  html body form.sam-waste-one-row .sam-waste-evidence-actions{display:flex;gap:6px}
  html body form.sam-waste-one-row .sam-waste-evidence-actions .btn{flex:1 1 auto;width:auto}
  html body form.sam-waste-one-row .sam-waste-remove-photo{flex:0 0 auto!important;padding:0 8px!important;font-size:11px!important}
  html body form.sam-waste-one-row img.sam-waste-evidence-preview{position:absolute;right:0;top:-2px;width:22px!important;height:22px!important;max-height:22px!important;object-fit:cover;border-radius:4px;margin:0!important}
}

/* ===== SAM 2.0.7 — CHUẨN GIAO DIỆN CHUNG (1 nơi quy định, áp mọi màn) =====
   Máy tính: nút thường cao 40px (bằng ô nhập, đứng cạnh nhau thẳng hàng), nút trong bảng 30px, chữ nút 13/12px, ô nhập 40px chữ 14px.
   Điện thoại: nút 44px chữ 14px, ô nhập 44px chữ 16px (iPhone không tự phóng to khi bấm vào ô). */
@media (min-width:900px){
  html body .main .content .btn{min-height:0!important;height:auto!important;padding:10px 14px!important;font-size:13px!important;line-height:18px!important;border-radius:9px!important;box-sizing:border-box}
  html body .main .content input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),html body .main .content select{height:40px;box-sizing:border-box}
  html body .main .content td .btn,html body .main .content td button.btn{padding:5px 10px!important;font-size:12px!important;line-height:18px!important}
  html body .main .content input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),html body .main .content select{font-size:14px!important}
  html body .main .content label{font-size:12px}
}
@media (max-width:899px){
  html body .main .content .btn,html body .main .content button.sam-row-act-btn,html body .main .content .samv3-ledger-filterbtn{min-height:44px!important;height:auto!important;font-size:14px!important;border-radius:10px!important;box-sizing:border-box}
  html body .main .content input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),html body .main .content select,html body .main .content textarea{font-size:16px!important;min-height:44px!important;height:auto}
  html body .main .content td .btn{min-height:36px!important;font-size:13px!important}
  html body .main .content input[type=date]{min-height:44px}
}

/* ===== SAM 2.0.8 — MÀN BÁN HÀNG làm gọn (máy tính + điện thoại) ===== */
/* Giỏ hàng: 1 dòng = tên | [− SL +] | ✕ nhỏ */
html body .cart-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;padding:8px 2px!important}
html body .cart-line>div:last-child{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important;justify-content:flex-end}
html body .cart-line .qtybox{display:inline-flex!important;align-items:stretch;border:1px solid #d9ccc2;border-radius:8px;overflow:hidden;height:32px;background:#fff}
html body .cart-line .qtybox>button{display:inline-flex!important;align-items:center;justify-content:center;width:28px!important;min-width:28px!important;height:30px!important;min-height:0!important;border:0!important;border-radius:0!important;background:#f3ede8!important;padding:0!important;margin:0!important;font-size:16px!important;line-height:1;color:#3a2a20}
html body .cart-line .qtybox>input{width:42px!important;min-width:0!important;height:30px!important;min-height:0!important;border:0!important;border-radius:0!important;text-align:center!important;padding:0!important;margin:0!important;font-size:14px!important;box-shadow:none!important}
html body .cart-line button.sam-cart-remove{width:26px!important;min-width:26px!important;height:26px!important;min-height:0!important;margin:0 0 0 2px!important;padding:0!important;border-radius:50%!important;border:1px solid #e6cfc9!important;background:transparent!important;color:#a8392d!important;font-size:0!important;display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 auto}
html body .cart-line button.sam-cart-remove{position:relative!important;overflow:hidden!important;text-indent:-9999px!important}
html body .cart-line button.sam-cart-remove::after{content:"✕";font-size:12px;line-height:1;text-indent:0;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#a8392d}
html body .cart-line button.sam-cart-remove:hover{background:#fdecea!important}
html body .cart-line button.sam-cart-remove *{display:none!important}
@media (max-width:899px){
  html body .cart-line .qtybox{height:38px}
  html body .cart-line .qtybox>button{width:36px!important;min-width:36px!important;height:36px!important;font-size:18px!important}
  html body .cart-line .qtybox>input{width:44px!important;height:36px!important;font-size:16px!important}
  html body .cart-line button.sam-cart-remove{width:32px!important;min-width:32px!important;height:32px!important}
  html body .cart-line button.sam-cart-remove::after{font-size:14px}
  /* Lưới món trên điện thoại: thẻ gọn, không còn ô chữ to "BI/BÁ" khi món chưa có ảnh */
  html body .samv3-pos .samv3-products .samv3-product.product-card.moderns{gap:8px!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"thumb thumb" "name name" "meta meta" "stock stock" "price plus"!important;row-gap:2px!important;column-gap:6px!important;padding:10px!important;min-height:0!important;height:auto!important;align-content:start}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-thumb{grid-area:thumb;height:84px!important;min-height:0!important;margin:0 0 6px!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-thumb:not(:has(img)){display:none!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-name{grid-area:name;font-weight:700;font-size:14px!important;line-height:1.3!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.6em;margin:0!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-meta{grid-area:meta;margin:0!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-stock{grid-area:stock;margin:0!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-price{grid-area:price;align-self:center;font-size:15px!important;font-weight:800;margin:4px 0 0!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-plus{grid-area:plus;position:static!important;width:38px!important;height:38px!important;min-height:0!important;font-size:22px!important;align-self:end;margin:0!important}
}

/* ===================================================================================
   SAM 2.1.0 — CHUẨN GIAO DIỆN MỚI (đã duyệt 30/11): font Be Vietnam Pro + MÀN BÁN HÀNG
   Chỉ đổi cách hiển thị. Không đổi nút, form, đường dẫn, cách lưu — nghiệp vụ giữ nguyên.
   =================================================================================== */
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:400;src:url(/sam-ui/be-vietnam-pro-vietnamese-400-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:500;src:url(/sam-ui/be-vietnam-pro-vietnamese-500-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:600;src:url(/sam-ui/be-vietnam-pro-vietnamese-600-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:700;src:url(/sam-ui/be-vietnam-pro-vietnamese-700-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:800 900;src:url(/sam-ui/be-vietnam-pro-vietnamese-800-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:400;src:url(/sam-ui/be-vietnam-pro-latin-ext-400-normal.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:500;src:url(/sam-ui/be-vietnam-pro-latin-ext-500-normal.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:600;src:url(/sam-ui/be-vietnam-pro-latin-ext-600-normal.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:700;src:url(/sam-ui/be-vietnam-pro-latin-ext-700-normal.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:800 900;src:url(/sam-ui/be-vietnam-pro-latin-ext-800-normal.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:400;src:url(/sam-ui/be-vietnam-pro-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:500;src:url(/sam-ui/be-vietnam-pro-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:600;src:url(/sam-ui/be-vietnam-pro-latin-600-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:700;src:url(/sam-ui/be-vietnam-pro-latin-700-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-display:swap;font-weight:800 900;src:url(/sam-ui/be-vietnam-pro-latin-800-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
html body,html body button,html body input,html body select,html body textarea{font-family:"Be Vietnam Pro","Segoe UI",system-ui,-apple-system,sans-serif!important}

/* ---------- BÁN HÀNG — MÁY TÍNH ---------- */
@media (min-width:900px){
  html body .pos-real-split{gap:16px!important;align-items:stretch}
  html body .pos-real-split .bill-tabs{gap:6px!important;margin:0 0 10px!important;align-items:center!important}
  html body .pos-real-split .sam-bill-tab-822g{display:inline-flex!important;align-items:center;gap:2px;height:36px;border:1px solid #3b2417!important;border-radius:10px!important;background:#fff!important;padding:0 4px 0 12px!important}
  html body .pos-real-split .sam-bill-tab-822g:not(.active){border-color:#e3d6cb!important}
  html body .pos-real-split .sam-bill-tab-822g button{border:0!important;background:transparent!important;font-weight:700!important;font-size:13px!important;padding:0 6px!important;height:34px!important;min-height:0!important;color:#2b1d14!important}
  html body .pos-real-split .sam-bill-plus-822g{width:36px!important;height:36px!important;min-height:0!important;border:1px solid #e3d6cb!important;border-radius:10px!important;background:#fff!important;font-size:18px!important;padding:0!important}
  html body .pos-real-split .sam-bill-held-822g{height:36px!important;min-height:0!important;border:1px solid #e3d6cb!important;border-radius:10px!important;background:#efe6dd!important;font-weight:600!important;font-size:13px!important;padding:0 14px!important}
  html body .pos-real-split .pos-topline{gap:8px!important;align-items:center!important;margin:0 0 10px!important}
  html body .pos-real-split form.pos-search{flex:1 1 auto}
  html body .pos-real-split form.pos-search input[name=q]{height:44px!important;border:1.5px solid #3b2417!important;border-radius:12px!important;font-size:15px!important;padding:0 14px!important;background:#fff!important;box-shadow:none!important;width:100%!important}
  html body .pos-real-split .pos-topline .pill{height:32px;display:inline-flex;align-items:center;border-radius:999px!important;font-size:12px!important;padding:0 12px!important;white-space:nowrap}
  html body .pos-real-split .category-tabs{display:flex!important;flex-wrap:wrap!important;gap:6px!important;overflow:visible!important;margin:0 0 12px!important;padding:0!important;border:0!important}
  html body .pos-real-split .category-tabs a{border-radius:999px!important;border:1px solid #e3d6cb!important;background:#fff!important;color:#2b1d14!important;padding:7px 14px!important;font-size:13px!important;font-weight:500!important;text-decoration:none!important;white-space:nowrap}
  html body .pos-real-split .category-tabs a.active{background:#3b2417!important;border-color:#3b2417!important;color:#fff!important;font-weight:600!important}
  html body .pos-real-split .pos-left-pane .pos-products{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(160px,1fr))!important;grid-auto-rows:auto!important;grid-template-rows:none!important;gap:10px!important;align-content:start!important;overflow-y:auto!important}
  html body .pos-real-split .pos-products .product-card.modern.compact{display:flex!important;flex-direction:column!important;height:auto!important;min-height:196px!important;max-height:none!important;overflow:hidden!important;padding:10px!important;border:1px solid #eadfd5!important;border-radius:12px!important;background:#fff!important;gap:4px!important;position:relative;box-shadow:none!important;cursor:pointer}
  html body .pos-real-split .pos-products .product-card.modern.compact:hover{border-color:#3b2417!important}
  html body .pos-real-split .product-card .product-thumb{width:100%!important;height:84px!important;min-height:0!important;border-radius:8px!important;overflow:hidden;margin:0 0 4px!important;background:linear-gradient(135deg,#efe3d7,#e2cfbe)!important;display:flex!important;align-items:center;justify-content:center;flex:0 0 auto}
  html body .pos-real-split .product-card .product-thumb img{width:100%!important;height:100%!important;object-fit:cover!important}
  html body .pos-real-split .product-card .product-info{display:flex!important;flex-direction:column!important;gap:2px!important;flex:1 1 auto;min-width:0;padding:0!important}
  html body .pos-real-split .product-card .product-info .name{font-size:13.5px!important;font-weight:700!important;line-height:1.3!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.6em}
  html body .pos-real-split .product-card .product-info .meta{font-size:12px!important;color:#8a6a55!important}
  html body .pos-real-split .product-card .product-info .stock{font-size:12px!important;font-weight:600!important}
  html body .pos-real-split .product-card .product-info .price{font-size:15px!important;font-weight:800!important;margin-top:4px!important;padding:0!important;background:transparent!important}
  html body .pos-real-split .product-card .product-plus{position:absolute!important;right:10px!important;bottom:10px!important;width:32px!important;height:32px!important;min-height:0!important;border-radius:50%!important;background:#3b2417!important;color:#fff!important;border:0!important;font-size:18px!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}
  html body .pos-real-split aside.cart.pos-right-pane{background:#fff!important;border:1px solid #eadfd5!important;border-radius:14px!important;box-shadow:none!important;display:flex!important;flex-direction:column!important;padding:0!important;overflow:hidden}
  html body .pos-real-split aside.cart .cart-head{padding:14px 16px!important;border-bottom:1px solid #f0e7df!important;font-weight:700!important;display:flex!important;justify-content:space-between;align-items:center;background:#fff!important;color:#2b1d14!important;font-size:15px!important;text-transform:none}
  html body .pos-real-split aside.cart form#checkoutForm{display:flex!important;flex-direction:column!important;flex:1 1 auto;min-height:0}
  html body .pos-real-split aside.cart .cart-lines{flex:1 1 auto;overflow-y:auto!important;padding:0 16px!important;min-height:120px;max-height:none!important}
  html body .pos-real-split aside.cart .cart-bottom{padding:12px 16px 16px!important;border-top:1px solid #f0e7df!important;display:flex;flex-direction:column;gap:10px;background:#fff!important;flex:0 0 auto}
  html body .pos-real-split aside.cart .cart-total{display:flex!important;justify-content:space-between;align-items:baseline;margin:0!important}
  html body .pos-real-split aside.cart .cart-total small{font-size:13px!important;font-weight:700!important;color:#6b5547!important}
  html body .pos-real-split aside.cart #cartTotal{font-size:28px!important;font-weight:800!important;color:#2b1d14!important}
  html body .pos-real-split aside.cart .pos-actions{display:grid!important;grid-template-columns:1fr 2fr!important;gap:8px!important}
  html body .pos-real-split aside.cart .pos-actions .btn{height:48px!important;border-radius:12px!important;font-size:14px!important;font-weight:700!important;padding:0 12px!important}
  html body .pos-real-split aside.cart .pos-actions .btn.blue{background:#3b2417!important;border-color:#3b2417!important;color:#fff!important}
  html body .pos-real-split aside.cart .pos-actions .btn.secondary{background:#efe6dd!important;border:1px solid #e3d6cb!important;color:#2b1d14!important}
}
/* Ô ảnh món chưa có ảnh: biểu tượng ảnh thay cho chữ viết tắt (máy tính + điện thoại) */
html body .product-card .product-thumb:not(:has(img))>span,html body .samv3-product .samv3-thumb:not(:has(img)){font-size:0!important;color:transparent!important}
html body .product-card .product-thumb:not(:has(img)),html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-thumb:not(:has(img)){background:linear-gradient(135deg,#efe3d7,#e2cfbe) center/auto no-repeat!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23a07d63' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M21 16l-5-5-8 8'/%3E%3C/svg%3E"),linear-gradient(135deg,#efe3d7,#e2cfbe)!important;background-position:center,center!important;background-repeat:no-repeat!important}

/* ---------- BÁN HÀNG — ĐIỆN THOẠI ---------- */
@media (max-width:899px){
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-thumb,html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-thumb:not(:has(img)){display:flex!important;height:96px!important;border-radius:10px!important;overflow:hidden;margin:0 0 6px!important}
  html body .samv3-pos .samv3-thumb img{width:100%!important;height:100%!important;object-fit:cover!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern{border:1px solid #eadfd5!important;border-radius:12px!important;box-shadow:none!important}
  html body .samv3-pos .samv3-products .samv3-product.product-card.modern>.samv3-plus{width:36px!important;height:36px!important;background:#3b2417!important;color:#fff!important;border-radius:50%!important}
  /* Giỏ hàng trượt lên: danh sách cuộn trong khung, tổng tiền + nút luôn ở dưới */
  html body .samv3-cartsheet .cart-lines{max-height:none!important;flex:1 1 auto;overflow-y:auto!important;min-height:0}
  html body .samv3-cartsheet .cart-line .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body .samv3-cartsheet .cart-line>div:first-child{min-width:0}
  html body .samv3-cartsheet .pos-actions .btn.blue{background:#3b2417!important;border-color:#3b2417!important}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-thumb{width:100%!important;max-width:none!important;height:84px!important;grid-column:auto!important;grid-row:auto!important;position:static!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info{position:static!important;padding:0!important;grid-column:auto!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .price{position:static!important;background:none!important;padding:0!important;margin:4px 0 0!important;width:auto!important;border:0!important;box-shadow:none!important;left:auto!important;right:auto!important;bottom:auto!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact::after,html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact::before{display:none!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-plus{position:absolute!important;right:10px!important;bottom:10px!important;top:auto!important;left:auto!important}
  html body .pos-real-split aside.cart .cart-head,html body .pos-real-split aside.cart .cart-head span{text-transform:none!important;letter-spacing:0!important}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-thumb:not(:has(img)){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23a07d63' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M21 16l-5-5-8 8'/%3E%3C/svg%3E"),linear-gradient(135deg,#efe3d7,#e2cfbe)!important;background-position:center,center!important;background-repeat:no-repeat,no-repeat!important;background-size:30px 30px,auto!important}
}
html body .samv3-cartsheet .cart-head{display:flex!important;justify-content:space-between!important;align-items:center;gap:8px;text-transform:none!important;font-size:16px!important}
html body .cart-head #cartCount{margin-left:auto!important}

/* ===== SAM UI 2.1.1: hóa đơn + in báo cáo 80mm ===== */
/* Màn hóa đơn: số không xuống dòng, cột tên tự co */
html body #receipt table th:not(:first-child),
html body #receipt table td.num{white-space:nowrap!important;word-break:normal!important}
html body #receipt table td.num{font-variant-numeric:tabular-nums}
@media (max-width:640px){
  html body #receipt table th,html body #receipt table td{padding-left:6px!important;padding-right:6px!important}
  html body #receipt table td.num,html body #receipt table th:not(:first-child){font-size:14px!important}
}
/* Mã hàng in đậm, không mờ */
html body #receipt .receipt-sold-sku{color:#000!important;opacity:1!important;font-weight:700!important}
@media print{
  html body #receipt table th:not(:first-child),html body #receipt table td.num{font-size:9px!important;padding-left:.5mm!important;padding-right:.5mm!important}
  html body #receipt .receipt-sold-sku{font-size:9px!important}
}
/* Báo cáo bán hàng in 80mm: cùng khổ với hóa đơn (80mm, lề 4mm) -> không tràn phải */
@media print{
  html body #samSalesPrint.sales-print-80{width:70mm!important;max-width:70mm!important;min-width:0!important;padding:2mm 1mm!important;box-sizing:border-box!important;font-family:Arial,sans-serif!important;color:#000!important}
  html body #samSalesPrint.sales-print-80 *{font-family:Arial,sans-serif!important;color:#000!important}
}
html body #samSalesPrint.sales-print-80 .sp-name small{opacity:1!important;color:#000!important;font-size:9px!important;font-weight:700}
html body #samSalesPrint.sales-print-80 .sp-meta>div,html body #samSalesPrint.sales-print-80 .sp-summary>div{gap:4px}
html body #samSalesPrint.sales-print-80 .sp-meta b,html body #samSalesPrint.sales-print-80 .sp-summary b{text-align:right;min-width:0;overflow-wrap:anywhere}
html body #samSalesPrint.sales-print-80 .sp-columns,html body #samSalesPrint.sales-print-80 .sp-item{grid-template-columns:minmax(0,1fr) 20px 46px 52px!important;gap:2px!important}
html body #samSalesPrint.sales-print-80 .sp-qty,html body #samSalesPrint.sales-print-80 .sp-price,html body #samSalesPrint.sales-print-80 .sp-money,html body #samSalesPrint.sales-print-80 .sp-columns b{white-space:nowrap;font-size:10px!important}
html body #samSalesPrint.sales-print-80 .sp-item,html body #samSalesPrint.sales-print-80 .sp-industry,html body #samSalesPrint.sales-print-80 .sp-category,html body #samSalesPrint.sales-print-80 .sp-meta,html body #samSalesPrint.sales-print-80 .sp-summary{font-size:10.5px!important}
html body #samSalesPrint.sales-print-80 .sp-industry,html body #samSalesPrint.sales-print-80 .sp-category{gap:4px}

/* 2.1.1: gợi ý khi lọc nhanh không thấy dòng nào */
.sam-live-hint{margin:6px 0 8px;padding:8px 12px;border:1px dashed #E3D6CB;border-radius:10px;background:#FBF8F4;color:#6b5547;font-size:13px}
/* 2.1.1: giỏ hàng điện thoại — tên món đủ 1 dòng riêng (không cắt "..."), dòng dưới: mã·giá bên trái, nút −/+ nhỏ gọn + ✕ bên phải */
@media (max-width:760px){
  html body .samv3-cartsheet .cart-line,html body .pos-real-split .cart-line{grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;row-gap:4px!important;column-gap:8px!important;padding:8px 10px!important;min-height:0!important}
  html body .samv3-cartsheet .cart-line>div:first-child,html body .pos-real-split .cart-line>div:first-child{display:contents!important}
  html body .samv3-cartsheet .cart-line .nm,html body .pos-real-split .cart-line .nm{grid-column:1/-1!important;grid-row:1!important;display:block!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;-webkit-line-clamp:unset!important;max-height:none!important;font-size:15px!important;line-height:1.3!important}
  html body .samv3-cartsheet .cart-line .sub,html body .pos-real-split .cart-line .sub{grid-column:1!important;grid-row:2!important;align-self:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  html body .samv3-cartsheet .cart-line>div:last-child,html body .pos-real-split .cart-line>div:last-child{grid-column:2!important;grid-row:2!important;gap:6px!important}
  html body .samv3-cartsheet .cart-line .qtybox,html body .pos-real-split .cart-line .qtybox{display:inline-grid!important;grid-template-columns:30px 36px 30px!important;height:32px!important;border-radius:8px!important}
  html body .samv3-cartsheet .cart-line .qtybox button,html body .pos-real-split .cart-line .qtybox>button{width:30px!important;min-width:0!important;height:30px!important;font-size:16px!important}
  html body .samv3-cartsheet .cart-line .qtybox input,html body .pos-real-split .cart-line .qtybox>input{width:36px!important;height:30px!important;font-size:16px!important}
  html body .samv3-cartsheet .cart-line .sam-cart-remove,html body .pos-real-split .cart-line button.sam-cart-remove{width:30px!important;min-width:30px!important;height:30px!important}
}
@media (max-width:899px){
  /* 2.1.1: khung danh sách món trong giỏ tự cuộn, phần loại bán / tổng tiền / nút luôn nằm ngay dưới (không bị món đè) */
  html body .samv3-pos .samv3-cartsheet .cart-lines{max-height:calc(100vh - 345px)!important;max-height:calc(100dvh - 345px - env(safe-area-inset-bottom,0px))!important;min-height:150px!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
  html body .samv3-pos .samv3-cartsheet .cart-line span.qtybox{align-items:stretch!important;height:32px!important;min-height:0!important;max-height:32px!important;overflow:hidden!important}
  html body .main .content .samv3-pos .samv3-cartsheet .cart-line span.qtybox>input[type=number]:not([type=hidden]):not([type=checkbox]):not([type=radio]){height:30px!important;min-height:0!important;max-height:30px!important;line-height:30px!important;align-self:stretch!important;padding:0!important}
}
/* 2.1.1: số việc trong menu điện thoại */
#samMobDrawerV2 a.sam-mob-link{position:relative}
#samMobDrawerV2 a.sam-mob-link .sam-dbadge{margin-left:auto;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#B42318;color:#fff;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1;flex:0 0 auto}
@media (max-width:899px){
  /* 2.1.2: bỏ khoảng trống dưới nút Thanh toán trong giỏ hàng điện thoại */
  html body .samv3-pos .samv3-cartsheet{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))!important}
}

/* ===== SAM UI 2.2.0: DANH SÁCH — thanh tìm + chip trạng thái + nhãn trạng thái ===== */
.sam-lk-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0 8px;padding:10px 12px;background:#fff;border:1px solid #E3D6CB;border-radius:12px}
.sam-lk-bar .sam-lk-q{flex:1 1 240px;min-width:0;max-width:420px;height:40px;box-sizing:border-box;border:1px solid #E3D6CB;border-radius:10px;padding:0 12px 0 34px;font:400 14px "Be Vietnam Pro",system-ui,sans-serif;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b5547' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 11px center no-repeat}
.sam-lk-bar .sam-lk-q:focus{outline:2px solid #3B2417;outline-offset:0;border-color:#3B2417}
.sam-lk-chips{display:flex;gap:6px;flex-wrap:wrap}
html body .sam-lk-bar .sam-lk-chip{height:32px;min-height:0;padding:0 12px;border-radius:999px;border:1px solid #E3D6CB;background:#fff;color:#2b1d14;font:600 13px "Be Vietnam Pro",system-ui,sans-serif;cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;text-transform:none;letter-spacing:0;box-shadow:none}
html body .sam-lk-bar .sam-lk-chip b{font-weight:700;color:#6b5547;font-size:12px}
html body .sam-lk-bar .sam-lk-chip.on{background:#3B2417;border-color:#3B2417;color:#fff}
html body .sam-lk-bar .sam-lk-chip.on b{color:#f3e6da}
.sam-lk-count{margin-left:auto;color:#6b5547;font-size:13px;white-space:nowrap}
.sam-st{display:inline-flex;align-items:center;padding:3px 9px;border-radius:999px;font-size:12px!important;font-weight:700;line-height:1.3;white-space:nowrap;border:0}
html body .sam-st.sam-st-ok{background:#e8f4ee!important;color:#1F7A4D!important}
html body .sam-st.sam-st-warn{background:#fdf0e3!important;color:#B45309!important}
html body .sam-st.sam-st-bad{background:#fdecea!important;color:#B42318!important}
html body .sam-st.sam-st-mute{background:#EFE6DD!important;color:#6b5547!important}
@media (max-width:760px){
  .sam-lk-bar{padding:8px;gap:6px;margin:8px 0}
  .sam-lk-bar .sam-lk-q{flex:1 1 100%;max-width:none;height:44px;font-size:16px}
  .sam-lk-chips{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;scrollbar-width:none}
  .sam-lk-chips::-webkit-scrollbar{display:none}
  .sam-lk-count{margin-left:0;font-size:12px}
}
/* 2.2.0 Điều chuyển: dòng gọn, chữ chuẩn hệ thống */
html body .sam-transfer-list,html body .sam-transfer-compact-table,html body .sam-transfer-compact-table *{font-family:"Be Vietnam Pro",system-ui,sans-serif!important}
html body .sam-transfer-compact-row{padding:8px 12px!important;row-gap:2px!important;cursor:pointer}
html body .sam-transfer-compact-row:hover{background:#FBF8F4}
html body .sam-transfer-compact-row .sam-tc-action .btn{min-height:32px!important;height:32px;padding:0 12px!important;font-size:13px!important;text-transform:none!important;border-radius:8px!important;display:inline-flex;align-items:center}
@media (min-width:761px){
  html body .sam-transfer-compact-row .sam-tc-number{grid-column:1!important;grid-row:1!important}
  html body .sam-transfer-compact-row .sam-tc-route{grid-column:2!important;grid-row:1!important}
  html body .sam-transfer-compact-row .sam-tc-date{grid-column:3!important;grid-row:1!important}
  html body .sam-transfer-compact-row .sam-tc-count{grid-column:4!important;grid-row:1!important}
  html body .sam-transfer-compact-row .sam-tc-status{grid-column:5!important;grid-row:1!important}
  html body .sam-transfer-compact-row .sam-tc-action{grid-column:6!important;grid-row:1!important}
  html body .sam-transfer-compact-row .sam-tc-extra{grid-column:1/5!important;grid-row:2!important;border-top:0!important;padding-top:0!important;color:#8b7568!important}
}
@media (max-width:760px){
  html body .sam-transfer-compact-row{grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"num st" "route route" "date count" "extra act"!important;gap:4px 10px!important;padding:12px!important;border-radius:12px!important}
  html body .sam-transfer-compact-row .sam-tc-number{grid-area:num!important;font-size:15px!important}
  html body .sam-transfer-compact-row .sam-tc-status{grid-area:st!important;justify-self:end}
  html body .sam-transfer-compact-row .sam-tc-route{grid-area:route!important;font-size:14px!important}
  html body .sam-transfer-compact-row .sam-tc-date{grid-area:date!important;color:#6b5547}
  html body .sam-transfer-compact-row .sam-tc-count{grid-area:count!important;justify-self:end;color:#6b5547}
  html body .sam-transfer-compact-row .sam-tc-extra{grid-area:extra!important;align-self:center;border-top:0!important;padding-top:0!important}
  html body .sam-transfer-compact-row .sam-tc-action{grid-area:act!important;text-align:right!important}
}
/* 2.2.0: chữ trên nút không ép viết hoa; nút thao tác nhỏ trong bảng */
html body .main .btn,html body .main button,html body .main summary{text-transform:none!important;letter-spacing:0!important}
html body .main .sam-act{display:inline-flex;align-items:center;justify-content:center;height:28px;padding:0 10px;border:1px solid #E3D6CB;border-radius:8px;background:#fff;color:#3B2417!important;text-decoration:none!important;font-size:12.5px!important;font-weight:600;white-space:nowrap;cursor:pointer}
html body .main .sam-act:hover{background:#F7F3EE}
html body .main .sam-act.sam-act-bad{color:#B42318!important;border-color:#f1c9c3}
html body .main .sam-act.sam-act-bad:hover{background:#fdecea}
/* 2.2.0: các nút thao tác trong 1 ô nằm cùng hàng */
html body .main table tbody tr td.sam-actcell.sam-actcell,html body .main table.sam-lap tbody tr td.sam-actcell.sam-actcell{white-space:nowrap!important}
html body .main td.sam-actcell>*,html body .main td.sam-actcell form{display:inline-flex!important;vertical-align:middle;margin:2px 2px!important;width:auto!important}
html body .main td.sam-actcell .btn,html body .main td.sam-actcell button{height:28px!important;min-height:0!important;padding:0 10px!important;font-size:12.5px!important}
/* nhãn trạng thái dạng .pill cũ: bỏ chấm tròn, cùng cỡ */
html body .main .pill.sam-st{height:auto!important;min-height:0!important;width:auto!important;border-radius:999px!important;padding:3px 9px!important;box-shadow:none!important}
html body .main .pill.sam-st::before{display:none!important}
html body .main .sam-st [class*="status-dot"],html body .main .sam-st .dot{display:none!important}
html body .main span.sam-st[class*="status-badge"]{border:0!important;box-shadow:none!important;height:auto!important;min-height:0!important;width:auto!important}

/* ===== SAM UI 2.2.1: FORM TẠO PHIẾU HỦY / SƠ CHẾ trên điện thoại — ô cân đối, thẳng hàng ===== */
@media (max-width:760px){
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form{display:grid!important;gap:12px 10px!important;padding:14px!important;align-items:end}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form>*{min-width:0!important;margin:0!important;grid-column:auto!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form .field{display:flex!important;flex-direction:column;gap:6px;margin:0!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form label{font-size:13px!important;font-weight:600!important;color:#6b5547!important;margin:0!important;line-height:1.3!important;text-transform:none!important;letter-spacing:0!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form input:not([type=hidden]):not([type=file]),html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form select{height:44px!important;min-height:44px!important;box-sizing:border-box!important;border-radius:10px!important;font-size:16px!important;width:100%!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form .qtybox{display:block!important;width:100%!important;border:0!important;height:auto!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form .qtybox>button{display:none!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form .qtybox>input{text-align:left!important;padding:0 12px!important;border:1px solid #E3D6CB!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form>div:last-child>.btn,html body.sam-ops-v11-create.sam-ops-v11 .main .sam-ops-form>div>button.btn:not(.secondary){width:100%!important;height:48px!important;border-radius:12px!important;font-size:16px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-addline{width:100%!important;height:44px!important;border-radius:10px!important;border:1px dashed #cdb9a8!important;background:#fff!important;color:#3B2417!important}

  /* --- Hủy / hao hụt: Mặt hàng (cả dòng) / SL | Lý do / Ảnh / thêm dòng / Gửi --- */
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row{grid-template-columns:96px minmax(0,1fr)!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row>.sam-ops-v11-waste-itemrow,
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row>.sam-waste-evidence,
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row>.sam-waste-lines,
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row>div:last-child{grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row .sam-v2-item-head{display:flex!important;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row .sam-scan-btn{height:34px!important;min-height:0!important;padding:0 12px!important;font-size:13px!important;border-radius:8px!important;width:auto!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row .sam-waste-evidence-actions{display:flex!important;align-items:center;gap:8px;flex-wrap:wrap}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row .sam-waste-evidence-actions .btn{height:40px!important;min-height:0!important;padding:0 14px!important;font-size:14px!important;border-radius:10px!important;width:auto!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.sam-waste-one-row .sam-waste-evidence-status{font-size:12px!important;color:#8b7568}

  /* --- Sơ chế: NVL / [Đầu vào | Dùng được | Hao hụt] / [Thu hồi | Ảnh] / Ghi chú / thêm NVL / Gửi --- */
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-ops-v11-ingredient{order:1;grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-v2-section-title{order:2;grid-column:1/-1!important;margin:4px 0 -4px!important;font-size:12px!important;letter-spacing:.04em;color:#8b7568}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.field:not(.sam-ops-v11-ingredient):not(.sam-ops-v11-yield):not(.sam-ops-v11-note){order:3}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-ops-v11-yield{order:4}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-v2-photo-field{order:4;grid-column:2/-1!important;display:flex!important;flex-direction:column;gap:6px}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-ops-v11-note{order:5;grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-pre-lines{order:6;grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>div:has(>button.btn:not(.secondary)){order:7;grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form .sam-v2-photo-label{font-size:13px;font-weight:600;color:#6b5547}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form .sam-preprocess-camera{display:inline-flex!important;align-items:center;justify-content:center;gap:6px;height:44px!important;width:100%!important;border:1px solid #E3D6CB!important;border-radius:10px!important;background:#fff!important;font-size:14px!important;font-weight:600;color:#3B2417}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form #preYield{background:#F7F3EE!important;text-align:center!important;font-weight:700!important;color:#1F7A4D!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form .field label .unit-hint{font-weight:500;color:#8b7568}

  /* --- Dòng thêm (cả 2 form): thẻ riêng có số thứ tự --- */
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-lines,html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-lines{display:flex!important;flex-direction:column;gap:10px;counter-reset:samln 1}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line,html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line{display:grid!important;gap:8px!important;padding:10px!important;border:1px solid #E3D6CB!important;border-radius:12px!important;background:#FBF8F4!important;margin:0!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line::before,html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line::before{counter-increment:samln;content:"Dòng " counter(samln);grid-column:1/-2;align-self:center;font-size:12px;font-weight:700;color:#8b7568}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line{grid-template-columns:84px minmax(0,1fr) 44px 32px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line .sam-wl-pick{grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line .sam-wl-tools{display:contents!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line .sam-wl-del{grid-row:1;grid-column:-2/-1}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line .sam-wl-cam{width:44px!important;height:44px!important;min-height:0!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center;border-radius:10px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line{grid-template-columns:repeat(3,minmax(0,1fr)) 32px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-wl-del{grid-row:1;grid-column:-2/-1}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-pick{grid-column:1/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-in,html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-use{grid-column:span 1}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-dis{grid-column:3/-1!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-yield{grid-column:1/2!important;text-align:center!important;background:#fff!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-notecell{grid-column:2/-1!important;display:flex!important;gap:8px;align-items:center}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-cam{flex:0 0 44px;width:44px!important;height:44px!important;display:inline-flex!important;align-items:center;justify-content:center;border:1px solid #E3D6CB;border-radius:10px;background:#fff}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-wl-del{width:32px!important;height:32px!important;min-height:0!important;padding:0!important;border-radius:50%!important;justify-self:end;align-self:center;color:#B42318!important;background:#fff!important;border:1px solid #f1c9c3!important;font-size:12px!important}
}
@media (max-width:760px){
  /* 2.2.1: sơ chế — đặt ô theo vùng cố định (không phụ thuộc thứ tự HTML) */
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form{grid-template-areas:"ing ing ing" "ttl ttl ttl" "pin puse pdis" "yld pho pho" "note note note" "lines lines lines" "sub sub sub"!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-ops-v11-ingredient{grid-area:ing!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-v2-section-title{grid-area:ttl!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.field:has(#preInput){grid-area:pin!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.field:has(#preUsable){grid-area:puse!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.field:has(#preDiscard){grid-area:pdis!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-ops-v11-yield{grid-area:yld!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-v2-photo-field{grid-area:pho!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-ops-v11-note{grid-area:note!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-pre-lines{grid-area:lines!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>div:has(>button.btn:not(.secondary)){grid-area:sub!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line{grid-template-columns:repeat(3,minmax(0,1fr))!important;position:relative}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line::before{grid-column:1/-1!important;padding-right:40px}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-wl-del{position:absolute!important;top:6px;right:8px}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-pl-dis{grid-column:auto!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line input{font-size:15px!important;padding:0 8px!important}
}
@media (max-width:760px){
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-waste-line::before,html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line::before{min-height:32px;display:flex;align-items:center}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-wl-del{top:10px!important;right:10px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line input{font-size:14px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main form.preprocess-form>.sam-v2-photo-field>label.sam-preprocess-camera{width:100%!important;max-width:none!important;box-sizing:border-box!important}
}
@media (max-width:760px){
  html body.sam-ops-v11-create.sam-ops-v11 .main .content button.btn.sam-wl-del:not([hidden]):not(.x1):not(.x2),
  html body.sam-ops-v11-create.sam-ops-v11 .main button.btn.sam-wl-del:not([hidden]):not(.x1):not(.x2):not(.x3){width:32px!important;height:32px!important;min-height:0!important;max-height:32px!important;padding:0!important}
}
@media (max-width:760px){
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line::before{grid-column:1/3!important;padding-right:0}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line .sam-wl-del{position:static!important;grid-row:1!important;grid-column:3!important;justify-self:end}
}
@media (max-width:760px){
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line{gap:8px 6px!important}
  html body.sam-ops-v11-create.sam-ops-v11 .main .sam-pre-line input{font-size:16px!important;padding:0 6px!important}
}
/* 2.2.1 Chi tiết điều chuyển: không tràn ngang trên điện thoại */
html body .sam-transfer-redesign{grid-template-columns:minmax(0,1fr)!important;max-width:100%!important}
html body .sam-transfer-redesign>*{min-width:0!important;max-width:100%!important}
/* 2.2.1 Chi tiết điều chuyển — mỗi mặt hàng 1 thẻ gọn trên điện thoại */
@media (max-width:760px){
  html body .sam-transfer-products .tablewrap{overflow:visible!important;border:0!important}
  html body .sam-transfer-products table.sam-datatable,html body .sam-transfer-products table.sam-datatable tbody{display:block!important;width:100%!important;min-width:0!important}
  html body .sam-transfer-products table.sam-datatable thead{display:none!important}
  html body .sam-transfer-products table.sam-datatable tbody tr{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:8px 10px!important;position:relative;padding:12px!important;margin:0 0 10px!important;border:1px solid #E3D6CB!important;border-radius:12px!important;background:#fff!important}
  html body .sam-transfer-products table.sam-datatable tbody td{display:block!important;padding:0!important;border:0!important;min-width:0!important;width:auto!important;text-align:left!important;font-size:14px!important;white-space:normal!important}
  html body .sam-transfer-products table.sam-datatable tbody td::before{display:block;font-size:11px;font-weight:600;color:#8b7568;margin-bottom:2px}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(2){grid-column:1/-1!important;grid-row:1;padding-right:44px!important;font-size:15px!important;font-weight:700!important}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(2)::before{display:none!important}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(1){grid-column:1/4!important;grid-row:2}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(3){grid-column:4/7!important;grid-row:2}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(4){grid-column:1/3!important;grid-row:3}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(5){grid-column:3/5!important;grid-row:3}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(6){grid-column:5/7!important;grid-row:3}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(1)::before{content:"Mã quầy gửi"}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(3)::before{content:"Mã quầy nhận"}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(4)::before{content:"SL chuyển"}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(5)::before{content:"Đã nhận"}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(6)::before{content:"ĐVT"}
  html body .sam-transfer-products table.sam-datatable tbody td.sam-col-action{position:absolute!important;top:10px;right:10px}
  html body .sam-transfer-products table.sam-datatable tbody td.sam-col-action::before{display:none!important}
  html body .sam-transfer-products table.sam-datatable tbody td.sam-col-action .btn{height:30px!important;min-height:0!important;padding:0 10px!important;font-size:12.5px!important;border-radius:8px!important}
  html body .sam-transfer-products table.sam-datatable tbody td:nth-child(4),html body .sam-transfer-products table.sam-datatable tbody td:nth-child(5){font-weight:700!important;font-variant-numeric:tabular-nums}
}
/* 2.2.1 Lập phiếu điều chuyển trên điện thoại: Từ | Đến cùng hàng; SL + Thêm cùng hàng; dòng hàng gọn */
@media (max-width:760px){
  html body details.sam-transfer-create .sam-transfer-batch-entry{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px 10px!important;align-items:end}
  html body details.sam-transfer-create .sam-transfer-batch-entry>*{min-width:0!important;margin:0!important;width:auto!important}
  html body details.sam-transfer-create .sam-transfer-batch-entry .field{display:flex!important;flex-direction:column;gap:6px}
  html body details.sam-transfer-create .sam-transfer-batch-product{grid-column:1/-1!important}
  html body details.sam-transfer-create .sam-transfer-batch-qty{grid-column:1!important}
  html body details.sam-transfer-create .sam-transfer-batch-add{grid-column:2!important}
  html body details.sam-transfer-create .sam-transfer-batch-add .btn{width:100%!important;height:44px!important;min-height:0!important;border-radius:10px!important;border:1px dashed #cdb9a8!important;background:#fff!important}
  html body details.sam-transfer-create label{font-size:13px!important;font-weight:600!important;color:#6b5547!important;margin:0!important}
  html body details.sam-transfer-create input:not([type=hidden]),html body details.sam-transfer-create select{height:44px!important;min-height:44px!important;font-size:16px!important;border-radius:10px!important;box-sizing:border-box}
  html body details.sam-transfer-create .sam-transfer-draft-wrap{margin:12px 0!important;overflow:visible!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table,html body details.sam-transfer-create table.sam-transfer-draft-table tbody{display:block!important;width:100%!important;min-width:0!important;border:0!important;background:transparent!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table thead{display:none!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody tr{display:grid!important;grid-template-columns:28px minmax(0,1fr) auto 36px!important;grid-template-areas:"n name qty del" "n code qty del"!important;align-items:center;gap:2px 8px!important;padding:10px 12px!important;margin:0 0 8px!important;border:1px solid #E3D6CB!important;border-radius:12px!important;background:#FBF8F4!important;min-height:0!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td{display:block!important;padding:0!important;border:0!important;text-align:left!important;min-width:0!important;width:auto!important;background:transparent!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td::before{display:none!important;content:none!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(1){grid-area:n;font-weight:700;color:#8b7568}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(2){grid-area:code;font-size:13px!important;color:#8b7568}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(3){grid-area:name;font-size:15px!important;font-weight:600}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(4){grid-area:qty;font-size:15px!important;font-weight:700;text-align:right!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(4)::before{display:inline!important;content:"SL "!important;font-weight:500;color:#8b7568;font-size:12px}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(5){grid-area:del;justify-self:end}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(5) .btn,html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(5) button{width:32px!important;height:32px!important;min-height:0!important;padding:0!important;border-radius:50%!important;font-size:0!important;position:relative;background:#fff!important;border:1px solid #f1c9c3!important}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(5) .btn::after,html body details.sam-transfer-create table.sam-transfer-draft-table tbody td:nth-child(5) button::after{content:"✕";font-size:12px;color:#B42318;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
  html body details.sam-transfer-create table.sam-transfer-draft-table tbody tr.sam-transfer-draft-empty{display:block!important;text-align:center;color:#8b7568;border-style:dashed!important;background:#fff!important}
  html body details.sam-transfer-create .sam-transfer-batch-bottom{display:flex!important;flex-direction:column;gap:12px}
  html body details.sam-transfer-create .sam-transfer-submit .btn{width:100%!important;height:48px!important;border-radius:12px!important;font-size:16px!important}
}
@media (max-width:760px){
  html body details.sam-transfer-create.card form#samTransferBatchForm table.sam-transfer-draft-table tbody td{white-space:normal!important;overflow-wrap:anywhere}
  html body details.sam-transfer-create.card form#samTransferBatchForm table.sam-transfer-draft-table tbody td:nth-child(5) .btn{text-indent:-9999px!important;overflow:hidden!important;font-size:12px!important}
  html body details.sam-transfer-create.card form#samTransferBatchForm table.sam-transfer-draft-table tbody td:nth-child(5) .btn::after{text-indent:0!important}
  html body details.sam-transfer-create.card form#samTransferBatchForm .sam-transfer-batch-bottom{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px!important}
  html body details.sam-transfer-create.card form#samTransferBatchForm .sam-transfer-batch-bottom>*{width:100%!important;margin:0!important;max-width:none!important;flex:none!important}
  html body details.sam-transfer-create.card form#samTransferBatchForm .sam-transfer-note{display:flex!important;flex-direction:column;gap:6px}
}
/* 2.2.1 nhãn cạnh nhau cùng cỡ (Kiểm hàng: trạng thái + kết quả) ; chip lọc xuống dòng thay vì bị cắt */
html body .main .samv3-stk-status,html body .main .samv3-stk-result{display:inline-flex!important;align-items:center!important;height:24px!important;min-height:0!important;padding:0 10px!important;border-radius:999px!important;font-size:12px!important;font-weight:700!important;line-height:1!important;text-transform:none!important;letter-spacing:0!important;border:0!important;box-shadow:none!important;white-space:nowrap}
html body .main .samv3-stk-result{background:#e8f4ee;color:#1F7A4D}
@media (max-width:760px){.sam-lk-chips{flex-wrap:wrap!important;overflow:visible!important}}
/* 2.2.2 Hotline trên hóa đơn */
#receipt .sam-hotline{display:block;font-size:13px;font-weight:700;color:#000;margin-top:2px}
@media print{#receipt .sam-hotline{font-size:10px!important;color:#000!important;font-weight:700!important}}
/* 2.2.2 Báo cáo bán hàng 80mm: 64mm — vừa cả khi máy in tự thêm lề 8mm mỗi bên */
@media print{
  html body #samSalesPrint.sales-print-80{width:64mm!important;max-width:64mm!important;padding:1mm 0!important}
}

/* ===== 2.2.2 KIỂM HÀNG CUỐI CA — chi tiết gọn ===== */
html body .sam-stk-bar{background:#fff;border:1px solid #E3D6CB;border-radius:12px;padding:10px 12px;margin:0 0 10px}
html body .sam-stk-bar-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:15px}
html body .sam-stk-bar-form{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;margin-top:10px;align-items:center}
html body .sam-stk-bar-form input[name=reason]{height:40px!important;min-height:0!important;border-radius:10px!important;min-width:0;width:100%!important;box-sizing:border-box}
html body .sam-stk-bar-form .btn{height:40px!important;min-height:0!important;padding:0 14px!important;border-radius:10px!important;font-size:14px!important;white-space:nowrap}
@media (max-width:760px){
  html body .sam-stk-bar-form{grid-template-columns:1fr 1fr}
  html body .sam-stk-bar-form input[name=reason]{grid-column:1/-1;height:44px!important;font-size:16px!important}
  html body .sam-stk-bar-form .btn{height:44px!important;width:100%!important}
}
html body:has(.sam-stk-bar) #samV3StocktakeDetail>div:first-child{display:none!important}
html body #samV3StocktakeDetail .samv3-stkd-summary{padding:10px 12px!important;border-radius:12px!important;display:grid!important;grid-template-columns:auto 1fr;gap:4px 10px!important;align-items:center}
html body #samV3StocktakeDetail .samv3-stkd-summary>div{display:contents!important}
html body #samV3StocktakeDetail .samv3-stkd-summary span{font-size:12px!important;font-weight:600!important;text-transform:none!important;letter-spacing:0!important;opacity:.8}
html body #samV3StocktakeDetail .samv3-stkd-summary strong{font-size:14px!important;font-weight:800!important;text-align:right;text-transform:lowercase!important;display:inline-block}
html body #samV3StocktakeDetail .samv3-stkd-summary strong::first-letter{text-transform:uppercase}
html body #samV3StocktakeDetail .samv3-stkd-summary>div:last-child{display:block!important;grid-column:1/-1;font-size:12.5px!important}
html body #samV3StocktakeDetail .samv3-stkd-progress{padding:8px 12px!important;border-radius:12px!important}
/* thẻ mặt hàng: tên | tồn HT ; mã | lệch ; thực đếm ; lý do 1 dòng */
html body #samV3StocktakeDetail .samv3-stkd-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px 10px!important;padding:10px 12px!important;border-radius:12px!important;margin-bottom:8px!important;align-items:center}
html body #samV3StocktakeDetail .samv3-stkd-head{display:contents!important}
html body #samV3StocktakeDetail .samv3-stkd-head>div:first-child{grid-column:1;min-width:0;display:flex;gap:10px;align-items:center}
html body #samV3StocktakeDetail .samv3-stkd-head img{width:40px!important;height:40px!important;border-radius:8px!important;object-fit:cover;flex:0 0 40px}
html body #samV3StocktakeDetail .samv3-stkd-name{font-size:14.5px!important;font-weight:700!important;line-height:1.3!important}
html body #samV3StocktakeDetail .samv3-stkd-meta{font-size:12px!important;color:#8b7568!important}
html body #samV3StocktakeDetail .samv3-stkd-system{grid-column:2;display:grid!important;grid-template-columns:auto auto;gap:2px 6px;align-items:center;justify-items:end;text-align:right}
html body #samV3StocktakeDetail .samv3-stkd-system strong{grid-column:2;grid-row:1;font-size:16px!important;line-height:1.1}
html body #samV3StocktakeDetail .samv3-stkd-system span{grid-column:1;grid-row:1;font-size:11px!important;font-weight:600;color:#8b7568;text-transform:lowercase!important;letter-spacing:0!important}
html body #samV3StocktakeDetail .samv3-stkd-diff{grid-column:1/-1;grid-row:2;display:inline-block!important;height:auto!important;padding:2px 9px!important;border-radius:999px!important;font-size:12px!important;font-weight:700!important;text-transform:lowercase!important;margin:0!important;border:0!important}
html body #samV3StocktakeDetail .samv3-stkd-diff::first-letter{text-transform:uppercase}
html body #samV3StocktakeDetail .samv3-stkd-entry{grid-column:1/-1;display:flex!important;align-items:center;gap:8px;margin:0!important;padding:0!important}
html body #samV3StocktakeDetail .samv3-stkd-entry::before{content:"Thực đếm";font-size:12px;font-weight:600;color:#6b5547}
html body #samV3StocktakeDetail .samv3-stkd-entry input,html body #samV3StocktakeDetail .samv3-stkd-actual{width:110px!important;height:40px!important;min-height:0!important;border-radius:10px!important;font-size:16px!important;font-weight:700!important;display:inline-flex!important;align-items:center;justify-content:center;border:1px solid #E3D6CB!important;margin:0!important;padding:0 8px!important;box-sizing:border-box}
html body #samV3StocktakeDetail .samv3-review-detail{grid-column:1/-1;display:flex!important;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0!important;padding:6px 10px!important;border-radius:10px!important}
html body #samV3StocktakeDetail .samv3-review-category{margin:0!important;font-size:12px!important;padding:2px 8px!important;border-radius:999px!important}
html body #samV3StocktakeDetail .samv3-review-reason-label{margin:0!important;font-size:12px!important;text-transform:none!important;letter-spacing:0!important}
html body #samV3StocktakeDetail .samv3-review-reason-label::after{content:":"}
html body #samV3StocktakeDetail .samv3-review-reason{font-size:12.5px!important}
html body #samV3StocktakeDetail .samv3-review-detail.sam-same .samv3-review-reason-label,html body #samV3StocktakeDetail .samv3-review-detail.sam-same .samv3-review-reason{display:none!important}
html body #samV3StocktakeDetail .samv3-stkd-head>div:first-child{display:block!important}
html body #samV3StocktakeDetail .samv3-stkd-head img{float:left;margin:0 10px 0 0!important}
html body #samV3StocktakeDetail .samv3-stkd-system{align-self:start}
html body #samV3StocktakeDetail .samv3-stkd-entry::before{line-height:40px}
html body #samV3StocktakeDetail .samv3-stkd-summary span{text-transform:lowercase!important;display:inline-block}
html body #samV3StocktakeDetail .samv3-stkd-summary span::first-letter{text-transform:uppercase}
@media (max-width:760px){
  html body .main .sam-stk-bar form.sam-stk-bar-form{display:grid!important;grid-template-columns:1fr 1fr!important}
  html body .main .sam-stk-bar form.sam-stk-bar-form input[name=reason]{grid-column:1/-1!important}
}
html body .main .sam-stk-bar form.sam-stk-bar-form{display:grid!important}
html body .main .sam-stk-bar form.sam-stk-bar-form input[name=reason]{max-width:none!important;width:100%!important;flex:none!important}
/* 2.2.6: bỏ khối ép khổ in báo cáo (in báo cáo 80mm nay dùng khung in riêng) */
/* 2.2.3 thẻ kiểm hàng gọn hơn: 2 dòng — [tên/mã | tồn HT] , [đếm | lệch] ; lý do 1 dòng nhỏ */
html body #samV3StocktakeDetail .samv3-stkd-card{grid-template-columns:minmax(0,1fr) auto auto!important;grid-template-areas:"info lbl sys" "info ent diff" "why why why"!important;gap:4px 8px!important;padding:8px 10px!important;margin-bottom:6px!important}
html body #samV3StocktakeDetail .samv3-stkd-system{display:contents!important}
html body #samV3StocktakeDetail .samv3-stkd-head>div:first-child{grid-area:info!important;align-self:center}
html body #samV3StocktakeDetail .samv3-stkd-system span{grid-area:lbl!important;align-self:center;justify-self:end;font-size:11px!important}
html body #samV3StocktakeDetail .samv3-stkd-system strong{grid-area:sys!important;align-self:center;justify-self:end;font-size:15px!important;min-width:56px;text-align:right}
html body #samV3StocktakeDetail .samv3-stkd-entry{grid-area:ent!important;justify-content:flex-end;gap:6px}
html body #samV3StocktakeDetail .samv3-stkd-entry::before{content:"Đếm";font-size:11px;line-height:34px}
html body #samV3StocktakeDetail .samv3-stkd-entry input,html body #samV3StocktakeDetail .samv3-stkd-actual{width:72px!important;height:34px!important;font-size:16px!important;padding:0 6px!important}
html body #samV3StocktakeDetail .samv3-stkd-diff{grid-area:diff!important;align-self:center;justify-self:end;min-width:56px;text-align:center}
html body #samV3StocktakeDetail .samv3-review-detail{grid-area:why!important;padding:4px 8px!important;background:#FBF8F4!important;border:0!important}
html body #samV3StocktakeDetail .samv3-stkd-head img{width:36px!important;height:36px!important;flex-basis:36px}
html body #samV3StocktakeDetail .samv3-stkd-name{font-size:14px!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
html body #samV3StocktakeDetail .samv3-stkd-system span{display:block!important}
html body #samV3StocktakeDetail .samv3-stkd-system span::first-letter{text-transform:uppercase}
html body #samV3StocktakeDetail .samv3-stkd-diff{line-height:1.4!important}
/* 2.2.4 Bán hàng máy tính: ảnh món to hơn (khung 4:3, bỏ giới hạn cao 48px cũ) */
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-thumb,
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-thumb{height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:4/3;width:100%!important;border-radius:10px!important;overflow:hidden!important;background-color:#f3ece5}
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-thumb img{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;display:block}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-thumb,
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-info{flex:0 0 auto!important;min-height:auto}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info{overflow:visible!important;max-height:none!important;height:auto!important}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-thumb,
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-thumb{aspect-ratio:auto!important;height:140px!important}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact{overflow:visible!important;min-height:250px!important}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-info .name{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important;min-height:2.6em;line-height:1.3!important;white-space:normal!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact{min-height:274px!important}
}
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact{justify-content:flex-start!important;gap:8px!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .name.name{display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;max-height:2.6em!important}
}
/* 2.2.5 Bán hàng máy tính: thẻ gọn lại (~206px), ảnh 96px hiện trọn hình trên nền trắng; mã · ĐVT · tồn chung 1 dòng */
@media (min-width:900px){
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact{min-height:206px!important;gap:6px!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-thumb,html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-thumb{height:96px!important;background:#fff!important;border:1px solid #f0e8e1}
  html body .pos-real-split .pos-left-pane .pos-products .product-card .product-thumb img{object-fit:contain!important;padding:3px;box-sizing:border-box}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info{display:grid!important;grid-template-columns:auto minmax(0,1fr);column-gap:6px;row-gap:2px;align-items:baseline}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .name.name{grid-column:1/-1}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .meta{grid-column:1;white-space:nowrap}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .stock{grid-column:2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600!important}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .stock::before{content:"· ";color:#8b7568;font-weight:400}
  html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .price{grid-column:1/-1;margin-top:2px!important}
}

/* ===== 2.2.6 HỦY / SƠ CHẾ trên điện thoại: đầu trang gọn (tháng nằm cùng hàng tiêu đề), nút tạo phiếu 1 dòng, thẻ phiếu cân đối ===== */
@media (max-width:760px){
  html body.sam-ops-v11 .content>.title.sam-has-month{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;margin-bottom:8px!important}
  html body.sam-ops-v11 .content>.title.sam-has-month h1{margin:0!important}
  html body.sam-ops-v11 .content>.title.sam-has-month p{grid-column:1/-1;margin:2px 0 0!important;font-size:12.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body.sam-ops-v11 .title .sam-ops-v11-monthbar{display:inline-flex!important;align-items:center;gap:2px;margin:0!important;padding:0!important;height:36px;border:1px solid #E3D6CB;border-radius:999px;background:#fff;width:auto!important;grid-row:1;grid-column:2}
  html body.sam-ops-v11 .title .sam-ops-v11-monthbar .current{font-size:14px!important;font-weight:700!important;padding:0 4px!important;border:0!important;background:none!important;height:auto!important;min-height:0!important;width:auto!important;box-shadow:none!important}
  html body.sam-ops-v11 .main .title .sam-ops-v11-monthbar a.btn{width:34px!important;min-width:34px!important;height:34px!important;min-height:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;border-radius:50%!important;display:inline-flex!important;align-items:center;justify-content:center}
  /* nút tạo phiếu: 1 dòng 48px */
  html body.sam-ops-v11 .main a.sam-ops-v11-list-cta{display:flex!important;align-items:center;justify-content:center;gap:8px;min-height:0!important;height:48px!important;padding:0 14px!important;margin:0 0 10px!important;border-radius:12px!important;background:#3B2417!important;color:#fff!important;border:0!important;box-shadow:none!important}
  html body.sam-ops-v11 .main a.sam-ops-v11-list-cta .main{display:block!important}
  html body.sam-ops-v11 .main a.sam-ops-v11-list-cta .main b{color:#fff!important;font-size:15px!important;font-weight:700!important}
  html body.sam-ops-v11 .main a.sam-ops-v11-list-cta .main small{display:none!important}
  html body.sam-ops-v11 .main a.sam-ops-v11-list-cta .plus{order:-1;width:auto!important;height:auto!important;min-width:0!important;background:none!important;color:#fff!important;font-size:20px!important;line-height:1!important;box-shadow:none!important;border:0!important;padding:0!important}
  /* ô tìm + chip gộp gọn */
  html body.sam-ops-v11 .main .sam-lk-bar{margin-top:-2px!important;padding:6px 0!important;border:0!important;background:transparent!important}
  /* thẻ phiếu: chỉ số chia đều cột, hàng dưới gọn */
  html body .sam-op-mobile-card .sam-op-metrics,html body .sam-waste-final-card .sam-waste-final-grid{display:grid!important;gap:6px!important;margin:8px 0!important}
  html body .sam-op-mobile-card .sam-op-metrics{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  html body .sam-waste-final-card .sam-waste-final-grid{grid-template-columns:96px minmax(0,1fr)!important}
  html body .sam-op-mobile-card .sam-op-metrics>div,html body .sam-waste-final-card .sam-waste-final-grid>div{display:flex!important;flex-direction:column;gap:1px;background:#F7F3EE;border-radius:8px;padding:6px 8px!important;min-width:0;margin:0!important}
  html body .sam-op-mobile-card .sam-op-metrics span,html body .sam-waste-final-card .sam-waste-final-grid span{font-size:11px!important;color:#8b7568!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body .sam-op-mobile-card .sam-op-metrics b,html body .sam-waste-final-card .sam-waste-final-grid b{font-size:13.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body .sam-op-mobile-card .sam-op-card-bottom,html body .sam-waste-final-card .sam-waste-final-bottom{display:flex!important;align-items:center;gap:8px;margin-top:4px!important}
  html body .sam-op-mobile-card .sam-op-no-photo,html body .sam-waste-final-card .sam-waste-final-no-photo{flex:1;font-size:12px!important;color:#8b7568}
  html body .main .sam-op-mobile-card .sam-op-detail-btn,html body .main .sam-waste-final-card .sam-waste-final-detail-btn{height:36px!important;min-height:0!important;padding:0 12px!important;font-size:13.5px!important;border-radius:10px!important;width:auto!important}
  html body .main .sam-op-mobile-card button.sam-row-act-btn{height:36px!important;min-height:0!important;padding:0 12px!important;border:1px solid #f1c9c3!important;border-radius:10px!important;background:#fff!important;color:#B42318!important;text-decoration:none!important;font-size:13.5px!important;font-weight:600}
  html body .sam-op-mobile-card,html body .sam-waste-final-card{padding:12px!important;border-radius:12px!important;margin-bottom:8px!important}
}

/* ===== 2.2.6 HỦY / SƠ CHẾ trên máy tính: tháng cùng hàng tiêu đề; các dòng nhập thẳng cột với dòng đầu ===== */
@media (min-width:761px){
  html body .content>.title.sam-has-month{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px}
  html body .content>.title.sam-has-month p{grid-column:1;margin:2px 0 0!important}
  html body .content>.title.sam-has-month h1{grid-column:1;margin:0!important}
  html body .main .title .sam-waste-monthbar,html body .main .title .sam-preprocess-monthbar,html body .main .title .sam-ops-v11-monthbar{grid-column:2;grid-row:1/3;display:inline-flex!important;align-items:center;gap:2px;margin:0!important;padding:0 2px!important;height:36px;border:1px solid #E3D6CB;border-radius:999px;background:#fff;width:auto!important;justify-content:center}
  html body .main .title [class*=monthbar] .current{font-size:14px!important;font-weight:700!important;padding:0 6px!important;border:0!important;background:none!important;min-height:0!important;height:auto!important;width:auto!important;text-transform:none!important}
  html body .main .title [class*=monthbar] a.btn{height:32px!important;min-height:0!important;padding:0 10px!important;border:0!important;background:none!important;box-shadow:none!important;border-radius:999px!important;font-size:13px!important;white-space:nowrap}
  html body .main .title [class*=monthbar] a.btn:hover{background:#F7F3EE!important}

  /* Hủy: cột cố định dùng chung cho dòng đầu + dòng thêm */
  html body .main form.sam-waste-one-row{display:grid!important;grid-template-columns:minmax(0,2fr) 100px minmax(0,1.6fr) 40px 40px!important;grid-template-areas:"item qty rsn . ." "lines lines lines lines lines" "ev ev ev sub sub"!important;gap:10px!important;align-items:end}
  html body .main form.sam-waste-one-row>*{min-width:0!important;margin:0!important}
  html body .main form.sam-waste-one-row>.field:nth-of-type(1),html body .main form.sam-waste-one-row>.sam-ops-v11-waste-itemrow{grid-area:item!important}
  html body .main form.sam-waste-one-row>.field:has(input[name=qty]){grid-area:qty!important}
  html body .main form.sam-waste-one-row>.field:has(input[name=reason]){grid-area:rsn!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence{grid-area:ev!important;display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 10px}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>label{margin:0!important}
  html body .main form.sam-waste-one-row>.sam-waste-lines{grid-area:lines!important}
  html body .main form.sam-waste-one-row>div:last-child{grid-area:sub!important;justify-self:end;white-space:nowrap}
  html body .main form.sam-waste-one-row .sam-waste-lines{display:flex!important;flex-direction:column;gap:10px}
  html body .main form.sam-waste-one-row .sam-waste-line{display:grid!important;grid-template-columns:minmax(0,2fr) 100px minmax(0,1.6fr) 40px 40px!important;gap:10px!important;padding:0!important;border:0!important;background:none!important;margin:0!important;align-items:center}
  html body .main form.sam-waste-one-row .sam-waste-line .sam-wl-tools{display:contents!important}
  html body .main form.sam-waste-one-row .sam-waste-line .sam-wl-cam{width:44px!important;height:40px!important;min-height:0!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center;border-radius:10px!important}
  /* Sơ chế */
  html body .main form.preprocess-form.sam-preprocess-one-row{display:grid!important;grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)) 84px minmax(0,1.4fr) 32px!important;gap:10px!important;align-items:end}
  html body .main form.preprocess-form.sam-preprocess-one-row>*{min-width:0!important;margin:0!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field.span2:first-of-type{grid-column:1!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preInput){grid-column:2!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preUsable){grid-column:3!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preDiscard){grid-column:4!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preYield){grid-column:5!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(input[name=note]){grid-column:6/8!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.sam-pre-lines{grid-column:1/-1!important;display:flex!important;flex-direction:column;gap:10px}
  html body .main form.preprocess-form.sam-preprocess-one-row>div:last-child{grid-column:1/-1!important;justify-self:end}
  html body .main form.preprocess-form.sam-preprocess-one-row .sam-pre-line{display:grid!important;grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr)) 84px minmax(0,1.4fr) 32px!important;gap:10px!important;padding:0!important;border:0!important;background:none!important;margin:0!important;align-items:center}
  html body .main form.preprocess-form.sam-preprocess-one-row .sam-pre-line .sam-pl-notecell{display:flex!important;gap:8px;align-items:center;min-width:0}
  html body .main form.preprocess-form.sam-preprocess-one-row .sam-pre-line .sam-pl-notecell input{flex:1;min-width:0}
  html body .main form.preprocess-form.sam-preprocess-one-row .field:has(input[name=note]) .sam-preprocess-note-photo{display:flex!important;gap:8px;align-items:center}
  html body .main form .sam-wl-del{width:32px!important;height:32px!important;min-height:0!important;padding:0!important;border-radius:50%!important;background:#fff!important;border:1px solid #f1c9c3!important;color:#B42318!important;font-size:12px!important}
  html body .main form.sam-waste-one-row input:not([type=hidden]):not([type=file]),html body .main form.preprocess-form input:not([type=hidden]):not([type=file]){height:40px!important;min-height:0!important;box-sizing:border-box}
}

/* 2.2.6b: vị trí ô cố định (hàng, cột) — không phụ thuộc thứ tự tự xếp của trình duyệt */
@media (min-width:761px){
  html body .main form.sam-waste-one-row{grid-template-areas:none!important}
  html body .main form.sam-waste-one-row>.field:nth-of-type(1){grid-row:1!important;grid-column:1!important}
  html body .main form.sam-waste-one-row>.field:has(input[name=qty]){grid-row:1!important;grid-column:2!important}
  html body .main form.sam-waste-one-row>.field:has(input[name=reason]){grid-row:1!important;grid-column:3/6!important}
  html body .main form.sam-waste-one-row>.sam-waste-lines{grid-row:2!important;grid-column:1/-1!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence{grid-row:3!important;grid-column:1/3!important}
  html body .main form.sam-waste-one-row>div:last-child{grid-row:3!important;grid-column:3/-1!important;justify-self:end}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field.span2:first-of-type{grid-row:1!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preInput),html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preUsable),html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preDiscard),html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(#preYield),html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(input[name=note]){grid-row:1!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>.sam-pre-lines{grid-row:2!important}
  html body .main form.preprocess-form.sam-preprocess-one-row>div:last-child{grid-row:3!important}
}
@media (min-width:761px){
  html body .main form.preprocess-form.sam-preprocess-one-row .sam-pre-line .sam-pl-cam,html body .main form.preprocess-form.sam-preprocess-one-row .sam-preprocess-camera{width:40px!important;height:40px!important;min-height:0!important;flex:0 0 40px;display:inline-flex!important;align-items:center;justify-content:center;border:1px solid #E3D6CB;border-radius:10px;background:#fff;font-size:16px!important;padding:0!important}
}
@media (min-width:761px){
  html body .main form.sam-waste-one-row>.sam-waste-evidence .btn,html body .main form.sam-waste-one-row>.sam-waste-evidence label.btn{width:auto!important;flex:0 0 auto!important;height:40px!important;min-height:0!important;padding:0 14px!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>label:first-child{flex:0 0 100%}
}
html body .main .title [class*=monthbar] .current{border-radius:0!important}
/* 2.3.0 thông báo thành công */
.sam-toast{position:fixed;left:50%;top:16px;transform:translate(-50%,-20px);opacity:0;z-index:99999;display:flex;align-items:center;gap:10px;padding:12px 18px;border-radius:12px;background:#1F7A4D;color:#fff;font:600 15px "Be Vietnam Pro",system-ui,sans-serif;box-shadow:0 10px 30px rgba(0,0,0,.18);transition:all .25s ease;max-width:calc(100vw - 32px)}
.sam-toast.on{opacity:1;transform:translate(-50%,0)}
.sam-toast-ic{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.22);font-size:13px}

/* ===== 2.3.0 HỦY / HAO HỤT máy tính — bố cục theo mẫu đã duyệt =====
   Tiêu đề thẻ + "Quét mã" cùng hàng; dòng 1: Mặt hàng | SL | Lý do | 📷 (ảnh chung) ; dòng thêm thẳng cột ; dưới: + Thêm mặt hàng ... Gửi duyệt */
@media (min-width:761px){
  html body .main details.card:has(form.sam-waste-one-row){position:relative}
  html body .main details.card:has(form.sam-waste-one-row)>summary{padding-right:160px}
  html body .main details.card:has(form.sam-waste-one-row) .waste-mobile-tools{position:absolute!important;top:10px;right:14px;margin:0!important;display:flex!important}
  html body .main details.card:has(form.sam-waste-one-row) .waste-mobile-tools .sam-scan-btn{height:34px!important;min-height:0!important;padding:0 12px!important;font-size:13px!important;border-radius:8px!important;background:#fff!important;color:#3B2417!important;border:1px solid #E3D6CB!important}
  html body .main details.card:not([open]):has(form.sam-waste-one-row) .waste-mobile-tools{display:none!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence{display:contents!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>label{display:none!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>.sam-waste-evidence-actions{grid-row:1!important;grid-column:4/6!important;align-self:end;display:flex!important;gap:6px;align-items:center}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>.sam-waste-evidence-actions label.btn{width:44px!important;height:40px!important;min-height:0!important;padding:0!important;font-size:0!important;display:inline-flex!important;align-items:center;justify-content:center;border-radius:10px!important;position:relative}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>.sam-waste-evidence-actions label.btn::before{content:"📷";font-size:17px}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>.sam-waste-evidence-actions .sam-waste-remove-photo{height:28px!important;min-height:0!important;padding:0 8px!important;font-size:12px!important;width:auto!important}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>img.sam-waste-evidence-preview:not([hidden]){grid-row:3!important;grid-column:1!important;width:64px!important;height:64px!important;object-fit:cover;border-radius:8px;border:1px solid #E3D6CB}
  html body .main form.sam-waste-one-row>.sam-waste-evidence>.sam-waste-evidence-status{grid-row:3!important;grid-column:1/4!important;font-size:12px!important;color:#8b7568;align-self:center}
  html body .main form.sam-waste-one-row>.field:has(input[name=reason]){grid-column:3!important}
  html body .main form.sam-waste-one-row>div:last-child{grid-row:2!important;grid-column:3/-1!important;align-self:end;justify-self:end;z-index:1}
  html body .main form.sam-waste-one-row>div:last-child>.btn{background:#3B2417!important;border-color:#3B2417!important;color:#fff!important;height:40px!important;min-height:0!important;padding:0 18px!important;border-radius:10px!important}
  html body .main form.sam-waste-one-row .sam-waste-addline{height:40px!important;min-height:0!important;width:auto!important;align-self:flex-start;border:1px dashed #cdb9a8!important;background:#fff!important;border-radius:10px!important}
  html body .main form.sam-waste-one-row .field>label{font-size:12.5px!important;font-weight:600!important;color:#6b5547!important;text-transform:none!important}
}
@media (min-width:761px){
  html body .main form.sam-waste-one-row .sam-waste-line .sam-wl-cam{font-size:17px!important}
  html body .main form.sam-waste-one-row .sam-waste-line .sam-wl-del{width:32px!important;height:32px!important;border-radius:50%!important;justify-self:center}
}
/* 2.3.0 Kiểm hàng cuối ca: 1 hàng công cụ */
html body .main .sam-stk-top{display:grid;grid-template-columns:220px minmax(0,1fr) auto auto;gap:10px;align-items:end;margin:6px 0 10px;padding:12px;background:#fff;border:1px solid #E3D6CB;border-radius:12px}
html body .main .sam-stk-top form{margin:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
html body .main .sam-stk-top form.stocktake-stall-selector{display:flex!important;flex-direction:column;gap:4px}
html body .main .sam-stk-top form.stocktake-stall-selector label{font-size:12.5px!important;font-weight:600!important;color:#6b5547!important;margin:0!important}
html body .main .sam-stk-top form.stocktake-create-inline{grid-column:2/4;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important;width:auto!important}
html body .main .sam-stk-top select,html body .main .sam-stk-top input{height:40px!important;min-height:0!important;border-radius:10px!important;box-sizing:border-box;width:100%}
html body .main .sam-stk-top .btn{height:40px!important;min-height:0!important;padding:0 16px!important;border-radius:10px!important;white-space:nowrap}
html body .main .sam-stk-top .sam-stk-scope-btn{height:40px;padding:0 12px;border:1px solid #E3D6CB;border-radius:10px;background:#fff;color:#3B2417;font:600 13px "Be Vietnam Pro",system-ui,sans-serif;cursor:pointer;white-space:nowrap}
html body .main .sam-stk-top .sam-stk-scope-btn[aria-expanded=true]{background:#F7F3EE}
html body .main .sam-stk-scope{margin:-4px 0 10px!important;padding:10px 12px!important;font-size:13px!important;border-radius:10px!important;background:#FBF8F4!important}
html body .main .tablewrap>.sam-lk-bar{margin:0!important;border:0!important;border-bottom:1px solid #eee5dd!important;border-radius:0!important}
@media (max-width:760px){
  html body .main .sam-stk-top{grid-template-columns:minmax(0,1fr) auto;padding:10px}
  html body .main .sam-stk-top form.stocktake-create-inline{grid-column:1/-1;grid-template-columns:minmax(0,1fr)!important}
  html body .main .sam-stk-top form.stocktake-stall-selector{grid-column:1}
  html body .main .sam-stk-top .sam-stk-scope-btn{grid-column:2;grid-row:1;align-self:end;height:44px}
  html body .main .sam-stk-top select,html body .main .sam-stk-top input,html body .main .sam-stk-top .btn{height:44px!important;font-size:16px!important}
}
html body .main .sam-stk-top form.stocktake-stall-selector label{align-self:flex-start!important;text-align:left!important;padding:0!important;width:auto!important}

/* ===== 2.3.0 Chuyến bay & Doanh thu ===== */
html body .main .sam-flight-datebox{position:relative!important;display:block!important}
html body .main .sam-flight-datebox .sam-flight-date-display{position:absolute!important;left:1px;top:1px;bottom:1px;right:34px;display:flex!important;align-items:center;padding:0 12px;background:#fff;border-radius:9px 0 0 9px;pointer-events:none;font-size:14px;color:#2b1d14;z-index:1;margin:0!important}
html body .main .sam-flight-datebox input[type=date]{width:100%!important;height:40px!important;min-height:0!important;box-sizing:border-box;border-radius:10px!important}
html body .main .sam-flight-datebox input[type=date]:disabled+*{opacity:1}
html body .main form.sam-flight-filter-row{display:flex!important;flex-wrap:wrap!important;gap:10px 12px!important;align-items:flex-end!important;grid-template-columns:none!important}
html body .main form.sam-flight-filter-row>*{flex:0 0 auto!important;width:auto!important;min-width:0!important;margin:0!important}
html body .main form.sam-flight-filter-row .sam-flight-preset-field{width:200px!important}
/* "Ngày / kỳ" chỉ là ô chữ lặp lại lựa chọn -> bỏ; chỉ hiện ô Từ ngày / Đến ngày khi chọn "Tùy chọn" */
html body .main .sam-flight-period-field .sam-flight-period-label,html body .main .sam-flight-period-field .sam-flight-preset-summary{display:none!important}
html body .main .sam-flight-period-field:has(.sam-flight-custom-range.is-hidden){display:none!important}
html body .main .sam-flight-custom-range:not(.is-hidden){display:flex!important;gap:10px 12px!important;align-items:flex-end;flex-wrap:wrap}
html body .main .sam-flight-custom-date{display:flex!important;flex-direction:column;gap:4px;width:180px!important}
html body .main .sam-flight-custom-caption,html body .main .sam-flight-filter-field>label,html body .main .sam-flight-field>label{font-size:12.5px!important;font-weight:600!important;color:#6b5547!important;text-transform:none!important}
html body .main form.sam-flight-filter-row select,html body .main form.sam-flight-filter-row .btn,html body .main form.sam-flight-entry input,html body .main form.sam-flight-entry .btn{height:40px!important;min-height:0!important;border-radius:10px!important;box-sizing:border-box}
html body .main form.sam-flight-filter-row .btn{padding:0 18px!important}
html body .main .sam-flight-tools{margin:4px 0 8px!important;gap:8px!important}
html body .main .sam-flight-tools .btn{height:34px!important;min-height:0!important;padding:0 12px!important;font-size:13px!important}
@media (max-width:760px){
  html body .main form.sam-flight-filter-row .sam-flight-preset-field,html body .main .sam-flight-custom-date{width:calc(50% - 6px)!important}
  html body .main .sam-flight-datebox input[type=date],html body .main form.sam-flight-filter-row select,html body .main form.sam-flight-filter-row .btn{height:44px!important;font-size:16px!important}
}
@media (min-width:761px){html body .main form.sam-flight-filter-row>:last-child:not(button):not(.btn){margin-left:auto!important}}
@media (max-width:760px){
  html body .main form.sam-flight-filter-row .sam-flight-preset-field,html body .main form.sam-flight-filter-row .sam-flight-period-field,html body .main .sam-flight-custom-range:not(.is-hidden){width:100%!important;flex:1 1 100%!important}
  html body .main .sam-flight-custom-date{width:calc(50% - 6px)!important;flex:1 1 calc(50% - 6px)!important}
  html body .main form.sam-flight-filter-row>:last-child:not(button):not(.btn){flex:1 1 auto!important}
}

/* ===== SAM UI 2.3.0b: form nhập hàng / công thức / gán NCC ===== */
/* Ô SL nhập tay (chuẩn 1.7.2), SL và đơn giá chia đều trên điện thoại */
@media(max-width:760px){
html body .content form[action^="/purchase/create"] .purchase-multi-row:not(.sam-dp-create-line-v11){grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px!important}
html body .content form[action^="/purchase/create"] .purchase-multi-row:not(.sam-dp-create-line-v11)>.qtybox>button{display:none!important}
html body .content form[action^="/purchase/create"] .purchase-multi-row:not(.sam-dp-create-line-v11)>.qtybox{display:block!important;width:100%!important;min-width:0!important;max-width:none!important;height:40px!important}
html body.sam-direct-purchase-create-mobile-v12 .sam-dp-create-controls-v12,html body.sam-direct-purchase-create-mobile-v12 .sam-dp-create-labels-v12{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
html body.sam-direct-purchase-create-mobile-v11 .sam-dp-create-qty-v11.qtybox{display:block!important;width:100%!important;min-width:0!important;max-width:none!important;height:40px!important}
html body.sam-direct-purchase-create-mobile-v11 .sam-dp-create-qty-v11.qtybox>input{width:100%!important;min-width:0!important;max-width:none!important;height:40px!important;text-align:right!important;padding:0 10px!important}
html body.sam-pg-supmap .main details>.tablewrap>table{min-width:0!important;width:100%!important}
html body.sam-pg-supmap .main details>.tablewrap>table th:first-child{width:72px!important}
html body.sam-pg-supmap .main details>.tablewrap>table td{white-space:normal!important}
}
/* Công thức: ô tìm + nút Tìm cùng hàng, danh sách món gọn */
html body .main .bom-products>form{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center}
html body .main .bom-products>form>button{margin-top:0!important;height:40px!important}
html body .main .bom-products>form>input[name=q]{height:40px!important;min-width:0!important;width:100%!important}
html body .main .bom-product-link br{display:none}
html body .main .bom-product-link>span.muted{display:block;margin-top:2px;line-height:1.3!important}
html body .main .bom-product-link{line-height:1.3!important;padding:8px 10px!important}
/* Tiêu đề khối viết hoa toàn bộ → chữ thường có dấu */
html body .main .smv2-title{text-transform:none!important}
@media(max-width:760px){
html body .content form[action^="/purchase/create"] .purchase-multi-row:not(.sam-dp-create-line-v11)>.qtybox>input{width:100%!important;min-width:0!important;max-width:none!important;height:40px!important;text-align:right!important;padding:0 10px!important}
html body .content form[action^="/purchase/create"] input[name^="price_"]{text-align:right!important;padding:0 10px!important}
html body .main .sam-request-date-wrap input[type=date]{color:transparent!important}
html body .main .sam-request-date-wrap input[type=date]::-webkit-datetime-edit{opacity:0!important}
}
@media(max-width:760px){
html body .content form[action^="/purchase/create"] .purchase-multi-row:not(.sam-dp-create-line-v11)>.qtybox{border:0!important;background:none!important;padding:0!important;box-shadow:none!important}
html body .content form[action^="/purchase/create"] .purchase-multi-row .sam-purchase-item-labels-v112{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px!important;column-gap:8px!important}
html body .content form[action^="/purchase/create"] .purchase-multi-row .sam-purchase-item-labels-v112>span:nth-child(2){grid-column:2/4!important;width:auto!important}
}

/* ===== SAM UI 2.3.1: thẻ mặt hàng phiếu kiểm NHÁP (đang đếm, có nút − 0 +) ===== */
/* Dòng 1: [ảnh + tên + mã]  |  Tồn hệ thống  số
   Dòng 2: Đếm [−] [ ô số ] [+] [0]   |   trạng thái
   Dòng 3: lý do (nếu có) */
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick){grid-template-columns:minmax(0,1fr) auto auto!important;grid-template-areas:"info lbl sys" "info diff diff" "ent ent ent" "why why why"!important;gap:6px 8px!important;padding:10px 12px!important}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-head>div:first-child{min-width:0!important;overflow:hidden}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-entry{display:grid!important;grid-template-columns:auto 40px minmax(0,1fr) 40px 40px;grid-template-areas:"lb mi in pl ze";align-items:center;gap:6px!important;min-width:0}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-entry::before{grid-area:lb;line-height:40px!important}
html body #samV3StocktakeDetail .samv3-stkd-entry .samv3-stkd-quick{width:40px!important;min-width:40px!important;max-width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;margin:0!important;border-radius:10px!important;font-size:16px!important;font-weight:700!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border:1px solid #E3D6CB!important;background:#F3ECE6!important;color:#3B2417!important;box-shadow:none!important}
html body #samV3StocktakeDetail .samv3-stkd-entry .samv3-stkd-quick[data-action=minus]{grid-area:mi}
html body #samV3StocktakeDetail .samv3-stkd-entry .samv3-stkd-quick[data-action=plus]{grid-area:pl}
html body #samV3StocktakeDetail .samv3-stkd-entry .samv3-stkd-quick[data-action=zero]{grid-area:ze;font-size:14px!important}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-entry input.samv3-stkd-actual{grid-area:in;width:100%!important;min-width:0!important;max-width:none!important;height:40px!important;text-align:center!important}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-diff{white-space:nowrap}
html body #samV3StocktakeDetail .samv3-stkd-card:has(.samv3-stkd-quick) .samv3-stkd-reason-wrap{grid-area:why;min-width:0}
/* 2.3.1: Bán hàng — danh sách món cuộn riêng: khi đã cuộn, mép trên mờ dần (không còn trông như thẻ mất ảnh) */
@media(min-width:901px){html body .pos-real-split .pos-left-pane .pos-products.sam-scrolled{-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 22px);mask-image:linear-gradient(to bottom,transparent 0,#000 22px)}}
html body .pos-real-split .pos-left-pane .pos-products .product-card.modern.compact .product-info .stock{text-overflow:clip!important}
/* 2.3.1: Bán hàng — thẻ Bill: bỏ vòng viền thứ 2 quanh chữ "Bill n" khi đang chọn bằng bàn phím; thẻ đang chọn đã có viền đậm */
html body #samBillTabs822m .sam-bill-tab-822g button:focus,html body #samBillTabs822m .sam-bill-tab-822g button:focus-visible{outline:none!important;box-shadow:none!important}

/* ===== SAM UI 3.0 — BỘ THÀNH PHẦN CHUẨN DUY NHẤT (1 lớp) =====
   Nằm trong @layer: khai báo !important trong layer THẮNG mọi !important cũ không có layer,
   nên không cần chồng thêm selector dài. JS gắn lớp sx-b* cho nút theo vai trò (1 chỗ duy nhất).
   Chỉ quy định "da" (màu, viền, bo góc, cỡ chữ, cao); không đụng bố cục/độ rộng. */
@layer samds{
  :root{--sx-dark:#3B2417;--sx-dark-h:#2c1b11;--sx-beige:#F3ECE6;--sx-beige-h:#EADFD6;--sx-line:#DDD0C5;--sx-text:#2B1D14;--sx-bad:#B42318;--sx-bad-bg:#FDECEA;--sx-bad-line:#F3C9C4;--sx-r:10px}
  html body .main .sx-b{box-sizing:border-box!important;border-radius:var(--sx-r)!important;font-weight:600!important;text-transform:none!important;letter-spacing:0!important;box-shadow:none!important;line-height:1.2!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important}
  html body .main .sx-b:not(.sx-b--sm){height:40px!important;min-height:40px!important;padding-top:0!important;padding-bottom:0!important}
  html body .main .sx-b:not(.sx-b--sm):not(.sx-b--sq){padding-left:14px!important;padding-right:14px!important}
  html body .main .sx-b--sm{height:30px!important;min-height:30px!important;padding:0 10px!important}
  html body .main .sx-b:not(.sx-b--icon):not(.sx-b--sm){font-size:13px!important}
  html body .main .sx-b--sm:not(.sx-b--icon){font-size:12.5px!important}
  html body .main .sx-b--sq{padding:0!important}
  html body .main .sx-b--primary{background:var(--sx-dark)!important;color:#fff!important;border:1px solid var(--sx-dark)!important}
  html body .main .sx-b--primary:hover{background:var(--sx-dark-h)!important}
  html body .main .sx-b--secondary{background:var(--sx-beige)!important;color:var(--sx-text)!important;border:1px solid var(--sx-line)!important}
  html body .main .sx-b--secondary:hover{background:var(--sx-beige-h)!important}
  html body .main .sx-b--danger{background:var(--sx-bad-bg)!important;color:var(--sx-bad)!important;border:1px solid var(--sx-bad-line)!important}
  html body .main .sx-b[disabled]{opacity:.5!important;cursor:not-allowed!important}
  /* chip lọc / tab chuyển: 1 chuẩn — cao 36, bo tròn, đang chọn = nền nâu đậm */
  html body .main .sx-chip{box-sizing:border-box!important;height:36px!important;min-height:36px!important;padding:0 14px!important;border-radius:999px!important;border:1px solid var(--sx-line)!important;background:#fff!important;color:var(--sx-text)!important;font-size:13px!important;font-weight:600!important;text-transform:none!important;letter-spacing:0!important;box-shadow:none!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important;line-height:1.2!important}
  html body .main .sx-chip:hover{background:var(--sx-beige)!important}
  html body .main .sx-chip.sx-chip--on{background:var(--sx-dark)!important;color:#fff!important;border-color:var(--sx-dark)!important}
  html body .main .sx-chip.sx-chip--on *{color:inherit!important}
  html body .main .sx-chip.sx-chip--on b{background:rgba(255,255,255,.2)!important;border-radius:999px!important;padding:0 6px!important;line-height:18px!important}
  /* nút ✕ xóa dòng: 1 chuẩn — ô vuông 40×40 (cao bằng ô nhập), cùng 1 ký tự ✕ */
  html body .main .sx-x{width:40px!important;min-width:40px!important;max-width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;font-size:0!important;line-height:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 40px!important}
  html body .main .sx-x::after{content:none!important;display:none!important}
  html body .main .sx-x{position:relative!important;overflow:hidden!important;color:transparent!important;text-indent:-200px!important;white-space:nowrap!important}
  html body .main .sx-x *{visibility:hidden!important}
  html body .main .sx-x::before{content:"✕"!important;font-size:14px!important;font-weight:700!important;line-height:1!important;color:var(--sx-bad)!important;position:absolute!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;text-indent:0!important;visibility:visible!important}
  /* viền báo chọn: bấm chuột thì không hiện; dùng phím Tab thì 1 viền mảnh bên ngoài */
  html body .main .sx-b:focus:not(:focus-visible),html body .main .sx-chip:focus:not(:focus-visible),html body .main .sx-x:focus:not(:focus-visible){outline:none!important;box-shadow:none!important}
  html body .main .sx-b:focus-visible,html body .main .sx-chip:focus-visible{outline:2px solid rgba(59,36,23,.35)!important;outline-offset:2px!important;box-shadow:none!important}
  /* nút thao tác nhỏ trong bảng/thẻ (Hủy, Xóa, Ngưng…): nền trắng, viền đỏ nhạt, chữ đỏ — kiểu cũ chị chọn */
  html body .main .sx-b--danger.sx-b--sm{background:#fff!important}
  html body .main .sx-b--danger.sx-b--sm:hover{background:var(--sx-bad-bg)!important}
  /* SỐ: cột số trong bảng và ô nhập số canh phải; tiêu đề của cột số canh phải theo (tiêu đề và số luôn thẳng nhau) */
  @media(min-width:761px){html body .main th.sx-num,html body .main td.sx-num{text-align:right!important}}
  html body .main .sx-f[type=number]:not(.samv3-stkd-actual){text-align:right!important;padding-right:12px!important}
  html body .main .sx-numlbl{text-align:right!important;justify-self:end!important}
  /* ô nhập: 1 chuẩn */
  html body .main .sx-f{box-sizing:border-box!important;height:40px!important;min-height:40px!important;border:1px solid var(--sx-line)!important;border-radius:var(--sx-r)!important;box-shadow:none!important}
  html body .main .sx-f:not([readonly]):not([disabled]):not([type=date]):not([type=datetime-local]){background-color:#fff!important;color:var(--sx-text)!important}
  html body .main .sx-f:focus{border-color:var(--sx-dark)!important;outline:2px solid rgba(59,36,23,.12)!important;outline-offset:0!important}
  @media(max-width:760px){
    html body .main .sx-b--sm{height:32px!important;min-height:32px!important}
    html body .main .sx-f{font-size:16px!important}
    html body .main .sx-b:not(.sx-b--icon):not(.sx-b--sm){font-size:14px!important}
  }
}

/* ===== SAM UI 3.0b: sửa lỗi đã biết ===== */
/* Gán NCC (điện thoại): đầu thẻ 2 dòng — [ảnh | tên hàng] / [ảnh | mã · trạng thái · quầy]; tên dài xuống dòng, không chen nhãn */
@media(max-width:760px){
html body .main .content section.smv2-card>header.smv2-head{display:grid!important;grid-template-columns:44px auto minmax(0,1fr)!important;grid-template-areas:"th nm nm" "th cd st"!important;column-gap:10px!important;row-gap:4px!important;align-items:center!important}
html body .main .content section.smv2-card>header.smv2-head>.smv2-thumb-wrap{grid-area:th!important;align-self:start}
html body .main .content section.smv2-card>header.smv2-head>.smv2-product{grid-area:nm!important;min-width:0;white-space:normal!important;overflow-wrap:anywhere;line-height:1.3!important}
html body .main .content section.smv2-card>header.smv2-head>.smv2-code{grid-area:cd!important;justify-self:start;position:static!important}
html body .main .content section.smv2-card>header.smv2-head>.smv2-stall{grid-area:st!important;justify-self:start;display:flex!important;align-items:center;gap:6px;flex-wrap:wrap;position:static!important;background:none!important;padding:0!important}
}
/* Gán NCC: "+ Thêm NCC" cùng kiểu nút phụ chuẩn (không viền đứt) */
html body .main .content details.smv2-add>summary{border:1px solid #DDD0C5!important;border-style:solid!important;background:#F3ECE6!important;color:#2B1D14!important;border-radius:10px!important;height:40px!important;min-height:40px!important;padding:0 14px!important;display:inline-flex!important;align-items:center!important;gap:6px;font-size:13px!important;font-weight:600!important;box-sizing:border-box!important;list-style:none}
html body .main .content details.smv2-add>summary::-webkit-details-marker{display:none}
/* Nhãn bị ép VIẾT HOA bằng CSS → chữ thường có dấu (thẻ duyệt điện thoại, báo cáo điện thoại, bảng Kho văn phòng) */
html body .main .sam-mcard-label,html body .main .sam-ap-review-label,html body .main .sam-report-mobile-nav-label,html body .main .sam-report-period-title,html body .main .sam-report-card-eyebrow,html body .main th.sam-lap-nw,html body .main th.num{text-transform:none!important;letter-spacing:0!important}
/* Nhãn đếm đầu trang (Tổng sản phẩm: 197 · Ngưng: 2 …): cùng cỡ, cùng hàng */
html body .main span.pill:has(>b){display:inline-flex!important;align-items:center!important;height:26px!important;min-height:26px!important;padding:0 10px!important;white-space:nowrap!important;line-height:1!important;box-sizing:border-box!important;vertical-align:middle}
html body .main .ow-badge{text-transform:none!important;letter-spacing:0!important}
/* Quy tắc vị trí nút cuối form (máy tính): "+ Thêm…" bên trái — nút gửi/lưu bên phải, cùng 1 hàng */
@media(min-width:761px){
html body .main form .toolbar:has(>.btn:first-child+.btn:last-child){justify-content:space-between!important}
html body .main form.preprocess-form.sam-preprocess-one-row{position:relative!important}
html body .main form.preprocess-form.sam-preprocess-one-row>div:last-child:has(>button){position:absolute!important;right:0!important;bottom:0!important;grid-row:auto!important;margin:0!important}
}
@media(min-width:761px){
/* Sơ chế: dòng đầu chừa cột ✕ như các dòng thêm → Ghi chú + 📷 thẳng cột mọi dòng */
html body .main form.preprocess-form.sam-preprocess-one-row>.field:has(input[name=note]){grid-column:6!important}
}
@media(min-width:761px){html body .main form.preprocess-form.sam-preprocess-one-row .field:has(input[name=note]) .sam-preprocess-camera{width:40px!important;min-width:40px!important;max-width:40px!important;flex:0 0 40px!important;padding:0!important}}
/* Nút tạo phiếu đầu trang (Hủy / Sơ chế, điện thoại): chữ 1 dòng, rộng theo chữ — không gãy "hao / hụt" */
@media(max-width:760px){html body .main .title.sam-has-month>a.sam-ops-v11-list-cta{width:auto!important;max-width:100%!important;white-space:nowrap!important;padding-left:14px!important;padding-right:16px!important}
html body .main .title.sam-has-month>a.sam-ops-v11-list-cta *{white-space:nowrap!important}}
@media(min-width:761px){
/* Nhập hàng / Nhập trực tiếp (máy tính): cột xóa dòng 40px cho vừa nút ✕ chuẩn; đơn giá giãn ra lấp chỗ */
html body .main .content form[action^="/purchase/create"] .purchase-multi-row:not(.sam-dp-create-line-v11),html body .main .content form[action^="/purchase/create"] .purchase-head{grid-template-columns:minmax(0,1fr) 114px 210px 40px!important}
html body .main .content form[action^="/purchase/create"] #directPurchaseV1Lines .purchase-multi-row,html body .main .content form[action^="/purchase/create"] .sam-dp-create-old-head-v11{grid-template-columns:minmax(360px,1fr) 120px 210px 40px!important}
}
/* Chi tiết điều chuyển: khối thao tác rỗng không chiếm thêm khoảng cách → 2 khung cách đều nhau */
html body .main .sam-transfer-redesign>.sam-transfer-actions:not(:has(button,a,form,input:not([type=hidden]))){display:none!important}

/* ===== 2.4.1b ===== */
/* Phiếu kiểm: ô tìm lọc được thẻ (bố cục thẻ ép display:grid đã đè lệnh ẩn) + ô tìm rộng hết hàng */
html body #samV3StocktakeDetail .samv3-stkd-card.samv3-stkd-hidden{display:none!important}
html body #samV3StocktakeDetail .samv3-stkd-tools{display:flex!important;gap:8px!important;align-items:center!important}
html body #samV3StocktakeDetail .samv3-stkd-tools>.samv3-stkd-search{flex:1 1 auto!important;width:auto!important;min-width:0!important;max-width:none!important}

/* ===== SAM UI 2.5.0: TRANG TỔNG QUAN (hướng B chị chọn) — 1 khối riêng .sx-dash, dữ liệu đọc từ trang gốc (ẩn đi) ===== */
html body .main section.content.sx-dash-on>*:not(.sx-dash){display:none!important}
html body .main section.content.sx-dash-on{display:block!important;padding:16px!important}
.sx-dash{--d-dark:#3B2417;--d-text:#2B1D14;--d-muted:#7A6556;--d-line:#E3D6CB;--d-bg:#F7F3EE;--d-beige:#F3ECE6;--d-ok:#1F7A4D;--d-okbg:#E8F5EE;--d-bad:#B42318;--d-badbg:#FDECEA;--d-warn:#B45309;
  display:grid;gap:14px;max-width:1180px;margin:0 auto;color:var(--d-text);font-family:inherit}
.sx-dash *{box-sizing:border-box}
.sx-dash .sxd-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:10px}
.sx-dash .sxd-h1{margin:0;font-size:22px;font-weight:800;line-height:1.2}
.sx-dash .sxd-sub{margin:2px 0 0;font-size:13px;color:var(--d-muted)}
.sx-dash .sxd-chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.sx-dash .sxd-chips::-webkit-scrollbar{display:none}
.sx-dash .sxd-chip{flex:0 0 auto;height:36px;padding:0 14px;border-radius:999px;border:1px solid #DDD0C5;background:#fff;color:var(--d-text);font:600 13px/1 inherit;cursor:pointer;white-space:nowrap}
.sx-dash .sxd-chip[aria-pressed="true"]{background:var(--d-dark);border-color:var(--d-dark);color:#fff}
.sx-dash .sxd-custom{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:13px;color:var(--d-muted)}
.sx-dash .sxd-custom input{height:40px;border:1px solid #DDD0C5;border-radius:10px;padding:0 10px;font:inherit;color:var(--d-text);background:#fff}
.sx-dash .sxd-box{background:#fff;border:1px solid var(--d-line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0}
.sx-dash .sxd-h2{margin:0;font-size:16px;font-weight:800}
.sx-dash .sxd-hero-l{font-size:13px;color:var(--d-muted);font-weight:600}
.sx-dash .sxd-hero-v{font-size:34px;font-weight:800;letter-spacing:-.5px;font-variant-numeric:tabular-nums;line-height:1.1;color:var(--d-text);text-decoration:none}
.sx-dash .sxd-delta{align-self:flex-start;height:26px;padding:0 10px;border-radius:999px;font-size:13px;font-weight:700;display:inline-flex;align-items:center}
.sx-dash .sxd-delta.up{background:var(--d-okbg);color:var(--d-ok)}
.sx-dash .sxd-delta.down{background:var(--d-badbg);color:var(--d-bad)}
.sx-dash .sxd-delta.flat{background:var(--d-beige);color:var(--d-muted)}
.sx-dash .sxd-bars{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;align-items:end;height:96px;border-bottom:1px solid var(--d-line);margin-top:6px}
.sx-dash .sxd-bar{background:#DCC7B6;border-radius:4px 4px 0 0;min-height:3px}
.sx-dash .sxd-bar.now{background:var(--d-dark)}
.sx-dash .sxd-hours{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;font-size:11px;color:var(--d-muted);text-align:center}
.sx-dash .sxd-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.sx-dash .sxd-kpi{background:#fff;border:1px solid var(--d-line);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px;min-width:0}
.sx-dash .sxd-kpi span{font-size:12px;color:var(--d-muted);font-weight:600}
.sx-dash .sxd-kpi b{font-size:18px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sx-dash .sxd-tasks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sx-dash a.sxd-task{background:#fff;border:1px solid var(--d-line);border-radius:12px;padding:12px;text-decoration:none!important;color:var(--d-text)!important;display:flex;flex-direction:column;gap:2px;min-height:72px}
.sx-dash a.sxd-task b{font-size:22px;color:var(--d-warn);font-variant-numeric:tabular-nums}
.sx-dash a.sxd-task span{font-size:13px;font-weight:600}
.sx-dash a.sxd-alert{background:var(--d-badbg);border:1px solid #F3C9C4;border-radius:12px;padding:12px;text-decoration:none!important;color:var(--d-text)!important;display:flex;align-items:center;gap:10px}
.sx-dash a.sxd-alert b{font-size:18px;color:var(--d-bad)}
.sx-dash a.sxd-alert span{font-size:13px;font-weight:600;flex:1;min-width:0}
.sx-dash .sxd-empty{font-size:13px;color:var(--d-muted);background:var(--d-beige);border-radius:12px;padding:12px}
.sx-dash .sxd-top{display:flex;flex-direction:column;gap:4px}
.sx-dash .sxd-top-row{display:flex;justify-content:space-between;gap:10px;font-size:13px}
.sx-dash .sxd-top-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sx-dash .sxd-top-row b{font-variant-numeric:tabular-nums;white-space:nowrap}
.sx-dash .sxd-track{height:8px;background:var(--d-beige);border-radius:999px;overflow:hidden}
.sx-dash .sxd-fill{height:8px;background:var(--d-dark);border-radius:999px}
@media(min-width:900px){
  .sx-dash .sxd-main{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start}
  .sx-dash .sxd-col{display:flex;flex-direction:column;gap:14px;min-width:0}
  .sx-dash .sxd-bars{height:160px}
}
@media(max-width:899px){.sx-dash .sxd-main,.sx-dash .sxd-col{display:flex;flex-direction:column;gap:14px}}
.sx-dash [hidden]{display:none!important}
@media(max-width:899px){.sx-dash .sxd-main{display:flex;flex-direction:column;gap:14px}.sx-dash .sxd-col{display:contents}
  .sx-dash .sxd-o1{order:1}.sx-dash .sxd-o2{order:2}.sx-dash .sxd-o3{order:3}.sx-dash .sxd-o4{order:4}}

/* ===== SAM UI 2.5.0: CHI TIẾT + DUYỆT PHIẾU (điều chuyển) — theo mẫu chị duyệt; chỉ đổi bố cục, form/nút giữ nguyên ===== */
html body .main .sam-transfer-redesign .sam-transfer-compact-top{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px 12px!important;background:#fff!important;border:1px solid #E3D6CB!important;border-radius:14px!important;padding:14px 16px!important;margin:0!important}
html body .main .sam-transfer-redesign .sam-transfer-compact-top>strong{font-size:18px!important;font-weight:800!important;color:#2B1D14!important}
html body .main .sam-transfer-redesign .sam-transfer-compact-top>span:not(.sam-transfer-state){flex-basis:100%;order:3;font-size:15px!important;font-weight:700!important;color:#2B1D14!important}
html body .main .sam-transfer-redesign .sam-transfer-compact-top>.sam-transfer-state{order:2;margin-left:auto}
/* khung Duyệt phiếu */
html body .main .sam-transfer-redesign .sam-transfer-actions:has(button[value=approve]){background:#fff!important;border:1px solid #E3D6CB!important;border-radius:14px!important;padding:14px 16px!important;margin:0!important}
html body .main .sam-transfer-redesign .sam-transfer-actions:has(button[value=approve])>form{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr)!important;grid-template-areas:"ttl ttl" "rsn rsn" "rej app"!important;gap:8px 10px!important;margin:0!important;padding:0!important;background:none!important;border:0!important}
html body .main .sam-transfer-redesign .sam-transfer-actions:has(button[value=approve])>form::before{content:"Duyệt phiếu";grid-area:ttl;font-size:15px;font-weight:800;color:#2B1D14}
html body .main .sam-transfer-redesign .sam-transfer-actions>form>input[name=reason]{grid-area:rsn;width:100%!important;max-width:none!important;margin:0!important}
html body .main .sam-transfer-redesign .sam-transfer-actions>form>button[value=reject]{grid-area:rej;width:100%!important;margin:0!important;background:#fff!important}
html body .main .sam-transfer-redesign .sam-transfer-actions>form>button[value=approve]{grid-area:app;width:100%!important;margin:0!important}
@media(min-width:900px){
  html body .main .sam-transfer-redesign.sx-split{display:flex!important;gap:16px!important;align-items:flex-start!important}
  html body .main .sam-transfer-redesign.sx-split>.sx-left{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:16px}
  html body .main .sam-transfer-redesign.sx-split>.sx-side{flex:0 0 340px;display:flex;flex-direction:column;gap:14px}
}
@media(max-width:899px){
  html body .main .sam-transfer-redesign.sx-split{display:flex!important;flex-direction:column!important;gap:12px!important}
  html body .main .sam-transfer-redesign.sx-split>.sx-side{display:flex;flex-direction:column;gap:12px;order:1}
  html body .main .sam-transfer-redesign.sx-split>.sx-left{display:flex;flex-direction:column;gap:12px;order:2;min-width:0}
}
/* nhãn trạng thái phiếu: cam = đang chờ, xanh = xong, đỏ = từ chối/hủy */
html body .main .sam-transfer-state.sx-tone-warn{background:#FDF3E3!important;color:#B45309!important;border-color:#F5D9AE!important}
html body .main .sam-transfer-state.sx-tone-ok{background:#E8F5EE!important;color:#1F7A4D!important;border-color:#BFE3CD!important}
html body .main .sam-transfer-state.sx-tone-bad{background:#FDECEA!important;color:#B42318!important;border-color:#F3C9C4!important}
@layer samds{html body .main .sam-transfer-actions button[value=reject].sx-b--danger{background:#fff!important}}
@media(max-width:899px){
  html body .main .sam-transfer-redesign:has(.sam-transfer-actions button[value=approve]){padding-bottom:150px!important}
  html body .main .sam-transfer-redesign .sam-transfer-actions:has(button[value=approve]){position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:50!important;border-radius:16px 16px 0 0!important;border-bottom:0!important;box-shadow:0 -6px 16px rgba(43,29,20,.08)!important;padding:12px max(16px,env(safe-area-inset-left,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-right,0px))!important}
  html body .main .sam-transfer-redesign .sam-transfer-actions:has(button[value=approve])>form::before{display:none}
  html body .main .sam-transfer-redesign .sam-transfer-actions:has(button[value=approve])>form{grid-template-areas:"rsn rsn" "rej app"!important}
  html body .main .sam-transfer-redesign .sam-transfer-actions>form>button{height:44px!important;min-height:44px!important;font-size:15px!important}
}

/* SAM 2.5.0 notifications: one list card, coloured dot per type */
@layer samds{
  .sam-bell2 .sx-nk--sale{--nk:#16A34A}
  .sam-bell2 .sx-nk--move{--nk:#2563EB}
  .sam-bell2 .sx-nk--stock{--nk:#9333EA}
  .sam-bell2 .sx-nk--low{--nk:#EA580C}
  .sam-bell2 .sx-nk--other{--nk:#A8A29E}
  html body .sam-bell2 .sx-nlist{display:block!important;background:#fff!important;border:1px solid #E3D6CB!important;border-radius:14px!important;overflow:hidden!important;margin:0 0 12px!important;padding:0!important}
  html body .sam-bell2 .sx-nlist>.sam-bell2-entry{display:flex!important;gap:10px!important;align-items:flex-start!important;border:0!important;border-bottom:1px solid #F0E6DE!important;border-radius:0!important;margin:0!important;background:transparent!important;padding:12px 14px!important;box-shadow:none!important}
  html body .sam-bell2 .sx-nlist>.sam-bell2-entry:last-child{border-bottom:0!important}
  html body .sam-bell2 .sx-nlist>a.sam-bell2-entry:hover{background:#FBF8F5!important}
  html body .sam-bell2 .sx-nlist .sam-bell2-ico{flex:0 0 18px!important;width:18px!important;min-width:18px!important;max-width:18px!important;margin:0!important;padding:0!important;height:20px!important;background:none!important;border-radius:0!important;font-size:0!important;color:transparent!important;display:grid!important;place-items:center!important}
  html body .sam-bell2 .sx-nlist .sam-bell2-ico::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--nk)}
  html body .sam-bell2 .sx-nlist .sx-nk--low .sam-bell2-ico::before{content:"!";width:18px;height:18px;display:grid;place-items:center;color:#fff;font-size:12px;font-weight:800;line-height:1}
  html body .sam-bell2 .sx-nlist .sam-bell2-title,html body .sam-bell2 .sx-nlist .sam-bell2-title b{color:#6B5547!important;font-weight:400!important}
  html body .sam-bell2 .sx-nlist .sam-bell2-title b{font-weight:600!important}
  html body .sam-bell2 .sx-nlist .unread .sam-bell2-title,html body .sam-bell2 .sx-nlist .unread .sam-bell2-title b,html body .sam-bell2 .sx-nlist .sx-npend .sam-bell2-title,html body .sam-bell2 .sx-nlist .sx-npend .sam-bell2-title b{color:#2B1D14!important;font-weight:700!important}
  html body .sam-bell2 .sx-nlist .sam-bell2-go{align-self:center!important}
  html body .sam-bell2 .sx-nlist .sam-action-required::after{content:none!important;display:none!important}
  html body .sam-bell2 .sx-nlegend{display:flex!important;flex-wrap:wrap;gap:6px 14px;margin:0 0 8px!important;font-size:12px;color:#7A6556;align-items:center}
  html body .sam-bell2 .sx-nlegend span{display:inline-flex;align-items:center;gap:6px}
  html body .sam-bell2 .sx-nlegend i{width:12px;height:12px;border-radius:50%;background:var(--nk);display:inline-block}
  html body .sam-bell2 .sx-nlegend .sx-nk--low i{width:16px;height:16px}
  html body .sam-bell2 .sx-nlegend .sx-nk--low i::before{content:"!";display:grid;place-items:center;height:100%;color:#fff;font-size:11px;font-weight:800;font-style:normal;line-height:1}
}

/* SAM 2.6.0 — duyệt phiếu thống nhất theo mẫu điều chuyển: lý do | Từ chối (trắng viền đỏ) | Duyệt (nâu); điện thoại: thanh dính đáy */
html body .content .sam-stk-bar:has(button[value=approve]) .sam-stk-bar-form{display:grid!important;grid-template-columns:minmax(0,1fr) 120px 180px!important;grid-template-areas:"rsn rej app"!important;gap:10px!important;align-items:center!important;margin:10px 0 0!important}
html body .content .sam-stk-bar-form>input[name=reason]{grid-area:rsn;width:100%!important;max-width:none!important;margin:0!important}
html body .content .sam-stk-bar-form>button[value=reject]{grid-area:rej;width:100%!important;margin:0!important}
html body .content .sam-stk-bar-form>button[value=approve]{grid-area:app;width:100%!important;margin:0!important}
html body .content form.sam-ap-actions>input[name=reason]{order:0}
html body .content form.sam-ap-actions>button[value=reject]{order:1}
html body .content form.sam-ap-actions>button[value=approve]{order:2}
@layer samds{
  html body .content .sam-stk-bar-form>button[value=reject].sx-b--danger,
  html body .content form.sam-ap-actions>button[value=reject].sx-b--danger{background:#fff!important}
}
@media(max-width:760px){
  html body .content:has(.sam-stk-bar button[value=approve]){padding-bottom:150px!important}
  html body .content .sam-stk-bar:has(button[value=approve]) .sam-stk-bar-form,
  html body.sam-ap-detail-mode article.sam-ap-open .sam-mcard-actions{position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:50!important;margin:0!important;background:#fff!important;border:1px solid #E3D6CB!important;border-bottom:0!important;border-radius:16px 16px 0 0!important;box-shadow:0 -6px 16px rgba(43,29,20,.08)!important;padding:12px max(16px,env(safe-area-inset-left,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-right,0px))!important}
  html body .content .sam-stk-bar:has(button[value=approve]) .sam-stk-bar-form{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr)!important;grid-template-areas:"rsn rsn" "rej app"!important;gap:8px 10px!important}
  html body.sam-ap-detail-mode article.sam-ap-open .sam-mcard-actions>form.sam-ap-actions{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr)!important;grid-template-areas:"rsn rsn" "rej app"!important;gap:8px 10px!important;margin:0!important;padding:0!important;width:100%!important}
  html body.sam-ap-detail-mode article.sam-ap-open form.sam-ap-actions>input[name=reason]{grid-area:rsn;width:100%!important;max-width:none!important;margin:0!important;height:44px!important;font-size:16px!important}
  html body.sam-ap-detail-mode article.sam-ap-open form.sam-ap-actions>button[value=reject]{grid-area:rej;width:100%!important;margin:0!important}
  html body.sam-ap-detail-mode article.sam-ap-open form.sam-ap-actions>button[value=approve]{grid-area:app;width:100%!important;margin:0!important}
  html body.sam-ap-detail-mode .content>.card:has(.sam-mcard-list):not(:has(.sam-ap-open)){display:none!important}
  html body.sam-ap-detail-mode .content{padding-bottom:150px!important}
  html body.sam-ap-detail-mode article.sam-ap-open .sam-mcard-index{display:none!important}
}

/* SAM 2.6.0 — chi tiết phiếu nhập: trạng thái là nhãn màu; điện thoại thông tin 2 cột cho gọn */
html body .content.sx-pd .sx-pd-st{display:inline-flex;align-items:center;height:26px;padding:0 10px;border-radius:999px;font-size:12px;font-weight:700}
html body .content.sx-pd .sx-pd-st.sx-tone-ok{background:#E8F5EE;color:#1F7A4D}
html body .content.sx-pd .sx-pd-st.sx-tone-warn{background:#FDF3E3;color:#B45309}
html body .content.sx-pd .sx-pd-st.sx-tone-bad{background:#FDECEA;color:#B42318}
@media(max-width:760px){
  html body .content.sx-pd .sx-pd-card .formgrid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:12px 14px!important}
  html body .content.sx-pd .sx-pd-card .formgrid>.field{margin:0!important;min-width:0}
  html body .content.sx-pd .sx-pd-card .formgrid>.field.span2{grid-column:1/-1}
  html body .content.sx-pd .sx-pd-card .formgrid>.field>label{margin:0 0 2px!important;font-size:12px!important}
  html body .content.sx-pd .sx-pd-card h3{margin:0 0 12px!important}
}
@layer samds{@media(max-width:760px){
  html body .content .sam-stk-bar-form>button.sx-b,
  html body.sam-ap-detail-mode article.sam-ap-open form.sam-ap-actions>button.sx-b{height:44px!important;min-height:44px!important;font-size:15px!important;padding:0 12px!important}
}}
/* SAM 2.6.0 — thẻ mặt hàng chi tiết phiếu nhập (điện thoại): mã hàng tràn đè tên -> cột mã tự giãn */
html body .sam-pd-line-top-v1{grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;column-gap:8px!important}
html body .sam-pd-line-code-v1{white-space:nowrap!important;width:auto!important;max-width:none!important}
html body .sam-pd-line-item-v1{padding-top:0!important}
/* SAM 2.6.0 — phiếu kiểm chờ duyệt: đã có thanh Duyệt/Từ chối ở trên (điện thoại dính đáy) -> ẩn khối "Xử lý phiếu kiểm" trùng ở cuối trang; số đếm dài không tràn ô */
html body .content:has(.sam-stk-bar button[value=approve]) .samv3-review-actions{display:none!important}
@layer samds{html body .samv3-stkd-actual.sx-long{font-size:13px!important;letter-spacing:-.2px!important;padding-left:2px!important;padding-right:2px!important}}

/* SAM 2.6.0 — form Sửa sản phẩm / Sửa nhà cung cấp (JS chia nhóm .sx-fs) */
html body .content .sam-product-image-field .product-image-preview[hidden]{display:none!important}
@layer samds{
  html body .content form.sx-fs-form{display:grid!important;grid-template-columns:minmax(0,1fr) 340px!important;gap:16px!important;align-items:start!important;background:none!important;border:0!important;box-shadow:none!important;padding:0!important;margin:0!important}
  html body .content form.sx-fs-supplier{grid-template-columns:minmax(0,1fr)!important;max-width:880px}
  html body .content form.sx-fs-form>.sx-fs-main{display:flex;flex-direction:column;gap:16px;min-width:0}
  html body .content form.sx-fs-form>.sx-fs-side{display:flex;flex-direction:column;gap:16px;position:sticky;top:76px}
  html body .content form.sx-fs-form .sx-fs{background:#fff!important;border:1px solid #E3D6CB!important;border-radius:14px!important;padding:16px!important;margin:0!important;display:flex;flex-direction:column;gap:12px}
  html body .content form.sx-fs-form .sx-fs-h{margin:0!important;font-size:15px!important;font-weight:800!important;color:#2B1D14!important;text-transform:none!important;letter-spacing:0!important}
  html body .content form.sx-fs-form .sx-fs-g{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  html body .content form.sx-fs-form .sx-fs-price .sx-fs-g{grid-template-columns:repeat(4,minmax(0,1fr))}
  html body .content form.sx-fs-form .sx-fs-g>.field{margin:0!important;min-width:0;grid-column:auto!important;display:flex;flex-direction:column;gap:4px}
  html body .content form.sx-fs-form .sx-fs-g>.field.sx-f-wide{grid-column:1/-1!important}
  html body .content form.sx-fs-form .sx-fs-g>.field>label{margin:0!important;font-size:12px!important;font-weight:600!important;color:#7A6556!important;text-transform:none!important}
  html body .content form.sx-fs-form .sx-fs-g>.field>small{margin:2px 0 0!important;color:#7A6556!important}
  html body .content form.sx-fs-form .sx-fs-g>.field>input,html body .content form.sx-fs-form .sx-fs-g>.field>select{width:100%!important;max-width:none!important;margin:0!important}
  html body .content form.sx-fs-form .sx-f-num>label,html body .content form.sx-fs-form .sx-f-num>input{text-align:right!important}
  html body .content form.sx-fs-form .sx-f-num>input{font-variant-numeric:tabular-nums}
  html body .content form.sx-fs-form .sx-fs-img .sx-fs-g{grid-template-columns:1fr}
  html body .content form.sx-fs-form .sx-fs-img .field{margin:0!important}
  html body .content form.sx-fs-form .sx-fs-img .sam-image-dropzone{min-height:200px!important;border:1px dashed #C9AE98!important;border-radius:12px!important;background:#FBF8F5!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:4px!important;text-align:center!important;padding:12px!important;color:#7A6556!important;cursor:pointer}
  html body .content form.sx-fs-form .sx-fs-img .sam-image-drop-title{font-size:13px!important;font-weight:600!important;color:#2B1D14!important}
  html body .content form.sx-fs-form .sx-fs-img .sam-image-drop-sub{font-size:12px!important;color:#7A6556!important}
  html body .content form.sx-fs-form .sx-fs-img .product-image-preview:not([hidden]){max-width:100%!important;max-height:180px!important;object-fit:contain!important;border-radius:8px!important}
  html body .content form.sx-fs-form .sx-fs-actions{background:#fff;border:1px solid #E3D6CB;border-radius:14px;padding:16px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:10px}
  html body .content form.sx-fs-form .sx-fs-actions>a{order:1;width:100%!important;margin:0!important;justify-content:center}
  html body .content form.sx-fs-form .sx-fs-actions>button{order:2;width:100%!important;margin:0!important}
  html body .content form.sx-fs-supplier>.sx-fs-side{position:static}
  html body .content form.sx-fs-supplier .sx-fs-actions{background:none;border:0;padding:0;justify-self:end;width:360px;max-width:100%}
  html body .sx-sr{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important}
  @media(max-width:760px){
    html body .content.sx-fs-page{padding-bottom:110px!important}
    html body .content form.sx-fs-form{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
    html body .content form.sx-fs-form>.sx-fs-side{position:static;order:-1;gap:12px}
    html body .content form.sx-fs-form .sx-fs{padding:14px!important;gap:10px}
    html body .content form.sx-fs-form .sx-fs-g{gap:10px}
    html body .content form.sx-fs-form .sx-fs-price .sx-fs-g{grid-template-columns:repeat(2,minmax(0,1fr))}
    html body .content form.sx-fs-form .sx-fs-price .sx-f-unit{order:3}
    html body .content form.sx-fs-form .sx-fs-price .field:has([name=tax_rate]){order:4}
    html body .content form.sx-fs-form .sx-fs-img .sx-fs-h{display:none}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-dropzone{min-height:96px!important;flex-direction:row!important;justify-content:flex-start!important;text-align:left!important;gap:12px!important}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-dropzone::before{content:"";flex:0 0 72px;height:72px;border-radius:10px;background:#F3ECE6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%237A6556' stroke-width='1.8'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3C/svg%3E") center/26px no-repeat}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-dropzone:has(.product-image-preview:not([hidden]))::before{display:none}
    html body .content form.sx-fs-form .sx-fs-actions{position:fixed;left:0;right:0;bottom:0;z-index:50;border-radius:16px 16px 0 0;border-bottom:0;box-shadow:0 -6px 16px rgba(43,29,20,.08);padding:12px max(16px,env(safe-area-inset-left,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-right,0px));width:auto;max-width:none;justify-self:stretch}
    html body .content form.sx-fs-form .sx-fs-actions>.sx-b{height:44px!important;min-height:44px!important;font-size:15px!important}
  }
}
@layer samds{
  html body .content form.sx-fs-form>.sx-fs-main{grid-column:1;grid-row:1}
  html body .content form.sx-fs-product>.sx-fs-side{grid-column:2;grid-row:1}
  html body .content form.sx-fs-supplier>.sx-fs-side{grid-column:1;grid-row:2}
  html body .content form.sx-fs-form::before,html body .content form.sx-fs-form::after{content:none!important;display:none!important}
  html body .content form.sx-fs-form .sx-f-num>label{text-align:right!important;justify-content:flex-end!important;align-self:stretch!important}
  @media(max-width:760px){
    html body .content form.sx-fs-form>.sx-fs-main,html body .content form.sx-fs-form>.sx-fs-side{grid-column:1!important;grid-row:auto!important}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-dropzone{display:grid!important;grid-template-columns:72px minmax(0,1fr)!important;grid-template-rows:auto auto!important;align-content:center!important;column-gap:12px!important;row-gap:2px!important}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-dropzone::before{grid-row:1/3}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-drop-title,html body .content form.sx-fs-form .sx-fs-img .sam-image-drop-sub{grid-column:2;align-self:end}
    html body .content form.sx-fs-form .sx-fs-img .sam-image-drop-sub{align-self:start}
  }
}
@layer samds{html body .content form.sx-fs-form>.sx-fs-main,html body .content form.sx-fs-form>.sx-fs-side{align-self:start!important}}
@layer samds{html body .content form.sx-fs-supplier>.sx-fs-side{align-items:flex-end!important}@media(max-width:760px){html body .content form.sx-fs-supplier>.sx-fs-side{align-items:stretch!important}}}
@layer samds{@media(max-width:760px){html body .content form.sx-fs-form .sx-fs-img .product-image-preview:not([hidden]){grid-column:1!important;grid-row:1/3!important;width:72px!important;height:72px!important;max-height:72px!important;min-height:0!important;object-fit:cover!important;border-radius:10px!important;margin:0!important;padding:0!important}}}

/* SAM 2.6.0b — 12 lỗi điện thoại chị chụp 01/12 22:08 */
@layer samds{
  html body .sx-dash .sxd-chip.sxd-morebtn{display:none}
  @media(max-width:760px){html body .sx-dash .sxd-chip.sxd-morebtn{display:inline-flex}}
  /* 1. Kiểm cuối ca: 2 nhãn trạng thái cùng cỡ, thẳng hàng */
  html body .samv3-stk-badges{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:wrap;justify-content:flex-end}
  html body .samv3-stk-badges>.samv3-stk-status,html body .samv3-stk-badges>.samv3-stk-result{display:inline-flex!important;align-items:center!important;height:26px!important;min-height:26px!important;padding:0 10px!important;margin:0!important;border-radius:999px!important;font-size:12px!important;font-weight:700!important;line-height:1!important;box-sizing:border-box!important;white-space:nowrap}
  html body .samv3-stk-history-top{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important}
  @media(max-width:760px){
    /* 2. Lập điều chuyển: ô SL gọn, nút Thêm rộng */
    html body .content *:has(>.sam-transfer-batch-qty){grid-template-columns:120px minmax(0,1fr)!important}
    /* 3. Kho văn phòng – phân bổ nơi nhận: thẻ gọn, 4 nơi nhận 2 cột */
    html body .sam-office-plan-scroll{overflow:visible!important;border:0!important}
    html body .sam-office-plan-table{min-width:0!important;width:100%!important;table-layout:auto!important}
    html body .sam-office-plan-table tbody tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px 10px!important;padding:12px!important;margin:0 0 10px!important;border:1px solid #E3D6CB!important;border-radius:12px!important;background:#fff!important}
    html body .sam-office-plan-table tbody td{width:auto!important;min-width:0!important;padding:0!important;border:0!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:4px!important;text-align:left!important}
    html body .sam-office-plan-table tbody td::before{font-size:12px!important;font-weight:600!important;color:#7A6556!important;margin:0!important;width:auto!important;text-align:left!important}
    html body .sam-office-plan-table tbody td:nth-child(1){grid-column:1/-1;font-size:15px}
    html body .sam-office-plan-table tbody td:nth-child(1)::before{display:none!important}
    html body .sam-office-plan-table tbody td:nth-child(2),html body .sam-office-plan-table tbody td:nth-child(3){flex-direction:row!important;align-items:baseline!important;gap:6px!important}
    html body .sam-office-plan-table tbody td:nth-child(8){grid-column:1/-1;flex-direction:row!important;justify-content:space-between!important;border-top:1px solid #F0E6DE!important;padding-top:8px!important}
    html body .sam-office-plan-table tbody td .sam-plan-qty{height:40px!important;font-size:16px!important}
    /* 4. Đề nghị mua: nút ✕ lên góc phải thẻ, cùng hàng chữ "Mặt hàng" */
    html body .content .sam-request-line{position:relative!important}
    html body .content .sam-request-line>.sam-v41-delete.sx-x{position:absolute!important;top:12px!important;right:12px!important;margin:0!important}
    html body .content .sam-request-line .sam-v41-product>.sam-request-field-label{min-height:40px!important;display:flex!important;align-items:center!important;padding-right:52px!important;box-sizing:border-box}
    /* 8. Danh sách phiếu: chip trạng thái gọn để 4 chip vừa 1 hàng; chữ "N phiếu" xuống dòng riêng */
    html body .sam-lk-bar .sam-lk-chips{flex:1 1 100%!important;flex-wrap:wrap!important;gap:6px!important}
    html body .sam-lk-bar .sam-lk-chip.sx-chip{padding:0 10px!important;height:34px!important;min-height:34px!important;font-size:13px!important}
    html body .sam-lk-bar .sam-lk-count{flex:1 1 100%!important;margin:0!important}
    /* 9. Sơ chế / hủy nhiều dòng: hàng "Dòng 2" cao đủ cho nút ✕ (không đè ô nhập) + hiện ĐVT */
    html body .main .sam-pre-line::before,html body .main .sam-waste-line::before{min-height:40px!important;padding-right:52px!important;content:"Dòng " counter(samln) attr(data-unit)!important}
    html body .main .sam-pre-line>.sam-wl-del,html body .main .sam-waste-line>.sam-wl-del{top:10px!important;right:10px!important}
    /* 10. Báo cáo: bỏ bảng nguồn bị hiện thành thẻ trùng; nút In vào cùng lưới với Lọc / Xuất Excel */
    html body .content .sam-report-tablewrap-cardified>table.sam-report-source{display:none!important}
    html body .content .sam-report-mobile-actions-v23{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
    html body .content .sam-report-mobile-actions-v23>*{width:100%!important;margin:0!important;justify-content:center}
    html body .content form.sam-report-sales-period-v24.sx-rep-moved{display:none!important}
    /* 11. Tổng quan: chip kỳ xuống dòng thay vì bị cắt */
    html body .sx-dash .sxd-chips{flex-wrap:wrap!important;overflow:visible!important}
    html body .sx-dash .sxd-chips:not(.open)>.sxd-chip.sxd-more{display:none!important}
    html body .sx-dash .sxd-chips>.sxd-chip{padding:0 12px!important;gap:6px}
    html body .sx-dash .sxd-chips{gap:6px!important}
    html body .samv3-stk-badges{flex-wrap:nowrap!important;flex:0 0 auto}
    html body .samv3-stk-date{flex:1 1 auto;min-width:0}
    /* 8b. từ 4 chip trở lên: chia đều 1 hàng, chữ trên – số dưới (không rớt dòng, không bị cắt) */
    html body .content .sam-lk-chips:has(>:nth-child(4)){display:grid!important;grid-template-columns:repeat(auto-fit,minmax(0,1fr))!important;gap:6px!important}
    html body .content .sam-lk-chips:has(>:nth-child(4))>.sam-lk-chip{height:auto!important;min-height:48px!important;padding:6px 4px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;border-radius:12px!important;line-height:1.15!important;white-space:nowrap;font-size:12.5px!important}
    html body .content .sam-lk-chips:has(>:nth-child(4))>.sam-lk-chip b{font-size:13px!important;padding:0!important;background:none!important;min-width:0!important}
    /* Nhận hàng điều chuyển: ô nhập Thực nhận / Hủy / Khác có nhãn như các dòng khác */
    html body .content table.sam-transfer-receive-table.sam-mcard td::before{display:block!important;content:attr(data-label)!important;flex:0 0 auto;min-width:96px;font-size:12px!important;font-weight:600!important;color:#7A6556!important}
    html body .content table.sam-transfer-receive-table.sam-mcard td{align-items:center!important;justify-content:space-between!important;gap:10px!important}
    html body .main .content table.sam-transfer-receive-table.sam-mcard tbody tr td .qtybox,html body .content table.sam-transfer-receive-table.sam-mcard td .qtybox{width:150px!important;max-width:150px!important;flex:0 0 150px!important;height:auto!important;min-height:40px!important;overflow:visible!important;margin:0!important;display:flex!important}
    html body .main .content table.sam-transfer-receive-table.sam-mcard tbody tr td input[name*=reason],html body .content table.sam-transfer-receive-table.sam-mcard td .qtybox input,html body .content table.sam-transfer-receive-table.sam-mcard td>input{width:150px!important;max-width:150px!important;flex:0 0 150px!important;min-width:0!important;height:40px!important;min-height:40px!important;margin:0!important;box-sizing:border-box!important}
    html body .content table.sam-transfer-receive-table.sam-mcard td .qtybox input{width:100%!important}
    /* bảng nguồn của danh sách thẻ: không hiện trùng */
    html body .content table.sam-report-source.sam-mcard,html body .content table.sam-sup-v1-source-table.sam-mcard{display:none!important}
    /* ô gộp cột (dòng trống "Không có …") không hiện nhãn cột dính vào chữ */
    html body .content table.sam-mcard td[colspan]::before{display:none!important;content:none!important}
    html body .content table.sam-mcard td[colspan]{justify-content:center!important;text-align:center!important;color:#7A6556}
    /* chip lọc từ 3 cái: chia đều 1 hàng (chữ trên, số dưới) — áp dụng chung mọi danh sách */
    html body .content .sam-lk-chips:has(>:nth-child(3)){display:grid!important;grid-template-columns:repeat(auto-fit,minmax(0,1fr))!important;gap:6px!important}
    html body .content .sam-lk-chips:has(>:nth-child(3))>.sam-lk-chip{height:auto!important;min-height:48px!important;padding:6px 4px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;border-radius:12px!important;line-height:1.15!important;white-space:normal!important;text-align:center!important;font-size:12.5px!important}
    html body .content .sam-lk-chips:has(>:nth-child(3))>.sam-lk-chip b{font-size:13px!important;padding:0!important;background:none!important;min-width:0!important}
    /* Công thức (3 chip) và Nguyên vật liệu (4 nút lọc): cùng kiểu chia đều */
    html body .content .sam-mf-chips,html body .sam-mi-filterbar{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(0,1fr))!important;gap:6px!important;overflow:visible!important;margin:8px 0!important}
    html body .main .sam-mf-chips>button.sx-chip,html body .main .sam-mf-chips>button,html body .main .sam-mi-filterbar>button,html body .main .sam-mi-filterbar>button.sx-b,html body .main .sam-mi-filterbar>button.sx-chip{height:auto!important;min-height:48px!important;width:auto!important;padding:6px 4px!important;margin:0!important;border-radius:12px!important;border:1px solid #DDD0C5!important;background:#fff!important;color:#2B1D14!important;font-size:12.5px!important;font-weight:600!important;line-height:1.2!important;white-space:normal!important;text-align:center!important;display:flex!important;align-items:center!important;justify-content:center!important;box-shadow:none!important}
    html body .main .sam-mf-chips>button.on,html body .main .sam-mi-filterbar>button.active,html body .main .sam-mi-filterbar>button.active.sx-chip,html body .main .sam-mi-filterbar>button.active.sx-b{background:#3B2417!important;border-color:#3B2417!important;color:#fff!important}
    /* thẻ chỉ số lẻ (5 ô): ô cuối rộng hết hàng cho cân */
    html body .content .sam-po-list-overview>div:nth-child(5):nth-last-child(1 of div){grid-column:1/-1!important}html body .content .sam-po-list-overview>div:nth-child(5){grid-column:1/-1!important}
    /* Kho văn phòng: đầu trang gọn — mô tả trên, 2 nút chia đều, nhãn kho ẩn (đã có tiêu đề) */
    html body .content .ow-top.ow-top-compact{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important}
    html body .content .ow-top.ow-top-compact>div[style]{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
    html body .content .ow-top.ow-top-compact>div[style]>.btn{width:100%!important;margin:0!important;justify-content:center}
    html body .content .ow-top.ow-top-compact .ow-badge{display:none!important}
    /* 3b. thẻ phân bổ: tự làm thẻ (bảng không còn tràn nên không tự đổi sang thẻ) */
    html body .sam-office-plan-table,html body .sam-office-plan-table tbody{display:block!important}
    html body .sam-office-plan-table thead{display:none!important}
    html body .sam-office-plan-table tbody td::before{content:attr(data-label)!important;display:block}
    /* 12. Sản phẩm: nút ✕ (xóa lọc) cùng hàng ô trạng thái */
    html body .content form.sam-search-inline-form{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important}
    html body .content form.sam-search-inline-form>select{flex:1 1 auto!important;min-width:0!important;width:auto!important;margin:0!important}
    html body .content form.sam-search-inline-form>.sx-x{flex:0 0 40px!important;margin:0!important}
  }
}

/* SAM 2.6.0b — nhãn ô nhập cùng cỡ ở form nhập hàng / nhập trực tiếp (trước 10.5px, nhỏ hơn mọi form khác) */
@layer samds{
  html body .main [class*="sam-dp-create-"]>label{font-size:12px!important;font-weight:600!important;color:#7A6556!important;letter-spacing:0!important;text-transform:none!important}
  html body .main form[action^="/purchase/create"] .field>label::after{font-size:12px!important;font-weight:600!important;color:#7A6556!important;letter-spacing:0!important}
}
@layer samds{@media(max-width:760px){html body .main form.sx-fs-form.sx-fs-inline .sx-fs-actions{position:static!important;border-radius:14px!important;border:1px solid #E3D6CB!important;box-shadow:none!important;padding:14px!important}}}
/* 2.6.0b — form Thêm SP: ảnh trên, nhóm giữa, nút Lưu cuối; nhãn số canh trái trên ĐT */
@layer samds{@media(max-width:760px){
  html body .content form.sx-fs-inline>.sx-fs-side{display:contents!important}
  html body .content form.sx-fs-inline>.sx-fs-side>.sx-fs-img{order:-1}
  html body .content form.sx-fs-inline>.sx-fs-main{order:0}
  html body .content form.sx-fs-inline>.sx-fs-side>.sx-fs-actions{order:2}
  html body .main form.sx-fs-form.sx-fs-inline>.sx-fs-side>.sx-fs-actions{display:block!important;background:none!important;border:0!important;padding:0!important}
  html body .main form.sx-fs-form.sx-fs-inline>.sx-fs-side>.sx-fs-actions>button{width:100%!important;height:44px!important}
}}
/* 2.6.0b — máy tính: nút Hủy dòng sơ chế không gạch chân (đồng bộ nút Hủy khác) */
@layer samds{html body .main button.sam-row-act-btn.sx-b{text-decoration:none!important}}
/* 2.6.0b — form Thêm SP (máy tính): khối nút chỉ có 1 nút Lưu -> nút trải đủ chiều ngang */
@layer samds{html body .main form.sx-fs-form.sx-fs-inline .sx-fs-actions{grid-template-columns:minmax(0,1fr)!important}html body .main form.sx-fs-form.sx-fs-inline .sx-fs-actions>button{width:100%!important}}
/* 2.6.0b — chi tiết điều chuyển (máy tính): bỏ khoảng trống khối thao tác rỗng, nút In phiếu trải ngang cột phải */
@layer samds{
  html body .main aside.sx-side .sam-transfer-actions:not(:has(*)){display:none!important}
  html body .main aside.sx-side .sam-transfer-head-actions{justify-content:stretch!important}
  html body .main aside.sx-side .sam-transfer-head-actions>.sam-transfer-pdf-toolbar{flex:1 1 auto!important;margin:0!important}
  html body .main aside.sx-side .sam-transfer-head-actions>.sam-transfer-pdf-toolbar>a{width:100%!important;justify-content:center!important}
}
/* SAM 2.6.0c — chị góp ý 02/12 06:37 (điện thoại) */
@layer samds{@media(max-width:760px){
  /* Sơ chế / Hủy: nút ✕ của dòng nằm gọn trong hàng tiêu đề "Dòng n", không đè ô chọn NVL */
  html body .main .sam-pre-line>.sam-wl-del.sx-x,html body .main .sam-waste-line>.sam-wl-del.sx-x{position:relative!important;top:0!important;right:0!important;left:auto!important;bottom:auto!important;margin:0!important;align-self:center!important;justify-self:end!important}
  html body .main .sam-pre-line,html body .main .sam-waste-line{row-gap:10px!important}
  html body .main .sam-v2-section-title{text-transform:none!important;letter-spacing:0!important}
  /* Phiếu nhập hàng: hàng "Mặt hàng" cao bằng nút ✕, ✕ không chạm ô tìm */
  html body .main .purchase-multi-row>.sam-purchase-item-header-v112{min-height:40px!important;display:flex!important;align-items:center!important}
  html body .main .purchase-multi-row>.sx-x{align-self:center!important;top:auto!important;margin:0!important}
  /* Đề nghị: nhãn "Mặt hàng" cao bằng nút ✕ ở góc phải */
  html body .content .sam-request-line .sam-v41-product>label{min-height:40px!important;display:flex!important;align-items:center!important;padding-right:52px!important;margin:0 0 6px!important}
  html body .content .sam-request-line>.sam-v41-delete.sx-x{top:var(--sx-req-top,12px)!important}
  /* Chuyến bay: nút Lọc cùng hàng ô "Xem theo", tổng chuyến bay xuống hàng riêng */
  html body .main form.sam-flight-filter-row{display:flex!important;flex-wrap:wrap!important;column-gap:8px!important;row-gap:10px!important;align-items:flex-end!important}
  html body .main form.sam-flight-filter-row>.sam-flight-preset-field{order:1;flex:1 1 0!important;width:auto!important;min-width:0!important}
  html body .main form.sam-flight-filter-row>.sam-flight-filter-action{order:2;flex:0 0 auto!important;margin:0!important}
  html body .main form.sam-flight-filter-row>.sam-flight-filter-action>*{height:40px!important;min-width:72px!important;margin:0!important}
  html body .main form.sam-flight-filter-row>.sam-flight-period-field{order:3;flex:1 1 100%!important;width:100%!important}
  html body .main form.sam-flight-filter-row>.sam-flight-total{order:4;flex:1 1 100%!important;width:100%!important;margin:0!important}
  /* Sản phẩm (và thẻ đếm cùng kiểu): 3 ô đếm chia đều 1 hàng, chữ trên số dưới */
  html body .content .sam-master-count-card:has(.pill~.pill~.pill){display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;padding:10px!important}
  html body .content .sam-master-count-card:has(.pill~.pill~.pill)>span:not(.pill){grid-column:1/-1!important;font-size:13px!important}
  html body .content .sam-master-count-card:has(.pill~.pill~.pill)>.pill{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;min-height:52px!important;height:auto!important;margin:0!important;padding:6px 4px!important;border-radius:10px!important;text-align:center!important;font-size:12px!important;line-height:1.25!important;white-space:normal!important}
  html body .content .sam-master-count-card:has(.pill~.pill~.pill)>.pill>b{font-size:16px!important;line-height:1.2!important}
}}
/* SAM 2.6.1 — Tổng quan: không cho trang gốc hiện chớp trước khi giao diện mới dựng xong (hết "nhấp nháy 2 giao diện" khi bấm kỳ).
   An toàn: nếu JS lỗi, sau 2 giây trang gốc tự hiện lại. */
@keyframes sxDashReveal{to{visibility:visible}}
html body .main section.content:has(form.dashboard-filter):not(.sx-dash-on){visibility:hidden;animation:sxDashReveal 0s linear 2s forwards}
html body .main .sx-dash.sxd-loading>*:not(:first-child){opacity:.45;transition:opacity .15s}
/* 2.6.1 — thông báo nổi: nút × tắt nhanh, cho vuốt ngang trên điện thoại */
html body .sam-nt{position:relative}
html body .sam-nt,html body .sam-toast{touch-action:pan-y;user-select:none;-webkit-user-select:none}
html body .sam-nt{padding-right:40px!important}
html body .sam-toast{padding-right:40px!important}
html body .sx-nt-x{position:absolute;top:50%;right:6px;transform:translateY(-50%);width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:inherit;opacity:.6;font:600 18px/1 "Be Vietnam Pro",system-ui,sans-serif;cursor:pointer;display:grid;place-items:center;padding:0}
html body .sam-nt .sx-nt-x{top:8px;transform:none}
html body .sx-nt-x:hover{opacity:1;background:rgba(0,0,0,.06)}
/* 2.6.1 — Tổng quan: chip kỳ gọn (Hôm nay · Hôm qua · Tháng này · Tùy chọn · Khác ▾) cả máy tính; ô Tùy chọn bấm hiện / bấm lại ẩn, 1 hàng */
@layer samds{
  html body .sx-dash .sxd-chips{flex-wrap:wrap!important;overflow:visible!important;gap:8px!important}
  html body .sx-dash .sxd-chips>.sxd-chip.sxd-morebtn{display:inline-flex!important}
  html body .sx-dash .sxd-chips:not(.open)>.sxd-chip.sxd-more{display:none!important}
  html body .sx-dash .sxd-chip.sxd-custbtn[aria-expanded=true]:not([aria-pressed=true]){border-color:#3B2417!important}
  html body .sx-dash .sxd-custom[hidden]{display:none!important}
  html body .sx-dash .sxd-custom:not([hidden]){display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:8px!important;max-width:520px}
  html body .sx-dash .sxd-custom input{flex:1 1 0;min-width:0;height:40px!important;width:auto!important}
  html body .sx-dash .sxd-custom .sxd-dash-sep{color:#7A6556;flex:0 0 auto}
  html body .sx-dash .sxd-custom .sxd-go{flex:0 0 auto;height:40px!important;background:#3B2417!important;color:#fff!important;border-color:#3B2417!important;padding:0 16px!important}
  @media(max-width:760px){
    html body .sx-dash .sxd-chips{gap:6px!important}
    html body .sx-dash .sxd-chips>.sxd-chip{padding:0 10px!important;font-size:13px!important}
    html body .sx-dash .sxd-custom:not([hidden]){max-width:none}
    html body .sx-dash .sxd-chips:not(.open)>.sxd-chip.sxd-custbtn:not([aria-pressed=true]):not([aria-expanded=true]){display:none!important}
    html body .sx-dash .sxd-custom input{width:0!important;flex:1 1 0!important;padding:0 8px!important}
    html body .sx-dash .sxd-custom .sxd-go{padding:0 14px!important}
  }
}
/* 2.6.1 — Thông báo › Hoạt động: Quầy · Loại hoạt động · Lọc cùng 1 hàng (cả điện thoại) */
@layer samds{
  html body .main form.sam-bell2-filters{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto!important;gap:8px!important;align-items:end!important}
  html body .main form.sam-bell2-filters>label{display:flex!important;flex-direction:column!important;gap:4px!important;margin:0!important;min-width:0!important;font-size:12px!important;font-weight:600!important;color:#7A6556!important}
  html body .main form.sam-bell2-filters>label>select{width:100%!important;min-width:0!important;margin:0!important}
  html body .main form.sam-bell2-filters>button{height:40px!important;margin:0!important;min-width:64px}
}
/* 2.6.1b — Tổng quan: các kỳ còn lại gom trong menu "Khác ▾" (máy tính mở ra cùng hàng; điện thoại thả xuống dạng danh sách) */
@layer samds{
  html body .sx-dash .sxd-chips{position:relative}
  html body .sx-dash .sxd-menu{display:contents}
  html body .sx-dash .sxd-chips:not(.open)>.sxd-menu{display:none!important}
  html body .sx-dash .sxd-menu>.sxd-chip.sxd-more,html body .sx-dash .sxd-menu>.sxd-chip.sxd-custbtn{display:inline-flex!important}
  @media(max-width:760px){
    html body .sx-dash .sxd-chips{flex-wrap:nowrap!important}
    html body .sx-dash .sxd-chips>.sxd-chip{flex:0 0 auto;padding:0 14px!important;font-size:14px!important}
    html body .sx-dash .sxd-chips.open>.sxd-menu{display:flex!important;flex-direction:column;position:absolute;z-index:40;top:calc(100% + 6px);right:0;min-width:200px;padding:6px;background:#fff;border:1px solid #E3D6CB;border-radius:14px;box-shadow:0 12px 28px rgba(43,29,20,.16)}
    html body .sx-dash .sxd-menu>.sxd-chip{display:flex!important;width:100%!important;justify-content:flex-start!important;height:44px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:#2B1D14!important;padding:0 12px!important;font-size:15px!important;font-weight:500!important}
    html body .sx-dash .sxd-menu>.sxd-chip[aria-pressed=true]{background:#F3ECE6!important;font-weight:700!important}
    html body .sx-dash .sxd-menu>.sxd-chip.sxd-custbtn{border-top:1px solid #F0E6DE!important;border-radius:0 0 10px 10px!important;margin-top:4px}
    html body .sx-dash .sxd-chips>.sxd-morebtn{margin-left:auto}
  }
}
/* 2.6.1b — biểu đồ giờ nhiều cột (tháng, tuần) trên điện thoại: nhãn giờ cách 3 cột để không dính chữ */
@media(max-width:760px){html body .sx-dash .sxd-hours:has(>:nth-child(11))>:not(:nth-child(3n+1)){visibility:hidden}}
/* SAM 2.6.2 — Nguyên vật liệu: đầu trang 1 hàng, ô tìm + lọc trạng thái 1 hàng, trạng thái dạng nhãn chữ */
@layer samds{
  html body .main .content.sx-nvl-page>.sx-ph{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 16px;margin:0 0 14px}
  html body .main .content.sx-nvl-page>.sx-ph>.title{margin:0!important;min-width:0}
  html body .main .content.sx-nvl-page>.sx-ph>.toolbar{display:flex!important;flex-wrap:wrap;gap:8px;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
  html body .main .content.sx-nvl-page>.sx-ph>.toolbar>*{margin:0!important}
  html body .main .content.sx-nvl-page>details.sx-ph-form:not([open]){display:none!important}
  html body .main .content.sx-nvl-page>details.sx-ph-form[open]>summary{font-size:15px!important;font-weight:800!important;list-style:none;cursor:default}
  html body .main .content.sx-nvl-page>details.sx-ph-form[open]>summary::-webkit-details-marker{display:none}
  html body .main .content.sx-nvl-page>.ingredient-status-legend{display:none!important}
  html body .main .sam-nvl-search{display:flex!important;flex-wrap:wrap;align-items:center;gap:10px 12px;margin:0 0 12px!important}
  html body .main .sam-nvl-search>input{flex:1 1 320px;max-width:460px;height:40px!important;margin:0!important}
  html body .main .sam-nvl-search>.sam-nvl-search-count{font-size:13px;color:#7A6556;font-variant-numeric:tabular-nums;white-space:nowrap}
  html body .main .sx-nvl-chips{display:flex;gap:6px;margin-left:auto}
  html body .main .sx-nvl-chip{height:36px;padding:0 14px;border-radius:999px;border:1px solid #DDD0C5;background:#fff;color:#2B1D14;font:600 13px "Be Vietnam Pro",system-ui,sans-serif;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
  html body .main .sx-nvl-chip>b{font-weight:600;color:#7A6556;font-variant-numeric:tabular-nums}
  html body .main .sx-nvl-chip[aria-pressed=true]{background:#3B2417;border-color:#3B2417;color:#fff}
  html body .main .sx-nvl-chip[aria-pressed=true]>b{color:#fff;opacity:.8}
  html body .main td.sam-nvl-status-v123 .product-status-dot{white-space:nowrap!important;width:auto!important;height:24px!important;border-radius:999px!important;padding:0 10px!important;display:inline-flex!important;align-items:center;font:600 12px/1 "Be Vietnam Pro",system-ui,sans-serif;box-shadow:none!important;border:0!important}
  html body .main td.sam-nvl-status-v123 .product-status-dot.on{background:#E6F4EC!important;color:#1F7A4D!important}
  html body .main td.sam-nvl-status-v123 .product-status-dot.off{background:#FDECEA!important;color:#B42318!important}
  html body .main td.sam-nvl-status-v123 .product-status-dot.on::after{content:"Đang dùng"}
  html body .main td.sam-nvl-status-v123 .product-status-dot.off::after{content:"Ngưng"}
  @media(max-width:760px){html body .main .sx-nvl-chips{margin-left:0;width:100%}html body .main .sx-nvl-chip{flex:1 1 0;justify-content:center;padding:0 8px}}
}
/* 2.6.2 — ô tìm có nút × riêng: ẩn nút × mặc định của trình duyệt (trước hiện 2 dấu ×) */
html body .sam-list-search-v1 input::-webkit-search-cancel-button,html body .sam-lk-bar input::-webkit-search-cancel-button{-webkit-appearance:none;display:none}
/* SAM 2.7.2 — Chi tiết Sản phẩm / NVL (bấm vào dòng): 1 bố cục chung cho cả 2 trang
   Hàng 1: ảnh + tên + mã + trạng thái + giá (trái) · Chỉnh sửa / Đóng chi tiết (phải)
   Hàng 2: thanh tab ngang Thông tin · Tồn kho · Thẻ kho · Giá & NCC
   Hàng 3: nội dung tab trải đủ chiều ngang (trước: 4 cột chen nhau, bảng thẻ kho đè lên nút) */
@layer samds{
  html body .main section.sam-exp-panel.sam-pd2,html body .main .sam-nvl-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"head foot" "tabs tabs" "body body";gap:14px 16px!important;width:100%!important;max-width:100%!important;box-sizing:border-box;padding:16px!important;align-items:start!important;flex-direction:initial!important}
  html body .main .sam-pd2>.sam-pd2-head,html body .main .sam-nvl-card>.sam-nvl-head{grid-area:head;min-width:0;width:auto!important;margin:0!important}
  html body .main .sam-pd2>.sam-pd2-footer,html body .main .sam-nvl-card>.sam-nvl-footer{grid-area:foot;display:flex!important;flex-direction:row!important;gap:8px!important;justify-self:end;align-self:start;width:auto!important;margin:0!important;padding:0!important;border:0!important}
  html body .main .sam-pd2>.sam-pd2-footer>*,html body .main .sam-nvl-card>.sam-nvl-footer>*{margin:0!important;white-space:nowrap}
  html body .main .sam-pd2>.sam-pd2-tabs,html body .main .sam-nvl-card>.sam-nvl-tabs{grid-area:tabs;display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:6px!important;width:auto!important;margin:0!important;padding:0 0 12px!important;border:0!important;border-bottom:1px solid #EFE5DC!important}
  html body .main .sam-pd2-tabs>.sam-pd2-tab,html body .main .sam-nvl-tabs>.sam-nvl-tab{height:36px!important;min-height:36px!important;padding:0 16px!important;border-radius:999px!important;border:1px solid #DDD0C5!important;background:#fff!important;color:#2B1D14!important;font:600 13px/1 "Be Vietnam Pro",system-ui,sans-serif!important;margin:0!important;width:auto!important;box-shadow:none!important;text-align:center!important;justify-content:center!important}
  html body .main .sam-pd2-tabs>.sam-pd2-tab[aria-selected=true],html body .main .sam-nvl-tabs>.sam-nvl-tab[aria-selected=true]{background:#3B2417!important;border-color:#3B2417!important;color:#fff!important}
  html body .main .sam-pd2>.sam-pd2-content,html body .main .sam-nvl-card>.sam-nvl-panel{grid-area:body;min-width:0;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;border:0!important;overflow-x:auto}
  html body .main .sam-pd2>.sam-pd2-content[hidden],html body .main .sam-nvl-card>.sam-nvl-panel[hidden]{display:none!important}
  html body .main .sam-pd2 .sam-pd2-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(180px,1fr))!important;gap:12px 20px!important;width:100%!important}
  html body .main .sam-nvl-card>.sam-nvl-panel table{width:100%!important;max-width:100%!important;margin:0!important}
  @media(max-width:760px){
    html body .main section.sam-exp-panel.sam-pd2,html body .main .sam-nvl-card{grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"head" "tabs" "body" "foot"}
    html body .main .sam-pd2>.sam-pd2-footer,html body .main .sam-nvl-card>.sam-nvl-footer{justify-self:stretch}
    html body .main .sam-pd2>.sam-pd2-footer>*,html body .main .sam-nvl-card>.sam-nvl-footer>*{flex:1 1 0}
    html body .main .sam-pd2 .sam-pd2-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  }
}
/* 2.7.2 — dòng vừa sửa: giữ nền nhạt để biết chỗ quay lại, bỏ nhãn chữ "↩ Vừa thao tác" (trước nằm chen vào cột Thao tác) */
html body .sam-recent-edited-label,html body .sam-recent-activity-label-v2{display:none!important}

/* 2.7.3 — Nhà cung cấp (máy tính): tiêu đề + mô tả bên trái, 3 nút bên phải; ô tìm + chip trạng thái do thanh danh sách lo.
   Ô tìm / chọn trạng thái / Lọc của form cũ chỉ ẩn khi đang không lọc gì (vào bằng đường dẫn có ?q= hay ?status= vẫn thấy để xóa lọc). */
@layer samds{
  @media (min-width:801px){
    html body .main .content.sx-sup-page>.sam-sup-title{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"h t" "p t";align-items:center;gap:4px 16px!important;margin:0 0 14px!important}
    html body .main .content.sx-sup-page>.sam-sup-title>h1{grid-area:h;margin:0!important}
    html body .main .content.sx-sup-page>.sam-sup-title>p{grid-area:p;margin:0!important;font-size:13px!important;color:#7A6556!important}
    html body .main .content.sx-sup-page>.sam-sup-title>.toolbar{grid-area:t;display:flex!important;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px!important;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
    html body .main .content.sx-sup-page>.sam-sup-title>.toolbar>*{margin:0!important;width:auto!important;flex:0 0 auto!important}
    html body .main .content.sx-sup-page>.sam-sup-title>.toolbar>.pill{display:none!important}
    html body .main .content>form.supplier-master-filter:has(input[name=q][value=""]):not(:has(select[name=status] option[selected]))>:is(.supplier-search-wrap,select[name=status],button){display:none!important}
    html body .main .content.sx-sup-page>form.supplier-master-filter:has(input[name=q][value=""]):not(:has(select[name=status] option[selected])){display:none!important}
    html body .main .content.sx-sup-page>form.supplier-master-filter{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px!important;margin:0 0 12px!important}
    html body .main .content.sx-sup-page>form.supplier-master-filter>.supplier-search-wrap{flex:0 1 380px!important;width:auto!important;margin:0!important}
    html body .main .content.sx-sup-page>form.supplier-master-filter>.supplier-search-wrap>input{width:100%!important}
    html body .main .content.sx-sup-page>form.supplier-master-filter>select{flex:0 0 200px!important;width:200px!important;margin:0!important}
    html body .main .content.sx-sup-page>form.supplier-master-filter>button{flex:0 0 auto!important;width:auto!important;min-width:90px;margin:0!important}
  }
}
/* 2.7.3 — Lịch sử nhận hàng: 5 ô lọc chia đều 1 hàng, hàng 2 = ô tìm + Lọc · Nhận hàng · Xuất Excel. Ô NCC dạng gõ tìm cao bằng ô khác. Chỉ máy tính (điện thoại có bộ lọc riêng, form này bị ẩn). */
@layer samds{
  @media (min-width:801px){
    html body .main form.toolbar:has(>input[name=view][value=history]){display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px 12px!important;align-items:end!important;padding:0!important;margin:0 0 12px!important}
    html body .main form.toolbar:has(>input[name=view][value=history])>.field{min-width:0!important;width:auto!important;max-width:none!important;margin:0!important;display:flex!important;flex-direction:column!important;justify-content:flex-end!important;gap:6px!important}
    html body .main form.toolbar:has(>input[name=view][value=history])>.field>label{margin:0!important;padding:0!important;line-height:18px!important;min-height:18px}
    html body .main form.toolbar:has(>input[name=view][value=history])>.field:has(input[name=q]){grid-column:span 2}
    html body .main form.toolbar:has(>input[name=view][value=history])>.btn{margin:0!important;width:100%!important;height:40px!important}
    html body .main form.toolbar:has(>input[name=view][value=history]) .field>input,
    html body .main form.toolbar:has(>input[name=view][value=history]) .field>select,
    html body .main form.toolbar:has(>input[name=view][value=history]) .sam-autocomplete,
    html body .main form.toolbar:has(>input[name=view][value=history]) .sam-autocomplete-input{width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;box-sizing:border-box}
    html body .main form.toolbar:has(>input[name=view][value=history]) .sam-autocomplete-input{height:40px!important;border-radius:10px!important;padding:0 12px!important}
  }
}
/* 2.7.3 — nút trong ô Thao tác: Sửa / Ngưng / Xóa… thẳng 1 hàng, cùng cao (form bọc nút "Ngưng" từng đẩy nút xuống 2px) */
html body .main td .sam-nvl-actions-v123{display:flex!important;align-items:center!important;justify-content:flex-end;gap:8px!important;flex-wrap:nowrap}
html body .main td .sam-nvl-actions-v123>form{display:flex!important;align-items:center;margin:0!important;padding:0!important}
html body .main td .sam-nvl-actions-v123 .sx-b{margin:0!important}
/* 2.7.3 — điện thoại, màn CHI TIẾT sản phẩm / NVL (mobile_detail=1): form sửa gốc phải ẩn (chỉ hiện khi bấm "Sửa sản phẩm").
   Lỗi từ 2.6.0: luật chia nhóm form (.sx-fs-form display:grid trong @layer) thắng luật ẩn cũ -> form sửa + thanh Lưu hiện sẵn dưới chi tiết / Thẻ kho. */
@layer samds{@media(max-width:800px){
  html body .main .content form.sx-fs-form:is(.sam-original-product-edit,.sam-original-ingredient-edit),
  html body .main .content form:is(.sam-original-product-edit,.sam-original-ingredient-edit){display:none!important}
}}

/* 2.7.4 — Chi tiết SẢN PHẨM dùng đúng khuôn thẻ NVL (chị yêu cầu đồng nhất 02/12 19:48):
   khối có tiêu đề (Định danh / Phân loại & đơn vị / Giá…), bảng Thẻ kho: Chứng từ · Loại phát sinh · Diễn giải · Thời gian · Nhập/Xuất · Tồn sau · Nhân viên */
@layer samds{
  html body .main .sam-pd2 .sam-nvl-layout{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;align-items:start;width:100%;min-width:0;white-space:normal}
  html body .main .sam-pd2 .sam-nvl-section{box-sizing:border-box;min-width:0;margin:0;padding:14px 15px!important;background:#fff!important;border:1px solid #E9EDF2!important;border-radius:10px!important}
  html body .main .sam-pd2 .sam-nvl-section.sam-nvl-wide{grid-column:1/-1}
  html body .main .sam-pd2 .sam-nvl-section>h4{font-size:13px!important;font-weight:700!important;color:#263448!important;margin:0 0 11px!important;line-height:1.45}
  html body .main .sam-pd2 .sam-nvl-fields{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:11px 17px!important}
  html body .main .sam-pd2 .sam-nvl-wide .sam-nvl-fields{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))!important}
  html body .main .sam-pd2 .sam-nvl-field{display:flex;flex-direction:column;gap:3px;min-width:0}
  html body .main .sam-pd2 .sam-nvl-field>span{font-size:13px!important;color:#667085!important;font-weight:400!important}
  html body .main .sam-pd2 .sam-nvl-field>strong{font-size:13px!important;font-weight:600!important;color:#253247!important;line-height:1.45;white-space:normal!important;overflow-wrap:anywhere}
  html body .main .sam-pd2 .sam-nvl-empty{padding:16px 18px;border-radius:10px;background:#F7F4F1;border:1px solid #EDE5DE;color:#5f5148;font-size:14px;line-height:1.5;white-space:normal}
  html body .main .sam-pd2 .sam-nvl-ledger-wrap{width:100%;max-width:100%;overflow-x:auto}
  html body .main .sam-pd2 table.sam-nvl-ledger{width:100%!important;min-width:0;table-layout:auto;border-collapse:separate!important;border-spacing:0;background:#fff;border:1px solid #E6D9CF!important;border-radius:10px!important;overflow:hidden}
  html body .main .sam-pd2 table.sam-nvl-ledger th{background:#F7F1ED!important;color:#321E15!important;font-size:13px!important;font-weight:650!important;text-align:left;padding:8px 8px!important;white-space:nowrap;border-bottom:1px solid #E6D9CF}
  html body .main .sam-pd2 table.sam-nvl-ledger td{font-size:13px!important;padding:8px 8px!important;border-bottom:1px solid #F0E8E1;white-space:normal;overflow-wrap:anywhere;vertical-align:middle}
  html body .main .sam-pd2 table.sam-nvl-ledger tbody tr:last-child td{border-bottom:0}
  html body .main .sam-pd2 table.sam-nvl-ledger :is(th,td){text-align:left!important}
  html body .main .sam-pd2 table.sam-nvl-ledger :is(th,td):is(:nth-child(5),:nth-child(6)){text-align:right!important}
  html body .main .sam-pd2 table.sam-nvl-ledger td:nth-child(4){white-space:nowrap}
  @media (max-width:800px){
    html body .main .sam-pd2 .sam-nvl-layout{grid-template-columns:1fr!important}
    html body .main .sam-pd2 .sam-nvl-section.sam-nvl-wide{grid-column:auto}
  }
}
/* 2.7.4 — Báo cáo: ô Từ ngày / Đến ngày nằm trong nhãn chữ đậm nên bị đậm 800 -> chữ thường như mọi ô nhập */
@layer samds{html body .main form label>input[type=date].sx-f{font-weight:400!important}}
/* 2.7.4 — Nhập tồn đầu kỳ: nhãn "Đã ghi nhận" không xuống 2 dòng; 3 nút thao tác tự xuống hàng trong ô (không tràn bảng) */
@layer samds{@media (min-width:801px){
  html body .main td.sam-col-status .sam-st{white-space:nowrap!important}
  html body .main td .sam-opening-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important;align-items:center}
  html body .main td .sam-opening-actions>form{display:flex!important;margin:0!important}
  html body .main td .sam-opening-actions .sx-b{margin:0!important;white-space:nowrap}
  html body .main td.sam-col-action:has(.sam-opening-actions){min-width:0!important;width:auto}
}}
/* 2.7.5 — Tồn kho: nhãn "Ngưng" cạnh tên mặt hàng đã ngưng (xếp cuối danh sách) */
html body .main .sx-inv-off{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#F3ECE6;color:#7A6556;font-size:11px;font-weight:600;line-height:18px;vertical-align:1px;white-space:nowrap}
/* 2.7.6: Sổ kho / Tồn kho / NVL trên điện thoại "nhấp nháy 2 giao diện": chữ nhỏ <12px hiện trước rồi JS mới nâng lên 12px
   (hàng nghìn ô) → cả danh sách nhảy cỡ. Đặt sẵn 12px ngay từ CSS (đúng bằng kết quả JS cũ) để trang hiện 1 lần, không nhảy. */
html body #samV3Ledger .samv3-ledger-tab,html body #samV3Ledger .samv3-ledger-nav>a,html body #samV3Ledger .samv3-ledger-date,
html body #samV3Ledger .samv3-ledger-summary>span,html body #samV3Ledger .samv3-ledger-name,html body #samV3Ledger .samv3-ledger-code,
html body #samV3Ledger .samv3-ledger-current>span,html body #samV3Ledger .samv3-ledger-metric>span,html body #samV3Ledger .samv3-ledger-metric>strong,
html body #samV3Ledger .samv3-ledger-flow,
html body #samV3Inventory .samv3-inv-tab,html body #samV3Inventory .samv3-inv-summary>span,html body #samV3Inventory .samv3-inv-thumb,
html body #samV3Inventory .samv3-inv-name,html body #samV3Inventory .samv3-inv-meta,html body #samV3Inventory .samv3-inv-type,
html body #samV3Inventory .samv3-inv-stock>span{font-size:12px!important;line-height:1.35!important}
/* 2.7.6: Tồn kho (máy tính) — ảnh nhỏ cạnh tên mặt hàng, giống bản điện thoại */
html body .main .sx-inv-cell{display:flex;align-items:center;gap:8px;min-width:0}
html body .main .sx-inv-th{flex:0 0 32px;width:32px;height:32px;border-radius:8px;background:#F3ECE6;color:#7A6556;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;letter-spacing:.2px;overflow:hidden}
html body .main .sx-inv-th img{width:100%;height:100%;object-fit:cover;display:block}
html body .main .sx-inv-nm{min-width:0;overflow-wrap:anywhere}
/* 2.7.7: Nhận hàng — khối "Điều chuyển chờ nhận" */
html body .main .sx-dcw{display:flex!important;flex-direction:column;gap:0!important;padding:0!important;margin:0 0 14px!important;overflow:hidden}
html body .main .sx-dcw-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;background:#F3ECE6;border-bottom:1px solid #DDD0C5;color:#2B1D14;font-size:14px}
html body .main .sx-dcw-head span{color:#7A6556;font-size:13px;font-weight:600}
html body .main .sx-dcw-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-top:1px solid #EFE6DE}
html body .main .sx-dcw-item:first-of-type{border-top:0}
html body .main .sx-dcw-main{display:flex;flex-direction:column;gap:2px;min-width:0}
html body .main .sx-dcw-main b{font-size:14px;color:#2B1D14}
html body .main .sx-dcw-main span{font-size:13px;color:#7A6556}
html body .main .sx-dcw-open{flex:0 0 auto;white-space:nowrap}
@media (max-width:800px){html body .main .sx-dcw-item{flex-wrap:wrap}html body .main .sx-dcw-open{width:100%;justify-content:center;text-align:center}}
/* 2.7.8 + 2.7.9: tab Giá & NCC của SẢN PHẨM và NVL dùng chung 1 bố cục.
   Khối "Nhập hàng gần nhất": 4 cột cố định (cột NCC rộng gấp đôi), cách nhau 24px, chữ xuống dòng trong cột (trước: NVL tên NCC dài
   đè sang Ngày nhận; SP màn hẹp "Giá nhập" rớt hàng 2). Tên NCC dài: tối đa 2 dòng. Khối "Nhà cung cấp": ô NCC được gán rộng hết khối. */
@layer samds{
  html body .main :is(.sam-nvl-panel[data-nvl-panel=price],.sam-pd2 [data-pd2-content=price]) .sam-nvl-layout>.sam-nvl-section:last-child{grid-column:1/-1}
  html body .main :is(.sam-nvl-panel[data-nvl-panel=price],.sam-pd2 [data-pd2-content=price]) .sam-nvl-layout>.sam-nvl-section:last-child .sam-nvl-fields{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)!important;gap:11px 24px!important}
  html body .main :is(.sam-nvl-panel[data-nvl-panel=price],.sam-pd2 [data-pd2-content=price]) .sam-nvl-layout>.sam-nvl-section:nth-child(2) .sam-nvl-field:first-child{grid-column:1/-1}
  html body .main :is(.sam-nvl-panel[data-nvl-panel=price],.sam-pd2 [data-pd2-content=price]) .sam-nvl-field>strong{white-space:normal!important;overflow-wrap:anywhere;min-width:0}
  html body .main :is(.sam-nvl-panel[data-nvl-panel=price],.sam-pd2 [data-pd2-content=price]) :is(.sam-nvl-layout>.sam-nvl-section:last-child .sam-nvl-field:nth-child(2),.sam-nvl-layout>.sam-nvl-section:nth-child(2) .sam-nvl-field:first-child)>strong{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  @media (max-width:800px){html body .main :is(.sam-nvl-panel[data-nvl-panel=price],.sam-pd2 [data-pd2-content=price]) .sam-nvl-layout>.sam-nvl-section:last-child .sam-nvl-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
}
/* 2.7.9: điện thoại chi tiết SP/NVL — nút Ngưng bán / Mở bán cùng cỡ nút Sửa (trước bị gắn kiểu chip lọc: cao 36px, bo tròn) */
@layer samds{
  html body .main .sam-md-bottom-actions form{display:flex;min-width:0}
  html body .main .sam-md-bottom-actions form>button.sam-md-btn{flex:1 1 auto;width:100%!important;height:48px!important;min-height:48px!important;border-radius:12px!important;font-size:15px!important;font-weight:700!important;padding:10px 12px!important;background:#F3ECE6!important;border:1px solid #DDD0C5!important;color:#2B1D14!important;justify-content:center}
}
/* 2.7.9: Bán hàng ĐIỆN THOẠI — thanh Bill giống bản máy tính (1 thẻ "Bill 1 ×" viền nâu, ô "+", "Đơn treo" nền be).
   Trước: "Bill 1" và "×" thành 2 ô rời; nút không đặt màu chữ nên iPhone (Safari) tô chữ XANH mặc định. */
@media (max-width:899px){
  html body .samv3-pos .sam-multibill-822g{display:flex!important;flex-wrap:wrap;align-items:center!important;gap:8px!important;margin:0 0 12px!important}
  html body .samv3-pos .sam-multibill-822g button{-webkit-appearance:none;appearance:none;font-family:inherit;-webkit-tap-highlight-color:transparent;box-shadow:none!important}
  html body .samv3-pos .sam-multibill-822g button:focus{outline:none!important;box-shadow:none!important}
  html body .samv3-pos .sam-bill-tab-822g{display:inline-flex!important;align-items:center;gap:0;height:40px!important;border:1px solid #e3d6cb!important;border-radius:10px!important;background:#fff!important;padding:0 2px 0 12px!important;margin:0!important}
  html body .samv3-pos .sam-bill-tab-822g.active{border-color:#3b2417!important;border-width:1.5px!important}
  html body .samv3-pos .sam-bill-tab-822g button{border:0!important;background:transparent!important;color:#2b1d14!important;font-size:15px!important;font-weight:700!important;height:38px!important;min-height:0!important;min-width:0!important;width:auto!important;padding:0 6px!important;margin:0!important;border-radius:8px!important}
  html body .samv3-pos .sam-bill-tab-822g button.sam-bill-close-822g{color:#7a6556!important;font-size:17px!important;padding:0 10px!important}
  html body .samv3-pos .sam-bill-plus-822g{width:40px!important;height:40px!important;min-height:0!important;padding:0!important;border:1px solid #e3d6cb!important;border-radius:10px!important;background:#fff!important;color:#49301f!important;font-size:20px!important;font-weight:600!important}
  html body .samv3-pos .sam-bill-held-822g{height:40px!important;min-height:0!important;padding:0 14px!important;border:1px solid #e3d6cb!important;border-radius:10px!important;background:#efe6dd!important;color:#49301f!important;font-size:14px!important;font-weight:600!important}
}
/* 2.7.10: Chi tiết điều chuyển — form nhận hàng lên đầu, thẻ "Hủy phiếu điều chuyển" riêng ở cuối, lý do nằm dưới ô số (trong @layer để thắng luật cũ) */
@layer samds{
html body .main .sam-transfer-redesign .sx-dc-hide{display:none!important}
html body .main .sam-transfer-redesign input.sx-dc-reason{display:block;width:100%!important;min-width:0!important;height:36px!important;margin-top:6px!important;font-size:13px!important;text-align:left!important}
html body .main .sam-transfer-redesign input.sx-dc-reason[hidden]{display:none!important}
html body .main .sam-transfer-redesign .sx-dc-cancel{display:flex!important;flex-direction:column;gap:10px;padding:14px 16px!important;margin:0!important}
html body .main .sam-transfer-redesign .sx-dc-cancel-h{display:flex;flex-direction:column;gap:2px}
html body .main .sam-transfer-redesign .sx-dc-cancel-h b{font-size:14px;color:#2b1d14}
html body .main .sam-transfer-redesign .sx-dc-cancel-h span{font-size:13px;color:#7a6556}
html body .main .sam-transfer-redesign form.sx-dc-cancel-f{display:flex!important;flex-wrap:wrap;align-items:center;gap:10px!important;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
html body .main .sam-transfer-redesign form.sx-dc-cancel-f input:not([type=hidden]){flex:1 1 240px;min-width:0;width:auto!important;margin:0!important}
html body .main .sam-transfer-redesign form.sx-dc-cancel-f button{flex:0 0 auto;margin:0!important}
@media (max-width:800px){html body .main .sam-transfer-redesign form.sx-dc-cancel-f button{flex:1 1 100%}}
}
/* SAM 2.8.0: đơn giá phiếu nhập — dòng "Lần trước" dưới ô giá + thẻ Đơn giá trên chi tiết phiếu */
@layer samds{
html body .purchase-multi-row>.sx-lp{grid-column:1/-1;flex:1 1 100%;order:99;width:100%}
html body .sx-lp{font-size:12px;line-height:1.35;color:#7A6A5E;margin:2px 0 0;text-align:right}
html body .sx-lp[hidden]{display:none!important}
html body .sx-lp--chg{color:#B45309;font-weight:600}
html body .main .card.sx-pp{margin:14px 0;padding:14px 16px}
html body .sx-pp-h{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin-bottom:8px}
html body .sx-pp-h b{font-size:15px}
html body .sx-pp-h span{font-size:13px;color:#7A6A5E}
html body form.sx-pp-row{display:grid;grid-template-columns:minmax(0,2fr) minmax(130px,1fr) minmax(0,2fr) auto;gap:8px 12px;align-items:end;padding:12px 0;border-top:1px solid #EFE6DE;margin:0}
html body form.sx-pp-row .sx-pp-f{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0}
html body form.sx-pp-row .sx-pp-f>span{font-size:12px;font-weight:600;color:#7A6A5E}
html body form.sx-pp-row input{margin:0!important;width:100%!important;min-width:0;box-sizing:border-box}
html body form.sx-pp-row input[name=purchase_price]{text-align:right}
html body form.sx-pp-row input[name=purchase_price]::placeholder{text-align:left}
html body form.sx-pp-row .sx-pp-item{align-self:center}
html body .sx-pp-ok{background:#E8F5EE;color:#1F7A4D;border:1px solid #BFE3CF;border-radius:10px;padding:10px 12px;font-size:14px;font-weight:600;margin:0 0 12px}
html body .sx-pp-item{display:flex;flex-direction:column;gap:2px;min-width:0}
html body .sx-pp-item b{font-size:14px;overflow-wrap:anywhere}
html body .sx-pp-item span{font-size:12px;color:#7A6A5E}
html body .sx-pp-item em{color:#B42318;font-style:normal;font-weight:600}
html body .sx-pp-hist{margin-top:6px;border-top:1px solid #EFE6DE;padding-top:8px}
html body .sx-pp-sub{font-size:12px;font-weight:600;color:#7A6A5E;margin-bottom:4px}
html body .sx-pp-hrow{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px dashed #EFE6DE}
html body .sx-pp-hrow:last-child{border-bottom:0}
html body .sx-pp-hrow>div:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
html body .sx-pp-hrow span{font-size:12px;color:#7A6A5E;overflow-wrap:anywhere}
html body .sx-pp-chg{white-space:nowrap;font-size:13px;text-align:right}
html body .sx-pp-chg i{display:block;font-style:normal;font-size:12px}
html body .sx-pp-chg i.up{color:#B42318}html body .sx-pp-chg i.down{color:#1F7A4D}
@media (max-width:800px){
  html body form.sx-pp-row{grid-template-columns:minmax(0,1fr);gap:10px}
  html body form.sx-pp-row button{width:100%}
  html body .sx-pp-hrow{flex-direction:column;gap:4px}
  html body .sx-pp-chg{text-align:left}
}
}
/* SAM 2.8.0: Quản trị › Kết nối API */
@layer samds{
html body .main a.card.sx-api-link{display:flex;align-items:center;gap:4px 14px;flex-wrap:wrap;text-decoration:none;color:inherit;margin:0 0 14px;padding:14px 16px}
html body a.sx-api-link b{font-size:15px}
html body a.sx-api-link span{flex:1 1 260px;font-size:13px;color:#7A6A5E}
html body a.sx-api-link i{font-style:normal;font-size:20px;color:#7A6A5E}
html body .sx-api .card{margin:0 0 14px;padding:14px 16px}
html body .sx-api .card>b{font-size:15px}
html body .sx-api-p{font-size:13px;color:#7A6A5E;margin:6px 0 10px}
html body .sx-api code{font-size:12px;background:#F3ECE6;border-radius:6px;padding:1px 5px;overflow-wrap:anywhere}
html body form.sx-api-cr{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 12px}
html body form.sx-api-cr input{flex:1 1 260px;margin:0!important;width:auto!important}
html body .sx-api-key{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #EFE6DE}
html body .sx-api-key>div{display:flex;flex-direction:column;gap:2px;min-width:0}
html body .sx-api-key span{font-size:12px;color:#7A6A5E;overflow-wrap:anywhere}
html body .sx-api-key.off b{color:#A8A29E;text-decoration:line-through}
html body .sx-api-off{font-size:12px;color:#A8A29E;white-space:nowrap}
html body form.sx-api-rv{margin:0}
html body .sx-api-new{border:2px solid #1F7A4D!important;background:#F0FAF4!important}
html body .sx-api-new p{font-size:13px;margin:6px 0 10px}
html body .sx-api-copy{display:flex;gap:10px;flex-wrap:wrap}
html body .sx-api-copy input{flex:1 1 280px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px!important;margin:0!important;width:auto!important}
html body .sx-api-pre{background:#2B1D14;color:#F3ECE6;border-radius:10px;padding:10px 12px;font-size:12px;overflow-x:auto;white-space:pre;margin:0 0 10px}
html body .sx-api-ep{display:flex;flex-direction:column;gap:3px;padding:8px 0;border-top:1px dashed #EFE6DE}
html body .sx-api-ep span{font-size:13px;color:#5C4A3F}
@media (max-width:800px){html body .sx-api-key{flex-direction:column;align-items:stretch}html body .sx-api-key .btn{width:100%}}
}
/* SAM 2.8.0: Phiếu nhập hàng điện thoại — tên NCC dài (Suntory Pepsico…) làm thẻ rộng quá màn hình, mất nút PDF */
@layer samds{
html body .sam-purchase-list-mobile-v1{grid-template-columns:minmax(0,1fr)!important}
html body .sam-purchase-list-card-v1{min-width:0!important;max-width:100%!important;box-sizing:border-box}
html body .sam-purchase-list-supplier-v1{white-space:normal!important;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
}

/* SAM 2.8.2: khung xem phiếu hủy / sơ chế (Cần xử lý, thông báo) cùng kiểu trang Hủy hàng */
@layer samds{
html body #sam-doc-pop{position:fixed;inset:0;z-index:100000;background:rgba(24,15,11,.72);display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}
html body #sam-doc-pop .sx-dp{background:#fff;border-radius:20px;width:100%;max-width:520px;max-height:90vh;overflow:auto;padding:18px;box-sizing:border-box;box-shadow:0 14px 40px rgba(0,0,0,.3)}
html body #sam-doc-pop .sx-dp-h{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
html body #sam-doc-pop .sx-dp-h strong{display:block;font-size:18px;line-height:1.3;color:#2B1D14}
html body #sam-doc-pop .sx-dp-h small{display:block;font-size:13px;color:#7A6A5E;margin-top:2px}
html body #sam-doc-pop .sx-dp-h button.x{flex:0 0 auto;width:40px!important;height:40px!important;min-height:40px!important;min-width:40px!important;border-radius:10px!important;border:1px solid #F3C2BC!important;background:#FDECEA!important;color:#B42318!important;font-size:20px!important;line-height:1;padding:0!important;cursor:pointer;display:flex;align-items:center;justify-content:center}
html body #sam-doc-pop .sx-dp-g{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
html body #sam-doc-pop .sx-dp-c{border:1px solid #EADFD6;border-radius:12px;padding:10px 12px;min-width:0;display:flex;flex-direction:column;gap:4px}
html body #sam-doc-pop .sx-dp-c.w{grid-column:1/-1}
html body #sam-doc-pop .sx-dp-c span{font-size:13px;color:#7A6A5E}
html body #sam-doc-pop .sx-dp-c b{font-size:15px;font-weight:700;color:#2B1D14;overflow-wrap:anywhere}
html body #sam-doc-pop .sx-dp-c.w b{font-weight:500}
html body #sam-doc-pop .sx-dp-img{margin-top:10px}
html body #sam-doc-pop .sx-dp-img img{display:block;width:100%;max-height:60vh;object-fit:contain;background:#F5F1ED;border-radius:10px;margin:4px 0 0}
html body #sam-doc-pop .sx-dp-img em{font-style:normal;font-size:14px;color:#7A6A5E}
}
/* SAM 2.8.2: menu điện thoại — người đang đăng nhập (tên dài xuống dòng, không mất chữ) */
@layer samds{
html body .sam-mob-user-v282{display:flex;align-items:center;gap:12px;margin:12px 14px 0;padding:12px 14px;border:1px solid #EADFD6;border-radius:16px;background:#fff}
html body .sam-mob-user-v282 .av{flex:0 0 40px;width:40px;height:40px;border-radius:50%;background:#3B2417;color:#fff;font-weight:700;font-size:17px;display:flex;align-items:center;justify-content:center}
html body .sam-mob-user-v282>div{min-width:0;display:flex;flex-direction:column;gap:2px}
html body .sam-mob-user-v282 b{font-size:16px;line-height:1.3;color:#2B1D14;overflow-wrap:anywhere}
html body .sam-mob-user-v282 span{font-size:13px;color:#7A6A5E;overflow-wrap:anywhere}
}
/* SAM 2.8.2: Nhận hàng điện thoại — ô Nhận / Hủy / Khác bị bóp còn 23px (khung −/+ ẩn nút nhưng vẫn chia 3 cột) */
@layer samds{
html body .sam-rx-v27-controls .sam-rx-v27-field .qtybox{display:block!important;width:100%!important}
html body .sam-rx-v27-controls .sam-rx-v27-field .qtybox>button{display:none!important}
html body .sam-rx-v27-controls .sam-rx-v27-field .qtybox>input{display:block!important;width:100%!important;min-width:0!important;box-sizing:border-box}
html body .sam-rx-v27-controls .sam-rx-v27-shortage-value{display:flex!important;align-items:center;justify-content:flex-end;box-sizing:border-box;padding:0 12px!important;font-size:16px!important;font-weight:700}
html body .sam-rx-v282-ro{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 12px}
html body .sam-rx-v282-note{font-size:13px;color:#7A6A5E}
}
/* SAM 2.8.2: Lịch sử nhận hàng điện thoại (chị báo 03/12 ảnh 6, 7) */
@layer samds{
@media (max-width:800px){
  /* 4 bộ lọc chia đều 2 × 2, hết chữ bị cắt; bỏ nút kính lúp (đã có ô tìm ngay dưới) */
  html body .sam-rh-v6-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  html body .sam-rh-v6-grid .sam-rh-v6-search{display:none!important}
  html body .sam-rh-v6-grid .sam-rh-v6-control{min-width:0!important;width:100%!important;height:auto!important;min-height:44px!important;padding:6px 10px!important;gap:6px!important;justify-content:flex-start!important}
  html body .sam-rh-v6-grid .sam-rh-v6-control>span{flex:1 1 auto;min-width:0;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;text-align:left;font-size:14px!important;line-height:1.25!important}
  html body .sam-rh-v6-grid .sam-rh-v6-control>svg{flex:0 0 auto}
  html body .sam-rh-v6-grid .sam-rh-v6-control>svg:first-child{display:none!important}
  html body .sam-rh-v6-grid .sam-rh-v6-control{margin:0!important;padding:6px 10px 6px 14px!important;grid-column:auto!important;grid-row:auto!important}
  /* thẻ phiếu: tên NCC không ép chữ hoa; người nhận / nguồn / giờ xuống dòng, không mất chữ */
  html body .sam-rh-v5-supplier{text-transform:none!important;white-space:normal!important;overflow-wrap:anywhere}
  html body .sam-rh-v5-meta{display:grid!important;grid-template-columns:auto minmax(0,1fr) minmax(0,1fr)!important}
  html body .sam-rh-v5-meta>span{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;min-width:0}
  /* khung chọn khoảng ngày: 2 ô vừa màn hình (Safari iPhone tràn phải), chữ thường */
  html body .sam-rh-v62-dategrid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  html body .sam-rh-v62-datefield{min-width:0!important;display:block}
  html body .sam-rh-v62-datefield span{text-transform:none!important;font-size:13px!important;font-weight:600!important}
  html body .sam-rh-v62-datefield input{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;-webkit-appearance:none;appearance:none;text-align:center}
  html body .sam-rh-v62-sheet-actions button{text-transform:none!important}
  html body .sam-rh-v62-panel{box-sizing:border-box;max-width:100vw;overflow:hidden}
}
}
/* SAM 2.8.2: nhân viên — trang Điều chuyển (chỉ xem) */
@layer samds{
html body .sx-dcs{max-width:760px}
html body .sx-dcs-note{font-size:13px;color:#7A6A5E;margin:0 0 12px}
html body .sx-dcs-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
html body a.sx-dcs-chip{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:999px;border:1px solid #DDD0C5;background:#fff;color:#2B1D14;font-size:14px;font-weight:600;text-decoration:none}
html body a.sx-dcs-chip b{font-size:12px;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#F3ECE6;display:inline-flex;align-items:center;justify-content:center}
html body a.sx-dcs-chip.on{background:#3B2417!important;border-color:#3B2417!important;color:#fff!important}
html body a.sx-dcs-chip.on b{background:rgba(255,255,255,.2)!important;color:#fff!important}
html body a.sx-dcs-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center;padding:14px 16px;margin:0 0 10px;border:1px solid #EADFD6;border-radius:14px;background:#fff;color:inherit;text-decoration:none}
html body .sx-dcs-top{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:10px}
html body .sx-dcs-top b{font-size:16px;color:#2B1D14}
html body .sx-dcs-st{font-size:12px!important;font-weight:700;padding:4px 10px!important;border:0!important;line-height:1.3!important;min-height:0!important;border-radius:999px!important;white-space:nowrap}
html body .sx-dcs-st.ok{background:#E8F5EE;color:#1F7A4D}html body .sx-dcs-st.warn{background:#FEF3E2;color:#B45309}
html body .sx-dcs-st.info{background:#EAF1FD;color:#2563EB}html body .sx-dcs-st.bad{background:#FDECEA;color:#B42318}
html body .sx-dcs-route{font-size:14px;color:#2B1D14;min-width:0;overflow-wrap:anywhere}
html body .sx-dcs-route em{font-style:normal;font-weight:700}
html body .sx-dcs-meta{font-size:13px;color:#7A6A5E}
html body .sx-dcs-go{grid-column:2;grid-row:2/4;font-size:13px;font-weight:700;color:#3B2417;white-space:nowrap}
html body .sx-dcs-go.recv{background:#3B2417;color:#fff;border-radius:10px;padding:10px 12px}
@media (max-width:800px){html body a.sx-dcs-item{grid-template-columns:minmax(0,1fr)}html body .sx-dcs-go{grid-column:1/-1;grid-row:auto;text-align:center;margin-top:6px}html body .sx-dcs-go:not(.recv){border:1px solid #DDD0C5;border-radius:10px;padding:9px 12px;background:#F3ECE6}}
}
/* SAM 2.8.3: chỉnh tiếp theo góp ý 03/12 22:03 */
@layer samds{
/* NV Điều chuyển: 4 ô trạng thái chia đều, chữ trên số dưới (như chip các trang danh sách) */
html body .sx-dcs-chips{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important}
html body a.sx-dcs-chip{flex-direction:column!important;justify-content:center!important;gap:2px!important;height:auto!important;min-height:56px!important;padding:6px 4px!important;border-radius:12px!important;text-align:center;font-size:13px!important;line-height:1.2}
html body a.sx-dcs-chip b{background:none!important;font-size:17px!important;height:auto!important;min-width:0!important;padding:0!important;color:#2B1D14}
html body .sx-dcs-chips a.sx-dcs-chip.on b,html body .sx-dcs-chips a.sx-dcs-chip b{background:none!important}
html body a.sx-dcs-chip.on b{color:#fff!important}
/* Nhận hàng điện thoại: 4 ô cùng cao, số giữa ô; Theo dõi HSD — 2 nút bằng nhau */
html body .sam-rx-v27-card .sam-rx-v27-controls{align-items:start!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important}
html body .sam-rx-v27-card .sam-rx-v27-controls .sam-rx-v27-field .qtybox{height:auto!important;overflow:visible!important}
html body .sam-rx-v27-card .sam-rx-v27-controls>.sam-rx-v27-field{width:auto!important;min-width:0!important;max-width:none!important}
html body .sam-rx-v27-meta .sam-rx-v27-hsd-badge{margin-left:6px}
html body .sam-rx-v27-card .sam-rx-v27-controls .sam-rx-v27-shortage-value{background:#F5F1ED!important;border:1px solid #DDD0C5!important;box-sizing:border-box!important;width:100%!important}
html body .sam-rx-v27-card .sam-rx-v27-controls .sam-rx-v27-field .qtybox>input[type=number],
html body .sam-rx-v27-card .sam-rx-v27-controls .sam-rx-v27-shortage-value{height:44px!important;min-height:44px!important;text-align:center!important;justify-content:center!important;font-size:16px!important;font-weight:700!important;padding:0 4px!important;border-radius:10px!important}
html body .sam-rx-v279-hsd:not(.sam-rx-v282-ro){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;align-items:center}
html body .sam-rx-v279-hsd:not(.sam-rx-v282-ro) .sam-rx-v279-choices{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%}
html body .sam-rx-v279-choices>.sam-rx-v279-choice{width:100%!important;height:44px!important;min-height:44px!important;margin:0!important;border-radius:10px!important;border:1px solid #DDD0C5!important;background:#fff!important;color:#2B1D14!important;font-size:15px!important;font-weight:600!important;display:flex!important;align-items:center;justify-content:center;gap:6px}
html body .sam-rx-v279-choices>.sam-rx-v279-choice.is-active{background:#3B2417!important;border-color:#3B2417!important;color:#fff!important}
html body .sam-rx-v279-title{font-size:13px!important;font-weight:700!important;color:#2B1D14}
}

/* SAM 2.8.4 — Hàng ký gửi (/consignment): NCC ký gửi + Bảng kê thanh toán */
@layer samds{
html body .sx-kg{display:flex;flex-direction:column;gap:14px;min-width:0}
html body .sx-kg .card.sx-kg-card{padding:16px!important;min-width:0}
html body .sx-kg-muted{color:#7A6A5E;font-size:13px;margin:6px 0 10px}
html body .sx-kg-filter{display:grid;grid-template-columns:160px minmax(0,1fr) 180px auto;gap:10px;align-items:end;background:#fff;border:1px solid #E8DDD3;border-radius:14px;padding:14px}
html body .sx-kg-filter label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:#5B4A3E;min-width:0}
html body .sx-kg-filter input,html body .sx-kg-filter select{width:100%;min-width:0;height:44px}
html body .sx-kg-filter .btn{height:44px}
html body .sx-kg-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
html body .sx-kg-head>div{display:flex;flex-direction:column;gap:4px;min-width:0}
html body .sx-kg-head span{color:#7A6A5E;font-size:13px;overflow-wrap:anywhere}
html body .sx-kg-head .btn{flex:0 0 auto}
html body .sx-kg-sum{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}
html body .sx-kg-sum>div{background:#F7F2EE;border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px;min-width:0}
html body .sx-kg-sum span{font-size:12px;color:#7A6A5E}
html body .sx-kg-sum b{font-size:20px;color:#2B1D14;overflow-wrap:anywhere}
html body .sx-kg-wrap{overflow-x:auto}
html body .sx-kg-table{width:100%;border-collapse:collapse;font-size:14px}
html body .sx-kg-table th{text-align:right;font-size:12px;color:#7A6A5E;font-weight:700;padding:8px;border-bottom:1px solid #E8DDD3;white-space:nowrap}
html body .sx-kg-table th:first-child{text-align:left}
html body .sx-kg-table td{text-align:right;padding:9px 8px;border-bottom:1px solid #F0E8E1;white-space:nowrap;font-variant-numeric:tabular-nums}
html body .sx-kg-table td.sx-kg-item{text-align:left;white-space:normal;min-width:180px}
html body .sx-kg-item b{display:block;overflow-wrap:anywhere}
html body .sx-kg-item span{display:block;font-size:12px;color:#7A6A5E}
html body .sx-kg-table .sx-kg-sold{font-weight:700}
html body .sx-kg-table .sx-kg-amt{font-weight:700;color:#2B1D14}
html body .sx-kg-table tfoot td{font-weight:700;border-bottom:0;text-align:left}
html body .sx-kg-table tfoot td.sx-kg-amt{text-align:right}
html body .sx-kg-note{font-size:12px;color:#7A6A5E;margin:10px 0 0}
html body .sx-kg-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
html body form.sx-kg-chip{display:inline-flex;align-items:center;gap:6px;background:#F3ECE6;border-radius:999px;padding:4px 4px 4px 12px;max-width:100%;margin:0}
html body form.sx-kg-chip span{font-size:13px;font-weight:600;overflow-wrap:anywhere}
html body form.sx-kg-chip button{width:28px;height:28px;min-height:28px;border-radius:50%;border:0;background:#fff;color:#5B4A3E;font-size:16px;line-height:1;padding:0;flex:0 0 auto}
html body .sx-kg-add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;margin:0}
html body .sx-kg-add select{min-width:0;height:44px}
html body .sx-kg-add .btn{height:44px}
@media(max-width:760px){
html body .sx-kg-filter{grid-template-columns:repeat(2,minmax(0,1fr))}
html body .sx-kg-filter label:nth-of-type(2){grid-column:1/-1}
html body .sx-kg-filter .btn{grid-column:1/-1}
html body .sx-kg-head{flex-direction:column;align-items:stretch}
html body .sx-kg-head .btn{width:100%}
html body .sx-kg-add{grid-template-columns:1fr}
html body .sx-kg-wrap{overflow:visible}
html body .sx-kg-table thead{display:none}
html body .sx-kg-table,html body .sx-kg-table tbody,html body .sx-kg-table tr{display:block;width:100%}
html body .sx-kg-table tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px;border:1px solid #E8DDD3;border-radius:12px;padding:10px 12px;margin-bottom:10px}
html body .sx-kg-table tbody td{border:0;padding:0;text-align:left;white-space:normal;display:flex;flex-direction:column;font-size:15px;min-width:0}
html body .sx-kg-table tbody td::before{content:attr(data-l);font-size:11px;color:#7A6A5E;font-weight:600}
html body .sx-kg-table tbody td.sx-kg-item{grid-column:1/-1;min-width:0;padding-bottom:4px;border-bottom:1px dashed #E8DDD3}
html body .sx-kg-table tbody td.sx-kg-item::before{content:none}
html body .sx-kg-table tbody td[colspan]{grid-column:1/-1}
html body .sx-kg-table tbody td[colspan]::before{content:none}
html body .sx-kg-table tbody td{border:0!important;padding:0!important;background:none!important}
html body .sx-kg-table tbody td.sx-kg-amt{grid-column:1/-1;flex-direction:row!important;justify-content:space-between;align-items:center;border-top:1px dashed #E8DDD3!important;padding-top:8px!important;margin-top:2px}
html body .sx-kg-filter input,html body .sx-kg-filter select{width:100%!important;max-width:none!important}
html body .sx-kg-filter label{grid-column:1/-1}
html body .sx-kg-table tfoot{display:block}
html body .sx-kg-table tfoot tr{display:flex;justify-content:space-between;padding:8px 4px}
html body .sx-kg-table tfoot td[colspan]{display:none}
}
}

/* SAM 2.8.6 — Hàng ký gửi: Mặt hàng & giá ký gửi */
@layer samds{
html body .sx-kg-warn{color:#B45309;font-weight:700;font-size:12px}
html body .sx-kg-plist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px}
html body .sx-kg-prow{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #F0E8E1;min-width:0}
html body .sx-kg-pname{display:flex;flex-direction:column;gap:2px;min-width:0}
html body .sx-kg-pname b{overflow-wrap:anywhere;font-size:14px}
html body .sx-kg-pname span{font-size:12px;color:#7A6A5E}
html body .sx-kg-pin{display:flex;flex-direction:column;gap:4px;margin:0;min-width:0}
html body .sx-kg-pin span{font-size:11px;color:#7A6A5E;text-align:right;font-weight:600}
html body .sx-kg-pin input{width:100%;height:40px;text-align:right;min-width:0}
html body .sx-kg-pact{display:flex;justify-content:flex-end;margin-top:12px}
@media(max-width:760px){
html body .sx-kg-plist{grid-template-columns:1fr}
html body .sx-kg-prow{grid-template-columns:minmax(0,1fr) 130px}
html body .sx-kg-pin input{height:44px;font-size:16px}
html body .sx-kg-pact .btn{width:100%;height:44px}
}
}

/* SAM 2.8.8 — Kho VP › Chuyển hàng về quầy (tạo + sửa phiếu): dòng mặt hàng cân, ✕ 40×40, điện thoại thẻ gọn */
@layer samds{
html body .owt-page :is(#owt-lines,#owte-lines) td{vertical-align:middle}
html body .owt-page :is(#owt-lines,#owte-lines) td:last-child .btn{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center;font-size:20px!important;line-height:1!important;border-radius:10px!important;background:#FDECEA!important;color:#B42318!important;border:1px solid #F4C7C3!important}
html body .owt-page :is(#owt-lines,#owte-lines) input[type=number]{text-align:right;height:40px;width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box}
html body .owt-page :is(#owt-lines,#owte-lines) select{height:40px;width:100%;min-width:0;box-sizing:border-box}
html body .owt-page :is(#owt-lines,#owte-lines) .qtybox{display:block!important;width:100%!important;height:auto!important;min-height:0!important;overflow:visible!important;border:0!important;padding:0!important;background:none!important;box-shadow:none!important}
html body .owt-page :is(#owt-lines,#owte-lines) .qtybox>button{display:none!important}
@media(min-width:761px){
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)){table-layout:fixed;width:100%}
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)) th:nth-child(2),html body .owt-page :is(#owt-lines,#owte-lines) td:nth-child(2){width:120px;text-align:right}
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)) th:nth-child(3),html body .owt-page :is(#owt-lines,#owte-lines) td:nth-child(3){width:90px}
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)) th:nth-child(4),html body .owt-page :is(#owt-lines,#owte-lines) td:nth-child(4){width:150px;text-align:right}
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)) th:nth-child(5),html body .owt-page :is(#owt-lines,#owte-lines) td:nth-child(5){width:56px;text-align:center}
}
@media(max-width:760px){
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)){border:0!important;background:none!important}
html body .owt-page :is(#owt-lines,#owte-lines){display:flex!important;flex-direction:column;gap:10px}
html body .owt-page :is(#owt-lines,#owte-lines)>tr{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,.8fr) minmax(0,1.3fr) 40px;gap:10px;align-items:start;border:1px solid #E8DDD3!important;border-radius:12px!important;padding:12px!important;background:#fff!important;margin:0 0 10px!important;overflow:visible!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td{display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:6px;overflow:visible!important;height:auto!important;padding:0!important;border:0!important;min-width:0;text-align:left!important;font-size:15px}
html body .owt-page .owt-table-wrap:has(:is(#owt-lines,#owte-lines)){overflow:visible!important}
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines)),html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines))>tbody{display:block!important;width:100%!important;min-width:0!important}
html body .owt-page .owt-table:has(:is(#owt-lines,#owte-lines))>thead{display:none!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:nth-child(1)::before{content:"Mặt hàng"!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:nth-child(2)::before{content:"Tồn Kho VP"!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:nth-child(3)::before{content:"ĐVT"!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:nth-child(4)::before{content:"SL chuyển"!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td::before{display:block!important;position:static!important;width:auto!important;font-size:12px!important;font-weight:600!important;color:#7A6A5E!important;margin:0!important;padding:0!important;text-align:left!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:first-child{grid-column:1/-1}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:is(.owt-stock,.owt-unit){line-height:44px}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:is(.owt-stock,.owt-unit)::before{line-height:1.3}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:last-child{padding-top:22px!important}
html body .owt-page :is(#owt-lines,#owte-lines)>tr>td:last-child::before{content:none!important}
html body .owt-page :is(#owt-lines,#owte-lines) input[type=number],html body .owt-page :is(#owt-lines,#owte-lines) select{height:44px;font-size:16px}
html body .owt-page :is(#owt-lines,#owte-lines) td:last-child .btn{width:40px!important;height:44px!important;min-height:44px!important}
}
}

/* SAM 2.8.8 — màn hình lớn (24 inch+): Tổng quan dùng hết bề ngang như các trang khác (trước khóa 1180px ở giữa) */
@layer samds{
@media(min-width:1280px){
html body .sx-dash{max-width:none!important;margin:0!important}
html body .sx-dash .sxd-main{grid-template-columns:minmax(0,2fr) minmax(360px,1fr)!important}
html body .sx-dash .sxd-bars{height:200px}
}
@media(min-width:1800px){
html body .sx-dash .sxd-hero-v{font-size:40px}
html body .sx-dash .sxd-kpi b{font-size:20px}
}
}
/* Báo cáo, Kho VP: bỏ khóa 1500px trên màn hình lớn */
@layer samds{@media(min-width:1280px){html body[data-sam-report-v2="1"] .content,html body .ow-page{max-width:none!important;margin-left:0!important;margin-right:0!important}}}
/* Sản phẩm › Quản lý danh mục: dòng hướng dẫn */
@layer samds{
html body #category-manager .sx-cat-help{display:flex;flex-direction:column;gap:4px;background:#F7F2EE;border-radius:10px;padding:10px 12px;margin-top:4px}
html body #category-manager .sx-cat-help b{font-size:14px}
html body #category-manager .sx-cat-help span{font-size:13px;color:#5B4A3E;line-height:1.5}
html body #category-manager .sx-cat-ok{margin:0 0 8px}
}
@layer samds{
html body #category-manager .cat-manager-edit button,html body #category-manager .cat-manager-delete button{height:36px!important;min-height:36px!important;padding:0 12px!important;font-size:13px!important;border-radius:10px!important;width:100%!important}
html body #category-manager .cat-manager-edit button{background:#F3ECE6!important;border:1px solid #DDD0C5!important;color:#2B1D14!important}
html body #category-manager .cat-manager-delete button{background:#fff!important;border:1px solid #F4C7C3!important;color:#B42318!important}
}
@layer samds{@media(max-width:760px){
html body #category-manager .category-add-grid{grid-template-columns:1fr!important}
html body #category-manager .category-add-grid .btn{width:100%}
html body #category-manager .cat-manager-head{display:none!important}
html body #category-manager .cat-manager-row{grid-template-columns:1fr!important;padding:10px!important;gap:8px!important}
html body #category-manager .cat-manager-edit{grid-template-columns:minmax(0,1fr) 88px!important}
html body #category-manager .cat-manager-edit input[name=name]{grid-column:1/-1}
html body #category-manager .cat-manager-edit select{grid-column:1/2}
html body #category-manager .cat-manager-edit :is(input,select){height:44px!important;font-size:16px!important;width:100%!important}
html body #category-manager .cat-manager-edit button{height:44px!important;min-height:44px!important}
html body #category-manager .cat-manager-delete button{height:40px!important;min-height:40px!important}
}}

/* SAM 2.8.8 — Sổ kho (máy tính): bộ lọc thẳng hàng, nút ‹ › cân 2 bên ô ngày */
@layer samds{@media(min-width:761px){
html body form.sl-filter-card .sl-filter-main{display:grid!important;gap:10px 12px!important;align-items:end!important;
  grid-template-columns:150px 230px 150px minmax(200px,1fr)!important;grid-template-areas:"per date type search" "zero zero act act"!important}
html body form.sl-filter-card .sl-period{grid-area:per!important}
html body form.sl-filter-card .sl-date-nav{grid-area:date!important;min-width:0}
html body form.sl-filter-card .sl-type-filter{grid-area:type!important}
html body form.sl-filter-card .sl-search{grid-area:search!important;min-width:0}
html body form.sl-filter-card .sl-zero{grid-area:zero!important;align-self:center!important;margin:0!important}
html body form.sl-filter-card .sl-actions{grid-area:act!important;display:flex!important;justify-content:flex-end!important;justify-self:stretch!important;width:auto!important;min-width:0!important;max-width:none!important;gap:10px!important;margin:0!important;padding:0!important;position:static!important}
html body form.sl-filter-card .sl-actions .btn{width:auto!important;min-width:140px;height:40px!important;flex:0 0 auto!important}
html body form.sl-filter-card .sl-actions .sl-primary-btn{background:#3B2417!important;border-color:#3B2417!important;color:#fff!important}
html body form.sl-filter-card :is(.sl-field,.sl-date-nav)>label{display:block;margin:0 0 6px!important;font-size:13px!important;font-weight:600!important;line-height:1.2!important}
html body form.sl-filter-card :is(.sl-field select,.sl-field input){height:40px!important;width:100%!important;min-width:0!important}
html body form.sl-filter-card .sl-date-nav-row{display:grid!important;grid-template-columns:40px minmax(0,1fr) 40px!important;gap:6px!important;align-items:center!important}
html body form.sl-filter-card .sl-date-arrow{width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;margin:0!important;display:flex!important;align-items:center!important;justify-content:center!important;
  border:1px solid #DDD0C5!important;border-radius:10px!important;background:#fff!important;color:#3B2417!important;font-size:22px!important;line-height:1!important;font-weight:600!important;text-decoration:none!important;box-sizing:border-box!important}
html body form.sl-filter-card .sl-date-arrow:hover{background:#F3ECE6!important}
html body form.sl-filter-card .sl-date-arrow.sl-disabled{opacity:.35!important;pointer-events:none!important;background:#fff!important}
html body form.sl-filter-card .sl-date-display{height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;border:1px solid #DDD0C5!important;border-radius:10px!important;
  background:#fff!important;font-size:14px!important;font-weight:600!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;padding:0 6px!important;margin:0!important;box-sizing:border-box!important;min-width:0!important}
html body form.sl-filter-card .sl-check{display:inline-flex!important;align-items:center!important;gap:8px!important;white-space:nowrap!important;font-size:13px!important;margin:0!important}
html body form.sl-filter-card .sl-check span{white-space:nowrap!important;font-size:13px!important}
}
@media(min-width:1500px){
html body form.sl-filter-card .sl-filter-main{grid-template-columns:150px 240px 150px minmax(220px,1fr) max-content!important;grid-template-areas:"per date type search act" "zero zero zero zero zero"!important}
}}
