/* FIXED STYLE: product-editor-mobile-layout */

/* Mobile product editor: 2 visual rows, desktop contract remains untouched. */
body[data-resolved-mode="mobile"] .product-editor-header{
  height:auto !important;
  min-height:88px;
  padding:8px 12px 10px !important;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  grid-template-rows:auto auto;
  gap:7px;
  align-items:center;
}
body[data-resolved-mode="mobile"] .product-editor-header-title{
  min-width:0;
  width:100%;
  height:34px;
}
body[data-resolved-mode="mobile"] .product-editor-header-title > div{
  margin-left:6px !important;
}
body[data-resolved-mode="mobile"] .product-editor-header-title .text-white.font-bold{
  font-size:13px !important;
  line-height:16px;
}
body[data-resolved-mode="mobile"] .product-editor-header-actions{
  width:100%;
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px !important;
}
body[data-resolved-mode="mobile"] .product-editor-header-actions > button{
  width:100%;
  min-width:0;
  height:34px !important;
  padding:0 7px !important;
  justify-content:center;
  gap:4px !important;
  font-size:10.5px !important;
  line-height:1;
  white-space:nowrap;
}
body[data-resolved-mode="mobile"] .product-editor-header-actions > button i{
  font-size:12px;
}

body[data-resolved-mode="mobile"] #productEditorTableOwner{
  min-width:0 !important;
  width:100%;
}
body[data-resolved-mode="mobile"] .product-editor-grid,
body[data-resolved-mode="mobile"] .product-editor-row{
  grid-template-columns:minmax(0,1.25fr) minmax(0,.9fr) minmax(0,.9fr) !important;
  grid-template-areas:
    "name name name"
    "source cost sale" !important;
  column-gap:12px !important;
  row-gap:2px;
  justify-content:stretch !important;
  align-items:center;
}
body[data-resolved-mode="mobile"] .product-editor-grid{
  padding:7px 16px 6px !important;
  min-height:48px;
}
body[data-resolved-mode="mobile"] .product-editor-row{
  min-height:76px !important;
  padding:7px 16px 8px !important;
}
body[data-resolved-mode="mobile"] .product-editor-row > :nth-child(n+2){
  padding-top:1px !important;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(1),
body[data-resolved-mode="mobile"] .product-editor-row > :nth-child(1){
  grid-area:name;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(2),
body[data-resolved-mode="mobile"] .product-editor-row > :nth-child(2){
  grid-area:cost;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(3),
body[data-resolved-mode="mobile"] .product-editor-row > :nth-child(3){
  grid-area:sale;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(4),
body[data-resolved-mode="mobile"] .product-editor-row > :nth-child(4){
  grid-area:source;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(n+2){
  padding:0 !important;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(1){
  padding-bottom:2px !important;
  color:#6b7280;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(4){
  text-align:left !important;
}
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(2),
body[data-resolved-mode="mobile"] .product-editor-grid > :nth-child(3){
  text-align:right !important;
}
body[data-resolved-mode="mobile"] .product-editor-input,
body[data-resolved-mode="mobile"] .product-editor-source-btn{
  height:28px !important;
  font-size:12px !important;
}

/* SPEC-TAPHOA-MOBILE-FOCUS-SCALE-20261102
   Given a compact 12px product editor on mobile Safari/PWA, focusing a
   real editable input must not cause the OS to enlarge the page. Only the
   focused input grows to the iOS-safe 16px; idle labels, 28px row geometry,
   product values and single save owner remain unchanged.
   CSS P4 owner: this mobile editor input only; no body-wide font rule. */
body[data-resolved-mode="mobile"] input.product-editor-input:focus{
  font-size:16px !important;
}

/* SPEC-TAPHOA-MOBILE-CUSTOMER-INPUT-FOCUS-20261102:
   The picker auto-focuses its 13px search input, and its new-customer
   form also uses 13px. Keep these two picker inputs at Safari-safe 16px
   on mobile without changing modal geometry, filtering or customer data.
   Debt money fields already have their own owner in fixed-ui-debt-popup.css. */
body[data-resolved-mode="mobile"] #customerSearchInput,
body[data-resolved-mode="mobile"] #newCustomerName{
  font-size:16px !important;
  min-height:44px;
}
body[data-resolved-mode="mobile"] .product-editor-name{
  height:30px !important;
  font-size:13px !important;
  line-height:30px;
  text-align:left !important;
}
body[data-resolved-mode="mobile"] .product-editor-money{
  width:100% !important;
  padding:0 !important;
  text-align:right !important;
}
body[data-resolved-mode="mobile"] .product-editor-source-btn{
  width:100% !important;
  padding:0 !important;
  text-align:left !important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* FIXED STYLE: source-detail-modal-style */

#sourceDetailModalWrapper,
#sourceDetailModalWrapper *{
  -webkit-user-select:none;
  user-select:none;
}
#sourceDetailModalWrapper{
  z-index:99999 !important;
}
#sourceDetailModalCard{
  position:relative;
  background:#fff !important;
  opacity:1 !important;
  overflow:hidden;
}
.source-summary-link{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  max-width:100%;
  border-radius:7px;
  cursor:pointer;
}
.source-summary-link:hover{color:var(--app-primary,#16a34a);text-decoration:underline;text-underline-offset:2px;}
.source-detail-capture,
.source-detail-capture *{
  background-clip:padding-box;
  mix-blend-mode:normal !important;
}
.source-detail-capture{--source-detail-inline:12px;font-variant-numeric:tabular-nums; position:relative; z-index:1; background:#fff !important;}
.source-detail-share-header{padding:14px 14px 10px;border-bottom:1px solid #f1f5f9;background:#fff;}
.source-detail-share-title{font-size:16px;line-height:1.3;font-weight:800;color:#111827;}
.source-detail-share-meta{margin-top:3px;font-size:10px;line-height:1.4;font-weight:600;color:#94a3b8;}
.source-detail-grid{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) 48px;
  column-gap:6px;
  align-items:center;
  width:100%;
}
.source-detail-grid-detail{
  grid-template-columns:24px minmax(0,1.45fr) minmax(78px,.8fr) 42px;
  column-gap:6px;
}
.source-detail-grid-detail.source-detail-data-row{align-items:start;}
.source-detail-grid-detail .source-detail-stt,
.source-detail-grid-detail .source-detail-qty{padding-top:1px;}
.source-detail-product-cell,
.source-detail-buyer-cell{min-width:0;}
.source-detail-buyer-cell .source-detail-buyer{margin-top:0;font-size:10px;line-height:1.35;font-weight:650;color:#64748b;}
.source-detail-note{white-space:normal;overflow-wrap:anywhere;line-height:1.35;}
/* SPEC-SOURCE-SUPPLIER-PICK-SORT-20261108: compact sorting is UI-only,
   never inside the capture surface or in saved-order mutations. */
.source-detail-sort-row{
  display:flex;align-items:center;justify-content:flex-end;gap:8px;
  padding:5px 2px 8px;color:#64748b;font-size:11px;font-weight:650;
}
.source-detail-sort-select{
  flex:0 1 auto;min-width:0;max-width:80%;min-height:36px;
  border:1px solid #e2e8f0;border-radius:9px;
  padding:5px 26px 5px 9px;background:#fff;
  color:#334155;font-size:11px;font-weight:700;
}
.source-detail-group-buyer{
  font-size:11px;font-weight:800;line-height:1.4;color:#0f766e;
  overflow-wrap:anywhere;margin-bottom:2px;
}
.source-detail-group-notes{margin-top:4px;display:flex;flex-direction:column;gap:4px;min-width:0;}
.source-detail-note-context{
  min-width:0;display:flex;align-items:flex-start;flex-wrap:wrap;
  gap:2px 6px;line-height:1.4;
}
.source-detail-note-owner{
  flex:none;font-size:10px;font-weight:750;color:#475569;
  max-width:100%;overflow-wrap:anywhere;
}
.source-detail-note-context .source-detail-note{min-width:0;}

.note-chip-row{
  display:flex;
  align-items:flex-start;
  gap:5px;
  flex-wrap:wrap;
  min-width:0;
  font-size:10px;
  line-height:1.35;
}
.note-chip-bullet{
  flex:none;
  color:#111827;
  font-weight:800;
  line-height:1.55;
}
.note-chip{
  display:inline-block;
  max-width:100%;
  padding:1px 4px;
  border-radius:3px;
  background:#f1f3f5;
  color:#111827;
  font-weight:650;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.35;
}
.order-card-title-row,
.order-card-meta-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  column-gap:8px;
  align-items:baseline;
  min-width:0;
}
.order-card-total,
.order-card-meta-row .profit-only{
  white-space:nowrap;
}
.order-product-preview{
  margin-top:5px;
  padding-top:4px;
  border-top:1px solid #f3f4f6;
  overflow:hidden;
  max-width:100%;
}
.order-product-text-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
  min-width:0;
  max-width:100%;
  overflow:hidden;
}
.order-product-text{
  flex:0 1 auto;
  min-width:0;
  max-width:44%;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#111827;
  font-size:11px;
  line-height:1.3;
  font-weight:400;
  white-space:nowrap;
}
.order-rank-dot{
  align-self:center;
  border:1px solid rgba(148,163,184,.12);
}
.order-rank-dot-pending{
  background:#fffaf3;
  color:#d97706;
}
.order-rank-dot-delivered{
  background:#f5faf6;
  color:#2f855a;
}
.order-product-more{
  flex:none;
  font-size:11px;
  line-height:1.3;
  font-weight:400;
  color:#94a3b8;
  white-space:nowrap;
}
.source-detail-grid-detail .source-detail-qty,
.source-detail-grid-detail .source-detail-total-qty{grid-column:4 / 5;}
.source-detail-grid-detail .source-detail-total-label{grid-column:1 / 4;}
.source-detail-table-head{padding:8px var(--source-detail-inline);background:#f8fafc;border-bottom:1px solid #f1f5f9;font-size:9px;font-weight:800;color:#94a3b8;text-transform:uppercase;letter-spacing:.04em;}
.source-detail-data-row{padding:9px var(--source-detail-inline);border-bottom:1px solid #f8fafc;min-height:48px;background:#fff;}
.source-detail-stt{width:24px;justify-self:stretch;text-align:right;color:#94a3b8;font-size:10px;font-weight:700;font-variant-numeric:tabular-nums;}
.source-detail-name{min-width:0;font-size:12px;line-height:1.35;font-weight:750;color:#111827;overflow-wrap:anywhere;}
.source-detail-buyer{margin-top:2px;font-size:9.5px;line-height:1.3;font-weight:550;color:#94a3b8;overflow-wrap:anywhere;}
.source-detail-qty,.source-detail-total-qty{grid-column:3 / 4;display:flex;justify-content:flex-end;align-items:center;width:100%;min-width:0;text-align:right !important;font-size:12px;font-weight:800;color:#111827;white-space:nowrap;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1, "lnum" 1;}
.source-detail-total{padding:10px var(--source-detail-inline);border-top:1px solid #e5e7eb;background:#fff;font-weight:850;color:#111827;}
.source-detail-total-label{grid-column:1 / 3;text-align:left;font-size:11px;}
.source-detail-total-qty{font-size:12px;}
.source-detail-empty{padding:28px 16px;text-align:center;font-size:12px;color:#9ca3af;}
.source-detail-page-note{padding:9px 12px;text-align:right;font-size:9px;font-weight:700;color:#94a3b8;border-top:1px solid #f1f5f9;background:#fff;}
#sourceDetailPanelDetail[hidden],
#sourceDetailPanelGrouped[hidden]{display:none !important;}
@media (min-width:768px){
  .source-detail-capture{--source-detail-inline:16px;}
  .source-detail-grid{grid-template-columns:28px minmax(0,1fr) 56px;column-gap:10px;}
  .source-detail-grid-detail{grid-template-columns:28px minmax(0,1.55fr) minmax(130px,.85fr) 56px;column-gap:10px;}
  .source-detail-data-row{padding-top:10px;padding-bottom:10px;}
  .source-detail-table-head{padding-top:9px;padding-bottom:9px;}
  .source-detail-name{font-size:13px;}
  .source-detail-buyer{font-size:10px;}
  .source-detail-stt{width:28px;}
  .source-detail-qty,.source-detail-total-qty{width:auto !important;}
}


/* FIXED STYLE: source-time-popup-shell-style */

/* Source/time popups reuse the proven in-app modal shell used by orderDetailModalWrapper. */
#sourceDetailModalWrapper,
#orderTimeCustomWrapper{
  background:transparent !important;
}
#sourceDetailModalCard,
#orderTimeCustomCard{
  background:#fff !important;
  opacity:1 !important;
  mix-blend-mode:normal !important;
  filter:none !important;
  -webkit-filter:none !important;
}
/* PC: overlay only the left work area; cart stays independent. */
.pc-mode #sourceDetailModalWrapper,
.pc-mode #orderTimeCustomWrapper,
body[data-force-pc="1"] #sourceDetailModalWrapper,
body[data-force-pc="1"] #orderTimeCustomWrapper{
  left:0 !important;
  right:480px !important;
  top:0 !important;
  bottom:0 !important;
  width:auto !important;
  height:auto !important;
  justify-content:center !important;
  align-items:center !important;
  padding:20px !important;
}
.pc-mode #sourceDetailModalCard,
body[data-force-pc="1"] #sourceDetailModalCard{
  width:min(100%,680px) !important;
  max-width:680px !important;
  max-height:84% !important;
  border-radius:22px !important;
  transform:none !important;
}
.pc-mode #orderTimeCustomCard,
body[data-force-pc="1"] #orderTimeCustomCard{
  width:min(100%,420px) !important;
  max-width:420px !important;
  max-height:84% !important;
  border-radius:22px !important;
  transform:none !important;
}


/* FIXED STYLE: preview-layout-fixes */

/* Ngày/giờ nằm giữa 2 vùng: bên trái là Chọn khách hàng, bên phải là Giỏ. */
#tab-ban-hang > header{
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) auto !important;
  align-items:center !important;
  column-gap:12px;
}
#tab-ban-hang > header > :first-child{
  min-width:0;
  justify-self:start;
}
#tab-ban-hang > header > .text-center{
  position:static !important;
  left:auto !important;
  top:auto !important;
  transform:none !important;
  justify-self:center;
  text-align:center;
  margin:0 auto;
  pointer-events:none;
}
#tab-ban-hang > header > :last-child{
  justify-self:end;
}



/* SPEC-PWA-TAB-READABILITY-20261101:
   Existing 9px tab labels and low-contrast inactive gray are difficult
   to read on iPhone. Preserve all five equal touch targets, active theme,
   active underline, navigation handlers and 64px navbar height. */
@media (max-width:767px){
  #topNav .tab-btn{
    opacity:1 !important;
    filter:none !important;
    -webkit-filter:none !important;
  }
  #topNav .tab-btn.text-gray-400{
    color:#64748b !important;
  }
  #topNav .tab-btn > span{
    font-size:11.5px !important;
    font-weight:600 !important;
    line-height:1.25 !important;
    letter-spacing:0 !important;
  }
  #topNav .tab-btn > i{
    font-size:18px !important;
    line-height:1 !important;
  }
}


/* FIXED STYLE: sales-header-compact-capacity
   Customer gives space first; quick cart reserves xxx | xxx.xxx without wasting gaps. */
#tab-ban-hang > header{
  column-gap:8px !important;
}
#saleCustomerTrigger{
  min-width:0 !important;
  max-width:184px !important;
  padding-left:10px !important;
  padding-right:8px !important;
  gap:6px !important;
}
#saleCustomerTrigger #selectedCustomerDisplay{
  min-width:0 !important;
  max-width:none !important;
  flex:1 1 auto !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
#saleCustomerTrigger .ph-caret-down{
  margin-left:-2px !important; /* name -> caret = 4px while icon -> name stays 6px */
  flex:none !important;
}
#tab-ban-hang > header > :last-child{
  min-width:120px !important;
  padding-left:8px !important;
  padding-right:8px !important;
  gap:8px !important;
}
#headerQuickQty{
  width:34px !important;
  min-width:34px !important;
  padding-left:4px !important;
  padding-right:4px !important;
  box-sizing:border-box !important;
}
#headerQuickTotal{
  min-width:62px !important;
  text-align:right !important;
  font-variant-numeric:tabular-nums !important;
}


/* FIXED STYLE: centered-leading-index-columns */

/* Keep STT/# labels and values on the center axis of their own narrow column.
   This creates a cleaner visual gap before the product name without widening the table. */
.source-detail-stt,
.source-detail-table-head > :first-child{
  text-align:center !important;
}
.order-detail-compact-grid .order-stt{
  text-align:center !important;
}
.cart-left .cart-stt{
  text-align:center !important;
}

/* FIXED STYLE: summary-finance-colors */

/* Tổng hợp: Chi đỏ, Thu xanh nước biển, Lãi xanh lá — áp dụng cả header và số liệu. */
.summary-compact-table :is(th,td):nth-child(3){
  color:#ef4444 !important;
}
.summary-compact-table :is(th,td):nth-child(4){
  color:#2563eb !important;
}
.summary-compact-table :is(th,td):nth-child(5){
  color:#16a34a !important;
}


/* LOGIN AUTOFILL */
#loginScreen input:-webkit-autofill,
#loginScreen input:-webkit-autofill:hover,
#loginScreen input:-webkit-autofill:focus,
#loginScreen input:-webkit-autofill:active {
  -webkit-text-fill-color: #111827 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: #111827;
  transition: background-color 9999s ease-out 0s;
}


/* LOGIN OUTLINE FIELD */
#loginScreen .login-outline-field {
  min-inline-size: 0;
}
#loginScreen .login-outline-field:focus-within {
  border-color: #171717 !important;
  box-shadow: 0 0 0 1px #171717 inset;
}
#loginScreen .login-outline-legend {
  background: transparent !important;
}
#loginScreen input {
  appearance: none;
  -webkit-appearance: none;
}
#loginScreen input:-webkit-autofill,
#loginScreen input:-webkit-autofill:hover,
#loginScreen input:-webkit-autofill:focus,
#loginScreen input:-webkit-autofill:active {
  -webkit-text-fill-color: #171717 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  caret-color: #171717;
}


/* UI-126 — Sales uses the resolved in-app mode, never the outer Chrome
   viewport. A 428px app panel must look identical in 500px and 730px windows. */
#sourceTagsContainer .source-tag-label-mobile{display:none;}
body[data-resolved-mode="mobile"] #sourceTagsContainer{
  gap:5px !important;
  overflow-x:auto;
}
body[data-resolved-mode="mobile"] #sourceTagsContainer .source-filter-chip,
body[data-resolved-mode="mobile"] #sourceTagsContainer .market-source-filter-chip{
  padding-left:9px !important;
  padding-right:9px !important;
  font-size:12px !important;
}
body[data-resolved-mode="mobile"] #sourceTagsContainer .source-tag-label-full{display:none;}
body[data-resolved-mode="mobile"] #sourceTagsContainer .source-tag-label-mobile{display:inline;}

/* Mobile sales search needs >=16px to avoid iOS focus zoom. */
body[data-resolved-mode="mobile"] #tab-ban-hang #searchProductInput{
  height:44px;
  min-height:44px;
  font-size:16px !important;
}
body[data-resolved-mode="mobile"]:not([data-employee-mode="true"]) #tab-ban-hang #searchProductInput{
  padding-left:48px !important;
}
body[data-resolved-mode="mobile"] #tab-ban-hang #salesSearchModeToggle{
  width:40px;
  height:40px;
  left:4px;
}
body[data-resolved-mode="mobile"] #tab-ban-hang #sourceTagsContainer .source-filter-chip,
body[data-resolved-mode="mobile"] #tab-ban-hang #sourceTagsContainer .market-source-filter-chip{
  min-height:36px;
}

/* FIXED STYLE: sales-supermarket-search-toggle */
#salesSearchModeToggle.is-market{
  color:#16a34a !important;
  background:#f0fdf4 !important;
}
.market-quick-card{
  min-height:68px;
}
.market-quick-thumb img{
  display:block;
}
.market-quick-price.market-source-winmart{color:#d71920;}
.market-quick-price.market-source-bhx{color:#087a40;}
.market-quick-price.market-source-go{color:#e85d04;}
.market-quick-price.market-source-vnm{color:#2563eb;}
.market-quick-price.market-source-other{color:#334155;}
body[data-resolved-mode="mobile"] .market-quick-card{
  min-height:64px;
  padding-top:8px !important;
  padding-bottom:8px !important;
}
body[data-resolved-mode="mobile"] .market-quick-thumb{
  width:64px !important;
  height:64px !important;
}


/* FIXED STYLE: order-list-empty-state */
.order-list-empty-state{
  min-height:clamp(140px,28vh,220px);
  display:grid;
  place-items:center;
  padding:18px 12px;
}
.order-list-empty-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  max-width:280px;
  color:#94a3b8;
  font-size:12px;
  line-height:1.45;
  font-weight:400;
  text-align:center;
}
.order-list-empty-inner i{
  color:#cbd5e1;
  font-size:22px;
  line-height:1;
}


/* PUBLIC CUSTOMER LINK: reuse the production User UI; the bottom bar owns supplemental tools. */
.public-user-tools{
  min-height:44px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  gap:1px;
  width:100% !important;
  margin:0;
  padding:0;
  overflow:hidden;
  isolation:isolate;
  border-radius:0;
  background:#1e293b;
  color:#fff;
  box-shadow:none;
}
.public-user-tool{
  min-width:0;
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:0;
  appearance:none;
  -webkit-appearance:none;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  outline:none;
  background:transparent;
  color:#cbd5e1;
  font-size:11px;
  font-weight:700;
  line-height:1;
  padding:0 6px;
  cursor:pointer;
  transition:background-color .14s ease,color .14s ease,transform .08s ease,box-shadow .14s ease;
}
.public-user-tool.is-active{
  background:rgba(255,255,255,.14);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}
.public-user-tool:active{
  transform:scale(.985);
  background:rgba(255,255,255,.10);
}
.public-user-tool.is-active:active{
  background:rgba(255,255,255,.18);
}
.public-user-tool:focus,
.public-user-tool:focus-visible{
  outline:none;
}
@media (hover:hover){
  .public-user-tool:hover{
    background:rgba(255,255,255,.08);
    color:#fff;
  }
  .public-user-tool.is-active:hover{
    background:rgba(255,255,255,.16);
  }
}
.public-user-tool-share{
  color:#fff;
}
.public-user-tool-status{
  grid-column:1/-1;
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border-radius:0;
  font-size:11px;
  font-weight:650;
}
.public-user-tool-status i{color:#4ade80;}
.public-user-tools[data-tool-count="2"]{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.public-user-tools[data-tool-count="3"]{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.public-share-panel{
  position:fixed;
  inset:0;
  z-index:240;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px;
}
.public-share-backdrop{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  padding:0;
  background:rgba(15,23,42,.42);
  -webkit-tap-highlight-color:transparent;
}
.public-share-card{
  position:relative;
  width:min(420px,100%);
  border:1px solid #e5e7eb;
  border-radius:20px;
  background:#fff;
  padding:16px;
  box-shadow:0 20px 50px rgba(15,23,42,.22);
}
.public-share-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.public-share-title{
  color:#111827;
  font-size:16px;
  font-weight:800;
}
.public-share-sub{
  margin-top:3px;
  color:#6b7280;
  font-size:11px;
  line-height:1.4;
}
.public-share-warning{
  margin-top:12px;
  padding:10px 11px;
  border:1px solid #fecaca;
  border-radius:12px;
  background:#fef2f2;
  color:#b42318;
  font-size:11px;
  line-height:1.45;
  font-weight:650;
}
.public-share-close{
  width:32px;
  height:32px;
  flex:0 0 32px;
  border:0;
  border-radius:10px;
  background:#f3f4f6;
  color:#4b5563;
  font-size:20px;
  line-height:1;
  -webkit-tap-highlight-color:transparent;
}
.public-share-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  padding:11px 12px;
  border:1px solid #e5e7eb;
  border-radius:13px;
  background:#f9fafb;
  color:#6b7280;
  font-size:12px;
}
.public-share-status strong{
  color:#b45309;
  font-size:12px;
}
.public-share-status strong[data-active="true"]{
  color:#15803d;
}
.public-share-label{
  display:block;
  margin-top:14px;
  color:#374151;
  font-size:11px;
  font-weight:750;
}
.public-share-pin-boxes{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:7px;
  margin-top:7px;
}
.public-share-pin-digit{
  width:100%;
  min-width:0;
  height:46px;
  border:1px solid #d1d5db;
  border-radius:11px;
  padding:0;
  outline:none;
  background:#fff;
  color:#111827;
  text-align:center;
  font-size:19px;
  font-weight:800;
  line-height:1;
  caret-color:#111827;
}
.public-share-pin-digit:focus{
  border-color:#111827;
  box-shadow:0 0 0 2px rgba(17,24,39,.08);
}
.public-share-pin-boxes[data-invalid="true"] .public-share-pin-digit{
  border-color:#f04438;
  background:#fffafa;
}
.public-share-pin-boxes[data-complete="true"] .public-share-pin-digit{
  border-color:#98a2b3;
}
.public-share-pin-save{
  width:100%;
  height:44px;
  margin-top:9px;
  border:0;
  border-radius:12px;
  padding:0 14px;
  background:#111827;
  color:#fff;
  font-size:12px;
  font-weight:800;
  -webkit-tap-highlight-color:transparent;
}
.public-share-pin-save:disabled{
  opacity:.42;
  cursor:default;
}
@media(max-width:340px){
  .public-share-pin-boxes{gap:5px}
  .public-share-pin-digit{height:43px;font-size:18px}
}
.public-share-help{
  min-height:31px;
  margin-top:7px;
  color:#6b7280;
  font-size:11px;
  line-height:1.4;
}
.public-share-help[data-error="true"]{color:#b42318;}
.public-share-help[data-success="true"]{color:#15803d;}
.public-share-copy{
  width:100%;
  height:46px;
  margin-top:4px;
  border:1px solid #d1d5db;
  border-radius:13px;
  background:#fff;
  color:#111827;
  font-size:13px;
  font-weight:800;
  -webkit-tap-highlight-color:transparent;
}
.public-share-copy:active,
.public-share-close:active{
  background:#f3f4f6;
}
@media(min-width:760px){
  .public-share-panel{align-items:center;}
  .public-share-card{padding:18px;}
}

body[data-employee-mode="true"] #topNav .tab-btn:not(:first-child){
  display:none !important;
}
body[data-employee-mode="true"] #topNav .tab-btn:first-child{
  width:100% !important;
  max-width:none !important;
}
body[data-employee-mode="true"] #saleCustomerTrigger{
  pointer-events:none;
}
body[data-employee-mode="true"] #headerQuickTotal,
body[data-employee-mode="true"] #salesSearchModeToggle,
body[data-employee-mode="true"] #btnOpenCartMobile,
body[data-employee-mode="true"] .product-line-note-wrap{
  display:none !important;
}
body[data-employee-mode="true"] #searchProductInput{
  padding-left:1rem !important;
}
body[data-employee-link="true"] #publicSharePanel{
  display:none !important;
}
body[data-employee-link="true"] #saleCustomerTrigger{
  pointer-events:none !important;
}
body[data-employee-link="true"] #cartShareOrderBtn,
body[data-employee-link="true"] #cartFooterActions button[onclick*="dayToanBoGioHang"],
body[data-employee-link="true"] #cartFooterActions button[onclick*="updateExistingOrder"],
body[data-employee-link="true"] #cartFooterActions button[onclick*="goToBanHangForEditing"],
body[data-employee-link="true"] #cartFooterActions button[onclick*="requestDeleteEditingOrder"]{
  display:none !important;
}

/* FIXED STYLE: two-sided-intrinsic-tables-20261008
   Summary has an existing max-content ruler in source-3. A user role
   hides Chi+Lãi, so the remaining 3 data columns must occupy 3 tracks. */
body[data-auth-role="user"] .summary-compact-table{
  grid-template-columns:minmax(0,1fr) max-content max-content !important;
}

/* Chi tiết + Gộp: STT/Tên at left, last SL stays at the right edge.
   The customer-name column in Chi tiết also shrinks when needed.
   These classes are shared by the on-screen and share-capture tables. */
.source-detail-capture .source-detail-grid{
  box-sizing:border-box;
  width:100%;
  grid-template-columns:24px minmax(0,1fr) max-content;
  column-gap:8px;
  justify-content:stretch;
}
.source-detail-capture .source-detail-grid-detail{
  grid-template-columns:24px minmax(0,1fr) minmax(0,.75fr) max-content;
}
.source-detail-capture .source-detail-grid .source-detail-qty,
.source-detail-capture .source-detail-grid .source-detail-total-qty{
  justify-self:end;
  justify-content:flex-end;
  text-align:right !important;
  white-space:nowrap;
  min-width:max-content;
}
.source-detail-capture .source-detail-grid .source-detail-product-cell,
.source-detail-capture .source-detail-grid .source-detail-buyer-cell,
.source-detail-capture .source-detail-grid .source-detail-name{
  min-width:0;
}
@media(min-width:768px){
  .source-detail-capture .source-detail-grid{
    grid-template-columns:28px minmax(0,1fr) max-content;
    column-gap:10px;
  }
  .source-detail-capture .source-detail-grid-detail{
    grid-template-columns:28px minmax(0,1fr) minmax(0,.75fr) max-content;
  }
}

/* SPEC-TAPHOA-USER-PIN-ORDER-TIMELINE-20261108: distinct status tabs */
#appContainer #topNav .tab-btn[onclick*="tab-da-giao"].text-primary{
  color:#289e57 !important;
  border-bottom-color:#289e57 !important;
}
#appContainer #topNav .tab-btn[onclick*="tab-don-tam"].text-primary{
  color:#c98529 !important;
  border-bottom-color:#c98529 !important;
}
body[data-auth-role="user"] #tab-da-giao #completedTimeFilterButton,
body[data-auth-role="user"] #tab-don-tam #pendingTimeFilterButton{
  display:none !important;
}
.order-timeline-day-heading{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:18px 0 10px;
  padding:0 2px 8px;
  border-bottom:1px solid #e2e8f0;
  color:#64748b;
  font-size:12px;
  line-height:1.4;
  font-weight:750;
}
.order-timeline-day-count{
  color:#94a3b8;
  font-weight:600;
  white-space:nowrap;
}
.order-timeline-more{
  display:block;
  width:100%;
  margin:12px auto 20px;
  padding:13px 16px;
  background:#fff;
  color:#475569;
  border:1px solid #e2e8f0;
  border-radius:14px;
  font-size:13px;
  font-weight:700;
  text-align:center;
}
.order-timeline-more:hover{background:#f8fafc;}

/* SPEC-TAPHOA-PWA-UPDATE-ACTION-20261108: visible for logged-in users and PIN. */
#taphoa-update-notice{
  position:fixed;
  right:max(12px,env(safe-area-inset-right));
  bottom:calc(56px + env(safe-area-inset-bottom));
  z-index:190;
  padding:11px 15px;
  max-width:min(310px,calc(100vw - 24px));
  border:1px solid #fed7aa;
  border-radius:12px;
  background:#fff7ed;
  color:#9a3412;
  box-shadow:0 4px 18px rgba(15,23,42,.15);
  font-size:13px;
  font-weight:750;
  line-height:1.3;
  cursor:pointer;
}
#taphoa-update-notice[hidden]{display:none!important;}
#taphoa-update-notice:focus-visible{outline:2px solid #ea580c;outline-offset:2px;}
/* UI-185: public order/debt tabs use one full-width, readable policy rail. */
#statusBar[data-public-user-tools="true"][data-public-tool-view="policy"]{
  display:flex;
  align-items:center;
  justify-content:center;
}
#statusBar[data-public-user-tools="true"] > .tp-policy-reopen--bar{
  color:#e2e8f0;
  font-size:12px;
  font-weight:700;
  width:100%;
  min-height:44px;
  flex:1;
}
body[data-auth-role="user"] > .tp-policy-reopen--home:not(.tp-policy-reopen--quote){
  bottom:calc(52px + env(safe-area-inset-bottom));
}

/* SPEC-ORDER-DAY-GROUPS-20261108:
   User/PIN sees actual orders beneath each day, before the secondary summary. */
body[data-auth-role="user"] :is(#tab-da-giao,#tab-don-tam) > main{
  display:flex;
  flex-direction:column;
  gap:16px;
}
body[data-auth-role="user"] :is(#tab-da-giao,#tab-don-tam) > main > *{
  margin-top:0 !important;
}
body[data-auth-role="user"] :is(#tab-da-giao,#tab-don-tam) > main > .order-summary-panel{order:2;}
body[data-auth-role="user"] :is(#tab-da-giao,#tab-don-tam) > main > div:not(.order-summary-panel){
  order:1;
  min-width:0;
}
.order-timeline-day-group{width:100%;min-width:0;margin:0 0 14px;}
.order-timeline-day-group > .order-timeline-day-heading{
  margin:10px 0 9px;
  padding:0 2px 8px;
  border-bottom:1px solid #e2e8f0;
  font-size:12px;
  line-height:1.35;
}
.order-timeline-day-group > .allow-fast-click{width:100%;margin-bottom:8px;}
.order-timeline-day-group > .allow-fast-click:last-child{margin-bottom:0;}
