/* Restaurante POS — estilos. Pensado para tablet y computadora táctil. */
:root {
  --bg: #f4f2ef; --card: #fff; --ink: #1c1917; --muted: #78716c; --line: #e7e5e4; --soft: #f5f5f4;
  --pri: #c2410c; --pri-2: color-mix(in srgb, var(--pri) 78%, #000); --pri-soft: color-mix(in srgb, var(--pri) 55%, #fff); --ok: #15803d; --warn: #b45309; --bad: #dc2626; --info: #1d4ed8; --violet: #7c3aed;
  --nav: #1c1917; --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h3 { font-size: 15px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
a { color: var(--pri); }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.muted { color: var(--muted); } .sm { font-size: 13px; } .grow { flex: 1; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.bad { color: var(--bad); } .good { color: var(--ok); }
.loading { padding: 40px; text-align: center; color: var(--muted); } .loading.full { margin-top: 30vh; }
.empty { padding: 28px; text-align: center; color: var(--muted); } .empty.sm { padding: 12px; font-size: 13px; }

/* ---------- botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; min-height: 44px; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--soft); color: var(--ink); transition: filter .15s, transform .05s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--pri); color: #fff; } .btn.primary:hover { background: var(--pri-2); }
.btn.ghost { background: #fff; border-color: var(--line); } .btn.ghost:hover { background: var(--soft); }
.btn.danger { background: #fff; color: var(--bad); border-color: #fecaca; } .btn.danger:hover { background: #fef2f2; }
.btn.pay { background: var(--ok); color: #fff; } .btn.kitchen { background: #0f766e; color: #fff; }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; } .btn.big { min-height: 54px; font-size: 17px; width: 100%; }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: var(--soft); }
.link { background: none; border: 0; color: var(--pri); cursor: pointer; padding: 0; font-weight: 600; text-decoration: none; font-size: 13px; }
.link.danger { color: var(--bad); }
input, select, textarea { width: 100%; border: 1px solid #d6d3d1; border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri-soft); border-color: var(--pri); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--pri); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid-form .full, .fld.full, .chk.full { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span { font-size: 13px; font-weight: 600; color: #44403c; }
.fld small { color: var(--muted); font-size: 12px; }
.chk { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.actions.full { grid-column: 1 / -1; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: #57534e; white-space: nowrap; }
.pill.ok { background: #dcfce7; color: var(--ok); } .pill.warn { background: #fef3c7; color: var(--warn); }
.pill.bad { background: #fee2e2; color: var(--bad); } .pill.info { background: #dbeafe; color: var(--info); }
.pill.st-pendiente { background: #fef3c7; color: var(--warn); } .pill.st-confirmada { background: #dbeafe; color: var(--info); }
.pill.st-sentada { background: #dcfce7; color: var(--ok); } .pill.st-no_show, .pill.st-cancelada { background: #fee2e2; color: var(--bad); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input { width: 110px; min-height: 40px; border-radius: 999px; }

/* ---------- estructura */
.app { display: flex; height: 100vh; height: 100dvh; }
.nav { width: 220px; background: var(--nav); color: #e7e5e4; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid #292524; }
.brand b { display: block; color: #fff; font-size: 15px; line-height: 1.2; } .brand small { color: #a8a29e; font-size: 12px; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--pri); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.logo.big { width: 64px; height: 64px; font-size: 32px; margin: 0 auto 12px; border-radius: 16px; }
.logo.img { background: #fff; overflow: hidden; } .logo.img img { width: 100%; height: 100%; object-fit: contain; }
/* Con logo propio (cuadrado o horizontal) el logo va arriba, a todo lo ancho. */
.brand:has(.logo.img) { flex-direction: column; align-items: stretch; gap: 10px; }
.brand .logo.img { width: 100%; height: 72px; background: transparent; border-radius: 0; }
.login-card .logo.img { width: 100%; height: 110px; background: transparent; border-radius: 0; }
.logo-row { display: flex; gap: 16px; align-items: center; } .logo-row .logo.big { margin: 0; flex-shrink: 0; width: 88px; height: 88px; border: 1px solid var(--line); }
.logo-row .logo.img.big { width: 180px; }
.logo-row .btn { margin: 6px 6px 0 0; }
.nav nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav nav a { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; color: #d6d3d1; text-decoration: none; font-weight: 600; margin-bottom: 2px; }
.nav nav a:hover { background: #292524; } .nav nav a.active { background: var(--pri); color: #fff; }
.nav .ico { width: 22px; text-align: center; font-size: 17px; }
.me { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-top: 1px solid #292524; }
.me div { flex: 1; min-width: 0; } .me b { display: block; color: #fff; font-size: 14px; } .me small { color: #a8a29e; font-size: 12px; }
.me .btn { background: #292524; border-color: #44403c; color: #e7e5e4; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); min-height: 60px; }
.top h1 { font-size: 19px; flex: 1; } .top-right { display: flex; gap: 12px; align-items: center; color: var(--muted); font-weight: 600; }
.menu-btn { display: none; }
.view { flex: 1; overflow-y: auto; padding: 20px; }
.view-pedido { padding: 0; overflow: hidden; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { max-width: 260px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 16px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.on { color: var(--pri); border-color: var(--pri); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi b { display: block; font-size: 24px; margin-top: 4px; font-variant-numeric: tabular-nums; } .kpi span { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin: 0; }
.list { list-style: none; padding: 0; margin: 0 0 10px; } .list li { padding: 8px 0; border-bottom: 1px solid var(--soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list.sm li { padding: 4px 0; font-size: 13px; }
.list.plain li { display: block; }

/* ---------- tablas y gráficas */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 13px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
table.data tr:hover td { background: #fafaf9; } table.data .num { text-align: right; }
table.data tr.low td { background: #fef2f2; }
table.data tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.row-actions { white-space: nowrap; text-align: right; } .row-actions .btn { margin-left: 4px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 10px; }
.bar span { width: 100%; background: linear-gradient(180deg, var(--pri-soft), var(--pri)); border-radius: 5px 5px 0 0; }
.bar small { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--pri-soft), var(--pri)); }
.hbar b { font-variant-numeric: tabular-nums; }
.statement { width: 100%; border-collapse: collapse; } .statement td { padding: 8px 4px; border-bottom: 1px solid var(--soft); }
.statement td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement .sub td { padding-left: 22px; color: #57534e; } .statement .tot td { font-weight: 800; border-top: 2px solid var(--ink); }
.statement .big td { font-size: 18px; font-weight: 800; }
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.range input { width: 150px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #44403c, #1c1917); padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 28px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card h2 { font-size: 20px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; min-height: 16px; }
.pin-dots span { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #a8a29e; }
.pin-dots span.on { background: var(--pri); border-color: var(--pri); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); font-size: 24px; font-weight: 700; cursor: pointer; }
.pinpad button:active { background: #e7e5e4; } .pinpad button[data-k="✓"] { background: var(--pri); color: #fff; }
.err { color: var(--bad); min-height: 20px; font-weight: 600; margin: 12px 0 0; }

/* ---------- mesas */
.legend { display: flex; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: -6px; }
.floor-layout { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
.floor-wrap { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: auto; min-height: 480px; }
.floor { position: relative; min-width: 700px; min-height: 560px; background-image: radial-gradient(#e7e5e4 1px, transparent 1px); background-size: 20px 20px; }
.floor.editing { background-color: #fffbeb; }
.mesa { position: absolute; width: 130px; height: 110px; border-radius: 14px; border: 0; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.15); touch-action: none; user-select: none; }
.mesa.round { border-radius: 50%; width: 120px; height: 120px; }
.mesa b { font-size: 20px; } .mesa span { font-weight: 700; } .mesa small { font-size: 11px; opacity: .92; text-align: center; line-height: 1.2; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor.editing .mesa { outline: 2px dashed #92400e; cursor: move; }
.st-libre { background: #16a34a; } .st-ocupada { background: #ea580c; } .st-cuenta { background: #7c3aed; } .st-reservada { background: #2563eb; }
.badge { position: absolute; top: -8px; right: -6px; background: #facc15; color: #422006; font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.badge.alt { top: auto; bottom: -8px; background: #fff; color: var(--bad); }
.side h3 { margin-bottom: 10px; }
.order-chip { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; position: relative; }
.order-chip b { display: block; } .order-chip span { color: var(--muted); font-size: 13px; }
.numgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.numgrid .btn { font-size: 20px; min-height: 56px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }

/* ---------- pedido (POS) */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100%; }
.pos-menu { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 14px; gap: 10px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; flex-shrink: 0; }
.cats button { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; background: #fff; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); border-left: 5px solid var(--c, var(--pri)); min-height: 44px; }
.cats button.on { background: var(--c, var(--pri)); color: #fff; }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; overflow-y: auto; align-content: start; padding: 2px; }
.prod { border: 0; background: #fff; border-radius: 12px; padding: 12px; min-height: 92px; text-align: left; cursor: pointer; box-shadow: var(--shadow); border-top: 5px solid var(--c, var(--pri)); display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.prod:active { transform: scale(.97); } .prod b { font-size: 14px; line-height: 1.25; } .prod span { color: var(--pri); font-weight: 800; }
.prod.off { opacity: .45; } .prod.off span { color: var(--bad); }
.pos-ticket { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.t-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.t-head > div { flex: 1; min-width: 0; } .t-head h2 { font-size: 18px; } .t-head small { color: var(--muted); font-size: 12px; }
.t-note { background: #fffbeb; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.t-items { flex: 1; overflow-y: auto; padding: 6px 0; }
.t-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 14px; border-bottom: 1px solid var(--soft); }
.t-item .t-main b { font-size: 14px; } .t-item small { display: block; color: var(--muted); font-size: 12px; }
.t-item .pill { margin-top: 3px; font-size: 11px; } .t-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.t-item.anulado .t-main b, .t-item.anulado .t-price { text-decoration: line-through; color: var(--muted); }
.t-ctrl { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.t-ctrl button { width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; font-weight: 700; }
.t-totals { padding: 12px 14px 10px; border-top: 2px dashed #d6d3d1; background: #fafaf9; font-size: 14px; }
.t-totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.t-totals .grand { font-size: 24px; font-weight: 800; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); letter-spacing: -.01em; } .t-totals .disc { color: var(--ok); }
.t-totals .due { color: var(--bad); font-weight: 800; } .t-totals b { font-variant-numeric: tabular-nums; }
.t-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.t-actions #send, .t-actions #pay { grid-column: 1 / -1; }
.t-actions #pay { min-height: 56px; font-size: 18px; }
.menu-list { display: grid; gap: 8px; } .menu-list .btn { justify-content: flex-start; }

/* ---------- cobro */
.pay { display: grid; gap: 14px; }
.pay-sum { background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.pay-sum > div { display: flex; justify-content: space-between; padding: 2px 0; } .pay-sum .due { font-size: 20px; font-weight: 800; color: var(--bad); }
.split { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .split input { width: 80px; }
.change { font-size: 18px; } .change b { font-size: 24px; color: var(--ok); } .change b.bad { color: var(--bad); }
.pay-total { display: flex; justify-content: space-between; align-items: center; font-size: 15px; } .pay-total b { font-size: 22px; }
.done { text-align: center; } .big-change { font-size: 46px; font-weight: 800; color: var(--ok); margin: 6px 0 16px; }

/* ---------- cocina */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.kcard { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border-top: 6px solid #0f766e; }
.kcard.warn { border-color: #f59e0b; } .kcard.late { border-color: var(--bad); } .kcard.done { border-color: var(--ok); opacity: .75; }
.kcard header { display: flex; justify-content: space-between; padding: 10px 12px 0; font-size: 16px; }
.kcard.late header span { color: var(--bad); font-weight: 800; } .kcard > small { padding: 0 12px; color: var(--muted); }
.kcard ul { list-style: none; margin: 8px 0; padding: 0; }
.kcard li { padding: 10px 12px; border-top: 1px solid var(--soft); cursor: pointer; font-size: 16px; }
.kcard li em { display: block; color: var(--bad); font-style: normal; font-size: 13px; font-weight: 700; }
.kcard li.listo { text-decoration: line-through; color: var(--muted); background: #f0fdf4; }
.kcard footer { padding: 0 12px 12px; } .kcard footer .btn { width: 100%; }

/* ---------- modales y avisos */
.modal-bg { position: fixed; inset: 0; background: rgba(28,25,23,.55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { max-width: 720px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; overflow-y: auto; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 99; width: max-content; max-width: 92vw; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: fade .15s; }
.toast.err { background: var(--bad); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.ie-report { overflow-x: auto; }
.copybox { display: flex; gap: 8px; } .copybox textarea, .copybox input { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.recipe-row { display: grid; grid-template-columns: 1fr 110px 90px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d6d3d1; border-radius: 26px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--ok); } .switch input:checked + span::before { transform: translateX(20px); }
.center-card { max-width: 440px; margin: 20px auto; text-align: center; }
.center-card .grid-form { text-align: left; margin-top: 16px; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.denoms label { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 6px; font-weight: 700; }
.diff { font-size: 26px; font-weight: 800; }

/* ---------- instalador */
.install { padding: 24px 16px; } .install-card { max-width: 720px; margin: 0 auto; } .install-card h1 { margin-bottom: 16px; }
.install h3 { margin: 10px 0 0; } .ok-box, .err-box { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.ok-box { background: #dcfce7; color: var(--ok); } .err-box { background: #fee2e2; color: var(--bad); }

/* ---------- responsivo */
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 340px; } .floor-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .nav { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.3); } .menu-btn { display: inline-block; }
  .view { padding: 14px; } .top { padding: 8px 12px; } #clock { display: none; }
  .view-pedido { overflow-y: auto; } .pos { grid-template-columns: 1fr; height: auto; }
  .pos-menu { max-height: 55vh; } .pos-ticket { border-left: 0; border-top: 1px solid var(--line); }
  .t-items { overflow: visible; }
}
@media (max-width: 560px) {
  .grid-form { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; }
  .prods { grid-template-columns: repeat(2, 1fr); } .kpi b { font-size: 20px; }
  .recipe-row { grid-template-columns: 1fr 80px 40px; } .recipe-row .rcost { display: none; }
  .toolbar .search { max-width: none; }
}
/* ---------- primeros pasos */
.setup { max-width: 860px; }
.setup-head { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.setup-head h2 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 4px; }
.setup-ring { --p: 0; flex-shrink: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; grid-auto-flow: column; align-items: baseline; align-content: center;
  background: radial-gradient(closest-side, var(--bg) 78%, transparent 80% 100%), conic-gradient(var(--pri) calc(var(--p) * 1%), var(--line) 0); }
.setup-ring b { font-size: 26px; font-variant-numeric: tabular-nums; } .setup-ring small { color: var(--muted); font-weight: 700; }
.steps { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: step; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--soft); }
.steps li:last-child { border-bottom: 0; }
.steps li p { margin: 2px 0 0; color: var(--muted); font-size: 14px; max-width: 60ch; }
.steps .tick { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d6d3d1; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.steps .tick:empty::before { content: counter(step); font-size: 13px; }
.steps li.step-ok .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.step-ok b { color: var(--muted); }
.step-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.step-actions .chk { padding: 0; font-weight: 600; color: var(--muted); }
@media (max-width: 700px) {
  .setup-head h2 { font-size: 21px; } .setup-ring { width: 68px; height: 68px; } .setup-ring b { font-size: 21px; }
  .steps li { flex-wrap: wrap; align-items: flex-start; } .steps li .grow { flex-basis: calc(100% - 46px); }
  .step-actions { margin-left: 46px; justify-content: flex-start; }
}

/* ---------- celular: barra inferior, mesas en cuadrícula y la cuenta como hoja */
.tabbar, .sheet-bar, .sheet-grip, .nav-shade, .back-btn { display: none; }
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px; } /* evita que el iPhone haga zoom al escribir */
  .menu-btn { display: none; }
  .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 58px; justify-content: center; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; border-radius: 12px; }
  .tabbar span { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .7; }
  .tabbar a.active { color: var(--pri); background: color-mix(in srgb, var(--pri) 9%, #fff); }
  .tabbar a.active span { filter: none; opacity: 1; }
  .nav-shade.on { display: block; position: fixed; inset: 0; background: rgba(28,25,23,.45); z-index: 35; }
  .top h1 { font-size: 18px; } .top { min-height: 54px; }
  .toolbar { gap: 8px; } .toolbar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .legend { order: 9; width: 100%; }
  .floor-wrap { min-height: 0; }
  .floor-wrap:has(> .floor:not(.editing)) { overflow: visible; }
  .floor:not(.editing) { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 12px; padding: 16px 12px; min-width: 0; min-height: 0; background-image: none; }
  .floor:not(.editing) .mesa, .floor:not(.editing) .mesa.round { position: static; width: auto; height: auto; aspect-ratio: 1; border-radius: 16px; }
  .floor:not(.editing) .mesa.round { border-radius: 50%; }
  body[data-view="pedido"] .tabbar { display: none; }
  body[data-view="pedido"] .back-btn { display: grid; place-items: center; text-decoration: none; color: var(--ink); }
  body[data-view="pedido"] .main { padding-bottom: 0; }
  .view-pedido { overflow: hidden; }
  .pos { display: block; height: 100%; }
  .pos-menu { height: 100%; max-height: none; padding: 10px 10px calc(86px + env(safe-area-inset-bottom)); }
  .prods { grid-template-columns: repeat(2, 1fr); }
  .prod { min-height: 84px; }
  .pos-ticket { position: fixed; left: 0; right: 0; bottom: 0; height: 90dvh; z-index: 45; border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -16px 48px rgba(0,0,0,.28); transform: translateY(104%); transition: transform .24s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom); }
  .pos.sheet .pos-ticket { transform: none; }
  .pos.sheet::after { content: ""; position: fixed; inset: 0; background: rgba(28,25,23,.4); z-index: 44; }
  .t-items { overflow-y: auto; }
  .sheet-grip { display: block; width: 100%; height: 22px; border: 0; background: none; cursor: pointer; position: relative; flex-shrink: 0; }
  .sheet-grip::before { content: ""; position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #d6d3d1; }
  .sheet-bar { display: flex; align-items: center; gap: 12px; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; min-height: 60px; padding: 0 18px 0 10px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.3); text-align: left; }
  .sheet-bar b { font-size: 19px; font-variant-numeric: tabular-nums; }
  .sb-n { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 11px; background: var(--pri); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
  .sheet-bar.bump .sb-n { animation: bump .3s; }
  .kds { grid-template-columns: 1fr; }
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  #toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@keyframes bump { 40% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .pos-ticket { transition: none; } .sheet-bar.bump .sb-n, .modal-bg, .toast { animation: none; } }
@media print { body * { visibility: hidden; } }
