/* ==========================================================================
   1995 Food & Beer — native app design system v22
   Nạp SAU app-mobile-v21.css (điện thoại) / app-mobile-v21-wide.css (màn rộng).
   Mọi selector bắt đầu bằng html.m22 (class do app-shell-v22.js gắn) để thắng
   các lớp cũ mà không cần sửa file v21. Áp dụng ở MỌI độ rộng: trên máy tính
   app hiển thị thành một cột điện thoại ở giữa màn hình (mục 22).
   ========================================================================== */

:root {
  --m22-navy: #0b1a30;
  --m22-navy-2: #14294a;
  --m22-amber: #f2b632;
  --m22-amber-strong: #c98a06;
  --m22-amber-soft: #fdf1d3;
  --m22-bg: #f2f3f7;
  --m22-surface: #ffffff;
  --m22-fill: #f3f4f8;
  --m22-fill-strong: #e8eaf0;
  --m22-ink: #0b1a30;
  --m22-text: #1c2434;
  --m22-muted: #536175;
  --m22-line: rgba(11, 26, 48, 0.08);
  --m22-danger: #e11d48;
  --m22-shadow-card: 0 1px 2px rgba(11, 26, 48, 0.04), 0 8px 24px rgba(11, 26, 48, 0.06);
  --m22-shadow-float: 0 12px 32px rgba(11, 26, 48, 0.16);
  --m22-header-h: 56px;
  --m22-tabbar-h: 64px;
  --m22-band: 112px;
  --m22-frame-w: 430px;
  --m22-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --m22-sat: env(safe-area-inset-top, 0px);
  --m22-sab: env(safe-area-inset-bottom, 0px);
  --app-tabbar-height: var(--m22-tabbar-h);
}

/* --------------------------------------------------------------------------
   1. Font Inter & thang chữ cho điện thoại
   -------------------------------------------------------------------------- */
html.m22 {
  --font-sans: "Inter", Arial, sans-serif;
  --font-mono: "Inter", Arial, sans-serif;
  /* Tailwind: text-xs 12px → 13px, text-sm 14px → 14.5px */
  --text-xs: 0.8125rem;
  --text-xs--line-height: 1.45;
  --text-sm: 0.90625rem;
  --text-sm--line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

html.m22,
html.m22 body,
html.m22 button,
html.m22 input,
html.m22 select,
html.m22 textarea,
html.m22 table,
html.m22 .font-display,
html.m22 .font-mono,
html.m22 svg text {
  font-family: "Inter", Arial, sans-serif !important;
}

html.m22 body {
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

/* Runtime cũ đặt font monospace cho số liệu → đồng bộ về Inter (số đều cột). */
html.m22 :where(.app-main, .recon9-view, .recon9-detail-layer, .ops-overlay, .reset17-modal, .app-modal-sheet) :not(code):not(pre):not(kbd):not(samp) {
  font-family: "Inter", Arial, sans-serif !important;
}

html.m22 :where(.recon9-view, .recon9-detail-layer, .ops-overlay) :is(strong, b) {
  font-variant-numeric: tabular-nums;
}

html.m22 .font-mono,
html.m22 .tabular-nums {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0 !important;
}

html.m22 code,
html.m22 kbd,
html.m22 samp,
html.m22 pre {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace !important;
}

/* Chữ siêu nhỏ (10–11px) của bản web → cỡ đọc được trên điện thoại. */
html.m22 .text-\[9px\] { font-size: 10.5px !important; }
/* text-[9.5px], text-[10.5px] không có trong CSS gốc → chữ bị phóng thành 16px. */
html.m22 .text-\[9\.5px\] { font-size: 11.5px !important; }
html.m22 .text-\[10px\] { font-size: 11.5px !important; }
html.m22 .text-\[10\.5px\] { font-size: 12px !important; }
html.m22 .text-\[11px\] { font-size: 12.5px !important; }
html.m22 .text-\[12px\] { font-size: 13px !important; }

/* Bỏ kiểu VIẾT HOA + giãn chữ của bảng điều khiển web trong nội dung. */
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet, .ops-overlay, .recon9-detail-layer, .reset17-modal) :is(.uppercase, .tracking-wider, .tracking-wide, .tracking-widest),
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) th {
  text-transform: none !important;
  letter-spacing: 0 !important;
}

html.m22 :where(.app-main, .recon9-view) :is(h2, h3) {
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.012em !important;
}

html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) h4 {
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.005em !important;
}

/* --------------------------------------------------------------------------
   2. Nền & khung app
   -------------------------------------------------------------------------- */
html.m22,
html.m22 body {
  background: var(--m22-bg) !important;
  color: var(--m22-text);
}

/* v21 cộng safe-area vào body → đệm hai lần với header/tab bar. */
html.m22 body {
  padding: 0 !important;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

html.m22 .app-shell {
  min-height: var(--app-viewport-height, 100dvh);
  background: transparent !important;
}

html.m22.m22-sheet-open,
html.m22.m22-sheet-open body {
  overflow: hidden !important;
}

html.m22 .app-header,
html.m22 .app-tabbar,
html.m22 button,
html.m22 [role="button"],
html.m22 [role="tab"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html.m22 img,
html.m22 svg {
  -webkit-user-drag: none;
}

/* --------------------------------------------------------------------------
   3. App bar (header) — navy liền thanh trạng thái, tiêu đề thu gọn khi cuộn
   -------------------------------------------------------------------------- */
html.m22 .app-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 60 !important;
  min-height: calc(var(--m22-header-h) + var(--m22-sat)) !important;
  padding: calc(var(--m22-sat) + 8px) 16px 8px !important;
  border: 0 !important;
  background: var(--m22-navy) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: box-shadow 200ms ease;
}

html.m22.m22-scrolled .app-header {
  box-shadow: 0 10px 28px rgba(4, 12, 24, 0.28) !important;
}

html.m22 .app-header__inner {
  max-width: none !important;
  gap: 12px !important;
}

html.m22 .app-brand {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  gap: 10px !important;
}

html.m22 .app-brand > svg,
html.m22 .app-brand > img,
html.m22 .app-brand > div:first-child:not(:last-child) {
  flex: 0 0 auto !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 11px !important;
  box-shadow: 0 0 0 1.5px rgba(242, 182, 50, 0.5) !important;
}

/* Khối chữ: dòng trên là thương hiệu; dòng dưới đổi giữa mô tả ↔ tên màn hình. */
html.m22 .app-brand > div:last-child {
  display: grid !important;
  grid-template-areas: "over" "line";
  align-content: center;
  min-width: 0 !important;
  flex: 1 1 auto;
}

html.m22 .app-brand h1 {
  grid-area: over;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--m22-amber) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: 0.08em !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html.m22 .app-brand h1 > span {
  display: none !important;
}

html.m22 .app-brand p {
  grid-area: line;
  max-width: none !important;
  margin: 1px 0 0 !important;
  overflow: hidden !important;
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  transition: opacity 200ms ease, transform 220ms var(--m22-ease);
}

html.m22 .app-brand > div[data-m22-screen]::after {
  content: attr(data-m22-screen);
  grid-area: line;
  overflow: hidden;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 220ms var(--m22-ease);
}

html.m22.m22-scrolled .app-brand > div[data-m22-screen] p {
  opacity: 0;
  transform: translateY(-8px);
}

html.m22.m22-scrolled .app-brand > div[data-m22-screen]::after {
  opacity: 1;
  transform: none;
}

html.m22 .app-header__actions {
  flex: 0 0 auto !important;
  gap: 8px !important;
}

html.m22 .app-header__actions > span {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 12px !important;
}

/* Avatar tài khoản: chạm để mở bảng tài khoản (đăng xuất nằm trong đó). */
html.m22 .app-user-chip {
  gap: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}

html.m22 .app-user-chip > div:first-child {
  width: 36px !important;
  height: 36px !important;
  border-radius: 999px !important;
  background: var(--m22-amber) !important;
  color: var(--m22-navy) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16) !important;
  transition: transform 120ms ease;
}

html.m22 .app-user-chip:active > div:first-child {
  transform: scale(0.92);
}

html.m22 .app-user-chip > div:not(:first-child),
html.m22 .app-user-chip > button {
  display: none !important;
}

html.m22 .app-header .app-icon-button {
  display: grid !important;
  place-items: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

html.m22 .app-header .app-icon-button svg {
  width: 18px !important;
  height: 18px !important;
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   4. Tiêu đề lớn trên dải navy (cuộn theo nội dung, kiểu iOS)
   -------------------------------------------------------------------------- */
html.m22 .app-main,
html.m22 .recon9-view {
  max-width: none !important;
  padding-right: 16px !important;
  padding-left: 16px !important;
}

html.m22 body.has-app-nav .app-main,
html.m22 body.has-app-nav .recon9-view {
  padding-top: 6px !important;
  padding-bottom: calc(var(--m22-tabbar-h) + var(--m22-sab) + 28px) !important;
}

html.m22 body.has-app-nav .app-main[data-m22-screen],
html.m22 body.has-app-nav .recon9-view[data-m22-screen] {
  background:
    linear-gradient(180deg, var(--m22-navy) 0%, var(--m22-navy-2) 100%) 0 0 / 100% var(--m22-band) no-repeat !important;
}

html.m22 body.has-app-nav .app-main[data-m22-screen]::before,
html.m22 body.has-app-nav .recon9-view[data-m22-screen]::before {
  content: attr(data-m22-screen);
  display: block;
  margin: 0 2px 18px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

/* Hiệu ứng chuyển màn hình khi đổi tab. */
@keyframes m22ScreenIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: none; }
}

html.m22 .m22-screen-enter > * {
  animation: m22ScreenIn 280ms var(--m22-ease) both;
}

/* --------------------------------------------------------------------------
   5. Dải chỉ số (KPI) — chỉ ở màn đầu tiên, vuốt ngang như app ngân hàng
   -------------------------------------------------------------------------- */
html.m22.m22-tab-rest .app-kpi-grid {
  display: none !important;
}

html.m22 .app-kpi-grid {
  display: flex !important;
  gap: 10px !important;
  margin: 0 -16px !important;
  padding: 0 16px 6px !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}

html.m22 .app-kpi-grid::-webkit-scrollbar {
  display: none;
}

html.m22 .app-kpi-card {
  position: relative !important;
  flex: 0 0 auto !important;
  width: 44% !important;
  min-width: 146px !important;
  max-width: 190px !important;
  min-height: 0 !important;
  justify-content: flex-start !important;
  gap: 8px;
  padding: 14px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: var(--m22-shadow-card) !important;
  scroll-snap-align: start;
}

html.m22 .app-kpi-card::before {
  content: none !important;
  display: none !important;
}

html.m22 .app-kpi-card > p:first-child {
  overflow: hidden;
  color: var(--m22-muted) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis;
  text-transform: none !important;
  white-space: nowrap;
}

html.m22 .app-kpi-card > p:last-child,
html.m22 .app-kpi-card > p.text-xl {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--m22-ink) !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  overflow-wrap: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Thẻ đầu tiên nổi bật màu vàng thương hiệu. */
html.m22 .app-kpi-card:first-child {
  background: linear-gradient(140deg, #f8cd5c 0%, #f2b632 55%, #e9a514 100%) !important;
}

html.m22 .app-kpi-card:first-child > p:first-child {
  color: rgba(11, 26, 48, 0.72) !important;
}

/* --------------------------------------------------------------------------
   6. Thẻ nội dung & ô bên trong
   -------------------------------------------------------------------------- */
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) .rounded-md { border-radius: 10px !important; }
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) .rounded-lg { border-radius: 12px !important; }
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) .rounded-xl { border-radius: 16px !important; }
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) .rounded-2xl { border-radius: 20px !important; }

/* Thẻ cấp 1: nền trắng, không viền, bóng mềm, bo 22px. */
html.m22 .app-main .app-surface,
html.m22 .app-main :is(div, section, article).bg-white:is(.rounded-xl, .rounded-2xl, .rounded-3xl)[class~="border"]:not(.app-surface *):not(.app-kpi-card) {
  border: 0 !important;
  border-radius: 22px !important;
  background-color: #ffffff !important;
  box-shadow: var(--m22-shadow-card) !important;
}

html.m22 .app-main .app-surface:hover {
  box-shadow: var(--m22-shadow-card) !important;
}

/* Viền xám trung tính bên trong thẻ → bỏ, dùng nền xám nhạt. */
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet) :is(div, button, a, article, li, label, section, span)[class~="border"]:is(
  .border-\[\#e5e5e7\], .border-slate-100, .border-slate-200, .border-slate-200\/80, .border-slate-200\/60,
  .border-slate-200\/90, .border-slate-100\/80, .border-\[\#f5f5f7\], .border-white\/5
):not(.border-dashed):not(.app-surface) {
  border-color: transparent !important;
}

html.m22 :where(.app-surface, .app-modal-sheet, .recon9-view) :is(div, button, a, article, li, label, section)[class~="border"]:is(
  .bg-white, .bg-\[\#f5f5f7\], .bg-\[\#f8fafc\], .bg-\[\#fcfcfd\], .bg-slate-50, .bg-slate-50\/70
):not(.border-dashed) {
  background-color: var(--m22-fill) !important;
  box-shadow: none !important;
}

/* Ô màu trạng thái (xanh/đỏ/vàng): giữ màu nền, viền nhẹ hơn. */
html.m22 :where(.app-main, .app-modal-sheet) [class~="border"]:is(
  .border-\[\#b7eb8f\], .border-\[\#ffa39e\], .border-\[\#ffe58f\], .border-\[\#91d5ff\], .border-\[\#ffccc7\],
  .border-amber-100, .border-amber-200\/60, .border-amber-200\/80, .border-emerald-100, .border-emerald-200\/60,
  .border-red-100, .border-rose-200\/60, .border-rose-200\/70, .border-rose-200\/80, .border-blue-100, .border-blue-200\/60
):not(button) {
  border-color: transparent !important;
}

/* Đường kẻ phân cách mảnh hơn. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) :is(.border-b, .border-t):is(.border-\[\#e5e5e7\], .border-slate-100, .border-slate-200) {
  border-color: var(--m22-line) !important;
}

/* Huy hiệu/nhãn trạng thái dạng viên thuốc. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) span:is(.rounded, .rounded-md, .rounded-lg, .rounded-full)[class*="px-"] {
  border-color: transparent !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

/* Nhãn vuông → bo 8px (không ép hình viên thuốc: nhãn dài xuống dòng sẽ bị méo). */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) span:is(.rounded, .rounded-md, .rounded-lg)[class*="px-"] {
  border-radius: 8px !important;
}

/* Trạng thái rỗng. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .text-center.italic {
  padding: 26px 12px !important;
  color: var(--m22-muted) !important;
  font-size: 13.5px !important;
  font-style: normal !important;
}

html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .text-center.italic::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7385' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 22px no-repeat,
    var(--m22-fill);
}

html.m22 td.text-center.italic::before {
  display: none;
}

/* --------------------------------------------------------------------------
   7. Nút bấm
   -------------------------------------------------------------------------- */
html.m22 :where(.app-main, .recon9-view, .app-modal-sheet, .app-login) button {
  min-height: 38px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  border-radius: 12px !important;
}

/* Nút chính màu navy. */
html.m22 :where(.app-main, .app-modal-sheet, .app-login) button:is(.bg-\[\#0b1a30\], .bg-slate-900) {
  border: 0 !important;
  background: var(--m22-navy) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(11, 26, 48, 0.2) !important;
}

/* Nút chính màu vàng: nền vàng đặc, chữ navy (tương phản tốt hơn chữ trắng). */
html.m22 :where(.app-main, .app-modal-sheet) :is(button.bg-amber-500, button.bg-amber-400, button.bg-\[\#faad14\], .ops-primary-button) {
  border: 0 !important;
  background: var(--m22-amber) !important;
  color: var(--m22-navy) !important;
  box-shadow: 0 6px 16px rgba(242, 182, 50, 0.32) !important;
}

/* Nút hành động chính chiếm cả hàng: cao 50px, bo 16px. */
html.m22 :where(.app-main, .app-modal-sheet, .app-login) button:is([type="submit"], .w-full) {
  min-height: 50px !important;
  padding: 12px 18px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 16px !important;
}

/* Nút phụ (nền trắng có viền) → nền xám nhạt kiểu app. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) button[class~="border"]:is(.bg-white, .bg-\[\#f5f5f7\], .bg-slate-50, .bg-slate-100):not([type="submit"]) {
  border-color: transparent !important;
  background: var(--m22-fill-strong) !important;
  color: var(--m22-ink) !important;
  box-shadow: none !important;
}

/* Nút nhỏ trong danh sách (Sửa, Xóa, Thêm, Chi tiết). */
html.m22 :where(.app-main, .app-modal-sheet) :is(table button, button[class*="px-2"][class*="py-1"], button[class*="px-3"][class*="py-1"]) {
  min-height: 34px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  border-radius: 999px !important;
}

/* Nút icon. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.app-icon-button, .ops-icon-button, button.w-10.h-10, button.w-8.h-8, button.w-7.h-7) {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 999px !important;
}

html.m22 :where(.app-main, .app-modal-sheet) :is(.app-icon-button, .ops-icon-button) svg {
  width: 17px !important;
  height: 17px !important;
}

/* Bộ tăng/giảm số lượng: vuông 36px, đủ để chạm. */
html.m22 div:has(> input[class*="w-9"]) button,
html.m22 div:has(> input[class*="w-10"]) button,
html.m22 div:has(> input[class*="w-12"]) button,
html.m22 div:has(> input[type="text"][class*="text-center"]) button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  font-size: 17px !important;
}

/* Phản hồi chạm. */
html.m22 button:active:not(:disabled),
html.m22 [role="button"]:active:not([aria-disabled="true"]) {
  transform: scale(0.97);
  opacity: 0.9;
  transition: transform 90ms ease, opacity 90ms ease;
}

/* --------------------------------------------------------------------------
   8. Bộ chuyển (segmented control) & chip lọc
   -------------------------------------------------------------------------- */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button) {
  gap: 2px !important;
  padding: 3px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--m22-fill-strong) !important;
}

html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button {
  min-height: 34px !important;
  padding: 6px 12px !important;
  border: 0 !important;
  border-radius: 11px !important;
  box-shadow: none !important;
  font-size: 12.5px !important;
  white-space: nowrap !important;
}

/* Lựa chọn chưa chọn (không có lớp nền) → trong suốt, chữ xám. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button:not([class^="bg-"]):not([class*=" bg-"]) {
  background: transparent !important;
  color: var(--m22-muted) !important;
}

/* Lựa chọn đang chọn: giữ nền trắng (kiểu iOS) hoặc navy như thiết kế gốc. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button.bg-white {
  background: #ffffff !important;
  color: var(--m22-ink) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(11, 26, 48, 0.12), 0 1px 1px rgba(11, 26, 48, 0.04) !important;
}

html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button:is(.bg-\[\#0b1a30\], .bg-slate-900) {
  background: var(--m22-navy) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(11, 26, 48, 0.25) !important;
}

/* Dải chip/bộ lọc cuộn ngang: không hiện thanh cuộn. */
html.m22 :where(.app-main, .app-modal-sheet) .overflow-x-auto:not(:has(table)) {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

html.m22 :where(.app-main, .app-modal-sheet) .overflow-x-auto:not(:has(table))::-webkit-scrollbar {
  display: none;
}

html.m22 :where(.app-main, .app-modal-sheet) .overflow-x-auto:not(:has(table)) > button {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  border-radius: 999px !important;
}

/* Hàng tiêu đề + bộ chuyển chế độ: thiếu chỗ thì xuống dòng thay vì cắt chữ. */
html.m22 .app-main .flex.items-center.justify-between:has(> .shrink-0:is(.bg-slate-100, .bg-\[\#f5f5f7\]) > button),
html.m22 .app-main .flex.items-center.justify-between.border-b:has(> .shrink-0) {
  flex-wrap: wrap !important;
  row-gap: 10px !important;
}

html.m22 .app-main .flex.items-center.justify-between.border-b:has(> .shrink-0) > :not(.shrink-0),
html.m22 .app-main .flex.items-center.justify-between:has(> .shrink-0:is(.bg-slate-100, .bg-\[\#f5f5f7\]) > button) > :not(.shrink-0) {
  flex: 1 1 auto !important;
  min-width: min(100%, 220px) !important;
}

/* Thẻ thông báo có nút bên phải: chữ được xuống dòng, nút xuống hàng riêng khi chật. */
html.m22 .app-main div:is(.rounded-xl, .rounded-2xl).flex.items-center.justify-between:has(> button.shrink-0):has(.truncate) {
  flex-wrap: wrap !important;
  row-gap: 12px !important;
}

html.m22 .app-main div:is(.rounded-xl, .rounded-2xl).flex.items-center.justify-between:has(> button.shrink-0):has(.truncate) > :not(button) {
  flex: 1 1 60% !important;
  min-width: 0 !important;
}

html.m22 .app-main div:is(.rounded-xl, .rounded-2xl).flex.items-center.justify-between:has(> button.shrink-0):has(.truncate) > button.shrink-0 {
  flex: 1 0 auto !important;
  justify-content: center !important;
}

html.m22 .app-main div:is(.rounded-xl, .rounded-2xl).flex.items-center.justify-between:has(> button.shrink-0) .truncate {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
}

/* Segmented control kiểu iOS: chiếm cả hàng, các lựa chọn chia đều, chữ dài thì
   xuống 2 dòng chứ không tràn ra ngoài màn hình. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button) {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 7px 6px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  white-space: normal !important;
}

html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   9. Ô nhập liệu — kiểu "filled" của app
   -------------------------------------------------------------------------- */
html.m22 :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]), select, textarea) {
  border: 1.5px solid transparent !important;
  border-radius: 14px !important;
  background-color: var(--m22-fill) !important;
  color: var(--m22-ink) !important;
  font-size: 16px !important;
  box-shadow: none !important;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease !important;
}

html.m22 :is(.app-main, .app-modal-sheet, .app-login) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not(.text-center):not([class*="w-9"]):not([class*="w-10"]):not([class*="w-12"]), select) {
  min-height: 48px !important;
}

html.m22 :is(input, select, textarea)::placeholder {
  color: #9aa1b0 !important;
  opacity: 1;
}

html.m22 :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):focus {
  border-color: var(--m22-amber) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(242, 182, 50, 0.2) !important;
  outline: none !important;
}

/* v21 đặt appearance:none cho mọi input trên điện thoại → checkbox/radio vô hình.
   Trả lại giao diện gốc của hệ điều hành, tô màu thương hiệu. */
html.m22 input[type="checkbox"],
html.m22 input[type="radio"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  flex: 0 0 auto;
  width: 20px !important;
  height: 20px !important;
  min-height: 0 !important;
  margin: 0;
  accent-color: var(--m22-navy);
  cursor: pointer;
}

html.m22 :where(.app-main, .app-modal-sheet, .app-login) label {
  color: var(--m22-text);
}

/* --------------------------------------------------------------------------
   10. Thanh tab dưới đáy
   -------------------------------------------------------------------------- */
html.m22 .app-tabbar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 55 !important;
  display: grid !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  grid-auto-flow: column !important;
  gap: 0 !important;
  min-height: calc(var(--m22-tabbar-h) + var(--m22-sab)) !important;
  margin: 0 !important;
  padding: 7px 4px calc(7px + var(--m22-sab)) !important;
  border: 0 !important;
  border-top: 1px solid var(--m22-line) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 -8px 28px rgba(11, 26, 48, 0.07) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  transition: transform 260ms var(--m22-ease), opacity 200ms ease !important;
}

html.m22.m22-keyboard .app-tabbar,
html.m22.m22-sheet-open .app-tabbar {
  transform: translate3d(0, 110%, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.m22 .app-tabbar__item {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  min-width: 0 !important;
  min-height: 50px !important;
  padding: 0 1px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #5b6475 !important;
  transform: none !important;
  opacity: 1 !important;
}

html.m22 .app-tabbar__item:active {
  transform: none !important;
  opacity: 1 !important;
}

html.m22 .app-tabbar__item > :first-child {
  position: relative;
  display: grid !important;
  place-items: center;
  width: 60px;
  max-width: 100%;
  height: 32px;
  margin: 0 auto;
  padding: 5px 0;
  border-radius: 999px;
  box-sizing: border-box;
  transition: background-color 220ms ease, transform 160ms var(--m22-ease);
}

html.m22 .app-tabbar__item:active > :first-child {
  transform: scale(0.9);
}

html.m22 .app-tabbar__item svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 1.9;
  color: currentColor !important;
}

html.m22 .app-tabbar__item > svg:first-child {
  width: 60px !important;
  height: 32px !important;
  padding: 5px 19px;
}

html.m22 .app-tabbar__item > span:last-child {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  color: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  -webkit-line-clamp: unset !important;
}

/* Nhãn ngắn do app-shell-v22.js gắn (attr() đọc thuộc tính của chính span). */
html.m22 .app-tabbar__item > span[data-m22-label]:last-child {
  font-size: 0 !important;
}

html.m22 .app-tabbar__item > span[data-m22-label]:last-child::after {
  content: attr(data-m22-label);
  font-size: 11px;
  line-height: 1.2;
}

html.m22 .app-tabbar__item.is-active {
  color: var(--m22-ink) !important;
}

html.m22 .app-tabbar__item.is-active > :first-child {
  background: var(--m22-amber-soft);
}

html.m22 .app-tabbar__item.is-active svg,
html.m22 .app-tabbar__item.is-active svg.text-amber-500 {
  color: var(--m22-ink) !important;
}

html.m22 .app-tabbar__item.is-active > span:last-child {
  font-weight: 700 !important;
}

html.m22 .app-tabbar__item .absolute,
html.m22 .app-tabbar__item .recon9-nav-badge {
  top: -3px !important;
  right: 10px !important;
  left: auto !important;
  width: auto !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 4px !important;
  border: 2px solid #ffffff !important;
  border-radius: 999px !important;
  background: var(--m22-danger) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 14px !important;
  text-align: center;
  box-sizing: border-box;
  animation: none !important;
}

/* --------------------------------------------------------------------------
   11. Hộp thoại → bottom sheet
   -------------------------------------------------------------------------- */
html.m22 .app-modal-overlay {
  z-index: 70 !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(4, 12, 24, 0.5) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  animation: m22FadeIn 200ms ease both;
}

html.m22 .app-modal-sheet {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  max-height: calc(var(--app-viewport-height, 100dvh) - var(--m22-sat) - 24px) !important;
  margin: 0 !important;
  padding: 0 18px calc(18px + var(--m22-sab)) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  border: 0 !important;
  border-radius: 26px 26px 0 0 !important;
  background: #ffffff !important;
  box-shadow: 0 -12px 40px rgba(4, 12, 24, 0.22) !important;
  animation: m22SheetUp 340ms var(--m22-ease) both !important;
  will-change: transform;
}

html.m22 .app-modal-sheet::before {
  content: "" !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2;
  display: block !important;
  width: 100% !important;
  height: 24px !important;
  margin: 0 0 2px !important;
  border-radius: 0 !important;
  background:
    radial-gradient(closest-side, #cfd5df 98%, transparent) center 10px / 40px 5px no-repeat,
    #ffffff !important;
  opacity: 1 !important;
}

/* Tiêu đề sheet. */
html.m22 .app-modal-sheet > div:first-child h3,
html.m22 .app-modal-sheet > div:first-of-type h3 {
  color: var(--m22-ink) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -0.015em !important;
  text-transform: none !important;
}

/* Hàng nút cuối form luôn hiện ở đáy sheet. */
html.m22 .app-modal-sheet form > div:last-child.border-t,
html.m22 .app-modal-sheet > div:last-child.border-t {
  position: sticky;
  bottom: calc(-18px - var(--m22-sab));
  z-index: 2;
  margin: 0 -18px calc(-18px - var(--m22-sab)) !important;
  padding: 12px 18px calc(12px + var(--m22-sab)) !important;
  border-color: var(--m22-line) !important;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html.m22 .app-modal-sheet form > div:last-child.border-t > button,
html.m22 .app-modal-sheet > div:last-child.border-t > button {
  flex: 1 1 0;
  min-height: 50px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
}

html.m22 .app-modal-sheet.m22-dragging {
  animation: none !important;
  transition: none !important;
}

html.m22 .app-modal-sheet.m22-releasing {
  animation: none !important;
  transition: transform 240ms var(--m22-ease) !important;
}

html.m22 .recon9-detail-layer,
html.m22 .ops-overlay {
  align-items: flex-end !important;
  padding: 0 !important;
}

@keyframes m22SheetUp {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: none; }
}

@keyframes m22FadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   12. Bảng dữ liệu → danh sách thẻ (app-shell-v22.js gắn data-label)
   -------------------------------------------------------------------------- */
html.m22 .app-table-scroll.m22-table-cards,
html.m22 .overflow-x-auto.m22-table-cards {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.m22 table.m22-cards {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

html.m22 table.m22-cards thead {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

html.m22 table.m22-cards tbody {
  display: block !important;
}

/* Mỗi dòng bảng = một thẻ: ô đầu làm tiêu đề, các ô còn lại xếp lưới 2 cột
   (nhãn cột nhỏ phía trên, giá trị phía dưới) cho gọn và thẳng hàng. */
html.m22 table.m22-cards tbody > tr {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin: 0 0 10px !important;
  padding: 14px !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: var(--m22-fill) !important;
}

html.m22 table.m22-cards tbody > tr > td {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  color: var(--m22-ink);
  font-size: 14px !important;
  font-weight: 600;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

html.m22 table.m22-cards tbody > tr > td:not([colspan]) {
  background: transparent !important;
}

html.m22 table.m22-cards tbody > tr > td > * {
  max-width: 100%;
  margin-left: 0 !important;
  text-align: left !important;
}

html.m22 table.m22-cards tbody > tr > td[data-label]::before {
  content: attr(data-label);
  color: var(--m22-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
}

html.m22 table.m22-cards tbody > tr > td:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding-bottom: 10px !important;
  border-bottom: 1px solid var(--m22-line) !important;
  font-size: 15.5px !important;
  font-weight: 700;
}

html.m22 table.m22-cards tbody > tr > td:first-child::before {
  display: none;
}

/* Nhãn xám trong thẻ nền xám → nền trắng để còn thấy hình nhãn. */
html.m22 table.m22-cards td span:is(.bg-slate-100, .bg-slate-50, .bg-\[\#f5f5f7\], .bg-\[\#f8fafc\])[class*="px-"] {
  background: #ffffff !important;
}

/* Ô chứa nút thao tác: nằm trọn một hàng, nút xếp ngang. */
html.m22 table.m22-cards tbody > tr > td:has(button):not(:first-child) {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html.m22 table.m22-cards tbody > tr > td:has(button):not(:first-child)::before {
  flex-basis: 100%;
}

html.m22 table.m22-cards tbody > tr > td[colspan] {
  grid-column: 1 / -1;
  align-items: center;
  border-bottom: 0 !important;
  text-align: center !important;
}

html.m22 table.m22-cards tbody > tr:has(> td[colspan]) {
  background: transparent !important;
}

html.m22 table.m22-cards tfoot,
html.m22 table.m22-cards tfoot tr {
  display: block !important;
}

html.m22 table.m22-cards tfoot td {
  display: flex !important;
  justify-content: space-between;
  padding: 8px 14px !important;
}

/* --------------------------------------------------------------------------
   13. Màn Đối soát (runtime v21)
   -------------------------------------------------------------------------- */
html.m22 .recon9-hero {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px !important;
  padding: 18px !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: linear-gradient(145deg, #1b355d 0%, #0f2240 100%) !important;
  box-shadow: var(--m22-shadow-float) !important;
}

html.m22 .recon9-hero .recon9-refresh {
  align-self: flex-start;
  min-height: 38px !important;
  padding: 8px 16px !important;
  border-radius: 999px !important;
}

html.m22 .recon9-summary-grid {
  gap: 10px !important;
}

html.m22 .recon9-summary-card {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 14px !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: var(--m22-shadow-card) !important;
}

html.m22 .recon9-summary-card__icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
}

html.m22 .recon9-summary-card > div {
  min-width: 0;
}

html.m22 .recon9-summary-card span {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 12.5px !important;
}

html.m22 .recon9-summary-card strong {
  font-size: 22px !important;
}

html.m22 .recon9-filters {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none;
}

html.m22 .recon9-filters > * {
  flex-shrink: 0 !important;
  border-radius: 999px !important;
}

/* Nhãn trong màn Đối soát: viết hoa chữ đầu như phần còn lại của app. */
html.m22 :is(.recon9-view, .recon9-detail-layer) *:not(.recon9-hero__badge) {
  text-transform: none !important;
  letter-spacing: normal !important;
}

html.m22 .recon9-detail-layer small {
  color: var(--m22-muted) !important;
}

/* Lớp chi tiết: chỉ phần nội dung cuộn, thanh tiêu đề (nút Đóng) luôn hiện. */
html.m22 .recon9-detail-layer {
  overflow: hidden !important;
}

html.m22 .recon9-detail-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  background: #ffffff !important;
}

html.m22 .recon9-detail-header h2 {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  line-height: 1.3 !important;
}

.recon9-table-scroll.m22-table-cards {
  overflow: visible !important;
}

/* Dải "Đồng bộ lúc…" thành một dòng thông tin nhỏ, tách khỏi thẻ navy. */
html.m22 .recon9-sync {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  margin: 12px 0 0 !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: var(--m22-muted) !important;
  font-size: 12.5px !important;
}

html.m22 :is(.recon9-case-card, .recon9-debt-card, .recon9-cash-strip, .recon9-controls) {
  border: 0 !important;
  border-radius: 20px !important;
  box-shadow: var(--m22-shadow-card) !important;
}

/* --------------------------------------------------------------------------
   14. Màn Bếp
   -------------------------------------------------------------------------- */
html.m22 .kitchen-quick-action {
  min-height: 58px !important;
  border-radius: 16px !important;
  font-size: 13.5px !important;
  line-height: 1.25 !important;
  text-align: left !important;
  white-space: normal !important;
}

html.m22 .kitchen-quick-action__icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px !important;
}

/* --------------------------------------------------------------------------
   15. Màn đăng nhập
   -------------------------------------------------------------------------- */
html.m22 body:not(.has-app-nav) .app-main {
  padding-bottom: calc(24px + var(--m22-sab)) !important;
}

html.m22 .app-shell:has(.app-login) {
  background:
    linear-gradient(180deg, var(--m22-navy) 0, var(--m22-navy-2) 300px, var(--m22-bg) 300px) !important;
}

html.m22 .app-shell:has(.app-login) .app-header {
  display: none !important;
}

html.m22 .app-shell:has(.app-login) .app-main {
  padding: calc(var(--m22-sat) + 16px) 16px calc(24px + var(--m22-sab)) !important;
}

html.m22 .app-login {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-top: 4px !important;
}

html.m22 .app-login__card {
  padding: 28px 20px !important;
  border: 0 !important;
  border-radius: 26px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 40px rgba(11, 26, 48, 0.12) !important;
}

html.m22 .app-login__card .grid > button,
html.m22 .app-login__card .grid > div {
  min-height: 66px !important;
  padding-right: 4px !important;
  padding-left: 4px !important;
  border-radius: 16px !important;
  white-space: nowrap !important;
}

html.m22.is-standalone .pwa-banner-card {
  display: none !important;
}

html.m22 .pwa-banner-card {
  border-radius: 20px !important;
}

html.m22 .app-shell:has(.app-login) .pwa-banner-card {
  border: 1px solid rgba(242, 182, 50, 0.35) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
}

html.m22 .pwa-banner-card > div:first-child > svg,
html.m22 .pwa-banner-card h4 > span:not(:first-child) {
  display: none !important;
}

/* --------------------------------------------------------------------------
   16. Toast, nút nổi, lớp phủ cũ
   -------------------------------------------------------------------------- */
html.m22 .app-toast-stack {
  top: calc(var(--m22-sat) + 10px) !important;
  right: 12px !important;
  left: 12px !important;
  z-index: 90 !important;
  width: auto !important;
  max-width: none !important;
}

html.m22 .app-toast {
  border-radius: 18px !important;
  box-shadow: var(--m22-shadow-float) !important;
}

html.m22 .ops-launcher {
  bottom: calc(var(--m22-tabbar-h) + var(--m22-sab) + 16px) !important;
}

html.m22 .ops-toast {
  bottom: calc(var(--m22-tabbar-h) + var(--m22-sab) + 16px) !important;
}

html.m22.m22-keyboard .ops-launcher,
html.m22.m22-sheet-open .ops-launcher {
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   17. Màn hình chờ (splash)
   -------------------------------------------------------------------------- */
#m22-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #0b1a30;
  color: #ffffff;
  font-family: "Inter", Arial, sans-serif;
  transition: opacity 320ms ease, visibility 320ms ease;
}

#m22-splash img {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(242, 182, 50, 0.4), 0 18px 40px rgba(0, 0, 0, 0.35);
}

#m22-splash .m22-splash__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#m22-splash .m22-splash__bar {
  position: relative;
  width: 72px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

#m22-splash .m22-splash__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: #f2b632;
  animation: m22SplashBar 1s ease-in-out infinite;
}

@keyframes m22SplashBar {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

#m22-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   18. Kéo để làm mới, mất mạng, thông báo nhanh
   -------------------------------------------------------------------------- */
.m22-ptr {
  position: fixed;
  top: calc(var(--m22-header-h) + var(--m22-sat) + 4px);
  left: 50%;
  z-index: 58;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--m22-navy);
  box-shadow: 0 6px 18px rgba(11, 26, 48, 0.18);
  opacity: 0;
  transform: translate3d(0, -48px, 0) scale(0.7);
  pointer-events: none;
}

.m22-ptr svg {
  width: 18px;
  height: 18px;
}

.m22-ptr.is-ready {
  background: var(--m22-amber);
}

.m22-ptr.is-loading svg {
  animation: m22Spin 0.8s linear infinite;
}

@keyframes m22Spin {
  to { transform: rotate(360deg); }
}

.m22-offline {
  position: fixed;
  top: calc(var(--m22-header-h) + var(--m22-sat) + 8px);
  left: 50%;
  z-index: 59;
  padding: 7px 14px;
  border-radius: 999px;
  background: #b42318;
  color: #ffffff;
  font-family: "Inter", Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(180, 35, 24, 0.3);
  transform: translate3d(-50%, -12px, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--m22-ease);
}

html.m22-offline-on .m22-offline {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.m22-snack {
  position: fixed;
  left: 50%;
  bottom: calc(var(--m22-tabbar-h) + var(--m22-sab) + 16px);
  z-index: 95;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(11, 26, 48, 0.95);
  color: #ffffff;
  font-family: "Inter", Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(4, 12, 24, 0.3);
  transform: translate3d(-50%, 12px, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--m22-ease);
}

.m22-snack.is-visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

/* --------------------------------------------------------------------------
   19. Bảng tài khoản (mở khi chạm avatar)
   -------------------------------------------------------------------------- */
.m22-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 12, 24, 0);
  transition: background-color 240ms ease;
}

.m22-sheet-overlay.is-open {
  background: rgba(4, 12, 24, 0.5);
}

.m22-sheet {
  width: 100%;
  max-width: var(--m22-frame-w);
  padding: 8px 16px calc(16px + var(--m22-sab));
  border-radius: 26px 26px 0 0;
  background: var(--m22-bg);
  color: var(--m22-text);
  font-family: "Inter", Arial, sans-serif;
  box-shadow: 0 -12px 40px rgba(4, 12, 24, 0.22);
  transform: translate3d(0, 100%, 0);
  transition: transform 320ms var(--m22-ease);
}

.m22-sheet-overlay.is-open .m22-sheet {
  transform: none;
}

.m22-sheet__handle {
  width: 40px;
  height: 5px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: #cfd5df;
}

.m22-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(140deg, #14294a 0%, #0b1a30 100%);
  color: #ffffff;
}

.m22-profile__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--m22-amber);
  color: var(--m22-navy);
  font-size: 18px;
  font-weight: 800;
}

.m22-profile__name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.m22-profile__role {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.m22-sheet__list {
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
}

/* !important: v21 ép kiểu cho mọi <button> (bo 9px, bóng, chữ 12px). */
html.m22 .m22-sheet__item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 54px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--m22-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--m22-ink) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  transform: none !important;
  opacity: 1 !important;
  cursor: pointer;
}

html.m22 .m22-sheet__item:last-child {
  border-bottom: 0 !important;
}

html.m22 .m22-sheet__item:active {
  background: var(--m22-fill) !important;
}

.m22-sheet__item svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--m22-muted);
}

html.m22 .m22-sheet__item.is-danger,
html.m22 .m22-sheet__item.is-danger svg {
  color: var(--m22-danger) !important;
}

.m22-sheet__meta {
  margin: 12px 4px 0;
  color: var(--m22-muted);
  font-size: 12px;
  text-align: center;
}

html.m22 .m22-sheet__close {
  width: 100% !important;
  min-height: 50px !important;
  margin-top: 12px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  color: var(--m22-ink) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
}

html.m22 .m22-sheet:focus {
  outline: none !important;
}

/* --------------------------------------------------------------------------
   19c. Sửa lỗi phát hiện khi đo tự động (tương phản, chữ bị cắt, cỡ chữ)
   -------------------------------------------------------------------------- */
/* Màu chữ Ant Design quá nhạt trên nền sáng (tương phản 2.2–2.9) → đậm hơn, đạt ≥ 4.5:1. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay, .app-login) .text-\[\#d48806\] { color: #8f5400 !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay, .app-login) .text-\[\#d48806\]\/80 { color: rgba(143, 84, 0, 0.92) !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay, .app-login) .text-\[\#faad14\] { color: #9a6200 !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay, .app-login) .text-\[\#1890ff\] { color: #0958d9 !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay, .app-login) :is(.text-\[\#52c41a\], .text-\[\#389e0d\]) { color: #237804 !important; }
/* Màu Tailwind (oklch) dưới 4.5:1 trên nền trắng/xám nhạt. Không áp vào thẻ nền navy (giữ chữ sáng ở đó). */
html.m22 :where(.app-main, .app-surface, .app-modal-sheet, .app-login__card, .recon9-view, .recon9-detail-layer, .ops-overlay, .reset17-modal) :is(.text-amber-500, .text-amber-600):not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\], .recon9-hero, .bg-slate-900, .bg-slate-800) *) { color: #a35c04 !important; }
html.m22 :where(.app-main, .app-surface, .app-modal-sheet, .app-login__card, .recon9-view, .recon9-detail-layer, .ops-overlay, .reset17-modal) :is(.text-emerald-500, .text-emerald-600):not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\], .recon9-hero, .bg-slate-900, .bg-slate-800) *) { color: #047857 !important; }
html.m22 :where(.app-main, .app-surface, .app-modal-sheet, .app-login__card, .recon9-view, .recon9-detail-layer, .ops-overlay, .reset17-modal) .text-slate-500:not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\], .recon9-hero, .bg-slate-900, .bg-slate-800) *) { color: #536175 !important; }
html.m22 :where(.app-main, .app-surface, .app-modal-sheet, .app-login__card, .recon9-view, .recon9-detail-layer, .ops-overlay, .reset17-modal) .text-slate-400:not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\], .recon9-hero, .bg-slate-900, .bg-slate-800) *) { color: #646d80 !important; }
/* Dấu "/" ngăn cách màu slate-300: chỉ trang trí, nâng lên ~3:1 cho dễ thấy. */
html.m22 :where(.app-main, .app-surface, .app-modal-sheet, .recon9-view, .ops-overlay) .text-slate-300:not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\], .recon9-hero, .bg-slate-900, .bg-slate-800) *) { color: #8b95a7 !important; }
html.m22 :where(.app-main, .app-surface, .app-modal-sheet, .recon9-view, .ops-overlay) :is(.text-rose-500, .text-rose-600):not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\], .recon9-hero, .bg-slate-900, .bg-slate-800) *) { color: #be123c !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay) .text-\[\#f5222d\]:not(:is(.from-\[\#0b1a30\], .bg-\[\#0b1a30\]) *) { color: #cf1322 !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay) .text-\[\#cf1322\]\/80 { color: #cf1322 !important; }
/* Danh sách hồ sơ Đối soát (CSS runtime v21): mã phiếu cam, chữ xám trên nền xanh nhạt, mũi tên. */
html.m22 .recon9-view .recon9-card-code { color: #a35c04 !important; }
html.m22 .recon9-view .recon9-card-dot { color: #8b95a7 !important; }
html.m22 .recon9-view .recon12-arrow { color: #646d80 !important; }
html.m22 .recon9-view :is(.recon12-step span, .recon9-card-btn span, .recon9-list-heading p) { color: #536175 !important; }

/* Huy hiệu nền màu chữ trắng: nền đậm hơn để chữ trắng đạt ≥ 4.5:1. */
html.m22 .bg-amber-600.text-white { background-color: #b45309 !important; }
html.m22 .bg-\[\#ff4d4f\].text-white { background-color: #cf2f37 !important; }
html.m22 .recon9-view small:not(.recon9-hero small) { color: var(--m22-muted) !important; }
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .text-\[\#86868b\] { color: #5f6778 !important; }

/* Tiêu đề nhóm dạng nhãn xám (h4 xám) → kiểu tiêu đề nhóm iOS: nhỏ, đậm, rõ. */
html.m22 :where(.app-main, .app-modal-sheet) h4.text-\[\#86868b\] {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

/* Chữ bị cắt "…" trong nội dung → cho xuống dòng để đọc đủ (trừ chip/nút cuộn ngang). */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .truncate:not(button):not(button *):not(.overflow-x-auto *):not(.app-kpi-card *) {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
}

/* Ô nhập nằm trong vùng nền xám → nền trắng + viền mảnh, để còn thấy khung ô. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) :is(.bg-\[\#f5f5f7\], .bg-\[\#f8fafc\], .bg-\[\#fcfcfd\], .bg-slate-50, .bg-slate-50\/70, .bg-slate-100, .app-surface [class~="border"].bg-white, .app-modal-sheet [class~="border"].bg-white, .bg-\[\#fffbe6\], .bg-amber-50, .bg-\[\#f6ffed\], .bg-\[\#e6f7ff\]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea):not(:focus) {
  border-color: rgba(11, 26, 48, 0.12) !important;
  background-color: #ffffff !important;
}

/* Nhãn, mã phiếu, ngày giờ dạng viên thuốc: luôn một dòng. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) span[class*="px-"]:is(.rounded, .rounded-md, .rounded-lg, .rounded-full) {
  white-space: nowrap !important;
}

/* Nhãn ngắn bị gãy dòng (app-shell-v22.js phát hiện) → giữ một dòng. */
html.m22 .m22-nowrap {
  white-space: nowrap !important;
}

/* Bộ chuyển từ 3 lựa chọn: chia chỗ theo độ dài chữ, chữ gọn hơn, một dòng. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button:nth-child(3)) > button {
  flex: 1 1 auto !important;
  padding-right: 4px !important;
  padding-left: 4px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

/* Bộ chuyển 4 lựa chọn trở lên (Hôm nay / Tuần này / Tháng này / Năm nay): chữ gọn hơn. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button:nth-child(4)) > button {
  padding-right: 2px !important;
  padding-left: 2px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

/* Bộ chuyển từ 3 lựa chọn trở lên: bỏ icon để chữ nằm gọn một dòng. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button:nth-child(3)) > button svg {
  display: none !important;
}

/* Câu mô tả/nhãn đã bỏ (ui-text-v22.cjs đặt chuỗi rỗng) → ẩn hẳn, không để lại khoảng trống. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .recon9-detail-layer, .ops-overlay, .reset17-modal) :is(p, h2, h3, h4, small, label):empty,
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view, .ops-overlay) span[class*="px-"]:empty,
html.m22 :is(.recon9-hero__badge, .recon9-sync span, .ops-eyebrow, .ops-supplier-settings-entry__eyebrow, .ops-supplier-settings-entry__tab-chip):empty {
  display: none !important;
}

/* Ô nhập trùng màu nền (app-shell-v22.js phát hiện) → nền trắng + viền mảnh. */
/* Lặp lớp để thắng quy tắc ô nhập chung (input:not(...) x5). */
html.m22 body :is(input, select, textarea).m22-input-raised.m22-input-raised.m22-input-raised.m22-input-raised.m22-input-raised:not(:focus) {
  border-color: rgba(11, 26, 48, 0.12) !important;
  background-color: #ffffff !important;
}

/* Ô tải file (hóa đơn, chứng từ) → nút tải kiểu app trong khung nét đứt. */
html.m22 :where(.app-main, .app-modal-sheet) input[type="file"] {
  width: 100% !important;
  min-height: 52px;
  padding: 8px !important;
  border: 1.5px dashed rgba(11, 26, 48, 0.2) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: var(--m22-muted) !important;
  font-size: 13.5px !important;
  cursor: pointer;
}

html.m22 :where(.app-main, .app-modal-sheet) input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--m22-navy);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Ô nhập nằm cùng hàng với nút: ô co lại để nút không bị đẩy ra ngoài thẻ. */
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .flex > :is(input, select, textarea),
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .flex > .relative:has(> input) {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .flex > :is(input, select, textarea) ~ button,
html.m22 :where(.app-main, .app-modal-sheet, .recon9-view) .flex > .relative:has(> input) ~ button {
  flex: 0 0 auto !important;
}

/* Ô chọn (select) chiếm cả hàng như form của app, không co theo chữ. */
html.m22 :where(.app-main, .app-modal-sheet) select {
  width: 100% !important;
  max-width: 100% !important;
}

/* Nút dạng thẻ (chữ căn trái, nhiều dòng) cũng cho chữ xuống dòng thay vì cắt. */
html.m22 :where(.app-main, .recon9-view) :is(button.text-left, .kitchen-stock-alert) .truncate {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
}

/* v21 gắn .app-table-scroll cho mọi vùng cuộn ngang (kể cả dải chip) → bỏ bóng/lề
   của bảng cho các vùng không chứa bảng. */
html.m22 .app-table-scroll:not(:has(table)) {
  margin-right: 0 !important;
  margin-left: 0 !important;
  box-shadow: none !important;
}

/* Thanh tab con gạch chân (VD: Tồn kho sỉ FIFO / Dự báo / Kiểm kê) → thanh tab nền trắng. */
html.m22 .app-main .flex.border-b.overflow-x-auto:has(> button[class*="border-b-2"]) {
  gap: 2px !important;
  padding: 4px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: var(--m22-shadow-card) !important;
}

html.m22 .app-main .flex.border-b.overflow-x-auto > button[class*="border-b-2"] {
  flex: 0 0 auto !important;
  min-height: 38px !important;
  padding: 8px 14px !important;
  border: 0 !important;
  border-radius: 12px !important;
  white-space: nowrap !important;
}

html.m22 .app-main .flex.border-b.overflow-x-auto > button[class*="border-b-2"]:not(.border-transparent) {
  background: var(--m22-amber-soft) !important;
  color: var(--m22-ink) !important;
  font-weight: 700 !important;
}

/* Dải chip lọc cuộn ngang có nền xám: giữ chip theo độ dài chữ, không ép chia đều. */
html.m22 :where(.app-main, .app-modal-sheet) .overflow-x-auto:is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button) {
  overflow-x: auto !important;
}

html.m22 :where(.app-main, .app-modal-sheet) .overflow-x-auto:is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5) > button {
  flex: 0 0 auto !important;
  padding-right: 12px !important;
  padding-left: 12px !important;
  white-space: nowrap !important;
}

/* Chú thích biểu đồ: chữ màu tối, chỉ chấm màu theo dữ liệu. */
html.m22 .recharts-legend-item-text {
  color: var(--m22-text) !important;
}

html.m22 .recharts-legend-wrapper {
  left: 0 !important;
  width: 100% !important;
}

/* Hộp thông báo kiểu app (thay alert() của trình duyệt). */
.m22-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 12, 24, 0);
  transition: background-color 180ms ease;
}

.m22-alert-overlay.is-open {
  background: rgba(4, 12, 24, 0.45);
}

.m22-alert {
  width: min(320px, 100%);
  padding: 22px 20px 16px;
  border-radius: 22px;
  background: #ffffff;
  color: var(--m22-text);
  font-family: "Inter", Arial, sans-serif;
  text-align: center;
  box-shadow: 0 24px 60px rgba(4, 12, 24, 0.3);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 200ms var(--m22-ease), opacity 160ms ease;
}

.m22-alert-overlay.is-open .m22-alert {
  transform: none;
  opacity: 1;
}

html.m22 :is(.m22-alert, .m22-sheet):is(:focus, :focus-visible) {
  outline: none !important;
}

.m22-alert__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}

.m22-alert__icon svg {
  width: 24px;
  height: 24px;
}

.m22-alert.is-success .m22-alert__icon {
  background: #dcfce7;
  color: #15803d;
}

.m22-alert.is-error .m22-alert__icon {
  background: #ffe4e6;
  color: #be123c;
}

.m22-alert__text {
  margin: 0 0 18px;
  color: var(--m22-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

html.m22 .m22-alert__button {
  width: 100% !important;
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--m22-navy) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

/* Trung tâm nhà cung cấp (lớp phủ ops-* của runtime cũ). */
html.m22 .ops-sheet {
  border-radius: 26px 26px 0 0 !important;
}

html.m22 .ops-sheet .ops-icon-button {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 999px !important;
}

html.m22 .ops-tabs button {
  min-height: 38px !important;
  font-size: 13.5px !important;
  border-radius: 12px !important;
}

html.m22 .ops-sheet .ops-secondary-button {
  min-height: 34px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  border-radius: 999px !important;
}

html.m22 .ops-sheet .ops-primary-button {
  min-height: 44px !important;
  border-radius: 14px !important;
  font-size: 13.5px !important;
}

html.m22 :is(.ops-overlay, .recon9-detail-layer, .reset17-modal) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea):not(:focus) {
  border-color: rgba(11, 26, 48, 0.12) !important;
  background-color: #ffffff !important;
}

html.m22 :is(.ops-overlay, .recon9-detail-layer, .reset17-modal) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select) {
  min-height: 46px !important;
}

html.m22 .ops-form-actions {
  gap: 10px !important;
}

html.m22 .ops-form-actions > button {
  flex: 1 1 0 !important;
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 14.5px !important;
}

html.m22 .ops-mini-grid dt {
  color: var(--m22-muted) !important;
  font-size: 11.5px !important;
  letter-spacing: 0.02em !important;
}

html.m22 .ops-mini-grid dd {
  font-size: 13.5px !important;
}

/* Chữ nhỏ hơn 11px (app-shell-v22.js gắn lớp m22-min-font) → 11.5px. */
html.m22 .m22-min-font {
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}

/* Các nhãn nhỏ của runtime cũ. */
html.m22 :is(.ops-supplier-settings-entry__badge, .ops-supplier-settings-entry__eyebrow, .ops-supplier-settings-entry__tab-chip) {
  font-size: 11.5px !important;
  letter-spacing: 0.02em !important;
}

/* Dải chỉ số: 3 thẻ vừa khít một hàng (không còn thẻ bị cắt ở mép phải). */
html.m22 .app-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 0 4px !important;
  overflow: visible !important;
}

html.m22 .app-kpi-grid:has(> .app-kpi-card:nth-child(4)) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.m22 .app-kpi-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  gap: 6px;
  padding: 12px 10px !important;
  border-radius: 18px !important;
}

html.m22 .app-kpi-card > p:first-child {
  font-size: 11.5px !important;
  white-space: normal !important;
  line-height: 1.25 !important;
}

html.m22 .app-kpi-card > p:last-child,
html.m22 .app-kpi-card > p.text-xl {
  font-size: 15px !important;
  letter-spacing: -0.01em !important;
  overflow-wrap: anywhere !important;
}

/* --------------------------------------------------------------------------
   20. Thanh cuộn: ẩn trên thiết bị cảm ứng
   -------------------------------------------------------------------------- */
@media (pointer: coarse) {
  html.m22 ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  html.m22 * {
    scrollbar-width: none;
  }
}

/* --------------------------------------------------------------------------
   21. Máy tính / máy tính bảng: app là một cột điện thoại ở giữa màn hình.
   (app-mobile-v21-wide.css đã quy đổi mọi @media của bản v21 về bố cục 430px.)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  html.m22 {
    background:
      radial-gradient(900px 520px at 50% -8%, rgba(242, 182, 50, 0.14) 0%, transparent 62%),
      linear-gradient(180deg, #0f223f 0%, #070f1c 100%) !important;
    background-attachment: fixed !important;
    scrollbar-width: none;
  }

  html.m22::-webkit-scrollbar {
    display: none;
  }

  html.m22 body {
    background: transparent !important;
  }

  html.m22 #root {
    position: relative;
    max-width: var(--m22-frame-w);
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--m22-bg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 90px rgba(0, 0, 0, 0.55);
  }

  html.m22 .app-shell {
    min-height: 100dvh;
  }

  html.m22 .app-tabbar {
    left: 50% !important;
    right: auto !important;
    width: var(--m22-frame-w) !important;
    transform: translateX(-50%) !important;
  }

  html.m22.m22-keyboard .app-tabbar,
  html.m22.m22-sheet-open .app-tabbar {
    transform: translate(-50%, 110%) !important;
  }

  html.m22 :is(.app-modal-overlay > .app-modal-sheet, .ops-overlay > *, .recon9-detail-layer > *, .reset17-modal > *) {
    max-width: var(--m22-frame-w) !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  html.m22 .app-toast-stack {
    left: 50% !important;
    right: auto !important;
    width: calc(var(--m22-frame-w) - 24px) !important;
    transform: translateX(-50%);
  }

  html.m22 .ops-launcher {
    right: calc(50% - var(--m22-frame-w) / 2 + 14px) !important;
  }

  /* Màn rất rộng: giới thiệu nhỏ bên trái cột app. */
  html.m22 body::before {
    content: "1995 FOOD & BEER\A Ứng dụng quản lý chi phí\A dành cho điện thoại";
    position: fixed;
    top: 50%;
    left: max(32px, calc(50% - var(--m22-frame-w) / 2 - 360px));
    width: 300px;
    color: rgba(255, 255, 255, 0.86);
    font-family: "Inter", Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    white-space: pre-line;
    transform: translateY(-50%);
    pointer-events: none;
  }
}

@media (min-width: 768px) and (max-width: 1179px) {
  html.m22 body::before {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   21b. Rà soát v22.9: biểu đồ, ô tìm kiếm Đối soát, danh sách Cài đặt
   -------------------------------------------------------------------------- */
/* Chữ trục biểu đồ 9–10px → 11px, màu xám đọc được. */
html.m22 .recharts-cartesian-axis-tick-value {
  font-size: 11px !important;
  fill: var(--m22-muted) !important;
}

/* Ô tìm kiếm Đối soát: thẻ label là khung ô, ô nhập bên trong trong suốt (không lồng 2 khung). */
html.m22 .recon9-search {
  min-width: 0 !important;
  height: 44px !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--m22-fill) !important;
  color: var(--m22-muted) !important;
}

html.m22 body .recon9-search input.m22-input-raised.m22-input-raised.m22-input-raised.m22-input-raised.m22-input-raised,
html.m22 body .recon9-search input {
  height: 44px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px !important;
}

/* Bộ chuyển (segmented): vùng chạm tối thiểu 36px. */
html.m22 :where(.app-main, .app-modal-sheet) :is(.bg-\[\#f5f5f7\], .bg-slate-100):is(.p-1, .p-0\.5):has(> button:nth-child(2)) > button {
  min-height: 36px !important;
}

/* Cài đặt: danh sách danh mục mở hết theo trang, không cuộn lồng trong khung 240px. */
html.m22 .app-main[data-m22-screen="Cài đặt"] .divide-y.max-h-60 {
  max-height: none !important;
  overflow: visible !important;
}

/* Lớp Tailwind có trong bundle nhưng CSS gốc không sinh ra (vd. "0phiếu" dính chữ vì thiếu ml-1).
   :where() giữ độ ưu tiên thấp như lớp tiện ích gốc. Lấy từ lần quét className trong bundle
   so với selector trong CSS (2026-10-08); thêm lớp mới vào bundle thì quét lại. */
:where(html.m22) .ml-1 { margin-left: 0.25rem; }
:where(html.m22) .ml-6 { margin-left: 1.5rem; }
:where(html.m22) .mr-1 { margin-right: 0.25rem; }
:where(html.m22) .mt-2\.5 { margin-top: 0.625rem; }
:where(html.m22) .pb-0\.5 { padding-bottom: 0.125rem; }
:where(html.m22) .pt-2\.5 { padding-top: 0.625rem; }
:where(html.m22) .pl-6 { padding-left: 1.5rem; }
:where(html.m22) .pr-2 { padding-right: 0.5rem; }
:where(html.m22) .pr-8 { padding-right: 2rem; }
:where(html.m22) .pr-9 { padding-right: 2.25rem; }
:where(html.m22) .pr-24 { padding-right: 6rem; }
:where(html.m22) .gap-x-3 { column-gap: 0.75rem; }
:where(html.m22) .gap-y-1\.5 { row-gap: 0.375rem; }
:where(html.m22) .w-2 { width: 0.5rem; }
:where(html.m22) .w-9 { width: 2.25rem; }
:where(html.m22) .w-14 { width: 3.5rem; }
:where(html.m22) .w-44 { width: 11rem; }
:where(html.m22) .w-48 { width: 12rem; }
:where(html.m22) .h-9 { height: 2.25rem; }
:where(html.m22) .h-14 { height: 3.5rem; }
:where(html.m22) .h-44 { height: 11rem; }
:where(html.m22) .h-48 { height: 12rem; }
:where(html.m22) .max-h-32 { max-height: 8rem; }
:where(html.m22) .max-w-xl { max-width: 36rem; }
:where(html.m22) .min-w-\[48px\] { min-width: 48px; }
:where(html.m22) .min-w-\[180px\] { min-width: 180px; }
:where(html.m22) .-bottom-6 { bottom: -1.5rem; }
:where(html.m22) .-right-4 { right: -1rem; }
:where(html.m22) .border-x { border-left-width: 1px; border-right-width: 1px; border-left-style: solid; border-right-style: solid; }
:where(html.m22) .items-stretch { align-items: stretch; }
:where(html.m22) .leading-none { line-height: 1; }
:where(html.m22) .flex-shrink-0 { flex-shrink: 0; }
:where(html.m22) .select-none { -webkit-user-select: none; user-select: none; }
:where(html.m22) .rotate-90 { rotate: 90deg; }
:where(html.m22) .duration-150 { transition-duration: 150ms; }
:where(html.m22) .stroke-\[2\.5\] { stroke-width: 2.5; }
:where(html.m22) .ring-1 { box-shadow: 0 0 0 1px var(--tw-ring-color, currentColor); }
:where(html.m22) .ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, currentColor); }
:where(html.m22) .active\:scale-\[0\.985\]:active { transform: scale(0.985); }
/* Chỉ mờ dần, không transform và không giữ sau khi chạy: khối cha có transform sẽ neo
   các form/sheet position:fixed bên trong theo nó (form hiện ra ngoài màn hình). */
:where(html.m22) .animate-fadeIn { animation: m22-fade-in 200ms ease-out backwards; }
:where(html.m22) :is(.animate-scaleUp, .animate-in) { animation: m22-scale-up 220ms var(--m22-ease) backwards; }

@keyframes m22-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes m22-scale-up {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Ô KPI "Gas đang dùng": icon nằm cùng dòng với tên bình (svg mặc định display:block). */
html.m22 .app-kpi-card p > svg:first-child {
  display: inline-block !important;
  width: 15px !important;
  height: 15px !important;
  margin-right: 4px;
  vertical-align: -2px;
}

/* Thẻ "Sắp hết hàng" (Bếp): v21 gắn kiểu huy hiệu 11px cho tiêu đề → tiêu đề rõ, dòng phụ nhỏ hơn. */
html.m22 .kitchen-stock-alert .kitchen-stock-alert__badge {
  padding: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  color: var(--m22-text) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

html.m22 .kitchen-stock-alert .kitchen-stock-alert__badge + span {
  padding: 1px 7px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  line-height: 16px !important;
}

/* Nút "Xem ngay" gọn lại để tiêu đề + số món nằm chung một dòng. */
html.m22 .kitchen-stock-alert .kitchen-stock-alert__cta {
  padding: 6px 10px !important;
  font-size: 13px !important;
}

html.m22 .kitchen-stock-alert div:has(> .kitchen-stock-alert__badge) + p {
  margin-top: 3px !important;
  color: var(--m22-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* Nút icon nhỏ (ghim, yêu thích cạnh tên nguyên liệu): phẳng, không bóng, không trông như ô nổi. */
html.m22 :where(.app-main, .app-modal-sheet) button.p-0\.5.rounded.shrink-0:not([class*="bg-"]) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  min-height: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.m22 :where(.app-main, .app-modal-sheet) button.p-0\.5.rounded.shrink-0:not([class*="bg-"]):active {
  background: var(--m22-fill) !important;
}

/* Hàng tab con gạch chân (Kho & gas…): các tab chia đều, đệm gọn để vừa một hàng. */
html.m22 .app-main .flex.border-b.overflow-x-auto.gap-2 > button.border-b-2 {
  flex: 1 1 auto;
  justify-content: center;
  padding-right: 8px !important;
  padding-left: 8px !important;
}

/* Cột số trong danh sách nguyên liệu của phiếu (Đề xuất / Nhận): 56px, chữ một dòng. */
html.m22 :where(.app-main, .app-modal-sheet) .w-14.sm\:w-16.shrink-0 {
  white-space: nowrap;
}

/* Nhóm nút xếp dọc trên điện thoại (Từ chối / Duyệt & sửa / Duyệt hết) → một hàng như app. */
html.m22 :where(.app-main, .app-modal-sheet) .w-full.flex.flex-col.sm\:flex-row:has(> button:nth-child(2)):not(:has(> button:nth-child(4))):not(:has(> :not(button))) {
  flex-direction: row !important;
}

html.m22 :where(.app-main, .app-modal-sheet) .w-full.flex.flex-col.sm\:flex-row:has(> button:nth-child(2)):not(:has(> button:nth-child(4))):not(:has(> :not(button))) > button {
  min-width: 0;
  padding-right: 6px !important;
  padding-left: 6px !important;
  white-space: nowrap;
}

/* Icon trang trí mờ cỡ lớn trong thẻ navy: đè lên ô số liệu trên màn hình hẹp → ẩn. */
html.m22 .app-main .absolute.opacity-5.pointer-events-none {
  display: none !important;
}

/* Mã hệ thống (IC-0001, EC-0017…) trong danh sách Cài đặt: không cần cho người dùng. */
html.m22 .m22-sys-code {
  display: none !important;
}

/* --------------------------------------------------------------------------
   22. Giảm chuyển động nếu người dùng yêu cầu
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html.m22 *,
  html.m22 *::before,
  html.m22 *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
