/* Layout: delivery-app style. Clean white surfaces on a soft grey page, one vivid tomato brand color, pill controls,
   product cards with an illustrated thumbnail tinted by each flavor (--c). Phone-first; tablets spread into grids. */
:root {
  --page: #F5F5F7; --surface: #FFFFFF; --ink: #17171A; --muted: #6B6B73; --line: #EBEBEF; --fill: #F1F1F4;
  --brand: #FF4B2B; --brand-ink: #FFFFFF; --brand-soft: #FFEDE8; --brand-strong: #E8381A;
  --ok: #1F9D55; --ok-soft: #E4F6EC; --warn: #B76E00; --warn-soft: #FFF3D6; --bad: #D92D20; --bad-soft: #FEE9E7;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 6px 20px rgba(20, 20, 30, .06);
  --shadow-up: 0 -6px 24px rgba(20, 20, 30, .08);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 18px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page: #0E0E10; --surface: #1A1A1E; --ink: #F4F4F6; --muted: #A0A0AA; --line: #2A2A30; --fill: #24242A;
  --brand: #FF5A3D; --brand-ink: #FFFFFF; --brand-soft: #3A1D17; --brand-strong: #FF7559;
  --ok: #4CC38A; --ok-soft: #15301F; --warn: #F0B54B; --warn-soft: #33270F; --bad: #FF6B5E; --bad-soft: #3A1A17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25); --shadow-up: 0 -6px 24px rgba(0, 0, 0, .35); color-scheme: dark } }
:root[data-theme="dark"] {
  --page: #0E0E10; --surface: #1A1A1E; --ink: #F4F4F6; --muted: #A0A0AA; --line: #2A2A30; --fill: #24242A;
  --brand: #FF5A3D; --brand-ink: #FFFFFF; --brand-soft: #3A1D17; --brand-strong: #FF7559;
  --ok: #4CC38A; --ok-soft: #15301F; --warn: #F0B54B; --warn-soft: #33270F; --bad: #FF6B5E; --bad-soft: #3A1A17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25); --shadow-up: 0 -6px 24px rgba(0, 0, 0, .35); color-scheme: dark }
* { box-sizing: border-box }
body { background: var(--page); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased }
.wrap { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 0 130px }
.wide .wrap { max-width: 1180px }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; margin: 0 }
h1 { font-size: 1.75rem; line-height: 1.15 } h2 { font-size: 1.3rem } h3 { font-size: 1.05rem; font-weight: 700 }
.num { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) } .small { font-size: .86rem }
.stack { display: grid; gap: 12px } .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap } .sp { flex: 1; min-width: 0 }
section.block { display: grid; gap: 12px; padding-block: 16px 6px }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; align-items: center; gap: 8px; padding-block: 8px; min-height: 60px }
.brand { font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.2rem }
.logo span:last-child { color: var(--brand) }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 1rem }
.role { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700 }

/* buttons */
button, .btn { font: inherit; font-weight: 700; border: 0; background: var(--fill); color: var(--ink); border-radius: 999px; padding: 10px 18px; min-height: 44px; cursor: pointer; transition: transform .08s ease, background .15s ease }
button:active:not(:disabled) { transform: scale(.97) }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px }
button.pri { background: var(--brand); color: var(--brand-ink) }
button.pri:hover:not(:disabled) { background: var(--brand-strong) }
button.danger { background: var(--bad-soft); color: var(--bad) }
button.ghost { background: transparent; color: var(--muted); padding-inline: 10px }
button.big { width: 100%; min-height: 56px; font-size: 1.04rem }
button.small { min-height: 38px; padding: 6px 14px; font-size: .88rem }
button:disabled { opacity: .4; cursor: not-allowed }
button.link { background: none; color: var(--brand); padding: 4px 0; min-height: 34px; font-weight: 700; font-size: .92rem; justify-self: start; text-align: left; border-radius: 6px }
a.btn { display: inline-flex; align-items: center; text-decoration: none }
a.btn.ghost { background: transparent; color: var(--muted) }
.iconbtn { width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; display: grid; place-items: center; font-size: 1.2rem }

/* surfaces */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow) }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); width: 100% }
.choice .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none }
.choice .ic svg { width: 26px; height: 26px }
.choice .tx { flex: 1; min-width: 0; display: grid; gap: 2px }
.choice b { font-size: 1.12rem; font-weight: 800 }
.choice .tx span { font-weight: 500 }
.chev { color: var(--muted); font-size: 1.4rem; font-weight: 500 }
.hero { padding-block: 22px 4px; display: grid; gap: 6px }

/* mesas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px }
.mesa { display: grid; gap: 4px; text-align: left; min-height: 104px; align-content: space-between; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); padding: 14px; font-weight: 600 }
.mesa .n { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em }
.mesa .st { font-size: .82rem; color: var(--muted); font-weight: 600 }
.mesa.on { background: var(--brand); color: var(--brand-ink) }
.mesa.on .st { color: color-mix(in srgb, var(--brand-ink) 85%, transparent) }
.mesa .amt { font-size: 1.05rem; font-weight: 800 }

/* chips & pills */
.pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--muted); white-space: nowrap }
.pill.enviado { background: var(--brand-soft); color: var(--brand) }
.pill.horno { background: var(--warn-soft); color: var(--warn) }
.pill.listo { background: var(--ok-soft); color: var(--ok) }
.pill.servido { background: var(--fill); color: var(--muted) }
.pill.cancelado { background: var(--bad-soft); color: var(--bad) }
.pill.warn { background: var(--warn-soft); color: var(--warn) }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-block: 14px 2px; scrollbar-width: none }
.tabs::-webkit-scrollbar { display: none }
.tabs button { white-space: nowrap; min-height: 40px; padding: 8px 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700 }
.tabs button.on { background: var(--ink); color: var(--surface); box-shadow: none }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-block: 0 10px; background: var(--fill); border-radius: 999px }
.seg button { min-height: 40px; background: transparent; color: var(--muted) }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow) }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chips button { min-height: 42px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600 }
.chips button.on { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand) }
.chips button.off { opacity: .4 }

/* products */
.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; align-items: start }
.pz, .prod { --c: #999; display: grid; gap: 12px }
.pzhead, .prod { grid-template-columns: 1fr auto }
.pzhead { display: grid; gap: 12px; align-items: start }
.prod { align-items: center }
.info { display: grid; gap: 3px; min-width: 0 }
.info b { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em }
.info .desc { font-size: .86rem; color: var(--muted); font-weight: 500; line-height: 1.35 }
.info .price { font-weight: 700 }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 16px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); display: grid; place-items: center; flex: none }
.thumb svg { width: 74px; height: 74px }
.thumb .plus { position: absolute; right: -6px; bottom: -6px }
.off { opacity: .5 }
.off .thumb { filter: grayscale(1) }
.soldout { font-size: .82rem; font-weight: 700; color: var(--bad) }
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px }
.sz { position: relative; display: grid; gap: 1px; padding: 8px 4px; min-height: 58px; border-radius: 14px; background: var(--fill); font-weight: 600; font-size: .8rem; color: var(--muted); text-align: center }
.sz b { font-size: .92rem; color: var(--ink); font-weight: 800 }
.sz.on { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand) }
.badge { position: absolute; top: -7px; right: -5px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-style: normal; font-weight: 800; font-size: .8rem; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--surface) }
.plusbtn { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 999px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); font-size: 1.4rem; display: grid; place-items: center; line-height: 1 }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border-radius: 999px; padding: 3px; box-shadow: var(--shadow) }
.stepper button { min-height: 34px; min-width: 34px; padding: 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 1.15rem }
.stepper b { min-width: 24px; text-align: center; font-weight: 800 }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; vertical-align: 0; margin-right: 8px }
.dot.big { width: 16px; height: 16px; vertical-align: -2px }

/* lists & totals */
.line { display: flex; gap: 12px; align-items: flex-start; padding-block: 12px; border-top: 1px solid var(--line) }
.line:first-child { border-top: 0; padding-top: 2px }
.line .info { flex: 1 }
.line b { font-weight: 700 }
.strike { text-decoration: line-through; color: var(--muted) }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; padding-inline: 4px }

/* bottom bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); box-shadow: var(--shadow-up); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px) }
.bar .wrap { padding-block: 12px }
.cta { display: flex; align-items: center; gap: 12px; padding-inline: 10px 20px }
.cta .count { min-width: 30px; height: 30px; border-radius: 999px; background: color-mix(in srgb, var(--brand-ink) 22%, transparent); display: grid; place-items: center; font-size: .9rem }
.cta .lbl { flex: 1; text-align: left }
.cartlist { max-height: 42vh; overflow: auto; padding-inline: 4px }

/* forms */
label.f { display: grid; gap: 6px; font-weight: 700; font-size: .9rem }
input, select, textarea { font: inherit; font-weight: 500; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 0; background: var(--fill); color: var(--ink) }
textarea { min-height: 76px }

/* sheets & toasts */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 14, .45); z-index: 10; display: flex; align-items: flex-end; justify-content: center }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px }
.sheet::before { content: ""; width: 40px; height: 5px; border-radius: 99px; background: var(--line); justify-self: center }
.sheethero { height: 150px; border-radius: 20px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); display: grid; place-items: center }
.sheethero svg { width: 120px; height: 120px }
.sect { display: grid; gap: 10px }
.sect > b { font-size: 1rem; font-weight: 800 }
.toast { position: fixed; left: 16px; right: 16px; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 12; max-width: 520px; margin: 0 auto; background: var(--ink); color: var(--surface); border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); font-weight: 600 }
.toast button { background: color-mix(in srgb, var(--surface) 16%, transparent); color: var(--surface); min-height: 38px; padding: 6px 14px }
.alert { background: var(--bad-soft) }
.notice { background: var(--warn-soft); color: var(--ink); box-shadow: none }

/* kitchen */
.ticketgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; align-items: start }
.ticket { display: grid; gap: 8px; border-top: 6px solid var(--brand) }
.ticket.late { border-top-color: var(--warn) }
.ticket.flag { border-top-color: var(--bad); background: var(--bad-soft) }
.ticket h3 { font-size: 1.15rem; font-weight: 800 }
.kitem { padding-block: 8px; border-top: 1px solid var(--line); font-size: 1.04rem }
.kitem:first-of-type { border-top: 0 }
.note { font-style: italic; color: var(--warn); font-weight: 600 }

/* admin */
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line) }
.switch:first-of-type { border-top: 0 }
.tog { min-width: 112px; background: var(--ok-soft); color: var(--ok) }
.tog.no { background: var(--bad-soft); color: var(--bad) }
.tog.neutral { background: var(--fill); color: var(--muted) }
.statbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; padding-block: 6px; font-weight: 600; font-size: .92rem }
.statbar .track { height: 10px; background: var(--fill); border-radius: 99px; overflow: hidden }
.statbar .fill { height: 100%; background: var(--brand); border-radius: 99px }
.statbar span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px }
.kpi { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow) }
.kpi b { display: block; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em }
.kpi span { font-weight: 600 }
.demo { font-size: .8rem; color: var(--muted); background: var(--fill); border-radius: 12px; padding: 10px 12px; font-weight: 500 }
.receipt { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; font-variant-numeric: tabular-nums; display: grid; gap: 6px; max-width: 400px; margin: 0 auto; width: 100% }
.receipt .rl { display: flex; justify-content: space-between; gap: 10px }
.receipt hr { border: 0; border-top: 1.5px dashed var(--line); width: 100%; margin: 6px 0 }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; width: 100% }
.pinpad button { min-height: 64px; font-size: 1.4rem; font-weight: 700; background: var(--surface); box-shadow: var(--shadow) }
.dots { text-align: center; font-size: 1.8rem; letter-spacing: .45em; min-height: 48px; color: var(--brand) }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem }
table.t td, table.t th { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top }
.scrollx { overflow-x: auto }
.admrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border-radius: 12px; padding: 12px 4px; border-top: 1px solid var(--line); font-weight: 600 }
.admrow:first-of-type { border-top: 0 }
.admrow:hover { background: var(--fill) }
.admrow .info { flex: 1 }
.catrow { display: grid; gap: 8px; padding-block: 12px; border-top: 1px solid var(--line) }
.catrow:first-of-type { border-top: 0 }
.paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.paygrid button { min-height: 64px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink) }
.swatches { display: flex; flex-wrap: wrap; gap: 10px }
.swatches button { width: 40px; height: 40px; min-height: 40px; padding: 0; background: var(--c); box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1px var(--line) }
.swatches button.on { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 3px var(--ink) }
@media (prefers-reduced-motion: no-preference) { .toast { animation: drop .2s ease-out } @keyframes drop { from { transform: translateY(-8px); opacity: .5 } } .sheet { animation: rise .22s ease-out } @keyframes rise { from { transform: translateY(24px) } } }
@media (prefers-reduced-motion: reduce) { button { transition: none } }

/* ---- versión real ---- */
.offline { position: fixed; left: 0; right: 0; top: 0; z-index: 20; background: var(--bad); color: #fff; text-align: center; font-weight: 700; font-size: .9rem; padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px }
.sheethero img { height: 100%; width: 100%; object-fit: cover; border-radius: 20px }
.pinpad button.okkey { background: var(--brand); color: var(--brand-ink) }
.qrsheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px }
.qrcard { background: #fff; color: #111; border-radius: 16px; padding: 16px; text-align: center; display: grid; gap: 6px; justify-items: center; box-shadow: var(--shadow); break-inside: avoid }
.qrcard svg { width: 180px; height: 180px }
.qrcard b { font-size: 1.3rem }
.qrbox { background: #fff; padding: 8px; border-radius: 10px; display: inline-grid }
.qrbox svg { width: 92px; height: 92px }
.toast.err { background: var(--bad); color: #fff }
.install { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 30%, transparent) }
.install .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); flex: none }
.install .ic svg { width: 24px; height: 24px }
.install button.pri { justify-self: start; min-height: 42px }
.loading { opacity: .6; pointer-events: none }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.filebtn { position: relative; overflow: hidden }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer }
@media print {
  .top, .noprint, .bar, .toast { display: none !important }
  body { background: #fff }
  .qrcard { box-shadow: none; border: 1px solid #ddd }
}