/* ==========================================================================
   1995 Food & Beer — màn Tổng quan của Chủ quán (v23)
   Do app-overview-v23.js dựng; màn cũ (React) chỉ hiện khi bấm "Xem báo cáo chi tiết".
   Bo góc 12px (riêng cột biểu đồ 4px ở đầu cột); chữ Inter kế thừa từ body.
   ========================================================================== */

/* Màn cũ: đưa ra ngoài khung nhìn + tàng hình (không display:none) để biểu đồ recharts vẫn có
   kích thước, không báo lỗi "width(0)" liên tục và sẵn sàng khi mở báo cáo chi tiết. */
html.m22 body.ov23-on:not(.ov23-detail) .app-main {
  position: fixed !important;
  top: 0 !important;
  left: -10000px !important;
  width: var(--m22-frame-w, 430px) !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html.m22 body:not(.ov23-on) #ov23,
html.m22 body.ov23-detail #ov23 { display: none !important; }

html.m22 #ov23 {
  --ov-ink: var(--m22-text, #1c2434);
  --ov-muted: var(--m22-muted, #536175);
  --ov-line: rgba(11, 26, 48, 0.08);
  --ov-track: #e9edf3;
  --ov-bar: #6b85ab;
  --ov-bar-strong: #0b1a30;
  --ov-good: #15803d;
  --ov-good-bg: #e7f6ec;
  --ov-warn: #a14a06;
  --ov-warn-bg: #fdf1dc;
  --ov-bad: #be123c;
  --ov-bad-bg: #fde8ec;
  display: block;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 6px 16px calc(var(--m22-tabbar-h, 64px) + var(--m22-sab, 0px) + 28px);
  color: var(--ov-ink);
  background: linear-gradient(180deg, var(--m22-navy, #0b1a30) 0%, var(--m22-navy-2, #14294a) 100%) 0 0 / 100% 256px no-repeat;
  animation: ov23-in 260ms var(--m22-ease, ease) both;
}

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

html.m22 #ov23.is-refreshing .ov23-body { opacity: 0.55; transition: opacity 160ms ease; }
html.m22 #ov23 .ov23-body { transition: opacity 160ms ease; }

/* Đầu màn: lời chào, tiêu đề lớn, ngày, bộ chọn kỳ */
html.m22 #ov23 .ov23-head { padding: 2px 2px 0; color: #ffffff; }
html.m22 #ov23 .ov23-greet { margin: 0; color: rgba(255, 255, 255, 0.78); font-size: 14px; font-weight: 600; }
html.m22 #ov23 .ov23-title { margin: 2px 0 0; color: #ffffff; font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; }
html.m22 #ov23 .ov23-date { margin: 4px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 13px; font-weight: 500; }

html.m22 #ov23 .ov23-seg {
  display: flex;
  gap: 4px;
  margin: 16px 0 14px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

html.m22 #ov23 .ov23-seg button {
  flex: 1 1 0;
  min-height: 38px !important;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

html.m22 #ov23 .ov23-seg button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--m22-navy, #0b1a30);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Thẻ chính (một con số lớn duy nhất của màn) */
html.m22 #ov23 .ov23-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--m22-surface, #ffffff);
  box-shadow: var(--m22-shadow-card, 0 1px 2px rgba(11, 26, 48, 0.04), 0 8px 24px rgba(11, 26, 48, 0.06));
}

html.m22 #ov23 .ov23-hero { margin-top: 0; padding: 18px 16px 16px; }
html.m22 #ov23 .ov23-hero__label { color: var(--ov-muted); font-size: 14px; font-weight: 600; }
html.m22 #ov23 .ov23-hero__value { margin-top: 2px; color: var(--ov-ink); font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; overflow-wrap: anywhere; }
html.m22 #ov23 .ov23-hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

html.m22 #ov23 .ov23-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

html.m22 #ov23 .ov23-delta svg { width: 14px; height: 14px; }
html.m22 #ov23 .ov23-delta.is-up { background: var(--ov-warn-bg); color: var(--ov-warn); }
html.m22 #ov23 .ov23-delta.is-down { background: var(--ov-good-bg); color: var(--ov-good); }
html.m22 #ov23 .ov23-delta.is-flat { background: var(--ov-track); color: var(--ov-muted); }
html.m22 #ov23 .ov23-hero__count { color: var(--ov-muted); font-size: 13px; font-weight: 600; }

html.m22 #ov23 .ov23-meter { position: relative; height: 10px; margin-top: 16px; border-radius: 12px; background: var(--ov-track); overflow: hidden; }
html.m22 #ov23 .ov23-meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 12px; background: var(--ov-good); }
html.m22 #ov23 .ov23-meter.is-warn { background: #fbe7c4; }
html.m22 #ov23 .ov23-meter.is-warn > span { background: var(--ov-warn); }
html.m22 #ov23 .ov23-meter.is-bad { background: #f8d3db; }
html.m22 #ov23 .ov23-meter.is-bad > span { background: var(--ov-bad); }
html.m22 #ov23 .ov23-meter.is-good { background: #d6efdf; }
html.m22 #ov23 .ov23-hero__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--ov-muted); font-size: 13px; font-weight: 600; }
html.m22 #ov23 .ov23-hero__foot strong { color: var(--ov-ink); font-weight: 700; }

/* Tiêu đề mục */
html.m22 #ov23 .ov23-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
html.m22 #ov23 .ov23-sec-head h2 { margin: 0; color: var(--ov-ink); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
html.m22 #ov23 .ov23-sec-head p { margin: 2px 0 0; color: var(--ov-muted); font-size: 13px; font-weight: 500; }
html.m22 #ov23 .ov23-count { min-width: 26px; padding: 2px 9px; border-radius: 12px; background: var(--ov-bad); color: #ffffff; font-size: 13px; font-weight: 800; text-align: center; }

/* Cần bạn xử lý */
html.m22 #ov23 .ov23-tasks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
html.m22 #ov23 .ov23-task {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px !important;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--m22-fill, #f3f4f8);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

html.m22 #ov23 button.ov23-task:active { transform: scale(0.99); }
html.m22 #ov23 div.ov23-task { cursor: default; }
html.m22 #ov23 .ov23-task__icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
html.m22 #ov23 .ov23-task__icon svg { width: 21px; height: 21px; }
html.m22 #ov23 .ov23-task.is-bad .ov23-task__icon { background: var(--ov-bad-bg); color: var(--ov-bad); }
html.m22 #ov23 .ov23-task.is-warn .ov23-task__icon { background: var(--ov-warn-bg); color: var(--ov-warn); }
html.m22 #ov23 .ov23-task.is-info .ov23-task__icon { background: #e6eefb; color: #1d4ed8; }
html.m22 #ov23 .ov23-task__text { flex: 1 1 auto; min-width: 0; }
html.m22 #ov23 .ov23-task__title { display: block; color: var(--ov-ink); font-size: 15px; font-weight: 700; line-height: 1.3; }
html.m22 #ov23 .ov23-task__sub { display: block; margin-top: 2px; color: var(--ov-muted); font-size: 13px; font-weight: 500; line-height: 1.35; }
html.m22 #ov23 .ov23-task__chev { flex: 0 0 auto; color: #8b95a7; }
html.m22 #ov23 .ov23-task__chev svg { width: 18px; height: 18px; }

html.m22 #ov23 .ov23-clear { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
html.m22 #ov23 .ov23-clear .ov23-task__icon { background: var(--ov-good-bg); color: var(--ov-good); }

/* Ô chỉ số 2 cột */
html.m22 #ov23 .ov23-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
html.m22 #ov23 .ov23-tile {
  display: block;
  min-width: 0;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--m22-surface, #ffffff);
  box-shadow: var(--m22-shadow-card, 0 8px 24px rgba(11, 26, 48, 0.06));
  color: inherit;
  font: inherit;
  text-align: left;
}

html.m22 #ov23 button.ov23-tile { cursor: pointer; }
html.m22 #ov23 .ov23-tile__label { display: flex; align-items: center; gap: 6px; color: var(--ov-muted); font-size: 13px; font-weight: 600; }
html.m22 #ov23 .ov23-tile__label svg { width: 16px; height: 16px; flex: 0 0 auto; }
html.m22 #ov23 .ov23-tile__value { display: block; margin-top: 6px; color: var(--ov-ink); font-size: 21px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
html.m22 #ov23 .ov23-tile__sub { display: block; margin-top: 3px; color: var(--ov-muted); font-size: 12.5px; font-weight: 500; line-height: 1.35; }
html.m22 #ov23 .ov23-tile.is-warn .ov23-tile__sub { color: var(--ov-warn); font-weight: 700; }
html.m22 #ov23 .ov23-tile.is-bad .ov23-tile__sub { color: var(--ov-bad); font-weight: 700; }

/* Biểu đồ cột theo ngày */
html.m22 #ov23 .ov23-chart { position: relative; touch-action: pan-y; }
html.m22 #ov23 .ov23-chart svg { display: block; width: 100%; overflow: visible; }
html.m22 #ov23 .ov23-chart .grid { stroke: #e6eaf0; stroke-width: 1; }
html.m22 #ov23 .ov23-chart .tick { fill: var(--ov-muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
html.m22 #ov23 .ov23-chart .tick.is-today { fill: var(--ov-ink); font-weight: 800; }
html.m22 #ov23 .ov23-chart .bar { fill: var(--ov-bar); }
html.m22 #ov23 .ov23-chart .bar.is-today { fill: var(--ov-bar-strong); }
html.m22 #ov23 .ov23-chart .bar.is-picked { fill: var(--m22-amber, #f2b632); }
html.m22 #ov23 .ov23-chart .val { fill: var(--ov-ink); font-size: 11.5px; font-weight: 700; }
html.m22 #ov23 .ov23-tip {
  position: absolute;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--m22-navy, #0b1a30);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(11, 26, 48, 0.24);
  transform: translate(-50%, -100%);
}

html.m22 #ov23 .ov23-tip strong { display: block; font-size: 15px; font-weight: 800; }
html.m22 #ov23 .ov23-chart-note { margin-top: 8px; color: var(--ov-muted); font-size: 12.5px; font-weight: 500; }

/* Chi theo khoản */
html.m22 #ov23 .ov23-cats { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
html.m22 #ov23 .ov23-cat__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
html.m22 #ov23 .ov23-cat__name { min-width: 0; color: var(--ov-ink); font-size: 14px; font-weight: 600; line-height: 1.3; }
html.m22 #ov23 .ov23-cat__amount { flex: 0 0 auto; color: var(--ov-ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
html.m22 #ov23 .ov23-cat__bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
html.m22 #ov23 .ov23-cat__track { position: relative; flex: 1 1 auto; height: 8px; border-radius: 12px; background: var(--ov-track); overflow: hidden; }
html.m22 #ov23 .ov23-cat__track > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 12px; background: #31507d; }
html.m22 #ov23 .ov23-cat__pct { flex: 0 0 38px; color: var(--ov-muted); font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Trợ lý AI */
html.m22 #ov23 .ov23-ai__top { display: flex; align-items: center; gap: 14px; }
html.m22 #ov23 .ov23-ring { position: relative; flex: 0 0 76px; width: 76px; height: 76px; }
html.m22 #ov23 .ov23-ring svg { display: block; width: 76px; height: 76px; transform: rotate(-90deg); }
html.m22 #ov23 .ov23-ring__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ov-ink); font-size: 22px; font-weight: 800; line-height: 1; }
html.m22 #ov23 .ov23-ring__num small { margin-top: 2px; color: var(--ov-muted); font-size: 11px; font-weight: 600; }
html.m22 #ov23 .ov23-ai__rating { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
html.m22 #ov23 .ov23-ai__rating svg { width: 18px; height: 18px; }
html.m22 #ov23 .ov23-ai__rating.is-good { color: var(--ov-good); }
html.m22 #ov23 .ov23-ai__rating.is-warn { color: var(--ov-warn); }
html.m22 #ov23 .ov23-ai__rating.is-bad { color: var(--ov-bad); }
html.m22 #ov23 .ov23-ai__summary { margin: 4px 0 0; color: var(--ov-ink); font-size: 14px; font-weight: 500; line-height: 1.45; }
html.m22 #ov23 .ov23-ai__list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
html.m22 #ov23 .ov23-ai__item { padding: 10px 12px; border-radius: 12px; background: var(--m22-fill, #f3f4f8); }
html.m22 #ov23 .ov23-ai__item b { display: block; color: var(--ov-ink); font-size: 14px; font-weight: 700; line-height: 1.35; }
html.m22 #ov23 .ov23-ai__item > span { display: block; margin-top: 3px; color: var(--ov-muted); font-size: 13px; line-height: 1.4; }
html.m22 #ov23 .ov23-chip { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 12px; font-size: 12px; font-weight: 800; vertical-align: 1px; }
html.m22 #ov23 .ov23-chip.is-bad { background: var(--ov-bad-bg); color: var(--ov-bad); }
html.m22 #ov23 .ov23-chip.is-warn { background: var(--ov-warn-bg); color: var(--ov-warn); }
html.m22 #ov23 .ov23-chip.is-info { background: #e6eefb; color: #1d4ed8; }
html.m22 #ov23 .ov23-ai__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--ov-muted); font-size: 12.5px; font-weight: 500; }
html.m22 #ov23 details.ov23-tips { margin-top: 10px; }
html.m22 #ov23 details.ov23-tips summary { min-height: 40px !important; display: flex; align-items: center; color: var(--ov-ink); font-size: 14px; font-weight: 700; cursor: pointer; }
html.m22 #ov23 details.ov23-tips summary { list-style: none; gap: 10px; }
html.m22 #ov23 details.ov23-tips summary::-webkit-details-marker { display: none; }
html.m22 #ov23 details.ov23-tips summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  margin-right: 6px;
  border-right: 2px solid #8b95a7;
  border-bottom: 2px solid #8b95a7;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 160ms ease;
}
html.m22 #ov23 details.ov23-tips[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
html.m22 #ov23 details.ov23-tips ul { margin: 0; padding: 0 0 0 4px; list-style: none; }
html.m22 #ov23 details.ov23-tips li { position: relative; padding: 6px 0 6px 22px; color: var(--ov-ink); font-size: 13.5px; line-height: 1.45; }
html.m22 #ov23 details.ov23-tips li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 8px; height: 8px; border-radius: 12px; background: var(--ov-good); }

/* Nút */
html.m22 #ov23 .ov23-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px !important;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--m22-fill, #f3f4f8);
  color: var(--ov-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

html.m22 #ov23 .ov23-btn svg { width: 17px; height: 17px; }
html.m22 #ov23 .ov23-btn.is-primary { background: var(--m22-navy, #0b1a30); color: #ffffff; }
html.m22 #ov23 .ov23-btn[disabled] { opacity: 0.6; cursor: default; }
html.m22 #ov23 .ov23-btn.is-busy svg { animation: ov23-spin 900ms linear infinite; }
@keyframes ov23-spin { to { transform: rotate(360deg); } }

/* Chi gần đây */
html.m22 #ov23 .ov23-recent { margin: 0; padding: 0; list-style: none; }
html.m22 #ov23 .ov23-recent li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ov-line); }
html.m22 #ov23 .ov23-recent li:first-child { border-top: 0; padding-top: 2px; }
html.m22 #ov23 .ov23-recent__icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--m22-fill, #f3f4f8); color: #31507d; }
html.m22 #ov23 .ov23-recent__icon svg { width: 19px; height: 19px; }
html.m22 #ov23 .ov23-recent__text { flex: 1 1 auto; min-width: 0; }
html.m22 #ov23 .ov23-recent__title { display: block; color: var(--ov-ink); font-size: 14.5px; font-weight: 600; line-height: 1.3; }
html.m22 #ov23 .ov23-recent__sub { display: block; margin-top: 2px; color: var(--ov-muted); font-size: 12.5px; line-height: 1.35; }
html.m22 #ov23 .ov23-recent__sub > span { white-space: nowrap; }
html.m22 #ov23 .ov23-recent__amount { flex: 0 0 auto; color: var(--ov-ink); font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
html.m22 #ov23 .ov23-recent__amount small { display: block; margin-top: 2px; color: var(--ov-warn); font-size: 11.5px; font-weight: 700; }
html.m22 #ov23 .ov23-link { display: flex; width: 100%; margin-top: 8px; }

/* Báo cáo chi tiết (màn cũ) */
html.m22 #ov23 .ov23-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed rgba(11, 26, 48, 0.18);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

html.m22 #ov23 .ov23-detail__icon { background: #e6eefb; color: #1d4ed8; }
html.m22 #ov23 .ov23-detail__text { flex: 1 1 auto; min-width: 0; }
html.m22 #ov23 .ov23-detail__text b { display: block; color: var(--ov-ink); font-size: 15px; font-weight: 700; }
html.m22 #ov23 .ov23-detail__sub { display: block; margin-top: 2px; color: var(--ov-muted); font-size: 13px; line-height: 1.35; }

html.m22 .ov23-back {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(var(--m22-tabbar-h, 64px) + var(--m22-sab, 0px) + 14px);
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 40px !important;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--m22-navy, #0b1a30);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(11, 26, 48, 0.3);
  transform: translateX(-50%);
  cursor: pointer;
}

html.m22 body.ov23-on.ov23-detail .ov23-back { display: inline-flex; }
html.m22 .ov23-back svg { width: 18px; height: 18px; }

/* Đang tải lần đầu */
html.m22 #ov23 .ov23-skel { height: 14px; margin-top: 10px; border-radius: 12px; background: linear-gradient(90deg, #eef1f5 0%, #f6f7fa 50%, #eef1f5 100%); background-size: 200% 100%; animation: ov23-shine 1.2s linear infinite; }
html.m22 #ov23 .ov23-skel.is-big { height: 40px; width: 70%; }
@keyframes ov23-shine { to { background-position: -200% 0; } }

html.m22 #ov23 .ov23-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ov-bad); font-size: 14px; font-weight: 600; }

html.m22 #ov23 .ov23-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html.m22 #ov23, html.m22 #ov23 .ov23-skel, html.m22 #ov23 .ov23-btn.is-busy svg { animation: none !important; }
}
