:root {
  --bg: #14161a; --bg2: #1c1f25; --card: #23272f; --card2: #2b303a; --line: #343a46;
  --text: #f1f3f6; --muted: #9aa3b2; --accent: #f59e0b; --accent-ink: #1a1203;
  --free: #22c55e; --busy: #f59e0b; --bill: #ef4444; --info: #38bdf8; --danger: #ef4444; --ok: #22c55e; --paid: #a855f7;
  --radius: 14px; --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 11px; }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; } .gap-s { gap: 6px; }
.stack > * + * { margin-top: 10px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--danger); }
.hidden { display: none !important; }

/* layout */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { padding: 14px 16px calc(var(--nav-h) + 90px + var(--safe-b)); max-width: 900px; margin: 0 auto; }
.nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--bg2); border-top: 1px solid var(--line); display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--accent); }
.nav .badge { position: absolute; margin: -18px 0 0 22px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 9px; padding: 1px 5px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 12px; background: var(--card2); font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); color: #04210f; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; }
.icon-btn { color: var(--text); flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; }
.fab { position: fixed; z-index: 9; right: 16px; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); }

/* cards */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border-radius: var(--radius); padding: 12px; }
.kpi .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.list > * { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--card2); color: var(--muted); }
.pill.ok { background: rgba(34,197,94,.15); color: var(--ok); }
.pill.warn { background: rgba(245,158,11,.15); color: var(--accent); }
.pill.bad { background: rgba(239,68,68,.15); color: var(--danger); }
.pill.info { background: rgba(56,189,248,.15); color: var(--info); }
.banner { text-decoration: none; border-radius: 12px; padding: 12px 14px; background: rgba(245,158,11,.12); color: var(--accent); display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.banner.bad { background: rgba(239,68,68,.12); color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* mesas */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 0 0 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 520px) { .tables { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 800px) { .tables { grid-template-columns: repeat(6, 1fr); } }
.tbl { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--card); border: 2px solid transparent; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; text-align: left; }
.tbl .n { font-size: 26px; font-weight: 800; line-height: 1; }
.tbl .meta { font-size: 11px; color: var(--muted); line-height: 1.3; }
.tbl .tot { font-size: 13px; font-weight: 700; }
.tbl.free { border-color: rgba(34,197,94,.35); }
.tbl.free .n { color: var(--free); }
.tbl.busy { border-color: var(--busy); background: rgba(245,158,11,.10); }
.tbl.bill { border-color: var(--bill); background: rgba(239,68,68,.12); }
.tbl .dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 3px rgba(56,189,248,.25); }
.seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--card2); color: var(--text); }

/* comanda */
.item { display: flex; gap: 10px; align-items: flex-start; }
.item .q { min-width: 34px; height: 28px; border-radius: 8px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.item.canceled { opacity: .45; } .item.canceled .nm { text-decoration: line-through; }
.item .nm { font-weight: 600; }
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.actionbar { position: fixed; z-index: 9; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); padding: 10px 16px; background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 8px; }
.actionbar .btn { flex: 1; }

/* sheet (modal de baixo) */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; background: var(--bg2); border-radius: 20px 20px 0 0; animation: up .2s ease-out; }
.sheet.full { height: 100vh; max-height: 100vh; border-radius: 0; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t) * var(--full, 0)) 16px 12px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-size: 17px; flex: 1; }
.sheet-b { padding: 14px 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-f { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet-f .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* lançamento de itens */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.prod { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prod .info { flex: 1; min-width: 0; }
.prod .nm { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; background: var(--card2); font-size: 20px; font-weight: 700; }
.stepper button.add { background: var(--accent); color: var(--accent-ink); }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.note-link { font-size: 12px; color: var(--info); padding: 2px 0; }

/* pagamento */
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.methods button { padding: 12px 4px; border-radius: 12px; background: var(--card); font-weight: 600; font-size: 13px; border: 2px solid transparent; }
.methods button.on { border-color: var(--accent); background: rgba(245,158,11,.12); }
.amount-in { font-size: 28px; font-weight: 800; text-align: center; padding: 14px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { flex: 1; min-width: 70px; padding: 9px 4px; border-radius: 9px; background: var(--card); font-size: 13px; font-weight: 600; }
.big-remaining { text-align: center; padding: 8px 0 4px; }
.big-remaining .v { font-size: 34px; font-weight: 800; }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px calc(24px + var(--safe-b)); max-width: 420px; margin: 0 auto; }
.brand-hero { background: #faf7ee; border-radius: 22px; padding: 18px 16px 16px; text-align: center; margin-bottom: 22px; }
.brand-hero img { mix-blend-mode: multiply; width: 62%; max-width: 230px; display: block; margin: 0 auto 6px; }
.brand-hero .kicker { color: #5b3a1e; letter-spacing: .25em; text-transform: uppercase; font-size: 13px; font-weight: 600; }
.brand-hero .bname { color: #1a7fd0; font-size: 26px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; margin-top: 2px; }
.top-logo { width: 40px; height: 40px; border-radius: 10px; flex: none; object-fit: cover; }
.users { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.users button { background: var(--card); border-radius: var(--radius); padding: 16px 10px; text-align: center; }
.users button .av { width: 44px; height: 44px; border-radius: 50%; background: var(--card2); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: var(--accent); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 22px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 62px; border-radius: 16px; background: var(--card); font-size: 24px; font-weight: 600; }

/* cozinha */
.kds { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .kds { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .kds { grid-template-columns: repeat(3, 1fr); } }
.kds .card { margin: 0; border-left: 4px solid var(--busy); }
.kds .card.late { border-left-color: var(--danger); }

/* barras de relatório */
.bar { height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: 8px; }
.hours div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.hours-l { display: flex; gap: 3px; font-size: 9px; color: var(--muted); }
.hours-l span { flex: 1; text-align: center; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t td, table.t th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.t td.r, table.t th.r { text-align: right; }

/* toast */
#toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--nav-h) + 80px + var(--safe-b)); transform: translateX(-50%); pointer-events: none; }
#toast div { background: #f1f3f6; color: #111; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.4); animation: up .2s; max-width: 88vw; text-align: center; }
#toast div.err { background: var(--danger); color: #fff; }

/* impressão (cupom 80mm) */
#print-area { display: none; }
@media print {
  @page { margin: 4mm; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; background: #fff; font: 12px/1.35 "Courier New", monospace; width: 72mm; }
  #print-area h2 { font-size: 15px; text-align: center; margin: 0 0 4px; }
  #print-area .c { text-align: center; }
  #print-area hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #print-area .l { display: flex; justify-content: space-between; gap: 6px; }
  #print-area .b { font-weight: bold; font-size: 14px; }
  html, body { background: #fff; }
}

/* área de gestão (computador) */
body.g-mode { --bg: #f4f5f7; --bg2: #ffffff; --card: #ffffff; --card2: #eceef2; --line: #dfe2e8; --text: #1d2129; --muted: #6a7282; --accent: #e8590c; --accent-ink: #fff; --busy: #e8890c; }
.g-wrap { display: flex; min-height: 100vh; }
.g-side { width: 190px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 12px 8px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.g-side a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; margin-bottom: 2px; }
.g-side a:hover { background: var(--card2); }
.g-side a.on { background: var(--accent); color: #fff; font-weight: 600; }
.g-brand { font-weight: 800; padding: 6px 12px 14px; line-height: 1.2; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-top { display: flex; align-items: center; gap: 12px; background: #fff; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.g-top h1 { font-size: 18px; flex: 1; }
.g-user { font-size: 13px; color: var(--muted); }
.g-tabs { display: flex; gap: 2px; background: #4a4f58; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.g-tabs a { color: #d5d8de; text-decoration: none; padding: 10px 12px; font-size: 13px; white-space: nowrap; }
.g-tabs a.on { background: #33373e; color: #fff; font-weight: 700; }
.g-body { padding: 16px 18px 40px; flex: 1; min-width: 0; }
.g-body input, .g-body select, .g-body textarea, body.g-mode .sheet input, body.g-mode .sheet select, body.g-mode .sheet textarea { padding: 8px 10px; border-radius: 8px; background: #fff; }
.g-body label { margin: 10px 0 4px; }
.g-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.g-left { min-width: 0; }
.g-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow: hidden; }
.g-ph { background: #fbe08a; padding: 10px 14px; font-weight: 700; color: #3d3206; }
.g-pb { padding: 12px 14px; overflow-y: auto; flex: 1; }
.g-pf { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.g-pf .btn { min-height: 38px; flex: 1; }
.g-hint { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.g-bar, .g-filters, .g-period, .g-rooms { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.g-filters select, .g-period input { width: auto; }
.g-search { max-width: 280px; }
.g-check { display: flex !important; align-items: center; gap: 6px; color: var(--text) !important; margin: 8px 0 !important; font-size: 13px !important; }
.g-check input { width: auto; }
.g-period .chip, .g-rooms .chip, .g-bar .chip { background: var(--card2); color: var(--text); }
.g-period .chip.on, .g-rooms .chip.on, .g-bar .chip.on { background: var(--accent); color: #fff; }
.g-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.g-kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.g-kpi .l { font-size: 12px; color: var(--muted); }
.g-kpi .v { font-size: 18px; font-weight: 700; margin-top: 4px; white-space: normal; }
.g-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.g-sec { font-size: 14px; margin: 16px 0 8px; }
.g-tw { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.g-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-t th { background: #eef0f3; color: #4a4f58; text-align: left; font-weight: 600; padding: 9px 12px; white-space: nowrap; }
.g-t td { padding: 9px 12px; border-top: 1px solid var(--line); }
.g-t .r { text-align: right; }
.g-t tr.click { cursor: pointer; }
.g-t tr.click:hover td { background: #fafafb; }
.g-t tr.sel td { background: #fdeeb4; }
.g-t tr.strong td { font-weight: 700; background: #f7f8fa; }
.g-none { text-align: center; color: var(--muted); padding: 22px 10px !important; font-size: 13px; }
.g-star { color: #c9ccd3; font-size: 16px; }
.g-star.on { color: var(--accent); }
.g-count { width: 110px !important; }
.g-chart { width: 100%; height: auto; color: var(--muted); display: block; }
.g-floor { display: flex; flex-wrap: wrap; gap: 14px; }
.g-tbl { width: 76px; height: 76px; border-radius: 10px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.g-tbl.round { border-radius: 50%; }
.g-tbl small { font-size: 10px; font-weight: 600; }
.g-tbl.free { background: #3fb873; } .g-tbl.busy { background: #e8890c; } .g-tbl.bill { background: #dc3c3c; }
.g-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.g-tile { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.g-tile small { color: var(--muted); }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
body.g-mode .btn { min-height: 38px; }
body.g-mode .btn.sm { min-height: 32px; }
body.g-mode #toast { bottom: 24px; }
body.g-mode .banner { background: #fff4d6; color: #7a5a00; }
@media (max-width: 1000px) {
  .g-wrap { flex-direction: column; }
  .g-side { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .g-side a { white-space: nowrap; margin: 0 2px 0 0; }
  .g-brand { display: none; }
  .g-split { grid-template-columns: minmax(0, 1fr); }
  .g-panel { position: static; max-height: none; }
  .g-body { padding: 12px; }
  .g-search { max-width: none; }
}
@media print { .g-wrap { display: none; } }
/* cara de site no computador */
@media (min-width: 1000px) {
  body.g-mode { font-family: Arial, "Segoe UI", sans-serif; font-size: 13px; }
  body.g-mode .sheet-bg { align-items: center; }
  body.g-mode .sheet { border-radius: 8px; max-width: 620px; }
  body.g-mode .sheet.full { height: 86vh; max-height: 86vh; border-radius: 8px; max-width: 760px; }
  body.g-mode .sheet-h { background: #4a4a4a; color: #fff; border-radius: 8px 8px 0 0; padding: 14px 16px; }
  body.g-mode .sheet-h h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .02em; }
  body.g-mode .sheet-h .icon-btn { background: none; color: #fff; }
  body.g-mode .login { min-height: 100vh; }
  body.g-mode .users button { border: 1px solid var(--line); }
  body.g-mode .keypad button { background: #eceef2; }
  .g-side { width: 165px; padding: 0; display: flex; flex-direction: column; }
  .g-brand { display: flex; align-items: center; gap: 8px; padding: 10px; height: 60px; font-size: 12px; border-bottom: 1px solid var(--line); }
  .g-brand img { width: 34px; height: 34px; border-radius: 6px; }
  .g-links { flex: 1; overflow-y: auto; padding: 8px 6px; }
  .g-bottom { padding: 8px 6px; border-top: 1px solid var(--line); }
  .g-side a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; font-size: 13px; border-radius: 7px; margin-bottom: 3px; color: #2b2f36; }
  .g-side a svg { width: 18px; height: 18px; flex: none; }
  .g-side a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-side a.on { background: #ff5a2b; color: #fff; }
  .g-top { height: 60px; padding: 0 12px; flex: none; }
  .g-top h1 { font-size: 16px; }
  .g-clock { display: flex; align-items: center; gap: 6px; color: #555; }
  .g-clock small { font-size: 9px; line-height: 1.1; text-transform: uppercase; text-align: right; }
  .g-clock b { font-size: 24px; font-weight: 400; }
  .g-userbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 10px; text-align: left; }
  .g-userbox svg { width: 20px; height: 20px; }
  .g-userbox b, .g-userbox small { display: block; font-size: 11px; line-height: 1.2; }
  .g-userbox small { color: var(--muted); }
  .g-tabs { background: #5c5c5c; padding: 0 8px; flex: none; }
  .g-tabs a { color: #e4e4e4; padding: 11px 12px; font-size: 12px; }
  .g-tabs a.on { background: #474747; font-weight: 700; }
  .g-band { display: flex; align-items: center; gap: 10px; background: #5c5c5c; color: #fff; padding: 8px 14px; min-height: 46px; flex: none; }
  .g-band b { font-size: 15px; }
  .g-band .icon-btn { background: #474747; color: #fff; width: 34px; height: 34px; }
  .g-band-in { margin: -16px -18px 16px; }
  .g-dark { background: #3b3b3b !important; color: #fff !important; text-decoration: none; }
  .g-main { height: 100vh; overflow: hidden; }
  .g-body { overflow-y: auto; background: #f7f7f7; }
  .g-body.g-flush { padding: 0; overflow: hidden; }
  .g-vert, .g-prodcols { display: flex; flex: 1; min-height: 0; }
  .g-prodcols { height: 100%; }
  .g-vtabs { width: 170px; flex: none; background: #5c5c5c; color: #fff; overflow-y: auto; padding-bottom: 20px; }
  .g-vtabs h2 { font-size: 14px; padding: 16px 14px 10px; text-transform: uppercase; }
  .g-vtabs a { display: block; color: #f0f0f0; text-decoration: none; padding: 9px 14px; font-size: 13px; }
  .g-vtabs a:hover { background: #686868; }
  .g-vtabs a.on { background: #ff5a2b; color: #fff; }
  .g-vert .g-body, .g-prodcols .g-body { flex: 1; min-width: 0; }
  .g-split { grid-template-columns: minmax(0, 1fr) 300px; }
  .g-panel { border-radius: 6px; top: 0; max-height: calc(100vh - 140px); }
  .g-ph { background: #fbdf8c; padding: 11px 14px; }
  .g-rest { height: 100%; gap: 0; align-items: stretch; }
  .g-rest > .g-left { overflow-y: auto; }
  .g-rest > .g-panel { border-radius: 0; border-width: 0 0 0 1px; max-height: none; height: 100%; background: #efefef; }
  .g-roomtabs { background: #5c5c5c; padding: 8px 14px 0; display: flex; }
  .g-roomtabs button { background: #6a6a6a; color: #eee; padding: 9px 22px; border-radius: 5px 5px 0 0; margin-right: 4px; font-weight: 600; font-size: 12px; }
  .g-roomtabs button.on { background: #fff; color: #222; }
  .g-floor { display: grid; grid-template-columns: repeat(auto-fill, 66px); gap: 18px; padding: 22px; }
  .g-tbl { width: 66px; height: 66px; border-radius: 6px; color: #fff; font-size: 24px; border: 2px solid rgba(0,0,0,.05); box-shadow: 0 3px 5px rgba(0,0,0,.22); }
  .g-tbl b { font-weight: 700; }
  .g-tbl small { font-size: 9px; }
  .g-tbl.free { background: #6fdc9c; } .g-tbl.busy { background: #f6a63c; } .g-tbl.bill { background: #ef6b6b; }
  .g-tbl.sel { outline: 3px solid #333; }
  .g-leg { padding: 0 22px; }
  .g-alert { display: flex; gap: 10px; justify-content: space-between; align-items: center; background: #e9eefb; margin: 10px; padding: 12px; border-radius: 8px; color: #24304f; }
  .g-alert a { font-weight: 700; color: #1b2b63; white-space: nowrap; }
  .g-t th { background: #efefef; color: #777; font-size: 12px; font-weight: 400; }
  .g-t td { font-size: 13px; }
  .g-tw, .g-card, .g-kpi { border-radius: 6px; }
  .g-kpi { background: #fff; }
  .g-kpi .l { font-size: 11px; }
  body.g-mode .btn { border-radius: 5px; font-size: 12px; font-weight: 600; padding: 0 12px; }
  body.g-mode .btn.primary { background: #ff5a1f; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
  body.g-mode .btn.ok { background: #d9480f; color: #fff; }
  body.g-mode .btn.ghost { background: #fff; border: 1px solid #1b2b63; color: #1b2b63; }
  body.g-mode .btn:not(.primary):not(.ghost):not(.danger):not(.ok):not(.g-dark) { background: #fff; border: 1px solid #c9ccd3; color: #333; }
  body.g-mode .btn.danger { background: #fdeeea; border: 0; color: #d9480f; }
  .g-page .actionbar { position: static; background: none; padding: 12px 0 0; }
  .g-page .fab { position: static; display: inline-flex; margin-top: 12px; }
  .g-page .card { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
  .g-page { padding-bottom: 30px; }
  .g-page .tables { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

body.g-mode .methods button, body.g-mode .quick button, body.g-mode .chip { border: 1px solid #c9ccd3; }
body.g-mode .methods button.on { border: 2px solid #ff5a1f; }

.g-qrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.g-qrcell { border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: #fff; }
.g-qrcell.on { border-color: #6fdc9c; background: #f2fbf5; }

/* ícones do menu também na tela estreita */
.g-side a svg { width: 18px; height: 18px; flex: none; }
.g-side a { display: flex; align-items: center; gap: 8px; }
.g-brand img { width: 30px; height: 30px; border-radius: 6px; }
.g-userbox svg { width: 20px; height: 20px; }

@media (min-width: 1000px) {
  .g-tbl.busy { background: #ef6b6b; } .g-tbl.bill { background: #4f8ff0; }
}
details.g-card summary { cursor: pointer; }

/* app de celular: ambientes, lista de mesas, comandas da mesa e tela Pedidos */
.chips { margin-bottom: 10px; }
.chips > button, .chips > a { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.chips > .on { background: var(--accent); color: var(--accent-ink); }
.chips > #new-tab { background: transparent; border: 1px dashed var(--accent); color: var(--accent); }
.seg.mini { margin: 0; flex: none; }
.seg.mini button { flex: none; padding: 6px 14px; }
.tlist { padding: 0; }
.trow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; color: inherit; }
.trow:last-child { border-bottom: 0; }
.tnum { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--bg2); border: 2px solid var(--line); }
.tnum.free { color: var(--free); border-color: rgba(34,197,94,.35); }
.tnum.busy { color: var(--busy); border-color: var(--busy); }
.tnum.bill { color: var(--bill); border-color: var(--bill); }
.fab-row { position: fixed; z-index: 9; right: 16px; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); display: flex; gap: 8px; }
.fab-row .btn.ghost { background: var(--bg2); }
.nav a { font-size: 10.5px; min-width: 0; }
/* Gestão no celular: menu numa faixa rolável e botão de volta ao app */
@media (max-width: 1000px) {
  .g-side { align-items: center; gap: 4px; }
  .g-links, .g-bottom { display: flex; gap: 2px; }
  .g-side a svg { display: none; }
  .g-toapp { background: var(--accent) !important; color: #fff !important; font-weight: 700; }
  .g-top { flex-wrap: wrap; padding: 8px 12px; }
  .g-clock { display: none; }
  .g-userbox span small { display: none; }
}

/* celular no jeito do app de garçom: menu lateral, mesa em duas colunas e botões de cobrança */
body.drawer-mode:not(.g-mode) { --nav-h: 0px; }
#menu-btn { font-size: 22px; }
.drawer-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(80vw, 300px); background: var(--bg2); overflow-y: auto; transform: translateX(-100%); transition: transform .2s; padding: calc(12px + var(--safe-t)) 0 calc(12px + var(--safe-b)); }
.drawer-bg.open .drawer { transform: none; }
.drawer-h { display: flex; gap: 10px; align-items: center; padding: 6px 16px 14px; border-bottom: 1px solid var(--line); }
.drawer-h img { width: 40px; height: 40px; border-radius: 10px; }
.drawer-s { padding: 14px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.drawer a { display: block; padding: 12px 22px; color: var(--text); text-decoration: none; font-size: 15px; }
.drawer a.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.page.split { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0; padding: 0; max-width: none; }
.tcol { position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto; background: var(--bg2); padding: 8px 6px 120px; display: flex; flex-direction: column; gap: 6px; }
.tc { position: relative; display: grid; place-items: center; height: 44px; border-radius: 10px; font-weight: 800; font-size: 17px; text-decoration: none; border: 2px solid var(--line); background: var(--card); flex: none; }
.tc.free { color: var(--free); border-color: rgba(34,197,94,.35); }
.tc.busy { color: #fff; background: var(--busy); border-color: var(--busy); }
.tc.bill { color: #fff; background: var(--bill); border-color: var(--bill); }
.tc.on { outline: 3px solid var(--text); outline-offset: 1px; }
.tc i { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--info); }
.scol { padding: 0 12px 120px; min-width: 0; }
.thead { margin: 0 -12px 12px; padding: 16px; text-align: center; color: #fff; }
.thead b { display: block; font-size: 26px; }
.thead span { font-weight: 600; }
.thead.busy { background: var(--busy); } .thead.bill { background: var(--bill); } .thead.free { background: var(--free); color: #04210f; }
.ppl-btn { justify-content: flex-start; margin-bottom: 10px; }
.pend { background: rgba(245,158,11,.14); border: 1px solid var(--busy); }
.pend h3 { color: var(--busy); }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 10px; }
.tools .btn { font-size: 20px; font-weight: 800; color: var(--accent); }
.tools .btn svg { width: 22px; height: 22px; }
.btn.outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); margin-bottom: 8px; }
.btn.soft { background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.fab-round { position: fixed; z-index: 9; right: 16px; bottom: calc(16px + var(--safe-b)); width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 32px; font-weight: 400; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.qty-big { display: flex; align-items: center; justify-content: space-around; padding: 20px 0; }
.qty-big button { font-size: 34px; width: 64px; height: 64px; border-radius: 50%; background: var(--card2); }
.qty-big b { font-size: 40px; }
.prod[data-pc] { cursor: pointer; }
.icon-btn.sm { width: 30px; height: 30px; } .icon-btn.sm svg { width: 16px; height: 16px; }
.dotc { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); }
.dotc.on { border-color: var(--text); }
.seg a.on { background: var(--card2); }

/* menu recolhível: só ícones fechado, com nomes aberto (celular) */
body.drawer-mode:not(.g-mode) #app { padding-left: 56px; }
.drawer-bg { opacity: 1; pointer-events: none; background: transparent; }
.drawer-bg.open { pointer-events: auto; background: rgba(0,0,0,.5); }
.drawer { transform: none; width: 56px; pointer-events: auto; border-right: 1px solid var(--line); transition: width .2s; overflow-x: hidden; }
.drawer-bg.open .drawer { width: min(80vw, 300px); }
.drawer a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; white-space: nowrap; }
.drawer a svg { width: 22px; height: 22px; flex: none; }
.drawer-bg:not(.open) .drawer a span, .drawer-bg:not(.open) .drawer-s, .drawer-bg:not(.open) .drawer-h div { display: none; }
.drawer-bg:not(.open) .drawer-h { padding: 6px 8px 12px; justify-content: center; }
.drawer-bg:not(.open) .drawer-s + a { margin-top: 10px; }
.drawer-h img { flex: none; }
.tcol { top: 58px; }
/* Gestão no computador: menu lateral recolhível */
.g-collapse { display: none; }
@media (min-width: 1000px) {
  .g-collapse { display: block; width: 100%; padding: 10px; font-size: 18px; text-align: left; padding-left: 16px; }
  body.g-collapsed .g-side { width: 56px; }
  body.g-collapsed .g-side a span, body.g-collapsed .g-brand span { display: none; }
  body.g-collapsed .g-side a { justify-content: center; padding: 9px 0; }
  body.g-collapsed .g-brand { justify-content: center; padding: 10px 0; }
}
/* o menu lateral também na Gestão do celular; janelas (sheets) ficam por cima do menu */
@media (max-width: 1000px) {
  body.g-mode.drawer-mode #app { padding-left: 56px; }
  body.g-mode.drawer-mode .g-side { display: none; }
}
.sheet-bg { z-index: 45; }
#toast { z-index: 60; }
/* mesa paga pelo garçom, esperando o caixa dar baixa */
.tc.paid, .thead.paid { color: #fff; background: var(--paid); border-color: var(--paid); }
.tbl.paid { border-color: var(--paid); background: rgba(168,85,247,.14); } .tbl.paid .n { color: var(--paid); }
.tnum.paid { color: var(--paid); border-color: var(--paid); }
.g-tbl.paid, .g-map .paid { background: #a855f7 !important; }
