/* ============================================================
   GREEN - Premium POS Design
   Mobile-first, iOS/Android optimized
   ============================================================ */

:root {
  /* --- Forest / Emerald palette --- */
  --forest-950: #0a2e1f;
  --forest-900: #0f3d2e;
  --forest-800: #1b4d3a;
  --forest-700: #2d6a4f;
  --forest-600: #40916c;
  --forest-500: #6bb78f;
  --forest-300: #b7dcc4;
  --forest-100: #e8f3ec;
  --forest-50:  #f4faf6;

  /* --- Warm neutrals --- */
  --paper:     #fbf8f1;
  --paper-2:   #f4efe3;
  --stone-300: #e1dccd;
  --stone-500: #aaa395;

  /* --- Ink (text) — warm charcoal scale --- */
  --ink-950:   #131c17;
  --ink-900:   #1d2a24;
  --ink-800:   #283932;
  --ink-700:   #3a4942;
  --ink-600:   #4d5b54;
  --ink-500:   #687268;
  --ink-400:   #8a9189;
  --ink-300:   #b3b9b5;
  --ink-200:   #d3d6d3;
  --line:      #ecead8;
  --line-2:    #d9d6c2;

  /* --- Text role tokens — dùng cho ngữ nghĩa --- */
  --text:        var(--ink-900);  /* nội dung chính */
  --text-strong: var(--ink-950);  /* tiêu đề, số quan trọng */
  --text-soft:   var(--ink-600);  /* nhãn, mô tả */
  --text-mute:   var(--ink-400);  /* placeholder, ghi chú */
  --text-faint:  var(--ink-300);  /* phụ trợ */

  /* --- Accents --- */
  --gold:      #b89455;
  --gold-soft: #e8d9b8;
  --rose:      #c0533e;
  --rose-soft: #f5dad4;
  --amber:     #b87f1c;

  /* --- Shadows (warm-tinted) --- */
  --shadow-xs: 0 1px 2px rgba(15, 61, 46, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 61, 46, 0.06);
  --shadow:    0 4px 16px rgba(15, 61, 46, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 61, 46, 0.14);
  --shadow-up: 0 -6px 24px rgba(15, 61, 46, 0.12);

  /* --- Geometry --- */
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  --tab-h:    72px;
  --header-h: 60px;

  /* --- Easing --- */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Backwards-compat aliases (đừng dùng cho code mới) --- */
  --ink-700:  var(--ink-600);
  --ink-500:  var(--ink-400);
  --green-100: var(--forest-100);
  --green-800: var(--forest-800);
  --green-900: var(--forest-900);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
  letter-spacing: -0.01em;
}

/* ============================================================
   CURRENCY UNIT — đ nhỏ hơn, mờ hơn để số nổi bật
   ============================================================ */
.cur {
  font-size: 0.62em;
  font-weight: 600;
  margin-left: 0.18em;
  opacity: 0.7;
  letter-spacing: 0.5px;
  vertical-align: 0.05em;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background-image:
    radial-gradient(ellipse 1200px 600px at 10% -10%, var(--forest-50) 0%, transparent 50%),
    radial-gradient(ellipse 800px 400px at 90% 110%, var(--gold-soft) 0%, transparent 60%);
  background-attachment: fixed;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

/* Mọi phần tử bấm được (kể cả div) -> tap 1 phát ăn ngay, không chờ double-tap zoom */
.cust-card, .cust-cat, .cat-pill, .menu-row, .tab-btn, .period-btn,
.settings-row, .settings-row.button-row, .table-row, .order-card,
.cart-line, .menu-edit-row, .expense-row, .qty-btn, .cust-qty-btn {
  touch-action: manipulation;
}

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

::selection { background: var(--forest-300); color: var(--forest-950); }

/* ============================================================
   ICONS (Lucide-style SVG)
   ============================================================ */
.icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.22em;
  flex-shrink: 0;
}
.icon-xl {
  display: inline-block;
  width: 56px;
  height: 56px;
  vertical-align: middle;
}
.icon-fab {
  width: 28px;
  height: 28px;
}
.icon-leading {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  color: var(--forest-700);
}
.icon-leading-danger { color: var(--rose); }
.settings-row.danger { color: var(--rose); }@media (hover: hover) {
  .settings-row.danger:active,
.settings-row.danger:hover { background: var(--rose-soft); }
}
.tab-icon-svg {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 0.3s var(--ease-spring);
}

/* ============================================================
   ACCESSIBILITY — focus-visible + reduced motion
   ============================================================ */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--forest-700);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
button:focus-visible {
  outline-offset: 3px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 241, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 0 18px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.app-header::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0.5;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  min-width: 0;
  gap: 1px;
}
.brand .subtitle {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand .logo {
  font-family: 'Cormorant Garamond', 'Be Vietnam Pro', serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  position: relative;
  line-height: 1;
  background: linear-gradient(135deg, var(--forest-900) 0%, var(--forest-700) 50%, var(--forest-800) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.brand .logo::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 4px;
  vertical-align: middle;
  transform: translateY(-6px);
}

.app-header .date-picker {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink-950);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  min-height: 36px;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-xs);
}
.app-header .date-picker:focus {
  border-color: var(--forest-700);
  outline: none;
}

.app-main {
  flex: 1;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
}

.tab-page { display: none; }
.tab-page.active { display: block; animation: pageIn 0.4s var(--ease-out); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BOTTOM TABS - elevated, premium
   ============================================================ */
.bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
  padding: 6px 4px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-up);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tab-h);
  color: var(--ink-400);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: var(--r-md);
  transition: color 0.2s, background 0.2s, transform 0.2s var(--ease-spring);
  position: relative;
}
.tab-btn .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.tab-btn .tab-icon-svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s var(--ease-spring), color 0.18s;
}
.tab-btn .tab-label {
  display: block;
}
.tab-btn.active {
  color: var(--forest-800);
  background: var(--forest-100);
}
.tab-btn.active .tab-icon-svg {
  transform: scale(1.12) translateY(-1px);
  stroke-width: 2;
}@media (hover: hover) {
  .tab-btn:hover:not(.active) { color: var(--ink-600); }
}
.tab-btn:active { transform: scale(0.94); }

/* ============================================================
   COMMON: buttons, inputs, alerts
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 15px;
  min-height: 48px;
  letter-spacing: -0.005em;
  transition: transform 0.08s var(--ease-spring), background 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--forest-800);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 61, 46, 0.22);
}@media (hover: hover) {
  .btn-primary:hover { background: var(--forest-700); box-shadow: 0 6px 18px rgba(15, 61, 46, 0.28); }
}
.btn-primary:active { background: var(--forest-900); }
.btn-secondary {
  background: var(--forest-100);
  color: var(--forest-900);
}@media (hover: hover) {
  .btn-secondary:hover { background: var(--forest-300); }
}
.btn-ghost {
  background: transparent;
  color: var(--forest-800);
  border: 1px solid var(--line-2);
}@media (hover: hover) {
  .btn-ghost:hover { background: var(--forest-50); border-color: var(--forest-300); }
}
.btn-ghost .icon { width: 16px; height: 16px; }
.btn-danger {
  background: var(--rose);
  color: #fff;
}@media (hover: hover) {
  .btn-danger:hover { background: #a13b29; }
}
.btn-gold {
  background: linear-gradient(135deg, #c9a96a, var(--gold));
  color: #fff;
  box-shadow: 0 4px 14px rgba(184, 148, 85, 0.3);
}
.btn-full { width: 100%; }
.btn-sm   { padding: 8px 14px; min-height: 36px; font-size: 13px; }

.alert {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  margin-bottom: 12px;
  border: 1px solid;
}
.alert-error   { background: var(--rose-soft);    color: var(--rose);    border-color: var(--rose); }
.alert-success { background: var(--forest-100);   color: var(--forest-900); border-color: var(--forest-500); }
.alert-info    { background: var(--gold-soft);    color: var(--amber);   border-color: var(--gold); }

.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--forest-700);
  margin-bottom: 7px;
}
.form-field input,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.form-field input:focus,
.form-field select:focus {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 4px var(--forest-100);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
}

/* ============================================================
   SALES TAB
   ============================================================ */
.sticky-bar {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 20;
  background: var(--paper);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search-bar:focus-within {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 4px var(--forest-100);
}
.search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  min-width: 0;
}
.search-icon {
  display: inline-flex;
  color: var(--ink-400);
  width: 18px;
  height: 18px;
}
.search-icon .icon { width: 18px; height: 18px; }
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-400);
  background: transparent;
  transition: background 0.18s, color 0.18s;
}@media (hover: hover) {
  .search-clear:hover { background: var(--paper-2); color: var(--ink-950); }
}
.search-clear .icon { width: 14px; height: 14px; }

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-600);
  white-space: nowrap;
  transition: all 0.2s var(--ease-out);
}@media (hover: hover) {
  .cat-pill:hover:not(.active) {
  background: var(--forest-50);
  border-color: var(--forest-300);
  color: var(--forest-800);
}
}
.cat-pill.active {
  background: var(--forest-900);
  color: #fff;
  border-color: var(--forest-900);
  box-shadow: 0 4px 12px rgba(15, 61, 46, 0.25);
  transform: translateY(-1px);
}

.category-block {
  padding: 14px 16px 4px;
}
.category-block {
  --cat-color: var(--forest-700);
}
.category-block h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.8px;
  font-style: italic;
  color: var(--cat-color);
  margin: 22px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.category-block h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--cat-color), color-mix(in srgb, var(--cat-color) 50%, var(--gold)));
  margin-right: 12px;
  border-radius: 2px;
  vertical-align: middle;
  flex-shrink: 0;
}
.category-block h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--cat-color), transparent);
  border-radius: 1px;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-row {
  --item-color: var(--forest-700);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: var(--r-md);
  padding: 10px 14px 10px 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.menu-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--item-color) 10%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.menu-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.menu-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--item-color);
  opacity: 0.7;
  transition: opacity 0.2s var(--ease-out), width 0.2s var(--ease-out);
}
.menu-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--item-color);
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 0.2s var(--ease-out);
}@media (hover: hover) {
  .menu-row:hover {
  border-color: var(--item-color);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--item-color) 18%, transparent);
  transform: translateY(-1px);
}
}@media (hover: hover) {
  .menu-row:hover::before { opacity: 1; width: 5px; }
}
.menu-row.has-qty {
  border-color: var(--item-color);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--item-color) 22%, transparent);
}
.menu-row.has-qty::before { opacity: 1; width: 5px; }
.menu-row.has-qty::after { opacity: 0.07; }

/* Đảm bảo nội dung nằm trên overlay */
.menu-row > * { position: relative; z-index: 1; }

.menu-info .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.3;
  letter-spacing: -0.012em;
}
.menu-info .price {
  font-size: 13px;
  color: var(--item-color);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.005em;
  opacity: 0.85;
}
.menu-info .price .cur {
  opacity: 0.7;
}
.menu-row.has-qty .menu-info .name {
  color: color-mix(in srgb, var(--item-color) 35%, var(--ink-950));
}
.menu-row.has-qty .menu-info .price {
  color: var(--item-color);
  opacity: 1;
  font-weight: 700;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease-spring), background 0.18s, box-shadow 0.18s;
  background: color-mix(in srgb, var(--item-color, var(--forest-700)) 14%, white);
  color: color-mix(in srgb, var(--item-color, var(--forest-700)) 80%, black);
}
.qty-btn .icon {
  width: 20px;
  height: 20px;
}
.qty-btn:active { transform: scale(0.86); }
.qty-btn.plus {
  background: var(--item-color, var(--forest-800));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--item-color, var(--forest-800)) 35%, transparent);
}@media (hover: hover) {
  .qty-btn.plus:hover {
  filter: brightness(1.08);
}
}
.qty-btn.plus:active { filter: brightness(0.92); }
.qty-btn.minus:disabled,
.qty-btn[disabled] { opacity: 0.3; }
.menu-row.has-qty .qty-input {
  border-color: var(--item-color);
  color: var(--item-color);
  background: color-mix(in srgb, var(--item-color) 6%, white);
}

.qty-input {
  width: 50px;
  height: 38px;
  text-align: center;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-950);
  padding: 0;
  transition: all 0.18s;
}
/* .qty-input.has-qty được override bởi .menu-row.has-qty .qty-input ở dưới */
.qty-input:focus {
  outline: none;
  border-color: var(--forest-700);
  box-shadow: 0 0 0 4px var(--forest-100);
}

/* ============================================================
   STICKY TOTALS BAR - dramatic, elevated
   ============================================================ */
.totals-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 30;
  background: linear-gradient(135deg, var(--forest-950) 0%, var(--forest-800) 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(15, 61, 46, 0.35);
  border: 1px solid rgba(184, 148, 85, 0.25);
}
.totals-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--gold) 0%, transparent 30%, transparent 70%, var(--gold) 100%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  pointer-events: none;
}
.totals-bar .label {
  font-size: 10px;
  opacity: 0.65;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-soft);
}
.totals-bar .val {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.totals-bar .val.big {
  font-size: 26px;
  background: linear-gradient(135deg, #fff 0%, #fff 40%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
}
.totals-bar .val.big .cur {
  font-size: 0.55em;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 1;
}

/* ============================================================
   EXPENSES TAB
   ============================================================ */
.section { padding: 16px; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  line-height: 1.6;
}
.empty .icon {
  margin: 0 auto 16px;
  color: var(--forest-500);
  opacity: 0.6;
  display: flex;
  justify-content: center;
}

.expense-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s;
}
.expense-row:active { transform: scale(0.99); }
.expense-row .name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 15px;
  letter-spacing: -0.012em;
}
.expense-row .meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.expense-row .amount {
  font-weight: 700;
  font-size: 18px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, var(--amber) 0%, #cf9530 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.expense-row .amount .cur {
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  background: none;
  opacity: 0.85;
}
.expense-row .actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 6px;
}
.expense-row .actions button {
  font-size: 12px;
  color: var(--ink-400);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.18s, color 0.18s;
}@media (hover: hover) {
  .expense-row .actions button:hover { background: var(--paper-2); color: var(--ink-950); }
}
.expense-row .actions button.del { color: var(--rose); }@media (hover: hover) {
  .expense-row .actions button.del:hover { background: var(--rose-soft); color: var(--rose); }
}
.expense-row .actions .icon { width: 14px; height: 14px; }

/* FAB - large, premium */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--forest-700) 0%, var(--forest-900) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 12px 28px rgba(15, 61, 46, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 30;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  line-height: 1;
}@media (hover: hover) {
  .fab:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(15, 61, 46, 0.4); }
}
.fab:active { transform: scale(0.92) rotate(8deg); }

/* ============================================================
   MODAL - bottom sheet, refined
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.22s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal {
  background: var(--paper);
  width: 100%;
  max-width: 560px;
  border-radius: 24px 24px 0 0;
  padding: 24px 22px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp 0.3s var(--ease-out);
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -24px 60px rgba(15, 61, 46, 0.2);
  position: relative;
}
.modal::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  background: var(--line-2);
  border-radius: 999px;
  margin: -10px auto 16px;
}
.modal h3 {
  margin: 0 0 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, var(--forest-900), var(--forest-700));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions .btn { flex: 1; }

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 24px; max-height: 84vh; }
  .modal::before { display: none; }
}

/* ============================================================
   STATEMENT TAB
   ============================================================ */
.period-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-radius: var(--r-md);
  padding: 4px;
  border: 1px solid var(--line);
  gap: 2px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.period-btn {
  padding: 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-400);
  letter-spacing: 0.3px;
  transition: all 0.2s var(--ease-out);
}
.period-btn.active {
  background: var(--forest-900);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 61, 46, 0.25);
}

.range-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  padding: 6px;
  box-shadow: var(--shadow-xs);
}
.range-nav .nav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  color: var(--forest-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.range-nav .nav-btn .icon { width: 20px; height: 20px; }@media (hover: hover) {
  .range-nav .nav-btn:hover { background: var(--forest-100); }
}
.range-nav .label {
  font-weight: 700;
  color: var(--text-strong);
  text-align: center;
  flex: 1;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.range-nav .sub {
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 500;
  margin-top: 3px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

/* Stats grid - hero cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.stat-card {
  background: #fff;
  border-radius: var(--r-md);
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-card.full { grid-column: 1 / -1; }
.stat-card .stat-label {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.stat-card .stat-value .cur {
  font-size: 0.5em;
  font-weight: 600;
  opacity: 0.6;
  margin-left: 0.2em;
  vertical-align: 0.1em;
  letter-spacing: 0;
}

/* Revenue card - hero gold */
.stat-card.revenue {
  background:
    radial-gradient(circle at 100% 0%, rgba(184, 148, 85, 0.25), transparent 60%),
    linear-gradient(135deg, var(--forest-900) 0%, var(--forest-800) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 22px rgba(15, 61, 46, 0.28);
}
.stat-card.revenue .stat-label { color: rgba(255, 255, 255, 0.7); }
.stat-card.revenue .stat-value {
  background: linear-gradient(135deg, #fff 50%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card.revenue::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(184, 148, 85, 0.3) 0%, transparent 60%);
  pointer-events: none;
}

.stat-card.profit .stat-value {
  background: linear-gradient(135deg, var(--forest-800), var(--forest-600));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card.profit.negative .stat-value {
  background: linear-gradient(135deg, var(--rose), #d96b54);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card.expense .stat-value {
  background: linear-gradient(135deg, var(--amber), #d4a544);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--forest-800);
  margin: 22px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.section-title > span:first-child {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, var(--forest-800) 0%, var(--forest-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title .btn {
  -webkit-text-fill-color: initial;
  background-clip: initial;
  flex-shrink: 0;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  margin-right: 12px;
  vertical-align: middle;
  border-radius: 1px;
  flex-shrink: 0;
}

.breakdown {
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row.header {
  background: var(--forest-50);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--forest-800);
}
.breakdown-row.total {
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  font-weight: 700;
  font-size: 15px;
}
.breakdown-row .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-strong);
  letter-spacing: -0.005em;
}
.breakdown-row .name small {
  display: block;
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.breakdown-row .qty {
  font-weight: 700;
  color: var(--forest-700);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 50px;
  font-size: 15px;
}
.breakdown-row .amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 96px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.breakdown-row .amt .cur {
  color: var(--gold);
  opacity: 0.9;
}
.breakdown-row.total {
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  font-weight: 700;
}
.breakdown-row.total .amt {
  background: linear-gradient(135deg, var(--forest-900), var(--forest-700));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.breakdown-row.total .amt .cur {
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  background: none;
}

/* ============================================================
   SETTINGS TAB
   ============================================================ */
.settings-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .row-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.settings-row .row-sub {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 3px;
  font-weight: 500;
}
.settings-row.button-row {
  color: var(--forest-800);
  cursor: pointer;
  font-weight: 600;
}
.settings-row.button-row:active { background: var(--forest-50); }
.settings-row.danger { color: var(--rose); }

.menu-edit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.menu-edit-row:last-child { border-bottom: 0; }
.menu-edit-row .name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.menu-edit-row .name small {
  display: block;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 500;
  margin-top: 3px;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
}
.menu-edit-row .price-input {
  width: 96px;
  padding: 7px 10px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--forest-800);
}
.menu-edit-row .price-input:focus {
  border-color: var(--forest-700);
  outline: none;
  box-shadow: 0 0 0 3px var(--forest-100);
}
.menu-edit-row .toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--forest-100);
  color: var(--forest-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
}
.menu-edit-row .toggle-btn .icon { width: 18px; height: 18px; }@media (hover: hover) {
  .menu-edit-row .toggle-btn:hover { background: var(--forest-300); }
}
.menu-edit-row.inactive { opacity: 0.55; }
.menu-edit-row.inactive .toggle-btn { background: var(--paper-2); color: var(--ink-400); }

.cat-header {
  background: linear-gradient(180deg, var(--forest-50), var(--forest-100));
  color: var(--forest-900);
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  letter-spacing: 0.5px;
}

/* ============================================================
   LOADING / TOAST
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
  gap: 14px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--forest-100);
  border-top-color: var(--forest-800);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 100px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-950);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: toast 2.6s var(--ease-out) forwards;
  pointer-events: none;
  max-width: 90vw;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@keyframes toast {
  0%       { opacity: 0; transform: translate(-50%, 16px); }
  10%, 80% { opacity: 1; transform: translate(-50%, 0); }
  100%     { opacity: 0; transform: translate(-50%, 16px); }
}
.toast.error   { background: var(--rose); border-color: rgba(255, 255, 255, 0.15); }
.toast.success { background: var(--forest-800); border-color: rgba(255, 255, 255, 0.15); }

/* ============================================================
   BOTTOM NAV 5 COLUMNS
   ============================================================ */
.bottom-tabs.nav-5 { grid-template-columns: repeat(5, 1fr); }

.tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(192, 83, 62, 0.4);
}

/* ============================================================
   ORDERS TAB (admin)
   ============================================================ */
/* Banner bật chuông & thông báo */
.notif-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, var(--forest-900), var(--forest-800));
  color: #fff;
  border: 1px solid rgba(184, 148, 85, 0.35);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.notif-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.notif-banner-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--gold-soft);
}
.notif-banner-icon .icon { width: 24px; height: 24px; }
.notif-banner strong { font-size: 14px; font-weight: 700; }
.notif-banner-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  line-height: 1.35;
}
.notif-banner .btn { flex-shrink: 0; }

.orders-header { margin-bottom: 16px; }
.orders-filter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-radius: var(--r-md);
  padding: 4px;
  border: 1px solid var(--line);
  gap: 2px;
  box-shadow: var(--shadow-xs);
}
.orders-filter .period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.orders-filter .badge {
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.orders-filter .period-btn.active .badge { background: rgba(255,255,255,0.25); }

.order-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border-left: 4px solid var(--gold);
}
.order-card:has(.status-new) { border-left-color: var(--gold); }
.order-card:has(.status-confirmed) { border-left-color: #1d6fb8; }
.order-card:has(.status-paid) { border-left-color: var(--forest-500); opacity: 0.85; }
.order-card:has(.status-cancelled) { border-left-color: var(--ink-300); opacity: 0.55; }

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 6px;
}
.order-table {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-strong);
}
.order-table .icon { color: var(--forest-700); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.status-badge .icon { width: 14px; height: 14px; }
.status-new       { background: var(--gold-soft); color: var(--amber); }
.status-confirmed { background: #d7ebff; color: #1d6fb8; }
.status-paid      { background: var(--forest-100); color: var(--forest-800); }
.status-cancelled { background: #f0eee5; color: var(--ink-400); }

.order-meta {
  padding: 0 16px 10px;
  font-size: 12px;
  color: var(--text-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.order-meta .dot { opacity: 0.4; }
.order-meta .order-note { color: var(--forest-800); font-style: italic; }

.order-items {
  padding: 0 16px 12px;
  border-bottom: 1px dashed var(--line);
}
.order-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
}
.order-item .qty {
  font-weight: 800;
  color: var(--forest-700);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  font-size: 15px;
}
/* Tên món nổi bật */
.order-item .name {
  color: var(--forest-900);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
/* Chú thích khách hàng -> chip đỏ nhấp nháy thu hút chú ý */
.order-item .item-note {
  grid-column: 2 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  animation: noteBlink 1.1s ease-in-out infinite;
}
@keyframes noteBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.order-item .amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.order-foot {
  padding: 12px 16px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--paper);
}
.order-total {
  font-size: 15px;
  color: var(--text-soft);
}
.order-total strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--forest-800);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   TABLES LIST (settings)
   ============================================================ */
.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.table-row:last-child { border-bottom: 0; }
.table-row-main { flex: 1; min-width: 0; }
.table-row-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 15px;
}
.table-row-meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 3px;
}
.table-row-meta code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--forest-800);
}
.table-row-actions {
  display: flex;
  gap: 6px;
}
.table-row-actions .btn .icon { width: 16px; height: 16px; }
.table-row-actions .act-del {
  color: var(--rose);
  padding: 8px;
}

/* QR Modal */
.qr-modal { text-align: center; }
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin: 12px 0;
}
.qr-wrap canvas { display: block; }
.qr-url {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qr-url input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--paper);
  font-family: monospace;
}

/* ============================================================
   CUSTOMER ORDERING PAGE (order.html) — LongWang inspired
   ============================================================ */
body.customer-page {
  background:
    radial-gradient(ellipse 1000px 600px at 50% -20%, var(--forest-50) 0%, transparent 50%),
    var(--paper);
  min-height: 100dvh;
}

.cust-app {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 110px;
}

/* Header */
.cust-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, var(--forest-950) 0%, var(--forest-900) 100%);
  color: #fff;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 18px rgba(15, 61, 46, 0.3);
}
.cust-brand-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  line-height: 1;
}
.cust-brand-logo::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 4px;
  vertical-align: middle;
  transform: translateY(-7px);
}
.cust-brand-sub {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 2px;
}
.cust-table-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold);
  color: var(--forest-950);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(184, 148, 85, 0.4);
}
.cust-table-badge .icon { width: 16px; height: 16px; }

/* Search (trang khách) */
.cust-search-wrap {
  position: sticky;
  top: calc(60px + env(safe-area-inset-top));
  z-index: 26;
  background: rgba(251, 248, 241, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 16px 4px;
}
.cust-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.cust-search:focus-within {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 4px var(--forest-100);
}
.cust-search-icon { display: inline-flex; color: var(--ink-400); flex-shrink: 0; }
.cust-search-icon .icon { width: 20px; height: 20px; }
.cust-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  min-width: 0;
}
.cust-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-500);
  flex-shrink: 0;
}
.cust-search-clear .icon { width: 14px; height: 14px; }

.cust-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-mute);
  font-weight: 500;
}
.cust-empty .icon-xl { color: var(--forest-500); opacity: 0.55; margin-bottom: 12px; }
.cust-empty-sub { font-size: 13px; margin-top: 6px; }

/* Khi có thanh search -> đẩy category strip xuống dưới search */
.cust-search-wrap + .cust-cats { top: calc(60px + env(safe-area-inset-top) + 56px); }

/* Category strip */
.cust-cats {
  position: sticky;
  top: calc(60px + env(safe-area-inset-top) + 16px);
  z-index: 25;
  background: rgba(251, 248, 241, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.cust-cats::-webkit-scrollbar { display: none; }
.cust-cat {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-600);
  white-space: nowrap;
  transition: all 0.2s var(--ease-out);
}
.cust-cat.active {
  background: var(--forest-900);
  color: #fff;
  border-color: var(--forest-900);
  box-shadow: 0 4px 12px rgba(15, 61, 46, 0.3);
}

/* Section + cat title */
.cust-main {
  padding: 18px 14px;
}
.cust-section { margin-bottom: 26px; }
.cust-cat-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  color: var(--cat-color, var(--forest-900));
  margin: 8px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--cat-color, var(--forest-900));
  text-align: center;
  letter-spacing: 0.5px;
  position: relative;
}
.cust-cat-title::after {
  content: "❖";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  color: var(--gold);
  padding: 0 10px;
  font-size: 14px;
  font-style: normal;
}

/* Grid */
.cust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .cust-grid { grid-template-columns: repeat(3, 1fr); }
}

.cust-card {
  --item-color: var(--forest-700);
  background: #fff;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  position: relative;
}
.cust-card:active { transform: scale(0.97); }
.cust-card.has-qty {
  border-color: var(--item-color);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--item-color) 25%, transparent);
}

.cust-card-image {
  aspect-ratio: 1 / 1;
  background: color-mix(in srgb, var(--item-color) 14%, white);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cust-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: transform 0.3s var(--ease-out);
}@media (hover: hover) {
  .cust-card:hover .cust-card-img { transform: scale(1.06); }
}
.cust-card.has-qty .cust-card-img { filter: saturate(1.15); }
.cust-item-blob {
  overflow: hidden;
}
.cust-item-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cust-card-blob {
  position: absolute;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--item-color) 35%, transparent), transparent 60%);
  pointer-events: none;
  animation: blob-drift 8s ease-in-out infinite;
}
@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(8%, -6%); }
}
.cust-card-monogram {
  font-family: 'Cormorant Garamond', serif;
  font-size: 64px;
  font-weight: 700;
  color: var(--item-color);
  opacity: 0.85;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 0 rgba(255,255,255,0.5);
}
.cust-card-qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--item-color);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--item-color) 50%, transparent);
  z-index: 2;
}

.cust-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.cust-card-name {
  font-weight: 700;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  min-height: 2.5em;
}
.cust-card-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--item-color);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.cust-card-cta {
  background: var(--gold);
  color: var(--forest-950);
  font-weight: 700;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  letter-spacing: 0.3px;
  margin-top: 4px;
  transition: all 0.18s;
  box-shadow: 0 3px 10px rgba(184, 148, 85, 0.3);
}@media (hover: hover) {
  .cust-card-cta:hover { filter: brightness(1.06); }
}
.cust-card-cta:active { transform: scale(0.96); }
.cust-card.has-qty .cust-card-cta {
  background: var(--item-color);
  color: #fff;
}

/* Cart bar (sticky bottom) */
.cust-cart-bar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 660px;
  background: linear-gradient(135deg, var(--forest-950) 0%, var(--forest-800) 100%);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(15, 61, 46, 0.4);
  border: 1px solid rgba(184, 148, 85, 0.3);
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring);
  animation: cart-bar-in 0.3s var(--ease-spring);
}
@keyframes cart-bar-in {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}@media (hover: hover) {
  .cust-cart-bar:hover { transform: translate(-50%, -2px); }
}
.cust-cart-bar:active { transform: translate(-50%, 0) scale(0.98); }
.cust-cart-bar .icon { color: var(--gold-soft); }
.cust-cart-count {
  background: var(--gold);
  color: var(--forest-950);
  font-weight: 800;
  font-size: 14px;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.cust-cart-label { font-size: 13px; opacity: 0.85; }
.cust-cart-total {
  margin-left: auto;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #fff, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.cust-cart-cta {
  font-size: 12px;
  opacity: 0.7;
  letter-spacing: 0.5px;
}

/* Item sheet */
.cust-item-sheet {
  --item-color: var(--forest-700);
}
.cust-item-head {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: center;
}
.cust-item-blob {
  width: 90px;
  height: 90px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--item-color) 14%, white);
  position: relative;
  flex-shrink: 0;
  background-image: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--item-color) 35%, transparent), transparent 60%);
}
.cust-item-info { flex: 1; }
.cust-item-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 2px;
}
.cust-item-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.cust-item-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--item-color);
  font-variant-numeric: tabular-nums;
}

/* Topping chips (trong popup trà sữa) */
.topping-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topping-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  background: #fff;
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}
.topping-chip .topping-name {
  font-weight: 600;
  color: var(--text-strong);
  flex: 1;
}
.topping-chip .topping-price {
  font-weight: 700;
  color: var(--item-color, var(--forest-700));
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.topping-chip .topping-check {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.18s;
}
.topping-chip .topping-check .icon { width: 15px; height: 15px; opacity: 0; }
.topping-chip.on {
  border-color: var(--item-color, var(--forest-700));
  background: color-mix(in srgb, var(--item-color, var(--forest-700)) 8%, white);
}
.topping-chip.on .topping-check {
  background: var(--item-color, var(--forest-700));
  border-color: var(--item-color, var(--forest-700));
}
.topping-chip.on .topping-check .icon { opacity: 1; }

.cart-line-topping {
  font-size: 12px;
  font-weight: 600;
  color: var(--forest-700);
}

.cust-qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.cust-qty-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--forest-100);
  color: var(--forest-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease-spring);
}@media (hover: hover) {
  .cust-qty-btn:hover { background: var(--forest-300); }
}
.cust-qty-btn:active { transform: scale(0.9); }
.cust-qty-btn .icon { width: 22px; height: 22px; }
#cust-qty-input {
  width: 80px;
  height: 44px;
  text-align: center;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Cart modal */
.cart-modal h3 { text-align: center; }
.cart-list {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}
.cart-line {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.cart-line-name {
  font-weight: 600;
  color: var(--text-strong);
  font-size: 15px;
}
.cart-line-amt {
  font-weight: 700;
  color: var(--forest-800);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.cart-line-meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 3px;
}
.cart-line-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.cart-line-actions .cust-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.cart-line-actions .cust-qty-btn .icon { width: 16px; height: 16px; }
.cart-qty {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: center;
  color: var(--forest-800);
}
.cart-edit, .cart-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-400);
  background: transparent;
  margin-left: auto;
}@media (hover: hover) {
  .cart-edit:hover { background: var(--forest-100); color: var(--forest-800); }
}
.cart-remove { color: var(--rose); }@media (hover: hover) {
  .cart-remove:hover { background: var(--rose-soft); }
}
.cart-edit .icon, .cart-remove .icon { width: 16px; height: 16px; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--forest-950), var(--forest-800));
  color: #fff;
  border-radius: var(--r-md);
  margin-top: 12px;
  font-size: 14px;
}
.cart-total strong {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Error / Success screens */
.error-screen, .success-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, var(--forest-50), var(--paper));
  z-index: 100;
}
.error-card, .success-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.error-icon, .success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.error-icon { background: var(--rose-soft); color: var(--rose); }
.success-icon { background: var(--forest-100); color: var(--forest-700); }
.error-card h1, .success-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  margin: 0 0 12px;
  font-style: italic;
}
.error-card h1 { color: var(--rose); }
.success-card h1 { color: var(--forest-800); }
.error-card p, .success-card p {
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 18px;
}

.success-summary { text-align: left; margin: 20px 0; }
.success-items {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--line);
}
.success-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  color: var(--text-strong);
}
.success-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.success-total strong {
  font-size: 17px;
  color: var(--forest-800);
}

/* ============================================================
   PRINT - Sao kê A4
   ============================================================ */
@media print {
  @page { size: A4; margin: 14mm; }
  body {
    background: #fff !important;
    background-image: none !important;
  }
  .app-header, .bottom-tabs, .totals-bar, .fab, .period-selector,
  .range-nav .nav-btn, .icon-btn, .modal-backdrop, .no-print { display: none !important; }
  .app-main { padding: 0 !important; }
  .tab-page { display: block !important; }
  .tab-page:not(#tab-statement) { display: none !important; }
  .stat-card {
    border: 1px solid #888 !important;
    background: #fff !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .stat-card.revenue {
    background: #f5f5f5 !important;
  }
  .stat-card.revenue .stat-label,
  .stat-card.revenue .stat-value {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    background: none !important;
  }
  .stat-card.revenue::after { display: none; }
  .breakdown { border: 1px solid #888 !important; page-break-inside: avoid; box-shadow: none !important; }
  .breakdown-row { border-bottom: 1px solid #ccc !important; }
  .section { padding: 0 !important; }
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 18px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }
  .print-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    margin: 0;
    letter-spacing: 6px;
  }
  .print-header p { font-size: 12px; margin: 6px 0 0; color: #555; }
}
.print-header { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   DESKTOP — căn giữa nội dung, không stretch
   ============================================================ */
@media (min-width: 900px) {
  :root {
    --app-max:    920px;
  }

  body {
    background-image:
      radial-gradient(ellipse 1400px 800px at 50% -20%, var(--forest-50) 0%, transparent 50%),
      radial-gradient(ellipse 900px 500px at 90% 110%, var(--gold-soft) 0%, transparent 60%),
      linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  }

  /* Header: nội dung căn giữa, có max-width */
  .app-header {
    padding: 0;
    background: rgba(251, 248, 241, 0.9);
  }
  .app-header > * { position: relative; z-index: 1; }
  .app-header {
    display: flex;
    justify-content: center;
  }
  .app-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    backdrop-filter: inherit;
    -webkit-backdrop-filter: inherit;
  }
  .app-header {
    /* tạo wrapper bằng flex centering với inner via padding */
  }
  /* Đưa các con vào container giữa */
  .app-header .brand,
  .app-header .date-picker {
    /* Sẽ được dịch vào trong qua flex container giả */
  }
  /* Phương pháp đơn giản: dùng pseudo wrapper */
  .app-header {
    padding-left: max(20px, calc((100% - var(--app-max)) / 2));
    padding-right: max(20px, calc((100% - var(--app-max)) / 2));
    padding-top: env(safe-area-inset-top);
  }

  /* App main */
  .app-main {
    max-width: var(--app-max);
    margin: 0 auto;
    padding: 24px 24px calc(var(--tab-h) + 40px);
    width: 100%;
  }

  /* Sticky bar trên sales - vẫn opaque để không lộ nội dung phía sau */
  .sticky-bar {
    padding-left: 0;
    padding-right: 0;
    background: rgba(251, 248, 241, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Bottom tabs căn giữa với background full-width */
  .bottom-tabs {
    padding-left: max(0px, calc((100% - var(--app-max)) / 2));
    padding-right: max(0px, calc((100% - var(--app-max)) / 2));
  }
  /* Wrapper-like khi xếp 4 cột trong khu vực giữa */
  .bottom-tabs::before,
  .bottom-tabs::after {
    content: none;
  }

  /* Totals bar căn giữa */
  .totals-bar {
    max-width: calc(var(--app-max) - 48px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 20px);
  }

  /* Category block */
  .category-block { padding: 14px 0 4px; }
  .section { padding: 24px 0; }

  /* Menu rows xếp 2 cột grid */
  .menu-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .menu-row {
    padding: 16px 18px;
  }
  .menu-info .name { font-size: 16px; }

  /* FAB ở góc dưới-phải so với khung giữa */
  .fab {
    right: max(24px, calc((100% - var(--app-max)) / 2 + 24px));
  }

  /* Settings layout */
  #settings-menu-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1280px) {
  :root { --app-max: 1080px; }
  .menu-list { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   THANH TOÁN — VietQR (cài đặt + thu tiền + khách)
   ============================================================ */
/* --- Form cài đặt tài khoản ngân hàng --- */
.bank-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}
.bank-form .form-field { margin-bottom: 12px; }
.bank-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.bank-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 12px;
}
.bank-preview-img {
  width: 220px;
  max-width: 100%;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: #fff;
}
.bank-preview-cap { font-size: 12px; color: var(--text-mute); text-align: center; }
.bank-preview-empty {
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  width: 100%;
}

/* --- Modal thu tiền (chủ quán) --- */
.pay-qr-modal .pay-amount {
  font-size: 30px;
  font-weight: 800;
  color: var(--forest-800);
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 4px;
}
.pay-qr-img {
  width: 280px;
  max-width: 100%;
  display: block;
  border-radius: var(--r-sm);
}
.pay-meta {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin: 4px 0 10px;
}
.pay-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  font-size: 13.5px;
  color: var(--text-soft);
}
.pay-meta-row + .pay-meta-row { border-top: 1px dashed var(--line); }
.pay-meta-row strong { color: var(--text-strong); font-weight: 700; text-align: right; }
.pay-code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 0.5px;
  background: var(--forest-100);
  color: var(--forest-900) !important;
  padding: 2px 8px;
  border-radius: 6px;
}
.pay-hint {
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: center;
  line-height: 1.5;
  margin: 0 0 4px;
}
.pay-hint b { color: var(--forest-700); }

/* --- Khối thanh toán trên trang khách (success screen) --- */
.pay-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-2);
  text-align: center;
}
.pay-block-title {
  font-weight: 800;
  color: var(--forest-800);
  font-size: 15px;
  margin-bottom: 10px;
}
.pay-qr-frame {
  display: inline-block;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.pay-qr-frame .pay-qr-img { width: 250px; }
.pay-block .pay-meta { text-align: left; margin-top: 12px; }
.pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}
.pay-status.pending { background: var(--gold-soft); color: var(--amber); }
.pay-status.done { background: var(--forest-100); color: var(--forest-700); }
.pay-status .icon { width: 18px; height: 18px; flex-shrink: 0; }
.pay-status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
  animation: payPulse 1.1s ease-in-out infinite;
}
@keyframes payPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}
.pay-or {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-mute);
}
@media (prefers-reduced-motion: reduce) {
  .pay-status-dot { animation: none; }
}
