/* =========================================================
   dine.web - y tuong thi giac: thanh treo phieu trong bep nha hang.
   Tuong bep (xanh gach men) -> thanh inox -> phieu in nhiet.
   Cho "dam" duy nhat la thanh phieu; phan con lai giu yen tinh.
   ========================================================= */

:root {
  /* Mau nen */
  --wall: #1f3b39;        /* tuong gach men bep */
  --wall-deep: #17302e;
  --steel: #b4bcc0;       /* thanh treo inox */
  --steel-dark: #6f787d;
  --paper: #fbfbf8;       /* giay in nhiet */
  --page: #eef1f0;        /* nen phan noi dung ben duoi */
  --ink: #1c2022;
  --muted: #59646a;
  --on-wall: #e6eeec;
  --on-wall-muted: #a9bdb9;

  /* Mau trang thai - giong muc dau tren phieu */
  --ok: #2b7a4b;
  --fail: #c0362c;
  --pending: #b07a10;
  --undo: #2f5da8;

  /* Chu */
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-receipt: "Roboto Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Thang chu (ty le ~1.25) */
  --t-sm: 0.8125rem;
  --t-base: 1rem;
  --t-md: 1.25rem;
  --t-lg: 1.75rem;
  --t-xl: clamp(2.5rem, 6vw, 4.5rem);

  /* Le 2 ben. Man hinh rong hon --page-max: le tu no ra de noi dung (va
     header/footer) nam GIUA, nen mau van trai het chieu ngang. */
  --page-max: 90rem;
  --gutter-base: clamp(1rem, 4vw, 3rem);
  --gutter: max(var(--gutter-base), calc((100vw - var(--page-max)) / 2));
  /* GOTCHA: --gutter co the rat lon. Khoi nao vua padding --gutter vua co
     max-width thi max-width PHAI cong them 2 * --gutter, neu khong noi dung
     bi ep con vai chu moi dong (box-sizing: border-box). */
  --measure: 62ch;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}

h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid #f2c14e;
  outline-offset: 3px;
}

[v-cloak] { visibility: hidden; }

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

.skip {
  position: absolute;
  left: var(--gutter-base);
  top: -3rem;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* ---------------- Dau trang ---------------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: var(--wall-deep);
  color: var(--on-wall);
  /* dinh tren cung khi cuon: nut "Dat ban" luon trong tam tay o moi trang */
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--on-wall);
}
/* logo: phieu in nhiet treo tren thanh inox (img/logo-mark.svg) */
.brand-mark { display: block; width: 36px; height: 35px; flex: none; }
/* Chu "dine." chu dung hep (cung font tieu de) + dau cham vang (mau nut Dat
   ban); dong nho ben duoi kieu chu in tren phieu bep */
.brand-text { display: flex; flex-direction: column; gap: 0.18rem; }
.brand-word {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.85rem;
  line-height: 0.8;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}
.brand-dot { color: #f2c14e; }
.brand-tag {
  font-family: var(--f-receipt);
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-wall-muted);
  white-space: nowrap;
}
.brand:hover .brand-mark { transform: rotate(-4deg); transform-origin: 50% 8%; }
@media (prefers-reduced-motion: no-preference) {
  .brand-mark { transition: transform 0.2s ease; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  font-size: var(--t-sm);
}
.site-nav a:not(.btn) { text-decoration: none; color: var(--on-wall-muted); white-space: nowrap; }
.site-nav a:not(.btn):hover { color: var(--on-wall); }
.site-nav a[aria-current="page"] {
  color: var(--on-wall);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------------- Nut ---------------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: #33393c; }
.btn-ghost {
  background: transparent;
  color: var(--on-wall);
  border: 1px solid rgba(230, 238, 236, 0.35);
  padding: 0.45rem 0.8rem;
}
.btn-ghost:hover { background: rgba(230, 238, 236, 0.08); }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.soon { font-weight: 400; }
button.btn { font: inherit; font-weight: 600; cursor: pointer; }
button.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: var(--t-sm); }
/* Nut dat ban o header: mau giay vang (cung ho mau phieu dang chon) de
   noi bat tren nen tuong toi, khac nut dang nhap (vien mo) */
.btn-book {
  padding: 0.45rem 0.95rem;
  background: #f2c14e;
  color: var(--ink);
  font-size: var(--t-sm);
  white-space: nowrap;
}
.btn-book:hover { background: #f6d27a; }

/* Nut doi ngon ngu (js/lang.js chen vao header, ngay truoc nut Dat ban):
   chu ngan "EN"/"VI", vien mo giong nut dang nhap nhung nho hon */
.lang-btn {
  display: inline-block;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(230, 238, 236, 0.35);
  border-radius: 6px;
  color: var(--on-wall);
  font-family: var(--f-receipt);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.lang-btn:hover { background: rgba(230, 238, 236, 0.08); }

/* ---------------- O dang nhap (site.js dien vao) ---------------- */
.auth-slot {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  font-size: var(--t-sm);
}
/* dang cho /auth/me: giu cho, khong nhay "Dang nhap" -> ten */
.auth-slot.is-pending { visibility: hidden; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--on-wall);
}
.user-name {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  background: var(--wall);
}
.avatar-initial {
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  color: var(--on-wall);
  border: 1px solid rgba(230, 238, 236, 0.35);
}

/* Thong bao dang nhap loi (?login=failed) */
.notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--gutter);
  font-size: var(--t-sm);
}
.notice p { margin: 0; }
.notice-fail { background: #f6e1df; color: #7a1f18; border-bottom: 1px solid #e3b9b4; }
.notice-close {
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

/* ---------------- Hero: tuong bep ---------------- */
.hero {
  background-color: var(--wall);
  /* anh den roi tu tren xuong, khong co duong ke */
  background-image: radial-gradient(
    ellipse 90% 70% at 30% 0%,
    rgba(255, 255, 255, 0.07),
    transparent 70%
  );
  color: var(--on-wall);
  padding: clamp(2.5rem, 7vw, 5rem) 0 3rem;
}

.hero-text {
  padding: 0 var(--gutter);
  max-width: calc(var(--measure) + 2 * var(--gutter));
}

.hero h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: var(--t-xl);
  line-height: 1.02;
  letter-spacing: 0.005em;
  max-width: 16ch;
}

.lead {
  margin-top: 1.25rem;
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--on-wall-muted);
  max-width: var(--measure);
}

/* ---------------- Thanh treo phieu ---------------- */
.live { margin-top: clamp(2rem, 5vw, 3.5rem); }

.rail {
  position: relative;
  min-height: 17rem;
}

/* thanh inox */
.rail::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 14px;
  background: linear-gradient(180deg, #dfe4e6 0%, var(--steel) 45%, var(--steel-dark) 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.rail-tickets {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  overflow-x: auto;
  padding: 6px var(--gutter-base) 2rem;
  /* Khong snap, khong scroll anchoring: phieu moi chen vao ben trai
     thi trinh duyet KHONG duoc tu cuon theo phieu cu, neu khong
     phieu moi nhat se bi day ra ngoai man hinh. */
  overflow-anchor: none;
}

.rail-nav { display: flex; align-items: center; gap: 0.4rem; }
.rail-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(230, 238, 236, 0.35);
  background: transparent;
  color: var(--on-wall);
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.rail-btn:hover { background: rgba(230, 238, 236, 0.1); }
.rail-mine {
  margin-left: 0.6rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #f2c14e;
  background: transparent;
  color: #f2c14e;
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
}
.rail-mine[aria-pressed="true"] { background: #f2c14e; color: var(--ink); }
.rail-count { margin-left: 0.3rem; font-size: var(--t-sm); color: var(--on-wall-muted); }

.rail-empty {
  position: absolute;
  top: 3rem;
  left: var(--gutter-base);
  color: var(--on-wall-muted);
}

/* ---------------- Phieu ---------------- */
.ticket {
  position: relative;
  flex: 0 0 13.5rem;
  margin-top: 4px;
  padding: 1.1rem 0.95rem 3.4rem; /* chua cho con dau o day phieu */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-receipt);
  font-size: var(--t-sm);
  line-height: 1.45;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  transform-origin: top center;
  transition: transform 160ms ease;
}

/* kep giu phieu tren thanh */
.ticket::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 34px;
  height: 14px;
  margin-left: -17px;
  background: var(--steel-dark);
  border-radius: 0 0 3px 3px;
}

/* mep xe rang cua o day phieu */
.ticket::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -7px;
  height: 8px;
  background:
    linear-gradient(135deg, var(--paper) 4px, transparent 0) 0 0 / 8px 8px repeat-x,
    linear-gradient(-135deg, var(--paper) 4px, transparent 0) 0 0 / 8px 8px repeat-x;
}

/* Chi hover tren thiet bi co chuot - man cam ung se bi "dinh" hover sau khi cham */
@media (hover: hover) {
  .ticket:hover { transform: translateY(2px); }
}
.ticket.is-selected { transform: translateY(6px); box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35), 0 0 0 3px #f2c14e; }

.ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}
.ticket-no { font-size: var(--t-md); }
.ticket-time { color: var(--muted); }

.ticket-meta {
  margin-top: 0.15rem;
  color: var(--muted);
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed #b9bfc2;
}

.ticket-party { color: var(--ink); font-weight: 600; }
.ticket-mine { color: #8a5d06; font-weight: 700; }
.ticket.is-mine:not(.is-selected) { box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28), inset 0 4px 0 #f2c14e; }

.ticket-steps {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #b9bfc2;
}

.step {
  display: flex;
  justify-content: space-between;
  padding: 0.12rem 0;
}
.step-mark { font-weight: 700; min-width: 1.2em; text-align: right; }
.step-pending .step-mark { color: var(--pending); }
.step-succeeded .step-mark { color: var(--ok); }
.step-failed .step-mark { color: var(--fail); }
.step-failed .step-name { color: var(--fail); }
.step-compensating .step-mark,
.step-compensated .step-mark { color: var(--undo); }
.step-compensated .step-name { text-decoration: line-through; text-decoration-color: var(--undo); }

.ticket-last {
  margin-top: 0.6rem;
  min-height: 2.9em;
  color: var(--muted);
}

/* ---------------- Con dau ---------------- */
.stamp {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  padding: 0.1rem 0.5rem;
  border: 3px solid currentColor;
  border-radius: 4px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.1;
  transform: rotate(-9deg);
  opacity: 0.85;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: stamp-in 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.stamp-ok { color: var(--ok); }
.stamp-void { color: var(--fail); }
/* don da xac nhan theo gio: dang ngoi / da roi ban */
.stamp-eat { color: var(--undo); }
.stamp-done { color: var(--steel-dark); }
/* toi gio hen nhung chua biet gio roi ban: vang, khac han xanh "Đã xác nhận" */
.stamp-arrived { color: var(--pending); }
.ticket.is-done { opacity: 0.82; }

@keyframes stamp-in {
  from { transform: rotate(-9deg) scale(1.7); opacity: 0; }
  60% { opacity: 0.85; }
  to { transform: rotate(-9deg) scale(1); opacity: 0.85; }
}

/* Phieu moi treo vao tu ben trai, cac phieu cu truot sang */
.ticket-enter-from { opacity: 0; transform: translateY(-14px) rotate(-2deg); }
.ticket-enter-active { transition: opacity 300ms ease, transform 300ms ease; }
.ticket-leave-active { display: none; }
.ticket-move { transition: transform 300ms ease; }

/* ---------------- Chu thich + dong thoi gian ---------------- */
.live-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 0 var(--gutter);
  font-size: var(--t-sm);
  color: var(--on-wall-muted);
}

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.m { font-family: var(--f-receipt); font-weight: 700; color: var(--on-wall); }
.m-ok { color: #7fd1a1; }
.m-fail { color: #f08a80; }
.m-undo { color: #9cb9ef; }

.timeline {
  margin: 1.75rem var(--gutter) 0;
  padding: 1.25rem 1.4rem;
  background: var(--wall-deep);
  border-left: 4px solid var(--steel);
}
/* Trang chu: don dang chon trai het be ngang, 2 cot (don | dien bien) */
.od-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0 3rem;
  align-items: start;
}
.od-log .od-sub { margin-top: 0.9rem; }
@media (max-width: 900px) {
  .od-grid { grid-template-columns: minmax(0, 1fr); }
  .od-log .od-sub { margin-top: 1.1rem; }
}
.timeline h2 { font-size: var(--t-md); font-weight: 600; }
.timeline-note { margin-top: 0.35rem; font-size: var(--t-sm); color: var(--on-wall-muted); }

.timeline-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  font-size: var(--t-sm);
}
.timeline-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  padding: 0.3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.ev-at { font-family: var(--f-receipt); color: var(--on-wall-muted); }
.ev-step_failed .ev-text,
.ev-saga_failed .ev-text { color: #f08a80; }
.ev-late_success .ev-text { color: #f2c14e; }
.ev-compensation_started .ev-text,
.ev-step_compensated .ev-text,
.ev-compensation_done .ev-text { color: #9cb9ef; }
.ev-saga_completed .ev-text { color: #7fd1a1; }

/* Khung chi tiet don o trang chu (nen tuong toi) */
.od-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin: 0.9rem 0 0;
  font-size: var(--t-sm);
}
.od-facts dt { color: var(--on-wall-muted); font-size: 0.75rem; }
.od-facts dd { margin: 0; font-weight: 600; }
.od-facts .od-mine { color: #f2c14e; }

/* nhan trang thai canh tieu de don (khung chi tiet trang chu) */
.od-state {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: var(--f-body);
  font-size: 0.8125rem;
  font-weight: 600;
  vertical-align: middle;
  color: var(--on-wall-muted);
}
.od-state-upcoming { color: #7fd19c; }
.od-state-arrived { color: #f2c14e; }
.od-state-eating { color: #8fb4f0; }
.od-state-done { color: var(--on-wall-muted); }
.od-state-started { color: #f2c14e; }
.od-state-compensating { color: #8fb4f0; }
.od-state-failed { color: #f08a80; }
.od-items {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0.5rem 0;
  font-family: var(--f-receipt);
  font-size: var(--t-sm);
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}
.od-items li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 0.4rem; padding: 0.1rem 0; }
.od-items .oi-qty { color: var(--on-wall-muted); }
.od-total { display: flex; justify-content: space-between; padding: 0.45rem 0 0; font-size: var(--t-sm); font-weight: 700; }
.od-total b { font-size: var(--t-md); }
/* Loi moi dau khung don (chua dang nhap / chua co don) */
.od-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0.8rem 0 0.2rem;
  padding: 0.7rem 0.9rem;
  border: 1px dashed rgba(242, 193, 78, 0.6);
  border-radius: 6px;
  font-size: var(--t-sm);
  color: var(--on-wall);
}
.od-invite p { flex: 1 1 18rem; }

/* Huy dat ban (khung chi tiet don) */
.od-cancel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-top: 0.9rem;
  font-size: var(--t-sm);
  color: var(--on-wall-muted);
}
.od-cancel.is-error { color: #f08a80; }
.od-cancel.is-sent { color: #9cb9ef; }
.btn-cancel {
  padding: 0.4rem 0.9rem;
  border: 1px solid #f08a80;
  border-radius: 6px;
  background: transparent;
  color: #f08a80;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-cancel:hover { background: rgba(240, 138, 128, 0.12); }
.btn-cancel:disabled { opacity: 0.6; cursor: wait; }
.od-sub { margin-top: 1.1rem; font-size: var(--t-sm); font-weight: 600; color: var(--on-wall-muted); }
.od-sub + .timeline-list { margin-top: 0.4rem; }

/* ---------------- Cac phan noi dung ---------------- */
.band { padding: clamp(3rem, 7vw, 5rem) var(--gutter); }
.band > h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
}
.band-alt { background: #e3e8e6; }

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 2.5rem;
  margin-top: 2rem;
}
.point { padding-left: 1rem; border-left: 3px solid var(--steel-dark); }
.point h3 { font-size: var(--t-base); font-weight: 600; }
.point p { margin-top: 0.4rem; color: var(--muted); max-width: 40ch; }

/* So do kien truc: tam "tuong bep" toi trai het be ngang noi dung, cac
   nut gian deu (grid), duoi la 3 y chinh xep cot nhu .points */
.arch { margin: 2rem 0 0; }
.arch-flow {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) 2.5rem minmax(0, 1fr) 2.5rem minmax(0, 1.1fr) 2.5rem minmax(0, 1.2fr) 2.5rem minmax(0, 1.2fr);
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  background: radial-gradient(ellipse 90% 80% at 30% 0%, rgba(255, 255, 255, 0.07), transparent 70%), var(--wall);
  border-radius: 10px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.arch-col { display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; }
.arch-svcs { gap: 0.7rem; }
.arch-svc { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; }
.node {
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid #c4cbce;
  border-radius: 6px;
  color: var(--ink);
}
.node b { display: block; font-size: var(--t-base); }
.node small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.node-core { border: 2px solid #f2c14e; box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.18); }
.node-bus { background: var(--wall-deep); color: var(--on-wall); border: 1px solid #5d7470; }
.node-bus small { color: var(--on-wall-muted); font-family: var(--f-receipt); font-size: 0.72rem; }
/* "DB rieng": nhan nho kieu ong tru (database) */
.node-db {
  align-self: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid #5d7470;
  border-radius: 999px / 60%;
  font-family: var(--f-receipt);
  font-size: 0.7rem;
  color: var(--on-wall-muted);
  white-space: nowrap;
}

.link {
  justify-self: stretch;
  height: 2px;
  margin: 0 0.35rem;
  background: var(--steel);
  position: relative;
}
.link::after {
  content: "";
  position: absolute;
  right: -1px; top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--steel);
  border-right: 0;
}
.link-both::before {
  content: "";
  position: absolute;
  left: -1px; top: -4px;
  border: 5px solid transparent;
  border-right-color: var(--steel);
  border-left: 0;
}

.arch-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  margin-top: 2rem;
}

/* Man hep: xep doc, mui ten chi xuong */
@media (max-width: 960px) {
  .arch-flow { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .link { justify-self: center; width: 2px; height: 1.6rem; margin: 0.35rem 0; }
  .link::after { right: -4px; top: auto; bottom: -1px; border: 5px solid transparent; border-top-color: var(--steel); border-bottom: 0; }
  .link-both::before { left: -4px; top: -1px; border: 5px solid transparent; border-bottom-color: var(--steel); border-top: 0; }
  .arch-points { grid-template-columns: minmax(0, 1fr); }
}

/* Keu goi */
.cta p { margin: 1rem 0 1.5rem; max-width: var(--measure); color: var(--muted); font-size: var(--t-md); }

.site-foot {
  padding: 2rem var(--gutter);
  font-size: var(--t-sm);
  color: var(--muted);
  border-top: 1px solid #d2d8d6;
}
.site-foot p { margin: 0 0 0.35rem; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); }

/* ---------------- Man hinh hep ---------------- */
/* Man vua (tablet, ~641-900px): 5 muc menu + 2 nut khong vua 1 hang ->
   menu xuong hang rieng nhu mobile, nhung xep sat trai (khong dan deu). */
@media (max-width: 900px) {
  .site-head { flex-wrap: wrap; row-gap: 0.4rem; }
  .btn-book { margin-left: auto; }
  /* nut ngon ngu dung ngay truoc nut Dat ban: no nhan phan "day sang phai" */
  .lang-btn { margin-left: auto; }
  .lang-btn + .btn-book { margin-left: 0; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
}
/* Man rat hep (~320px): menu khong vua thi CUON NGANG, khong xuong dong tung chu */
@media (max-width: 380px) {
  /* overflow-x: auto cat luon phan tran DOC -> chua cho gach chan muc dang chon (offset 6px) */
  .site-nav { overflow-x: auto; scrollbar-width: none; padding-bottom: 0.5rem; margin-bottom: -0.5rem; }
  .site-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  /* Man hep: logo + o dang nhap cung hang tren, menu xuong hang rieng */
  .site-head { flex-wrap: wrap; row-gap: 0.4rem; padding-top: 0.75rem; padding-bottom: 0.6rem; }
  .btn-book { margin-left: auto; padding: 0.4rem 0.7rem; }
  .lang-btn + .btn-book { margin-left: 0; }
  .site-nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; gap: 0.5rem; }
  .hide-sm, .auth-slot .soon { display: none; }
  /* header dinh tren cung -> giu 2 hang: an ten (con anh dai dien), nut nho lai */
  .user-name { display: none; }
  .brand-tag { display: none; }
  .brand-word { font-size: 1.6rem; }
  .site-head { gap: 0.6rem; }
  .ticket { flex-basis: 12.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stamp { animation: none; }
  .ticket,
  .ticket-enter-active,
  .ticket-move { transition: none; }
}

/* =========================================================
   Trang con: seats.html, kitchen.html
   Cung y tuong: phan tren la tuong bep (toi), phan duoi la mat sang
   noi dat so do / ke. So lieu tong hop in tren "phieu nho" (chit).
   ========================================================= */

.hero-page { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.page-live { padding: 0 var(--gutter); margin-top: 2rem; max-width: calc(60rem + 2 * var(--gutter)); }

/* ---------------- Phieu nho tong hop ---------------- */
.chits {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-text .chits { margin-top: 2rem; }

.chit {
  position: relative;
  flex: 1 1 10rem;
  max-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.8rem 0.9rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-receipt);
  font-size: var(--t-sm);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.25);
}
.chit::after { /* mep xe rang, giong phieu o trang chu */
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -7px;
  height: 8px;
  background:
    linear-gradient(135deg, var(--paper) 4px, transparent 0) 0 0 / 8px 8px repeat-x,
    linear-gradient(-135deg, var(--paper) 4px, transparent 0) 0 0 / 8px 8px repeat-x;
}
.chit-label { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.chit-num {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.chit-pct { color: var(--muted); }
.chit-low .chit-num { color: var(--pending); }
.chit-out .chit-num { color: var(--fail); }

.glyph { width: 0.95em; height: 0.95em; flex: none; overflow: visible; }

/* Thanh lap day: nen giay de mau trung voi so do ben duoi */
.fill-bar {
  display: flex;
  height: 14px;
  margin-top: 1.6rem;
  padding: 3px;
  background: var(--paper);
  border-radius: 3px;
}
.fill-bar span { height: 100%; transition: width 600ms ease; }
.fill-eating { background: var(--wall); }
.fill-reserved {
  background: repeating-linear-gradient(45deg, #fbe7bb 0 2px, var(--pending) 2px 3.5px);
}
.fill-free { background: #dde3e1; }

/* ---------------- Mat sang ben duoi ---------------- */
.floor-band { padding-top: clamp(2rem, 5vw, 3rem); }
.band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.band-head h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
}
.legend-light { font-size: var(--t-sm); color: var(--muted); }
.legend-light span { display: inline-flex; align-items: center; gap: 0.4rem; }

.floor-note { margin-top: 1rem; max-width: var(--measure); font-size: var(--t-sm); color: var(--muted); }
.feed-status-light { margin-top: 0.4rem; font-size: var(--t-sm); color: var(--muted); }

/* ---------------- So do phong an (SVG) ---------------- */
.floor {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid #d2d8d6;
  border-radius: 8px;
  overflow-x: auto; /* man hep: cuon ngang thay vi ghe nho lai khong nhin thay */
}
.floor-svg { display: block; width: 100%; min-width: 760px; height: auto; }
/* Man hep: so do da xoay doc, vua be ngang -> khong can cuon ngang */
.floor-v { padding: 0.75rem 0.5rem; overflow-x: visible; }
.floor-v .floor-svg { min-width: 0; max-width: 26rem; margin: 0 auto; }

.counter { fill: var(--wall); }
.counter-text,
.entry-text {
  font-family: var(--f-receipt);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.counter-text { fill: var(--on-wall); }
.entry-text { fill: var(--muted); }
.col-mark { font-family: var(--f-receipt); font-size: 8px; fill: var(--muted); }
.row-mark { font-family: var(--f-display); font-weight: 800; font-size: 13px; fill: var(--ink); }
.row-stat { font-family: var(--f-receipt); font-size: 9px; fill: var(--muted); }
.row-stat-num { font-weight: 700; fill: var(--ink); }
.table { fill: #d9dedc; }

.seat {
  stroke-width: 1.25;
  transition: fill 400ms ease, stroke 400ms ease;
}
.seat-free { fill: #ffffff; stroke: #b9bfc2; }
.seat-reserved { fill: url(#seat-hatch); stroke: var(--pending); }
.seat-eating { fill: var(--wall); stroke: var(--wall); }
.hatch-bg { fill: #fbe7bb; }
.hatch-line { stroke: var(--pending); stroke-width: 1.6; }
/* glyph trong chu thich nam ngoai SVG so do -> khong dung duoc
   url(#seat-hatch), ve soc bang mau dac + vien dam */
.glyph .seat-reserved { fill: #f3d58f; stroke: var(--pending); stroke-dasharray: 2 1.2; }

.seat-click { cursor: pointer; }
/* Ca nhom dang mo trong modal duoc vien vang tren so do */
.seat.seat-picked { stroke: #e0a400; stroke-width: 3; }
/* Sac do thu 2: nhom nam xen ke (seats.js altById) - cung ho mau voi
   trang thai, chi dam/nhat hon de tach 2 nhom canh nhau */
.seat-eating.seat-alt { fill: #4f7f78; stroke: #4f7f78; }
.seat-reserved.seat-alt { fill: url(#seat-hatch-b); stroke: #8a5d06; }
.hatch-bg-b { fill: #f2cd7a; }
.hatch-line-b { stroke: #8a5d06; stroke-width: 1.6; }
/* Re chuot vao 1 ghe: ca nhom vien sang, phan con lai mo di */
.floor-svg.has-hover .seat { opacity: 0.28; }
.floor-svg.has-hover .seat.seat-hl { opacity: 1; stroke: #e0a400; stroke-width: 2.5; }
.floor-hover { min-height: 3.1em; }
/* Loc ghe: ghe khong khop bo loc mo di (re chuot 1 nhom van sang ca nhom) */
.floor-svg .seat.seat-dim { opacity: 0.16; }
.floor-svg.has-hover .seat.seat-dim.seat-hl { opacity: 1; }
.seat-filter { background: var(--paper); }
.seat-filter button { display: inline-flex; align-items: center; gap: 0.35rem; }
.seat-filter .seg-n { font-weight: 700; color: inherit; font-variant-numeric: tabular-nums; }
.glyph-mine { width: 10px; height: 10px; border-radius: 2px; background: #f2c14e; box-shadow: inset 0 0 0 1.5px #8a5d06; }
.my-parties { margin-top: 0.9rem; }
.my-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.my-chip {
  font: inherit;
  font-family: var(--f-receipt);
  font-size: var(--t-sm);
  text-align: left;
  color: var(--ink);
  background: #fdf3d9;
  border: 1.5px solid #e0a400;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
.my-chip:hover, .my-chip:focus-visible { background: #fbe7bb; outline: none; }
.my-seats { display: block; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .floor-svg .seat { transition: opacity 120ms ease; }
}

@media (hover: hover) {
  .floor-svg .seat-click:hover { stroke: #f2c14e; stroke-width: 2.5; }
}

/* Dau phieu modal: logo + "dine." nhu ten quan tren hoa don (site.js dlgBrand) */
.dlg-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px dashed #b9bfc2;
  padding-right: 2rem; /* cho nut dong */
}
.dlg-brand img { display: block; width: 22px; height: 22px; flex: none; }
.dlg-brand-word {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.dlg-brand .brand-dot { color: #d9a21b; } /* vang dam hon tren nen giay */
.dlg-brand-tag {
  margin-left: auto;
  font-family: var(--f-receipt);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 420px) { .dlg-brand-tag { display: none; } }

/* ---------------- Phieu huy dat ban (js/order-cancel.js) ---------------- */
.cc-ticket {
  width: 30rem;
  max-width: 100%;
  margin-top: 10px;
  padding: 1.1rem 1.2rem 0;
  cursor: default;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (hover: hover) { .cc-ticket:hover { transform: none; } }
.cc-head { padding-right: 2rem; padding-bottom: 0.5rem; border-bottom: 1px dashed #b9bfc2; }
.cc-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin: 0.7rem 0 0; }
.cc-facts dt { font-size: 0.72rem; color: var(--muted); }
.cc-facts dd { margin: 0; font-weight: 700; }
.cc-facts small { display: block; font-weight: 400; color: var(--muted); }
.cc-facts .cc-late { color: var(--fail); }
.cc-items { margin-top: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.cc-sec { padding: 0.7rem 0; border-top: 1px dashed #b9bfc2; margin-top: 0.7rem; }
.cc-h { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.cc-lead, .cc-note { font-size: 0.85rem; color: var(--muted); }
.cc-steps { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.3rem; }
.cc-steps li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.5rem; font-size: 0.88rem; }
.cc-steps li b::before { content: "↺ "; color: var(--undo); }
.cc-warn { background: #fdf3d9; margin-left: -1.2rem; margin-right: -1.2rem; padding-left: 1.2rem; padding-right: 1.2rem; font-size: 0.86rem; }
.cc-warn .cc-h { color: #8a5d06; }
.cc-done p + p { margin-top: 0.4rem; font-size: 0.86rem; color: var(--muted); }
.cc-error { margin-top: 0.4rem; color: var(--fail); font-weight: 600; font-size: 0.88rem; }
.cc-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.8rem 0 1rem;
  border-top: 1px dashed #b9bfc2;
}
.cc-keep { background: var(--ink); }
.cc-go { background: transparent; color: var(--fail); border: 1.5px solid var(--fail); }
.cc-go:hover { background: rgba(192, 57, 43, 0.08); }
.cc-go:disabled, .cc-keep:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Modal don (dialog) ---------------- */
.seat-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  max-width: calc(100vw - 2rem);
}
.seat-dialog::backdrop { background: rgba(14, 26, 25, 0.62); }
/* Focus vao nut dong (autofocus), khong vien ca khung dialog */
.seat-dialog:focus { outline: none; }
.seat-dialog[open] { animation: dlg-in 180ms ease both; }
@keyframes dlg-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

.ticket-order {
  width: 21rem;
  max-width: 100%;
  margin-top: 10px; /* cho kep giu phieu */
  cursor: default;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}
@media (hover: hover) {
  .ticket-order:hover { transform: none; }
}
.dlg-close {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
}
.dlg-close:hover { color: var(--ink); }
.ticket-order .ticket-head { padding-right: 2rem; }

.order-items {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #b9bfc2;
}
.order-items li {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 0.4rem;
  padding: 0.1rem 0;
}
.oi-qty { color: var(--muted); }
.oi-amt { text-align: right; font-variant-numeric: tabular-nums; }
.order-total {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0 0.6rem;
  border-bottom: 1px dashed #b9bfc2;
  font-weight: 700;
}
.order-total b { font-size: var(--t-md); }
.stamp-wait { color: var(--pending); }

/* ---------------- Kho bep ---------------- */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
  padding-right: var(--gutter);
}
.hero-split .hero-text { max-width: calc(var(--measure) + 2 * var(--gutter)); }

.ticket-log {
  flex: none;
  width: 22rem;
  margin-top: 0.5rem;
  padding-bottom: 1.2rem;
  cursor: default;
}
@media (hover: hover) {
  .ticket-log:hover { transform: none; }
}
.log-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0.5rem 0 0;
  border-top: 1px dashed #b9bfc2;
}
.log-list li {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  column-gap: 0.5rem;
  padding: 0.18rem 0;
}
.log-at { color: var(--muted); }
.log-qty { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.log-why { grid-column: 2 / 4; color: var(--muted); font-size: 0.75rem; }
.mv-order .log-qty { color: var(--ink); }
.mv-rejected .log-qty,
.mv-rejected .log-why { color: var(--fail); }
.mv-compensated .log-qty,
.mv-compensated .log-why { color: var(--undo); }
.mv-restock .log-qty { color: var(--ok); }
.log-empty { margin-top: 0.6rem; color: var(--muted); }

/* Nut chuyen sap xep */
.seg { display: inline-flex; border: 1px solid #b9c1c4; border-radius: 6px; overflow: hidden; }
.seg button {
  padding: 0.4rem 0.8rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--t-sm);
  color: var(--muted);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid #b9c1c4; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Ke: moi thung co tam ke inox ben duoi, khoang ngang = 0 de cac tam
   noi lien thanh 1 thanh ke dai tren moi hang */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
  column-gap: 0;
  row-gap: 2.25rem;
  margin-top: 1.5rem;
}
.bin {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  align-items: end;
  padding: 0.75rem 1rem 0;
  border-bottom: 10px solid var(--steel);
  border-image: linear-gradient(180deg, #dfe4e6, var(--steel) 50%, var(--steel-dark)) 1;
}
.bin-art { display: block; width: 100%; height: auto; margin-bottom: -1px; }
.bin-lid { fill: var(--steel-dark); }
.bin-body { fill: #f4f7f6; stroke: var(--steel-dark); stroke-width: 1.5; }
.bin-fill { fill: #4c8f74; transition: y 500ms ease, height 500ms ease, fill 300ms ease; }
.bin-low .bin-fill { fill: var(--pending); }
.bin-low-line { stroke: var(--fail); stroke-width: 1.2; stroke-dasharray: 3 2; }
.bin-tick { stroke: var(--steel-dark); stroke-width: 1; }
.bin-shine { fill: rgba(255, 255, 255, 0.55); }

.bin-info { padding-bottom: 0.6rem; min-width: 0; }
.bin-name { font-size: var(--t-base); font-weight: 600; }
/* So ton va "/ suc chua don vi" xuong dong khi thung hep (vd "1.000 / 1.000
   suat" dai hon cot chu ~116px) — truoc day nowrap nen tran sang thung ben */
.bin-stock { font-family: var(--f-receipt); font-size: var(--t-sm); color: var(--muted); }
.bin-cap { white-space: nowrap; }
.bin-stock b {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bin-low .bin-stock b { color: var(--pending); }
.bin-out .bin-stock b { color: var(--fail); }
.bin-warn { margin-top: 0.1rem; font-size: 0.75rem; color: var(--muted); }

.spark { display: block; width: 100%; height: 26px; margin-top: 0.35rem; }
.spark-line { fill: none; stroke: var(--wall); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bin-low .spark-line { stroke: var(--pending); }

/* Nhan "Sap het"/"Het" - kieu con dau nho */
/* Dat o goc TRAI, de len nap thung: dat ben phai thi de len ten mon dai
   (ten that tu dine.product, vd "Pepperoni Pizza", dai hon ten mo phong) */
.bin-tag {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  padding: 0 0.35rem;
  border: 2px solid currentColor;
  border-radius: 3px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.95rem;
  transform: rotate(-6deg);
  color: var(--pending);
  background: var(--page);
}
.bin-out .bin-tag { color: var(--fail); }

.bin-move { transition: transform 450ms ease; }

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; padding-right: 0; }
  .ticket-log { width: auto; margin: 0 var(--gutter); }
  /* nhat ky dung giua trang -> chi giu 6 dong moi nhat cho gon */
  .log-list li:nth-child(n+7) { display: none; }
}

@media (max-width: 640px) {
  /* 3 phieu tong hop luon nam tren 1 hang */
  .chits { gap: 0.6rem; flex-wrap: nowrap; }
  .chit { flex: 1 1 0; min-width: 0; padding: 0.6rem 0.6rem 0.8rem; font-size: 0.7rem; }
  .chit-num { font-size: 1.75rem; }
  .chit-pct { overflow-wrap: anywhere; }

  /* Ke: 2 cot, thung nho lai */
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.5rem; }
  .bin { grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.5rem; padding: 0.5rem 0.5rem 0; }
  .bin-name { font-size: var(--t-sm); }
  .bin-stock { font-size: 0.7rem; }
  .bin-stock b { font-size: 1.25rem; }
  .bin-warn { display: none; }
  .bin-stock { white-space: normal; }
  /* the hep: nhan dat de len thung, khong de len ten mon */
  .bin-tag { top: 0.1rem; left: 0.2rem; right: auto; font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .seat,
  .fill-bar span,
  .bin-fill,
  .bin-move { transition: none; }
}

/* =========================================================
   Lien ket giua cac trang + trang thanh toan + trang chi tiet don
   ========================================================= */

.more-link {
  font-size: var(--t-sm);
  font-weight: 600;
  color: #f2c14e;          /* tren nen toi */
  text-decoration: none;
}
.more-link:hover { text-decoration: underline; }
.more-link-ink { color: var(--undo); } /* tren nen giay */
.ticket-order .more-link { display: inline-block; margin-top: 0.5rem; font-family: var(--f-body); }

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}
a.log-why { color: inherit; text-decoration: underline; text-decoration-color: rgba(89, 100, 106, 0.4); }
a.log-why:hover { color: var(--undo); }

/* ---------------- Thanh toan ---------------- */
.pay-mark {
  display: inline-block;
  width: 1.15em;
  margin-right: 0.35rem;
  font-family: var(--f-receipt);
  font-weight: 700;
  text-align: center;
}
.pay-succeeded { color: var(--ok); }
.pay-failed { color: var(--fail); }
.pay-refunding,
.pay-refunded { color: var(--undo); }
.pay-pending { color: var(--pending); }
.chit-paid .chit-num { color: var(--ok); }
.chit-undo .chit-num { color: var(--undo); }

.ledger {
  margin-top: 1.25rem;
  background: var(--paper);
  border: 1px solid #d2d8d6;
  border-radius: 8px;
  font-family: var(--f-receipt);
  font-size: var(--t-sm);
  overflow: hidden;
}
.ledger-list { list-style: none; margin: 0; padding: 0; }
.ledger-row {
  display: grid;
  grid-template-columns: 5.5rem 9.5rem 9.5rem minmax(0, 1.5fr) minmax(0, 1fr) 8.5rem;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.55rem 1rem;
  border-bottom: 1px dashed #d2d8d6;
}
.ledger-headrow {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #c4cbce;
}
.lr-at,
.lr-id,
.lr-note { color: var(--muted); }
.lr-status { white-space: nowrap; }
.lr-order { display: flex; flex-direction: column; gap: 0.1rem; }
.lr-order-link, .lr-order b { font-weight: 700; color: var(--ink); text-decoration: none; }
.lr-order-link:hover { color: var(--undo); text-decoration: underline; }
.lr-order .lr-id { font-size: 0.72rem; }
.lr-items { color: var(--ink); overflow-wrap: anywhere; }
/* Don cua nguoi dang dang nhap: vach vang trai + nhan */
.lr-mine {
  align-self: flex-start;
  padding: 0 0.35rem;
  border-radius: 3px;
  background: #fbe7bb;
  color: #6b4a05;
  font-size: 0.7rem;
  font-weight: 700;
}
.ledger-row.is-mine { box-shadow: inset 4px 0 0 #f2c14e; }
.lr-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lr-failed .lr-amt { color: var(--muted); text-decoration: line-through; }
.lr-refunded .lr-amt,
.lr-refunding .lr-amt { color: var(--undo); }
.lr-failed .lr-note { color: var(--fail); }
.ledger-row.is-focus { background: #fff4d1; box-shadow: inset 4px 0 0 #e0a400; }
.ledger-empty { padding: 1rem; color: var(--muted); }

.lrow-enter-from { opacity: 0; transform: translateY(-6px); background: #fff4d1; }
.lrow-enter-active { transition: opacity 300ms ease, transform 300ms ease, background 1.2s ease; }
.lrow-leave-active { display: none; }

/* ---------------- Chi tiet don ---------------- */
.crumb { font-size: var(--t-sm); color: var(--on-wall-muted); margin-bottom: 0.75rem; }
.crumb a { color: var(--on-wall-muted); }
.mono { font-family: var(--f-receipt); font-size: var(--t-sm); overflow-wrap: anywhere; }
.timeline-page { margin: 1.75rem 0 0; max-width: none; }
.order-ticket { margin-top: 0.5rem; }
.order-ticket .ticket { width: 16rem; }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.svc {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--paper);
  border: 1px solid #d2d8d6;
  border-top: 4px solid var(--steel-dark);
  border-radius: 6px;
}
.svc-pending { border-top-color: var(--pending); }
.svc-succeeded { border-top-color: var(--ok); }
.svc-failed { border-top-color: var(--fail); }
.svc-compensating,
.svc-compensated { border-top-color: var(--undo); }
.svc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.svc-head h3 { font-size: var(--t-base); font-weight: 600; }
.svc-mark { font-family: var(--f-receipt); font-size: var(--t-sm); font-weight: 700; }
.svc-pending .svc-mark { color: var(--pending); }
.svc-succeeded .svc-mark { color: var(--ok); }
.svc-failed .svc-mark { color: var(--fail); }
.svc-compensating .svc-mark,
.svc-compensated .svc-mark { color: var(--undo); }
.svc-big { font-family: var(--f-display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.svc-sub { font-size: var(--t-sm); color: var(--muted); }
.svc-reason { color: var(--fail); }
.svc .order-items { font-family: var(--f-receipt); font-size: var(--t-sm); border-bottom: 0; }
.svc .more-link { margin-top: auto; padding-top: 0.5rem; }
.svc-moves {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0;
  border-top: 1px dashed #b9bfc2;
  font-family: var(--f-receipt);
  font-size: 0.75rem;
}
.svc-moves li { display: grid; grid-template-columns: 4.4rem 1fr auto; column-gap: 0.5rem; }
.svc-moves .log-why { grid-column: 2 / 4; }

@media (max-width: 860px) {
  .order-ticket { margin: 0 var(--gutter); }
}

@media (max-width: 760px) {
  /* So giao dich: moi dong 2 hang, bo ma giao dich */
  .ledger-headrow { display: none; }
  .ledger-row {
    grid-template-columns: 4.2rem minmax(0, 1fr) auto;
    grid-template-areas:
      "at status amt"
      "at order note"
      "at items items";
    row-gap: 0.15rem;
  }
  .lr-at { grid-area: at; }
  .lr-status { grid-area: status; }
  .lr-amt { grid-area: amt; }
  .lr-order { grid-area: order; }
  .lr-note { grid-area: note; text-align: right; font-size: 0.75rem; }
  .lr-items { grid-area: items; font-size: 0.75rem; }
  .lr-order .lr-id { display: none; }
}

/* 4 phieu tong hop (trang thanh toan): man rong 1 hang, man hep 2x2 */
.chits-4 .chit { flex: 1 1 9rem; max-width: 13rem; }
@media (max-width: 640px) {
  .chits.chits-4 { flex-wrap: wrap; }
  .chits-4 .chit { flex: 1 1 calc(50% - 0.6rem); max-width: none; }
}

/* Nut loc/sap xep: khong xuong dong, man hep thi cuon ngang trong khung */
.seg { max-width: 100%; overflow-x: auto; }
.seg button { white-space: nowrap; flex: none; }

.nowrap { white-space: nowrap; }

/* ---------------- Don mau: "Xem cac tinh huong" (trang chu) ---------------- */
/* 6 the: 3 cot x 2 hang (deu 2 hang), trai het be ngang noi dung */
.cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.5rem;
}
@media (max-width: 900px) { .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cases { grid-template-columns: minmax(0, 1fr); } }
.case {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  column-gap: 0.7rem;
  row-gap: 0.25rem;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: 1px solid #c9d0ce;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.case:hover { border-color: var(--ink); }
.case:focus-visible { outline: 3px solid #f2c14e; outline-offset: 2px; }
.case b { grid-column: 2; }
.case span:last-child { grid-column: 2; font-size: var(--t-sm); color: var(--muted); }
.case-mark { grid-row: 1 / span 2; width: 1.4rem; height: 1.4rem; border-radius: 4px; margin-top: 0.1rem; }
.case-ok { background: var(--ok); }
.case-fail { background: var(--fail); }
.case-late { background: repeating-linear-gradient(45deg, var(--ok) 0 5px, #3d915f 5px 10px); }
.case-wait { border-radius: 50%; background: var(--paper); border: 2px solid var(--pending); }
.case-undo { background: var(--undo); }
.case-human { background: var(--paper); border: 2px dashed var(--fail); }

/* ---------------- Dong "Hom nay ..." (trang chu, js/today-stats.js) ---------------- */
.today {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin-top: 1.5rem;
  padding: 0 var(--gutter);
  font-family: var(--f-receipt);
  font-size: 0.9rem;
  color: var(--on-wall-muted);
}
.today[hidden] { display: none; }
.today-label {
  padding: 0.1rem 0.5rem;
  border: 1px solid #5d7470;
  border-radius: 3px;
  color: var(--on-wall);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.today-item b { color: var(--on-wall); font-weight: 700; }
.today-item small { font-size: 0.72rem; }
.today-ok b { color: #7fd1a1; }
.today-fail b { color: #f08a80; }
.today-undo b { color: #9cb9ef; }
.today-warn b { color: #f2c14e; }
.today-sep { color: #5d7470; }
@media (prefers-reduced-motion: no-preference) {
  .today-item.is-bump b { display: inline-block; animation: today-bump 0.6s ease-out; }
}
@keyframes today-bump { 30% { transform: translateY(-3px); } }
