:root {
  --green: #2E7D32;
  --green-light: #4CAF50;
  --green-dark: #1B5E20;
  --green-soft: #edf7ef;
  --brand: #2E7D32;
  --brand-primary: #2E7D32;
  /* Alias legacy — toàn site dùng nhận diện xanh lá Teikei */
  --brown: var(--green);
  --brown-dark: var(--green-dark);
  --brown-soft: var(--green-soft);
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-600: #666;
  --checkbox-size: 1.125rem;
  --checkbox-radius: 4px;
  --checkbox-border: #b8c0cc;
  --surface-border: #c8e6c9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Checkboxes — đồng bộ kích thước & căn chỉnh toàn site */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: var(--checkbox-size);
  height: var(--checkbox-size);
  margin: 0;
  flex-shrink: 0;
  border: 2px solid var(--checkbox-border);
  border-radius: var(--checkbox-radius);
  background: var(--white);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="checkbox"]::after {
  content: "";
  width: 0.32rem;
  height: 0.58rem;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px, -1px) scale(0);
  transition: transform 0.12s ease;
}

input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}

input[type="checkbox"]:checked::after {
  transform: rotate(45deg) translate(-0.5px, -1px) scale(1);
}

input[type="checkbox"]:indeterminate {
  background: var(--green);
  border-color: var(--green);
}

input[type="checkbox"]:indeterminate::after {
  width: 0.55rem;
  height: 2px;
  border: none;
  background: var(--white);
  transform: none;
}

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.22);
}

input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.radio-label input[type="radio"] {
  margin: 0.2em 0 0;
  flex-shrink: 0;
  width: auto;
  height: auto;
}

.checkbox-label--top {
  align-items: flex-start;
}

.checkbox-label--top input[type="checkbox"] {
  margin-top: 0.2em;
}

td.text-center > .checkbox-label,
th.text-center > .checkbox-label,
td.text-center > input[type="checkbox"],
th.text-center > input[type="checkbox"],
.col-check > .checkbox-label,
.col-check > input[type="checkbox"] {
  justify-content: center;
}

td.text-center > input[type="checkbox"]:only-child,
th.text-center > input[type="checkbox"]:only-child,
.col-check > input[type="checkbox"]:only-child {
  display: block;
  margin-inline: auto;
}

.panel-grid-table td.text-center .checkbox-label,
.panel-grid-table th.text-center .checkbox-label {
  width: 100%;
  justify-content: center;
}


body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--white);
  color: #222;
  line-height: 1.5;
}

html,
body.customer-site {
  overflow-x: hidden;
  max-width: 100%;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: var(--brown);
  color: var(--white);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.brand em { display: block; font-size: 0.85rem; opacity: 0.85; font-style: italic; }

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--white);
}

.header-logo-link {
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  background: var(--white);
  border-radius: 8px;
}

.header-logo-fallback {
  width: 48px;
  height: 48px;
}

.header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: var(--white);
}

.header-slogan {
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.25;
  min-width: 0;
  opacity: 0.92;
}

.header-slogan-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header-slogan-link:hover {
  opacity: 1;
}

.main-nav a {
  color: var(--white);
  margin-left: 16px;
  font-weight: 500;
}

.cart-link { position: relative; }

.cart-badge {
  background: var(--green-light);
  color: var(--white);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  margin-left: 4px;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
}

.search-form button {
  padding: 10px 20px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.main-content { min-height: 60vh; padding-bottom: 40px; }

.hero {
  background: linear-gradient(135deg, #f0f7f0, #fff);
  border: 1px solid #dcefdc;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
}

.hero h1 { color: var(--brown-dark); margin-bottom: 8px; }

.section-title {
  color: var(--brown);
  margin: 24px 0 16px;
  font-size: 1.4rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.product-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--gray-100);
}

.product-body { padding: 14px; }

.product-body h3 { font-size: 1rem; margin-bottom: 6px; }

.price { color: var(--green); font-weight: 700; }

.price-lg { font-size: 1.5rem; color: var(--green); font-weight: 700; margin: 12px 0; }

.stock { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 8px; }

.description { margin: 16px 0; color: #444; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
}

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-light); text-decoration: none; }
.btn-outline { background: transparent; border: 1px solid var(--green); color: var(--green); }
.btn-lg { padding: 12px 24px; font-size: 1rem; width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-link { background: none; border: none; color: #c62828; cursor: pointer; font-size: 0.85rem; }

.add-cart-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.qty-input { width: 70px; padding: 6px; border: 1px solid #ccc; border-radius: 6px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.detail-image img {
  width: 100%;
  border-radius: 12px;
  max-height: 420px;
  object-fit: cover;
}

.detail-form { flex-direction: column; align-items: stretch; }
.detail-form label { font-weight: 600; margin-bottom: 4px; }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex: 1; }
.cart-item-total { text-align: right; }

.cart-summary {
  background: var(--gray-100);
  padding: 20px;
  border-radius: 12px;
  height: fit-content;
  position: sticky;
  top: 16px;
}

.summary-total { font-size: 1.5rem; color: var(--green); font-weight: bold; margin: 8px 0; }

.checkout-form { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

.checkout-form input:not([type="checkbox"]):not([type="radio"]),
.checkout-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
}

.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-error { background: #ffebee; color: #c62828; }

.empty-state { text-align: center; padding: 40px; color: var(--gray-600); }

.site-footer {
  background: var(--brown-dark);
  color: rgba(255,255,255,0.8);
  text-align: left;
  padding: 20px;
  margin-top: 40px;
}

/* —— Customer top promo bar —— */
.site-topbar {
  background: #f4f7f2;
  border-bottom: 1px solid #e2e8df;
  font-size: 0.78rem;
  color: var(--gray-800);
  max-width: 100%;
  overflow: hidden;
}

.site-topbar-inner {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 6px 12px;
}

.site-topbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  justify-content: center;
  padding: 4px 10px;
  min-width: 0;
}

.site-topbar-item + .site-topbar-item {
  border-left: 1px solid #dde5d8;
}

.site-info-icon {
  flex-shrink: 0;
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--green);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.site-topbar-icon.site-info-icon {
  width: 22px;
  height: 22px;
}

.footer-info-item .site-info-icon {
  margin-top: 2px;
}

.site-info-icon--truck {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4z'/%3E%3C/svg%3E");
}

.site-info-icon--mail {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.site-info-icon--clock {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
}

.site-info-icon--phone {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1zm-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5-4H7V4h9v14z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1zm-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm4.5-4H7V4h9v14z'/%3E%3C/svg%3E");
}

.site-info-icon--pin {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
}

.site-info-icon--chat {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
}

.site-info-icon--gift {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 12 7.4l3.38 4.6L17 10.83 14.92 8H20v6z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 12 7.4l3.38 4.6L17 10.83 14.92 8H20v6z'/%3E%3C/svg%3E");
}

.site-topbar-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}

.site-topbar-text strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brown-dark);
}

.site-topbar-text span {
  font-size: 0.72rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— Customer site shell —— */
body.customer-site .site-header-v2 {
  background: var(--brown);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
  margin-bottom: 16px;
  padding-bottom: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.site-primary-nav {
  background: var(--green-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-primary-nav-inner {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0;
}

.site-primary-nav-inner::-webkit-scrollbar {
  display: none;
}

.site-primary-nav-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.site-primary-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.site-primary-nav-link.is-active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.customer-drawer-site-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.customer-drawer-site-nav .site-primary-nav-link {
  color: #333;
  border-bottom: none;
  border-radius: 8px;
  padding: 10px 12px;
}

.customer-drawer-site-nav .site-primary-nav-link:hover {
  background: #f5f5f5;
  color: var(--brown-dark);
}

.customer-drawer-site-nav .site-primary-nav-link.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

/* —— Trang chủ layout lưới —— */
body.home-grid-page .site-topbar,
body.home-grid-page .site-header,
body.home-grid-page .site-primary-nav {
  display: none !important;
}

body.home-grid-page .page-main {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

body.home-grid-page .site-footer {
  margin-top: 24px;
}

body.customer-flow-page .site-footer .container {
  max-width: 640px;
}

@media (min-width: 769px) {
  body.customer-flow-page .customer-flow-content {
    max-width: min(960px, 100%);
    padding-bottom: 100px;
  }

  body.customer-flow-page .customer-flow-content--wide {
    max-width: min(1200px, 100%);
  }

  body.customer-flow-page .site-footer .container {
    max-width: min(960px, 100%);
  }

  body.customer-flow-page:has(.customer-flow-content--wide) .site-footer .container {
    max-width: min(1200px, 100%);
  }

  body.customer-flow-page .home-grid-header--compact,
  body.customer-flow-page .home-grid-nav-inner {
    max-width: min(1200px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  body.customer-flow-page .home-grid-header--compact .home-grid-hero-video,
  body.customer-flow-page .home-grid-header--compact .home-grid-hero-poster,
  body.customer-flow-page .home-grid-header--compact .home-grid-hero-placeholder {
    max-height: 160px;
  }
}

/* Menu ngang layout trang chủ / luồng khách */
.home-grid-nav {
  position: sticky;
  top: 0;
  z-index: 150;
  background: var(--green);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.home-grid-nav-inner {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 8px;
  max-width: 100%;
}

.home-grid-nav-inner::-webkit-scrollbar {
  display: none;
}

.home-grid-nav-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.home-grid-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.home-grid-nav-link.is-active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* Hero compact — trang con luồng khách */
.home-grid-header--compact {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  padding: 8px 12px;
  min-height: 0;
}

.home-grid-header--compact .home-grid-hero-video,
.home-grid-header--compact .home-grid-hero-poster,
.home-grid-header--compact .home-hero-video-trigger .home-grid-hero-video {
  max-height: 120px;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.home-grid-header--compact .home-grid-hero-placeholder {
  max-height: 120px;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.home-hero-video-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.home-hero-video-trigger .home-grid-hero-video,
.home-hero-video-trigger .home-grid-hero-poster {
  display: block;
  width: 100%;
  pointer-events: none;
}

.home-hero-video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.92);
}

.home-hero-video-lightbox.hidden {
  display: none !important;
}

body.home-hero-video-open {
  overflow: hidden;
}

.home-hero-video-lightbox-inner {
  width: min(100%, 1200px);
  max-height: calc(100vh - 48px);
}

.home-hero-video-lightbox-player {
  width: 100%;
  max-height: calc(100vh - 48px);
  border-radius: 8px;
  background: #000;
}

.home-hero-video-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.customer-flow-content {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 88px;
  box-sizing: border-box;
}

.customer-flow-content--wide {
  max-width: min(1200px, 100%);
}

.customer-flow-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 14px;
}

.customer-flow-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1b5e20;
  line-height: 1.25;
}

.customer-flow-page-desc {
  margin: 4px 0 0;
  color: #666;
  font-size: 0.92rem;
  line-height: 1.4;
}

.customer-flow-page-actions {
  flex-shrink: 0;
}

body.customer-flow-page .order-payment-page-wrap {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.home-grid-header {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 10px 16px;
  align-items: stretch;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, var(--green-soft) 100%);
  border-bottom: 1px solid #d4e8d6;
}

.home-grid-header-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.home-grid-brand-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  max-width: 100%;
}

.home-grid-logo {
  flex: 0 0 auto;
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
}

.home-grid-logo .header-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 128px;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: left bottom;
  border-radius: 0;
  flex-shrink: 1;
}

body.home-grid-page .home-grid-logo .header-logo {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: auto;
  height: auto;
  max-width: min(100%, 320px);
  max-height: 128px;
}

.home-grid-logo .header-logo-fallback,
.home-grid-logo .brand-badge.header-logo-fallback {
  width: auto;
  min-width: 48px;
  height: auto;
  min-height: 40px;
 padding: 10px 20px;
  font-size: 1.65rem;
  border-radius: 6px;
}

.home-grid-slogan {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  margin: -6px 0 0;
  padding: 0 0 0 15px;
}

body.home-grid-page .home-grid-slogan .header-slogan,
body.home-grid-page .home-grid-slogan .header-slogan-link {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--brown-dark);
  font-weight: 600;
  font-style: italic;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.home-grid-header-media {
  position: relative;
  align-self: stretch;
  min-height: 72px;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1208;
}

.home-grid-hero-video,
.home-grid-hero-poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-grid-hero-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--green-dark), var(--green) 55%, var(--green-light));
}

.home-grid-ticker {
  overflow: hidden;
  background: var(--green-soft);
  border-bottom: 1px solid var(--surface-border);
}

.home-grid-ticker-skew {
  transform: skewX(-6deg);
  margin: 0 -8px;
  padding: 8px 12px;
}

.home-grid-ticker-skew .shop-ticker {
  transform: skewX(6deg);
  max-width: 100%;
}

.home-grid-ticker .shop-ticker-text {
  font-size: 1rem;
}

.home-combo-section {
  padding: 16px;
}

body.home-grid-page .home-combo-section--home.home-combo-section--compact {
  padding: 4px 4px 6px;
  margin: 0;
  background: var(--green-soft);
  border-bottom: 1px solid #d4b896;
}

body.home-grid-page .home-combo-section--compact .home-combo-frame {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

body.home-grid-page .home-combo-section--home:not(.home-combo-section--compact) {
  padding: 12px 10px 14px;
  margin: 0;
  background: var(--green-soft);
  border-bottom: 2px solid #d4b896;
}

body.home-grid-page .home-combo-section--home:not(.home-combo-section--compact) .home-combo-frame {
  border: 2px solid #c9a87c;
  border-radius: 14px;
  background: #fff;
  padding: 12px 10px 14px;
  box-shadow: 0 2px 10px rgba(61, 41, 20, 0.06);
}

.home-combo-frame-title {
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brown-dark);
  letter-spacing: 0.02em;
}

.home-combo-carousel {
  position: relative;
}

body.home-grid-page .home-combo-section--compact .home-combo-carousel {
  padding: 0 22px;
}

.home-combo-viewport {
  overflow: hidden;
}

.home-combo-track {
  display: flex;
  transition: transform 0.3s ease;
  will-change: transform;
}

.home-combo-slide {
  flex: 0 0 100%;
  min-width: 100%;
}

.home-combo-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-items: stretch;
}

body.home-grid-page .home-combo-section--compact .home-combo-row {
  height: 100px;
  max-height: 100px;
}

body.home-grid-page .home-combo-section--compact .home-combo-row:has(.home-combo-card:nth-child(1):last-child) {
  grid-template-columns: minmax(0, 1fr);
}

body.home-grid-page .home-combo-section--compact .home-combo-row:has(.home-combo-card:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-combo-card {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(46, 125, 50, 0.08);
}

.home-combo-card--cover {
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--green-soft);
  background-image: var(--combo-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.home-combo-card--cover.home-combo-card--no-image {
  background-image: linear-gradient(135deg, var(--green-soft) 0%, #fff 45%, #e8f5e9 100%);
}

.home-combo-card-scrim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.55) 38%,
    rgba(255, 255, 255, 0.94) 72%,
    rgba(255, 255, 255, 0.98) 100%
  );
  pointer-events: none;
}

.home-combo-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  height: 100%;
  min-height: 0;
  padding: 4px 5px 4px 6px;
}

.home-combo-card-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-combo-card--compact {
  height: 100%;
  max-height: 100px;
  position: relative;
}

.home-combo-card--compact .home-combo-card-cover-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  text-indent: -9999px;
  overflow: hidden;
}

.home-combo-card--compact .home-combo-card-content {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.home-combo-card--compact .home-combo-card-title-text {
  color: inherit;
}

.home-combo-card--out {
  opacity: 0.7;
}

.home-combo-card-media {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
  text-decoration: none;
  background: var(--green-soft);
}

.home-combo-card-img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

.home-combo-card--cover .home-combo-card-tag {
  position: static;
  align-self: flex-start;
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: #d7ead9;
  color: #2d5a27;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.home-combo-card-media .home-combo-card-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 3px;
  background: #d7ead9;
  color: #2d5a27;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.home-combo-card-items {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.home-combo-card-items li {
  margin: 0;
  padding: 0;
  font-size: 0.56rem;
  line-height: 1.15;
  color: #4a3d30;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-combo-card-items-more {
  font-style: italic;
  color: #7a6a58;
  font-weight: 600;
}

.home-combo-card-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1px;
  min-width: 0;
  padding: 4px 5px 4px 6px;
}

.home-combo-card-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--brown-dark);
}

.home-combo-section--compact .home-combo-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.home-combo-card-title a {
  color: inherit;
  text-decoration: none;
}

.home-combo-card-desc,
.home-combo-card-includes {
  margin: 0;
  font-size: 0.6rem;
  color: var(--green-dark);
  line-height: 1.2;
}

.home-combo-card-stock {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  color: #b45309;
}

.home-combo-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: auto;
}

.home-combo-card-price {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brown-dark);
  line-height: 1;
  white-space: nowrap;
}

.home-combo-card-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 4px 7px;
  border-radius: 4px;
  background: #b83280;
  color: #fff !important;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.home-combo-card-cta--disabled {
  background: #c4b8a8;
  cursor: default;
}

.home-combo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 22px;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--brown-dark);
  padding: 0;
}

body.home-grid-page .home-combo-section--compact .home-combo-nav {
  top: 50%;
  width: 20px;
  height: 52px;
}

.home-combo-nav--prev { left: 0; }
.home-combo-nav--next { right: 0; }

.home-combo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.home-combo-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #d4c4b0;
  cursor: pointer;
}

.home-combo-dot.is-active {
  background: var(--green);
}

/* Shop /san-pham: thẻ combo lớn hơn một chút */
.shop-combo-section:not(.home-combo-section--compact) .home-combo-row {
  gap: 10px;
}

.shop-combo-section:not(.home-combo-section--compact) .home-combo-card {
  grid-template-columns: 1fr;
  padding: 10px;
}

.shop-combo-section:not(.home-combo-section--compact) .home-combo-card-media {
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.shop-combo-section:not(.home-combo-section--compact) .home-combo-card-title {
  font-size: 0.95rem;
  -webkit-line-clamp: unset;
}

.shop-combo-section:not(.home-combo-section--compact) .home-combo-card-includes {
  white-space: normal;
  font-size: 0.82rem;
}

.shop-combo-section:not(.home-combo-section--compact) .home-combo-card-price {
  font-size: 1rem;
  color: var(--green);
}

.shop-combo-section:not(.home-combo-section--compact) .home-combo-card-cta {
  font-size: 0.85rem;
  padding: 6px 12px;
  background: transparent;
  color: var(--green) !important;
  text-transform: none;
  font-weight: 600;
}

.home-compact-grid-section {
  padding: 8px 0 88px;
}

.home-compact-grid {
  --home-grid-cols: minmax(0, 1fr) max-content 75px minmax(4.5rem, max-content);
  border: 1px solid var(--surface-border);
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  font-size: 1.32rem;
}

.home-compact-grid-row {
  display: grid;
  grid-template-columns: var(--home-grid-cols);
  gap: 0;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
}

.home-compact-grid-row:last-child {
  border-bottom: none;
}

.home-compact-grid-row--head {
  background: var(--green);
  color: #fff;
  font-size: 1.23rem;
  font-weight: 700;
}

.home-compact-grid-row--head .home-compact-col {
  padding: 10px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.home-compact-grid-row--head .home-compact-col:last-child {
  border-right: none;
}

.home-compact-grid-row--actions {
  background: #fff;
}

.home-compact-actions {
  grid-column: 1 / 4;
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-right: 1px solid var(--surface-border);
}

.home-compact-checkout-btn {
  padding: 8px 18px;
  font-size: 1.28rem;
  font-weight: 700;
  min-height: 0;
}

.home-compact-grand-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--green);
  background: #e8f3e8;
}

.home-compact-total-label {
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.home-compact-grand-total .shop-money--full {
  display: none;
}

/* Ghi đè .shop-product-card — giữ layout bảng 4 cột, không dùng card dọc */
body.home-grid-page .home-compact-grid > article.home-compact-row.shop-product-card {
  display: grid;
  grid-template-columns: var(--home-grid-cols);
  flex-direction: unset;
  gap: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  opacity: 1;
  align-items: center;
  min-height: 57px;
}

body.home-grid-page .home-compact-grid > article.home-compact-row.shop-product-card--out {
  opacity: 1;
}

body.home-grid-page .home-compact-grid > article.home-compact-row.shop-product-card--interactive {
  cursor: default;
}

body.home-grid-page .home-compact-grid > article.home-compact-row.shop-product-card--interactive:hover,
body.home-grid-page .home-compact-grid > article.home-compact-row.shop-product-card--interactive:focus-within {
  border-color: transparent;
  box-shadow: none;
}

body.home-grid-page .home-compact-grid-row--head .home-compact-col--stock,
body.home-grid-page .home-compact-grid-row--head .home-compact-col--order {
  text-align: center;
}

body.home-grid-page .home-compact-grid > article.home-compact-row:nth-of-type(odd) {
  background: #fff;
}

body.home-grid-page .home-compact-grid > article.home-compact-row:nth-of-type(even) {
  background: #f5f8f4;
}

.home-compact-col {
  padding: 6px 8px;
  border-right: 1px solid #e8e0d0;
  min-width: 0;
}

.home-compact-col:last-child {
  border-right: none;
}

.home-compact-col--name {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.35em;
}

.home-compact-col--stock,
.home-compact-col--order {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-compact-col--stock {
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

.home-compact-stock-qty {
  white-space: nowrap;
}

.home-compact-col--money {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-weight: 700;
}

.home-compact-unit-price,
.home-compact-grid-row--head .home-compact-col--money {
  padding-left: 8px;
  padding-right: 10px;
  white-space: nowrap;
}

.home-compact-price-value {
  color: var(--green);
  font-weight: 700;
  font-size: 1.32rem;
  font-variant-numeric: tabular-nums;
}

.home-compact-grid-row--head .home-compact-col--money {
  background: transparent;
  color: #fff;
}

.home-compact-grid > article .home-compact-col--money {
  background: #e8f3e8;
  color: var(--green);
}

body.home-grid-page .home-compact-name,
body.customer-flow-page .customer-flow-page-title {
  color: #1b5e20;
}

.home-compact-name {
  color: #1b5e20;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.25;
}

.home-compact-pack {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-600, #666);
  line-height: 1.25;
  white-space: nowrap;
}

.home-compact-stock-qty {
  font-weight: 700;
  font-size: 1.32rem;
}

.home-compact-stock-qty--in {
  color: #2e7d32;
}

.home-compact-stock-qty--out {
  color: #c62828;
}

.home-compact-qty {
  width: 100%;
  max-width: 72px;
  padding: 6px 4px;
  text-align: center;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  font-size: 1.32rem;
  font-weight: 600;
  background: #fff;
}

.home-compact-qty:disabled {
  background: #f0f0f0;
  color: #999;
}

.home-compact-col--money .line-total {
  display: block;
  text-align: right;
  width: 100%;
  font-size: 1.32rem;
}

.home-compact-col--money .shop-money--compact {
  color: var(--green);
  font-weight: 700;
  font-size: 1.32rem;
}

.home-sticky-fabs {
  pointer-events: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.cart-drawer-open .home-sticky-fabs,
body.customer-menu-open .home-sticky-fabs,
body.product-filters-open .home-sticky-fabs,
body.customer-panel-open .home-sticky-fabs,
body.auth-modal-open .home-sticky-fabs,
body.customer-notify-open .home-sticky-fabs {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.home-fab {
  pointer-events: auto;
  position: static;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.home-fab-cart {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.home-fab-cart-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.home-fab-cart-preview:not(.has-preview) {
  display: none;
}

.home-fab-cart-thumb {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.home-fab-cart-preview.has-preview .home-fab-cart-thumb:nth-child(2) {
  width: 46%;
  height: 46%;
  right: 2px;
  bottom: 2px;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.home-fab-cart-preview.has-preview .home-fab-cart-thumb:first-child:last-child {
  position: static;
}

.home-fab-cart-icon.hidden {
  display: none;
}

.home-fab-cart-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.home-fab-cart .cart-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 0.72rem;
  line-height: 20px;
  text-align: center;
}

.home-fab-cart .cart-count-badge.is-empty {
  display: none;
}

.home-fab-login {
  padding: 12px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--brown-dark);
  border: 1px solid var(--surface-border);
  font-size: 0.9rem;
}

.home-fab-wallet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff;
  color: var(--brown-dark);
  border: 1px solid var(--surface-border);
  font-size: 0.72rem;
  line-height: 1.2;
}

.home-fab-wallet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.home-fab-wallet-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.home-fab-wallet-balance {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brown-dark);
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-fab-notify {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--brown-dark);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.home-fab-notify-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
}

.customer-notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 0.65rem;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

.customer-notify-badge.hidden {
  display: none;
}

.header-notify-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.header-notify-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.header-notify-badge {
  top: -5px;
  right: -5px;
}

.customer-notify-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1240;
}

.customer-notify-overlay.hidden {
  display: none !important;
}

.customer-notify-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  z-index: 1250;
  background: #fff;
  color: #222;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.customer-notify-drawer.is-open {
  transform: translateX(0);
}

.customer-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  background: var(--brown);
  color: #fff;
  flex-shrink: 0;
}

.customer-notify-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.customer-notify-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.customer-notify-actions {
  padding: 8px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.customer-notify-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.customer-notify-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  padding: 12px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.customer-notify-item:hover {
  background: #faf8f6;
}

.customer-notify-item.is-unread {
  background: #f4faf6;
  border-left: 3px solid var(--green);
}

.customer-notify-item-title {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.customer-notify-item-time {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 4px;
}

.customer-notify-item-body {
  display: block;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
}

.customer-notify-empty,
.customer-notify-loading {
  padding: 16px;
  margin: 0;
}

@media (max-width: 768px) {
  .home-grid-header {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    height: auto;
    max-height: none;
    padding: 8px 12px;
    gap: 10px;
  }

  body.home-grid-page .home-grid-logo {
    width: 100%;
  }

  body.home-grid-page .home-grid-logo .header-logo,
  body.customer-site.home-grid-page .home-grid-logo .header-logo {
    width: auto;
    height: auto;
    max-height: 96px;
    max-width: min(100%, 260px);
    object-fit: contain;
    object-position: left center;
  }

  body.home-grid-page .home-grid-logo .header-logo-fallback,
  body.customer-site.home-grid-page .home-grid-logo .header-logo-fallback {
    width: auto;
    height: auto;
    min-height: 48px;
    padding: 10px 22px;
    font-size: 1.75rem;
  }

  .home-grid-brand-stack {
    gap: 5px;
    width: 100%;
  }

  body.home-grid-page .home-grid-slogan .header-slogan,
  body.home-grid-page .home-grid-slogan .header-slogan-link {
    font-size: clamp(0.72rem, 3.2vw, 1rem);
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .home-grid-slogan {
    margin-top: 0;
    padding-left: 0;
  }

  @media (max-width: 480px) {
    .home-grid-header {
      grid-template-columns: minmax(0, 1.65fr) minmax(88px, 1fr);
      gap: 8px;
      padding: 8px 10px;
    }

    .home-grid-header-media {
      min-height: 64px;
    }

    body.home-grid-page .home-grid-logo .header-logo,
    body.customer-site.home-grid-page .home-grid-logo .header-logo {
      max-height: 88px;
      max-width: 100%;
    }
  }

  @media (max-width: 360px) {
    .home-grid-header {
      grid-template-columns: minmax(0, 1.5fr) minmax(80px, 1fr);
      gap: 6px;
      padding: 6px 8px;
    }

    .home-grid-header-media {
      min-height: 56px;
    }

    body.home-grid-page .home-grid-logo .header-logo,
    body.customer-site.home-grid-page .home-grid-logo .header-logo {
      max-height: 80px;
      max-width: 100%;
    }
  }

  body.home-grid-page .home-combo-section--compact .home-combo-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: 100px;
    max-height: 100px;
    gap: 4px;
  }

  body.home-grid-page .home-combo-section--compact .home-combo-carousel {
    padding: 0 18px;
  }

  .home-compact-grid {
    --home-grid-cols: minmax(0, 1fr) max-content 72px minmax(4rem, max-content);
  }

  .home-compact-name {
    font-size: 1.26rem;
  }

  .home-compact-pack {
    font-size: 0.88rem;
  }

  .home-compact-grid-row {
    grid-template-columns: var(--home-grid-cols);
  }
}

/* —— Trang chủ —— */
body.home-page .page-main {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  overflow-x: hidden;
}

.home-hero {
  background: linear-gradient(135deg, var(--green-soft) 0%, #e8f5e9 55%, #fff 100%);
  padding: 28px 0 32px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--surface-border);
}

.home-hero--banner {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  padding: 32px 0 36px;
  background: var(--green-dark);
  border-bottom-color: rgba(0, 0, 0, 0.2);
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.home-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    105deg,
    rgba(20, 14, 8, 0.78) 0%,
    rgba(20, 14, 8, 0.55) 42%,
    rgba(20, 14, 8, 0.2) 100%
  );
  pointer-events: none;
}

.home-hero--banner .home-hero-inner {
  position: relative;
  z-index: 2;
}

.home-hero--banner .home-hero-eyebrow {
  color: rgba(255, 255, 255, 0.88);
}

.home-hero--banner .home-hero-title {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.home-hero--banner .home-hero-slogan {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.home-hero--banner .home-hero-intro {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.home-hero--banner .home-hero-cta-secondary {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.home-hero--banner .home-hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.home-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}

.home-hero-eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.home-hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  line-height: 1.15;
  color: var(--brown-dark);
}

.home-hero-slogan {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #5a4a3a;
  font-weight: 600;
}

.home-hero-intro {
  margin: 0 0 18px;
  color: #4a4035;
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: min(38rem, 100%);
  overflow-wrap: anywhere;
}

.home-hero-intro img,
.home-hero-intro table {
  max-width: 100%;
}

.home-hero-intro--plain {
  margin-bottom: 18px;
}

.home-hero-intro p {
  margin: 0 0 0.5em;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-hero-cta {
  min-height: 46px;
  padding: 10px 22px;
  font-size: 1rem;
}

.home-hero-cta-secondary {
  min-height: 46px;
  padding: 10px 18px;
  border-color: var(--brown);
  color: var(--brown-dark);
  background: rgba(255, 255, 255, 0.65);
}

.home-section {
  max-width: 1100px;
  margin: 0 auto 28px;
  padding: 0 16px;
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.home-section-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brown-dark);
}

.home-section-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}

.home-section-link:hover {
  text-decoration: underline;
}

.home-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-category-chip {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ddd;
  color: var(--brown-dark);
  font-size: 0.9rem;
  text-decoration: none;
}

.home-category-chip:hover {
  border-color: var(--green);
  color: var(--green);
  text-decoration: none;
}

.shop-product-grid--home {
  margin-top: 0;
}

.home-quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.home-quick-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  text-decoration: none;
  color: inherit;
}

.home-quick-card:hover {
  border-color: var(--surface-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.home-quick-icon {
  grid-row: 1 / span 2;
  font-size: 1.5rem;
  line-height: 1;
  align-self: center;
}

.home-quick-card strong {
  color: var(--brown-dark);
  font-size: 1rem;
}

.home-quick-card span:last-child {
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--gray-600);
}

@media (max-width: 639px) {
  .home-hero--banner {
    min-height: 220px;
    padding: 24px 0 28px;
  }

  .home-hero--banner .home-hero-actions {
    flex-direction: column;
  }

  .home-hero--banner .home-hero-cta,
  .home-hero--banner .home-hero-cta-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (min-width: 640px) {
  .home-hero--banner .home-hero-inner {
    grid-template-columns: 1fr;
    max-width: 720px;
  }

  .home-hero--banner {
    min-height: 280px;
  }

  .home-quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .home-quick-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    text-align: center;
    gap: 6px;
  }

  .home-quick-icon {
    grid-row: auto;
    justify-self: center;
  }

  .home-quick-card span:last-child {
    grid-column: auto;
  }
}

body.customer-site .site-header-v2 .header-row {
  padding: 12px 0;
}

.brand-text {
  min-width: 0;
}

.brand-text strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.25;
}

.brand-text em {
  display: block;
  font-size: 0.82rem;
  opacity: 0.88;
  font-style: italic;
  line-height: 1.25;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: var(--white);
}

.brand-logo-fallback[hidden],
.brand .brand-logo + .brand-badge {
  display: none !important;
}

.header-toolbar {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.customer-site .header-toolbar {
  display: flex;
  flex-shrink: 0;
  align-self: center;
}

body.customer-site .site-header-v2 .header-row {
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}

body.customer-site .site-header-v2 .header-brand-group {
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
}

body.customer-site .header-slogan {
  white-space: nowrap;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.25;
}

body.customer-site .header-user-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  max-width: min(14rem, 38vw);
}

body.customer-site .header-user-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

body.customer-site .header-user-card-name {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

body.customer-site .header-user-card-wallet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

body.customer-site .header-user-card-wallet:hover {
  color: #fff;
  text-decoration: none;
}

body.customer-site .header-user-card-wallet .header-wallet-icon {
  flex-shrink: 0;
  line-height: 0;
  opacity: 0.9;
}

body.customer-site .header-user-card-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-left: 8px;
  padding: 3px 10px 3px 12px;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 2.5rem;
}

body.customer-site .header-user-card-cart .cart-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

body.customer-site .header-user-card-cart .cart-count-badge {
  font-size: 0.7rem;
  min-width: 1rem;
  padding: 0 4px;
  line-height: 1.2;
}

.customer-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
}

.cart-btn-compact {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.header-nav-desktop {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.customer-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.customer-nav-link.is-active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.customer-nav-link-muted {
  opacity: 0.9;
  font-weight: 400;
}

.customer-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1190;
}

.customer-menu-overlay.hidden {
  display: none !important;
}

.customer-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 88vw);
  z-index: 1200;
  background: var(--white);
  color: #222;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.customer-nav-drawer.is-open {
  transform: translateX(0);
}

.customer-nav-drawer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  background: var(--brown);
  color: var(--white);
}

.customer-nav-drawer-head #customer-nav-drawer-title {
  flex: 1 1 auto;
  min-width: 0;
}

.customer-nav-drawer-head .customer-drawer-wallet {
  flex: 1 1 100%;
  order: 3;
}

.customer-nav-drawer-head .customer-nav-drawer-close {
  flex-shrink: 0;
}

.customer-nav-drawer-close {
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.customer-nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  overflow-y: auto;
}

.customer-nav-drawer-links .customer-nav-link {
  color: var(--brown-dark);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
}

.customer-nav-drawer-links .customer-nav-link.is-active {
  background: #f1f8e9;
  border-color: #c5e1a5;
  color: var(--green);
}

.customer-nav-drawer-links .customer-nav-link-muted {
  color: var(--gray-600);
}

.customer-drawer-greeting {
  margin: 0 0 8px;
  padding: 0 14px 8px;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.customer-drawer-meta {
  margin: 0 0 8px;
  padding: 0 14px;
  font-size: 0.88rem;
  color: var(--gray-600);
}

body.customer-menu-open {
  overflow: hidden;
}

.site-footer-v2 {
  text-align: left;
  padding: 0;
  margin-top: 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 28px 16px;
  justify-items: start;
}

.footer-grid--balanced {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
  justify-content: start;
  justify-items: start;
  gap: 20px 28px;
  padding: 24px 16px 28px;
}

.footer-col {
  min-width: 0;
  max-width: 280px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-col-title {
  display: block;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
}

.footer-col--connect .footer-social {
  margin-bottom: 0;
}

.site-footer-v2 .footer-info-list {
  align-items: flex-start;
  width: 100%;
}

.footer-brand-title {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.footer-brand-slogan {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.85;
  line-height: 1.45;
}

.footer-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-info-item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

.footer-info-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 0.88rem;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.footer-info-text strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
}

.footer-info-text a,
.footer-info-text span {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-info-text a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-social {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  transition: background 0.15s ease;
}

.footer-social-link:hover {
  background: var(--green);
  color: var(--white);
}

.footer-social-empty {
  margin: 0 0 10px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.footer-contact-extra {
  margin-top: 8px;
}

.footer-contact-extra a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-contact-extra a:hover {
  color: var(--white);
  text-decoration: underline;
}

.settings-promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.settings-promo-block {
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fafafa;
}

.settings-promo-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.settings-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-icon-preview {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.settings-icon-select {
  flex: 1;
  min-width: 0;
}

.settings-footer-items {
  margin-bottom: 12px;
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-links a,
.footer-contact a,
.footer-link-btn,
.footer-plain-text {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.footer-plain-text {
  cursor: default;
  line-height: 1.45;
}

.footer-links a:hover,
.footer-contact a:hover,
.footer-link-btn:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.85;
}

.customer-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

.customer-page-head .page-title {
  margin: 0 0 4px;
}

.customer-page-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.customer-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.shop-ticker {
  margin: 0 0 8px;
  border-left: 4px solid var(--green);
  padding-left: 10px;
  min-height: 1.5rem;
}

.shop-ticker-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.shop-ticker-bar .shop-ticker {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.shop-ticker-bar .customer-page-actions {
  flex: 0 0 auto;
  margin: 0;
}

.shop-ticker-viewport {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.shop-ticker-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  color: var(--brown-dark);
  will-change: transform;
}

.shop-order-cutoff-hint {
  display: none;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 600;
  color: var(--brown-dark);
}

.shop-ticker-gap {
  display: inline-block;
  width: 60px;
  flex-shrink: 0;
}

body.shop-page .customer-page-head--ticker {
  flex-wrap: nowrap;
  gap: 0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

body.shop-page .customer-page-head--ticker .shop-ticker-bar {
  width: 100%;
}

@media (max-width: 768px) {
  body.shop-page .customer-page-head--ticker {
    margin-left: -6px;
    margin-right: -4px;
    padding-left: 2px;
    padding-right: 2px;
  }

  body.shop-page .customer-page-head--ticker .shop-ticker-bar {
    gap: 4px;
  }

  body.shop-page .customer-page-head--ticker .shop-ticker {
    padding-left: 6px;
    border-left-width: 3px;
  }

  body.shop-page .customer-page-head--ticker .product-filters-toggle {
    padding: 3px 7px;
    font-size: 0.72rem;
    line-height: 1.2;
    min-height: 26px;
    white-space: nowrap;
  }

  body.shop-page .shop-order-cutoff-hint {
    display: block;
  }
}

@media (min-width: 769px) {
  body.shop-page .customer-page-head--ticker {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  body.shop-page .customer-page-head--ticker .shop-ticker-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  body.shop-page .customer-page-head--ticker .shop-ticker {
    margin-bottom: 0;
  }

  body.shop-page .customer-page-head--ticker .customer-page-actions {
    align-self: flex-end;
    flex-shrink: 0;
  }

  body.shop-page .customer-page-head--ticker .shop-ticker-viewport {
    min-height: 1.75rem;
  }

  body.shop-page .customer-page-head--ticker .shop-ticker-text {
    font-size: 1.15rem;
  }
}

.shop-money--compact {
  display: none;
}

@media (max-width: 768px) {
  body.shop-page .shop-money--full {
    display: none;
  }

  body.shop-page .shop-money--compact {
    display: inline;
  }

  body.home-page .shop-card-line-total .shop-money--full,
  body.shop-page .shop-product-card .shop-card-line-total .shop-money--full,
  body.home-page .shop-grand-total .shop-money--full,
  body.shop-page .shop-grand-total .shop-money--full {
    display: inline;
  }

  body.home-page .shop-card-line-total .shop-money--compact,
  body.shop-page .shop-product-card .shop-card-line-total .shop-money--compact,
  body.home-page .shop-grand-total .shop-money--compact,
  body.shop-page .shop-grand-total .shop-money--compact {
    display: none;
  }

  body.shop-page.shop-product-detail-page .shop-money--full {
    display: inline;
  }

  body.shop-page.shop-product-detail-page .shop-money--compact {
    display: none;
  }
}

body.shop-page .shop-checkout-row .shop-btn-add-cart {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--brown);
  color: var(--brown-dark);
}

body.shop-page .shop-checkout-bar--desktop .shop-btn-add-cart {
  background: #fff;
  border: 1px solid #ccc;
  color: var(--brown-dark);
}

@media (max-width: 768px) {
  body.customer-site .site-header-v2 > .container {
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  body.customer-site .site-header-v2 .header-row {
    gap: 8px;
  }

  body.customer-site .header-avatar {
    display: none;
  }

  body.customer-site .header-slogan {
    flex-shrink: 1;
    font-size: clamp(0.62rem, 2.6vw, 0.82rem);
    line-height: 1.2;
  }

  body.customer-site .header-user-card {
    max-width: min(11.5rem, 46vw);
    padding: 4px 6px 4px 10px;
  }

  body.customer-site .header-user-card-name {
    font-size: 0.72rem;
  }

  body.customer-site .header-user-card-wallet {
    font-size: 0.66rem;
  }

  body.customer-site .header-user-card-cart {
    margin-left: 6px;
    padding: 2px 8px 2px 10px;
    min-width: 2.25rem;
  }

  body.customer-site .header-user-card-cart .cart-btn-icon {
    font-size: 0.95rem;
  }

  body.customer-site .header-user-card-cart .cart-count-badge {
    font-size: 0.65rem;
  }

  @media (max-width: 380px) {
    body.customer-site .site-header-v2 .header-logo,
    body.customer-site .site-header-v2 .header-logo-fallback {
      width: 40px;
      height: 40px;
    }

    body.customer-site .header-brand-group {
      gap: 6px;
    }

    body.customer-site .header-slogan {
      font-size: 0.74rem;
    }

    body.customer-site .header-user-card {
      max-width: min(10.5rem, 48vw);
      padding-left: 8px;
    }

    body.customer-site .header-user-card-name {
      font-size: 0.68rem;
    }

    body.customer-site .header-user-card-wallet {
      font-size: 0.62rem;
    }
  }

  .footer-grid,
  .footer-grid--balanced {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 16px;
  }

  .site-topbar-inner {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 5px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-topbar-inner::-webkit-scrollbar {
    display: none;
  }

  .site-topbar-item {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 2px 8px;
  }

  .site-topbar-item + .site-topbar-item {
    border-left: 1px solid #dde5d8;
  }

  .settings-promo-grid {
    grid-template-columns: 1fr;
  }

  .customer-page-head {
    align-items: center;
  }
}

@media (max-width: 768px) {
  .detail-grid, .cart-layout { grid-template-columns: 1fr; }
  body:not(.customer-site) .header-inner,
  body:not(.customer-site) .header-row { flex-direction: column; gap: 12px; }
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-nav a { color: var(--white); }

.cart-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.cart-btn-compact {
  padding: 8px 12px;
  font-size: 0.85rem;
  min-width: 44px;
  justify-content: center;
}

.cart-btn-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff;
  color: var(--green);
  line-height: 1;
}

.cart-count-badge.is-empty {
  opacity: 0.65;
}

.cart-total-label {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.95;
}

.header-auth-btn {
  padding: 5px 8px;
  font-size: 0.74rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-user-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.header-user { color: rgba(255,255,255,0.9); font-size: 0.95rem; }

.btn-outline-light {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.85);
  color: var(--white);
}

.btn-outline-light:hover { background: rgba(255,255,255,0.15); }

.btn-auth-register {
  background: var(--white);
  color: var(--brown);
  border: none;
}

.btn-auth-register:hover { background: #f0f0f0; }

.page-main { min-height: 50vh; padding-bottom: 40px; }
.page-title { color: var(--brown-dark); margin-bottom: 16px; }

.shop-table-wrap { overflow-x: auto; margin-bottom: 32px; }

.catalog-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.shop-page .shop-catalog-scroll {
  max-height: min(560px, calc(100dvh - 280px));
  margin-bottom: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: var(--white);
}

body.shop-page .shop-catalog-scroll .shop-order-table {
  border: none;
  border-radius: 0;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
}

.catalog-scroll .shop-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
}

.catalog-scroll .shop-table thead {
  position: relative;
  z-index: 3;
}

.catalog-scroll .shop-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background-color: var(--brown);
  background-clip: padding-box;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.08);
}

body.shop-page .shop-catalog-scroll .shop-order-table thead th {
  padding-top: 11px;
  padding-bottom: 11px;
}

body.panel-body .panel-catalog-summary {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--gray-600);
}

body.panel-body .panel-catalog-pagination {
  margin-top: 12px;
  margin-bottom: 4px;
}

body.panel-body .panel-products-list .panel-table-wrap,
body.panel-body .panel-products-list .panel-data-cards,
body.panel-body .panel-products-inactive .panel-table-wrap,
body.panel-body .panel-products-inactive .panel-data-cards {
  max-height: none;
  overflow: visible;
}

body.panel-body .panel-products-list .panel-table-wrap,
body.panel-body .panel-products-inactive .panel-table-wrap {
  margin-bottom: 8px;
}

.panel-products-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-field-span-2 {
  grid-column: 1 / -1;
}

.combo-form-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}

.combo-child-row {
  display: grid;
  grid-template-columns: 1fr 5rem auto;
  gap: 8px;
  align-items: center;
}

.order-line-combo-includes {
  margin: 4px 0 8px;
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.35;
}

.product-image-field .product-image-preview {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  margin-bottom: 8px;
  background: var(--gray-100);
}

.product-image-field .product-image-preview.hidden {
  display: none;
}

.product-image-remove-label.hidden {
  display: none;
}

.panel-product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--gray-100);
}

.panel-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-products-page-actions .btn {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

body.panel-body .panel-catalog-scroll {
  max-height: min(560px, calc(100dvh - 300px));
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.panel-body .panel-catalog-scroll.panel-table-wrap {
  padding: 0 0 16px;
  overflow: auto;
}

body.panel-body .shop-table.panel-grid-table,
body.panel-body .panel-catalog-scroll.panel-table-wrap .shop-table,
body.panel-body .panel-data-table-wrap .shop-table.panel-data-table,
body.panel-body .panel-data-table-wrap .shop-table.panel-products-table,
body.panel-body .panel-table-wrap > .shop-table.panel-data-table,
body.panel-body .panel-table-wrap > .shop-table.panel-products-table,
body.panel-body .panel-table-wrap > .shop-table.panel-grid-table,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) {
  border: none;
  border-radius: 0;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  overflow: visible;
}

body.panel-body .panel-catalog-scroll.panel-table-wrap .shop-table thead {
  position: relative;
  z-index: 3;
}

body.panel-body .panel-catalog-scroll.panel-table-wrap .shop-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background-color: var(--brown);
  background-clip: padding-box;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.08);
}

body.panel-body .panel-catalog-card,
body.panel-body .panel-card.panel-data-table-wrap {
  padding: 0;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: var(--white);
}

body.panel-body .panel-data-cards.panel-catalog-scroll {
  padding-right: 4px;
}

.shop-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
}

.shop-table th {
  background: var(--brown);
  color: var(--white);
  text-align: left;
  padding: 12px 14px;
  vertical-align: middle;
  font-weight: 600;
}

.shop-table th.text-center { text-align: center; }
.shop-table th.text-right { text-align: right; }

.shop-table td {
  padding: 12px 14px;
  border-top: 1px solid #eee;
  vertical-align: middle;
  word-wrap: break-word;
}

.shop-table .col-code { width: 100px; }
.shop-table .col-phone { width: 110px; }
.shop-table .col-check { width: 44px; text-align: center; vertical-align: middle; }
.shop-table .col-qty { width: 120px; }
.shop-table .col-num { width: 90px; }
.shop-table .col-action { width: 110px; }
.shop-table .col-money { width: 120px; }
.shop-table .col-date { width: 130px; }
.shop-table .col-status { width: 120px; }

.shop-table td .qty-input {
  width: 100%;
  max-width: 100px;
  box-sizing: border-box;
}

.shop-table .table-inline-input {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.table-row-form {
  display: none;
}

.panel-data-table,
.panel-products-table,
.panel-grid-table,
.shop-order-table {
  table-layout: fixed;
  border-collapse: collapse;
}

.shop-order-table,
body.panel-body .shop-table.panel-data-table,
body.panel-body .shop-table.panel-products-table,
body.panel-body .shop-table.panel-grid-table,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) {
  border-collapse: collapse;
}

.shop-order-table col.col-name { width: 32%; }
.shop-order-table col.col-stock { width: 14%; }
.shop-order-table col.col-qty { width: 52px; }
.shop-order-table col.col-price { width: 18%; }
.shop-order-table col.col-line { width: 18%; }

.shop-order-table th,
.shop-order-table td,
body.panel-body .shop-table.panel-data-table th,
body.panel-body .shop-table.panel-data-table td,
body.panel-body .shop-table.panel-products-table th,
body.panel-body .shop-table.panel-products-table td,
body.panel-body .shop-table.panel-grid-table th,
body.panel-body .shop-table.panel-grid-table td,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) th,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) td {
  text-align: center;
  vertical-align: middle;
  border: 1px solid #e0e0e0;
}

.shop-order-table thead th,
body.panel-body .shop-table.panel-data-table thead th,
body.panel-body .shop-table.panel-products-table thead th,
body.panel-body .shop-table.panel-grid-table thead th,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) thead th {
  font-size: 0.95rem;
  padding: 12px 8px;
}

.shop-order-table tbody td,
body.panel-body .shop-table.panel-data-table tbody td,
body.panel-body .shop-table.panel-products-table tbody td,
body.panel-body .shop-table.panel-grid-table tbody td,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) tbody td {
  font-size: 1rem;
  padding: 10px 8px;
}

.shop-order-table .product-name-line {
  justify-content: center;
  text-align: center;
}

body.shop-page .shop-order-table .product-name-line {
  justify-content: flex-start;
  text-align: left;
}

.shop-order-table .shop-stock-qty,
.shop-order-table .line-total {
  font-size: 1.05rem;
}

.shop-order-table .shop-qty-grid {
  display: block;
  width: 100%;
  height: 52px;
  min-height: 52px;
  max-width: none;
  margin: 0;
  padding: 0 4px;
  border: none;
  border-radius: 0;
  background: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.shop-order-table td.col-qty,
.shop-order-table th.col-qty {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 0;
}

.shop-order-table .shop-qty-grid:focus {
  outline: none;
  background: #f1f8f4;
  box-shadow: inset 0 0 0 2px var(--green);
}

.shop-order-table .shop-qty-grid::-webkit-outer-spin-button,
.shop-order-table .shop-qty-grid::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body.panel-body .shop-table.panel-data-table .qty-input,
body.panel-body .shop-table.panel-grid-table .qty-input,
body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table) .qty-input {
  width: 48px;
  max-width: 100%;
  height: 48px;
  margin: 0 auto;
  display: block;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

body.panel-body .shop-table.panel-data-table .qty-input:focus,
body.panel-body .shop-table.panel-grid-table .qty-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

body.panel-body .shop-table.panel-data-table .qty-input::-webkit-outer-spin-button,
body.panel-body .shop-table.panel-data-table .qty-input::-webkit-inner-spin-button,
body.panel-body .shop-table.panel-grid-table .qty-input::-webkit-outer-spin-button,
body.panel-body .shop-table.panel-grid-table .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.panel-products-table col.col-name { width: 26%; }
.panel-products-table col.col-money { width: 14%; }
.panel-products-table col.col-unit { width: 8%; }
.panel-products-table col.col-num { width: 10%; }
.panel-products-table col.col-link { width: 10%; }
.panel-products-table col.col-action { width: 12%; }

.panel-products-table th,
.panel-products-table td {
  padding: 10px 8px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-green { color: var(--green); font-weight: 700; }

.order-qty-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shop-qty { width: 64px; padding: 4px 4px; border: none; background: transparent; text-align: center; font-weight: 600; font-size: 0.95rem; -moz-appearance: textfield; }
.shop-qty:focus { outline: none; background: #f8faf8; }
.hint-inline { display: block; font-size: 0.75rem; color: #666; font-weight: normal; margin-top: 2px; }
.shop-qty::-webkit-outer-spin-button,
.shop-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  color: var(--brown-dark);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.qty-btn:hover:not(:disabled) { background: #e8e8e8; }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.unit-tag {
  display: inline;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: normal;
}

.unit-tag::before {
  content: '·';
  margin: 0 4px;
  color: #bbb;
}

.col-name .product-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 2px;
  line-height: 1.35;
}

.col-name .product-title {
  font-weight: inherit;
}

.col-name .product-qty-hint {
  font-size: 0.68rem;
  color: #888;
  font-weight: normal;
  white-space: nowrap;
}

.col-name .product-qty-hint::before {
  content: '·';
  margin: 0 4px;
  color: #bbb;
}

.shop-price-inline { display: none; }

.th-label-short { display: none; }
.th-label-long { display: inline; }

.shop-summary {
  background: var(--gray-100);
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.shop-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.shop-grand-total strong {
  color: var(--green);
  font-size: 1.25rem;
}

.shop-action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shop-action-btns-single {
  grid-template-columns: 1fr;
}

.shop-btn-label-short { display: none; }
.shop-btn-label-long { display: inline; }

.shop-checkout-bar {
  display: block;
}

.shop-checkout-bar--desktop {
  display: none;
}

.shop-btn {
  padding: 12px 10px;
  font-size: 0.95rem;
  border-radius: 10px;
}

.shop-order-table .col-name { min-width: 72px; }

body.shop-page .site-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
}

body.shop-page .header-row {
  padding: 10px 0;
}

body.shop-page .brand-badge {
  width: 36px;
  height: 36px;
  font-size: 0.7rem;
}

body.shop-page .brand strong { font-size: 0.95rem; }
body.shop-page .brand em { font-size: 0.72rem; }
body.shop-page .page-title { font-size: 1.05rem; margin-bottom: 8px; }
body.shop-page .page-main { padding-bottom: 16px; }
body.shop-page .shop-alert { padding: 8px 12px; margin-bottom: 8px; font-size: 0.85rem; }
body.shop-page .container { padding-left: 10px; padding-right: 10px; }

body.shop-page .shop-table-wrap {
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.shop-page .shop-catalog-scroll {
  overflow-x: auto;
  overflow-y: auto;
}

body.shop-page .shop-order-table th,
body.shop-page .shop-order-table td {
  padding: 10px 8px;
  font-size: 1.05rem;
  vertical-align: middle;
  color: var(--brown-dark);
}

body.shop-page .shop-order-table td.col-name {
  vertical-align: middle;
  text-align: left;
  width: auto;
  min-width: 5rem;
}

body.shop-page .shop-order-table th.col-name {
  width: auto;
}

body.shop-page .shop-order-table th.col-stock,
body.shop-page .shop-order-table td.col-stock,
body.shop-page .shop-order-table th.col-price,
body.shop-page .shop-order-table td.col-price,
body.shop-page .shop-order-table th.col-line,
body.shop-page .shop-order-table td.col-line {
  width: 1%;
  white-space: nowrap;
}

body.shop-page .shop-order-table th.col-qty,
body.shop-page .shop-order-table td.col-qty {
  width: 52px;
  min-width: 44px;
  max-width: 56px;
  white-space: nowrap;
}

body.shop-page .shop-order-table {
  table-layout: auto;
  width: 100%;
}

body.shop-page .shop-order-table col.col-name { width: auto; }
body.shop-page .shop-order-table col.col-stock { width: 1%; }
body.shop-page .shop-order-table col.col-qty { width: 52px; }
body.shop-page .shop-order-table col.col-price { width: 1%; }
body.shop-page .shop-order-table col.col-line { width: 1%; }

body.shop-page .shop-order-table td.col-qty {
  padding: 0;
}

body.shop-page .shop-order-table th {
  font-size: 1rem;
  white-space: nowrap;
  color: var(--white);
}

body.shop-page .shop-order-table .product-name-line--shop {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  text-align: left;
  min-width: 0;
  line-height: 1.3;
}

body.shop-page .shop-order-table .product-name-line--shop.product-name-line--multiline-pack {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 2px;
}

body.shop-page .shop-order-table .product-name-line--shop .product-title {
  display: inline;
  white-space: nowrap;
  overflow: visible;
  font-weight: 600;
  color: var(--brown-dark);
  flex: 0 1 auto;
}

body.shop-page .shop-order-table .product-name-line--shop.product-name-line--multiline-pack .product-title {
  display: block;
  width: 100%;
}

body.shop-page .shop-order-table .product-name-line--shop .product-title a {
  color: inherit;
  white-space: nowrap;
}

body.shop-page .shop-order-table .shop-pack-tag {
  font-size: 0.82em;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--brown);
}

body.shop-page .shop-order-table .product-name-line--shop.product-name-line--multiline-pack .shop-pack-tag {
  display: block;
}

body.shop-page .shop-order-table .shop-pack-tag::before {
  display: none;
}

body.shop-page .shop-order-table .line-total {
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

body.shop-page .shop-order-table th.col-line .th-currency-unit {
  font-size: 0.82em;
  font-weight: 600;
  opacity: 0.92;
}

body.shop-page .shop-checkout-row td.shop-checkout-cell {
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  background: linear-gradient(135deg, var(--brown-soft) 0%, var(--green-soft) 100%);
  border-bottom: 2px solid var(--brown);
}

body.shop-page .shop-checkout-row td.shop-checkout-cell--spacer {
  padding-left: 4px;
  padding-right: 4px;
}

body.shop-page .shop-checkout-row .shop-checkout-total-cell {
  text-align: center;
}

body.shop-page .shop-checkout-row .shop-grand-total {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 0;
  justify-content: center;
}

body.shop-page .shop-checkout-row .shop-action-btns {
  width: auto;
}

body.shop-page .shop-order-table .shop-stock-qty {
  color: var(--green);
}

body.shop-page .shop-order-table .shop-stock-qty--out {
  color: #b71c1c;
}

body.shop-page .shop-row-out-of-stock td {
  opacity: 0.72;
}

body.shop-page .shop-row-out-of-stock .shop-qty:disabled {
  cursor: not-allowed;
  background: #f0f0f0;
}

/* Bảng đặt hàng: header nâu, nền bảng xanh lá */
body.shop-page .shop-catalog-scroll {
  border-color: #a5d6a7;
  background: var(--green-soft);
}

body.shop-page .shop-order-table thead th {
  background-color: var(--brown);
  color: var(--white);
}

body.shop-page .shop-order-table tbody td {
  background: var(--green-soft);
}

body.shop-page .shop-order-table tbody tr:nth-child(even) td {
  background: #e3f2e5;
}

body.shop-page .shop-order-table tbody td.col-qty .shop-qty-grid {
  background: var(--white);
}

body.shop-page .shop-summary {
  background: linear-gradient(135deg, var(--brown-soft) 0%, var(--green-soft) 100%);
  border: 1px solid var(--surface-border);
  border-left: 4px solid var(--green);
}

body.shop-page .shop-grand-total strong {
  color: var(--green);
  font-weight: 800;
}

body.shop-page .page-title {
  color: var(--brown-dark);
  border-left: 4px solid var(--green);
  padding-left: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Shop catalog — toolbar, category chips, product cards */
.shop-catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.shop-search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shop-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 0 14px;
  min-height: 42px;
}

.shop-search-icon {
  color: var(--gray-600);
  font-size: 1.1rem;
  line-height: 1;
}

.shop-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  min-width: 0;
  padding: 8px 0;
}

.shop-search-input:focus {
  outline: none;
}

.shop-search-clear {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 1rem;
  padding: 4px 8px;
}

.shop-filter-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}

.shop-category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.shop-category-nav::-webkit-scrollbar {
  display: none;
}

.shop-category-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: var(--white);
  color: var(--brown-dark);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.shop-category-chip:hover {
  border-color: var(--green);
  color: var(--green);
}

.shop-category-chip.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.shop-catalog-main {
  margin-bottom: 16px;
}

.shop-card-order .shop-buy-now-btn {
  margin-top: 8px;
}

.shop-product-detail-actions {
  margin-top: 12px;
}

.shop-product-detail-actions .shop-buy-now-btn {
  width: 100%;
}

.shop-catalog-page .shop-catalog-main {
  margin-bottom: 8px;
}

.shop-catalog-compact--desktop {
  display: none;
}

.shop-combo-desktop-grid {
  margin-top: 16px;
}

@media (min-width: 769px) {
  .shop-catalog-page .shop-catalog-grid--mobile {
    display: block;
  }

  .shop-catalog-page .shop-catalog-compact--desktop {
    display: none;
  }

  .shop-combo-desktop-grid .shop-product-card--interactive .shop-card-cover-link {
    display: none;
  }

  .shop-combo-desktop-grid .shop-product-card--interactive .shop-card-title a,
  .shop-combo-desktop-grid .shop-product-card--interactive .shop-card-media-link {
    pointer-events: auto;
  }

  /* Catalog: hiện SL + Đặt ngay trên card (giống mobile), không phủ cover-link */
  .shop-catalog-page .shop-card-order--mobile {
    display: block;
  }

  .shop-catalog-page .shop-product-card--interactive .shop-card-cover-link {
    display: none;
  }

  .shop-catalog-page .shop-product-card--interactive .shop-card-title a,
  .shop-catalog-page .shop-product-card--interactive .shop-card-media-link {
    pointer-events: auto;
  }

  .shop-catalog-page .shop-product-card--interactive {
    cursor: default;
  }
}

.shop-category-section {
  margin-bottom: 24px;
}

.shop-category-heading {
  font-size: 1.05rem;
  color: var(--brown-dark);
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--green);
}

.shop-catalog-section {
  margin-bottom: 28px;
}

.shop-catalog-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.shop-catalog-section-title {
  font-size: 1.05rem;
  color: var(--brown-dark);
  margin: 0;
  padding-left: 10px;
  border-left: 3px solid var(--green);
  min-width: 0;
}

.shop-catalog-section-more {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}

.shop-catalog-section-more:hover {
  text-decoration: underline;
}

.shop-product-grid--section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shop-product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.shop-product-card--out {
  opacity: 0.72;
}

.shop-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.shop-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.shop-card-badge--combo {
  background: var(--brown);
  color: var(--white);
}

.shop-card-badge--bestseller {
  background: var(--brown);
  color: var(--white);
}

.shop-card-badge--out {
  background: #666;
  color: var(--white);
}

.shop-card-stock {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
}

.shop-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  flex: 1;
}

.shop-card-title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--brown-dark);
}

.shop-card-title a {
  color: inherit;
  text-decoration: none;
}

.shop-card-pack {
  margin: 0;
  font-size: 0.78rem;
  color: var(--brown);
  font-weight: 600;
}

.shop-card-desc,
.shop-card-includes {
  margin: 0;
  font-size: 0.76rem;
  color: var(--gray-600);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-card-includes {
  -webkit-line-clamp: 3;
}

.shop-card-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.shop-card-price {
  font-size: 1rem;
  color: var(--green);
}

.shop-card-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.shop-card-qty-label {
  font-size: 0.78rem;
  color: var(--gray-600);
}

.shop-card-qty {
  width: 4.5rem;
  text-align: center;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
}

.shop-card-line-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px dashed #e0e0e0;
  font-size: 0.85rem;
}

.shop-card-line-label {
  color: var(--gray-600);
}

.shop-product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.shop-product-card-link:hover .shop-product-card,
.shop-product-card-link:focus-visible .shop-product-card {
  border-color: var(--green);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.shop-product-card-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.shop-product-card--interactive {
  position: relative;
}

.shop-card-cover-link {
  display: none;
}

.shop-card-media-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.shop-card-top {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shop-card-order--mobile {
  padding: 0 10px 10px;
  overflow: visible;
}

.shop-card-order--mobile .shop-card-qty-row {
  flex-wrap: wrap;
  gap: 6px;
}

.shop-card-order--mobile .shop-qty-stepper {
  overflow: visible;
  border-radius: 8px;
  flex-shrink: 0;
}

.shop-card-order--mobile .shop-qty-step-btn {
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
  line-height: 1;
}

.shop-card-order--mobile .shop-qty-stepper-input {
  width: 2.25rem;
  min-width: 2rem;
  padding: 4px 2px;
  font-size: 0.85rem;
}

.shop-product-grid--home .shop-card-order--mobile .shop-qty-step-btn {
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .shop-product-card--interactive {
    overflow: visible;
  }

  .shop-card-line-total {
    font-size: 0.82rem;
  }

  .shop-card-line-total strong {
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

.shop-mini-cart {
  margin: 0 0 8px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.shop-mini-cart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e8dfd2;
  margin-bottom: 8px;
}

.shop-mini-cart-title {
  font-size: 0.88rem;
  color: var(--brown-dark);
}

.shop-mini-cart-toggle-show {
  display: none;
}

.shop-mini-cart-drawer {
  margin: 0 0 8px;
}

.shop-mini-cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(40vh, 260px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e8dfd2;
  border-radius: 10px;
  background: #fafaf8;
}

.shop-summary.is-cart-collapsed .shop-mini-cart-toolbar,
.shop-summary.is-cart-collapsed .shop-mini-cart-drawer,
.shop-summary.is-cart-collapsed .shop-mini-cart-title,
.shop-summary.is-cart-collapsed .shop-mini-cart-toggle-hide,
.shop-summary.is-cart-collapsed .shop-mini-cart-toggle-show {
  display: none !important;
}

.shop-summary.is-cart-collapsed .shop-address-compact,
.shop-summary.is-cart-collapsed #shop-wallet-bar,
.shop-summary.is-cart-collapsed .shop-action-btns {
  display: none !important;
}

.shop-summary.is-cart-expanded .shop-mini-cart-toggle-show {
  display: none;
}

.shop-summary.is-cart-expanded .shop-mini-cart-toolbar {
  display: flex;
}

.shop-summary.is-cart-expanded .shop-mini-cart-drawer {
  display: block;
}

.shop-product-detail-order {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
}

.shop-product-detail-actions {
  margin-top: 4px;
}

.shop-product-detail-actions--desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .shop-product-detail-actions--desktop-only {
    display: block;
  }

  .shop-product-detail-actions .shop-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
  }

  .shop-product-detail-actions .shop-btn {
    width: 100%;
    min-height: 44px;
  }

  body.shop-page.shop-product-detail-page .shop-order-layout--detail .shop-checkout-bar--desktop {
    display: none;
  }
}

.shop-mini-cart-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid #e8e8e8;
}

.shop-mini-cart-row:last-child {
  border-bottom: none;
}

.shop-mini-cart-thumb {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-100);
}

.shop-mini-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-mini-cart-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.shop-mini-cart-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-dark);
  text-decoration: none;
  line-height: 1.3;
}

.shop-mini-cart-unit {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.shop-mini-cart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.shop-mini-cart-actions .shop-qty-stepper {
  flex-shrink: 0;
}

.shop-mini-cart-actions .shop-qty-step-btn {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

.shop-mini-cart-actions .shop-qty-stepper-input {
  width: 3rem;
  min-width: 2.5rem;
  padding: 8px 4px;
  font-size: 0.95rem;
}

.shop-mini-cart-remove {
  font-size: 0.8rem;
  color: #b45309;
}

.shop-mini-cart-line {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green);
  text-align: right;
  white-space: nowrap;
  padding-top: 4px;
}

@media (min-width: 769px) {
  .shop-product-card--interactive {
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
  }

  .shop-product-card--interactive .shop-card-cover-link {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
  }

  .shop-product-card--interactive:hover,
  .shop-product-card--interactive:focus-within {
    border-color: var(--green);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  }

  .shop-product-card--interactive .shop-card-title a,
  .shop-product-card--interactive .shop-card-media-link {
    pointer-events: none;
  }

  .shop-card-order--mobile {
    display: none;
  }

  .shop-catalog-page .shop-card-order--mobile,
  .shop-catalog-page .shop-combo-desktop-grid .shop-card-order--mobile {
    display: block;
  }

  .shop-mini-cart {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .shop-product-detail-card .shop-qty-step-btn {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }

  .shop-product-detail-card .shop-qty-stepper-input {
    width: 3rem;
    padding: 8px 4px;
    font-size: 1rem;
  }

  body.shop-page .shop-order-layout--cards .shop-summary,
  body.home-page.shop-page .shop-order-layout--home .shop-summary,
  body.shop-page.shop-product-detail-page .shop-order-layout--detail .shop-summary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.14);
    border: 1px solid var(--surface-border);
    border-bottom: none;
    max-height: min(88vh, calc(100dvh - 48px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.shop-page .shop-checkout-bar--desktop {
    display: block;
  }

  body.home-page.shop-page .shop-checkout-bar--desktop {
    display: block;
  }

  body.shop-page .shop-checkout-bar--desktop .shop-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
  }

  body.shop-page .shop-checkout-bar--desktop .shop-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.shop-page .shop-checkout-bar--desktop .shop-btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  body.shop-page .shop-address-compact {
    margin-bottom: 8px;
    font-size: 0.82rem;
  }

  body.shop-page .page-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.home-page.shop-page .page-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.shop-page.shop-cart-panel-expanded .page-main {
    padding-bottom: calc(240px + env(safe-area-inset-bottom));
  }

  body.home-page.shop-page.shop-cart-panel-expanded .page-main {
    padding-bottom: calc(240px + env(safe-area-inset-bottom));
  }

  body.shop-page.shop-product-detail-page .page-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.shop-page.shop-product-detail-page.shop-cart-panel-expanded .page-main {
    padding-bottom: calc(240px + env(safe-area-inset-bottom));
  }

  body.shop-page .shop-summary.is-cart-collapsed {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }

  body.shop-page .shop-summary.is-cart-collapsed .shop-grand-total {
    margin-bottom: 0;
    padding: 0;
    cursor: pointer;
  }

  body.shop-page .shop-action-btns .shop-btn-add-cart {
    display: none;
  }

  body.shop-page:not(.shop-has-cart-qty) .shop-action-btns [data-shop-checkout] {
    opacity: 0.55;
  }

  body.home-page.shop-page:not(.shop-has-cart-qty) .shop-action-btns [data-shop-checkout] {
    opacity: 0.55;
  }
}

.shop-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.shop-breadcrumb a {
  color: var(--brown);
  text-decoration: none;
}

.shop-breadcrumb a:hover {
  text-decoration: underline;
}

.shop-breadcrumb-current {
  color: var(--brown-dark);
  font-weight: 600;
}

.shop-product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.shop-product-detail-media {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 480px;
  margin: 0 auto;
  background: var(--gray-100);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
}

.shop-product-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-product-detail-badge {
  top: 12px;
  left: 12px;
}

.shop-product-detail-badge--out {
  top: auto;
  bottom: 12px;
  left: 12px;
}

.shop-product-detail-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--brown-dark);
}

.shop-product-detail-category {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--brown);
  font-weight: 600;
}

.shop-product-detail-pack {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.shop-product-detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.shop-product-detail-price {
  font-size: 1.35rem;
  color: var(--green);
}

.shop-product-detail-stock {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--green);
}

.shop-product-detail-combo-desc {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--brown-dark);
}

.shop-product-detail-desc {
  margin: 0 0 14px;
}

.shop-product-detail-desc-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--brown-dark);
}

.shop-product-detail-subheading {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--brown-dark);
}

.shop-combo-items-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-product-detail-combo-items[data-product-type="combo_month"] .shop-combo-exclude-list {
  max-height: min(40vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
}

.shop-combo-items-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: var(--gray-100);
  border-radius: 8px;
  font-size: 0.88rem;
}

.shop-combo-item-qty {
  color: var(--gray-600);
  font-weight: 600;
  white-space: nowrap;
}

.shop-combo-exclude-label,
.checkout-combo-child-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}

.shop-combo-exclude-label .shop-combo-item-name {
  flex: 1;
}

.checkout-combo-children {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkout-combo-children li {
  font-size: 0.85rem;
}

.checkout-combo-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

.shop-product-detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.shop-product-detail-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-product-detail-line-total {
  border-top: none;
  padding-top: 0;
  font-size: 1rem;
}

.shop-product-detail-stock--warn {
  color: #b45309;
}

.shop-product-detail-stock--warn strong {
  color: #92400e;
}

.shop-order-layout--detail {
  margin-bottom: 24px;
}

.shop-related-section {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid #e8e8e8;
}

.shop-related-heading {
  margin: 0 0 14px;
  font-size: 1.05rem;
  color: var(--brown-dark);
}

@media (min-width: 768px) {
  .shop-product-detail {
    grid-template-columns: minmax(280px, 42%) 1fr;
    align-items: start;
    gap: 28px;
  }

  .shop-product-detail-media {
    margin: 0;
  }

  .shop-product-detail-title {
    font-size: 1.55rem;
  }
}

.shop-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}

.shop-qty-step-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--gray-100);
  color: var(--brown-dark);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.shop-qty-step-btn:active:not(:disabled) {
  background: #e0e0e0;
}

.shop-qty-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-qty-stepper-input {
  width: 3.5rem;
  min-width: 3rem;
  text-align: center;
  border: none;
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 10px 4px;
  font-size: 1.05rem;
  font-weight: 600;
}

.shop-product-detail-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.shop-product-detail-line-total strong {
  color: var(--green);
  font-size: 1.1rem;
}

@media (min-width: 769px) {
  body.shop-page.shop-product-detail-page .shop-order-layout--detail .shop-summary {
    position: static;
    margin: 0;
  }
}

body.shop-page .shop-order-layout--cards .shop-catalog-main {
  order: 1;
}

body.shop-page .shop-order-layout--cards .shop-summary {
  order: 3;
}

@media (min-width: 768px) {
  .shop-product-grid--section {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .shop-catalog-section-title {
    font-size: 1.15rem;
  }
}

@media (min-width: 600px) {
  .shop-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .shop-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .shop-category-heading {
    font-size: 1.15rem;
  }
}

@media (min-width: 769px) {
  body.shop-page .shop-order-layout {
    display: block;
  }

  body.shop-page .shop-checkout-body--mobile {
    display: none;
  }

  body.shop-page .shop-checkout-bar--desktop {
    display: block;
  }

  body.shop-page .shop-summary {
    position: static;
    margin: 0 0 24px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: none;
    z-index: auto;
  }

  body.shop-page .shop-checkout-bar--desktop .shop-grand-total {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  body.shop-page .shop-checkout-bar--desktop .shop-action-btns {
    width: 100%;
  }

  body.shop-page .shop-address-compact {
    margin-bottom: 12px;
  }

  body.shop-page .site-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  body.shop-page .header-row {
    padding: 16px 0;
  }

  body.shop-page .brand-badge {
    width: 48px;
    height: 48px;
    font-size: 0.85rem;
  }

  body.shop-page .brand strong { font-size: 1.1rem; }
  body.shop-page .brand em { font-size: 0.8rem; }
  body.shop-page .page-title { font-size: 1.35rem; margin-bottom: 16px; }
  body.shop-page .page-main { padding-bottom: 40px; }
  body.shop-page .container { padding-left: 16px; padding-right: 16px; }

  body.shop-page .shop-catalog-scroll {
    max-height: min(560px, calc(100dvh - 280px));
    margin-bottom: 12px;
  }
}

/* Đơn của tôi: luồng khách = card mọi kích thước */
body.customer-flow-page .order-list-table {
  display: none;
}

body.customer-flow-page .order-list-cards {
  display: grid;
  gap: 12px;
}

body.customer-flow-page .order-card {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  body.customer-flow-page .order-list-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.order-list-cards { display: none; }

@media (max-width: 768px) {
  body.shop-page .shop-order-layout {
    display: flex;
    flex-direction: column;
  }

  body.shop-page.shop-product-detail-page .shop-summary--checkout-only {
    display: block;
  }

  body.shop-page .shop-order-layout .shop-catalog-main {
    order: 1;
  }

  body.shop-page .shop-order-layout .shop-table-wrap {
    order: 2;
  }

  body.shop-page .shop-order-layout--cards .shop-summary {
    order: 3;
  }

  body.shop-page .shop-catalog-scroll {
    max-height: calc(100dvh - 248px - env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.shop-page .shop-catalog-scroll .shop-checkout-row td.shop-checkout-cell {
    position: sticky;
    top: var(--shop-table-head-height, 2.65rem);
    z-index: 4;
    box-shadow: 0 2px 0 rgba(93, 64, 55, 0.15);
  }

  body.panel-body .panel-catalog-scroll {
    max-height: calc(100dvh - 240px - env(safe-area-inset-bottom));
  }

  body.panel-body .panel-catalog-scroll.panel-table-wrap {
    padding-bottom: 20px;
  }

  body.shop-page .site-footer {
    margin-top: 8px;
    padding: 12px;
    font-size: 0.8rem;
  }

  body.shop-page .shop-summary:empty {
    display: none;
    margin: 0;
    padding: 0;
    border: none;
  }

  body.shop-page .shop-checkout-row .shop-grand-total-label {
    display: none;
  }

  body.shop-page .shop-checkout-row .shop-action-btns {
    flex-shrink: 0;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  body.shop-page .shop-checkout-row .shop-btn {
    padding: 8px 10px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  body.shop-page .shop-btn-label-long { display: none; }
  body.shop-page .shop-btn-label-short { display: inline; }

  body.shop-page.shop-address-open #shop-address-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 95;
    max-height: min(70vh, calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    overflow-y: auto;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }

  body.shop-page.product-filters-open .shop-summary {
    visibility: hidden;
    pointer-events: none;
  }

  body.shop-page.product-filters-open .shop-checkout-row {
    visibility: hidden;
    pointer-events: none;
  }

  body.shop-page #product-filters-panel.is-open {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .nav-short { display: inline; }
  .header-nav .nav-long { display: none; }
  .header-nav { gap: 8px; font-size: 0.85rem; }
  .header-user { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .order-list-head-actions .btn { flex-shrink: 0; }

  .order-list-table { display: none; }
  .order-list-cards { display: block; }

  .track-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .account-section .form-grid,
  .account-form { grid-template-columns: 1fr; }
  .address-card { padding: 12px; }

  body.shop-page .shop-grand-total strong {
    font-size: 1.15rem;
  }

  body.shop-page .shop-btn {
    padding: 10px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  body.shop-page .shop-order-table th {
    white-space: nowrap;
    line-height: 1.25;
    padding: 10px 6px;
    font-size: 1.2rem;
  }

  body.shop-page .shop-order-table th.col-name {
    white-space: nowrap;
  }

  body.shop-page .shop-order-table td {
    padding: 10px 6px;
    font-size: 1.28rem;
  }

  body.shop-page .shop-order-table td.col-qty {
    padding: 0;
    aspect-ratio: 1;
    vertical-align: middle;
    width: 48px;
    min-width: 44px;
    max-width: 52px;
  }

  body.shop-page .shop-order-table th.col-qty {
    width: 48px;
    min-width: 44px;
    max-width: 52px;
  }

  body.shop-page .shop-order-table .col-line,
  body.shop-page .shop-order-table .shop-stock-qty,
  body.shop-page .shop-order-table td.col-line,
  body.shop-page .shop-order-table td.col-stock {
    font-size: 1.35rem;
    white-space: nowrap;
    width: 1%;
  }

  body.shop-page .th-label-long { display: none; }
  body.shop-page .th-label-short { display: inline; }

  body.shop-page .shop-price-inline {
    display: none;
  }

  body.shop-page .col-price {
    display: none;
  }

  body.shop-page .shop-order-table col.col-price { width: 0; }
  body.shop-page .shop-order-table col.col-name { width: auto; }
  body.shop-page .shop-order-table col.col-stock { width: 1%; }
  body.shop-page .shop-order-table col.col-qty { width: 48px; }
  body.shop-page .shop-order-table col.col-line { width: 1%; }

  body.shop-page .shop-order-table td.col-line {
    background: #d4e2d6 !important;
    color: rgba(93, 46, 12, 0.72);
  }

  body.shop-page .shop-order-table tbody tr:nth-child(even) td.col-line {
    background: #c5d4c7 !important;
  }

  body.shop-page .shop-order-table td.col-line.line-total,
  body.shop-page .shop-order-table td.col-line .shop-money {
    color: rgba(46, 125, 50, 0.72);
    font-weight: 600;
  }

  body.shop-page .shop-checkout-row td.col-line.shop-checkout-cell {
    background: linear-gradient(135deg, #e5d9c8, #d4e2d6) !important;
  }

  body.shop-page .shop-order-table td.col-name,
  body.shop-page .shop-order-table th.col-name {
    width: auto;
    min-width: max-content;
  }

  body.shop-page .shop-order-table .shop-qty-grid {
    width: 100%;
    height: 100%;
    min-height: 44px;
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  body.shop-page .cart-btn-compact {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

.btn-brown { background: var(--brown); color: var(--white); }
.btn-danger { background: #c62828; color: var(--white); }
.btn-block { width: 100%; display: block; }

.alert-info { background: #e3f2fd; color: #1565c0; }
.alert-warn { background: #fff3e0; color: #e65100; }
.alert-dispute { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.row-mismatch { background: #fff3e0; }
.row-mismatch td { font-weight: 600; }
.order-card-mismatch { background: #fff3e0; border-color: #ffe082; }
.row-low-stock { background: #fff8e1; }
.row-sub td { border-top: none; padding-top: 0; font-size: 0.82rem; }
.log-meta { font-size: 0.82rem; margin-top: 6px; }
.log-meta-json { background: #f5f5f5; padding: 8px; border-radius: 6px; overflow-x: auto; font-size: 0.75rem; max-width: 360px; }
.panel-inventory-low { border-color: #ffe082; }
.cancel-reason { margin-top: -8px; margin-bottom: 16px; color: #c62828; }

.actions-row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 92vw);
  height: 100vh;
  background: var(--white);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--brown);
  color: var(--white);
}

.cart-drawer-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.cart-drawer-close:active {
  background: rgba(255, 255, 255, 0.22);
}

.cart-drawer-close-icon {
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
  margin-right: 2px;
}

.cart-drawer-title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.cart-drawer-clear {
  flex-shrink: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

.cart-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.cart-select-all-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.cart-drawer-header .btn-link { color: rgba(255, 255, 255, 0.88); }

.cart-btn--open {
  background: var(--brown);
}

.cart-btn--open .cart-btn-icon {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.cart-btn--open .cart-count-badge {
  display: none;
}

.cart-btn--open .cart-total-label {
  display: none;
}

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }

.cart-drawer-footer {
  padding: 16px;
  border-top: 1px solid #eee;
  background: var(--gray-100);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.cart-line {
  display: grid;
  grid-template-columns: auto 56px 1fr auto;
  gap: 10px 8px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  align-items: start;
}

.cart-line-select-wrap {
  display: flex;
  align-items: flex-start;
  padding-top: 18px;
  cursor: pointer;
}

.cart-line-select {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.cart-line-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--gray-100);
  grid-row: 1 / 3;
  grid-column: 2;
}

.cart-line-img--placeholder {
  display: block;
}

.cart-line-main {
  display: contents;
}

.cart-line-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cart-line-actions { display: flex; align-items: center; gap: 8px; }
.cart-line-total { grid-column: 2 / -1; text-align: right; color: var(--green); font-weight: 600; }
.cart-empty { text-align: center; color: var(--gray-600); padding: 24px; }

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
}
.app-loading.hidden {
  display: none !important;
}
body.app-loading-active {
  overflow: hidden;
}
.app-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid #e8e8e8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
}
.app-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e8e8e8;
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: app-loading-spin 0.75s linear infinite;
}
.app-loading-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brown);
}
@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}
.btn.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.hidden { display: none !important; }

.cart-toast {
  position: fixed;
  z-index: 1100;
  background: var(--green);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-size: 0.9rem;
}

.cart-toast::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 24px;
  border: 6px solid transparent;
  border-bottom-color: var(--green);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden { display: none !important; }

.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  width: min(420px, 100%);
  position: relative;
}

.modal-box-wide {
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
}

.modal-box-narrow {
  width: min(400px, 100%);
}

.modal-title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  color: var(--brown-dark);
}

.product-modal-form { margin-bottom: 0; }

.product-form-pack-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  grid-column: 1 / -1;
}
.product-form-hint { margin: 0; grid-column: 1 / -1; }
.modal-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  margin-top: 4px;
}
body.modal-open { overflow: hidden; }

body.panel-body .product-modal-form input:not([type="checkbox"]):not([type="radio"]),
body.panel-body .product-modal-form select {
  width: 100%;
}

.product-modal-form fieldset.form-field {
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: 10px;
  padding: 10px 12px 12px;
  margin: 0 0 10px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-modal-form fieldset.form-field > legend {
  padding: 0 4px;
  font-size: 0.82rem;
  color: var(--gray-600);
  font-weight: 600;
}

.product-modal-form fieldset.form-field .radio-label {
  width: 100%;
}

#combo-month-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--gray-200, #e5e5e5);
  border-radius: 10px;
  background: var(--gray-50, #fafafa);
  margin-bottom: 10px;
}

#combo-month-fields > .form-field {
  margin-bottom: 0;
}

#combo-month-fields > .hint {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 560px) {
  #combo-month-fields {
    grid-template-columns: 1fr;
  }
}

.modal-tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.modal-tabs .tab {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  background: var(--gray-100);
  cursor: pointer;
  border-radius: 8px;
}

.modal-tabs .tab.active {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.modal-form { display: flex; flex-direction: column; gap: 10px; }

.auth-form-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 8px;
}

.auth-form-error.hidden {
  display: none;
}

.auth-form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 2px 0 4px;
}

.auth-form-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: #555;
  cursor: pointer;
  user-select: none;
}

.auth-form-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brown);
}

.telegram-notify-block .telegram-notify-types {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
}

.telegram-notify-block .telegram-notify-types legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 4px;
}

.telegram-notify-block .telegram-notify-types .checkbox-label {
  margin-bottom: 6px;
}

.telegram-notify-block .telegram-link-code code {
  font-size: 1rem;
  background: var(--green-soft);
  padding: 2px 8px;
  border-radius: 4px;
}

.telegram-notify-actions {
  margin-top: 8px;
}

.telegram-link-form {
  margin-top: 10px;
}

.notify-settings-block .notify-channel {
  margin-bottom: 16px;
}

.notify-settings-block .notify-channel-title {
  font-size: 0.95rem;
  margin: 0 0 8px;
  color: var(--brown-dark);
}

.notify-steps {
  margin: 0 0 12px;
  padding-left: 20px;
}

.notify-steps li {
  margin-bottom: 8px;
}

.notify-step-active {
  font-weight: 600;
}

.notify-ext-link {
  display: inline-block;
  margin-left: 8px;
  margin-top: 4px;
  vertical-align: middle;
}

.notify-types-wrap {
  margin: 12px 0;
}

.notify-types-toggle {
  display: none;
}

.notify-types-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 88;
}

.notify-types-backdrop.hidden {
  display: none !important;
}

.notify-types-fieldset {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0;
  max-width: 560px;
}

.notify-types-sheet-head {
  display: none;
}

.notify-types-legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 4px;
  margin-bottom: 8px;
}

.notify-types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.notify-types-grid .notify-types-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  cursor: pointer;
}

@media (min-width: 900px) {
  .notify-types-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 769px) {
  .notify-types-toggle,
  .notify-types-backdrop,
  .notify-types-sheet-head {
    display: none !important;
  }

  .notify-types-fieldset {
    display: block !important;
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    max-height: none !important;
    box-shadow: none !important;
  }
}

@media (max-width: 768px) {
  .notify-types-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
  }

  .notify-types-legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .notify-types-fieldset {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    max-width: none;
    margin: 0;
    border-radius: 12px 12px 0 0;
    max-height: min(85vh, 640px);
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
  }

  .notify-types-fieldset.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .notify-types-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .notify-types-sheet-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brown-dark);
  }

  .notify-types-grid {
    grid-template-columns: 1fr;
  }

  body.notify-types-open {
    overflow: hidden;
  }
}

.notify-settings-actions {
  margin-top: 8px;
}

.notify-all-hint {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

body.customer-site .notify-settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  margin-top: 4px;
}

body.customer-site .notify-settings-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

body.customer-site .notify-settings-form .form-field > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-dark);
}

body.customer-site .notify-settings-form input[type="text"],
body.customer-site .notify-settings-form input[type="email"],
body.customer-site .notify-settings-form input[type="tel"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: #222;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.customer-site .notify-settings-form input::placeholder {
  color: #aaa;
}

body.customer-site .notify-settings-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

body.customer-site .notify-settings-form .checkbox-label {
  font-size: 0.92rem;
  margin: 2px 0;
}

.modal-form input:not([type="checkbox"]):not([type="radio"]),
.modal-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.panel-body { background: var(--green-soft); }

.farm-dashboard-mobile { display: none; }
.panel-layout { min-height: 100vh; }
.panel-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

.panel-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--brown-dark);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 80;
  flex-shrink: 0;
}

.panel-menu-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
}

.panel-topbar-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-user-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.panel-user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(200px, 42vw);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.panel-user-menu-toggle:hover,
.panel-user-menu.is-open .panel-user-menu-toggle {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.34);
}

.panel-user-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-user-menu-chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.panel-user-menu.is-open .panel-user-menu-chevron {
  transform: rotate(180deg);
}

.panel-user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  color: #333;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 120;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.panel-user-menu.is-open .panel-user-menu-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.panel-user-menu-item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  color: #333;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.12s ease;
}

.panel-user-menu-item:last-child {
  border-bottom: none;
}

.panel-user-menu-item:hover {
  background: #f5f5f5;
}

.panel-user-menu-item--danger {
  color: #c62828;
}

.panel-user-menu-item--danger:hover {
  background: #ffebee;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 90;
}

.panel-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--brown-dark);
  color: var(--white);
  padding: 20px 0;
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

body.panel-sidebar-open .panel-sidebar {
  transform: translateX(0);
}

@media (min-width: 769px) {
  body.panel-sidebar-open .panel-content {
    margin-left: 240px;
  }
}

body.panel-drawer-open {
  overflow: hidden;
}

.panel-sidebar > a {
  display: block;
  color: rgba(255,255,255,0.85);
  padding: 10px 20px;
  text-decoration: none;
}

.panel-sidebar > a:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.panel-sidebar > a.is-active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  font-weight: 600;
  border-left: 3px solid #fff;
  padding-left: 17px;
}

.panel-home {
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 16px !important;
}

.panel-brand {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 8px;
}

.panel-main { flex: 1; padding: 24px; }

.panel-main:has(.settings-page) .panel-page-header {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.panel-page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-page-title {
  font-size: 1.35rem;
  margin: 0 0 4px;
  color: var(--brown-dark);
}

.panel-page-desc {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.panel-page-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.panel-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 16px;
  margin-bottom: -2px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-tab:hover {
  color: var(--brown-dark);
}

.panel-tab.is-active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.combo-hub-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1rem;
}

.combo-hub-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: #fff;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.combo-hub-subnav-link:hover {
  color: var(--brown-dark);
  border-color: #cbd5e1;
}

.combo-hub-subnav-link.is-active {
  color: var(--green-dark, var(--green));
  border-color: var(--green);
  background: #f1f8f4;
}

.combo-month-hub-filters {
  margin-bottom: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.combo-month-hub-filters .filter-bar-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}

.combo-month-hub-filters .filter-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.combo-month-hub-table .status-badge {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .combo-month-hub-filters {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }

  .combo-month-hub-filters .filter-bar-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .combo-month-hub-filters .filter-bar-field,
  .combo-month-hub-filters .filter-bar-field-grow {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .combo-month-hub-filters .filter-bar-field input,
  .combo-month-hub-filters .filter-bar-field select {
    width: 100%;
    box-sizing: border-box;
  }

  .combo-month-hub-filters .filter-bar-actions {
    width: 100%;
    margin-top: 10px;
    justify-content: flex-start;
  }
}

.panel-tab-badge {
  position: static;
}

.panel-tab-panel:not(.is-active) {
  display: none;
}

.product-filters-toggle.is-active {
  border-color: var(--brown);
  color: var(--brown-dark);
}

.product-filters-badge {
  color: var(--green);
  font-weight: 700;
}

.customer-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.shop-page .filter-active-chips {
  margin-bottom: 12px;
}

body.shop-page #product-filters-panel.filter-sheet {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
}

.panel-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.panel-section-title {
  font-size: 1rem;
  margin: 0 0 12px;
  color: var(--brown-dark);
}

.panel-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.panel-filters { margin-bottom: 16px; }

.filter-clear-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d4c4a8;
  background: #fffaf3;
  color: var(--brown-dark);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.filter-clear-btn:hover {
  background: #fff;
  border-color: var(--brown);
  text-decoration: none;
}

.filter-clear-btn-chip {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.filter-bar-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.filter-bar-form .form-field.filter-bar-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.filter-bar-fields {
  display: flex;
  flex: 1;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: flex-end;
  min-width: 0;
}

.filter-bar-field-grow {
  flex: 1.6;
  min-width: 120px;
}

.filter-bar-field-check {
  flex: 0 0 auto;
  padding-bottom: 0;
  align-self: center;
}

.filter-bar-field span {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-600);
  margin-bottom: 3px;
  white-space: nowrap;
}

.filter-bar-form input:not([type="checkbox"]):not([type="radio"]),
.filter-bar-form select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.filter-bar-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  align-items: center;
}

.filter-bar-field-check .checkbox-label {
  margin: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

.filter-sheet {
  margin-bottom: 12px;
}

.filter-sheet-head {
  display: none;
}

.filter-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 88;
}

.filter-sheet-backdrop:not(.hidden) {
  z-index: 95;
}

.filter-sheet-backdrop.hidden { display: none !important; }

.filter-sheet-close {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--brown-dark);
  text-decoration: none;
  white-space: nowrap;
}

.filter-sheet-close:hover {
  border-color: var(--brown);
  text-decoration: none;
}

.filter-active-chips,
.order-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--surface-border);
  font-size: 0.82rem;
  color: var(--brown-dark);
}

.log-filters-toggle.is-active {
  border-color: var(--green);
  color: var(--green-dark);
  background: #f1f8f4;
}
.log-filters-badge {
  color: var(--green);
  font-weight: 700;
}

.wallet-topup-filters-toggle.is-active {
  border-color: var(--green);
  color: var(--green-dark);
  background: #f1f8f4;
}
.wallet-topup-filters-badge {
  color: var(--green);
  font-weight: 700;
}

@media (min-width: 769px) {
  .product-filters-toggle,
  .order-filters-toggle,
  .user-filters-toggle,
  .log-filters-toggle,
  .wallet-topup-filters-toggle,
  .filter-sheet-backdrop,
  .filter-sheet-head {
    display: none !important;
  }

  .filter-bar-actions .filter-apply-btn {
    display: none !important;
  }

  .filter-bar-actions:not(:has(.filter-clear-btn)) {
    display: none !important;
  }

  #product-filters-panel,
  #order-filters-panel,
  #user-filters-panel,
  #log-filters-panel,
  #wallet-topup-filters-panel {
    display: block !important;
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-height: none !important;
    margin-bottom: 12px;
    padding: 10px 14px;
    box-shadow: none;
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .product-filters-toggle,
  .order-filters-toggle,
  .user-filters-toggle,
  .log-filters-toggle,
  .wallet-topup-filters-toggle {
    flex-shrink: 0;
  }

  #product-filters-panel:not(.is-open),
  #order-filters-panel:not(.is-open),
  #user-filters-panel:not(.is-open),
  #log-filters-panel:not(.is-open),
  #wallet-topup-filters-panel:not(.is-open) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #product-filters-panel.is-open,
  #order-filters-panel.is-open,
  #user-filters-panel.is-open,
  #log-filters-panel.is-open,
  #wallet-topup-filters-panel.is-open {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    margin: 0;
    border-radius: 12px 12px 0 0;
    max-height: min(85vh, 640px);
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }

  .filter-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .filter-sheet-title {
    margin: 0;
    font-size: 1rem;
    color: var(--brown-dark);
  }

  .filter-bar-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar-fields {
    flex-direction: column;
    align-items: stretch;
  }

  body.product-filters-open,
  body.order-filters-open,
  body.user-filters-open,
  body.log-filters-open,
  body.wallet-topup-filters-open {
    overflow: hidden;
  }
}

.shop-filter-empty {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--cream);
  border-radius: var(--radius);
}

body.shop-page .product-filters {
  margin-bottom: 16px;
}

.panel-empty {
  text-align: center;
  padding: 32px 16px;
}

.panel-empty p { margin-bottom: 12px; color: var(--gray-600); }

.settings-form {
  margin-bottom: 24px;
}

.settings-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.settings-page.is-index .settings-detail {
  display: none !important;
}

.settings-page.is-detail .settings-index {
  display: none;
}

.settings-page.is-detail .settings-section {
  display: none;
}

.settings-page.is-detail .settings-content-wrap,
.settings-page.is-detail .settings-notify-wrap {
  display: none;
}

.settings-page.is-detail.is-section-site .settings-section[data-settings-section="site"],
.settings-page.is-detail.is-section-top-promo .settings-section[data-settings-section="top-promo"],
.settings-page.is-detail.is-section-footer .settings-section[data-settings-section="footer"],
.settings-page.is-detail.is-section-operations .settings-section[data-settings-section="operations"],
.settings-page.is-detail.is-section-notifications .settings-section[data-settings-section="notifications"],
.settings-page.is-detail.is-section-notifications .settings-notify-wrap {
  display: block;
}

.settings-page.is-detail.is-section-content .settings-content-wrap {
  display: block;
}

.settings-page.is-detail.is-section-content .settings-content-wrap .settings-section {
  display: block;
}

.settings-page.is-detail.is-section-content .settings-form {
  display: none !important;
}

.settings-page.is-detail:not(.is-section-notifications) .settings-notify-wrap {
  display: none !important;
}

.settings-page.is-detail.is-section-notifications .settings-notify-wrap {
  display: block;
  margin-top: 0;
}

.settings-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

@media (min-width: 900px) {
  .settings-index {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.settings-index-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #faf8f5 100%);
  color: var(--brown-dark);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-index-card:hover,
.settings-index-card:focus-visible {
  border-color: var(--green);
  box-shadow: 0 2px 10px rgba(46, 125, 50, 0.12);
  outline: none;
}

.settings-index-card strong {
  font-size: 1rem;
  line-height: 1.3;
}

.settings-index-card span {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.settings-section-toolbar {
  margin-bottom: 12px;
}

.settings-sections-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-notifications-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.settings-notifications-toolbar .settings-notifications-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
  width: 100%;
}

.settings-notify-personal {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e5dfd6;
}

.settings-notify-personal .notify-settings-block {
  margin-bottom: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.settings-form-panel,
.settings-notify-wrap,
.settings-content-wrap {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.settings-section--content {
  display: block;
}

.settings-content-wrap .content-page-editor {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e5dfd6;
}

.settings-content-wrap .content-page-editor:first-of-type {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
}

.settings-layout-main,
.settings-layout-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.settings-layout-side {
  position: sticky;
  top: 56px;
}

.settings-section.panel-card {
  margin-bottom: 0;
}

.settings-section .panel-section-title {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ece8e2;
}

.settings-section-desc {
  margin: 10px 0 14px;
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.45;
}

.settings-site-fields {
  margin-top: 14px;
}

.settings-logo-panel {
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
  gap: 16px 24px;
  align-items: start;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #ece8e2;
}

.settings-fields-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.settings-fields-row .form-field-wide {
  grid-column: 1 / -1;
}

.settings-logo-panel-label,
.settings-logo-library-title {
  display: block;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-dark);
}

.settings-logo-current {
  padding: 14px;
  background: #faf8f5;
  border: 1px solid #ece4d8;
  border-radius: 10px;
}

.settings-logo-empty {
  margin: 0;
  line-height: 1.45;
}

.settings-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #e5dfd6;
}

.settings-subsection-title {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brown-dark);
}

.settings-checkbox-block {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 4px 0 10px;
  line-height: 1.45;
  cursor: pointer;
}

.settings-checkbox-block input[type="checkbox"] {
  margin-top: 0.2em;
}

/* Nhóm label + input + chú thích — tránh lẫn với field kế */
.settings-field-block {
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid #ebe6df;
}

.settings-field-block:last-of-type,
.settings-field-block + .settings-field-hint--footer {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-field-block .form-field {
  margin-bottom: 0;
}

.settings-field-block .settings-checkbox-block {
  margin: 0;
}

.settings-field-hint {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #6b6560;
  background: #f7f5f1;
  border-radius: 8px;
  border-left: 3px solid #c8bfb2;
}

.settings-field-hint--footer {
  margin-top: 4px;
  margin-bottom: 0;
}

.settings-section[data-settings-section="operations"] .form-field > span {
  font-weight: 600;
  color: var(--brown-dark, #3d3429);
  font-size: 0.88rem;
}

.settings-actions {
  text-align: center;
  padding: 18px 16px;
}

.settings-actions .btn {
  width: 100%;
  justify-content: center;
}

.settings-promo-block .form-field {
  margin-bottom: 8px;
}

.settings-promo-block .settings-icon-field {
  margin-bottom: 0;
}

@media (max-width: 1100px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-layout-side {
    position: static;
  }

  .settings-index {
    grid-template-columns: 1fr;
  }

  .settings-logo-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .settings-fields-row,
  .settings-promo-grid {
    grid-template-columns: 1fr;
  }
}

.settings-logo-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.settings-logo-preview img {
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--surface-border);
  padding: 6px;
}
.settings-avatar-preview-img {
  border-radius: 50%;
  object-fit: cover;
  padding: 0;
}
.settings-avatar-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.settings-banner-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.settings-banner-preview-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
}
.settings-hero-video-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.settings-video-preview {
  width: 100%;
}
.settings-video-thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: #111;
  object-fit: contain;
}
.settings-video-url-hint {
  word-break: break-all;
  text-align: center;
}
.settings-logo-actions .form-field input[type="file"].full-input {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 10px;
  font-size: 0.88rem;
}
.settings-logo-preview-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.settings-logo-delete-btn {
  color: #b71c1c;
  border-color: #e8b4b4;
}
.settings-logo-delete-btn:hover {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #b71c1c;
}
.settings-logo-upload { margin-bottom: 0; }

.settings-logo-library {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e5dfd6;
}

.settings-logo-library-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-logo-pick {
  display: block;
  position: relative;
  width: 64px;
  height: 64px;
  border: 2px solid #e0d8cc;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-logo-pick:hover {
  border-color: var(--green);
}

.settings-logo-pick.is-current,
.settings-logo-pick:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.settings-logo-pick input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.settings-logo-pick img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
}

.settings-logo-library-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  line-height: 1;
  font-size: 0.7rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
}

.panel-data-cards { display: none; }

.panel-order-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.panel-inventory-card .panel-inventory-name {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.panel-inventory-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.panel-product-card .panel-product-name {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  color: var(--brown-dark);
  word-break: break-word;
}

.panel-product-card .product-dup-badge {
  margin-bottom: 8px;
}

.panel-product-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.panel-product-extra {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--gray-600);
  word-break: break-word;
}

.panel-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.panel-product-actions .btn,
.panel-product-actions form {
  flex: 1 1 calc(50% - 4px);
  min-width: 120px;
}

.panel-product-actions form .btn {
  width: 100%;
}

.panel-product-dup {
  border-color: #ffe082;
  background: #fff8e1;
}

.panel-product-inactive {
  opacity: 0.92;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.form-field span {
  font-size: 0.82rem;
  color: var(--gray-600);
}

@media (max-width: 768px) {
  .panel-data-table-wrap {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel-has-mobile-cards > .panel-data-table-wrap,
  .panel-has-mobile-cards > .panel-table-wrap,
  .panel-has-mobile-cards > .panel-card.panel-data-table-wrap,
  .panel-has-mobile-cards > .panel-card.panel-table-wrap {
    display: none !important;
  }

  .panel-order-list .panel-order-cards {
    display: none !important;
  }
  .panel-order-list > .panel-card.panel-data-table-wrap,
  .panel-order-list > .panel-card.panel-table-wrap {
    display: block !important;
  }
  .panel-order-list .panel-order-col-extra {
    display: none !important;
  }
  .panel-order-list .shop-table th,
  .panel-order-list .shop-table td {
    padding: 10px 8px;
    font-size: 0.88rem;
  }
  .panel-order-list .shop-table .col-action {
    white-space: nowrap;
  }

  .panel-has-mobile-cards > .panel-data-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }
  .panel-has-mobile-cards .panel-order-card,
  .panel-has-mobile-cards .panel-inventory-card,
  .panel-has-mobile-cards .panel-user-card,
  .panel-has-mobile-cards .panel-farm-priority-card,
  .panel-has-mobile-cards .panel-customer-card,
  .panel-has-mobile-cards .panel-settlement-card,
  .panel-has-mobile-cards .panel-reconcile-card,
  .panel-has-mobile-cards .panel-wholesale-card,
  .panel-has-mobile-cards .panel-log-card,
  .panel-has-mobile-cards .panel-report-card,
  .panel-has-mobile-cards .panel-harvest-summary-card,
  .panel-has-mobile-cards .panel-wallet-topup-card,
  .panel-has-mobile-cards .panel-bt-transit-card {
    margin-bottom: 0;
    word-break: break-word;
  }
  .panel-order-cards,
  .panel-inventory-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }
  .panel-report-cards-title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brown-dark);
  }
  .panel-log-details {
    margin-top: 6px;
    font-size: 0.85rem;
  }

  body.panel-body .shop-table.panel-data-table th,
  body.panel-body .shop-table.panel-data-table td,
  body.panel-body .shop-table.panel-products-table th,
  body.panel-body .shop-table.panel-products-table td,
  body.panel-body .shop-table.panel-grid-table th,
  body.panel-body .shop-table.panel-grid-table td,
  body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) th,
  body.panel-body .panel-table-wrap > .shop-table:not(.harvest-matrix):not(.print-slip-table):not(.harvest-split-grid) td {
    padding: 10px 6px;
    font-size: 0.85rem;
    white-space: normal;
    line-height: 1.25;
  }

  body.panel-body .shop-table.panel-data-table .qty-input,
  body.panel-body .shop-table.panel-grid-table .qty-input {
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }

  body.panel-body .panel-data-table-wrap .shop-table,
  body.panel-body .panel-table-wrap .shop-table.panel-data-table,
  body.panel-body .panel-table-wrap .shop-table.panel-products-table {
    min-width: 100%;
  }

  .panel-harvest-overview-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }
  .panel-harvest-overview-card { margin-bottom: 0; }
  .panel-harvest-overview-card .order-card-meta:last-child { margin-bottom: 0; }
  .panel-farm-priority-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }
  .panel-farm-priority-card {
    margin-bottom: 0;
    padding: 14px;
  }
  .panel-farm-priority-form .form-field { margin-bottom: 8px; }
  .panel-farm-priority-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .panel-farm-priority-field { margin-bottom: 0; }
  .panel-farm-priority-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: #faf8f5;
    border-radius: 8px;
    text-align: center;
  }
  .panel-farm-priority-stat span {
    font-size: 0.78rem;
    color: var(--gray-600);
  }
  .panel-farm-priority-stat strong {
    font-size: 1.1rem;
    color: var(--brown-dark);
  }
  .panel-farm-priority-users {
    margin: 0 0 10px;
    font-size: 0.85rem;
    word-break: break-word;
  }
  @media (max-width: 400px) {
    .panel-farm-priority-stats {
      grid-template-columns: 1fr 1fr;
    }
    .panel-farm-priority-field { grid-column: 1 / -1; }
  }
  .panel-user-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }
  .panel-user-card { margin-bottom: 0; }
  .user-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  .user-card-actions .btn,
  .user-card-actions form { flex: 1; min-width: calc(50% - 4px); }
  .user-card-actions form .btn { width: 100%; }
  .panel-products-list .panel-product-cards,
  .panel-products-inactive .panel-inactive-product-cards {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  .panel-products-list > .panel-table-wrap,
  .panel-products-inactive > .panel-table-wrap {
    display: none !important;
  }

  .panel-product-card {
    margin-bottom: 0;
  }

  .panel-page-header:has(.panel-products-page-actions) {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .panel-products-page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .panel-products-page-actions .btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 10px;
    font-size: 1rem;
    justify-content: center;
    text-align: center;
  }

  body.panel-body #product-filters-panel.is-open .filter-bar-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--surface-border);
  }

  body.panel-body #product-filters-panel.is-open .filter-bar-actions .btn-primary {
    flex: 1;
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    padding: 12px 16px;
  }
  body.panel-body .bulk-toolbar:not(.hidden) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 12px 12px 0 0;
    z-index: 85;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  body.panel-body #bulk-orders-form:has(.bulk-toolbar:not(.hidden)) {
    padding-bottom: 72px;
  }

  body.panel-body.farm-grower-dashboard .farm-dashboard-desktop {
    display: none !important;
  }

  body.panel-body.farm-grower-dashboard .farm-dashboard-mobile {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-wrap {
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.panel-body.farm-grower-dashboard .panel-page-header {
    display: none;
  }

  body.panel-body.farm-grower-dashboard .panel-main {
    padding: 4px 4px 2px;
  }

  body.panel-body.farm-grower-dashboard .harvest-backlog-banner {
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    line-height: 1.3;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-hint {
    display: none;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-complete {
    margin: 0 0 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.4;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-toolbar .btn-block {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-toolbar .btn-sm {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.88rem;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-head {
    display: grid;
    gap: 4px;
    padding: 8px 10px;
    margin-bottom: 0;
    background: var(--brown);
    color: var(--white);
    border-radius: 8px 8px 0 0;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-head--inventory {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-head--export {
    grid-template-columns: minmax(0, 1fr) repeat(4, 52px);
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-head-name {
    text-align: left;
    font-size: 0.9rem;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
    max-height: calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    border: 1px solid #a5d6a7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--green-soft);
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row {
    display: grid;
    gap: 4px;
    align-items: start;
    flex-shrink: 0;
    padding: 6px 10px;
    min-height: auto;
    background: var(--green-soft);
    border: none;
    border-bottom: 1px solid #b9ddb9;
    border-radius: 0;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row:last-child {
    border-bottom: none;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row:nth-child(even) {
    background: #e3f2e5;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row--inventory {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row--export {
    grid-template-columns: minmax(0, 1fr) repeat(4, 52px);
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-tab {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-radius: 8px;
    background: var(--gray-100);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brown);
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-tab.is-active {
    background: var(--green);
    color: var(--white);
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-tabs--single .farm-mobile-tab {
    flex: 1;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-toolbar--export {
    flex-wrap: wrap;
    gap: 6px;
  }

  body.panel-body.farm-grower-dashboard .farm-dashboard-desktop--grower-hidden {
    display: none;
  }

  .stock-inbox-time {
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 8px;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-name {
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    line-height: 1.35;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-name strong {
    font-size: 1.15rem;
    color: var(--brown-dark);
    word-break: break-word;
    flex: 1 1 auto;
    min-width: 0;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-name .unit-tag {
    font-size: 0.82rem;
    opacity: 0.9;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-cell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    padding-top: 2px;
  }

  body.panel-body.farm-grower-dashboard .farm-grid-qty {
    width: 72px;
    max-width: 72px;
    min-width: 72px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    padding: 4px;
    text-align: center;
    font-size: 1.05rem;
    border-radius: 8px;
    border: 1px solid #bdbdbd;
    background: var(--white);
    box-sizing: border-box;
    line-height: 1.2;
    -moz-appearance: textfield;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row--inventory .farm-grid-qty {
    max-width: 72px;
  }

  body.panel-body.farm-grower-dashboard .farm-grid-qty-readout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    max-width: 64px;
    min-width: 64px;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--brown-dark);
    box-sizing: border-box;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row--export .farm-grid-qty-readout,
  body.panel-body.farm-grower-dashboard .farm-mobile-grid-row--export .farm-grid-qty {
    max-width: 64px;
    min-width: 64px;
    width: 64px;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
  }

  body.panel-body.farm-grower-dashboard .farm-grid-agree-badge {
    font-size: 0.72rem;
    padding: 4px 6px;
    line-height: 1.2;
    text-align: center;
    max-width: 64px;
  }

  body.panel-body.farm-grower-dashboard .farm-grid-agree-btn {
    width: 64px;
    max-width: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 6px 4px;
    font-size: 0.82rem;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-agree-form {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  body.panel-body.farm-grower-dashboard .farm-mobile-grid-empty {
    margin: 0;
    padding: 10px 8px;
  }
}

@media (min-width: 769px) {
  .panel-data-cards { display: none !important; }
}

@media (max-width: 768px) {
  .panel-sidebar {
    width: min(280px, 85vw);
  }
  .panel-main { padding: 14px; }
  .panel-page-title { font-size: 1.15rem; }
}

@media print {
  .panel-sidebar, .panel-topbar, .panel-page-actions, .harvest-actions-row,
  .panel-overlay, .alert, .notify-enable-btn, .panel-home, .panel-user-menu,
  .no-print, .order-timeline, .panel-actions-sticky, .panel-page-header,
  .admin-farm-context-form, .admin-farm-context-banner,
  .screen-only, .harvest-split-mobile, .harvest-status-bar, .harvest-prior-list,
  #harvest-summary { display: none !important; }
  .admin-farm-context-sidebar { display: none !important; }
  .panel-main { padding: 0; }
  .panel-card:not(.print-packing-slip):not(.harvest-print-sheet):not(.print-harvest-split):not(.print-harvest-hub):not(.print-harvest-outbound):not(.invoice-page) { display: none !important; }
  .panel-card.invoice-page { display: block !important; border: none; box-shadow: none; padding: 0; }
  body.customer-site .site-header-v2,
  body.customer-site .customer-topbar,
  body.customer-site footer,
  body.customer-site .mobile-bottom-nav,
  body.customer-site .invoice-actions { display: none !important; }
  body.customer-site main { padding: 0 !important; }
  .invoice-page { max-width: none; margin: 0; }
  .panel-card, .harvest-print-sheet, .print-harvest-split, .print-harvest-hub, .print-harvest-outbound { border: 1px solid #ccc; break-inside: avoid; box-shadow: none; }
  .print-only { display: block !important; }
  body.panel-body { background: #fff; }
  .print-order-meta, .print-order-items, .order-meta { display: none !important; }
  .order-item-cards, .accept-received-cards { display: none !important; }
  #harvest-split .qty-input, #harvest-split input[type="number"] { display: none !important; }
  #harvest-split .split-ordered-hint { display: none !important; }
  #harvest-split .split-print-value { display: inline !important; }
  #harvest-split .status-badge, #harvest-split .harvest-col-badge,
  #harvest-split .harvest-col-order-actions, #harvest-split .harvest-mobile-order-actions { display: none !important; }
  .harvest-print-wrapper { display: block !important; }
  .print-packing-slip.harvest-print-target:not(.harvest-print-hidden) {
    display: block !important;
    page-break-after: always;
    break-after: page;
  }
  .print-harvest-split,
  .print-harvest-split .print-slip-table,
  .print-harvest-split .shop-table {
    background: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
  }
  .print-harvest-split h2,
  .print-harvest-split .print-slip-code,
  .print-harvest-split th,
  .print-harvest-split td,
  .print-harvest-split th strong,
  .print-harvest-split td strong,
  .print-harvest-split .harvest-customer-name,
  .print-harvest-split .unit-tag {
    background: #fff !important;
    color: #000 !important;
  }
  .print-harvest-split .hint,
  .print-harvest-split .print-split-legend {
    color: #000 !important;
  }
  .print-harvest-split .print-slip-table th,
  .print-harvest-split .print-slip-table td {
    border-top: 1px solid #000 !important;
    border-bottom: 1px solid #000 !important;
  }
  .print-split-ordered { font-size: 0.75rem; color: #000; display: block; }
  .print-split-write { display: block; min-height: 2em; min-width: 2.5em; }
  .print-split-na { color: #000; }
  .print-harvest-split .harvest-customer-name { font-weight: 700; }
  .print-harvest-split .harvest-split-product-col {
    border-right: 2px solid #000 !important;
    background: #fff !important;
  }
  .print-harvest-split .harvest-split-data-col {
    border-left: 2px solid #000 !important;
    background: #fff !important;
  }
  .print-harvest-split .harvest-split-col-alt,
  .print-harvest-split th.harvest-split-col-alt {
    background: #fff !important;
    color: #000 !important;
  }
  .print-harvest-split .harvest-split-total-col {
    border-left: 2px solid #000 !important;
    background: #fff !important;
  }
  .print-split-cell { vertical-align: top; }
  .harvest-print-hidden { display: none !important; }
  .harvest-print-target:not(.harvest-print-hidden) {
    display: block !important;
    page-break-after: always;
    break-after: page;
  }
  .harvest-print-wrapper > .harvest-print-target:not(.harvest-print-hidden):last-child {
    page-break-after: auto;
    break-after: auto;
  }
  body.b2b-ncc-page .b2b-header,
  body.b2b-ncc-page .b2b-subnav,
  body.b2b-ncc-page .b2b-alert,
  body.b2b-ncc-page .farm-dashboard-mobile,
  body.b2b-ncc-page footer {
    display: none !important;
  }
  body.b2b-ncc-page .harvest-print-wrapper {
    display: block !important;
    position: static;
  }
  body.b2b-ncc-page .harvest-print-hidden {
    display: none !important;
  }
  .print-harvest-draft-slip,
  .print-harvest-draft-slip .print-slip-table {
    background: #fff !important;
    color: #000 !important;
  }
  .print-harvest-draft-slip h2,
  .print-harvest-draft-slip .print-harvest-draft-code,
  .print-harvest-draft-slip .print-harvest-draft-customer,
  .print-harvest-draft-slip th,
  .print-harvest-draft-slip td {
    color: #000 !important;
  }
  .print-harvest-hub,
  .print-harvest-hub .print-slip-table,
  .print-harvest-outbound,
  .print-harvest-outbound .print-slip-table {
    background: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
  }
  .print-harvest-hub h2,
  .print-harvest-hub .print-slip-code,
  .print-harvest-hub th,
  .print-harvest-hub td,
  .print-harvest-outbound h2,
  .print-harvest-outbound th,
  .print-harvest-outbound td,
  .print-harvest-outbound .hint,
  .print-harvest-outbound .unit-tag {
    color: #000 !important;
    background: #fff !important;
  }
  .print-slip-signatures {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .print-slip-signature-label {
    font-weight: 700;
    margin: 0 0 4px;
    color: #000 !important;
  }
  .print-slip-signature-hint {
    font-size: 0.85rem;
    margin: 0 0 48px;
    color: #000 !important;
  }
  .print-slip-signature-line {
    border-bottom: 1px solid #000;
    min-height: 1px;
  }
}

.print-only { display: none; }

.harvest-print-hidden { display: none !important; }

.print-packing-slip {
  padding: 0;
  border: none;
  max-width: 100%;
}
.print-slip-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 2px solid #333;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.print-slip-header h2 { margin: 0 0 4px; font-size: 1.25rem; }
.print-slip-code { font-size: 1.1rem; font-weight: 700; margin: 0; }
.print-slip-qr { text-align: center; }
.print-slip-qr-hint { font-size: 0.75rem; margin: 4px 0 0; color: #555; }
.print-slip-table { width: 100%; margin-top: 12px; }
.print-slip-footer { margin-top: 12px; font-size: 1rem; }

.print-slip-signatures {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}
.print-slip-signature-label {
  font-weight: 700;
  margin: 0 0 4px;
}
.print-slip-signature-hint {
  font-size: 0.85rem;
  margin: 0 0 48px;
  color: var(--text-muted, #666);
}
.print-slip-signature-line {
  border-bottom: 1px solid #ccc;
  min-height: 1px;
}

.admin-farm-context-form {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.admin-farm-context-sidebar {
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 8px;
}
.admin-farm-context-sidebar label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 4px;
}
.admin-farm-context-sidebar select,
.admin-farm-context-form select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  max-width: 100%;
  width: 100%;
  font-size: 0.85rem;
}
.admin-farm-context-form select {
  max-width: 160px;
}
.admin-farm-context-banner {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.backup-restore-card { margin-top: 16px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.print-order-header {
  margin-bottom: 16px;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
}

.print-order-header h2 { margin: 0 0 4px; font-size: 1.2rem; }

/* Phiếu hái */
.harvest-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 0.9rem;
}

.harvest-date-form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.harvest-date-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.harvest-date-label-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, #666);
}

.harvest-date-input {
  padding: 6px 8px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font: inherit;
}

.harvest-backlog-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
}

.harvest-backlog-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
}

.harvest-backlog-list li + li {
  margin-top: 4px;
}

.harvest-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.harvest-badge-live { background: #e3f2fd; color: #1565c0; }
.harvest-badge-locked { background: #fff3e0; color: #e65100; }
.harvest-badge-done { background: #e8f5e9; color: #2e7d32; }

.harvest-prior-list {
  margin-bottom: 12px;
}

.harvest-prior-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.harvest-prior-items li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.harvest-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.harvest-finalize-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.harvest-qty-input, .split-qty-input {
  width: 72px;
  text-align: center;
}

.harvest-split-mobile { display: none; }
.harvest-product-accordion { margin-bottom: 10px; padding: 0; overflow: hidden; }
.harvest-product-accordion summary {
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
}
.harvest-product-accordion summary::-webkit-details-marker { display: none; }
.harvest-product-accordion .shop-table { margin: 0; font-size: 0.85rem; }

@media (max-width: 768px) {
  .harvest-split-desktop { display: none; }
  .harvest-split-mobile { display: block; }
  .harvest-qty-input, .split-qty-input { width: 64px; min-height: 44px; }
  .harvest-section.panel-has-mobile-cards > .panel-table-wrap {
    display: none !important;
  }
  .harvest-section.panel-has-mobile-cards > .panel-data-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }
  .harvest-mobile-order-chip {
    min-width: 0;
    word-break: break-word;
  }
  .harvest-mobile-order-label {
    min-width: 0;
    word-break: break-word;
  }
  .harvest-mobile-order-chip .harvest-col-order-actions {
    width: 100%;
    justify-content: stretch;
  }
  .harvest-mobile-order-chip .harvest-col-mini-btn {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.78rem;
    white-space: normal;
  }
  .harvest-product-accordion .qty-input {
    width: 64px;
    min-height: 44px;
    font-size: 0.95rem;
  }
  .panel-harvest-summary-card .qty-input {
    width: 100%;
    max-width: 120px;
    min-height: 44px;
  }
}

.harvest-matrix th { font-size: 0.78rem; white-space: nowrap; }
.harvest-matrix td { vertical-align: middle; }

.harvest-split-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
}
.harvest-split-filter-field { margin: 0; min-width: 140px; }
.harvest-split-search-field { flex: 1 1 180px; max-width: 280px; }
.harvest-split-filter-select,
.harvest-split-filter-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.harvest-split-filter-count { margin: 0; font-size: 0.85rem; }

.harvest-split-grid {
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}
#harvest-split .harvest-split-grid.panel-grid-table {
  border: none;
  border-radius: 0;
}
#harvest-split .harvest-split-grid.panel-grid-table th,
#harvest-split .harvest-split-grid.panel-grid-table td {
  border: 1px solid #e0e0e0;
  text-align: center;
  vertical-align: middle;
  padding: 10px 8px;
}
#harvest-split .harvest-split-grid.panel-grid-table thead th {
  font-size: 0.95rem;
  padding: 12px 8px;
  background: var(--brown);
  color: var(--white);
}
#harvest-split .harvest-split-grid.panel-grid-table thead th.harvest-split-product-col {
  text-align: left;
}
#harvest-split .harvest-split-grid.panel-grid-table tbody .harvest-split-product-col {
  text-align: left;
  background: var(--white);
}
#harvest-split .harvest-split-grid.panel-grid-table tbody .harvest-split-total-col {
  background: #f7f5f2;
  font-weight: 600;
}
#harvest-split .harvest-split-product-col {
  width: 118px;
  min-width: 118px;
}
#harvest-split .harvest-split-data-col {
  min-width: 76px;
}
#harvest-split .harvest-split-col-alt {
  background: inherit;
}
#harvest-split .harvest-split-total-col {
  width: 68px;
  min-width: 68px;
}
.harvest-split-product-col {
  width: 118px;
}
.harvest-split-data-col {
  min-width: 76px;
}
.harvest-split-col-alt {
  background: #f0f4f8;
}
.harvest-matrix-transposed th.harvest-split-col-alt {
  background: var(--green-dark);
}
.harvest-split-total-col {
  width: 68px;
}

.harvest-split-ops-bar {
  margin-bottom: 12px;
  padding: 12px 14px;
}
.harvest-split-ops-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}
.harvest-split-ops-tabs {
  flex: 1 1 260px;
  min-width: 0;
}
.harvest-split-ops-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
}

.harvest-split-scroll-wrap {
  margin-top: 0;
}
.harvest-split-sticky-top {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  padding-bottom: 8px;
  margin-bottom: 0;
}
.harvest-split-sticky-top .harvest-split-toolbar {
  margin-bottom: 0;
}
.harvest-split-table-scroll {
  max-height: min(70vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
#harvest-split .harvest-split-table-scroll .harvest-split-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: var(--brown);
  background-clip: padding-box;
}
#harvest-split .harvest-split-table-scroll .harvest-split-grid thead th.harvest-split-product-col {
  left: 0;
  z-index: 5;
}
#harvest-split .harvest-split-table-scroll .harvest-split-grid tbody td.harvest-split-product-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--white);
  background-clip: padding-box;
}

.harvest-matrix-transposed .harvest-col-customer { min-width: 96px; }
.harvest-col-customer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}
.harvest-customer-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #37e1e7;
  line-height: 1.25;
  word-break: break-word;
}
.harvest-col-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}
.harvest-col-ship {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
  justify-content: center;
}
.harvest-col-ship-input {
  max-width: 100%;
  font-size: 0.68rem;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--border, #ccc);
  background: #fff;
  color: var(--text, #222);
}
.harvest-mobile-order-chip .harvest-col-ship {
  justify-content: stretch;
}
.harvest-mobile-order-chip .harvest-col-ship-input {
  flex: 1 1 auto;
  min-height: 40px;
  font-size: 0.8rem;
}
.harvest-col-mini-btn {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
}
.harvest-col-mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.harvest-col-mini-btn--giao {
  background: var(--green);
  border-color: var(--green-dark);
}
.harvest-col-mini-btn--giao:hover {
  background: var(--green-light);
}
.harvest-col-mini-btn--light {
  border-color: #ccc;
  background: #f5f5f5;
  color: #444;
}
.harvest-col-mini-btn--light:hover {
  background: #ebebeb;
}
.harvest-col-mini-btn--light.harvest-col-mini-btn--giao {
  background: var(--green-soft);
  border-color: var(--surface-border);
  color: var(--green-dark);
}
.harvest-mobile-order-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.harvest-mobile-order-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #faf8f6;
  border: 1px solid #e8e0d8;
  border-radius: 8px;
}
.harvest-mobile-order-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2a6b8a;
  flex: 1 1 120px;
}
.harvest-archived-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.harvest-batch-nav { margin-bottom: 12px; }
.harvest-batch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.harvest-batch-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid #e0d6cc;
  border-radius: 8px;
  background: #faf8f6;
  color: #444;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  transition: border-color 0.15s, background 0.15s;
}
.harvest-batch-tab:hover {
  border-color: var(--surface-border);
  background: #fff;
  color: #333;
}
.harvest-batch-tab.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px var(--surface-border);
}
.harvest-batch-tab-note {
  font-size: 0.72rem;
  font-weight: 500;
  color: #777;
}
.harvest-batch-tab.is-active .harvest-batch-tab-note { color: var(--green); }
.harvest-batch-tab-time {
  font-size: 0.68rem;
  font-weight: 500;
  color: #999;
}
.split-ordered-hint {
  display: block;
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 2px;
}
.split-print-value { display: none; }
.harvest-delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.harvest-delivery-btn { font-size: 0.82rem; }
.harvest-print-toolbar,
.harvest-order-print-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.harvest-print-order-btn { font-size: 0.82rem; }
.print-harvest-draft-slip {
  padding: 0;
  border: none;
  max-width: 100%;
}
.print-harvest-draft-order-head {
  margin-bottom: 12px;
  text-align: center;
}
.print-harvest-draft-code {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.print-harvest-draft-customer {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: #2a6b8a;
}
.print-harvest-draft-write {
  min-width: 3em;
  letter-spacing: 0.05em;
}
.print-harvest-draft-legend { margin-top: 10px; font-size: 0.8rem; }
.print-split-legend { margin-top: 10px; font-size: 0.8rem; }

.user-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.user-form-meta { margin: 0 0 12px; }
.user-reset-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.user-reset-section .panel-section-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.user-reset-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.user-reset-field {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.user-admin-badge {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
}
.change-password-block {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e8e8e8;
}
.change-password-modal-body {
  margin: 0;
}
.change-password-block .panel-section-title,
.account-password-block h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.change-password-form-stack,
.change-password-form-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0;
}
.change-password-form-stack {
  max-width: 400px;
}
.change-password-form-stack .form-field,
.change-password-form-modal .form-field {
  margin: 0;
}
.change-password-form-actions {
  margin-top: 4px;
}
.change-password-form input,
body.panel-body .change-password-form input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.user-modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-bottom: 0;
}
.user-modal-form .form-field-full,
.user-modal-form .user-create-role-panel,
.user-modal-form .user-form-meta-block,
.user-modal-form .modal-form-actions,
.user-modal-form .user-modal-hint,
.user-modal-form #user-form-farm-wrap {
  grid-column: 1 / -1;
}
.user-create-role-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.user-create-role-panel[hidden] {
  display: none !important;
}
.user-create-or-divider {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
}
.user-create-role-panel .form-field-full {
  grid-column: 1 / -1;
}
.user-modal-hint {
  margin: 0;
  font-size: 0.82rem;
}
.user-form-meta-block {
  margin: 0 0 4px;
}

.panel-actions-sticky { margin-top: 16px; }

@media (max-width: 768px) {
  .panel-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--green-soft);
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    margin: 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card span { color: var(--gray-600); font-size: 0.9rem; }
.stat-card strong { color: var(--green); font-size: 1.4rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.form-inline .checkbox-label { margin-bottom: 0; }
.filter-bar-field-check.checkbox-label {
  flex-direction: row;
  align-self: flex-end;
  margin-bottom: 0;
}
.filter-bar-field-check.checkbox-label span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0;
  white-space: nowrap;
}
.inline-form { display: inline; }

.full-input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  max-width: 480px;
  padding: 10px;
  margin: 8px 0 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.simple-list { list-style: none; padding: 0; }
.simple-list li { padding: 10px 0; border-bottom: 1px solid #eee; }
.hint { color: var(--gray-600); font-size: 0.9rem; margin-top: 12px; }

.nav-link-customer { color: var(--white); text-decoration: none; font-size: 0.9rem; }
.nav-link-customer:hover { text-decoration: underline; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-confirmed { background: #e3f2fd; color: #1565c0; }
.badge-delivering { background: #e8f5e9; color: #2e7d32; }
.badge-completed { background: #f3e5f5; color: #6a1b9a; }
.badge-cancelled { background: #ffebee; color: #c62828; }

.order-filters-toggle.is-active {
  border-color: var(--brown);
  color: var(--brown-dark);
}

.order-filters-badge {
  color: var(--green);
  font-weight: 700;
}

.order-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.order-list-head .page-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.order-list-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }

.track-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.order-timeline {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.timeline-step {
  flex: 1;
  min-width: 70px;
  text-align: center;
  position: relative;
  opacity: 0.45;
}
.timeline-step.done, .timeline-step.active { opacity: 1; }
.timeline-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ccc;
  margin: 0 auto 6px;
}
.timeline-step.done .timeline-dot { background: var(--green); }
.timeline-step.active .timeline-dot { background: var(--brown); box-shadow: 0 0 0 3px rgba(139,69,19,0.25); }
.timeline-label { display: block; font-size: 0.72rem; font-weight: 600; }
.timeline-time { display: block; font-size: 0.68rem; color: var(--gray-600); }

.combo-month-progress-hint {
  margin: -0.5rem 0 1rem;
}

.combo-month-shipments {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.combo-month-ship-card {
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: #fff;
}

.combo-month-ship-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.combo-month-ship-lines {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--brown-dark, #3f2a1d);
}

.combo-month-shipments--admin .combo-month-ship-card {
  margin-bottom: 0;
}

.combo-compose-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}

.combo-compose-row {
  display: grid;
  grid-template-columns: 1fr 5rem auto;
  gap: 8px;
  align-items: center;
}

.combo-compose-row .combo-compose-select {
  min-width: 0;
  width: 100%;
}

.combo-compose-add {
  margin-top: 0.25rem;
}

.track-combo-month .panel-section-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.order-meta {
  background: var(--gray-100);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.order-meta p { margin-bottom: 4px; }
.order-meta p:last-child { margin-bottom: 0; }

.btn-link-inline {
  background: none;
  border: none;
  color: #1565c0;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.invoice-page { max-width: 72mm; margin: 0 auto; }
.invoice-print-sheet { background: #fff; }

/* Thermal receipt invoice (80mm paper) */
.invoice-thermal-sheet {
  max-width: 72mm;
  margin: 0 auto;
  padding: 4px 2px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.35;
  color: #000;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.invoice-thermal-header {
  text-align: center;
  margin-bottom: 4px;
}
.invoice-thermal-store-name {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.invoice-thermal-store-line {
  margin: 0 0 2px;
  font-size: 11px;
}
.invoice-thermal-divider {
  margin: 6px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: -0.5px;
  color: #333;
}
.invoice-thermal-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.invoice-thermal-meta p,
.invoice-thermal-buyer p {
  margin: 0 0 3px;
  font-size: 11px;
}
.invoice-thermal-label {
  font-weight: 600;
}
.invoice-thermal-items {
  margin: 4px 0;
}
.invoice-thermal-item {
  margin-bottom: 6px;
}
.invoice-thermal-item-name {
  margin: 0 0 1px;
  font-size: 11px;
  font-weight: 600;
}
.invoice-thermal-pack {
  font-weight: 400;
  font-size: 10px;
}
.invoice-thermal-item-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
}
.invoice-thermal-item-total {
  margin-left: auto;
  font-weight: 600;
}
.invoice-thermal-totals {
  margin-top: 4px;
}
.invoice-thermal-total-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 3px;
  font-size: 11px;
}
.invoice-thermal-total-grand {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}
.invoice-thermal-thanks {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
}
.invoice-thermal-qr {
  text-align: center;
  margin: 6px 0;
}
.invoice-thermal-qr img {
  display: inline-block;
}
.invoice-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }

.alert-error { background: #ffebee; color: #c62828; }

.account-section { margin-bottom: 32px; }
.account-section h2 { margin-bottom: 12px; }
.account-form { max-width: 480px; }

.account-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

.account-accordion-item.panel-card {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.account-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s ease;
}

.account-accordion-trigger:hover {
  background: #faf8f5;
}

.account-accordion-item.is-open .account-accordion-trigger {
  background: #f8f6f2;
  border-bottom: 1px solid #ececec;
}

.account-accordion-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f1f8e9;
  color: var(--green);
}

.account-accordion-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-accordion-title {
  font-size: 1rem;
  color: var(--brown-dark);
}

.account-accordion-desc {
  font-size: 0.85rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-accordion-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--gray-600);
  border-bottom: 2px solid var(--gray-600);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
}

.account-accordion-item.is-open .account-accordion-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.account-accordion-panel {
  padding: 16px 18px 18px;
}

.account-accordion-panel .notify-settings-block {
  margin: 0;
}

.account-accordion-panel .account-password-block {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
}

.account-accordion-panel .account-email-block {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
}

.account-accordion-panel .account-history {
  margin-top: 0;
}

.account-subsection-title {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--brown-dark);
}

.account-profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin-bottom: 20px;
}

.account-profile-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.account-profile-form .form-field > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-dark);
}

.account-profile-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: #222;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-profile-form input::placeholder {
  color: #aaa;
}

.account-profile-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.account-profile-form input:disabled {
  background: #f4f4f4;
  color: var(--gray-600);
  cursor: not-allowed;
  border-color: #e2e2e2;
}

.account-profile-form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.account-history {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
}

.account-history h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--brown-dark);
}

.account-history-table-wrap {
  overflow-x: auto;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
}

.account-history-table {
  width: 100%;
  margin: 0;
  font-size: 0.88rem;
}

.account-history-table th,
.account-history-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.account-history-table thead th {
  background: var(--brown);
  color: var(--white);
  font-weight: 600;
  white-space: nowrap;
}

.account-history-table tbody tr:nth-child(even) {
  background: #fff;
}

.account-history-time {
  white-space: nowrap;
  color: var(--gray-600);
}

.account-history-change {
  color: var(--brown-dark);
}

.account-history-same {
  color: var(--gray-600);
  font-style: italic;
}
.address-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.address-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 14px;
  background: #fafafa;
}
.address-default { border-color: var(--green); background: #f1f8e9; }
.address-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.address-card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; align-items: center; }
.badge-green {
  background: var(--green);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.text-danger { color: #c62828; }
.text-success { color: #2e7d32; }

.email-account-modal-body {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.email-account-block h3.panel-section-title,
.account-email-block h3.panel-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--brown-dark);
}

.email-account-hint {
  margin: 0 0 12px;
}

.email-account-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f3faf4;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
}

.email-account-status strong {
  word-break: break-all;
  color: var(--brown-dark);
}

.email-account-toggle-change {
  margin-bottom: 4px;
}

.email-account-change-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e0e0e0;
}

.email-change-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
}

.email-change-step {
  padding: 12px 0;
}

.email-change-step-new {
  padding-top: 16px;
  border-top: 1px solid #ececec;
}

.notify-linked-email-warn {
  color: #c62828;
}

.email-otp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
}

.email-otp-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.email-otp-form .form-field > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-dark);
}

.email-otp-form input[type="email"],
.email-otp-form input[type="text"],
.email-otp-form input[type="password"],
.email-otp-form .email-account-input,
.email-otp-form .email-account-code {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: #222;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.email-otp-form input::placeholder {
  color: #aaa;
}

.email-otp-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.email-otp-form .email-account-code {
  max-width: 220px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.email-otp-step-send,
.email-otp-step-verify {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.email-otp-step-verify {
  padding-top: 4px;
  border-top: 1px solid #f0f0f0;
}

.email-account-resend,
.email-forgot-resend {
  font-size: 0.82rem;
  color: var(--gray-600);
}

.email-account-msg,
.email-forgot-msg {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.email-account-msg:not([hidden]).text-danger,
.email-forgot-msg:not([hidden]).text-danger {
  background: #ffebee;
  border: 1px solid #ffcdd2;
}

.email-account-msg:not([hidden]).text-success,
.email-forgot-msg:not([hidden]).text-success {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.email-forgot-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

.email-forgot-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.email-forgot-root .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.email-forgot-root .form-field > span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-dark);
}

.email-forgot-root input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: #222;
}

.email-forgot-root input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.email-forgot-root .email-forgot-code {
  max-width: 220px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-align: center;
}

.email-forgot-step-1,
.email-forgot-step-2 {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.email-forgot-step-2 {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
}

body.panel-body .email-account-modal-body .email-otp-form input {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.auth-forgot-row {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.auth-switch-row {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.auth-switch-row .btn-link-inline {
  font-size: inherit;
  font-weight: 600;
}

.auth-forgot-link {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shop-address-form { margin-bottom: 16px; padding: 16px; background: var(--gray-100); border-radius: 12px; }
.shop-address-title { margin: 0 0 10px; font-size: 1rem; }
.address-mode-option { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.shop-address-select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-family: inherit; }

/* Địa chỉ gọn — shop */
.shop-address-compact { margin-bottom: 8px; }
.shop-address-summary-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  line-height: 1.35;
}
.shop-address-label { color: var(--gray-600); flex-shrink: 0; }
.shop-address-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-address-toggle { flex-shrink: 0; font-size: 0.85rem; }
.shop-recipient-hint { margin: 0 0 6px; font-size: 0.82rem; }
.shop-recipient-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 768px) {
  .shop-recipient-fields { grid-template-columns: 1fr; }
}

#shop-address-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-address-new {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.shop-address-new input,
.shop-address-new textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  margin: 0;
}

.shop-address-new textarea {
  min-height: 72px;
  resize: vertical;
}

.shop-address-new .checkbox-label {
  margin-top: 2px;
}
.shop-address-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.shop-address-apply { margin-top: 8px; align-self: flex-start; }
.shop-address-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 85;
}

@media (min-width: 769px) {
  .shop-address-overlay {
    display: none !important;
  }

  #shop-address-panel:not(.hidden) {
    position: relative;
    z-index: 2;
  }
}

@media (max-width: 768px) {
  body.shop-page.shop-address-open #shop-address-panel {
    z-index: 95;
  }
}

/* Thông báo khách */
.customer-notify-wrap { margin: 16px 0 8px; }
body.shop-page .customer-notify-wrap {
  margin-bottom: 8px;
}
.customer-notify-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 14px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  font-size: 0.88rem;
}
.customer-notify-text { flex: 1; min-width: 160px; color: #2e7d32; }

/* Header nav rút gọn mobile */
.nav-short { display: none; }
.header-nav .nav-long { display: inline; }

/* Danh sách đơn — card mobile */
.order-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.order-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 10px;
}
.order-card-total { font-weight: 600; color: var(--brown-dark); }

.product-edit-form { margin-top: 10px; min-width: 280px; padding: 12px; background: #fafafa; border-radius: 8px; }
.product-edit-details summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  padding: 5px 12px;
  border: 1px solid var(--brown);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--brown-dark);
  background: #fff;
}
.product-edit-details summary::-webkit-details-marker { display: none; }
.product-edit-details[open] summary { margin-bottom: 8px; }
.product-actions-cell {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.product-deactivate-form { margin-top: 4px; }
.product-dup-badge { margin-left: 6px; font-size: 0.68rem; vertical-align: middle; }

body.panel-body .form-field input:not([type="checkbox"]):not([type="radio"]),
body.panel-body .form-field select,
body.panel-body .form-field textarea,
body.panel-body .panel-filters input:not([type="checkbox"]):not([type="radio"]),
body.panel-body .panel-filters select,
body.panel-body .product-edit-form input:not([type="checkbox"]):not([type="radio"]),
body.panel-body .product-edit-form select,
body.panel-body .user-modal-form input:not([type="checkbox"]):not([type="radio"]),
body.panel-body .user-modal-form select,
body.panel-body .user-reset-form input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .product-edit-form { min-width: 0; grid-template-columns: 1fr; }
  .product-actions-cell { align-items: stretch; }
  .product-edit-details summary,
  .product-deactivate-form .btn,
  .product-edit-btn { width: 100%; text-align: center; }
  .modal-form-actions .btn { flex: 1; min-width: 120px; }
}

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 10px;
}
.bulk-orders-table .col-check { width: 40px; text-align: center; vertical-align: middle; }
.nav-badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 4px;
  background: #c62828;
  color: #fff;
  font-size: 0.75rem;
  line-height: 20px;
  border-radius: 999px;
  text-align: center;
}
.notify-enable-btn {
  margin: 8px 0 12px;
  width: 100%;
}
.notify-enable-btn.notify-enabled {
  opacity: 0.7;
}
.track-header .notify-enable-btn {
  width: auto;
  margin: 0;
}

@media (max-width: 768px) {
  .order-timeline { gap: 2px; }
  .timeline-label { font-size: 0.65rem; }
}

.report-chart-card { margin-top: 8px; }
.report-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 180px;
  padding: 12px 4px 0;
  overflow-x: auto;
}
.report-bar-col {
  flex: 1 1 0;
  min-width: 28px;
  max-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 160px;
}
.report-bar-fill {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, #7cb342 0%, var(--green) 100%);
  border-radius: 6px 6px 2px 2px;
  min-height: 2px;
  transition: height 0.2s ease;
}
.report-bar-label {
  font-size: 0.68rem;
  color: var(--gray-600);
  margin-top: 6px;
  white-space: nowrap;
}
.report-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.report-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.report-status-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
}
.report-status-item strong { font-size: 1.25rem; color: var(--brown-dark); }
.panel-empty-text { color: var(--gray-600); margin: 0; padding: 8px 0; }
.accept-received-panel { margin-bottom: 16px; }
.accept-received-panel .radio-label { display: block; margin: 6px 0; font-size: 0.9rem; }
.accept-received-panel .form-field-label { font-size: 0.9rem; margin: 12px 0 6px; font-weight: 600; }
.accept-loss-cause { margin: 4px 0 6px 24px; }
.accept-loss-cause .form-field-label { margin: 0 0 4px; font-weight: 500; }
.accept-loss-cause .form-select { padding: 8px 10px; border-radius: 8px; border: 1px solid #ccc; max-width: 320px; width: 100%; }
.loss-cause-tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: #fdecea; color: #c62828; font-size: 0.75rem; font-weight: 600; }
.track-note-input { min-width: 120px; max-width: 180px; font-size: 0.85rem; }
.form-field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.form-field-inline select { padding: 8px 10px; border-radius: 8px; border: 1px solid #ccc; }

/* Chi tiết đơn — desktop bảng, mobile card */
.order-item-cards,
.accept-received-cards { display: none; }

@media (min-width: 769px) {
  body.customer-flow-page.track-page .order-items-table-wrap {
    display: none !important;
  }

  body.customer-flow-page.track-page .order-item-cards {
    display: block !important;
  }

  body.customer-flow-page .order-card > .btn {
    display: inline-block;
    margin-right: 8px;
    margin-top: 4px;
  }
}
.order-line-card {
  background: var(--white);
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
}
.order-line-card-mismatch { background: #fff3e0; border-color: #ffe082; }
.order-line-card-name { display: block; margin-bottom: 4px; color: var(--brown-dark); }
.order-line-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
}
.order-line-card dt {
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.82rem;
}
.order-line-card dd { margin: 0; word-break: break-word; }
.accept-received-submit { margin-top: 12px; }

/* Chi tiết đơn — bảng desktop trên mobile, header cột rút gọn */
.order-detail-items-table {
  table-layout: fixed;
  width: 100%;
}
.order-detail-items-table col.col-sp { width: 30%; }
.order-detail-items-table col.col-qty-sm { width: 12%; }
.order-detail-items-table col.col-note-sm { width: 16%; }
.order-detail-items-table.order-detail-items-table--admin col.col-sp { width: 24%; }
.order-detail-items-table.order-detail-items-table--admin col.col-qty-sm { width: 10%; }
.order-detail-items-table.order-detail-items-table--admin col.col-note-sm { width: 12%; }
.order-detail-items-table.order-detail-items-table--admin col.col-money-sm { width: 14%; }
.order-detail-items-table .th-label-short { display: none; }
.order-detail-items-table th.col-sp,
.order-detail-items-table td.col-sp {
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}
.order-detail-items-table .order-item-name {
  display: inline;
  font-weight: 600;
  line-height: 1.3;
}
.order-detail-items-table td.col-sp .unit-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .order-detail-items-wrap {
    overflow-x: visible;
    margin-left: -2px;
    margin-right: -2px;
  }

  .order-detail-items-wrap .panel-card {
    padding: 8px 6px;
  }

  body.track-page .order-detail-items-table th,
  body.track-page .order-detail-items-table td,
  body.panel-body .order-detail-items-table th,
  body.panel-body .order-detail-items-table td {
    padding: 4px 3px !important;
    font-size: 0.8rem;
    line-height: 1.25;
  }

  body.track-page .order-detail-items-table th.col-sp,
  body.track-page .order-detail-items-table td.col-sp,
  body.panel-body .order-detail-items-table th.col-sp,
  body.panel-body .order-detail-items-table td.col-sp {
    text-align: left !important;
    vertical-align: top;
    padding-left: 5px !important;
    padding-right: 4px !important;
    word-break: normal !important;
    overflow-wrap: break-word;
    white-space: normal !important;
  }

  body.track-page .order-detail-items-table th.col-qty-sm,
  body.track-page .order-detail-items-table td.col-qty-sm,
  body.panel-body .order-detail-items-table th.col-qty-sm,
  body.panel-body .order-detail-items-table td.col-qty-sm {
    text-align: center !important;
    white-space: nowrap;
    padding: 4px 2px !important;
    font-size: 0.78rem;
    vertical-align: middle;
  }

  body.track-page .order-detail-items-table th.col-note-sm,
  body.track-page .order-detail-items-table td.col-note-sm,
  body.panel-body .order-detail-items-table th.col-note-sm,
  body.panel-body .order-detail-items-table td.col-note-sm {
    text-align: left !important;
    font-size: 0.72rem;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    vertical-align: top;
  }

  body.panel-body .order-detail-items-table th.col-money-sm,
  body.panel-body .order-detail-items-table td.col-money-sm {
    text-align: right !important;
    font-size: 0.72rem;
    white-space: nowrap;
    padding-right: 4px !important;
    vertical-align: middle;
  }

  body.track-page .order-detail-items-table .qty-input,
  body.panel-body .order-detail-items-table .qty-input {
    width: 34px !important;
    height: 30px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 1px 2px !important;
    margin: 0 auto;
    font-size: 0.78rem !important;
    border-radius: 4px;
    border-width: 1px;
    box-sizing: border-box;
    display: block;
  }

  body.track-page .order-detail-items-table .track-note-input,
  body.panel-body .order-detail-items-table .track-note-input {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 28px;
    font-size: 0.72rem !important;
    padding: 2px 3px !important;
    display: block;
  }

  body.track-page .order-detail-items-table .th-label-long,
  body.panel-body .order-detail-items-table .th-label-long { display: none; }
  body.track-page .order-detail-items-table .th-label-short,
  body.panel-body .order-detail-items-table .th-label-short { display: inline; }

  .order-items-table-wrap { display: none !important; }
  body.track-page .order-items-table-wrap,
  body.panel-body .order-detail-items-wrap { display: block !important; }
  .order-item-cards { display: block; }
  body.track-page .order-item-cards,
  body.panel-body .order-item-cards { display: none !important; }

  .accept-received-table-wrap { display: none !important; }
  .accept-received-cards { display: block; }

  .order-line-card .qty-input,
  .order-line-card .track-note-input {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  .accept-received-panel .radio-label { line-height: 1.4; padding: 6px 0; }
  .accept-received-panel .btn-primary,
  .accept-received-submit { width: 100%; }

  body.track-page .actions-row { flex-direction: column; align-items: stretch; }
  body.track-page .actions-row .btn,
  body.track-page .actions-row .inline-form { width: 100%; }
  body.track-page .actions-row .inline-form .btn { width: 100%; }
  body.track-page .actions-row form { width: 100%; }

  .panel-actions-sticky { flex-direction: column; align-items: stretch; }
  .panel-actions-sticky .btn { width: 100%; text-align: center; }

  body.panel-body .actions-row.no-print { flex-direction: column; align-items: stretch; }
  body.panel-body .actions-row.no-print .btn { width: 100%; text-align: center; }

  .order-timeline .timeline-label {
    font-size: 0.7rem;
    white-space: normal;
    line-height: 1.2;
  }
}

/* Bộ lọc — override cuối file, tránh cache/specificity cũ */
@media (min-width: 769px) {
  #product-filters-panel .filter-bar-form,
  #order-filters-panel .filter-bar-form,
  #user-filters-panel .filter-bar-form,
  #log-filters-panel .filter-bar-form,
  #wallet-topup-filters-panel .filter-bar-form {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    gap: 10px !important;
  }

  #product-filters-panel .filter-bar-fields,
  #order-filters-panel .filter-bar-fields,
  #user-filters-panel .filter-bar-fields,
  #log-filters-panel .filter-bar-fields,
  #wallet-topup-filters-panel .filter-bar-fields {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    flex: 1 !important;
    gap: 8px !important;
    align-items: flex-end !important;
  }

  #product-filters-panel .filter-bar-form .form-field,
  #order-filters-panel .filter-bar-form .form-field,
  #user-filters-panel .filter-bar-form .form-field,
  #log-filters-panel .filter-bar-form .form-field,
  #wallet-topup-filters-panel .filter-bar-form .form-field {
    margin-bottom: 0 !important;
  }
}

@media (max-width: 768px) {
  #product-filters-panel:not(.is-open),
  #order-filters-panel:not(.is-open) {
    display: none !important;
  }
}

/* Ghim header bảng khi cuộn danh sách SP */
body.shop-page .shop-catalog-scroll .shop-order-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background-color: var(--brown) !important;
  color: var(--white) !important;
}

body.panel-body .panel-catalog-scroll.panel-table-wrap .shop-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background-color: var(--brown) !important;
}

/* Cảnh báo lô hàng vườn cần đối chiếu */
.reconcile-pending-alert {
  border-left: 4px solid var(--amber, #e6a817);
  margin-bottom: 12px;
}

.reconcile-pending-alert-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.reconcile-date-mismatch-hint {
  color: var(--amber, #b8860b);
}

.shop-delivery-mode {
  margin-bottom: 8px;
}

.shop-shipping-line {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

/* Phiếu đối chiếu vườn ↔ kho */
.reconcile-sheet {
  margin-bottom: 16px;
}

.reconcile-sheet-title {
  margin-bottom: 4px;
  color: var(--brown-dark);
  font-size: 1.15rem;
}

.reconcile-sheet-desc {
  margin: 0 0 8px;
}

.reconcile-sheet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.dispatched-farm-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dispatched-farm-block:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.dispatched-farm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.dispatched-farm-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dispatched-farm-count {
  font-size: 0.85rem;
}

.farm-mobile-grid-complete {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--green-soft, #e8f5e9);
  border-radius: 8px;
  font-size: 0.9rem;
}

.reconcile-sheet-filter-note {
  margin: 4px 0 0;
}

.reconcile-farm-form {
  align-items: center;
  gap: 8px;
}

.reconcile-farm-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.reconcile-farm-select {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.reconcile-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.reconcile-table thead th {
  background: var(--brown);
  color: #fff;
  font-size: 0.9rem;
  padding: 10px 8px;
}

.reconcile-shipped {
  color: #e65100;
  font-weight: 600;
}

.reconcile-received {
  color: var(--green-dark);
  font-weight: 600;
}

.reconcile-btn-thuan {
  background: #f57c00;
  border-color: #ef6c00;
  color: #fff;
  font-weight: 700;
  min-width: 72px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.reconcile-btn-thuan:hover {
  background: #ef6c00;
  color: #fff;
}

.reconcile-row-agreed {
  background: #f1f8f4;
}

.reconcile-row-ready {
  background: #fff8e1;
}

.reconcile-dispute-plan {
  margin-top: 14px;
}

.reconcile-dispute-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.reconcile-dispute-list li {
  margin-bottom: 6px;
}

.reconcile-inbound-form {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--surface-border);
}

@media (max-width: 768px) {
  .reconcile-table .qty-input {
    width: 56px;
    height: 48px;
    font-size: 1rem;
  }

  .reconcile-btn-thuan {
    min-height: 44px;
    width: 100%;
    max-width: 88px;
  }

  .reconcile-aggregate-form .harvest-actions-row .btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }
}

/* Customer shell — rules cuối file, tránh drawer/nav lộ ra layout */
body.customer-site #customer-nav-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: min(300px, 88vw) !important;
  z-index: 1200 !important;
  transform: translateX(100%) !important;
  display: flex !important;
  flex-direction: column !important;
}

body.customer-site #customer-nav-drawer.is-open {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.customer-site #customer-nav-drawer:not(.is-open) {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.customer-site #customer-menu-overlay:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1190 !important;
}

@media (max-width: 768px) {
  body.customer-site:not(.home-grid-page) .site-header-v2 .header-row {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  body.customer-site:not(.home-grid-page) .header-slogan {
    white-space: normal !important;
  }

  body.customer-site .site-header-v2 .header-row {
    flex-direction: row !important;
    align-items: center !important;
  }

  .home-grid-header--compact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    max-height: 150px;
  }

  .home-grid-header--compact .home-grid-hero-video,
  .home-grid-header--compact .home-grid-hero-poster,
  .home-grid-header--compact .home-grid-hero-placeholder {
    max-height: 100px;
  }

  .customer-flow-content {
    padding: 10px 12px 88px;
  }

  .customer-flow-page-title {
    font-size: 1.2rem;
  }

  .order-payment-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .order-pay-actions .btn {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .payment-guide-qr,
  .payment-guide-meta {
    max-width: 100%;
    overflow-x: auto;
  }

  .cart-checkout-layout {
    gap: 12px;
  }
}

/* —— Ví khách hàng —— */
.wallet-page {
  display: grid;
  gap: 1.25rem;
  max-width: 100%;
  margin: 0;
}
.wallet-hero {
  padding: 1.35rem 1.25rem 1.25rem;
  background: linear-gradient(145deg, #f4faf6 0%, #e8f5ec 55%, #dff0e6 100%);
  border: 1px solid #cfe8d6;
}
.wallet-hero-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.wallet-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(45, 106, 79, 0.12);
  color: var(--brand-primary, #2d6a4f);
}
.wallet-hero-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-primary, #2d6a4f);
  letter-spacing: 0.01em;
}
.wallet-balance-card {
  padding: 1.25rem;
}
.wallet-balance-label {
  margin: 0 0 0.25rem;
  color: var(--text-muted, #666);
  font-size: 0.9rem;
}
.wallet-balance-amount {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-primary, #2d6a4f);
  line-height: 1.15;
}
.wallet-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.wallet-hero-actions .btn-lg {
  width: auto;
  min-width: 10rem;
}
.wallet-hero-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #5c6b63);
  line-height: 1.45;
}
.wallet-pending-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  background: #fff8e8;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
}
.wallet-pending-banner-text {
  display: grid;
  gap: 0.2rem;
  font-size: 0.88rem;
  color: #5c4a1e;
}
.wallet-pending-banner-text strong {
  font-size: 0.95rem;
  color: #8a5b00;
}
.wallet-pending-banner-time {
  font-size: 0.8rem;
  color: #7a6a45;
}
.wallet-pending-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.wallet-cancel-form {
  margin: 0;
}
.wallet-topup-cancel-form {
  margin-top: 1rem;
}
.wallet-topup-paid-actions {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #d9e8dc;
}
.wallet-topup-paid-hint {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.82rem;
}
.wallet-paid-ack {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.wallet-pending-banner.is-paid-submitted {
  background: #eef8f2;
  border-color: #b8dcc8;
}
.wallet-pending-banner.is-paid-submitted .wallet-pending-banner-text strong {
  color: #1b7f4a;
}
.wallet-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--brown-dark, #3d2c1e);
}
.wallet-empty-hint {
  margin: 0;
  color: var(--text-muted, #666);
  font-size: 0.9rem;
}
.wallet-topup-form {
  display: grid;
  gap: 0.75rem;
}
.wallet-topup-form-hint {
  margin: 0;
}
.wallet-amount-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wallet-amount-preset {
  padding: 0.4rem 0.7rem;
  border: 1px solid #cfe8d6;
  border-radius: 999px;
  background: #f4faf6;
  color: var(--brand-primary, #2d6a4f);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.wallet-amount-preset:hover {
  background: #e8f5ec;
  border-color: #a8d4b8;
}
.wallet-topup-modal-box {
  width: min(440px, 100%);
}
.wallet-topup-qr-wrap {
  margin: 0 auto;
}
.wallet-topup-meta {
  margin-top: 1rem;
}
.wallet-topup-pending-note {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed #d9e8dc;
}
.wallet-status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.wallet-status-badge.is-pending {
  background: #fff4e0;
  color: #9a6700;
}
.wallet-status-badge.is-paid {
  background: #e8f5ec;
  color: #1b7f4a;
}
.wallet-status-badge.is-rejected,
.wallet-status-badge.is-cancelled {
  background: #fdecea;
  color: #c0392b;
}
.wallet-tx-list {
  display: grid;
  gap: 0.65rem;
}
.wallet-tx-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color, #e8e8e8);
}
.wallet-tx-row--card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color, #ebebeb);
  border-radius: 10px;
  background: #fafafa;
}
.wallet-tx-row--card:last-child {
  border-bottom: 1px solid var(--border-color, #ebebeb);
}
.wallet-tx-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.wallet-tx-main .wallet-tx-amount {
  font-size: 0.95rem;
}
.wallet-tx-amount.is-credit { color: #1b7f4a; }
.wallet-tx-amount.is-debit { color: #c0392b; }
.wallet-tx-meta {
  text-align: right;
  font-size: 0.85rem;
}
.wallet-tx-date,
.wallet-tx-balance,
.wallet-tx-note {
  display: block;
  color: var(--text-muted, #666);
}
.shop-wallet-bar,
.cart-wallet-summary {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: #f4faf6;
  border: 1px solid #cfe8d6;
  border-radius: 8px;
  font-size: 0.9rem;
}
.wallet-summary-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.wallet-shortfall {
  margin: 0.5rem 0 0;
  color: #b42318;
  font-size: 0.85rem;
}
.btn.is-disabled-wallet,
button:disabled.is-disabled-wallet {
  opacity: 0.55;
  cursor: not-allowed;
}
.container-return-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border-color, #ddd);
}
.wallet-container-return-card h3 {
  margin-top: 0;
}
.wallet-transfer-guide {
  margin-bottom: 1rem;
}
.wallet-transfer-guide h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.wallet-transfer-steps {
  margin: 0 0 0.75rem 1.1rem;
  padding: 0;
}
.wallet-transfer-info {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}
.wallet-pending-alert {
  margin-top: 0.5rem;
}
.wallet-requests h2 {
  margin-top: 0;
}
.settings-payos-details {
  margin: 1rem 0;
}
.settings-payos-details summary {
  cursor: pointer;
  list-style: none;
}
.settings-payos-details summary::-webkit-details-marker {
  display: none;
}
.settings-secret-input {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-secret-input .full-input {
  flex: 1;
  min-width: 0;
}
.settings-secret-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}
.wallet-reject-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.35rem;
}

.wallet-topup-pending-table .actions-cell {
  min-width: 220px;
  text-align: left;
  vertical-align: middle;
}

.wallet-topup-pending-table .actions-cell .inline-form:first-child {
  display: inline-block;
  margin-right: 0.25rem;
}

.wallet-topup-pending-table .wallet-reject-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.5rem;
}

.wallet-topup-pending-table .wallet-reject-form .input-sm {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 200px;
  padding: 6px 10px;
  font-size: 0.85rem;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  font-family: inherit;
}

.wallet-topup-pending-table .wallet-reject-form .input-sm:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}

/* Card nạp ví — mobile admin */
.panel-wallet-topup-card {
  margin-bottom: 0;
}

.panel-wallet-topup-card .order-card-head {
  align-items: flex-start;
}

.wallet-topup-card-head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wallet-topup-card-code {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-soft);
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}

.panel-wallet-topup-card--pending .order-card-total,
.panel-wallet-topup-card--history .order-card-total {
  color: var(--green);
  font-size: 1.05rem;
  white-space: nowrap;
}

.wallet-topup-card-customer {
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.wallet-topup-card-customer .hint {
  display: block;
  margin-top: 2px;
}

.wallet-topup-card-amount-row {
  margin-bottom: 8px;
}

.wallet-topup-card-meta {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
}

.wallet-topup-card-meta > div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.wallet-topup-card-meta-note {
  flex-direction: column !important;
  align-items: stretch !important;
}

.wallet-topup-card-meta dt {
  flex: 0 0 auto;
  color: var(--gray-600);
  font-weight: 500;
  margin: 0;
}

.wallet-topup-card-meta dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: #222;
  min-width: 0;
}

.wallet-topup-card-meta-note dd {
  text-align: left;
  font-weight: 500;
  word-break: break-word;
}

.wallet-topup-card-order-link {
  display: block;
  margin-top: 2px;
}

.wallet-topup-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--surface-border);
}

.wallet-topup-card-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.wallet-topup-card-actions .wallet-reject-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.wallet-topup-card-actions .wallet-reject-form .input-sm,
.wallet-topup-card-actions .wallet-topup-card-form .input-sm {
  width: 100%;
  max-width: none;
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  font-family: inherit;
  box-sizing: border-box;
}

.wallet-topup-card-actions .btn-block {
  width: 100%;
}

.panel-wallet-topup-cards {
  gap: 10px;
}

.panel-wallet-topup-card--history .order-card-head .status-badge {
  flex-shrink: 0;
}

/* Accordion card — mobile admin (trung chuyển, nạp ví, NCC) */
.panel-collapsible-item {
  overflow: hidden;
}
.panel-collapsible-item.order-card,
.panel-collapsible-item.panel-bt-transit-card,
.panel-collapsible-item.panel-wallet-topup-card {
  margin-bottom: 0;
  padding: 0;
}
.panel-collapsible-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.panel-collapsible-summary::-webkit-details-marker {
  display: none;
}
.panel-collapsible-summary::after {
  content: "▾";
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--green);
  transition: transform 0.15s ease;
}
.panel-collapsible-item[open] > .panel-collapsible-summary::after {
  transform: rotate(180deg);
}
.panel-collapsible-title {
  font-weight: 600;
  color: #222;
  min-width: 0;
  word-break: break-word;
}
.panel-collapsible-meta {
  font-size: 0.85rem;
}
.panel-collapsible-amount {
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.panel-collapsible-body {
  padding: 0 14px 14px;
  border-top: 1px solid #eee;
}
.panel-collapsible-body .wallet-topup-card-meta {
  margin-top: 12px;
}
.panel-collapsible-body .wallet-topup-card-customer {
  margin: 10px 0 0;
}

/* ===== Popup thanh toán Zero-COD ===== */
.order-pay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.order-pay-card {
  background: #fff;
  border-radius: 14px;
  max-width: 460px;
  width: 100%;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.order-pay-card h3 {
  margin: 0 0 1rem;
}
.order-pay-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}
.order-pay-summary {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.order-pay-summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e2e8f0;
}

.order-pay-summary li strong {
  min-width: 0;
  text-align: right;
  word-break: break-word;
}
.order-pay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.order-pay-actions .btn {
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.35;
}

.payment-guide-qr img,
.payment-qr-img {
  max-width: 100%;
  height: auto;
}

.customer-panel-inner .order-payment-page-wrap {
  padding: 0;
  margin: 0;
  max-width: 100%;
}

.customer-panel-inner .order-payment-card {
  box-shadow: none;
  border-radius: 12px;
}

.customer-panel-inner .order-pay-summary li strong {
  min-width: 0;
  word-break: break-word;
}
.order-pay-status {
  margin-top: 0.75rem;
  color: #b45309;
  min-height: 1.2em;
}
.order-pay-manual ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.order-pay-manual li {
  padding: 0.25rem 0;
}

/* ===== Trang thanh toán đơn ===== */
.order-payment-page-wrap {
  max-width: 520px;
  margin: 0 auto 1rem;
  padding: 0;
}

.order-payment-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  box-shadow: 0 8px 32px rgba(93, 46, 12, 0.08);
  padding: 1.5rem;
}

.order-payment-card .order-pay-summary li:last-child strong {
  color: var(--brown-dark);
  font-size: 1.05rem;
}

.order-payment-hint {
  margin: 0.75rem 0 0;
}

.order-payment-wallet-link {
  text-align: center;
}

.order-payment-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
  text-align: center;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.order-payment-guide-wrap .order-payment-card {
  max-width: 560px;
}

.checkout-payos-inline {
  margin-top: 1rem;
}

.checkout-payos-inline .payment-guide-block {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.payment-guide-amount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: #f0f7f0;
  border: 1px solid #c8e6c9;
}

.payment-guide-amount strong {
  font-size: 1.25rem;
  color: var(--brown-dark);
}

.payment-guide-qr {
  text-align: center;
  margin: 0 0 1.25rem;
}

.payment-qr-img {
  display: inline-block;
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 8px;
}

.payment-transfer-note {
  font-family: ui-monospace, monospace;
  color: var(--brown-dark);
}

.order-payment-bank-preview {
  margin: 0 0 1rem;
  padding: 10px 12px;
  border-radius: 8px;
  background: #faf8f4;
  border: 1px dashed var(--surface-border);
  line-height: 1.45;
}

.order-payment-guide-status {
  margin: 1rem 0 0;
}

.payos-success-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.payos-success-modal.hidden {
  display: none !important;
}

body.payos-success-open {
  overflow: hidden;
}

.payos-success-card {
  width: min(100%, 360px);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.payos-success-card-body {
  padding: 28px 20px 24px;
  text-align: center;
}

.payos-success-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--green);
  color: var(--green);
}

.payos-success-card-title {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.payos-success-card-done {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.payos-success-card-done:hover {
  background: var(--green-light);
}

.wallet-topup-qr-panel .payos-success-card {
  width: 100%;
  box-shadow: none;
}

.payment-guide-payos-fallback {
  margin: 0.75rem 0 0;
  text-align: center;
}

.content-admin-edit {
  margin: 0 0 1rem;
}

.content-page-editor-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.content-page-editor + .content-page-editor {
  margin-top: 1rem;
}

.content-page-body-input {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

.content-page-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.5rem;
}

.settings-content-hint {
  margin-bottom: 1rem;
}

.settings-index-card--link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.settings-index-card--link:hover {
  border-color: var(--green);
  text-decoration: none;
}

.payment-guide-qr--hero .payment-qr-img {
  max-width: 280px;
  width: min(280px, 80vw);
}

.payment-guide-qr-hint {
  margin: 0.5rem 0 0;
  text-align: center;
}

.payment-guide-meta {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  border-top: 1px dashed #e2e8f0;
}

.payment-guide-meta li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
}

.payment-guide-details {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.payment-guide-details summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
}

.wallet-pending-qr {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8faf8;
  border: 1px solid #d9e8dc;
  border-radius: 10px;
}

.wallet-pending-qr h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.header-wallet-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  width: auto;
  max-width: 100%;
  align-self: flex-end;
}

.header-wallet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.header-wallet-icon svg {
  display: block;
}

.header-wallet-label {
  flex-shrink: 0;
  opacity: 0.95;
}

.header-wallet-balance {
  font-variant-numeric: tabular-nums;
}

.header-wallet-chip:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
}

.customer-drawer-wallet {
  display: block;
  margin: 4px 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.customer-nav-drawer-head .customer-drawer-wallet {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 6px 0 0;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.customer-nav-drawer-head .customer-drawer-wallet:hover {
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
  color: #fff;
}

.customer-drawer-wallet:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .header-wallet-chip {
    font-size: 0.72rem;
    padding: 4px 8px;
    gap: 4px;
  }

  .header-wallet-icon svg {
    width: 14px;
    height: 14px;
  }
}

.btn.is-wallet-short {
  position: relative;
}

/* ===== Trang nội dung ===== */
.content-page-wrap {
  max-width: 820px;
  margin: 1.5rem auto;
}
.content-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.content-title {
  margin-top: 0;
}
.content-body {
  line-height: 1.7;
}
.content-body img {
  max-width: 100%;
  height: auto;
}

/* ===== Claim (đổi/trả/bù) ===== */
.claim-section {
  margin-top: 1.5rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}
.claim-section-title {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}
.claim-card {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
  background: #fff;
}
.claim-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.claim-reason {
  margin: 0.3rem 0;
}
.claim-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.claim-evidence {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.claim-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.claim-msg {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  max-width: 88%;
}
.claim-msg p {
  margin: 0.2rem 0 0;
}
.claim-msg-customer {
  align-self: flex-end;
  background: #e7f3ea;
}
.claim-msg-system {
  align-self: center;
  background: #fff6e0;
  font-size: 0.9em;
}
.claim-msg-meta {
  font-size: 0.78em;
  color: #777;
}
.claim-proposal {
  margin: 0.3rem 0 0;
  font-size: 0.92em;
  color: #8a5a00;
}
.claim-respond-form textarea,
.claim-new-form textarea {
  width: 100%;
}
.claim-new {
  margin-top: 0.8rem;
}
.claim-new-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.order-bt-transit-badge {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  vertical-align: middle;
}
.order-bt-ship-card .bt-ship-assist-block {
  margin-top: 12px;
}
.order-bt-ship-card .assist-status-pending {
  color: var(--brown-dark);
}
.order-bt-ship-card .assist-status-ok {
  color: var(--green-dark);
}

/* ===== Hành trình giao (delivery legs) ===== */
.order-legs {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
}
.order-legs-title {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.leg-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.leg-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}
.leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  flex: 0 0 auto;
}
.leg-in_transit .leg-dot {
  background: #f0a500;
}
.leg-arrived .leg-dot {
  background: #2e9e5b;
}
.leg-label {
  flex: 1;
}
.leg-status {
  color: #777;
  font-size: 0.85em;
}

.farm-supply-matrix-wrap {
  margin-bottom: 1rem;
}
.farm-supply-matrix .farm-supply-qty {
  width: 4.5rem;
  max-width: 100%;
  text-align: center;
}
.farm-supply-row-mismatch .farm-supply-row-total {
  color: var(--color-danger, #c0392b);
  font-weight: 700;
}
.farm-supply-matrix--readonly {
  background: #fafafa;
}
.farm-supply-matrix--readonly .farm-supply-readonly-qty {
  font-variant-numeric: tabular-nums;
  color: #333;
}
.farm-supply-dispatch-history {
  margin-bottom: 1rem;
}
.farm-supply-dispatch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.farm-supply-dispatch-wave {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.farm-supply-dispatch-wave-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
.farm-supply-dispatch-wave-summary::-webkit-details-marker {
  display: none;
}
.farm-supply-dispatch-wave-time {
  font-size: 0.95rem;
  color: var(--green-dark);
}
.farm-supply-dispatch-wave-body {
  padding: 0 14px 14px;
  border-top: 1px solid #eee;
}
.farm-supply-dispatch-wave-body .farm-supply-matrix-embed {
  margin-bottom: 0;
  padding: 12px 0 0;
}
.settlement-batch-confirm-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.settlement-batch-confirm-block:last-child { border-bottom: 0; }
.settlement-batch-confirm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.report-bar-chart-horizontal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: auto;
  padding: 8px 0;
}
.report-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 120px) 1fr minmax(72px, 96px);
  gap: 10px;
  align-items: center;
}
.report-bar-row-label {
  font-size: 0.82rem;
  color: var(--text-muted, #666);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-bar-row-track {
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
.report-bar-fill-horizontal {
  height: 100%;
  border-radius: 999px;
}
.report-bar-row-value {
  font-size: 0.82rem;
  text-align: right;
  font-weight: 600;
}
.report-bar-fill-orders {
  background: #6b8f71;
}
.finance-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.finance-compare-item strong {
  display: block;
  font-size: 1.15rem;
  margin: 6px 0;
}
.supply-invoice-list .supply-invoice-cards {
  display: none;
}
.supply-invoice-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.supply-invoice-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.supply-invoice-detail-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.supply-invoice-filters-toggle.is-active {
  border-color: var(--brand);
}
@media (max-width: 768px) {
  .supply-invoice-list .supply-invoice-table-wrap {
    display: none;
  }
  .supply-invoice-list .supply-invoice-cards {
    display: grid;
    gap: 12px;
  }
}
@media (min-width: 769px) {
  .supply-invoice-filters:not([aria-hidden="false"]) {
    display: block;
    position: static;
    transform: none;
    max-height: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin-bottom: 14px;
  }
}

.farm-supply-invoice-page .farm-supply-invoice-sheet {
  max-width: 420px;
  margin: 0 auto;
}

/* Trang chốt đơn /gio-hang/chot-don */
.cart-checkout-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: 24px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto 32px;
}

.checkout-section-title {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

.checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-select-toolbar {
  padding: 4px 2px 8px;
  border-bottom: 1px solid #ececec;
}

.checkout-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.checkout-select-all-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.checkout-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--gray-100);
  border: 1px solid #e8e8e8;
  border-radius: 10px;
}

.checkout-item-select-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkout-item-select {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.checkout-item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.checkout-item-body {
  flex: 1;
  min-width: 0;
}

.checkout-item-name {
  display: block;
  font-size: 0.95rem;
}

.checkout-item-pack,
.checkout-item-qty {
  display: block;
  font-size: 0.85rem;
  color: #666;
}

.checkout-item-total {
  color: var(--green);
  white-space: nowrap;
}

.checkout-summary-panel {
  position: sticky;
  top: 12px;
}

.checkout-payment-section {
  margin: 16px 0;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.checkout-payment-options {
  margin-top: 10px;
}

.checkout-payment-scenario,
.checkout-wallet-auto-msg {
  margin: 8px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

#checkout-wallet-auto-msg {
  color: var(--green);
}

#checkout-wallet-shortfall-msg,
#checkout-wallet-empty-msg {
  color: #5a4a00;
}

.order-payment-scenario-hint {
  margin: 8px 0 0;
}

.checkout-totals {
  margin: 16px 0;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.checkout-grand-total-row {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 4px;
}

.checkout-grand-total-row strong {
  color: var(--green);
  font-size: 1.2rem;
}

.checkout-guest-prompt {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-back-link {
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .cart-checkout-layout {
    grid-template-columns: 1fr;
  }
  .checkout-summary-panel {
    position: static;
  }
}

/* Trang chốt đơn — căn lề, chống tràn ngang, tránh FAB che nút */
body.cart-checkout-page .customer-flow-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

body.cart-checkout-page .home-fab-cart {
  display: none;
}

body.cart-checkout-page .cart-checkout-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.cart-checkout-page .cart-checkout-layout > * {
  min-width: 0;
  max-width: 100%;
}

body.cart-checkout-page .checkout-items-section,
body.cart-checkout-page .checkout-summary-panel {
  width: 100%;
  box-sizing: border-box;
}

body.cart-checkout-page .checkout-summary-panel.shop-summary {
  margin-bottom: 0;
}

body.cart-checkout-page .shop-address-summary {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

body.cart-checkout-page .shop-address-summary-row {
  align-items: flex-start;
}

body.cart-checkout-page .checkout-total-row {
  gap: 10px;
}

body.cart-checkout-page .checkout-total-row span {
  flex: 1;
  min-width: 0;
}

body.cart-checkout-page .checkout-total-row strong {
  flex-shrink: 0;
  text-align: right;
}

body.cart-checkout-page .checkout-item-name {
  word-break: break-word;
}

body.cart-checkout-page .checkout-confirm-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.cart-checkout-page .address-mode-option {
  align-items: flex-start;
}

body.cart-checkout-page .address-mode-option input[type="radio"] {
  margin-top: 0.2em;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  body.cart-checkout-page .customer-flow-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.cart-checkout-page .checkout-summary-panel.shop-summary {
    padding: 14px;
  }

  body.cart-checkout-page .checkout-item {
    padding: 10px;
    gap: 10px;
  }
}

/* Chốt đơn trong panel (SHOP_HOME_ONLY) */
.customer-panel-inner.cart-checkout-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 0;
}

.customer-panel-inner.cart-checkout-layout > * {
  min-width: 0;
  max-width: 100%;
}

.customer-panel-inner .shop-address-summary {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.customer-panel-inner .checkout-summary-panel.shop-summary {
  margin-bottom: 0;
}

/* Customer panel stack (SHOP_HOME_ONLY) */
.customer-panel-stack {
  position: fixed;
  inset: 0;
  z-index: 1250;
}
.customer-panel-stack.hidden {
  display: none !important;
}
.customer-panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.customer-panel-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: transparent;
  z-index: 1;
}
.customer-panel-box {
  width: 100%;
  max-width: 640px;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.customer-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  background: var(--white);
}
.customer-panel-back,
.customer-panel-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--brown);
}
.customer-panel-title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}
.customer-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
  background: #faf8f6;
  -webkit-overflow-scrolling: touch;
}
.customer-panel-inner .panel-card {
  margin-bottom: 12px;
}
body.customer-panel-open .cart-drawer,
body.customer-panel-open .cart-overlay {
  z-index: 900;
}
body.customer-panel-open #wallet-topup-modal {
  z-index: 1280;
}
.customer-nav-drawer button.customer-nav-link,
.customer-nav-drawer button.customer-drawer-wallet {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}
@media (min-width: 769px) {
  .customer-panel-modal {
    align-items: center;
    padding: 24px 16px;
  }
  .customer-panel-box {
    max-height: min(92vh, 900px);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  }
}

/* Admin — QR NCC */
.btn-danger-text {
  color: #c62828;
  border-color: #ef9a9a;
}
.btn-danger-text:hover {
  background: #ffebee;
}
.farm-qr-token-list {
  margin: 8px 0 0;
  padding: 12px;
  background: #faf8f6;
  border-radius: 8px;
  border: 1px solid #eee;
}
.farm-qr-token-list-title {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.farm-qr-token-items {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.farm-qr-token-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.farm-qr-token-item:last-child {
  border-bottom: none;
}
.farm-qr-token-preview {
  flex: 0 0 100%;
}
.admin-qr-canvas {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}
.admin-qr-canvas--sm {
  padding: 4px;
}
.badge-qr-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.badge-qr-status--active {
  background: #e8f5e9;
  color: #2e7d32;
}
.badge-qr-status--expired {
  background: #f5f5f5;
  color: #757575;
}
.badge-qr-status--revoked {
  background: #ffebee;
  color: #c62828;
}
.farm-qr-print-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.farm-qr-print-meta {
  text-align: left;
  margin-bottom: 16px;
}
.farm-qr-print-body {
  margin: 16px 0;
}
.farm-qr-print-url {
  word-break: break-all;
  font-size: 0.85rem;
}
.farm-qr-print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.panel-farm-qr-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

/* Admin — Quản lý NCC */
.ncc-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ncc-admin-card {
  padding: 0;
  overflow: hidden;
}
.ncc-admin-collapsible.panel-collapsible-item {
  border: none;
  border-radius: 0;
  background: transparent;
}
.ncc-admin-card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.ncc-admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.ncc-admin-field-priority {
  flex: 1 1 auto;
  max-width: none;
  width: 100%;
}
.ncc-admin-form .full-input,
.ncc-admin-form .qty-input {
  margin: 0;
  max-width: none;
  width: 100%;
}
.ncc-admin-save {
  align-self: stretch;
}
@media (min-width: 769px) {
  .ncc-admin-card-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .ncc-admin-field {
    min-width: 140px;
    width: auto;
  }
  .ncc-admin-field-priority {
    flex: 0 0 100px;
    max-width: 120px;
    width: auto;
  }
  .ncc-admin-save {
    align-self: flex-end;
    width: auto;
  }
}
.ncc-admin-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
}
.ncc-admin-summary {
  margin: 10px 0 4px;
}
.ncc-admin-users {
  margin: 0 0 10px;
}
.ncc-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ncc-modal-box {
  max-width: 560px;
  width: calc(100% - 24px);
  max-height: min(92vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ncc-modal-title {
  margin: 0 0 12px;
  padding-right: 36px;
  font-size: 1.1rem;
}
.ncc-modal-body {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.ncc-detail-section {
  margin-top: 16px;
}
.ncc-detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.ncc-detail-table {
  font-size: 0.9rem;
}
.ncc-detail-meta {
  margin-bottom: 4px;
}
.ncc-qr-print-area {
  text-align: center;
  padding: 12px 0;
}
.ncc-qr-farm-name {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.ncc-qr-canvas {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}
.ncc-qr-url {
  margin: 12px 0;
}
.ncc-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

@media print {
  .panel-sidebar,
  .panel-topbar,
  .panel-page-header,
  .no-print,
  .site-footer,
  .ncc-modal-close,
  .ncc-qr-actions,
  .ncc-qr-url {
    display: none !important;
  }
  .ncc-modal,
  .ncc-modal.hidden {
    display: block !important;
    position: static;
    background: transparent;
  }
  .ncc-modal-box {
    box-shadow: none;
    border: none;
    max-width: 100%;
    max-height: none;
  }
  .farm-qr-print-card {
    box-shadow: none;
    border: none;
  }
  #ncc-qr-print-area,
  .ncc-qr-print-area {
    display: block !important;
  }
}

.ncc-supply-priority-banner {
  border-left: 4px solid var(--green);
  background: linear-gradient(90deg, rgba(45, 106, 79, 0.08), transparent);
}

.address-cascade {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.5rem 0 0.75rem;
}

.address-cascade .form-field {
  margin: 0;
}

.address-cascade select,
.address-cascade input {
  width: 100%;
}

.modal-form .address-cascade {
  margin-bottom: 0.5rem;
}

.checkout-form .address-cascade {
  margin: 0.75rem 0;
}

.ncc-supply-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ncc-supply-badge--pending,
.ncc-supply-badge--submitted {
  color: #b45309;
}

.ncc-supply-badge--approved {
  color: var(--green);
}

.ncc-supply-badge--draft {
  color: #6b7280;
}

.ncc-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.ncc-detail-table tr.ncc-stock-warn td {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

.b2b-supply-amend-form {
  margin: 0 0 12px;
}

.b2b-alert-ok {
  background: rgba(45, 106, 79, 0.12);
  border-color: var(--green);
  color: var(--green-dark, #1d4d38);
}

/* Dispatch slip preview modal */
.dispatch-slip-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.dispatch-slip-modal.hidden { display: none !important; }
.dispatch-slip-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.dispatch-slip-modal-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1200px, 100%);
  max-height: 100vh;
  margin: 0 auto;
  background: var(--panel-bg, #fff);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.dispatch-slip-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.dispatch-slip-modal-title {
  margin: 0;
  font-size: 1.15rem;
}
.dispatch-slip-modal-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.dispatch-slip-modal-body {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.dispatch-slip-modal-controls {
  border-right: 1px solid var(--border, #e5e7eb);
  padding: 14px;
  overflow: auto;
}
.dispatch-slip-control-section + .dispatch-slip-control-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.dispatch-slip-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dispatch-slip-control-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
}
.dispatch-slip-control-actions {
  display: flex;
  gap: 8px;
}
.dispatch-slip-order-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.dispatch-slip-order-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.dispatch-slip-col-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dispatch-slip-col-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  cursor: pointer;
  line-height: 1.35;
}
.dispatch-slip-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.dispatch-slip-modal-preview-wrap {
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}
.dispatch-slip-preview-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dispatch-slip-preview-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.dispatch-slip-print-root {
  display: none;
}
.slip-col-hidden { display: none !important; }
body.dispatch-slip-modal-open { overflow: hidden; }

@media (max-width: 900px) {
  .dispatch-slip-modal-body {
    grid-template-columns: 1fr;
  }
  .dispatch-slip-modal-controls {
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
    max-height: 42vh;
  }
}

@media print {
  body.dispatch-slip-printing * {
    visibility: hidden;
  }
  body.dispatch-slip-printing #dispatch-slip-print-root,
  body.dispatch-slip-printing #dispatch-slip-print-root * {
    visibility: visible;
  }
  body.dispatch-slip-printing #dispatch-slip-print-root {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  body.dispatch-slip-printing .dispatch-slip-preview-card {
    border: 1px solid #000;
    box-shadow: none;
    page-break-after: always;
    break-after: page;
  }
  body.dispatch-slip-printing .dispatch-slip-preview-card:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  body.dispatch-slip-printing .slip-col-hidden {
    display: none !important;
  }
}

/* Invoice preview modal (aliases dispatch-slip modal layout) */
.invoice-preview-modal { /* extends .dispatch-slip-modal */ }
.invoice-header-meta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-end;
}
.invoice-preview-qr {
  text-align: center;
}
.invoice-preview-qr img {
  display: block;
  margin: 0 auto 4px;
}
.invoice-preview-card {
  max-width: 72mm;
  margin: 0 auto;
}
.invoice-preview-modal-preview-wrap .invoice-thermal-sheet {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px dashed #cbd5e1;
  background: #fff;
}
.payment-status-badge {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.78rem;
  vertical-align: middle;
}
.order-card-head .payment-status-badge,
.panel-order-col-extra .payment-status-badge {
  display: inline-block;
  margin-left: 6px;
  margin-top: 2px;
}
.harvest-col-payment-badge {
  margin-top: 4px;
}
.harvest-col-payment-badge .payment-status-badge {
  margin-left: 0;
  font-size: 0.72rem;
}
body.invoice-preview-modal-open { overflow: hidden; }

@media print {
  @page {
    size: 80mm auto;
    margin: 2mm;
  }
  .panel-header,
  .panel-footer,
  .panel-page-header,
  .invoice-actions,
  .no-print {
    display: none !important;
  }
  .invoice-page,
  .panel-card.invoice-page {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  .invoice-thermal-sheet {
    max-width: none;
    width: 100%;
    padding: 0;
  }
}

@media print {
  body.invoice-preview-printing * {
    visibility: hidden;
  }
  body.invoice-preview-printing #invoice-preview-print-root,
  body.invoice-preview-printing #invoice-preview-print-root * {
    visibility: visible;
  }
  body.invoice-preview-printing #invoice-preview-print-root {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 72mm;
    max-width: 72mm;
  }
  body.invoice-preview-printing .invoice-preview-card,
  body.invoice-preview-printing .invoice-thermal-sheet {
    box-shadow: none;
    border: none;
    page-break-after: always;
    break-after: page;
    max-width: none;
    width: 100%;
  }
  body.invoice-preview-printing .invoice-preview-card:last-child,
  body.invoice-preview-printing .invoice-thermal-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

/* Admin — Trung chuyển (kho / cửa hàng Bác Tôm) */
.bt-transit-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bt-transit-page .panel-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bt-transit-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
}
.bt-transit-empty {
  margin: 0;
  padding: 8px 0 4px;
}
.bt-transit-add-card {
  padding: 0;
  overflow: hidden;
}
.bt-transit-add-details {
  border: none;
}
.bt-transit-add-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--green-soft);
  border-bottom: 1px solid var(--surface-border);
}
.bt-transit-add-summary::-webkit-details-marker {
  display: none;
}
.bt-transit-add-summary::after {
  content: "▾";
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--green);
  transition: transform 0.15s ease;
}
.bt-transit-add-details[open] .bt-transit-add-summary::after {
  transform: rotate(180deg);
}
.bt-transit-add-details[open] .bt-transit-add-summary {
  border-bottom-color: var(--surface-border);
}
.bt-transit-add-details .bt-transit-add-form {
  padding: 14px 16px 16px;
}
.bt-transit-add-form.filter-bar-form {
  margin-bottom: 0;
  flex-direction: column;
  align-items: stretch;
}
.bt-transit-add-form .filter-bar-fields {
  align-items: stretch;
  flex-wrap: wrap;
  width: 100%;
}
.bt-transit-add-form .filter-bar-field {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}
.bt-transit-add-form .filter-bar-field-check {
  align-self: stretch;
  width: 100%;
  padding-bottom: 0;
}
.bt-transit-add-form .filter-bar-field-check.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: stretch;
}
.bt-transit-add-form .filter-bar-field-check.checkbox-label span {
  margin-bottom: 0;
}
.bt-transit-add-form .full-input,
.bt-transit-add-form input:not([type="checkbox"]):not([type="radio"]),
.bt-transit-add-form select {
  margin: 0;
  max-width: none;
  width: 100%;
}
.bt-transit-add-form .filter-bar-actions {
  width: 100%;
  margin-top: 4px;
}
.bt-transit-add-form .filter-bar-actions .btn {
  width: 100%;
}
@media (min-width: 769px) {
  .bt-transit-add-form.filter-bar-form {
    flex-direction: row;
    align-items: flex-end;
  }
  .bt-transit-add-form .filter-bar-fields {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
  }
  .bt-transit-add-form .filter-bar-field {
    flex: 1;
    width: auto;
  }
  .bt-transit-add-form .filter-bar-field-grow {
    flex: 1.6;
  }
  .bt-transit-add-form .filter-bar-field-check {
    width: auto;
    align-self: center;
  }
  .bt-transit-add-form .filter-bar-actions {
    width: auto;
    margin-top: 0;
  }
  .bt-transit-add-form .filter-bar-actions .btn {
    width: auto;
  }
}
.bt-transit-pickup-field .checkbox-label {
  margin: 0;
  white-space: nowrap;
}
.bt-transit-table .full-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.bt-transit-table td {
  vertical-align: middle;
}
.bt-transit-table .bt-transit-check {
  justify-content: center;
  width: 100%;
  margin: 0;
}
.bt-transit-delete-form {
  margin: 0;
}
.bt-transit-table .btn-sm {
  white-space: nowrap;
}

/* Card mobile — trung chuyển */
.panel-bt-transit-cards {
  gap: 10px;
}
.panel-bt-transit-card {
  margin-bottom: 0;
}
.panel-bt-transit-card.panel-collapsible-item {
  padding: 0;
}
.bt-transit-card-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bt-transit-card-field {
  margin: 0;
}
.bt-transit-card-field span {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.bt-transit-card-field .full-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  max-width: none;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}
.bt-transit-card-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.bt-transit-card-check {
  margin: 0;
  font-size: 0.9rem;
}
.bt-transit-card-actions {
  margin-top: 4px;
}
.bt-transit-card-delete {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

