:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0f7b5f;
  --brand-dark: #0b5f49;
  --accent: #f0a202;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

/* Logo co chu den + hoa tiet hong, ma topbar mau xanh dam -> phai lot nen trang
   moi doc duoc. Bo goc cho hop voi phan con lai cua giao dien. */
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  background: #fff;
  padding: 4px 8px;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

/* Da co logo (trong logo da co ten roi) -> khong lap lai ten bang chu */
.brand:not(.no-logo) .brand-text strong {
  display: none;
}

.brand strong {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  opacity: 0.8;
}

.search-wrap {
  flex: 1;
  min-width: 120px;
}

.search-wrap input {
  width: 100%;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}

.icon-btn {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

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

.menu-btn {
  display: none;
}

.cart-btn {
  position: relative;
  background: var(--accent);
  color: #1b1b1b;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.track-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.track-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Nút tài khoản: ĐANG ĐĂNG NHẬP phải nhìn phát biết ngay, vì nó quyết định
   khách thấy giá nào. Nền sáng + chấm xanh cho khác hẳn lúc chưa đăng nhập. */
.acct-btn.da-dn {
  background: #fff;
  color: var(--brand);
}

.acct-btn.da-dn::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: #16a34a;
  vertical-align: middle;
}

/* ---------- Ngăn tài khoản ---------- */
.acct-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f0fdf4;
}

.acct-avatar {
  font-size: 26px;
  line-height: 1;
}

.acct-card strong {
  display: block;
  font-size: 15px;
}

.acct-note {
  margin: 10px 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.acct-help {
  margin-top: 18px;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.ghost-btn {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Nhắc đăng nhập ngay trong giỏ — đúng lúc khách đang nhìn số tiền */
.checkout-login {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12.5px;
  line-height: 1.5;
}

.checkout-login .primary {
  flex: none;
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}

/* ---------- Tra cứu / sửa đơn ---------- */
.track-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
}

.track-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.track-form input {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 14px/1.4 inherit;
}

.recent-orders {
  padding: 12px 0;
}

.recent-orders .rc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.recent-orders button {
  display: block;
  width: 100%;
  text-align: left;
  background: #f6f8f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  margin-bottom: 6px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.recent-orders button:hover {
  border-color: var(--brand);
}

.order-card {
  padding: 14px 0;
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.order-code {
  font-size: 17px;
  font-weight: 700;
}

.order-meta {
  font-size: 12px;
  color: var(--muted);
}

.status-pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-wait {
  background: #fff3cd;
  color: #8a6100;
}

.status-busy {
  background: #e0ecff;
  color: #1e4f9c;
}

.status-done {
  background: #e3f2ec;
  color: var(--brand-dark);
}

.status-cancel {
  background: #fdecea;
  color: var(--danger);
}

.order-hint {
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.hint-edit {
  background: #fff8e1;
  color: #7a5c00;
}

.hint-lock {
  background: #eef1f4;
  color: var(--muted);
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  font-size: 15px;
}

.order-total strong {
  font-size: 20px;
  color: var(--brand-dark);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #14181f;
  color: #fff;
  font-size: 12px;
}

.banner {
  padding: 10px 16px;
  background: #fff5d6;
  border-bottom: 1px solid #f0dca0;
  font-size: 13px;
  color: #6b5200;
}

.pricebook-badge {
  background: var(--accent);
  color: #1b1b1b;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Đăng nhập tài khoản ---------- */
.login-box label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.login-box input {
  width: 100%;
}

.login-box .primary {
  width: 100%;
}

.login-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.login-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.login-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.must-change {
  padding: 9px 11px;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #f0dca0;
  color: #7a5c00;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ---------- Lịch sử đơn ---------- */
.history-list {
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.history-list .h-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 6px;
  font: inherit;
  cursor: pointer;
}

.history-row:hover {
  border-color: var(--brand);
}

.history-row .h-code {
  font-weight: 600;
  font-size: 14px;
}

.history-row .h-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Tra cứu khách quen ---------- */
.lookup label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lookup input {
  width: 100%;
}

.lookup-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.lookup-results {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: 240px;
  overflow: auto;
}

.lookup-results button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  cursor: pointer;
  font: inherit;
}

.lookup-results button:last-child {
  border-bottom: 0;
}

.lookup-results button:hover {
  background: #f1f5f4;
}

.lk-name {
  font-weight: 600;
  font-size: 14px;
}

.lk-meta {
  font-size: 12px;
  color: var(--muted);
}

.lk-book {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e3f2ec;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Nhập mã OTP ---------- */
.otp-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #bfe0d1;
  border-radius: 10px;
  background: #f2faf6;
}

.otp-sent {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink);
}

.otp-row {
  display: flex;
  gap: 8px;
}

.otp-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  background: #fff;
}

.otp-confirm {
  padding: 10px 16px;
  font-size: 14px;
  white-space: nowrap;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
}

.chosen-customer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e3f2ec;
  border: 1px solid #bfe0d1;
}

.chosen-customer strong {
  display: block;
  font-size: 14px;
}

.chosen-meta {
  font-size: 12px;
  color: #3d6b5b;
}

.link-btn {
  background: none;
  border: 0;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Gia niem yet bi gach khi khach co bang gia rieng */
.price-was {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ---------- Nhân viên trực Zalo ---------- */
.help-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: #0068ff;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 104, 255, 0.35);
}

.help-fab:hover {
  background: #0055d4;
}

.staff-card {
  max-width: 400px;
  text-align: left;
}

.staff-card h2 {
  text-align: center;
}

.staff-sub {
  text-align: center;
  margin-bottom: 14px !important;
}

.staff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.staff-info {
  flex: 1;
  min-width: 0;
}

.staff-name {
  font-weight: 600;
  font-size: 14px;
}

.staff-role {
  font-size: 12px;
  color: var(--muted);
}

.staff-act {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 17px;
}

.staff-zalo {
  background: #0068ff;
  color: #fff;
}

.staff-call {
  background: #e8f5ee;
  color: var(--brand-dark);
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}

.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-head .icon-btn {
  display: none;
  color: var(--ink);
}

.group-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.group-list button:hover {
  background: #f1f5f4;
}

.group-list button.active {
  background: #e3f2ec;
  color: var(--brand-dark);
  font-weight: 600;
}

.group-list .g-head {
  font-weight: 700;
  margin-top: 6px;
}

.group-list .g-head > span:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.g-icon {
  font-size: 17px;
  line-height: 1;
  width: 22px;
  text-align: center;
  flex: none;
}

.group-list .g-child {
  padding-left: 22px;
  font-size: 14px;
}

.group-list .count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.sidebar-scrim {
  display: none;
}

/* ---------- Danh sách sản phẩm ---------- */
.content-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
}

.content-head h1 {
  font-size: 19px;
  margin: 0;
}

/* ---------- Thanh lọc thương hiệu (cấp 3) ---------- */
.brandbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.brand-chip:hover {
  border-color: var(--brand);
  background: #f1f8f5;
}

.brand-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.brand-chip.more {
  border-style: dashed;
  color: var(--brand-dark);
  font-weight: 600;
}

.brand-chip .n {
  color: var(--muted);
  font-size: 11px;
  margin-left: 5px;
}

.brand-chip.active .n {
  color: rgba(255, 255, 255, 0.8);
}

.card-brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  background: #e8f5ee;
  padding: 1px 7px;
  border-radius: 999px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.card-cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand);
  font-weight: 700;
}

.card-name {
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.stock {
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8f5ee;
  color: #12694f;
  font-weight: 600;
}

.stock.out {
  background: #fdecea;
  color: var(--danger);
}

/**
 * Hàng "giá + Còn hàng" của thẻ khách (chỉ đạo COO 29/08).
 *
 * Khách không còn thấy mã hàng nữa nên dòng `card-meta` biến mất, "Còn hàng"
 * dọn xuống nằm kế giá. Canh theo `baseline` chứ không `center`: chữ "Còn hàng"
 * 12px đứng cạnh giá 18px, canh giữa thì nó trôi lên trông như bị lệch.
 *
 * `flex-wrap` để máy hẹp có chỗ xuống dòng thay vì bóp chữ giá.
 */
.hang-gia {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-dark);
}

.price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions select,
.card-actions input {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  min-width: 0;
}

.card-actions input {
  width: 64px;
  text-align: center;
}

/* ===== Gui anh / tin nhan de len don ===== */

.ai-intro {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.ai-need-login {
  padding: 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13.5px;
  line-height: 1.5;
}

.ai-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ai-label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
  resize: vertical;
}

.ai-or {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin: 10px 0;
}

.ai-file {
  display: block;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.ai-file input {
  display: block;
  margin: 8px auto 0;
  font-weight: 400;
}

.ai-file-name {
  font-size: 12.5px;
  color: var(--muted);
  margin: 6px 0 0;
  text-align: center;
}

#aiGui {
  margin-top: 12px;
}

.ai-quota,
.ai-note {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

.ai-sum {
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 13.5px;
}

.ai-warn {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12.5px;
  line-height: 1.5;
}

.ai-warn-inline {
  margin-top: 6px;
  font-size: 12px;
  color: #9a3412;
}

/* Mot dong may doc duoc. Vien ben trai bao trang thai: xanh = chac,
   cam = can khach chon, do = khong ra. */
.ai-line {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: var(--card);
}

.ai-line.ok {
  border-left-color: #15803d;
}

.ai-line.ask {
  border-left-color: #f0a202;
  background: #fffbeb;
}

.ai-line.no {
  border-left-color: var(--danger);
  background: #fef2f2;
}

.ai-line-head {
  font-size: 13.5px;
  margin-bottom: 4px;
}

.ai-qty {
  color: var(--muted);
  font-size: 12.5px;
}

.ai-hit {
  font-size: 13px;
  font-weight: 600;
  margin: 2px 0;
}

.ai-code {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  margin-left: 4px;
}

.ai-price {
  font-weight: 600;
  margin-left: 6px;
}

.ai-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Máy giải thích vì sao chưa chắc — giúp khách chọn nhanh hơn */
.ai-why {
  margin: 4px 0 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12px;
  line-height: 1.5;
}

.ai-pick {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 12.5px;
  cursor: pointer;
  border-top: 1px solid var(--line);
}

.ai-pick input {
  margin-top: 3px;
  flex: none;
}

/* Ô để khách tự TÌM THEO TÊN khi 3 gợi ý đều không đúng.
   Bắt buộc phải có: đã bỏ nút "không đặt món này" nên nếu thiếu ô này
   khách sẽ kẹt, không đưa được giỏ hàng đi.
   Tìm theo TÊN chứ không phải mã: khách chỉ biết tên món, mã SPxxxxxx là
   ngôn ngữ nội bộ của KiotViet (chỉ đạo COO 18/08). */
.ai-tu-go {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.ai-tu-go label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.ai-tu-go input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

.ai-tim-thay {
  margin-top: 6px;
}

.ai-tim-goi {
  font-size: 11.5px;
  color: var(--muted);
  padding: 2px 0 4px;
}

.ai-tim-goi.sai {
  color: var(--danger);
  line-height: 1.5;
}

/* Mỗi món tìm được là một nút bấm cả hàng — ngón tay dễ trúng trên điện thoại */
.ai-tim-mot {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}

.ai-tim-mot:hover {
  border-color: var(--brand);
  background: #f8fafc;
}

.ai-tim-mot .ai-price {
  flex: none;
  white-space: nowrap;
}

/* Món khách đã bấm chọn — phải nhìn phát biết ngay, vì đây là thứ sẽ vào giỏ */
.ai-tim-mot.chon {
  border-color: #15803d;
  border-width: 2px;
  background: #f0fdf4;
  font-weight: 600;
}

.ai-bo {
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.ai-bo:hover {
  border-color: var(--danger);
  color: var(--danger);
}

#aiVaoGio {
  margin-top: 14px;
}

/* Moc "mua du 1 thung duoc giam" tren the san pham.
   Cua hang chi ban ma le nen khong con o chon quy cach — cho nay chi la GOI Y. */
.case-deal {
  margin: 6px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 12.5px;
  line-height: 1.45;
}

.case-deal .case-save {
  display: block;
  color: #c2410c;
  font-weight: 600;
}

/* Dong nhac trong gio hang */
.line-deal {
  margin-top: 4px;
  font-size: 12px;
  color: #9a3412;
}

.line-deal.ok {
  color: #15803d;
  font-weight: 600;
}

.add-btn {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.add-btn:hover {
  background: var(--brand-dark);
}

.sentinel {
  height: 40px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* ---------- Giỏ hàng ---------- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(420px, 100%);
  height: 100%;
  background: var(--card);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

/* Nút ✕ đóng ngăn: TO HẲN LÊN (chỉ đạo COO 19/08).
   Ngón tay cần ít nhất 44px mới bấm trúng dễ dàng — nút cũ chỉ ~26px nên hay
   bấm hụt, mà đây là đường thoát duy nhất khi khách lỡ mở nhầm ngăn. */
.drawer-head .icon-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--ink);
}

.drawer-head .icon-btn:hover,
.drawer-head .icon-btn:active {
  background: #e2e8f0;
  color: var(--danger);
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 8px 16px;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.line-name {
  font-weight: 600;
  font-size: 14px;
}

.line-sub {
  font-size: 12px;
  color: var(--muted);
}

.line-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.line-ctrl button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.line-ctrl input {
  width: 54px;
  text-align: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.line-total {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.line-remove {
  background: none;
  border: 0;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-align: right;
}

.checkout {
  border-top: 1px solid var(--line);
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfc;
  max-height: 62vh;
  overflow: auto;
}

.checkout label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.checkout input,
.checkout select,
.checkout textarea {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 14px/1.4 inherit;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

/* ---------- Kho phục vụ & tới lấy tận nơi ---------- */
.branch-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #cfdffb;
  font-size: 13px;
  color: #1e3f77;
}

.pickup-row {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 400 !important;
  color: var(--ink) !important;
}

.pickup-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: none;
}

.pickup-row strong {
  display: block;
  font-size: 14px;
}

.pickup-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Hàng đang hết — vẫn đặt được, thành đơn chờ hàng */
.card.backorder {
  border: 1px solid #f0dca0;
}

.card.backorder .add-btn {
  background: var(--accent);
  color: #1b1b1b;
}

.card.backorder .add-btn:hover {
  background: #d68f02;
}

.stock.wait {
  background: #fff3cd;
  color: #8a6100;
}

.backorder-warn {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #f0dca0;
  color: #7a5c00;
  font-size: 13px;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.total-row strong {
  font-size: 20px;
  color: var(--brand-dark);
}

.primary {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary:disabled {
  background: #9db8ae;
  cursor: progress;
}

.form-msg {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fdecea;
  color: var(--danger);
  font-size: 13px;
}

/* ---------- Modal & toast ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 32, 0.5);
  padding: 20px;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 12px 0 8px;
  font-size: 19px;
}

.modal-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
  white-space: pre-line;
}

.tick {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e3f2ec;
  color: var(--brand);
  font-size: 30px;
  display: grid;
  place-items: center;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #14181f;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 70;
  box-shadow: var(--shadow);
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 14px 12px 60px;
  }

  .menu-btn {
    display: block;
  }

  /* Man hinh hep: van hien LOGO (khach nhan ra shop ngay), nhung bo dong chu
     "1686 san pham" de con cho cho o tim kiem. Chua co logo thi an han nhu cu. */
  .brand {
    display: flex;
  }

  .brand.no-logo {
    display: none;
  }

  .brand .brand-text {
    display: none;
  }

  /* Logo nhuong cho cac nut: co lai duoc, khong bao gio day nut ra ngoai khung */
  .brand {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .brand-logo {
    height: 28px;
    max-width: 110px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 45;
    width: min(300px, 85%);
    height: 100%;
    max-height: none;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-head .icon-btn {
    display: block;
  }

  .sidebar-scrim.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 32, 0.45);
    z-index: 44;
  }

  /**
   * Thu gon nut gio hang / don de chua tim kiem rong hon tren dien thoai.
   *
   * ── DA THU GIU CHU "Đơn" O DAY, KHONG DUOC ──
   * COO bao 29/08 "xem lại trên điện thoại, ko xem đc": cua vao don tren dien
   * thoai chi con dau 🔎, ma kinh lup ai cung doc thanh "tim kiem".
   *
   * Thu them chu "Đơn" canh dau thi do duoc: chu can **73px** ma nut chi duoc
   * **52px** -> bi cat. Thu noi nut (`flex:0 0 auto`) thi ca hang co lai con
   * 26px moi nut — hong nang hon.
   *
   * Nen chua o CHO KHAC: doi dau thanh 🧾 (hoa don) trong `index.html`. Khong
   * dung mot pixel bo cuc nao, ma nhin phat hieu ngay la cho xem don.
   */
  .cart-label,
  .track-label {
    display: none;
  }


  /* Man hinh hep: logo + 5 nut + o tim khong the nhet chung MOT HANG.
     Truoc day nhet chung nen tong 397px tren man 375px -> ca trang cuon ngang duoc;
     them nut tai khoan thanh 451px. Bop nho lai thi vua khung nhung o tim con 28px,
     khong go noi. Nen cho o tim XUONG HANG RIENG, rong het be ngang. */
  .topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .search-wrap {
    order: 10; /* day xuong cuoi -> tu dong thanh hang thu hai */
    flex-basis: 100%;
    min-width: 0;
  }

  /* DAN DEU CAC NUT tren hang dau (chi dao COO 19/08).
     Truoc day logo chiem cho tuy hung roi cac nut don ve phai, nhin lech va
     nut nao cung be. Nay: logo giu ben trai, 4 nut chia deu phan con lai. */
  .brand {
    margin-right: auto;
  }

  .topbar .track-btn,
  .topbar .cart-btn {
    display: grid;
    place-items: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 76px;
    height: 44px; /* du to cho ngon tay bam trung */
    padding: 0;
    font-size: 19px;
  }

  /* Nut ☰ danh muc: TO HON NUA — no la cua vao toan bo nhom hang */
  .menu-btn {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    padding: 0;
    font-size: 26px;
    line-height: 1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
  }

  .menu-btn:active {
    background: rgba(255, 255, 255, 0.35);
  }

  .pricebook-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .help-fab {
    right: 12px;
    bottom: 12px;
    padding: 12px 14px;
  }

  .help-fab-label {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .card-actions input {
    width: 52px;
  }

  .card-actions .add-btn {
    flex: 1;
  }

  .checkout {
    max-height: none;
  }
}

/* ---------- Hàng khách hay mua ---------- */
/* Đặt trên cùng cột trái và tô khác hẳn: quán mua đi mua lại vài chục mã cố định,
   đây mới là thứ họ cần chứ không phải lục 1694 mã. */
.g-head.hay-mua {
  background: #fffbeb;
  border-left: 3px solid var(--accent);
  font-weight: 700;
}

.g-head.hay-mua.active {
  background: #fef3c7;
}

/* Nút đặt lại đơn cũ */
.order-repeat-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.order-card .ghost-btn {
  margin-top: 8px;
}

/* ---------- Khu nhân viên trực (góc trái dưới) ---------- */
/* Cố ý làm KÍN ĐÁO: khách chỉ thấy một dòng chữ xám nhỏ ở đáy cột trái.
   Chỉ khi nhân viên đăng nhập nó mới nổi lên và hiện số đơn đang chờ. */
.nv-goc {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nv-mo {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.nv-mo:hover {
  background: #f1f5f9;
  border-color: var(--line);
}

.nv-goc.da-vao .nv-mo {
  background: #ecfdf5;
  border-color: #86efac;
  color: var(--brand-dark);
  font-weight: 700;
}

/* Số đơn đang chờ — phải đập vào mắt, đơn nằm chờ là khách đang đợi */
.nv-dem {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.nv-drawer {
  width: min(560px, 100%);
}

.nv-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.nv-thanh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.nv-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.nv-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.nv-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.nv-don {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}

.nv-don-dau {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.nv-ma {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
}

.nv-don-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* Mọi thứ nhân viên PHẢI đọc trước khi bấm duyệt */
.nv-canh {
  margin: 6px 0;
  padding: 7px 9px;
  border-radius: 7px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12px;
  line-height: 1.5;
}

/**
 * Ghi chú nhân viên gõ tay trên đơn KiotViet ("chua soạn + ĐÃ IN 28/08...").
 * Đây là THỨ DUY NHẤT cho biết đơn đã soạn tới đâu — API không có trường nào —
 * nên người trực phải nhìn thấy nó trước khi bấm gộp. Cho nền trắng + viền đậm
 * để nó nổi hẳn khỏi băng vàng bao quanh, đọc lướt cũng không sót.
 */
.nv-ghichu-don {
  margin: 6px 0 4px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #d97706;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap; /* nhân viên hay xuống dòng trong ghi chú */
}

.nv-hangs {
  margin: 10px 0;
  border-top: 1px solid var(--line);
}

.nv-hang {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.nv-hang-ten {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.nv-hang-sl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.nv-hang-sl input {
  width: 68px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  text-align: right;
}

.nv-hang-gia {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.nv-tong {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 2px;
  font-size: 13px;
}

.nv-tong strong {
  font-size: 17px;
  color: var(--brand-dark);
}

.nv-xong {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  font-size: 12.5px;
}

.nv-nut {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.nv-nut .primary {
  flex: 2;
}

.nv-nut .ghost-btn {
  flex: 1;
  width: auto;
}

@media (max-width: 900px) {
  .nv-drawer {
    width: min(560px, 100%);
  }
}

/* ---------- Đang thêm hàng vào đơn đang chờ ---------- */
/* Dải băng CỐ ĐỊNH trên đầu trang. Cố ý chói mắt: khách bấm Gửi mà ra kết quả
   khác thứ họ nghĩ (gộp vào đơn cũ thay vì tạo đơn mới) là hỏng, nên phải
   không thể không thấy mình đang ở chế độ nào. */
.thanh-them-don {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 14px;
  background: var(--accent);
  color: #1b1b1b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.thanh-them-don button {
  padding: 5px 14px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.thanh-them-don button:hover {
  background: #fff;
}

/* Có băng rồi thì thanh trên không được đè lên nó */
body.dang-them-don .topbar {
  z-index: 29;
}

/* Trấn an khách ngay chỗ họ đang lưỡng lự bấm Gửi */
.submit-trust {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #14532d;
}

/* ---------- ⑦ Nút "thêm cho đủ thùng" ngay trong giỏ ---------- */
/* Bắt khách tự tính rồi tự gõ là mất một nửa số người chịu làm — nên đặt
   nút ngay cạnh lời nhắc, bấm phát xong. */
.line-deal {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.deal-them {
  flex: none;
  padding: 5px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #fffbeb;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #7a5c00;
  cursor: pointer;
  white-space: nowrap;
}

.deal-them:hover {
  background: var(--accent);
  color: #1b1b1b;
}

/* ---------- ⑧ Mời cài lên màn hình chính ---------- */
.cai-app {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  line-height: 1.5;
  color: #1e3a8a;
}

.cai-app strong {
  flex: none;
}

.cai-app span {
  flex: 1;
  min-width: 180px;
}

.cai-app .primary {
  flex: none;
  width: auto;
  padding: 8px 18px;
  font-size: 13px;
}

/* ---------- ⑨ Tháng này ---------- */
.thang-nay {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f7b5f, #0b5f49);
  color: #fff;
}

.tn-tieu {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

.tn-so {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.tn-so > div {
  display: flex;
  flex-direction: column;
}

.tn-so strong {
  font-size: 21px;
  line-height: 1.2;
}

.tn-so span {
  font-size: 11.5px;
  opacity: 0.8;
}

/* Phần tiết kiệm là lý do khách quay lại — cho nó nổi hơn hai số kia */
.tn-loi strong {
  color: var(--accent);
}

/* ---------- ⑩ Tới kỳ mua lại ---------- */
.toi-ky {
  margin: 6px 0 2px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  font-size: 11.5px;
  line-height: 1.4;
  color: #7a5c00;
}

/* ---------- Đặt hàng bằng giọng nói ---------- */
.ai-ghi {
  margin-bottom: 12px;
}

.ai-ghi-nut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.ai-ghi-nut:hover {
  border-color: var(--brand);
  background: #f8fafc;
}

.ai-ghi-nut #aiGhiIcon {
  font-size: 20px;
  line-height: 1;
}

/* ĐANG GHI phải nhìn phát biết ngay — micro bật mà khách tưởng đã tắt là
   chuyện rất khó chịu, nên cho nó đỏ và nhấp nháy. */
.ai-ghi-nut.dang-ghi {
  border-color: var(--danger);
  border-width: 2px;
  background: #fef2f2;
  color: var(--danger);
  animation: ghi-nhay 1.2s ease-in-out infinite;
}

@keyframes ghi-nhay {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.35); }
  50% { box-shadow: 0 0 0 7px rgba(192, 57, 43, 0); }
}

/* Người dùng bật "giảm chuyển động" thì đừng nhấp nháy vào mắt họ */
@media (prefers-reduced-motion: reduce) {
  .ai-ghi-nut.dang-ghi {
    animation: none;
  }
}

.ai-ghi-trang {
  /* Hướng dẫn bật micro dài nhiều dòng — phải xuống dòng đúng chỗ mới đọc được */
  white-space: pre-line;
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  min-height: 1px;
}

/* Chỉ khung vàng khi ĐANG BÁO LỖI. Dòng "Đang nghe… 5s" là trạng thái bình
   thường, đóng khung cảnh báo vào là khách tưởng có chuyện. */
.ai-ghi-trang.loi {
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 9px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #7a5c00;
}

#aiGhiNghe {
  display: block;
  width: 100%;
  margin-top: 8px;
}

/* Máy nghe được gì — khách đọc một dòng là biết nghe đúng hay nhầm */
.ai-nghe {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  line-height: 1.55;
  color: #1e3a8a;
}


/* ---------- Gợi ý khi tìm không ra ---------- */
/* Đo 19/08: gõ sai một chữ ("toranni") ra 0 kết quả rồi hết — khách bí lối.
   Nay vẫn đưa ra mấy món gần đúng, bấm phát là tới. */
.trong-tieu {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.trong-phu {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.trong-goiy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.trong-mot {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.trong-mot:hover {
  border-color: var(--brand);
  background: #f8fafc;
}

/* ---------- Ngón tay bấm được: mọi thứ ít nhất 44px ---------- */
/* Đo 19/08 trên màn 375px, các chỗ dưới đây đều dưới 44px nên hay bấm hụt. */
@media (max-width: 900px) {
  /* Ô tìm kiếm — thứ khách chạm nhiều nhất */
  .search-wrap input {
    height: 44px;
    font-size: 16px; /* dưới 16px là iPhone tự phóng to trang khi bấm vào ô */
  }

  /* Nút ✕ đóng cột danh mục — trước 31×32, hay bấm trượt ra ngoài rồi đóng nhầm */
  .sidebar-head .icon-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 22px;
  }

  /* Dòng nhóm hàng trong cột trái */
  .g-head,
  .g-child {
    min-height: 46px;
  }

  /* Chip lọc thương hiệu */
  .brand-chip {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* Ô số lượng + nút Thêm trên thẻ hàng */
  .card-actions input,
  .card-actions .add-btn {
    height: 46px;
    font-size: 16px; /* cùng lý do: tránh iPhone tự phóng to */
  }

  /* Nút +/− và ô số trong giỏ */
  .line-ctrl button,
  .line-ctrl input {
    min-width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ---------- Ảnh sản phẩm trên thẻ hàng ---------- */
/* 98% mặt hàng có sẵn ảnh trên KiotViet mà web chưa dùng. Chủ quán nhớ MẶT chai
   siro chứ ít ai nhớ "Torani Siro Đào 750ml" — có ảnh thì lướt bằng mắt nhanh
   hơn nhiều, và trang cũng ra dáng cửa hàng thật chứ không phải bảng kê hàng. */
.card-anh {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.card-anh img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Ảnh chưa tải xong thì hiện nền xám, đừng để thẻ nhảy giật khi ảnh về */
  background: #f8fafc;
}

/* Không có ảnh hoặc ảnh hỏng — để ô vỡ còn xấu hơn không có ảnh */
.card-anh.trong {
  font-size: 30px;
  opacity: 0.35;
}

.card-anh.trong img {
  display: none;
}

/* ---------- Mục "Bán chạy nhất" ---------- */
.g-head.ban-chay {
  background: #fff1f2;
  border-left: 3px solid var(--danger);
  font-weight: 700;
}

.g-head.ban-chay.active {
  background: #ffe4e6;
}

/* Màn hình hẹp: 2 thẻ một hàng cho ảnh đủ to mà vẫn thấy được nhiều món */
@media (max-width: 900px) {
  .card-anh {
    margin-bottom: 8px;
  }
}

/* Giá gốc gạch ngang trong lịch sử đơn — cho thấy dòng đó ĐÃ được giảm */
.line-cu {
  margin-left: 4px;
  color: var(--muted);
  opacity: 0.8;
}

/* ═══════════ Soát đơn AI: sửa số lượng · thêm hàng tay ═══════════ */

.ai-sl-sua {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.ai-sl-sua label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 16px để iOS không tự phóng to trang khi khách chạm vào ô */
.ai-sl-sua input {
  width: 88px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  min-height: 44px;
}

/* Dòng quy đổi "1 thùng = 12 Chai" — chỗ này từng sai nên phải nói to, rõ */
.ai-qd {
  margin-top: 4px;
  font-size: 13px;
  color: var(--brand-dark);
}

.ai-qd:empty {
  display: none;
}

.ai-qd.cho {
  color: var(--muted);
  font-style: italic;
}

.ai-qd.sai {
  color: #8a6100;
  background: #fff3cd;
  padding: 6px 9px;
  border-radius: 8px;
  font-style: normal;
}

/* "Không đúng món? Đổi món khác" — kín đáo hơn nút chính, nhưng phải đủ to để
   bấm trúng trên điện thoại (44px). Máy nói "chắc chắn" không có nghĩa là đúng. */
.ai-doi {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--brand-dark);
  font-weight: 600;
  cursor: pointer;
}

.ai-doi:hover {
  background: #f0fdf4;
  border-color: var(--brand);
}

.ai-tag-tay {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  background: #e8f5ee;
  padding: 1px 7px;
  border-radius: 999px;
}

.ai-them {
  margin: 16px 0 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fafafa;
}

.ai-them-tieu {
  font-weight: 700;
  margin-bottom: 8px;
}

.ai-them input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  min-height: 44px;
}

/* ═══════════ Dải báo ĐÃ ĐĂNG NHẬP ═══════════ */

.dn-bang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #ecfdf5;
  border-bottom: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 13.5px;
  line-height: 1.4;
}

/* Logo khách trong dải đăng nhập — nền trắng để logo nào cũng nổi, kể cả logo
   nền trong suốt hay logo tối màu. `object-fit: contain` để không méo hình. */
.dn-logo {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #a7f3d0;
  padding: 2px;
}

.chao-logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px;
}

.chao-ten {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.dn-cham {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
}

.dn-chu {
  flex: 1;
  min-width: 0;
}

.dn-chu strong {
  font-weight: 700;
}

.dn-doi {
  flex: none;
  border: 1px solid #a7f3d0;
  background: #fff;
  color: #065f46;
  border-radius: 8px;
  padding: 6px 12px;
  min-height: 34px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.dn-doi:hover {
  background: #d1fae5;
}

/* Điện thoại: tên quán có thể dài, cho xuống dòng thay vì đẩy nút "Đổi" ra ngoài */
@media (max-width: 560px) {
  .dn-bang {
    padding: 7px 10px;
    font-size: 12.5px;
  }
}

/* ═══════════ Tóm tắt luật CTKM (đầu mục Hàng khuyến mãi) ═══════════ */

.ctkm-tomtat {
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.ctkm-tomtat > div {
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Khách VIP — nói rõ KHÔNG cần mua nhiều, kẻo nhìn thang bậc lại tưởng phải gom */
.tt-vip {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
}

.tt-thuong {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--brand-dark);
}

/* Nhắc chốt sớm — vàng cảnh báo, không đỏ (đây là lời khuyên, không phải lỗi) */
.tt-gap {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.chao-vip {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Dòng giá: mấy con số là thứ khách đọc trước, cho nhỉnh hơn phần còn lại */
.chao-vip-gia {
  margin: 0;
}

/**
 * Dòng hạn dùng màu cam giục — khác màu tím của khối ưu đãi để mắt tách được
 * "được lợi bao nhiêu" với "còn bao lâu", hai ý khác nhau nằm chung một khối.
 */
.chao-vip-han {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px dashed #c7d2fe;
  color: #9a3412;
  font-size: 13px;
}

.chao-gap {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #9a3412;
}

/**
 * Dòng "nhóm nổi bật" NẰM TRONG hộp ưu đãi VIP — cùng một hộp, hai ý.
 * Vạch đứt ngăn ở trên để mắt tách được "ưu đãi riêng của mình" với "mấy nhóm
 * khác đang giảm", mà không phải đẻ ra hộp thứ hai (COO báo trùng 23/08).
 */
.chao-vip-them {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px dashed #c7d2fe;
  color: #9a3412;
  font-size: 13px;
}

/** Khách thường chỉ có mỗi khối này — nền cam nhạt, đứng riêng một hộp. */
.chao-noibat {
  margin: 8px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13.5px;
  line-height: 1.55;
}

.tt-noibat {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.tt-noibat em {
  color: #b45309;
  font-style: normal;
  opacity: 0.85;
}

/* ═══════════ Vạch ngăn: hết gợi ý, bên dưới là cả danh mục ═══════════ */

/* `1 / -1` để vạch chạy hết bề ngang lưới, không bị nhét thành một ô như thẻ hàng */
.vach-noi-tiep {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.vach-noi-tiep::before,
.vach-noi-tiep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ═══════════ Chuông báo đơn mới (nhân viên trực) ═══════════ */

.nv-chuong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.nv-chuong-bat,
.nv-chuong-tat {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 44px; /* ngón tay bấm trúng ngay lần đầu */
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nv-chuong-bat {
  background: var(--brand);
  color: #fff;
}

.nv-chuong-tat {
  background: #fee2e2;
  color: #991b1b;
}

.nv-chuong-trang {
  font-size: 12.5px;
  color: var(--muted);
}

/*
 * NHẤP NHÁY khi có đơn mới.
 *
 * Chỉ đổi màu nền/viền — KHÔNG dùng overlay, không `pointer-events`, không
 * `position: fixed` phủ lên gì cả. Nhân viên phải bấm duyệt được ngay trong lúc
 * đang nháy; cảnh báo mà chặn thao tác thì chính nó làm đơn chậm hơn.
 */
@keyframes nv-nhay {
  0%, 49% {
    background: #fee2e2;
    border-color: #dc2626;
  }
  50%, 100% {
    background: #fff7ed;
    border-color: #f59e0b;
  }
}

.nv-goc.nv-bao .nv-mo {
  animation: nv-nhay 0.9s steps(1, end) infinite;
  border: 2px solid #dc2626;
  font-weight: 800;
}

#nvDrawer.nv-bao {
  animation: nv-nhay 0.9s steps(1, end) infinite;
  border-left: 4px solid #dc2626;
}

/* Người bật "giảm chuyển động" trong hệ điều hành: giữ màu đỏ đứng yên, không
   nhấp nháy — vẫn thấy rõ là có đơn mà không gây khó chịu. */
@media (prefers-reduced-motion: reduce) {
  .nv-goc.nv-bao .nv-mo,
  #nvDrawer.nv-bao {
    animation: none;
    background: #fee2e2;
    border-color: #dc2626;
  }
}

/* ═══════════ CTKM ═══════════ */

/* Giá riêng của bạn — chỉ vài khách có, để nổi hẳn cho họ thấy ngay */
.g-head.gia-rieng {
  background: #eef2ff;
  border-left: 3px solid #4f46e5;
  font-weight: 700;
}

.g-head.gia-rieng.active {
  background: #e0e7ff;
}

.g-head.ctkm {
  background: #f0fdf4;
  border-left: 3px solid var(--brand);
  font-weight: 700;
}

.g-head.ctkm.active {
  background: #dcfce7;
}

/* Thẻ hàng trong mục CTKM cần position để đóng dấu lên trên */
.card.ctkm-con,
.card.ctkm-het {
  position: relative;
}

.card.ctkm-con {
  border: 1px solid #86efac;
}

/* Thang bậc CTKM trên thẻ hàng — rỗng thì biến mất hẳn */
.ctkm-bac {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--brand-dark);
  background: #f0fdf4;
  border-radius: 8px;
  padding: 6px 9px;
}

.ctkm-bac:empty {
  display: none;
}

/*
 * Các mốc xếp thành hàng, tự xuống dòng khi hết chỗ. Mỗi mốc là một "viên" nhỏ
 * để mắt tách được "10T 100.000đ" với "20T 99.000đ" — viết liền một dải chữ thì
 * khách phải đọc kỹ mới tách ra được.
 */
.ctkm-thang {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 2px;
}

.ctkm-thang span {
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Bậc khách ĐANG đạt — cho họ thấy mình đang đứng ở đâu trên thang */
.ctkm-thang span.dat {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.ctkm-vip {
  display: block;
  font-style: normal;
  font-weight: 700;
  margin-bottom: 2px;
}

/* Sắp có khuyến mãi — viền cam, khác hẳn xanh (đang chạy) và xám (đã hết) */
.card.ctkm-sap {
  border: 1px solid #fcd34d;
}

.ctkm-nhan.sap {
  background: var(--accent);
  color: #1b1b1b;
}

.ctkm-nhan {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--brand);
  padding: 3px 9px;
  border-radius: 999px;
}

/*
 * HẾT CTKM — làm xám cả thẻ và đóng dấu chéo.
 *
 * Vẫn mua được ở giá thường, nên KHÔNG khoá nút "Thêm": chỉ nói rõ là hết
 * khuyến mãi. Khoá luôn thì khách tưởng hết hàng, mất một đơn không đáng.
 */
.card.ctkm-het .card-anh,
.card.ctkm-het .card-name,
.card.ctkm-het .card-cat,
.card.ctkm-het .price,
.card.ctkm-het .case-deal {
  filter: grayscale(1);
  opacity: 0.55;
}

.ctkm-dau {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  z-index: 2;
  pointer-events: none; /* không được chắn nút bấm bên dưới */
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #b91c1c;
  border: 3px solid #b91c1c;
  border-radius: 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

/* ---------- Trang chào CTKM khi khách bấm link vào ---------- */

.chao-nen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 14, 20, 0.62);
}

.chao-hop {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 26px 22px 20px;
  text-align: center;
}

.chao-hop h2 {
  margin: 8px 0 6px;
  font-size: 20px;
  line-height: 1.3;
}

.chao-icon {
  font-size: 44px;
  line-height: 1;
}

.chao-so {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--ink);
}

.chao-han {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
}

.chao-xem,
.chao-bo {
  width: 100%;
  border: 0;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}

/* 48px: ngón tay bấm trúng ngay lần đầu trên điện thoại */
.chao-xem {
  margin-top: 18px;
  padding: 14px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
}

.chao-xem:hover {
  background: var(--brand-dark);
}

.chao-bo {
  margin-top: 8px;
  padding: 11px;
  min-height: 44px;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
}

.chao-dong {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
}

.chao-dong:hover {
  background: #f1f5f9;
}

/* Man hinh hep: anh vua phai thoi. Anh vuong lam the cao 494px -> mot man hinh
   chi con 2 mon, khach phai cuon lien tuc. Do 20/08. */
@media (max-width: 900px) {
  .card-anh {
    aspect-ratio: 4 / 3;
    margin-bottom: 6px;
  }
}

/* Man hinh hep: day chip thuong hieu CUON NGANG mot hang, dung xuong dong.
   Do 20/08: chip xuong dong chiem 196px -> luoi hang mai 381px moi bat dau,
   mot man hinh chi thay 2 mon. Cuon ngang giu du chuc nang ma chi ton 1 hang. */
@media (max-width: 900px) {
  .brandbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .brandbar::-webkit-scrollbar {
    display: none;
  }

  .brand-chip {
    flex: none;
  }
}

/* Loi moi dang nhap de mo khoa anh + giong noi (duong chu thi ai cung dung duoc) */
.ai-khoa {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.ai-khoa .primary {
  flex: none;
  width: auto;
  padding: 9px 18px;
  font-size: 13px;
}

/* ═══════════ Tra tồn & giá — chỉ nhân viên thấy ═══════════ */

.nv-tra {
  width: 100%;
  margin-top: 6px;
  padding: 5px 8px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.nv-tra:hover {
  background: #e2e8f0;
}

.nv-tra-nen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 14, 20, 0.62);
}

.nv-tra-hop {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
}

.nv-tra-hop h3 {
  margin: 0 28px 2px 0;
  font-size: 15px;
}

.nv-tra-hop h4 {
  margin: 16px 0 6px;
  font-size: 13px;
  color: #334155;
}

.nv-tra-ma {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.nv-tra-dong {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  cursor: pointer;
}

.nv-tra-bang {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nv-tra-bang td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
}

/* Cột số canh phải + font đều chữ số để nhân viên dóng hàng nghìn cho nhanh */
.nv-tra-bang td.so {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nv-tra-trong,
.nv-tra-canh {
  color: #9a3412;
  font-size: 12px;
}

.nv-tra-canh {
  margin: 6px 0 0;
  line-height: 1.45;
}

.nv-tra-loi {
  margin: 24px 0 0;
  color: var(--danger);
  font-size: 13px;
}

/* Kênh khác (Shopee/Lazada/Xuất VAT) — mờ đi để không đọc nhầm thành giá sỉ */
.nv-tra-bang tr.mo td {
  color: #94a3b8;
}

.nv-tra-bang tr.nv-tra-ngan td {
  padding-top: 10px;
  border-bottom: 0;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Tồn từng kho ngay trên thẻ hàng — chỉ nhân viên thấy ── */
.nv-ton {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  margin: 4px 0 2px;
  font-size: 11px;
  line-height: 1.35;
}

.nv-ton-kho {
  padding: 1px 5px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nv-ton-kho b {
  font-weight: 500;
  color: #64748b;
}

/* "đặt N" = hàng đã có người đặt, chưa xuất — tô cam để không cộng nhầm vào tồn */
.nv-ton-kho i {
  color: #b45309;
  font-style: normal;
}

.nv-tra-bang td.dat {
  color: #b45309;
}

/* ── Giá từng bảng giá ngay trên thẻ hàng — chỉ nhân viên thấy ── */
.nv-gia {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1.35;
}

/* Nền xanh nhạt để phân biệt với dãy tồn kho (nền xám) nằm ngay trên */
.nv-gia-o {
  padding: 1px 5px;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1e40af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nv-gia-o b {
  font-weight: 500;
  color: #60a5fa;
}

/* ── Khuyến mãi trong bảng tra của nhân viên ── */
.nv-km {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #fecdd3;
  border-radius: 9px;
  background: #fff1f2;
}

.nv-km-dau {
  margin-bottom: 5px;
  color: #9f1239;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nv-km-muc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.nv-km-muc span {
  padding: 2px 7px;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  background: #fff;
  color: #881337;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nv-km-ghi {
  margin-top: 5px;
  color: #9f1239;
  font-size: 11.5px;
  line-height: 1.4;
}

/* ═══════════ Thẻ hàng khi có nhân viên đăng nhập ═══════════
 *
 * Nhân viên chụp màn hình thẻ gửi khách qua Zalo. Giá phải to và nằm ngay dưới
 * tên hàng, còn dữ liệu nội bộ dồn hết xuống đáy — cắt phần trên là ảnh sạch.
 */
.card.nv-xem .price {
  margin: 2px 0 4px;
  font-size: 26px;
  line-height: 1.15;
}

.card.nv-xem .price small {
  font-size: 13px;
}

/**
 * Khối nội bộ: viền đứt + nhãn "nội bộ" để nhìn phát biết là KHÔNG gửi khách.
 * Đây là lời nhắc bằng mắt, không phải lớp bảo mật — khách không đăng nhập
 * nhân viên thì server không gửi mấy con số này xuống.
 */
.card.nv-xem .nv-khoi {
  position: relative;
  margin-top: 10px;
  padding: 16px 8px 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}

.card.nv-xem .nv-khoi::before {
  content: 'NỘI BỘ — không gửi khách';
  position: absolute;
  top: 3px;
  left: 8px;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.card.nv-xem .nv-khoi .nv-ton,
.card.nv-xem .nv-khoi .nv-gia {
  margin: 0 0 4px;
}

.card.nv-xem .nv-khoi .nv-tra {
  margin-top: 2px;
}

/* ── Ô nhập mã khách — chỉ hiện khi có nhân viên đăng nhập ── */
.nv-okhach {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}

.nv-okhach label {
  display: block;
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.nv-okhach input {
  margin-top: 4px;
  text-transform: uppercase;
}

.nv-okhach-kq {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.nv-okhach-kq.ok {
  color: var(--brand-dark);
}

.nv-okhach-kq.loi {
  color: var(--danger);
}

/* ═══════════ Báo động: web đang chạy danh mục dự phòng ═══════════
 *
 * Dán CỐ ĐỊNH đầu màn hình, hiện dù ngăn duyệt đơn đang đóng — nhân viên hay
 * đóng ngăn cho đỡ vướng, mà lúc đó mới là lúc cần thấy nhất.
 */
.nv-suco {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: #7f1d1d;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: nv-suco-nhay 1.6s ease-in-out infinite;
}

.nv-suco strong {
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

.nv-suco code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11.5px;
}

/* Nháy nhẹ thôi: nhấp nháy gắt cả buổi thì người ta thôi nhìn */
@keyframes nv-suco-nhay {
  0%, 100% { background: #7f1d1d; }
  50% { background: #991b1b; }
}

@media (prefers-reduced-motion: reduce) {
  .nv-suco { animation: none; }
}

/**
 * BĂNG VÀNG — DNS hỏng nhưng web vẫn chạy bằng IP đã nhớ.
 *
 * Đứng yên, KHÔNG nháy: giá và tồn vẫn đúng, đơn vẫn lên được, nên nó chỉ là
 * lời nhắc đi báo VPS. Cho nó nháy như băng đỏ là làm nhờn cái băng đỏ thật.
 */
.nv-suco-nhe {
  background: #78350f;
  animation: none;
}

/* ── Poster CTKM trong hộp chào (COO 31/08) ── */

.chao-poster {
  display: block;
  margin: 14px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--vien, #d6ded9);
  text-decoration: none;
}

.chao-poster img {
  display: block;
  width: 100%;
  height: auto;
  /* Poster CTKM rất cao (1080×4322). Để nguyên là hộp chào dài mấy màn hình,
     khách phải cuộn mãi mới thấy nút "Xem hàng khuyến mãi". Cắt bớt và mời
     bấm để xem lớn. */
  max-height: 46vh;
  object-fit: cover;
  object-position: top;
}

.chao-poster-nhac {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  text-align: center;
  color: #5b6b65;
  background: #f4f6f5;
}

/* Nút "tách thành đơn mới" — khác hẳn nút gộp để nhân viên không bấm nhầm.
   Hai nút này cho ra hai kết quả không thể hoàn tác giống nhau. */
.nv-tach {
  background: #fff;
  color: #a3701a;
  border: 1px solid #e0b872;
  font-weight: 600;
}
