.app { display: flex; height: 100dvh; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Rail */
.rail { width: 84px; flex: none; background: var(--pine); color: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0; }
.rail-logo { width: 56px; margin-bottom: 14px; }
.rail-btn { width: 64px; min-height: 60px; border: 0; border-radius: 14px; background: transparent; color: var(--cream); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; }
a.rail-btn { text-decoration: none; }
.chip.home-narrow { display: none; text-decoration: none; }
.rail-btn[aria-current="page"] { background: var(--cream); color: var(--pine); font-weight: 700; }
.rail-staff { margin-top: auto; font-size: 11px; text-align: center; opacity: .85; padding: 0 6px; line-height: 1.4; }

/* Khu menu */
.menu-area { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px 18px 0; gap: 12px; }
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.title .display { font-size: 22px; color: var(--pine); }
.title .sub { font-size: 12px; color: var(--ink-2); }
.search { display: flex; align-items: center; gap: 8px; height: var(--tap); flex: 0 1 220px; min-width: 150px; padding: 0 14px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 15px; color: var(--ink); }
.chip { height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: var(--r-md); background: var(--sand); color: var(--cedar); font-size: 13px; font-weight: 600; border: 0; white-space: nowrap; }
.chip-btn.ok { background: var(--pine); color: var(--cream); }
.chip-btn.off { background: var(--paper); border: 1.5px dashed var(--cedar); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.dot.on { background: #2E7D32; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; padding-bottom: 18px; }
.tile { min-height: 112px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left; position: relative; }
.tile:active { transform: scale(.98); background: var(--sand); }
.tile .name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.tile .hint { font-size: 12px; color: var(--ink-2); }
.tile .price { margin-top: auto; font-weight: 700; color: var(--cedar); }
.tile .badge { position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--pine); color: var(--cream); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 7px; }
.tile.out { background: #EFE8DC; border-style: dashed; color: var(--muted); }
.tile.out .price { color: var(--muted); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-2); padding: 40px 0; }

/* Hàng chờ yêu cầu từ khách */
.reqs { display: flex; flex-direction: column; gap: 8px; }
.reqs:empty { display: none; }
.req { display: flex; align-items: center; gap: 12px; border-radius: var(--r-md); padding: 10px 12px; }
.req.cash { background: var(--cedar); color: #FFFCF7; }
.req.approve { background: var(--pine); color: var(--cream); }
.req.call { background: var(--sand); color: var(--ink); }
.req .txt { flex: 1; font-size: 14px; line-height: 1.35; }
.req .txt small { opacity: .85; font-size: 12px; }
.req .btn { min-height: 40px; border: 0; }
.req.cash .btn { background: #FFFCF7; color: var(--cedar); }
.req.approve .btn { background: var(--ochre); color: var(--ink); }

/* Giỏ */
.cart { width: 380px; flex: none; background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; }
.cart-title { font-size: 20px; color: var(--pine); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--cream); }
.seg button { min-height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--pine); color: var(--cream); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.field input, .field textarea { height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); padding: 0 12px; background: #fff; font-size: 15px; color: var(--ink); }
.lines { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 0 -4px; padding: 0 4px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); }
.line .nm { font-weight: 600; font-size: 14px; }
.line .md { font-size: 12px; color: var(--ink-2); grid-column: 1; }
.line .amt { font-weight: 600; font-size: 14px; text-align: right; }
.stepper { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--pine); background: var(--paper); color: var(--pine); font-size: 18px; line-height: 1; }
.stepper .q { min-width: 22px; text-align: center; font-weight: 700; }
.stepper .rm { margin-left: auto; width: auto; border: 0; border-radius: 8px; padding: 0 8px; color: var(--cedar); font-size: 13px; font-weight: 600; }
.cart-empty { color: var(--ink-2); text-align: center; padding: 30px 10px; font-size: 14px; }
.totals { border-top: 1px dashed var(--line-strong); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; justify-content: space-between; align-items: baseline; }
.row.muted { font-size: 13px; color: var(--ink-2); }
.row.big strong { font-size: 26px; color: var(--pine); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-fab, .cart-close { display: none; }

/* Sheet tuỳ chọn */
.mgroup { display: flex; flex-direction: column; gap: 8px; }
.mgroup h3 { margin: 0; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.mgroup .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: #fff; font-size: 14px; }
.opt[aria-pressed="true"] { border-color: var(--pine); background: var(--pine); color: var(--cream); font-weight: 600; }
.sheet-foot { display: flex; align-items: center; gap: 12px; }
.qty { display: flex; align-items: center; gap: 12px; }
.qty button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--pine); background: #fff; color: var(--pine); font-size: 20px; }
.qty span { font-size: 20px; font-weight: 700; min-width: 24px; text-align: center; }

/* QR & tiền mặt */
.qr-box { align-self: center; width: 280px; height: 280px; border-radius: 16px; border: 2px solid var(--pine); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.kv { display: flex; justify-content: space-between; font-size: 14px; }
.kv span:first-child { color: var(--ink-2); }
.status-wait { display: flex; align-items: center; gap: 10px; background: var(--sand); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--cedar); border-top-color: transparent; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.paid-box { background: var(--pine); color: var(--cream); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.paid-box .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ochre); color: var(--pine); display: flex; align-items: center; justify-content: center; }
.paid-box .check svg { width: 34px; height: 34px; stroke-width: 2.6; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.big-input { height: 60px; font-size: 28px; font-weight: 700; text-align: right; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); padding: 0 16px; width: 100%; background: #fff; }

/* Danh sách đơn */
.olist { display: flex; flex-direction: column; gap: 8px; }
.orow { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
.orow .code { font-weight: 800; font-size: 16px; color: var(--pine); }
.orow .who { font-size: 14px; }
.orow .st { font-size: 12px; color: var(--ink-2); grid-column: 2; }

/* Màn hình hẹp (điện thoại): giỏ thành bảng trượt */
@media (max-width: 900px) {
  .rail { display: none; }
  .chip.home-narrow { display: inline-flex; }
  .search { width: 100%; order: 5; }
  .cart { position: fixed; inset: 0; width: auto; z-index: 40; transform: translateY(100%); transition: transform .25s; }
  .cart.open { transform: none; }
  .cart-close { display: inline-flex; }
  .cart-fab { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; }
  .grid { padding-bottom: 90px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.disc-btn { border: 0; background: none; color: var(--cedar); font-weight: 700; font-size: 13px; min-height: 32px; padding: 0; }
.disc-btn:disabled { color: var(--muted); }

.split-link { border: 1px dashed var(--line-strong); background: transparent; color: var(--cedar); font-weight: 700; font-size: 13px; min-height: 40px; border-radius: 10px; margin-bottom: 8px; width: 100%; }
.split-link:disabled { opacity: .45; }
.bill { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper, #fffdf8); }
.bill.done { opacity: .65; }
.bill .bitems { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.bill .bacts { display: flex; flex-wrap: wrap; gap: 8px; }
.bill .bacts .btn { min-height: 42px; padding: 0 14px; }
.bst { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.bst.warn { background: #f3e3c7; color: var(--cedar); }
.bst.ok { background: #dfe9dc; color: var(--pine); }

.who2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.who2 .field input { min-width: 0; width: 100%; }
.custinfo { background: var(--sand); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.rail-btn { position: relative; }
.rail-badge { position: absolute; top: 6px; right: 10px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ochre); color: var(--ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
