:root {
  --ink: #0b0b0c;
  --ink-2: #3a3d42;
  --muted: #8a8f98;
  --line: #eceef1;
  --bg: #f4f5f7;
  --card: #ffffff;
  --blue: #00b2ec;
  --blue-d: #0090c2;
  --blue-soft: #e6f7fd;
  --green: #12b76a;
  --green-soft: #e8f8f0;
  --amber: #f59e0b;
  --amber-soft: #fef5e6;
  --red: #f04438;
  --red-soft: #fdecea;
  --violet: #8b5cf6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 14px/1.45 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
svg { flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 18px; background: #fff; border-right: 1px solid var(--line); }
.side .logo { padding: 0 10px 2px; }
.side .logo img { height: 15px; }
.side .me { padding: 0 10px 18px; margin-top: -12px; font-size: 12px; color: var(--ink-2); }
.side .foot a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-size: 13px; text-decoration: none; }
.side .foot a:hover { background: var(--bg); color: var(--ink); }
.side .foot a svg { width: 18px; height: 18px; }
.langbtn { padding: 0 14px; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.langbtn svg { width: 17px; height: 17px; color: var(--muted); }
.keys button.langfn { display: flex; align-items: center; justify-content: center; gap: 6px; }
.keys button.langfn svg { width: 16px; height: 16px; margin: 0; }
.owner-link { display: inline-block; margin-top: 22px; color: var(--blue-d); font-size: 13px; font-weight: 500; text-decoration: none; }
.side .shop { padding: 6px 10px 18px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; transition: background .15s; }
.nav button svg { width: 20px; height: 20px; color: var(--muted); }
.nav button:hover { background: var(--bg); }
.nav button.on { background: var(--ink); color: #fff; }
.nav button.on svg { color: var(--blue); }
.nav .badge { margin-left: auto; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side .foot button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-size: 13px; }
.side .foot button:hover { background: var(--bg); color: var(--ink); }
.side .foot svg { width: 18px; height: 18px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; }
.badge.red { background: var(--red); }
.badge.blue { background: var(--blue); }
main.main { min-width: 0; padding: 26px 30px 60px; }
.topbar, .tabbar { display: none; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.3px; flex: 1; min-width: 160px; }
.page-head .sub { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; letter-spacing: 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s, background .15s, opacity .2s; white-space: nowrap; }
.btn:hover { background: #fafbfc; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #26282c; }
.btn.blue { background: var(--blue); color: #fff; box-shadow: none; }
.btn.blue:hover { background: var(--blue-d); }
.btn.green { background: var(--green); color: #fff; box-shadow: none; }
.btn.danger { color: var(--red); }
.btn.soft { background: var(--bg); box-shadow: none; }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.lg { height: 52px; font-size: 15px; font-weight: 600; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all .15s; }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.chip.pick.on { background: var(--blue-soft); color: #007aa5; box-shadow: inset 0 0 0 1.5px var(--blue); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #e9ebee; }
.seg button { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.in { width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--bg); outline: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s, background .15s; }
.in:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue); }
textarea.in { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.in.money { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.sw { position: relative; width: 44px; height: 26px; border-radius: 99px; background: #d7dbe0; transition: background .2s; flex: none; }
.sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.sw.on { background: var(--green); }
.sw.on::after { transform: translateX(18px); }
.sw.sm { width: 36px; height: 22px; margin-left: 4px; }
.sw.sm::after { width: 16px; height: 16px; }
.sw.sm.on::after { transform: translateX(14px); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.sec-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.empty { padding: 50px 0; text-align: center; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: #c8cdd3; margin-bottom: 8px; }

.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; border: 2px solid #fff; margin-left: -6px; flex: none; }
.avs { display: inline-flex; }
.avs .av:first-child { margin-left: 0; }
.av.sm { width: 18px; height: 18px; font-size: 9px; border-width: 1.5px; margin-left: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pill.new { background: var(--amber-soft); color: #b46d06; }
.pill.cooking { background: var(--blue-soft); color: #0086b3; }
.pill.served { background: var(--green-soft); color: #0e9255; }
.pill.void { background: #f1f2f4; color: var(--muted); text-decoration: line-through; }
.pill.bill { background: var(--red-soft); color: #c5281c; }
.pill.call { background: #f1ecfe; color: #6d3fe0; }

/* ---------- tables ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { display: block; margin-top: 2px; font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.tcard { position: relative; display: flex; flex-direction: column; min-height: 132px; padding: 14px 14px 12px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: left; transition: transform .15s, box-shadow .15s; overflow: hidden; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 10px 24px rgba(16, 24, 40, .09); }
.tcard .tn { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.tcard .ta { font-size: 11.5px; color: var(--muted); }
.tcard .tstat { position: absolute; top: 14px; right: 12px; display: flex; gap: 4px; flex-direction: column; align-items: flex-end; }
.tcard .tfoot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tcard .amt { font-size: 15px; font-weight: 600; }
.tcard .time { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.tcard .time svg { width: 13px; height: 13px; }
.tcard.empty-t { background: #fafbfc; box-shadow: inset 0 0 0 1.5px dashed var(--line); box-shadow: none; border: 1.5px dashed #dfe2e6; }
.tcard.empty-t .tn { color: #b3b9c2; }
.tcard.busy::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.tcard.alert::before { background: var(--amber); }
.tcard.billreq::before { background: var(--red); }
.tcard.alert, .tcard.billreq { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .18), var(--shadow); } }
.tcard.billreq { animation-name: glowr; }
@keyframes glowr { 50% { box-shadow: 0 0 0 4px rgba(240, 68, 56, .16), var(--shadow); } }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(11, 11, 12, .32); opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(520px, 100vw); display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow-lg); transform: translateX(104%); transition: transform .32s cubic-bezier(.2, .85, .25, 1); }
.drawer.show { transform: none; }
.dhead { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.dhead h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1; }
.dhead .meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dbody { flex: 1; overflow-y: auto; padding: 16px 22px; }
.dfoot { padding: 14px 22px calc(var(--safe-b) + 18px); border-top: 1px solid var(--line); background: #fff; }
.alertbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; font-size: 13px; font-weight: 500; }
.alertbar svg { width: 18px; height: 18px; }
.alertbar span { flex: 1; }
.alertbar.call { background: #f1ecfe; color: #5b2fc9; }
.alertbar.bill { background: var(--red-soft); color: #b42318; }
.alertbar.new { background: var(--amber-soft); color: #a05c00; }
.order { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; overflow: hidden; }
.order.isnew { box-shadow: inset 0 0 0 1.5px var(--amber); }
.ohead { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fafbfc; font-size: 12.5px; color: var(--muted); }
.ohead b { color: var(--ink); font-size: 13.5px; }
.ohead .sp { flex: 1; }
.oline { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.oline .q { width: 28px; font-weight: 600; }
.oline .n { flex: 1; min-width: 0; }
.oline .n small { display: block; color: var(--muted); font-size: 12px; }
.oline .n .note { color: #b46d06; }
.oline .p { font-weight: 500; min-width: 84px; text-align: right; }
.oline.void .n, .oline.void .p, .oline.void .q { color: var(--muted); text-decoration: line-through; }
.oline .pill { cursor: pointer; }
.totals { font-size: 13.5px; }
.totals .r { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-2); }
.totals .r.t { margin-top: 6px; padding-top: 10px; border-top: 1px dashed #d5d9de; color: var(--ink); font-size: 19px; font-weight: 600; }
.totals .r.paid { color: var(--green); }
.totals .r.rem { color: var(--red); font-weight: 600; }
.menu-pop { position: fixed; z-index: 80; min-width: 180px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-lg); animation: popin .16s ease-out; }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; text-align: left; }
.menu-pop button:hover { background: var(--bg); }
.menu-pop button svg { width: 16px; height: 16px; color: var(--muted); }
.menu-pop button.danger { color: var(--red); }
@keyframes popin { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; }
.modal-wrap .scrim { z-index: 0; }
.modal { position: relative; z-index: 1; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .22s, transform .28s cubic-bezier(.2, .85, .25, 1); }
.modal.wide { width: min(880px, 100%); }
.modal.show { opacity: 1; transform: none; }
.mhead { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; }
.mhead h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; }
.mbody { flex: 1; overflow-y: auto; padding: 4px 22px 18px; }
.mfoot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.mfoot .sp { flex: 1; }
.x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); }
.x svg { width: 16px; height: 16px; }

/* ---------- payment ---------- */
.paybig { text-align: center; padding: 8px 0 16px; }
.paybig small { color: var(--muted); }
.paybig b { display: block; font-size: 36px; font-weight: 600; letter-spacing: -1px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.quick button { height: 40px; border-radius: 10px; background: var(--bg); font-weight: 500; font-size: 13px; }
.change { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; margin-top: 12px; border-radius: 12px; background: var(--green-soft); color: #0b7a47; font-weight: 500; }
.change b { font-size: 20px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.prow .nm { flex: 1; min-width: 0; }
.prow .nm small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .amt { font-weight: 600; }
.paid-tag { color: var(--green); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.paid-tag svg { width: 16px; height: 16px; }
.done-pay { text-align: center; padding: 18px 0 6px; }
.done-pay .ok { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
.done-pay .ok svg { width: 30px; height: 30px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- kitchen ---------- */
.kcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kcol h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ticket { border-radius: 16px; background: #fff; box-shadow: var(--shadow); overflow: hidden; animation: slidein .3s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } }
.ticket .th { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ticket .th .tb { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.ticket .th .tm { flex: 1; font-size: 12px; color: var(--muted); }
.ticket .age { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg); }
.ticket .age.warn { background: var(--amber-soft); color: #b46d06; }
.ticket .age.late { background: var(--red-soft); color: #c5281c; }
.ticket.isnew { box-shadow: 0 0 0 2px var(--amber), var(--shadow); }
.kline { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 14px; text-align: left; border-bottom: 1px solid #f3f4f6; transition: background .15s; }
.kline:hover { background: #fafbfc; }
.kline .q { font-size: 16px; font-weight: 600; min-width: 26px; }
.kline .n { flex: 1; font-size: 14.5px; font-weight: 500; }
.kline .n small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.kline .n .note { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 6px; background: var(--amber-soft); color: #a05c00; font-weight: 500; }
.kline .ck { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #d0d5dc; display: grid; place-items: center; color: #fff; margin-top: 1px; }
.kline .ck svg { width: 14px; height: 14px; }
.kline.served .n, .kline.served .q { color: var(--muted); text-decoration: line-through; }
.kline.served .ck { background: var(--green); box-shadow: none; }
.ticket .tf { display: flex; gap: 8px; padding: 10px 12px; }
.ticket .tf .btn { flex: 1; }

/* ---------- menu ---------- */
.mlayout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.cats { padding: 8px; position: sticky; top: 20px; }
.cats .cat { display: flex; align-items: center; gap: 8px; width: 100%; height: 42px; padding: 0 8px 0 12px; border-radius: 10px; text-align: left; font-weight: 500; color: var(--ink-2); }
.cats .cat:hover { background: var(--bg); }
.cats .cat.on { background: var(--bg); color: var(--ink); }
.cats .cat span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cats .cat em { font-style: normal; font-size: 12px; color: var(--muted); }
.cats .cat .tools { display: none; gap: 2px; }
.cats .cat.on .tools { display: flex; }
.cats .cat .tools[hidden] { display: none !important; }
.cats .cat .tools button { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.cats .cat .tools button:hover { background: #fff; color: var(--ink); }
.cats .cat .tools svg { width: 14px; height: 14px; }
.cats .addcat { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; color: var(--blue-d); font-weight: 500; font-size: 13px; width: 100%; }
.cats .addcat svg { width: 16px; height: 16px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mcard { display: flex; flex-direction: column; border-radius: 16px; background: #fff; box-shadow: var(--shadow); overflow: hidden; text-align: left; transition: transform .15s; }
.mcard:hover { transform: translateY(-2px); }
.mcard .ph { position: relative; aspect-ratio: 1; background: linear-gradient(135deg, #eef1f4, #e3e7ec); display: grid; place-items: center; color: #b3b9c2; }
.mcard .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcard .ph svg { width: 32px; height: 32px; }
.mcard.off .ph img { filter: grayscale(1); opacity: .5; }
.mcard .ph .soldout { position: absolute; left: 10px; top: 10px; padding: 2px 9px; border-radius: 99px; background: rgba(11, 11, 12, .75); color: #fff; font-size: 11px; font-weight: 500; }
.mcard .mb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mcard .mn { font-weight: 500; line-height: 1.3; }
.mcard .me { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .mf { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.mcard .mp { font-weight: 600; }
.mcard .mtools { display: flex; gap: 2px; }
.mcard .mtools button:not(.sw) { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.mcard .mtools button:not(.sw):hover { background: var(--bg); color: var(--ink); }
.mcard .mtools svg { width: 15px; height: 15px; }
.mcard.add { align-items: center; justify-content: center; min-height: 230px; border: 1.5px dashed #d5d9de; background: transparent; box-shadow: none; color: var(--muted); gap: 6px; font-weight: 500; }
.mcard.add svg { width: 26px; height: 26px; }
.ai-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; border-radius: 18px; background: linear-gradient(120deg, #0b0b0c 0%, #1b2430 100%); color: #fff; }
.ai-banner .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 178, 236, .18); color: var(--blue); }
.ai-banner .ic svg { width: 22px; height: 22px; }
.ai-banner div { flex: 1; }
.ai-banner b { display: block; font-weight: 600; }
.ai-banner small { opacity: .65; }
/* editor */
.editor { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #eef1f4, #e3e7ec); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.photo img, .photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo .ph-in { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; }
.photo .ph-in svg { width: 30px; height: 30px; }
.ph-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt-group { padding: 12px; border-radius: 14px; background: var(--bg); margin-bottom: 10px; }
.opt-group .row { margin-bottom: 8px; }
.opt-group .in { background: #fff; height: 36px; }
.opt-choice { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; margin-bottom: 6px; }
.mini-btn { width: 32px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.mini-btn:hover { background: #fff; color: var(--red); }
.mini-btn svg { width: 16px; height: 16px; }
.linkbtn { color: var(--blue-d); font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn svg { width: 16px; height: 16px; }
.enh { display: flex; gap: 6px; }
.enh .chip { height: 30px; padding: 0 10px; font-size: 12px; }
/* import review */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 240px; border-radius: 18px; border: 1.5px dashed #cfd4da; background: #fafbfc; color: var(--muted); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); }
.drop svg { width: 40px; height: 40px; color: var(--blue); }
.drop b { color: var(--ink); font-weight: 600; font-size: 15px; }
.scan { position: relative; border-radius: 16px; overflow: hidden; max-height: 360px; }
.scan img { width: 100%; max-height: 360px; object-fit: contain; background: #111; }
.scan::after { content: ''; position: absolute; left: 0; right: 0; height: 80px; background: linear-gradient(180deg, transparent, rgba(0, 178, 236, .45), transparent); animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { from { top: -80px; } to { top: 100%; } }
.rv-cat { margin-bottom: 14px; }
.rv-cat > .in { font-weight: 600; background: transparent; padding-left: 0; height: 34px; }
.rv-item { display: grid; grid-template-columns: 22px 1fr 1fr 130px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rv-item .in { height: 34px; }
.rv-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.rv-opt { grid-column: 2 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }

/* ---------- report ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.5px; margin-top: 2px; }
.rgrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.bars .track { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; background: var(--blue); }
.bars .v { text-align: right; font-weight: 500; }
.hours { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 10px; }
.hours .h { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.hours .h i { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--blue); min-height: 2px; opacity: .85; }
.hours .h span { font-size: 10px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.tbl td.r, .tbl th.r { text-align: right; }

/* ---------- settings ---------- */
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.srow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow div { flex: 1; }
.srow small { display: block; color: var(--muted); font-size: 12px; }
.tlist .trow.staffrow { grid-template-columns: 1fr 1.6fr 90px auto; }
.tlist .trow { display: grid; grid-template-columns: 1fr 1fr 80px auto; gap: 8px; align-items: center; padding: 6px 0; }
.tlist .in { height: 36px; }
.qr-mini { width: 56px; height: 56px; border-radius: 10px; background: #fff; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); cursor: pointer; transition: transform .15s; }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch.pick { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); -webkit-appearance: none; appearance: none; overflow: hidden; }
.swatch.pick::-webkit-color-swatch-wrapper { padding: 0; opacity: 0; }
.logo-up { width: 72px; height: 72px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; overflow: hidden; cursor: pointer; color: var(--muted); }
.logo-up img { width: 100%; height: 100%; object-fit: contain; }
.logo-up svg { width: 24px; height: 24px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1000px 500px at 50% -10%, #e2f5fc, transparent), var(--bg); }
.login .box { width: min(360px, 100%); text-align: center; }
.login .box img { height: 20px; margin: 0 auto 26px; }
.login h1 { margin: 0; font-size: 20px; font-weight: 600; }
.login p { margin: 4px 0 22px; color: var(--muted); font-size: 13px; }
.dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; height: 14px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #c5cad1; transition: all .15s; }
.dots i.on { background: var(--ink); box-shadow: none; transform: scale(1.05); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keys button { height: 64px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-size: 22px; font-weight: 500; transition: transform .1s, background .1s; }
.keys button:active { transform: scale(.95); background: #f0f2f4; }
.keys button.fn { background: transparent; box-shadow: none; font-size: 13px; color: var(--muted); }
.keys button svg { width: 22px; height: 22px; margin: auto; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 13.5px; pointer-events: auto; animation: tin .35s cubic-bezier(.2, .9, .3, 1.2); max-width: 360px; }
.toast svg { width: 18px; height: 18px; color: var(--blue); }
.toast.amber svg { color: var(--amber); }
.toast.red svg { color: #ff8a80; }
.toast.out { animation: tout .3s forwards; }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } }
@keyframes tout { to { opacity: 0; transform: translateX(30px); } }

/* ---------- phone / tablet ---------- */
@media (max-width: 1100px) {
  .stats, .kpis { grid-template-columns: repeat(2, 1fr); }
  .rgrid, .sgrid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 12px 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .topbar img { height: 13px; }
  .topbar .shop { flex: 1; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar button { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); }
  .topbar button svg { width: 18px; height: 18px; }
  .topbar .langtop { width: auto; padding: 0 10px; gap: 5px; display: flex; align-items: center; font-size: 12px; font-weight: 600; }
  .topbar .langtop svg { width: 16px; height: 16px; }
  .page-head .langbtn { display: none; }
  main.main { padding: 16px 16px calc(var(--safe-b) + 110px); }
  .tabbar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 14px); z-index: 40; padding: 6px; border-radius: 22px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(16, 24, 40, .14); }
  .tabbar button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 54px; justify-content: center; border-radius: 16px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.on { color: var(--ink); background: var(--bg); }
  .tabbar button.on svg { color: var(--blue); }
  .tabbar .badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; }
  .page-head h1 { font-size: 20px; }
  .tgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .tcard { min-height: 118px; }
  .kcols { grid-template-columns: 1fr; }
  .mlayout { grid-template-columns: 1fr; }
  .cats { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 6px; }
  .cats .cat { width: auto; flex: none; }
  .cats .cat .tools { display: none !important; }
  .cats .addcat { width: auto; flex: none; }
  .mgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mcard.add { min-height: 180px; }
  .editor { grid-template-columns: 1fr; }
  .photo { max-width: 240px; }
  .drawer { width: 100vw; }
  .modal-wrap { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; transform: translateY(100%); }
  .modal.wide { width: 100%; }
  .modal.show { transform: none; }
  .mfoot { padding-bottom: calc(var(--safe-b) + 18px); }
  .rv-item { grid-template-columns: 22px 1fr 110px; }
  .rv-item .en { display: none; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  #toasts { left: 16px; right: 16px; top: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .bars .b { grid-template-columns: 90px 1fr 90px; }
}
@media (max-width: 520px) {
  .dfoot .lbl { display: none; }
  .dfoot .btn.lg { min-width: 0; }
}
@media (max-width: 420px) {
  .stats { gap: 8px; }
  .stat b { font-size: 17px; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .tlist .trow { grid-template-columns: 1fr 1fr 64px auto; }
}

/* 打印桌码：选样式 */
.tent-pick { --u: 1.62px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; }
.tent-pick .tp { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 6px 12px; border-radius: 18px; background: var(--bg); box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .18s, background .18s; }
.tent-pick .tp:hover { background: #eceef1; }
.tent-pick .tp.on { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.tent-pick .tp-card { border-radius: 4px; overflow: hidden; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 22px rgba(16, 24, 40, .1); transition: transform .2s; }
.tent-pick .tp.on .tp-card { transform: translateY(-2px); }
.tent-pick .tp span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tent-pick .tp.on span { color: var(--blue-d); }
.tent-opts { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; }
.tent-tip { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--amber-soft); color: #8a5a00; font-size: 13px; }
.tent-tip svg { width: 18px; height: 18px; flex: none; }
.tent-tip span { flex: 1; }
.tent-tip button { flex: none; height: 30px; padding: 0 12px; border-radius: 99px; background: #fff; font-size: 12.5px; font-weight: 600; color: #8a5a00; }
@media (max-width: 760px) {
  .tent-pick { --u: 1.3px; grid-template-columns: repeat(2, 1fr); }
  .tent-opts .seg { display: flex; width: 100%; }
  .tent-opts .seg button { flex: 1; padding: 0 8px; }
}

/* 菜品照片上的店铺 logo 角标（跟顾客页一样） */
.lmark { position: absolute; z-index: 1; width: var(--mk, 20%); aspect-ratio: 1; border-radius: 50%; background: #fff; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 3px 10px rgba(0, 0, 0, .14); }
.lmark.tr { top: 7%; right: 7%; }
.lmark.bl { left: 7%; bottom: 7%; }
.mcard .ph .lmark img, .photo .lmark img { position: static; display: block; width: 100%; height: 100%; object-fit: contain; filter: none; opacity: 1; }
.photo { --mk: 16%; }
.markpick { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.markpick .seg { display: flex; }
.markpick .seg button { flex: 1; height: 30px; padding: 0 6px; font-size: 12px; white-space: nowrap; }
.markpick small { color: #b9740c; }

/* 菜单库 */
.lib-wait { padding: 48px 0; text-align: center; color: var(--muted); }
.lib-top { position: sticky; top: -4px; z-index: 2; background: #fff; padding: 2px 0 12px; margin-bottom: 4px; }
.lib-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--bg); transition: box-shadow .15s, background .15s; }
.lib-search:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue); }
.lib-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.lib-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); }
.lib-cats { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; scrollbar-width: none; }
.lib-cats::-webkit-scrollbar { display: none; }
.lib-cats .chip { flex: none; height: 32px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px 12px; }
.lib-tile { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.lib-ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #f1f3f5, #e6e9ed); display: grid; place-items: center; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s, transform .15s; }
.lib-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib-none { color: #b3b9c2; display: grid; place-items: center; }
.lib-none svg { width: 34px; height: 34px; }
.lib-tile:hover .lib-ph { transform: translateY(-2px); }
.lib-tile.on .lib-ph { box-shadow: 0 0 0 2.5px var(--blue); }
.lib-ck { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .85); color: transparent; box-shadow: inset 0 0 0 1.5px rgba(11, 11, 12, .18); transition: all .15s; }
.lib-ck svg { width: 14px; height: 14px; }
.lib-tile.on .lib-ck { background: var(--blue); color: #fff; box-shadow: none; }
.lib-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; }
.lib-dots b { width: 16px; height: 16px; display: grid; place-items: center; cursor: pointer; }
.lib-dots b::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.lib-dots b.on::after { background: #fff; width: 9px; height: 9px; }
.lib-nm { margin-top: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lib-have { color: var(--green); }
.lib-own { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 6px; color: var(--muted); font-size: 13px; }
.lib-own p { margin: 0; }
.lib-count { font-size: 13px; color: var(--muted); align-self: center; }
.lib-rev { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.lib-row { display: grid; grid-template-columns: 52px 1fr 124px 200px 32px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lib-th { position: relative; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.lib-th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib-th .lib-none svg { width: 22px; height: 22px; }
.lib-rn { min-width: 0; }
.lib-rn b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-rn small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-price { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lib-price .in { height: 40px; text-align: right; }
.lib-row select.in { height: 40px; }

/* 空菜单引导 */
.lib-empty { padding: 40px 28px 32px; text-align: center; }
.lib-empty .le-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-d); }
.lib-empty .le-ic svg { width: 26px; height: 26px; }
.lib-empty h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.lib-empty p { margin: 8px auto 0; max-width: 440px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.le-btns { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.le-label { margin: 34px 0 12px; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.le-starters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; text-align: left; }
.le-tile { position: relative; min-width: 0; }
.le-add { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .16); transition: transform .15s; }
.le-add:active { transform: scale(.9); }
.le-add svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
  .lib-row { grid-template-columns: 48px 1fr 1fr 32px; grid-template-areas: 'th nm nm x' 'th pr cat cat'; row-gap: 8px; column-gap: 10px; }
  .lib-row .lib-th { grid-area: th; width: 48px; height: 48px; align-self: start; }
  .lib-row .lib-rn { grid-area: nm; }
  .lib-row .lib-price { grid-area: pr; }
  .lib-row select.in { grid-area: cat; min-width: 0; }
  .lib-row .mini-btn { grid-area: x; }
  .le-starters { grid-template-columns: repeat(3, 1fr); }
  .lib-empty { padding: 32px 18px 24px; }
}
