/* ==========================================================================
   Muadi – giao diện mobile-first
   Mọi màu, cỡ chữ, khoảng cách đều lấy từ biến bên dưới. Trang mới chỉ dùng
   các class ở file này (không dùng Bootstrap).
   ========================================================================== */

:root {
  /* Màu */
  --c-brand: #0B7A53;
  --c-brand-dark: #075C3E;
  --c-brand-soft: #E3F3EC;
  --c-accent: #FFB020;
  --c-accent-soft: #FFF3D6;
  --c-ink: #14171F;
  --c-ink-2: #3A404C;
  --c-muted: #5B6270;
  --c-line: #E3E6EB;
  --c-line-strong: #D5D9DF;
  --c-soft: #F1F3F5;
  --c-ground: #F6F7F9;
  --c-surface: #FFFFFF;
  --c-danger: #B42318;
  --c-danger-soft: #FDECEA;
  --c-red: #E53935;
  --c-neutral-soft: #E8EAEE;

  /* Chữ (đã chốt: nhỏ nhất 13px, ô nhập ≥ 16px để iPhone không tự phóng to) */
  --font: 'Be Vietnam Pro', 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif;
  --fs-title: 28px;
  --fs-name: 18px;
  --fs-body: 17px;
  --fs-sub: 15px;
  --fs-nav: 13px;
  --fs-button: 18px;
  --fs-input: 17px;

  /* Kích thước */
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 20px;
  --tap: 48px;            /* vùng chạm tối thiểu */
  --button-h: 56px;
  --gutter: 20px;
  --nav-h: 72px;
  --content-max: 640px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--c-ground);
  color: var(--c-ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-brand); }
a:hover { color: var(--c-brand-dark); }

h1, h2, h3 { margin: 0; line-height: 1.2; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Khung trang ---------- */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.app--with-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

.app-header {
  padding: 20px var(--gutter) 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header__text { flex-grow: 1; min-width: 0; }
.app-header__eyebrow { font-size: var(--fs-sub); color: var(--c-muted); font-weight: 500; }
.app-header__title { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.6px; }

.app-main {
  flex-grow: 1;
  padding: 0 var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Menu đáy ---------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--fs-nav);
  font-weight: 600;
  color: var(--c-muted);
  text-decoration: none;
}

.bottom-nav__item:hover { color: var(--c-ink); }
.bottom-nav__item.is-active { color: var(--c-brand); font-weight: 700; }

.bottom-nav__badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 6px);
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--c-accent);
  color: var(--c-ink);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav__badge[hidden] { display: none; }

/* ---------- Icon ---------- */

.icon { width: 24px; height: 24px; flex-shrink: 0; }
.icon--s { width: 20px; height: 20px; }

/* ---------- Thẻ ---------- */

.card {
  background: var(--c-surface);
  border-radius: var(--radius-l);
  padding: 16px;
}

/* ---------- Nút ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--button-h);
  padding: 0 22px;
  border-radius: var(--radius-m);
  border: 1.5px solid transparent;
  font: inherit;
  font-size: var(--fs-button);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary { background: var(--c-brand); color: #FFFFFF; }
.btn--primary:hover { background: var(--c-brand-dark); color: #FFFFFF; }
.btn--secondary { background: var(--c-surface); border-color: var(--c-line); color: var(--c-ink); }
.btn--danger { background: var(--c-surface); border-color: var(--c-line); color: var(--c-danger); }
.btn--block { width: 100%; }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 14px;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Biểu mẫu ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-sub); font-weight: 700; }
.field__hint { font-size: var(--fs-sub); color: var(--c-muted); }
.field__error { font-size: var(--fs-sub); color: var(--c-danger); font-weight: 600; }

.input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
  font-size: var(--fs-input);
}

.input:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
textarea.input { padding: 14px 16px; min-height: 96px; resize: vertical; }

/* ---------- Nhãn trạng thái ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--fs-sub);
  font-weight: 700;
  white-space: nowrap;
}

.pill--new { background: var(--c-accent); color: var(--c-ink); }
.pill--progress { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.pill--done { background: var(--c-neutral-soft); color: var(--c-ink-2); }
/* Đang làm / Đã giao có nền nhạt: thêm viền cho dễ thấy (thắng border: 0 của .pill--button) */
.pill.pill--progress { border: 1.5px solid var(--c-brand); }
.pill.pill--done { border: 1.5px solid #9AA1AD; }
.pill--cancelled { background: var(--c-red); color: #FFFFFF; }
.pill--paid { background: var(--c-brand); color: #FFFFFF; gap: 6px; }
/* Đã thu tiền: dấu tick tròn nền vàng, icon trắng, đặt sau chữ (kiểu "thành công") */
.pill--paid::after {
  content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-right: -4px; border-radius: 50%;
  background: var(--c-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* ---------- Thông báo ---------- */

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-m);
  font-size: var(--fs-sub);
  font-weight: 600;
}

.alert--error { background: var(--c-danger-soft); color: var(--c-danger); }
.alert--success { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.alert--warning, .alert--info { background: var(--c-accent-soft); color: var(--c-ink); }

/* ---------- Logo ---------- */

.brand { display: flex; align-items: center; gap: 12px; color: var(--c-ink); text-decoration: none; }
.brand__mark { width: 52px; height: 52px; flex-shrink: 0; }
.brand__name { font-size: 36px; font-weight: 800; letter-spacing: -1.2px; line-height: 1; }
.brand__tagline { font-size: var(--fs-sub); color: var(--c-muted); margin-top: 4px; }

/* ---------- Trang đăng nhập ---------- */

.auth {
  flex-grow: 1;
  padding: 48px var(--gutter) 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.auth__form { display: flex; flex-direction: column; gap: 18px; }
.auth__note { font-size: var(--fs-sub); color: var(--c-muted); line-height: 1.6; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 60px; }
.password-wrap__toggle {
  position: absolute;
  top: 50%; right: 4px;
  transform: translateY(-50%);
  width: var(--tap); height: var(--tap);
  border: 0; background: transparent; color: var(--c-muted);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  cursor: pointer;
}

/* ---------- Thanh lọc dạng chip ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter) 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  color: var(--c-ink);
  font-size: var(--fs-sub);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.chip:hover { color: var(--c-ink); border-color: var(--c-muted); }
.chip.is-active { background: var(--c-ink); border-color: var(--c-ink); color: #FFFFFF; }
.chip__count { font-weight: 800; }

/* ---------- Ô tìm kiếm ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 6px 0 16px;
  border-radius: 14px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-line);
}
.search:focus-within { border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.search__input {
  flex-grow: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: var(--fs-input);
  color: var(--c-ink);
}
.search__clear { font-size: var(--fs-sub); font-weight: 600; padding: 8px 10px; text-decoration: none; color: var(--c-muted); }

/* ---------- Banner đơn mới ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: var(--c-accent-soft);
  color: var(--c-ink);
  text-decoration: none;
}
.banner:hover { color: var(--c-ink); }
.banner[hidden] { display: none; }
.banner__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 14px;
  background: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
}
.banner__title { font-size: var(--fs-name); font-weight: 700; }
.banner__sub { font-size: var(--fs-sub); color: var(--c-muted); }

.sound-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink);
  font: inherit; font-size: var(--fs-sub); font-weight: 600; cursor: pointer;
}
.sound-toggle[aria-pressed="true"] { background: var(--c-brand-soft); border-color: var(--c-brand-soft); color: var(--c-brand-dark); }

/* ---------- Danh sách đơn ---------- */

.group-label {
  margin-top: 6px;
  font-size: var(--fs-sub);
  font-weight: 700;
  color: var(--c-muted);
}
/* tab Đang làm: nhóm theo ngày giao, kèm số đơn */
.group-label--delivery { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 800; }
.group-count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #E4E7EB; color: var(--c-ink-2); font-size: 13px; font-weight: 800;
}
.group-sub { font-weight: 600; }
.group-label--late { color: var(--c-red); }
.group-label--late .group-count { background: var(--c-red); color: #FFFFFF; }

.order-list { display: flex; flex-direction: column; gap: 10px; }

.order-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--c-surface);
  border: 2px solid transparent;
  color: var(--c-ink);
  text-decoration: none;
}
.order-card--new { border-color: var(--c-accent); }
/* viền thẻ theo màu trạng thái */
.order-card--progress { border-color: var(--c-brand); }
.order-card--done { border-color: var(--c-brand); }
.order-card--paid { border-color: var(--c-brand); }
.order-card--cancelled { border-color: var(--c-red); }
.order-card--flash { animation: card-flash 1.6s ease-out; }
/* đơn trễ hẹn (tab Đang làm) */
.order-card--late { border-color: var(--c-red); background: #FFF5F5; }
.order-card__when--late { height: 28px; padding: 0 10px; border-radius: 999px; background: var(--c-red); color: #FFFFFF; white-space: nowrap; }
/* đơn vừa đến: nền vàng nhạt + nhãn đỏ ở góc trên, đến khi bấm nút trạng thái */
.order-card.is-fresh { background: var(--c-accent-soft); box-shadow: 0 6px 18px rgba(255, 176, 32, 0.35); margin-top: 8px; }
.order-card.is-fresh .order-card__lines li:nth-child(even) { background: rgba(255, 255, 255, 0.7); }
.fresh-tag {
  position: absolute; top: -12px; left: 14px;
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
  border-radius: 999px; background: var(--c-red); color: #FFFFFF;
  font-size: 13px; font-weight: 800; box-shadow: 0 0 0 3px var(--c-ground);
}
.fresh-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #FFFFFF; }
.fresh-banner {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--c-red); color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 800; white-space: nowrap; cursor: pointer;
  box-shadow: 0 10px 26px rgba(229, 57, 53, 0.4);
}
.fresh-banner[hidden] { display: none; }
.fresh-banner.is-up { top: 16px; bottom: auto; }
.fresh-banner.is-up svg { transform: rotate(180deg); }
@keyframes card-flash { from { background: var(--c-accent-soft); } to { background: var(--c-surface); } }

.order-card__top { display: flex; align-items: flex-start; gap: 10px; }
.order-card__no { flex-shrink: 0; margin-top: 3px; font-size: 14px; color: var(--c-muted); white-space: nowrap; }
/* sản phẩm: mỗi dòng 1 sản phẩm, số lượng in đậm thẳng cột bên phải */
.order-card__lines { margin: 0 -8px; padding: 0; list-style: none; display: flex; flex-direction: column; }
.order-card__lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 8px; border-radius: 8px; font-size: 16px; color: var(--c-ink-2); }
/* xen kẽ màu từng dòng để mắt không đọc lệch số lượng khi đơn có nhiều sản phẩm */
.order-card__lines li:nth-child(even) { background: var(--c-soft); }
.order-card__lines li span { min-width: 0; overflow-wrap: anywhere; }
.order-card__lines strong { flex-shrink: 0; font-size: 17px; font-weight: 800; color: var(--c-ink); font-variant-numeric: tabular-nums; }
/* ghi chú của khách: nền vàng nhạt để không bị bỏ sót, hiện đầy đủ */
.order-card__note {
  margin: 0; display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 12px; border-radius: 12px; background: var(--c-accent-soft); color: #5A3A00;
  font-size: 15px; font-weight: 600; line-height: 1.4;
}
.order-card__note[hidden] { display: none; }
.order-card__note svg { flex-shrink: 0; margin-top: 2px; }
.order-card__note span { min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.order-card__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 10px; border-top: 1px solid #EEF0F3;
}
.order-card__when { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; font-weight: 700; color: var(--c-brand-dark); }
.order-card__foot .order-card__total { margin-left: auto; font-size: 16px; font-weight: 800; white-space: nowrap; }
.order-card__customer { font-size: var(--fs-name); font-weight: 700; line-height: 1.3; }
.order-card__items { font-size: var(--fs-body); color: var(--c-ink-2); line-height: 1.4; }
.order-card__meta { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sub); color: var(--c-muted); }
.order-card__total { font-weight: 700; color: var(--c-ink); white-space: nowrap; }
/* Đơn đã đặt của khách: chia theo ngày, mỗi sản phẩm một dòng */
.history-day { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 -2px; font-size: 15px; font-weight: 800; color: var(--c-ink-2); }
.history-day:first-child { margin-top: 2px; }
.history-day__count { flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--c-muted); }
.history-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.history-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; color: var(--c-ink-2); }
.history-lines li span { min-width: 0; overflow-wrap: anywhere; }
.history-lines li b { flex-shrink: 0; font-weight: 700; color: var(--c-ink); white-space: nowrap; }
.history-lines .history-lines__more { font-size: 14px; color: var(--c-muted); }

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--c-muted);
  font-size: var(--fs-body);
}

.list-footer { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.link-muted { font-size: var(--fs-sub); color: var(--c-muted); text-align: center; padding: 8px; }

/* ---------- Chi tiết đơn ---------- */

.app--with-actions { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.back-link {
  width: 44px; height: 44px;
  border: 1.5px solid var(--c-line-strong); border-radius: 999px;
  background: var(--c-surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-ink);
  flex-shrink: 0;
}
.back-link:hover { color: var(--c-ink); background: var(--c-ground); }
.back-link:active { transform: scale(0.95); }

.steps { display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); gap: 6px; }
.steps__bar { height: 6px; border-radius: 3px; background: var(--c-line); }
.steps__bar.is-done { background: var(--c-brand); }
.steps__label { font-size: var(--fs-sub); font-weight: 600; color: var(--c-muted); }
.steps__label.is-done { color: var(--c-brand-dark); font-weight: 700; }

.section-title { font-size: var(--fs-sub); font-weight: 700; color: var(--c-muted); margin-bottom: 8px; }

.line-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.line-item:first-child { padding-top: 0; }
.line-item__thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 12px; background: var(--c-brand-soft); color: var(--c-brand);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
}
.line-item__body { flex-grow: 1; min-width: 0; }
.line-item__name { font-size: var(--fs-name); font-weight: 700; line-height: 1.3; }
.line-item__price { font-size: var(--fs-sub); color: var(--c-muted); }
.line-item__qty { text-align: right; flex-shrink: 0; }
.line-item__qty strong { display: block; font-size: 20px; font-weight: 800; }
.line-item__qty span { font-size: var(--fs-sub); color: var(--c-muted); }

.total-row { display: flex; justify-content: space-between; padding-top: 14px; font-size: var(--fs-name); font-weight: 800; }

.date-picker { display: flex; gap: 8px; }
.date-picker .chip { flex: 1; justify-content: center; cursor: pointer; font: inherit; font-size: var(--fs-sub); font-weight: 600; }
.date-picker .input { flex: 1.4; min-width: 0; min-height: 44px; padding: 0 10px; font-size: 16px; }

.info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-l);
  background: var(--c-surface); color: var(--c-ink);
  font-size: var(--fs-body); font-weight: 600; text-decoration: none;
}
.info-row:hover { color: var(--c-ink); }

.notice { padding: 12px 16px; border-radius: var(--radius-m); font-size: var(--fs-sub); font-weight: 600; }
.notice--accent { background: var(--c-accent-soft); }
.notice--danger { background: var(--c-danger-soft); color: var(--c-danger); }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
}
.action-bar__inner { max-width: var(--content-max); margin: 0 auto; display: flex; gap: 10px; }
.action-bar__inner form { display: contents; }
.action-bar .btn--primary { flex-grow: 1; }

/* ---------- Sản phẩm ---------- */


.product-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--radius-m);
  background: var(--c-surface);
}
.product-row.is-off .product-row__body, .product-row.is-off .product-row__thumb { opacity: 0.55; }
.product-row__thumb {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 12px; background: var(--c-brand-soft); color: var(--c-brand);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
}
.product-row__body { flex-grow: 1; min-width: 0; }
.product-row__name { font-size: var(--fs-name); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.product-row__meta { font-size: var(--fs-sub); color: var(--c-muted); }
.product-row__state { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.product-row form { margin: 0; flex-shrink: 0; }

/* Công tắc bật/tắt */
.switch {
  position: relative;
  width: 60px; height: 36px;
  border-radius: 999px; border: 0; padding: 0;
  background: #C9CED6;
  cursor: pointer;
  transition: background 0.15s;
}
.switch::after {
  content: '';
  position: absolute; top: 4px; left: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(20, 23, 31, 0.3);
  transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--c-brand); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
.switch:disabled { opacity: 0.6; cursor: progress; }

.fab {
  position: fixed;
  right: max(var(--gutter), calc((100vw - var(--content-max)) / 2 + var(--gutter)));
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 22px;
  border-radius: 18px;
  background: var(--c-ink); color: #FFFFFF;
  font-size: var(--fs-button); font-weight: 700; text-decoration: none;
  box-shadow: 0 8px 20px rgba(20, 23, 31, 0.25);
}
.fab:hover { color: #FFFFFF; }
.app--with-fab { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }

/* ---------- Form sản phẩm ---------- */

.form-stack { display: flex; flex-direction: column; gap: 16px; }

.photo-card { background: var(--c-surface); border-radius: var(--radius-l); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.photo-card__preview {
  height: 220px; border-radius: var(--radius-m); overflow: hidden;
  background: var(--c-brand-soft);
  display: flex; align-items: center; justify-content: center;
}
.photo-card__preview img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 0.2s; }
.photo-card__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--c-brand-dark); font-weight: 600; }
.photo-card__actions { display: flex; gap: 10px; }
.photo-card__actions .btn { flex: 1; }
.photo-card__actions[hidden], .photo-card__empty[hidden] { display: none; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-m); background: var(--c-surface);
  cursor: pointer;
}
.toggle-row__title { display: block; font-size: var(--fs-body); font-weight: 700; }
.toggle-row__hint { display: block; font-size: var(--fs-sub); color: var(--c-muted); }

.switch-input {
  appearance: none; -webkit-appearance: none;
  position: relative; flex-shrink: 0;
  width: 60px; height: 36px; margin: 0;
  border-radius: 999px; background: #C9CED6;
  cursor: pointer; transition: background 0.15s;
}
.switch-input::after {
  content: ''; position: absolute; top: 4px; left: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(20, 23, 31, 0.3);
  transition: transform 0.15s;
}
.switch-input:checked { background: var(--c-brand); }
.switch-input:checked::after { transform: translateX(24px); }

.product-row__link { display: flex; align-items: center; gap: 12px; flex-grow: 1; min-width: 0; color: inherit; text-decoration: none; }
.product-row__link:hover { color: inherit; }

/* ---------- Khách hàng ---------- */

.customer-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 12px;
  border-radius: var(--radius-l);
  background: var(--c-surface);
  color: var(--c-ink); text-decoration: none;
}
.customer-card:hover { color: var(--c-ink); }
.customer-card__avatar {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--c-brand-soft); color: var(--c-brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.customer-card__body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.customer-card__name { font-size: var(--fs-name); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.customer-card__meta { font-size: var(--fs-sub); color: var(--c-muted); overflow-wrap: anywhere; }
.customer-card__tag { margin-top: 4px; align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--c-accent-soft); font-size: 13px; font-weight: 700; }

/* Thẻ mã QR (cũng là bản in) */
.qr-print {
  background: var(--c-surface);
  border-radius: 24px;
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(20, 23, 31, 0.08);
}
.qr-print__store { display: flex; align-items: center; gap: 8px; font-size: var(--fs-name); font-weight: 800; }
.qr-print__logo { max-height: 32px; max-width: 96px; object-fit: contain; }
.qr-print__code { width: min(240px, 70vw); }
.qr-print__code svg { display: block; width: 100%; height: auto; }
.qr-print__title { font-size: 22px; font-weight: 800; }
.qr-print__customer { font-size: var(--fs-body); font-weight: 700; }
.qr-print__brand { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--c-line); font-size: 14px; color: var(--c-muted); }
.qr-print__brand .brand__mark { width: 24px; height: 24px; }
.qr-print__brand strong { color: var(--c-ink); font-weight: 800; letter-spacing: -0.3px; }

.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action-tile {
  min-height: 80px;
  border-radius: var(--radius-m);
  border: 1.5px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink);
  font: inherit; font-size: var(--fs-sub); font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; text-decoration: none; cursor: pointer;
}
.action-tile:hover { color: var(--c-ink); }
.action-tile--primary { background: var(--c-brand); border-color: var(--c-brand); color: #FFFFFF; }
.action-tile--primary:hover { color: #FFFFFF; background: var(--c-brand-dark); }

/* Chi tiết khách hàng: 2 tab bo cong, tab đang chọn màu vàng nối liền với nội dung */
.customer-tabs { margin-top: 4px; }
.customer-tabs__bar { display: flex; padding: 0 8px; }  /* thụt 8px, chân cong 8px chạm đúng mép */
.customer-tabs__tab { position: relative; flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 6px; border: 0; border-radius: 16px 16px 0 0; background: none; font: inherit; font-size: var(--fs-body); font-weight: 800; color: var(--c-muted); cursor: pointer; transition: background-color 0.15s ease-out, color 0.15s ease-out; }
.customer-tabs__tab.is-active { background: var(--c-accent); color: var(--c-ink); }
.customer-tabs__tab:focus-visible { outline: 3px solid var(--c-brand); outline-offset: -3px; }
.customer-tabs__tab::before, .customer-tabs__tab::after { content: ""; position: absolute; bottom: 0; width: 8px; height: 8px; pointer-events: none; opacity: 0; transition: opacity 0.15s ease-out; }
.customer-tabs__tab.is-active::before, .customer-tabs__tab.is-active::after { opacity: 1; }
.customer-tabs__tab::before { right: 100%; background: radial-gradient(circle at 0 0, transparent 8px, var(--c-accent) 8.5px); }
.customer-tabs__tab::after { left: 100%; background: radial-gradient(circle at 100% 0, transparent 8px, var(--c-accent) 8.5px); }
.customer-tabs__panel { padding: 6px 16px 12px; border-top: 3px solid var(--c-accent); border-radius: 0 0 16px 16px; background: var(--c-surface); box-shadow: 0 1px 3px rgba(20, 23, 31, 0.12); }
.customer-tabs__pane { display: flex; flex-direction: column; }
.customer-tabs__pane[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .customer-tabs__tab, .customer-tabs__tab::before, .customer-tabs__tab::after { transition: none; }
}
.customer-tabs__panel .info-row { padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--c-line); background: none; }
.customer-tabs__panel .order-list { gap: 0; }
.customer-tabs__panel .order-list .info-row:last-child { border-bottom: 0; }
.customer-tabs__panel .card { padding: 14px 0 4px; border-radius: 0; background: none; box-shadow: none; }
.customer-tabs__panel .group-label { margin: 0; padding-top: 10px; }
.customer-tabs__panel .info-list { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 8px 12px; }
.customer-tabs__panel .info-list a { white-space: nowrap; }

.info-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: var(--fs-body); }
.info-list dt { color: var(--c-muted); font-size: var(--fs-sub); padding-top: 2px; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }

/* Chọn sản phẩm cho khách */
.choice-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: var(--c-surface);
  border: 2px solid transparent;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-soft); }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--c-brand); flex-shrink: 0; }
.choice__title { display: block; font-size: var(--fs-body); font-weight: 700; }
.choice__hint { display: block; font-size: var(--fs-sub); color: var(--c-muted); }

.picker-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--fs-sub); }
.link-button { border: 0; background: none; padding: 10px 8px; font: inherit; font-weight: 700; color: var(--c-brand); cursor: pointer; }
.pick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-m);
  background: var(--c-surface);
  cursor: pointer;
}
.pick-row[hidden] { display: none; }
.pick-row input { width: 24px; height: 24px; margin: 0; accent-color: var(--c-brand); flex-shrink: 0; }

/* In: chỉ in thẻ mã QR */
@media print {
  body { background: #FFFFFF; }
  body * { visibility: hidden; }
  .qr-print, .qr-print * { visibility: visible; }
  .qr-print { position: absolute; left: 0; right: 0; top: 0; margin: 0 auto; width: 90mm; box-shadow: none; padding: 0; }
  .qr-print__code { width: 70mm; }
  .bottom-nav { display: none; }
}

/* ==========================================================================
   Trang khách đặt hàng – theo bộ nhận diện Muadi (giống nhau ở mọi xưởng).
   Xưởng chỉ khác logo, tên, số điện thoại. (Tùy chọn màu riêng: để sau)
   ========================================================================== */

.shop { background: var(--c-ground); }
.shop.has-cart .shop__main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.shop-header {
  background: var(--c-brand);
  color: #FFFFFF;
  padding: 12px var(--gutter) 0;
  border-bottom: 3px solid var(--c-accent);
  display: flex; flex-direction: column; gap: 10px;
}
/* Đầu trang đứng yên, chỉ danh sách cuộn. Màn hình quá thấp (xoay ngang) thì cuộn theo để còn chỗ xem sản phẩm */
@media (min-height: 560px) {
  .shop-header { position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 10px rgba(20, 23, 31, 0.14); }
  .stepper__input { scroll-margin-top: 190px; scroll-margin-bottom: 90px; }
}
.shop-header__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-header__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shop-header__who { min-width: 0; }
.shop-header__tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.shop-header__logo {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px; background: #FFFFFF;
  object-fit: contain; padding: 4px;
}
.shop-header__logo--initial { display: flex; align-items: center; justify-content: center; padding: 0; color: var(--c-brand); font-size: 20px; font-weight: 800; }
.shop-header__name { font-size: 18px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-header__customer { font-size: var(--fs-sub); line-height: 1.25; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shop-call {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF; text-decoration: none;
}
.shop-call:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.24); }

/* Nút ngôn ngữ nhỏ cạnh tab, bấm mở danh sách */
.lang-menu { position: relative; flex-shrink: 0; }
.lang-menu__button {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 0 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF; font-size: var(--fs-sub); font-weight: 700;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.lang-menu__button::-webkit-details-marker { display: none; }
.lang-menu__list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  min-width: 112px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  border-radius: 14px; background: var(--c-surface);
  box-shadow: 0 8px 24px rgba(20, 23, 31, 0.18);
}
.lang-menu__item {
  display: flex; align-items: center;
  min-height: 44px; padding: 0 12px;
  border-radius: 10px;
  color: var(--c-ink); font-size: var(--fs-sub); font-weight: 700; text-decoration: none;
}
.lang-menu__item:hover { color: var(--c-ink); background: var(--c-ground); }
.lang-menu__item.is-active { color: var(--c-brand-dark); background: var(--c-brand-soft); }

/* Khung trắng, tab đang chọn nền vàng chữ tối (chữ trắng trên vàng khó đọc) */
/* 2 tab bo cong: tab đang chọn màu vàng, nối liền với đường vàng ở chân đầu trang */
.shop-tabs { display: flex; margin: 0 calc(8px - var(--gutter)); }  /* thụt 8px, chân cong 8px chạm đúng mép */
.shop-tabs__item {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 6px;
  border-radius: 16px 16px 0 0; text-align: center;
  color: #FFFFFF; font-size: var(--fs-body); font-weight: 800; text-decoration: none;  /* 2 tab cùng độ đậm: chữ không nhúc nhích khi chuyển */
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.shop-tabs__item:hover { color: #FFFFFF; }
/* Console: dải tab trượt ngang. Tab rộng vừa chữ; màn hình rộng thì giãn ra chia đều. Không hiện thanh cuộn. */
.shop-tabs--scroll { margin: 0 calc(-1 * var(--gutter)); padding: 0 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding: 0 8px; }
.shop-tabs--scroll::-webkit-scrollbar { display: none; }
.admin-header .shop-tabs--scroll .shop-tabs__item { flex: 1 0 auto; min-width: auto; padding: 0 18px; white-space: nowrap; }
.shop-tabs--scroll::after { content: ""; flex: 0 0 20px; }  /* chừa chỗ cuối dải: tab cuối không dính mép */
.shop-tabs__item.is-active, .shop-tabs__item.is-active:hover { background: var(--c-accent); color: var(--c-ink); }
.shop-tabs__item::before, .shop-tabs__item::after { content: ""; position: absolute; bottom: 0; width: 8px; height: 8px; pointer-events: none; opacity: 0; transition: opacity 0.15s ease-out; }
.shop-tabs__item.is-active::before, .shop-tabs__item.is-active::after { opacity: 1; }
.shop-tabs__item::before { right: 100%; background: radial-gradient(circle at 0 0, transparent 8px, var(--c-accent) 8.5px); }
.shop-tabs__item::after { left: 100%; background: radial-gradient(circle at 100% 0, transparent 8px, var(--c-accent) 8.5px); }
.shop-header .shop-search[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .shop-tabs__item, .shop-tabs__item::before, .shop-tabs__item::after { transition: none; }
}
body.is-history .cart-bar { display: none; }
.shop-pane { display: flex; flex-direction: column; gap: 14px; }
.shop-pane[hidden] { display: none; }
/* Đang thử (?cuon=moi): đầu trang đứng yên, mỗi tab có vùng cuộn riêng, chuyển tab trang không phải nhảy.
   Màn hình quá thấp (xoay ngang) vẫn cuộn cả trang như cũ. */
@media (min-height: 560px) {
  html.is-tab-scroll, html.is-tab-scroll body { height: 100%; overflow: hidden; }
  html.is-tab-scroll .app { height: 100vh; height: 100dvh; min-height: 0; }
  html.is-tab-scroll .shop-header { position: relative; flex: none; }
  html.is-tab-scroll .shop__main { position: relative; flex: 1 1 0; min-height: 0; padding: 0; overflow: hidden; }
  html.is-tab-scroll .shop-pane { position: absolute; inset: 0; padding: 10px var(--gutter) 24px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  html.is-tab-scroll .shop-pane[hidden] { display: flex; visibility: hidden; }
  html.is-tab-scroll .shop.has-cart .shop__main { padding-bottom: 0; }
  html.is-tab-scroll .shop.has-cart .shop-pane { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Máy rất hẹp: nút ngôn ngữ gọn lại, nhường chỗ cho tên xưởng */
@media (max-width: 359px) {
  .lang-menu__button { padding: 0 6px; }
  .lang-menu__chevron { display: none; }
}

.shop__main { padding-top: 10px; }

/* Lưới sản phẩm */
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.shop-card {
  background: var(--c-surface);
  border-radius: var(--radius-l);
  border: 2px solid transparent;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.shop-card[hidden] { display: none; }
.shop-card.is-picked { border-color: var(--c-brand); }
.shop-card__photo {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  border: 0; padding: 0; margin: 0;
  background: var(--c-brand-soft); cursor: zoom-in;
}
.shop-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-card__photo--empty { display: flex; align-items: center; justify-content: center; color: var(--c-brand); cursor: default; }
.shop-card__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.shop-card__name { margin: 0; font-size: var(--fs-body); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.shop-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.shop-tag {
  padding: 2px 8px; border-radius: 8px;
  background: var(--c-ground); color: var(--c-ink-2);
  font-size: var(--fs-sub); line-height: 1.4; overflow-wrap: anywhere;
}
.shop-card__price { font-size: var(--fs-name); font-weight: 800; color: var(--c-brand-dark); }
.shop-card__unit { font-size: var(--fs-sub); font-weight: 500; color: var(--c-muted); white-space: nowrap; }
.shop-card__text { display: contents; }

/* Cửa hàng không có ảnh: danh sách gọn, tên + giá bên trái, số lượng bên phải */
.shop-grid.shop-grid--list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.shop-grid--list .shop-card__body { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 14px; }
.shop-grid--list .shop-card__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.shop-grid--list .shop-card__price { font-size: var(--fs-body); }
.shop-grid--list .stepper { flex-shrink: 0; width: 140px; margin: 0; padding: 0; }
.shop-grid--list .shop-card__paused { flex-shrink: 0; max-width: 100px; margin: 0; text-align: right; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: auto; padding-top: 4px; }
.stepper__btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px; border: 1.5px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink);
  font: inherit; font-size: 22px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.stepper__btn--plus { background: var(--c-brand); border-color: var(--c-brand); color: #FFFFFF; }
.stepper__input {
  width: 100%; min-width: 0; height: 44px;
  border: 0; background: transparent; text-align: center;
  font: inherit; font-size: 20px; font-weight: 800; color: var(--c-ink);
  -moz-appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.shop-search { margin-bottom: 12px; }
.shop-header .shop-search { margin-bottom: 0; min-height: 48px; color: var(--c-ink); }
.shop-header .search__input { color: var(--c-ink); }

/* Trạng thái trống (có hình minh họa) */
.shop-empty { padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--c-muted); }
.shop-empty svg { width: 88px; height: 88px; }
.shop-empty[hidden] { display: none; }

/* Thanh giỏ hàng */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;   /* phần trống quanh nút không chặn thao tác với danh sách phía sau */
}
.cart-bar__button, .cart-hint { pointer-events: auto; }
.cart-bar[hidden] { display: none; }
.cart-bar__button {
  width: 100%; max-width: var(--content-max); margin: 0 auto;
  min-height: 56px; padding: 6px 14px 6px 8px;
  border: 0; border-radius: 18px;
  box-shadow: 0 6px 18px rgba(20, 23, 31, 0.22);
  background: var(--c-accent); color: var(--c-ink);
  display: flex; align-items: center; gap: 10px;
  font: inherit; text-align: left; cursor: pointer;
}
.cart-bar__button:hover { filter: brightness(0.96); }
.cart-bar__bag {
  position: relative; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.cart-bar__count {
  position: absolute; top: -4px; right: -6px;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: var(--c-brand); color: #FFFFFF;
  box-shadow: 0 0 0 2px var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.cart-bar__count.is-bump { animation: cart-bump 0.28s ease-out; }
@keyframes cart-bump { 40% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .cart-bar__count.is-bump { animation: none; } }
.cart-bar__text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-bar__action { font-size: 17px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.cart-bar__kinds { font-size: var(--fs-sub); font-weight: 500; }
.cart-bar__total { flex-shrink: 0; font-size: 17px; font-weight: 800; white-space: nowrap; }

/* Có hàng trong giỏ mà đứng yên: nhắc 1 lần, cùng mức chuyển động với dải cam ở trang xưởng */
.cart-bar__button { position: relative; overflow: hidden; }
.is-guiding .cart-bar__button { animation: cart-nudge 1.4s ease-in-out 3; }
.is-guiding .cart-bar__button::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: cart-sheen 2.8s ease-in-out 2 both;
}
@keyframes cart-nudge { 50% { transform: translateY(-5px); } }
@keyframes cart-sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(260%); } }
.cart-hint {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 2 * var(--gutter));
  padding: 10px 16px; border: 0; border-radius: 14px;
  background: var(--c-ink); color: #FFFFFF;
  font: inherit; font-size: var(--fs-sub); font-weight: 700; cursor: pointer;
  animation: cart-hint-in 0.25s ease-out;
}
.cart-hint[hidden] { display: none; }
.cart-hint::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -8px;
  border: 8px solid transparent; border-bottom: 0; border-top-color: var(--c-ink);
}
@keyframes cart-hint-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .is-guiding .cart-bar__button, .is-guiding .cart-bar__button::after, .cart-hint { animation: none; }
  .is-guiding .cart-bar__button::after { display: none; }
}
/* Máy rất hẹp: số tiền dài vẫn nằm gọn một hàng */
@media (max-width: 359px) {
  .cart-bar__button { gap: 8px; padding: 8px 12px 8px 8px; }
  .cart-bar__bag { width: 38px; height: 38px; }
  .cart-bar__bag svg { width: 24px; height: 24px; }
  .cart-bar__action, .cart-bar__total { font-size: 15px; }
}

/* Bảng xác nhận (dialog) */
.sheet {
  width: min(100% - 24px, 560px);
  max-height: calc(100dvh - 32px);
  border: 0; border-radius: 24px;
  padding: 20px;
  color: var(--c-ink);
}
.sheet::backdrop { background: rgba(20, 23, 31, 0.5); }
.sheet[open] { display: flex; flex-direction: column; gap: 14px; }
.sheet__title { font-size: 22px; font-weight: 800; }
.sheet__title:focus { outline: none; }
.sheet__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-body); }
.sheet__items li { display: flex; justify-content: space-between; gap: 12px; }
.sheet__total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--c-line); font-size: var(--fs-name); font-weight: 800; }
.sheet__total[hidden] { display: none; }
/* nút luôn ở đáy popup, nội dung dài thì cuộn phía trên */
.sheet__actions {
  position: sticky; bottom: -20px; z-index: 1; flex-shrink: 0;
  display: flex; gap: 10px;
  margin: 0 -20px -20px; padding: 12px 20px 20px;
  background: var(--c-surface); border-top: 1px solid var(--c-line);
}
.sheet__actions .btn { padding-inline: 14px; white-space: nowrap; }
.sheet__actions .btn--primary { flex-grow: 1; }
#confirm-warnings .alert { margin: 0 0 8px; }

.check-row { display: flex; align-items: center; gap: 12px; font-size: var(--fs-body); font-weight: 600; cursor: pointer; }
.check-row input { width: 24px; height: 24px; margin: 0; accent-color: var(--c-brand); flex-shrink: 0; }

/* Đặt hàng thành công */
.success-card {
  background: var(--c-surface);
  border-radius: var(--radius-l);
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  margin-bottom: 8px;
}
.success-card__badge {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--c-brand-soft); color: var(--c-brand);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.success-card__badge svg { width: 40px; height: 40px; }
.success-card__title { font-size: 24px; font-weight: 800; }
.success-card__number { font-size: var(--fs-body); }
.success-card__items { list-style: none; margin: 4px 0; padding: 0; font-size: var(--fs-body); color: var(--c-ink-2); }
.success-card__total { font-size: var(--fs-name); font-weight: 800; }
.success-card__note { margin: 4px 0; font-size: var(--fs-sub); color: var(--c-muted); }
.success-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* Footer Muadi */
.shop-footer {
  margin-top: 20px; padding: 16px 0 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--c-muted); font-size: var(--fs-sub);
  border-top: 1px solid var(--c-line);
}
.shop-footer .brand__mark { width: 28px; height: 28px; }
.shop-footer strong { color: var(--c-ink); font-weight: 800; letter-spacing: -0.3px; }

/* Ảnh phóng to */
.zoom { border: 0; border-radius: 20px; padding: 12px; width: min(100% - 24px, 640px); }
.zoom::backdrop { background: rgba(20, 23, 31, 0.75); }
.zoom[open] { display: flex; flex-direction: column; gap: 12px; }
.zoom img { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 12px; }

/* ---------- Cài đặt ---------- */

.menu-list { display: flex; flex-direction: column; background: var(--c-surface); border-radius: var(--radius-l); overflow: hidden; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px;
  color: var(--c-ink); text-decoration: none;
  border-bottom: 1px solid var(--c-line);
}
.menu-item:last-child { border-bottom: 0; }
a.menu-item:hover { color: var(--c-ink); background: var(--c-ground); }
.menu-item__icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px; background: var(--c-brand-soft); color: var(--c-brand-dark);
  display: flex; align-items: center; justify-content: center;
}
.menu-item__text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-item__title { font-size: var(--fs-body); font-weight: 700; overflow-wrap: anywhere; }
.menu-item__hint { font-size: var(--fs-sub); color: var(--c-muted); overflow-wrap: anywhere; }

.logo-field { display: flex; align-items: center; gap: 14px; }
.logo-field__preview {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 18px; border: 1px solid var(--c-line); background: var(--c-surface);
  object-fit: contain;
}
.logo-field__preview--empty { display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: var(--c-muted); }
.logo-field__actions { display: flex; flex-direction: column; gap: 8px; }

select.input { appearance: auto; }
.file-input { padding: 12px 14px; font-size: var(--fs-sub); }

.field-row { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--radius-m); background: var(--c-surface); }
.field-row__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.field-row__main .input { min-height: 48px; }
.field-row__tools { display: flex; flex-direction: column; gap: 4px; }
.field-row__tools .icon-btn { width: 40px; height: 40px; }

/* ---------- Trang lỗi ---------- */

.error-page {
  min-height: 100vh; min-height: 100dvh;
  max-width: 480px; margin: 0 auto;
  padding: 48px var(--gutter);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center;
}
.error-page__icon { width: 64px; height: 64px; color: var(--c-muted); }
.error-page__title { font-size: 24px; font-weight: 800; }
.error-page__message { margin: 0; color: var(--c-ink-2); line-height: 1.6; }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* ==========================================================================
   Muadi Console (quản trị nền tảng) – máy tính: menu trái / điện thoại: menu đáy
   ========================================================================== */

.console { background: var(--c-ground); }

.btn--dark { background: var(--c-ink); color: #FFFFFF; }
.btn--dark:hover { color: #FFFFFF; background: #000000; }

/* Đầu trang admin: xanh rừng + nhãn ADMIN để không nhầm với trang của xưởng và của khách.
   Dùng lại đầu trang và tab cong của trang khách, nhưng cuộn theo trang để biểu mẫu dài còn đủ chỗ khi hiện bàn phím */
.shop-header.admin-header { position: static; box-shadow: none; background: #0A3D2E; }
.admin-header__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-header__brand, .admin-header__brand:hover { display: flex; align-items: center; gap: 10px; min-width: 0; color: #FFFFFF; text-decoration: none; font-size: 18px; font-weight: 800; }
.admin-header__brand .brand__mark { width: 40px; height: 40px; }
.admin-header__badge { padding: 3px 8px; border-radius: 7px; background: var(--c-accent); color: var(--c-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.8px; line-height: 1.3; }
.admin-header__logout { margin: 0; flex-shrink: 0; }
.admin-header__logout .link-button { min-height: 44px; color: #FFFFFF; font-weight: 700; }
.admin-header .shop-search, .admin-header .shop-tabs { width: 100%; max-width: 560px; }
.admin-header .shop-tabs { width: auto; }
.admin-header .shop-tabs__item { white-space: nowrap; }
@media (max-width: 359px) {
  .admin-header__wordmark { display: none; }
  .admin-header .shop-tabs__item { padding: 0 2px; font-size: 15px; }
}


.console-main { flex-grow: 1; min-width: 0; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 16px; }
.console-main--full { max-width: 1180px; margin: 0 auto; width: 100%; }
.console-title { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.6px; }


.search--big { min-height: 60px; border-width: 2px; border-color: var(--c-brand); border-radius: 18px; }
.search--big .search__input { font-size: 18px; }

/* Ô số liệu */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--c-ground); border-radius: 18px; padding: 14px 16px; }
.console-main > .stat-grid .stat, .stat-grid--wide .stat { background: var(--c-surface); }
.stat--warn { background: var(--c-accent-soft) !important; }
.stat--danger { background: var(--c-danger-soft) !important; }
.stat__label { font-size: var(--fs-sub); font-weight: 600; color: var(--c-muted); }
.stat__value { font-size: 28px; font-weight: 800; line-height: 1.2; }

.console-soon ul { margin: 0; padding-left: 20px; color: var(--c-ink-2); line-height: 1.7; }

/* Danh sách xưởng */
.store-list { display: flex; flex-direction: column; gap: 10px; }
.store-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-l);
  background: var(--c-surface); color: var(--c-ink); text-decoration: none;
}
.store-row__avatar {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px;
  background: var(--c-brand-soft); color: var(--c-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.store-row__body { min-width: 0; }
.store-row__name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--fs-name); font-weight: 700; }
.store-row__meta { font-size: var(--fs-sub); color: var(--c-muted); }

/* Tab Xưởng: lọc và sắp xếp, dính ở đỉnh khi cuộn; mỗi xưởng 2 dòng để một màn hình thấy nhiều xưởng */
.store-filter { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; gap: 6px; padding: 8px 0; margin-top: -8px; background: var(--c-ground); }
.store-filter__chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.store-filter__chips::-webkit-scrollbar { display: none; }
.store-filter__chip { flex: none; min-height: 40px; padding: 0 13px; border: 1px solid var(--c-line-strong); border-radius: 999px; background: var(--c-surface); color: var(--c-ink-2); font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.store-filter__chip b { display: inline-block; min-width: 22px; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-dark); font-weight: 800; text-align: center; }
.store-filter__chip[aria-pressed="true"] { background: #0A3D2E; border-color: #0A3D2E; color: #FFFFFF; }
.store-filter__chip[aria-pressed="true"] b { background: var(--c-accent); color: #0A3D2E; }
.store-filter__tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.store-filter__sort { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--c-muted); font-size: var(--fs-sub); font-weight: 600; white-space: nowrap; }
.store-filter__sort select { min-height: 40px; max-width: 170px; border: 0; background: none; color: var(--c-ink); font: inherit; font-size: 16px; font-weight: 700; }
.store-filter__new { flex: none; font-size: var(--fs-sub); font-weight: 700; }
.store-lines { background: var(--c-surface); border-radius: var(--radius-l); overflow: hidden; }
.store-lines[hidden] { display: none; }
.store-line { display: flex; align-items: center; gap: 10px; min-height: 64px; margin-top: -1px; padding: 10px 14px; border-top: 1px solid var(--c-line); color: var(--c-ink); text-decoration: none; }
.store-line[hidden] { display: none; }
.store-line__body { flex: 1 1 auto; min-width: 0; }
.store-line__name { font-size: var(--fs-body); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-line__meta { font-size: 14px; line-height: 1.35; color: var(--c-muted); }
.store-line .pill { flex: none; padding: 3px 9px; font-size: 13px; }
@media (max-width: 860px) {
  .store-filter__chips { margin: 0 calc(0px - var(--gutter)); padding: 0 var(--gutter); }
}
@media (max-width: 359px) {
  .store-filter__sort-text { display: none; }
}

/* Trang một xưởng: đầu trang gọn đứng yên, 3 tab theo 3 việc */
.shop-header.admin-header.store-head { gap: 8px; padding-top: 8px; }
@media (min-height: 560px) {
  .shop-header.admin-header.store-head { position: sticky; top: 0; z-index: 30; }
}
.store-head__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.store-head__back, .store-head__back:hover { flex: none; min-width: 40px; min-height: 44px; margin-left: -10px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-size: 30px; line-height: 1; text-decoration: none; }
.store-head__who { flex: 1 1 auto; min-width: 0; }
.store-head__name { margin: 0; color: #FFFFFF; font-size: 18px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-head__sub { color: #FFFFFF; opacity: 0.9; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-head__top .pill { flex: none; padding: 3px 9px; font-size: 13px; }
.store-pane { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; }
.store-pane[hidden] { display: none; }
.store-pane .card { margin: 0; }
.store-pane section > .section-title { margin-bottom: 10px; }
.store-pane .card-head { margin-bottom: 10px; }
.store-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.store-actions form { margin: 0; display: grid; }
.store-actions .btn { min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 15px; text-align: center; }
.store-pane .store-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.store-pane .store-stats--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.store-pane .store-stats--two .stat__value { font-size: 20px; white-space: nowrap; }
.store-pane .stat { background: var(--c-surface); padding: 12px; border-radius: 14px; }
.store-pane .stat__label { font-size: 13px; line-height: 1.3; }
.store-pane .stat__value { font-size: 20px; overflow-wrap: anywhere; }
.store-stats__hint { font-size: 13px; color: var(--c-muted); }
.store-alert { background: var(--c-accent-soft); }
.store-alert--risk { background: var(--c-danger-soft); }
.store-alert ul { margin: 0; padding-left: 20px; font-size: var(--fs-body); font-weight: 600; line-height: 1.6; }
.store-bars { display: flex; align-items: stretch; gap: 6px; height: 124px; }
.store-bars__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; font-size: 12px; color: var(--c-muted); }
.store-bars__n { font-weight: 700; color: var(--c-ink); }
.store-bars__bar { display: block; width: 100%; min-height: 3px; flex: none; border-radius: 5px 5px 0 0; background: var(--c-brand); }
.store-lines-plain { list-style: none; margin: 0; padding: 0; }
.store-lines-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--c-line); font-size: 15px; }
.store-lines-plain li:first-child { border-top: 0; padding-top: 0; }
.store-lines-plain b { flex: none; font-weight: 600; color: var(--c-muted); text-align: right; }
.store-more summary { min-height: 28px; font-size: var(--fs-body); font-weight: 700; cursor: pointer; }
.store-more[open] summary { margin-bottom: 8px; }
.store-more .field__hint { margin-top: 0; }
.store-more--plain { margin-top: 10px; }
.store-more--plain summary { font-size: var(--fs-sub); color: var(--c-brand-dark); }
.store-payments { list-style: none; margin: 0; padding: 0; }
.store-payments li { padding: 10px 0; border-top: 1px solid var(--c-line); font-size: var(--fs-body); }
.store-payments li:first-child { border-top: 0; padding-top: 0; }
.store-payments s { font-size: 14px; color: var(--c-muted); }
.store-payments small { display: block; font-size: 14px; color: var(--c-muted); }

/* Tab Hoạt động: 3 card là bộ lọc, mỗi xưởng một thẻ có đủ số để so sánh */
.activity-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; padding-top: 8px; margin-top: -8px; background: var(--c-ground); }
.activity-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.activity-card { min-width: 0; min-height: 64px; padding: 8px 6px; border: 1px solid var(--c-line-strong); border-radius: 14px; background: var(--c-surface); color: var(--c-ink); font: inherit; text-align: center; cursor: pointer; }
.activity-card b { display: block; font-size: 22px; font-weight: 800; line-height: 1.15; }
.activity-card span { display: block; font-size: 13px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.activity-card--good b { color: var(--c-brand-dark); }
.activity-card--watch b { color: #8A4B08; }
.activity-card--risk b { color: #C62828; }
.activity-card[aria-pressed="true"] { background: #0A3D2E; border-color: #0A3D2E; color: #FFFFFF; }
.activity-card[aria-pressed="true"] b { color: #FFFFFF; }
.activity-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.activity-tools__count { flex: none; color: var(--c-muted); font-size: var(--fs-sub); font-weight: 700; }
.activity-tools__sort { display: flex; min-width: 0; }
.activity-tools__sort select { width: 100%; max-width: 245px; min-height: 40px; border: 0; background: none; color: var(--c-ink); font: inherit; font-size: 16px; font-weight: 700; text-align: right; }
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-list[hidden], .activity-row[hidden] { display: none; }
.activity-row { display: block; padding: 12px 14px; border-radius: var(--radius-l); background: var(--c-surface); color: var(--c-ink); text-decoration: none; }
.activity-row:hover { color: var(--c-ink); }
.activity-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.activity-row__name { min-width: 0; font-size: var(--fs-body); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-row__head .pill { flex: none; padding: 3px 9px; font-size: 13px; }
.activity-row__reason { margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--c-muted); }
.activity-row__reason--watch { color: #8A4B08; }
.activity-row__reason--risk { color: #C62828; }
.activity-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-line); }
.activity-nums > div { min-width: 0; }
.activity-nums small { display: block; font-size: 12px; line-height: 1.3; color: var(--c-muted); white-space: nowrap; }
.activity-nums b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .activity-card span { font-size: 12px; }
  .activity-nums { align-items: end; }
  .activity-nums small { white-space: normal; }
}

/* Tab Hoạt động (tổng nhiều xưởng): chọn khoảng, ô tổng có % so với kỳ trước, mỗi xưởng một thẻ 3×3 số */
.ov-periods { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 8px 0 6px; margin-top: -8px; background: var(--c-ground); }
.ov-period { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 0 2px; border: 1px solid var(--c-line-strong); border-radius: 12px; background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.ov-period:hover { color: var(--c-ink); }
.ov-period.is-active { background: var(--c-brand); border-color: var(--c-brand); color: #FFFFFF; }
.ov-compare { margin: 0 0 8px; font-size: var(--fs-sub); font-weight: 600; color: var(--c-muted); }
.ov-totals { display: flex; flex-direction: column; padding: 12px 14px 4px; margin-bottom: 12px; border-radius: var(--radius-l); background: var(--c-surface); }
.ov-totals__title { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.ov-trow { display: grid; grid-template-columns: minmax(0, 1fr) auto 78px; gap: 8px; align-items: baseline; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--c-line); background: none; color: var(--c-ink); font: inherit; text-align: left; }
.ov-totals__title + .ov-trow { border-top: 0; }
button.ov-trow { cursor: pointer; }
.ov-trow__label { min-width: 0; font-weight: 600; color: var(--c-ink-2); }
.ov-trow__value { font-size: 18px; font-weight: 800; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-delta { font-size: 13px; font-weight: 700; color: var(--c-muted); text-align: right; white-space: nowrap; }
.ov-delta--up { color: var(--c-brand-dark); }
.ov-delta--down { color: var(--c-danger); }
.ov-peak { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 0; border: 0; border-top: 1px solid var(--c-line); background: none; color: var(--c-ink); font: inherit; text-align: left; cursor: pointer; }
.ov-peak:disabled { cursor: default; }
.ov-peak__main { flex: 1; min-width: 0; }
.ov-peak__main b { display: block; font-weight: 700; }
.ov-peak__main small { display: block; font-size: 14px; color: var(--c-muted); }
.ov-peak__go { flex: none; font-size: 20px; color: var(--c-muted); }
.ov-filters { margin-bottom: 4px; }
.ov-cards { display: flex; flex-direction: column; gap: 10px; }
.ov-cards[hidden], .ov-card[hidden] { display: none; }
.ov-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-l); background: var(--c-surface); cursor: pointer; }
.ov-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ov-card__name { min-width: 0; font-size: 17px; font-weight: 800; color: var(--c-ink); text-decoration: none; overflow-wrap: anywhere; }
.ov-plan { flex: none; padding: 1px 9px; border-radius: 999px; background: var(--c-soft); color: var(--c-ink-2); font-size: 13px; font-weight: 700; }
.ov-card__line { margin: 0; font-size: 14px; color: var(--c-ink-2); }
.ov-spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; border-bottom: 1px solid var(--c-line-strong); }
.ov-spark i { flex: 1 1 0; min-width: 0; border-radius: 3px 3px 0 0; background: var(--c-brand); }
.ov-spark i.is-zero { background: var(--c-line-strong); }
.ov-spark__cap { margin: -5px 0 0; font-size: 13px; color: var(--c-muted); }
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 8px; border-top: 1px solid var(--c-line); }
.ov-cell { display: block; min-width: 0; padding: 0; border: 0; background: none; color: var(--c-ink); font: inherit; text-align: left; cursor: pointer; }
.ov-cell small { display: block; font-size: 13px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-cell b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ov-flags { margin: 0; }
.ov-flag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--c-accent-soft); color: #7A4300; font-size: 13px; font-weight: 700; }
.ov-note { margin: 14px 0 0; font-size: 14px; color: var(--c-muted); }
.ov-full { margin: 0; font-size: 30px; font-weight: 800; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ov-kv { display: flex; flex-direction: column; }
.ov-kv > * { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--c-line); color: var(--c-ink); text-decoration: none; }
.ov-kv > *:first-child { border-top: 0; }
.ov-kv span { min-width: 0; color: var(--c-ink-2); overflow-wrap: anywhere; }
.ov-kv b { flex: none; font-variant-numeric: tabular-nums; }
.ov-sub { margin: 4px 0 0; font-size: 16px; font-weight: 800; }
.ov-hours { display: flex; align-items: flex-end; gap: 2px; height: 96px; border-bottom: 1px solid var(--c-line-strong); }
.ov-hours button { flex: 1 1 0; min-width: 0; height: 100%; padding: 0; border: 0; background: none; display: flex; align-items: flex-end; cursor: pointer; }
.ov-hours i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--c-brand); }
.ov-hours button.is-zero i { background: var(--c-line-strong); }
.ov-hours__axis { display: flex; justify-content: space-between; margin-top: -10px; font-size: 13px; color: var(--c-muted); }
.ov-hours__read { margin: 0; font-weight: 700; }
.ov-cal-nav { display: flex; align-items: center; justify-content: space-between; }
.ov-cal-nav b { font-weight: 800; }
.ov-cal-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.ov-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; margin-top: -6px; }
.ov-cal__w { padding: 4px 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--c-muted); }
.ov-cal__d { min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--c-ink); font: inherit; font-weight: 600; cursor: pointer; }
.ov-cal__d:disabled { color: var(--c-line-strong); cursor: default; }
.ov-cal__d.is-mid { border-radius: 0; background: var(--c-brand-soft); color: var(--c-brand-dark); }
.ov-cal__d.is-end { background: var(--c-brand); color: #FFFFFF; font-weight: 800; }
.ov-cal__d.is-today:not(.is-end) { box-shadow: inset 0 0 0 2px var(--c-accent); }
.ov-cal__sum { margin: 0; font-weight: 800; }

/* Tab Hoạt động của 1 xưởng: 4 ô có %, 7 khu bấm để mở, popup nhiều lớp */
.ac-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ac-stat { display: flex; flex-direction: column; min-width: 0; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--c-surface); color: var(--c-ink); font: inherit; text-align: left; }
button.ac-stat { cursor: pointer; }
.ac-stat__label { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.ac-stat__value { font-size: 22px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ac-stat__sub { font-size: 13px; color: var(--c-muted); }
.ac-stat__sub .ov-delta { margin-left: 2px; }
.ac-zones { display: flex; flex-direction: column; gap: 10px; }
.ac-zones .zone--ac-rhythm { --zone-bg: var(--c-brand-soft); --zone-mark: var(--c-brand); --zone-ink: var(--c-brand-dark); }
.ac-zones .zone--ac-workshop { --zone-bg: #E4EFFD; --zone-mark: #1F63C7; --zone-ink: #17488F; }
.ac-zones .zone--ac-customers { --zone-bg: #EFE8FB; --zone-mark: #6B3FC2; --zone-ink: #4A2A8C; }
.ac-zones .zone--ac-plan { --zone-bg: var(--c-accent-soft); --zone-mark: var(--c-accent); --zone-ink: #7A4300; }
.ac-zones .zone.is-open .zone__body { display: flex; flex-direction: column; gap: 10px; }
.zone__panel .ov-sub:first-child { margin-top: 0; }
.ac-chart { display: flex; flex-direction: column; gap: 8px; }
.ov-hours button.is-picked i { background: var(--c-brand-dark); }
.ac-hint { font-size: 14px; color: var(--c-muted); }
.ac-list { display: flex; flex-direction: column; }
.ac-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 0; border: 0; border-top: 1px solid var(--c-line); background: none; color: var(--c-ink); font: inherit; text-align: left; }
.ac-list > .ac-row:first-child { border-top: 0; }
button.ac-row { cursor: pointer; }
.ac-row__main { flex: 1 1 auto; min-width: 0; }
.ac-row__main b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.ac-row__main small { display: block; font-size: 14px; color: var(--c-muted); overflow-wrap: anywhere; }
.ac-row__val { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.ac-row__go { flex: none; font-size: 20px; color: var(--c-muted); }
.ac-heat { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.ac-heat[hidden] { display: none; }
.ac-heat__day { font-size: 12px; font-weight: 700; color: var(--c-muted); }
.ac-heat__cell { display: block; height: 18px; border-radius: 3px; background: var(--c-soft); cursor: pointer; }
.ac-heat__cell--1 { background: #CDEBDD; }
.ac-heat__cell--2 { background: #8FD0B1; }
.ac-heat__cell--3 { background: #3FA77A; }
.ac-heat__cell--4 { background: var(--c-brand-dark); }
.ac-heat__cell.is-picked { outline: 2px solid var(--c-ink); outline-offset: 1px; }
.ac-heat__axis { display: flex; justify-content: space-between; padding-left: 28px; font-size: 12px; color: var(--c-muted); }
.ac-zones .ov-kv span { flex: none; max-width: 58%; }
.ac-zones .ov-kv b { flex: 0 1 auto; min-width: 0; text-align: right; }
.ac-meter { height: 8px; margin: 2px 0 8px; border-radius: 4px; background: var(--c-soft); overflow: hidden; }
.ac-meter i { display: block; height: 100%; border-radius: 4px; background: var(--c-brand); }
.ac-meter.is-high i { background: var(--c-accent); }
.ac-sheet__title { font-size: 19px; }
.ac-timeline { display: flex; flex-direction: column; gap: 10px; }
.ac-timeline section[hidden] { display: none; }
.ac-tl-day { margin: 0; font-size: 15px; font-weight: 800; color: var(--c-ink-2); }
.ac-tl { list-style: none; margin: 0; padding: 0; }
.ac-tl li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--c-line); }
.ac-tl li:first-child { border-top: 0; }
.ac-tl li[hidden] { display: none; }
.ac-tl time { flex: none; width: 44px; font-weight: 700; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.ac-tl__body { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; color: var(--c-ink); font: inherit; text-align: left; }
.ac-tl__link { cursor: pointer; }
.ac-tl__link b::after { content: ' ›'; color: var(--c-muted); }
.ac-tl__body b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.ac-tl__body small { display: block; font-size: 14px; color: var(--c-muted); overflow-wrap: anywhere; }

/* Tab Hệ thống: tóm tắt xanh/đỏ, nhãn trạng thái, thanh đo; khu có vấn đề chuyển đỏ */
.sys-sum { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; padding: 14px; border: 1px solid #BFE3D2; border-radius: 18px; background: var(--c-brand-soft); }
.sys-sum__head { display: flex; align-items: center; gap: 10px; }
.sys-sum b { font-size: 19px; font-weight: 800; color: var(--c-brand-dark); }
.sys-sum p { margin: 0; font-size: 14px; color: var(--c-ink-2); }
.sys-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c-brand); box-shadow: 0 0 0 4px #BFE3D2; }
.sys-sum.is-bad { border-color: #F5C2BC; background: #FDECEA; }
.sys-sum.is-bad b { color: #B42318; }
.sys-sum.is-bad .sys-dot { background: #B42318; box-shadow: 0 0 0 4px #F5C2BC; }
.sys-issues { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.sys-issue { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--c-surface); color: var(--c-ink); font: inherit; text-align: left; cursor: pointer; }
.sys-issue span { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.sys-issue small { display: block; font-size: 13px; font-weight: 600; color: var(--c-muted); }
.sys-issue i { font-style: normal; font-size: 20px; color: var(--c-muted); }
.sys-checked { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--c-muted); }
.sys-refresh { min-height: 44px; }
.ac-zones .sys-zone--run { --zone-bg: var(--c-brand-soft); --zone-mark: var(--c-brand); --zone-ink: var(--c-brand-dark); }
.ac-zones .sys-zone--server { --zone-bg: #E4EFFD; --zone-mark: #1F63C7; --zone-ink: #17488F; }
.ac-zones .sys-zone--backup { --zone-bg: #EFE8FB; --zone-mark: #6B3FC2; --zone-ink: #4A2A8C; }
.ac-zones .sys-zone--jobs { --zone-bg: var(--c-accent-soft); --zone-mark: var(--c-accent); --zone-ink: #7A4300; }
.ac-zones .sys-zone.is-bad { --zone-bg: #FDECEA; --zone-mark: #B42318; --zone-ink: #B42318; }
.sys-badge { flex: none; padding: 2px 10px; border-radius: 99px; background: #B42318; color: #FFFFFF; font-size: 13px; font-weight: 800; }
.sys-pill { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.sys-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sys-pill--ok { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.sys-pill--bad { background: #FDECEA; color: #B42318; }
.sys-pill--none { background: var(--c-soft); color: var(--c-muted); }
.ac-row.is-bad .ac-row__main b { color: #B42318; }
.sys-meter { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--c-line); }
.ac-list > .sys-meter:first-child { border-top: 0; }
.sys-meter__top { display: flex; justify-content: space-between; gap: 10px; }
.sys-meter__top b { font-weight: 700; }
.sys-meter__top span { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.sys-meter .ac-meter { margin: 0; }
.sys-meter small { font-size: 13px; color: var(--c-muted); }
.sys-meter.is-bad .ac-meter i { background: #B42318; }
.sys-meter.is-bad .sys-meter__top span { color: #B42318; }
.sys-grow { height: 72px; }
.sys-grow button i { background: #1F63C7; }
.sys-grow__axis { margin-top: 0; }
.sys-hash { padding: 1px 6px; border-radius: 6px; background: var(--c-soft); font-size: 14px; font-weight: 600; }
.sys-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-kv .sys-kv-bad b, .ov-kv .sys-kv-bad span { color: #B42318; }

/* Gói dịch vụ */
.plan-card { display: block; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--radius-l); background: var(--c-surface); color: var(--c-ink); font: inherit; text-align: left; cursor: pointer; }
.plan-card[hidden] { display: none; }
.plan-card.is-off { opacity: 0.62; }
.plan-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card__name { min-width: 0; font-size: var(--fs-body); font-weight: 800; overflow-wrap: anywhere; }
.plan-card__head .pill { flex: none; padding: 3px 9px; font-size: 13px; }
.plan-card__price { display: block; margin-top: 4px; font-size: 17px; font-weight: 800; }
.plan-card__price small { font-size: 14px; font-weight: 600; color: var(--c-muted); }
.plan-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-line); }
.plan-nums small { display: block; font-size: 12px; line-height: 1.3; color: var(--c-muted); }
.plan-nums b { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.plan-add { min-height: 48px; border: 1.5px dashed var(--c-line-strong); border-radius: var(--radius-l); background: none; color: var(--c-brand-dark); font: inherit; font-weight: 700; cursor: pointer; }
.plan-panel { max-height: 86vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.plan-panel [hidden], .plan-warn[hidden], #trial-box[hidden] { display: none !important; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-delete { min-height: 44px; flex: none; border: 0; background: none; color: var(--c-danger); font: inherit; font-weight: 700; cursor: pointer; }
.plan-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-now__name { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.plan-now .btn { flex: none; }
.plan-now--app { padding: 10px 14px; margin-bottom: 10px; }
.plan-now--app .plan-now__name { font-size: 17px; }
.plan-now--app > b { flex: none; }
.plan-use { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 15px; font-weight: 600; }
.plan-bar { height: 8px; margin-top: 6px; border-radius: 4px; background: var(--c-line); overflow: hidden; }
.plan-bar i { display: block; height: 100%; border-radius: 4px; background: var(--c-brand); }
.plan-bar i.is-full { background: var(--c-danger); }
.plan-warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--c-accent-soft); font-size: 14px; font-weight: 600; line-height: 1.4; }
.plan-choices { display: flex; flex-direction: column; gap: 8px; }
.plan-choice { display: block; padding: 12px; border: 1.5px solid var(--c-line-strong); border-radius: 14px; background: var(--c-surface); cursor: pointer; }
.plan-choice.is-active { border-color: var(--c-brand); background: var(--c-brand-soft); }
.plan-choice:focus-within { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.plan-choice b { display: block; font-size: 15px; }
.plan-choice small { display: block; font-size: 14px; color: var(--c-muted); }

/* Tab Dịch vụ: Cần thu / Đã thu / Bảng giá trong một trang */
.service-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; margin-top: -8px; background: var(--c-ground); }
.service-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; border-radius: 12px; background: var(--c-line); }
.service-seg a { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 10px; color: var(--c-ink-2); font-size: 15px; font-weight: 700; text-decoration: none; }
.service-seg a[aria-current] { background: var(--c-surface); color: var(--c-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.activity-cards[hidden], .store-filter__chips[hidden] { display: none; }
.service-card--overdue b { color: #C62828; }
.service-card--soon b { color: #8A4B08; }
.service-card--trial b { color: var(--c-brand-dark); }
.activity-card[aria-pressed="true"] b { color: #FFFFFF; }
.service-pane { display: flex; flex-direction: column; gap: 10px; }
.service-pane[hidden] { display: none; }
.service-row__name { color: var(--c-ink); text-decoration: none; }
.service-row__meta { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--c-muted); }
.service-row__amount { flex: none; text-align: right; }
.service-row__amount b { font-size: var(--fs-body); }
.service-row__amount s { font-size: 14px; color: var(--c-muted); }
.service-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.service-actions--one { grid-template-columns: 1fr; margin-top: 8px; }
.service-extend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
.service-actions .btn, .service-extend .btn { min-width: 0; padding-left: 6px; padding-right: 6px; font-size: 14px; text-align: center; }
.service-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.service-stat { min-width: 0; padding: 10px; border-radius: 14px; background: var(--c-surface); }
.service-stat small { display: block; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--c-muted); }
.service-stat b { display: block; margin: 2px 0; font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.service-stat i { display: block; font-size: 12px; font-style: normal; line-height: 1.3; color: var(--c-muted); }
.service-month { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.service-month form { flex: 1 1 auto; min-width: 0; margin: 0; }
.service-month a { flex: none; font-size: var(--fs-sub); font-weight: 700; }
@media (max-width: 359px) {
  .service-seg a { font-size: 14px; }
  .service-stat b { font-size: 15px; }
  .service-actions .btn, .service-extend .btn { font-size: 13px; }
}

/* Điện thoại */
@media (max-width: 860px) {
  .console-main { padding: 16px var(--gutter) 32px; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Console: chi tiết xưởng (Hỗ trợ) ---------- */

.btn--small { min-height: 44px; padding: 0 14px; font-size: var(--fs-sub); }
.btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
a.store-row:hover { color: var(--c-ink); box-shadow: 0 0 0 2px var(--c-brand-soft); }
.store-row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.store-row__avatar--l { width: 60px; height: 60px; font-size: 26px; border-radius: 18px; }

.console-store-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.console-store-head__text { flex: 1 1 280px; min-width: 0; }
.console-store-head__text .console-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.console-store-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.console-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist__item { display: flex; align-items: center; gap: 10px; font-size: var(--fs-body); }
.checklist__mark {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--c-brand-soft); color: var(--c-brand-dark);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.checklist__item.is-todo { color: #8A4B08; font-weight: 600; }
.checklist__item.is-todo .checklist__mark { background: var(--c-accent-soft); color: var(--c-ink); }

.account-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--c-line); }
.account-row:first-of-type { border-top: 0; padding-top: 0; }
.account-row__body { flex-grow: 1; min-width: 0; }
.account-row__email { font-size: var(--fs-body); font-weight: 700; overflow-wrap: anywhere; }
.account-row form { margin: 0; flex-shrink: 0; }
.note-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.note-form textarea { min-height: 54px; }
.note-form .btn { flex-shrink: 0; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.note-list__item { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--c-line); font-size: var(--fs-body); }
.note-list__item.is-system { color: var(--c-muted); }
.note-list__when { width: 96px; flex-shrink: 0; font-size: var(--fs-sub); color: var(--c-muted); }
.note-list__text { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .console-cols { grid-template-columns: 1fr; }
  .note-form { flex-direction: column; align-items: stretch; }
  .account-row { flex-wrap: wrap; }
  .note-list__item { flex-direction: column; gap: 2px; }
}

/* Tab Hỗ trợ của xưởng: các khu có màu riêng */
.zone { --zone-bg: var(--c-soft); --zone-mark: var(--c-muted); --zone-ink: var(--c-ink-2); --zone-mark-ink: #FFFFFF; border-left: 7px solid var(--zone-mark); border-radius: 18px; background: var(--zone-bg); overflow: hidden; }
.zone--setup { --zone-bg: var(--c-accent-soft); --zone-mark: var(--c-accent); --zone-ink: #7A4300; --zone-mark-ink: var(--c-ink); }
.zone--setup.is-done { --zone-bg: var(--c-brand-soft); --zone-mark: var(--c-brand); --zone-ink: var(--c-brand-dark); --zone-mark-ink: #FFFFFF; }
.zone--accounts { --zone-bg: #E4EFFD; --zone-mark: #1F63C7; --zone-ink: #17488F; }
.zone--notes { --zone-bg: #EFE8FB; --zone-mark: #6B3FC2; --zone-ink: #4A2A8C; }
.zone__row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.zone__tile { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; background: var(--zone-mark); color: var(--zone-mark-ink); }
.zone__who { flex: 1 1 auto; min-width: 0; }
.zone__title { display: block; font-size: var(--fs-body); font-weight: 800; color: var(--c-ink); }
.zone__sub { display: block; font-size: 14px; font-weight: 600; color: var(--zone-ink); }
.zone__num { flex: none; font-size: 24px; font-weight: 800; color: var(--zone-ink); }
.zone__chev { flex: none; display: flex; color: var(--zone-ink); transition: transform 0.15s; }
.zone.is-open .zone__chev { transform: rotate(180deg); }
.zone__body { display: none; padding: 2px 14px 14px; }
.zone.is-open .zone__body { display: block; }
.zone__panel { padding: 12px; border-radius: 13px; background: var(--c-surface); }
.zone-todo { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 16px; font-weight: 700; color: var(--zone-ink); }
.zone-todo__mark { flex: none; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--zone-mark); color: var(--zone-mark-ink); font-weight: 800; }
.zone-more { margin-top: 4px; font-size: 15px; }
.zone-more summary { display: flex; align-items: center; min-height: 40px; font-weight: 700; color: var(--zone-ink); cursor: pointer; list-style: none; }
.zone-more summary::-webkit-details-marker { display: none; }
.zone-more summary::after { content: '›'; margin-left: 8px; font-size: 18px; }
.zone-more[open] summary::after { transform: rotate(90deg); }
.zone-more__item { padding: 5px 0; overflow-wrap: anywhere; }
.zone-link { display: flex; align-items: center; gap: 10px; min-height: 60px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--c-line-strong); border-radius: 13px; color: inherit; text-decoration: none; }
button.zone-link { width: 100%; background: none; font: inherit; text-align: left; cursor: pointer; }
.zone-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.zone-actions .field__hint { margin: 0; }
.zone-add.zone-add--small { width: auto; min-height: 44px; margin-top: 0; padding: 0 14px; font-size: 16px; }

/* Lịch sử tự động */
.log-days { display: flex; flex-direction: column; gap: 12px; }
.log-day { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--c-line); font-size: 15px; font-weight: 800; color: var(--c-ink); }
.log-day small { font-size: 14px; font-weight: 600; color: var(--c-muted); }
.log-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.log-row { display: flex; align-items: flex-start; gap: 10px; }
.log-row__tile { flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--c-neutral-soft); color: var(--c-muted); }
.log-row__tile svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.log-row__main { flex: 1 1 auto; min-width: 0; }
.log-row__title { display: block; font-size: 16px; font-weight: 700; color: var(--c-ink); overflow-wrap: anywhere; }
.log-row__detail { display: block; font-size: 14px; color: var(--c-ink-2); overflow-wrap: anywhere; }
.log-row__time { flex: none; font-size: 14px; color: var(--c-muted); }
.log-row--quiet .log-row__title { font-weight: 600; color: var(--c-muted); }
.log--account { background: #E4EFFD; color: #1F63C7; }
.log--money { background: var(--c-brand-soft); color: var(--c-brand); }
.log--term { background: var(--c-accent-soft); color: #7A4300; }
.log--lock { background: var(--c-danger-soft); color: var(--c-danger); }
.log--column { background: #EFE8FB; color: #6B3FC2; }
.log-more { align-self: center; font-size: 16px; }
.zone-link__text { flex: 1 1 auto; min-width: 0; }
.zone-link__text b { display: block; font-size: 16px; }
.zone-link__text small { display: block; font-size: 14px; color: var(--c-muted); overflow-wrap: anywhere; }
.zone-add { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 10px; border: 1.5px dashed var(--zone-mark); border-radius: 13px; background: none; color: var(--zone-ink); font: inherit; font-weight: 700; cursor: pointer; list-style: none; }
.zone-add[hidden] { display: none; }
.zone .account-row { display: block; }
.zone .account-row form { margin-top: 8px; }
.zone .note-list__item:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 359px) { .zone__row { gap: 9px; padding: 10px; } .zone__num { font-size: 21px; } }

/* ---------- Console: tạo xưởng ---------- */
.console-form { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.console-form__actions { display: flex; justify-content: flex-end; gap: 10px; }
.trial-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trial-picker .chip { cursor: pointer; font: inherit; font-size: var(--fs-sub); font-weight: 600; }
.trial-picker .input { width: 120px; min-height: 44px; }

/* ---------- Console: tài chính ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.revenue-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 200px; align-items: end; }
.revenue-chart__col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.revenue-chart__bar { width: 100%; max-width: 40px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--c-brand-soft); }
.revenue-chart__bar.is-current { background: var(--c-brand); }
.revenue-chart__value { font-size: 11px; font-weight: 700; color: var(--c-muted); white-space: nowrap; overflow: hidden; max-width: 100%; }
.revenue-chart__month { font-size: 13px; color: var(--c-muted); font-weight: 600; }
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; }
.todo-row__head { display: flex; align-items: center; gap: 14px; flex: 1 1 280px; min-width: 0; }
.todo-row__head a { color: var(--c-ink); }
.todo-row__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chip--radio { cursor: pointer; font-size: var(--fs-sub); font-weight: 600; }
.chip--radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip--radio:focus-within { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.date-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.date-quick .chip { cursor: pointer; font: inherit; font-size: var(--fs-sub); font-weight: 600; }
.price-line { font-size: var(--fs-body); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sub); }
.data-table th { text-align: left; color: var(--c-muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.data-table .num { white-space: nowrap; }
.danger-zone { border: 1px solid var(--c-danger-soft); }
.extend-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 360px; }
.extend-form .input { flex: 1 1 180px; min-height: 44px; }
.extend-form__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.payments-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.payments-filter select.input { width: auto; min-height: 44px; }
.payments-filter input.input { flex: 1 1 200px; min-height: 44px; }
@media (max-width: 860px) {
  .revenue-chart { height: 160px; gap: 3px; }
  .revenue-chart__value { display: none; }
  .stat-grid--wide { grid-template-columns: 1fr; }
}

/* ---------- Console: xem như xưởng ---------- */
.view-as-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px; background: var(--c-ink); color: #FFFFFF; font-size: var(--fs-sub);
}
.view-as-bar form { margin: 0; }
.view-as-bar__exit {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--c-accent); color: var(--c-ink); font: inherit; font-weight: 700; cursor: pointer;
}

/* ---------- Sản phẩm của khách: bật tắt + giá riêng ---------- */
.vis-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: var(--radius-m); background: var(--c-surface);
}
.vis-row[hidden] { display: none; }
.vis-row form { margin: 0; flex-shrink: 0; }
.vis-row__body {
  flex-grow: 1; min-width: 0; min-height: var(--tap);
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.vis-row.is-off .vis-row__body { opacity: 0.5; }
.vis-row__name { font-size: var(--fs-name); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.vis-row__meta { font-size: var(--fs-sub); color: var(--c-muted); }
.price-special { color: var(--c-danger); font-weight: 700; }

.price-sheet { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; justify-content: flex-end; }
.price-sheet[hidden] { display: none; }
.price-sheet__backdrop { flex-grow: 1; border: 0; padding: 0; background: rgba(20, 23, 31, 0.45); cursor: pointer; }
.price-sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: var(--content-max); margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
  padding: 10px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: var(--c-surface); border-radius: 24px 24px 0 0;
}
.price-sheet__grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--c-line); }
.price-sheet__title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.price-sheet__default { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--c-ground); }
.price-sheet__default span { color: var(--c-muted); }
.price-sheet__input { font-size: 20px; font-weight: 700; color: var(--c-danger); }
.price-sheet__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.has-price-sheet { overflow: hidden; }
.price-sheet__backdrop--still { cursor: default; }
.price-sheet__panel--scroll { max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; }
.price-sheet__panel--scroll > * { flex-shrink: 0; }
.price-sheet__panel--scroll .price-sheet__actions .btn { padding-left: 8px; padding-right: 8px; }
.price-sheet__actions .btn[hidden] { display: none; }
.sheet-view { display: flex; flex-direction: column; gap: 14px; }
.sheet-view[hidden] { display: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sheet-head .price-sheet__title { flex: 1 1 auto; min-width: 0; }
.sheet-head .icon-btn { flex: none; }
.sheet-hint { margin: 0; }
.sheet-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--c-accent-soft); font-size: var(--fs-sub); font-weight: 600; }
.sheet-message { font-size: var(--fs-sub); }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 210;
  transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px;
  background: var(--c-ink); color: #FFFFFF; font-size: var(--fs-sub); font-weight: 600; white-space: nowrap;
}
.toast[hidden] { display: none; }

.customer-card__tag--warn { background: var(--c-danger-soft); color: var(--c-danger); }

/* CSV: chỉ trên máy tính */
@media (max-width: 899px) { .desktop-only { display: none !important; } }

/* Trang đặt hàng: món tạm dừng hôm nay (vẫn hiện, mờ, không đặt được) */
.shop-card.is-paused .shop-card__photo, .shop-card.is-paused .shop-card__name,
.shop-card.is-paused .shop-card__tags, .shop-card.is-paused .shop-card__price { opacity: 0.45; }
.shop-card__paused { margin-top: auto; font-size: var(--fs-sub); font-weight: 700; color: var(--c-danger); }

/* Tìm kiếm trong danh sách: thanh dài luôn hiện, kết quả cập nhật khi gõ */
.search { min-height: 48px; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
button.search__clear {
  width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--c-neutral-soft); color: var(--c-ink-2); cursor: pointer;
}
button.search__clear[hidden] { display: none; }
.search-count { margin: -4px 0 0; font-size: var(--fs-sub); color: var(--c-muted); font-weight: 600; }
.list-results { display: contents; }

/* ---------- Đơn hàng: thanh trạng thái trên nền xanh, nút Mới vàng có chuông ---------- */
.status-bar { background: var(--c-brand); border-radius: 18px; padding: 0 0 12px; }
.status-bar__scroll {
  position: relative;
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 12px 2px;
  scrollbar-width: none;
  /* mép phải mờ dần: còn nút phía sau, kéo ngang được */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.status-bar__scroll::-webkit-scrollbar { display: none; }
.status-chip {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.14); color: #FFFFFF;
  font-size: var(--fs-sub); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.status-chip:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.24); }
.status-chip.is-active { background: #FFFFFF; color: var(--c-brand-dark); }
.status-chip__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.22); color: #FFFFFF; font-size: 13px; font-weight: 800;
}
.status-chip__count[hidden] { display: none; }
.status-chip.is-active .status-chip__count { background: var(--c-brand); }
.status-chip--new, .status-chip--new:hover { background: var(--c-accent); color: var(--c-ink); }
.status-chip--new .status-chip__count { background: var(--c-ink); }
.status-chip--new.is-active { background: var(--c-accent); color: var(--c-ink); border-color: #FFFFFF; box-shadow: 0 0 0 2px var(--c-ink); }
.status-chip--new.is-active .status-chip__count { background: var(--c-ink); }
.status-chip__bell {
  position: absolute; top: -14px; right: -9px; width: 28px; height: 28px;
  transform: rotate(-18deg); transform-origin: 50% 10%; pointer-events: none;
}
.status-chip__bell[hidden] { display: none; }
.status-chip__bell svg { display: block; }
.status-chip__bell.is-ringing { animation: bell-ring 0.8s ease-in-out 3; }
@keyframes bell-ring {
  0% { transform: rotate(-18deg); } 15% { transform: rotate(12deg); } 30% { transform: rotate(-26deg); }
  45% { transform: rotate(8deg); } 60% { transform: rotate(-22deg); } 75% { transform: rotate(-12deg); }
  100% { transform: rotate(-18deg); }
}
@media (prefers-reduced-motion: reduce) { .status-chip__bell.is-ringing { animation: none; } }
.empty__icon { display: block; margin: 0 auto 8px; }
.empty__title { font-size: var(--fs-name); font-weight: 700; color: var(--c-ink); }

.chips { position: relative; }
.status-bar__scroll.at-end { -webkit-mask-image: none; mask-image: none; }

/* Khi chạm: nút hơi thu nhỏ thay cho lớp xám mặc định của điện thoại */
.status-chip, .chip { transition: transform 0.12s ease; }
.status-chip:active, .chip:active { transform: scale(0.95); }
@media (prefers-reduced-motion: reduce) { .status-chip:active, .chip:active { transform: none; } }

/* Đầu trang Sản phẩm: "Đang bán hôm nay        4/5 sản phẩm" */
.app-header__title--compact { font-size: 24px; }
.app-header__count { flex-shrink: 0; white-space: nowrap; font-size: var(--fs-body); color: var(--c-muted); font-weight: 600; }
.app-header__count strong { color: var(--c-brand-dark); font-size: 22px; font-weight: 800; }
/* thanh không có chuông (trang Sản phẩm): trên dưới cách đều */
.status-bar--plain .status-bar__scroll { padding-top: 12px; }

/* ==========================================================================
   Thông báo chung của Muadi (static/js/muadi-ui.js)
   - Thành công: dải xanh trượt xuống từ trên cùng
   - Lỗi / cảnh báo / xác nhận: popup ở giữa màn hình
   ========================================================================== */
.btn--danger-solid { background: var(--c-danger); border-color: var(--c-danger); color: #FFFFFF; }
.btn--danger-solid:hover { background: #8F1C13; color: #FFFFFF; }

.mui-backdrop {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px max(16px, env(safe-area-inset-left));
  background: rgba(20, 23, 31, 0.5);
  animation: mui-fade 0.16s ease-out;
}
.mui-backdrop.is-leaving { animation: mui-fade-out 0.14s ease-in forwards; }
.mui-dialog {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 20px 20px; border-radius: 24px;
  background: var(--c-surface); color: var(--c-ink); text-align: center;
  font-family: var(--font);
  box-shadow: 0 20px 60px rgba(20, 23, 31, 0.28);
  animation: mui-pop 0.18s ease-out;
}
.mui-dialog__icon {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.mui-dialog__icon--error { background: var(--c-danger-soft); color: var(--c-danger); }
.mui-dialog__icon--warning { background: var(--c-accent-soft); color: #8A4B08; }
.mui-dialog__icon--info, .mui-dialog__icon--question, .mui-dialog__icon--add { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.mui-dialog__icon--bell { background: var(--c-accent-soft); }
.mui-dialog__icon--bell svg { transform: rotate(-18deg); }
.mui-dialog__title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.3; overflow-wrap: anywhere; }
.mui-dialog__message { margin: 0; font-size: var(--fs-body); color: var(--c-ink-2); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.mui-dialog__message--list { width: 100%; max-height: 50vh; overflow-y: auto; text-align: left; }
.mui-dialog__actions { width: 100%; display: grid; gap: 10px; margin-top: 12px; }
.mui-dialog__actions--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.has-mui-dialog { overflow: hidden; }

.mui-toast {
  position: fixed; z-index: 310;
  top: calc(12px + env(safe-area-inset-top)); left: 16px; right: 16px;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 16px;
  background: var(--c-brand); color: var(--c-accent);
  font-family: var(--font); font-size: var(--fs-body); font-weight: 700; line-height: 1.35;
  box-shadow: 0 12px 32px rgba(11, 122, 83, 0.35);
  transform: translateY(calc(-100% - 24px)); opacity: 0;
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity 0.2s ease;
  cursor: pointer;
}
.mui-toast.is-visible { transform: translateY(0); opacity: 1; }
.mui-toast__icon {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #FFFFFF; color: var(--c-brand);
}
.mui-toast__text { min-width: 0; overflow-wrap: anywhere; }

/* Lỗi của từng ô nhập: viền đỏ + chữ đỏ ngay dưới ô */
.input.is-invalid, .search__input.is-invalid, select.is-invalid, textarea.is-invalid,
.field.has-server-error .input { border-color: var(--c-danger); box-shadow: 0 0 0 3px var(--c-danger-soft); }

@keyframes mui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mui-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes mui-pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mui-backdrop, .mui-dialog { animation: none; }
  .mui-toast { transition: opacity 0.2s ease; transform: none; }
}

/* Cột "chọn từ danh sách" (ví dụ Đơn vị): bấm để chọn, "+ Khác" để thêm cho cả xưởng */
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
  font: inherit; font-size: var(--fs-body); font-weight: 700; cursor: pointer;
  transition: transform 0.12s ease;
}
.choice-chip:active { transform: scale(0.95); }
.choice-chip.is-active { background: var(--c-brand); border-color: var(--c-brand); color: #FFFFFF; }
.choice-chip--add { border-style: dashed; border-color: var(--c-brand); color: var(--c-brand-dark); background: transparent; }
.field-type { display: flex; flex-direction: column; gap: 8px; }
.field-type[hidden], .field-type__choices[hidden] { display: none; }
.field-type__choices { display: flex; flex-direction: column; gap: 6px; }
.mui-dialog__field { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; text-align: left; }
.mui-dialog__input { font-size: 18px; font-weight: 600; min-height: 54px; }

/* ---------- Console: Cột sản phẩm ---------- */
.col-list { background: var(--c-surface); border-radius: var(--radius-l); overflow: hidden; }
.col-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--c-line); }
.col-row:first-child { border-top: 0; }
.col-row__body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.col-list.is-sorting .col-row__body { cursor: default; }
.col-list.is-sorting .col-row__chev { display: none; }
.col-row__title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.col-row__name { font-size: var(--fs-name); font-weight: 700; }
.col-row__options { display: flex; flex-wrap: wrap; gap: 6px; }
.col-row__sort { display: flex; gap: 4px; }
.col-row__sort[hidden] { display: none; }
.col-row__chev { color: #9AA0AA; flex-shrink: 0; }
.col-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: var(--c-ground); color: var(--c-muted); border: 1px solid var(--c-line);
}
.col-badge--fixed { background: var(--c-neutral-soft); color: var(--c-ink-2); border-color: transparent; }
.col-badge--price { background: var(--c-brand-soft); color: var(--c-brand-dark); border-color: transparent; }
.col-option {
  padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--c-ground); color: var(--c-ink-2); border: 1px solid var(--c-line);
}
.col-option.is-default { background: var(--c-brand); border-color: var(--c-brand); color: #FFFFFF; }
.col-add {
  min-height: 56px; border-radius: 16px; border: 2px dashed var(--c-brand); background: transparent;
  color: var(--c-brand-dark); font: inherit; font-size: var(--fs-body); font-weight: 800; cursor: pointer;
}
.col-add[hidden] { display: none; }
.col-sort-toggle { align-self: center; font-size: 16px; }
.segmented {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px;
  border-radius: 14px; background: var(--c-ground); border: 1px solid var(--c-line);
}
.segmented__item input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__item span {
  min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  font-size: var(--fs-sub); font-weight: 700; color: var(--c-muted); cursor: pointer; text-align: center;
}
.segmented__item input:checked + span { background: var(--c-surface); color: var(--c-brand-dark); box-shadow: 0 1px 3px rgba(20, 23, 31, 0.15); }
.segmented__item input:focus-visible + span { outline: 3px solid var(--c-accent); outline-offset: 1px; }
.opt-chip {
  display: inline-flex; align-items: center; border-radius: 999px;
  background: var(--c-surface); border: 1.5px solid var(--c-line); color: var(--c-ink);
}
.opt-chip.is-default { background: var(--c-brand); border-color: var(--c-brand); color: #FFFFFF; }
.opt-chip__label, .opt-chip__remove { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; min-height: 42px; }
.opt-chip__label { padding: 0 4px 0 14px; font-size: var(--fs-body); font-weight: 700; }
.opt-chip__remove { width: 34px; font-size: 15px; opacity: 0.75; }
.price-sheet__actions.is-single { grid-template-columns: 1fr; }
[data-type-box][hidden], [data-choices-box][hidden] { display: none; }
.console-link-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--c-ink); text-decoration: none; }
.console-link-card:hover { color: var(--c-ink); }
.console-link-card__text { font-size: var(--fs-body); font-weight: 600; }

/* ---------- Đơn hàng: đổi trạng thái ngay trên thẻ ---------- */
.order-card { position: relative; }
.order-card__top .order-card__customer { flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }

/* Chọn nhiều đơn ("Chọn tất cả"): đổi trạng thái / hẹn ngày cùng lúc, xem tổng cộng */
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.group-head .group-label { margin-top: 0; }
.select-all {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px;
  border: 1.5px solid var(--c-line-strong); border-radius: 999px; background: var(--c-surface); color: var(--c-ink);
  font: inherit; font-size: var(--fs-sub); font-weight: 700; cursor: pointer;
}
.select-all[aria-pressed="true"] { background: var(--c-brand-soft); border-color: var(--c-brand); color: var(--c-brand-dark); }
.select-all:active, .order-card__check:active { transform: scale(0.95); }
.select-box {
  flex-shrink: 0; width: 24px; height: 24px; padding: 0; border-radius: 7px;
  border: 2px solid #9AA1AD; background: var(--c-surface) center / 16px no-repeat;
}
.select-box[aria-pressed="true"], .select-all[aria-pressed="true"] .select-box {
  border-color: var(--c-brand);
  background-color: var(--c-brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.order-card__check { display: none; position: relative; z-index: 1; width: 26px; height: 26px; margin-top: 1px; cursor: pointer; }
.is-selecting .order-card__check { display: inline-block; }
.is-selecting .order-card.is-picked { border-color: var(--c-brand); }
.pill--button.is-hint { animation: hint-pulse 1.4s ease-out infinite; }
@keyframes hint-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(11, 122, 83, 0.55); transform: scale(1); }
  20%  { transform: scale(1.08); }
  40%  { transform: scale(1); }
  100% { box-shadow: 0 0 0 14px rgba(11, 122, 83, 0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pill--button.is-hint { animation: none; box-shadow: 0 0 0 3px var(--c-brand); }
}
.pill--button {
  position: relative; z-index: 1; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px; padding: 0 12px; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 800;
  transition: transform 0.12s ease;
}
.pill--button:active { transform: scale(0.95); }
/* Popup đổi trạng thái (giữa màn hình). Quy tắc chung: ✕ nổi ở góc phải = đóng, "‹ Quay lại" góc trái = lùi một bước */
.status-pop {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  padding: 28px max(20px, env(safe-area-inset-left));
}
.status-pop[hidden], .status-pop [hidden] { display: none; }
.status-pop__backdrop {
  position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer;
  background: rgba(20, 23, 31, 0.5); animation: mui-fade 0.16s ease-out;
}
.status-pop__panel {
  position: relative; width: 100%; max-width: 420px;
  display: flex; flex-direction: column;
  border-radius: 24px; background: var(--c-surface); color: var(--c-ink);
  box-shadow: 0 20px 60px rgba(20, 23, 31, 0.28); animation: mui-pop 0.18s ease-out;
}
.status-pop__close { position: absolute; top: -14px; right: -10px; z-index: 2; box-shadow: 0 6px 16px rgba(20, 23, 31, 0.22); }
.status-pop__head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 20px 44px 0 20px;
}
.status-pop__title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; color: var(--c-ink); overflow-wrap: anywhere; }
.status-pop__meta:empty { display: none; }
.status-pop__meta { font-size: var(--fs-sub); color: var(--c-muted); overflow-wrap: anywhere; }
.status-pop__body { padding: 16px 20px 20px; max-height: calc(100dvh - 220px); overflow-y: auto; }
.status-pop__step { display: flex; flex-direction: column; gap: 16px; }
/* Nút đóng / quay lại dùng chung: nền trắng, viền xám */
.pop-close, .pop-back {
  flex-shrink: 0; height: 44px; border: 1.5px solid var(--c-line-strong); border-radius: 999px;
  background: var(--c-surface); color: var(--c-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  font: inherit; font-size: var(--fs-sub); font-weight: 700;
}
.pop-close { width: 44px; }
.pop-back { height: 40px; padding: 0 16px 0 10px; }
.pop-close:active, .pop-back:active { transform: scale(0.95); }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.status-option {
  min-height: 58px; border-radius: 16px; border: 0; background: var(--c-soft);
  font: inherit; font-size: 17px; font-weight: 800; color: var(--c-ink); cursor: pointer;
}
.status-option.is-active { background: var(--c-brand); color: #FFFFFF; box-shadow: 0 6px 16px rgba(11, 122, 83, 0.28); }
.status-option.is-active::before { content: "✓ "; }
.status-option:active { transform: scale(0.97); }
.status-pop__rule { height: 1px; background: #EEF0F3; }
.status-pop__row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.status-pop__row--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-pop__date, .status-pop__cancel {
  min-height: 52px; padding: 0 10px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.status-pop__date { border: 0; background: var(--c-soft); color: var(--c-ink); }
.status-pop__date.has-date { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.status-pop__cancel { border: 1.5px solid #F4C7C3; background: var(--c-surface); color: var(--c-danger); }
.status-pop__cancel.is-active { background: var(--c-danger-soft); }
.status-pop__date:disabled, .status-pop__cancel:disabled { cursor: default; opacity: 0.6; }
.status-pop__cancel.is-active:disabled { opacity: 1; }
.status-pop__quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.status-pop__other { display: flex; flex-direction: column; gap: 8px; }
.status-pop__label { font-size: var(--fs-sub); font-weight: 700; color: var(--c-muted); }
.status-pop__days {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 12px; scrollbar-width: none;
  padding: 12px; border-radius: 18px; background: var(--c-brand);
}
.status-pop__days::-webkit-scrollbar { display: none; }
.status-pop__clear {
  align-self: center; border: 0; background: transparent; padding: 6px; cursor: pointer;
  font: inherit; font-size: var(--fs-sub); font-weight: 700; color: var(--c-muted); text-decoration: underline;
}
.status-pop__row.is-single { grid-template-columns: 1fr; }
.status-pop__sum {
  min-height: 52px; border: 0; border-radius: 14px; background: var(--c-accent); color: var(--c-ink);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
}
.status-pop__sum:active { transform: scale(0.98); }
.sum-table { display: flex; flex-direction: column; border: 1.5px solid var(--c-line); border-radius: 16px; overflow: hidden; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 13px 16px; }
.sum-row:nth-child(even) { background: #F8F9FA; }
.sum-row__name { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.sum-row__qty { white-space: nowrap; font-size: var(--fs-sub); color: var(--c-muted); }
.sum-row__qty strong { font-size: 22px; font-weight: 800; color: var(--c-brand-dark); }
.sum-foot { margin: 0; text-align: center; font-size: 14px; color: var(--c-muted); }
.date-chip {
  min-height: 56px; border-radius: 14px; border: 0; background: var(--c-soft);
  font: inherit; font-size: 16px; font-weight: 700; color: var(--c-ink); cursor: pointer;
}
.date-chip.is-active { background: var(--c-brand); color: #FFFFFF; box-shadow: 0 6px 16px rgba(11, 122, 83, 0.28); }
.date-chip:active { transform: scale(0.97); }
.date-quick { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; line-height: 1.2; }
.date-quick__num { font-size: 20px; font-weight: 800; line-height: 1; color: var(--c-brand); }
.date-chip.is-active .date-quick__num { color: #FFFFFF; }
.date-day { flex-shrink: 0; scroll-snap-align: start; width: 60px; min-height: 0; padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.date-day__weekday { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.date-chip.date-day { background: var(--c-surface); color: var(--c-ink); }
/* ô đang chọn trên nền xanh: vàng thương hiệu, viền trắng */
.date-chip.date-day.is-active { background: var(--c-accent); color: var(--c-ink); box-shadow: 0 0 0 3px #FFFFFF; }
.date-chip.date-day.is-active .date-day__weekday { color: var(--c-ink); }
/* T7, CN: ngày đặc biệt, chữ đỏ đậm */
.date-day.is-weekend, .date-chip.date-day.is-weekend.is-active, .date-chip.date-day.is-weekend .date-day__weekday { color: var(--c-red); }
.date-day__num { font-size: 21px; font-weight: 800; line-height: 1.1; }

/* ---------- Cài đặt · lựa chọn dạng radio ---------- */
.choice-list { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.choice-list legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; }
.choice-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; cursor: pointer; }
.choice-row + .choice-row { border-top: 1px solid var(--c-line); }
.choice-row input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--c-brand); flex-shrink: 0; }
.choice-row__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.choice-row__title { font-size: var(--fs-body); font-weight: 700; }

/* ---------- Thẻ đơn · khách muốn giao cùng đơn đã nhận: dải cam, có chuyển động để biết là bấm được ---------- */
.order-card__twins {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 8px; width: auto; border: 0; font-family: inherit; text-align: left; cursor: pointer;
  margin: -16px -16px 2px; padding: 10px 16px;
  border-radius: calc(var(--radius-l) - 2px) calc(var(--radius-l) - 2px) 0 0;
  background: #F5891F; color: #FFFFFF; font-size: 15px; font-weight: 800;
}
.order-card__twins span { flex: 1; min-width: 0; }
.order-card__twins svg { flex-shrink: 0; }
.order-card__twins::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: band-sheen 2.8s ease-in-out infinite;
}
.order-card__twins svg:last-child { animation: band-nudge 1.4s ease-in-out infinite; }
@keyframes band-sheen { 0% { left: -40%; } 55%, 100% { left: 110%; } }
@keyframes band-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .order-card__twins svg:last-child { animation: none; }
  .order-card__twins::after { display: none; }
}
/* "Cần xem trước": dòng giải thích chỉ hiện khi đang Chọn tất cả */
.group-note { display: none; margin: -2px 0 0; font-size: var(--fs-sub); font-weight: 600; color: var(--c-red); }
.is-selecting .group-note { display: block; }
/* đơn gộp: nhãn + vạch "Đặt lúc …" / "Đặt thêm lúc …" */
.merge-tag {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; margin-top: -2px; padding: 0 10px; border-radius: 999px;
  background: var(--c-soft); color: var(--c-ink-2); font-size: 13px; font-weight: 800;
}
.order-card__added { display: flex; align-items: center; gap: 10px; margin: 4px 0 -2px; font-size: 14px; font-weight: 800; color: var(--c-brand-dark); }
.order-card__added::before, .order-card__added::after { content: ""; flex: 1; border-top: 1.5px dashed #9FC7B6; }
/* popup: khách muốn giao cùng, các nút gộp / tách */
.status-ask { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: #FFF4E5; color: #8A4B08; font-size: 15px; }
.status-ask strong { font-size: 16px; }
.status-option.is-merge { background: #FFF1DF; color: #8A4B08; box-shadow: inset 0 0 0 2px #F5891F; }
.status-pop__hint { margin: -6px 0 0; font-size: 14px; color: var(--c-muted); text-align: center; }
.status-pop__merges { display: flex; flex-direction: column; gap: 10px; }
.status-pop__merges[hidden] { display: none; }
.status-pop__merge { flex-direction: column; gap: 2px; padding: 10px; }
.status-pop__merge small { font-size: 14px; font-weight: 500; color: var(--c-muted); overflow-wrap: anywhere; }
/* trang đặt hàng của khách: hôm nay đã đặt đơn (giao cùng / giao riêng), đơn giống hệt */
/* Popup đang mở: nền phía sau đứng yên */
html.is-popup-open, html.is-popup-open body { overflow: hidden; overscroll-behavior: none; }

/* Popup xác nhận đơn: nằm giữa màn hình, tổng tiền và 2 nút luôn hiện */
/* Đơn dài: cao tối đa khoảng 3/4 màn hình, phần còn lại lướt bên trong. Máy thấp vẫn giữ tối thiểu 460px */
.sheet--confirm { padding: 0; overflow: hidden; max-height: min(calc(100dvh - 56px), max(76dvh, 460px)); bottom: 48px; }  /* bottom: đẩy popup lên trên giữa màn hình 24px */
.sheet--confirm[open] { gap: 0; }
.sheet--confirm .sheet__title { flex-shrink: 0; padding: 14px 16px; font-size: 20px; background: var(--c-brand-soft); color: var(--c-brand-dark); border-bottom: 1px solid var(--c-line); }
/* Đang gõ ghi chú (có bàn phím): bám mép trên phần màn hình còn thấy, chỉ để ô ghi chú và 2 nút */
.sheet--confirm.has-keyboard { bottom: auto; margin: 0 auto; }
.has-keyboard .sheet__title, .has-keyboard #confirm-ship, .has-keyboard #confirm-same,
.has-keyboard .confirm-lines, .has-keyboard .confirm-total { display: none; }
.has-keyboard .confirm-body { padding-top: 12px; }
.has-keyboard #remarks { min-height: 72px; }
.confirm-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.confirm-body > div:empty { display: none; }
.ship-box { flex-shrink: 0; padding: 10px 12px 12px; border-radius: 14px; background: var(--c-accent-soft); }
.ship-box__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.ship-box__question { padding: 0; margin-bottom: 10px; font-size: var(--fs-body); font-weight: 800; line-height: 1.3; }
.ship-box__options { display: flex; gap: 8px; }
.ship-option { flex: 1 1 0; min-width: 0; cursor: pointer; }
.ship-option span {
  display: flex; align-items: center; justify-content: center; height: 100%;
  min-height: 52px; padding: 6px 8px;
  border: 1.5px solid var(--c-line); border-radius: 12px; background: #FFFFFF;
  font-size: var(--fs-sub); font-weight: 700; line-height: 1.25; text-align: center;
}
.ship-option input:checked + span { border-color: var(--c-brand); background: var(--c-brand); color: #FFFFFF; }
.ship-option input:focus-visible + span { outline: 3px solid var(--c-brand-dark); outline-offset: 2px; }
.ship-box .prev-box__error { margin-top: 8px; }
.confirm-lines { list-style: none; margin: 0; padding: 0; }
.confirm-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--c-line); }
.confirm-line:first-child { border-top: 0; padding-top: 0; }
.confirm-line__text { flex: 1; min-width: 0; }
.confirm-line__name { font-size: var(--fs-body); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.confirm-line__money { margin-top: 2px; font-size: var(--fs-sub); font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.confirm-step { flex-shrink: 0; display: flex; align-items: center; }
.confirm-step .stepper__btn:disabled { opacity: 0.4; }
.confirm-step__trash { color: var(--c-danger); display: flex; align-items: center; justify-content: center; }
.confirm-step__qty { width: 44px; text-align: center; font-size: 22px; font-weight: 800; }
.confirm-removed { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--c-line); font-size: var(--fs-sub); color: var(--c-muted); }
.confirm-removed:first-child { border-top: 0; }
.confirm-removed span { min-width: 0; overflow-wrap: anywhere; }
.confirm-undo { flex-shrink: 0; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--c-brand-dark); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.confirm-note-add { align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--c-brand-dark); font: inherit; font-size: var(--fs-sub); font-weight: 700; cursor: pointer; }
.confirm-note-add[hidden], #note-field[hidden] { display: none; }
.confirm-foot { flex-shrink: 0; padding: 10px 16px 14px; border-top: 1px solid var(--c-line); background: var(--c-surface); }
.confirm-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; margin-bottom: 10px; }
.confirm-total__count { font-size: var(--fs-sub); font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.confirm-total__money { margin-left: auto; font-size: 20px; font-weight: 800; white-space: nowrap; }
.sheet--confirm .sheet__actions { position: static; margin: 0; padding: 0; border: 0; background: none; }
.sheet--confirm .sheet__actions .btn { min-width: 0; }

.prev-box { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--c-accent-soft); }
.prev-box__head { font-size: var(--fs-body); font-weight: 800; }
.prev-box__items { font-size: 15px; color: var(--c-ink-2); overflow-wrap: anywhere; }
.prev-box .choice-list { margin-top: 4px; border: 0; padding: 0; }
.prev-box .choice-row + .choice-row { border-top-color: rgba(20, 23, 31, 0.12); }
.prev-box__error { scroll-margin-bottom: 96px; margin: 0; font-size: var(--fs-sub); font-weight: 700; color: var(--c-danger); }
.prev-box__error[hidden] { display: none; }
.prev-box--same { background: var(--c-danger-soft); }
.prev-box--same .prev-box__head { color: var(--c-danger); }
.prev-box__hint { margin: 0; font-size: 15px; color: var(--c-ink-2); }

/* ---- Console Hệ thống: Bây giờ / Đã qua / Rủi ro ---- */
.sys-h2 { margin: 18px 0 8px; font-size: 19px; font-weight: 800; scroll-margin-top: 64px; }
.sys-h2 small { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--c-muted); }
.sys-tiles { margin-bottom: 6px; }
.sys-tile { gap: 2px; cursor: pointer; }
.sys-tile__value { font-size: 21px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sys-tile__value small { font-size: 14px; font-weight: 700; color: var(--c-muted); }
.sys-tile__meter { height: 6px; margin: 3px 0 2px; }
.ac-meter.is-bad i { background: #B42318; }
.sys-lbl { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 1px 8px; border-radius: 99px; font-size: 13px; font-weight: 800; }
.sys-lbl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sys-lbl--ok { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.sys-lbl--mid { background: var(--c-accent-soft); color: #7A4300; }
.sys-lbl--bad { background: #FDECEA; color: #B42318; }
.sys-panel { margin-bottom: 10px; }
.sys-grp { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.sys-grp--c { background: #E4EFFD; color: #17488F; }
.sys-grp--s { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.sys-grp--a { background: #EFE8FB; color: #4A2A8C; }
.sys-split { display: flex; gap: 2px; height: 12px; margin: 4px 0; border-radius: 6px; overflow: hidden; background: var(--c-soft); }
.sys-split i { display: block; min-width: 2px; }
.sys-split--c { background: #1F63C7; }
.sys-split--s { background: var(--c-brand); }
.sys-split--a { background: #6B3FC2; }
.sys-chart { position: relative; height: 120px; }
.ov-hours button.is-over i { background: #B42318; }
.sys-line { position: absolute; left: 0; right: 0; border-top: 2px dashed #B42318; pointer-events: none; }
.sys-line span { position: absolute; right: 0; top: -20px; padding: 0 4px; background: var(--c-surface); color: #B42318; font-size: 12px; font-weight: 700; }
.sys-val { text-align: right; }
.sys-val small { display: block; font-size: 12px; font-weight: 600; color: var(--c-muted); }
.sys-rank { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c-soft); font-size: 13px; font-weight: 800; }
.sys-risk-group { margin: 10px 0 2px; font-size: 13px; font-weight: 800; color: var(--c-muted); }
.sys-risk { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--c-line); }
.sys-risk-group + .sys-risk { border-top: 0; padding-top: 4px; }
.sys-risk b { font-weight: 700; }
.sys-risk p { grid-column: 2; margin: 0; font-size: 14px; color: var(--c-ink-2); }
.sys-state { grid-row: span 2; align-self: start; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.sys-state--do { background: #FDECEA; color: #B42318; }
.sys-state--watch { background: var(--c-accent-soft); color: #7A4300; }
.sys-state--ok { background: var(--c-brand-soft); color: var(--c-brand-dark); }
.ac-chart[hidden], [data-heat-grid][hidden] { display: none; }

/* ===== Console: đầu trang 1 dòng + nút Menu nổi ở dưới ===== */
.shop-header.console-bar { padding-top: 0; padding-bottom: 0; gap: 0; }
.console-bar__top { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.console-bar__brand { display: flex; flex: none; }
.console-bar__brand .brand__mark { width: 32px; height: 32px; }
.console-bar__title { flex: 1; min-width: 0; font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.console-bar .shop-search { margin-bottom: 10px; }
.console .console-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.console-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px 0 16px;
  border: 0; border-radius: 28px; background: #0A3D2E; color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(10, 61, 46, 0.35);
}
.console-fab:focus-visible, .console-menu__item:focus-visible, .console-menu__x:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.console-menu__panel { gap: 4px; padding-left: 12px; padding-right: 12px; }
.console-menu__head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.console-menu__head .brand__mark { width: 30px; height: 30px; }
.console-menu__head b { font-size: 18px; font-weight: 800; }
.console-menu__x { margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--c-soft); color: var(--c-ink); font-size: 22px; cursor: pointer; }
.console-menu__nav { display: flex; flex-direction: column; gap: 4px; }
.console-menu__item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 14px;
  border: 0; border-radius: 12px; background: none; color: var(--c-ink);
  font: inherit; font-size: 17px; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer;
}
.console-menu__item:hover { background: var(--c-soft); color: var(--c-ink); }
.console-menu__item.is-active { background: var(--c-brand-soft); color: var(--c-brand-dark); font-weight: 800; }
.console-menu__out { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--c-line); }
.console-menu__out .console-menu__item { color: var(--c-ink-2); }
.console-bar__find {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -6px;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.12); color: #FFFFFF; cursor: pointer;
}
.console-bar__find:focus-visible, .console-find__cancel:focus-visible, .console-find__item:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.console-find { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; }
.console-find[hidden] { display: none; }
.console-find__panel {
  width: 100%; max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 14px; background: var(--c-surface); border-radius: 0 0 20px 20px;
  animation: console-find-in .16s ease-out;
}
@keyframes console-find-in { from { transform: translateY(-30%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .console-find__panel { animation: none; } }
.console-find__row { display: flex; align-items: center; gap: 6px; margin: 0; }
.console-find__row .search { flex: 1; min-width: 0; margin: 0; border-color: var(--c-brand); }
.console-find__cancel { flex: none; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--c-brand-dark); font: inherit; font-weight: 700; cursor: pointer; }
.console-find__label { font-size: var(--fs-nav); font-weight: 700; color: var(--c-muted); padding: 0 4px; }
.console-find__item { display: block; width: 100%; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--c-ink); font: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-find__backdrop { flex: 1; border: 0; padding: 0; background: rgba(20, 23, 31, 0.45); cursor: pointer; }
.service-bar .search[hidden] { display: none; }
.console-found { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.console-found .section-title { min-width: 0; overflow-wrap: anywhere; }
.console-found .search__clear { flex: none; min-height: 44px; display: inline-flex; align-items: center; color: var(--c-brand-dark); }

/* ===== Khung xương lấp lánh: chỗ giữ của danh sách / popup trong lúc tải ===== */
.mu-skel { display: flex; flex-direction: column; gap: 10px; }
.mu-skel__row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line); }
.mu-skel__lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.mu-skel__b {
  display: block; height: 12px; border-radius: 8px;
  background: linear-gradient(90deg, var(--c-soft) 0%, #E9ECEF 40%, var(--c-brand-soft) 50%, #E9ECEF 60%, var(--c-soft) 100%);
  background-size: 300% 100%; animation: mu-shine 1.4s ease-in-out infinite;
}
.mu-skel__b--title { height: 14px; width: 45%; }
.mu-skel__b--sub { width: 70%; }
.mu-skel__b--pill { width: 56px; height: 22px; border-radius: 11px; flex: none; }
.mu-skel__row:nth-child(2) .mu-skel__b--title { width: 60%; }
.mu-skel__row:nth-child(3) .mu-skel__b--title { width: 35%; }
@keyframes mu-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .mu-skel__b { animation: none; background: var(--c-soft); } }
