:root {
    --bg: #f6f4f1;
    --card: #ffffff;
    --text: #1f1b16;
    --muted: #6b645c;
    --line: #e4dfd8;
    --brand: #e85d04;
    --brand-dark: #b84a03;
    --ok: #1f8a4c;
    --bad: #c62828;
    --warn: #b7791f;
    --radius: 10px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}
a { color: var(--brand-dark); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }

.topbar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #1f1b16; color: #fff; padding: .6rem 1rem;
}
.topbar .logo { font-weight: 700; color: #fff; text-decoration: none; }
.topbar .logo span { color: var(--brand); }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.topbar nav a { color: #ddd; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { background: #3a332b; color: #fff; }
.topbar .who { font-size: .85rem; color: #bbb; display: flex; gap: .5rem; align-items: center; }
.topbar .who form { margin: 0; }
.topbar .who button { background: none; border: 1px solid #555; color: #ddd; border-radius: 6px; padding: .2rem .5rem; cursor: pointer; }
.acting { background: #fff3cd; color: #6b4e00; padding: .4rem 1rem; display: flex; gap: 1rem; align-items: center; font-size: .9rem; }
.acting form { margin: 0; }

main { padding: 1.25rem; max-width: 1200px; margin: 0 auto; }
main.wide { max-width: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid > * { min-width: 0; }
/* Tarjetas con vista previa de ticket: el ticket de 80 mm mide 48 caracteres. */
.grid.tickets { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.stat .n { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash.ok { background: #e3f4ea; color: #145c33; }
.flash.bad { background: #fde8e8; color: #8e1c1c; }
.errors { background: #fde8e8; color: #8e1c1c; padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.errors ul { margin: 0; padding-left: 1.2rem; }

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #faf8f5; font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }

.btn {
    display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--text);
    padding: .5rem .9rem; border-radius: 8px; cursor: pointer; text-decoration: none; font-size: .95rem;
}
.btn:hover { border-color: #c9c1b6; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); }
.btn.small { padding: .25rem .55rem; font-size: .85rem; }
.btn.big { padding: .9rem 1.3rem; font-size: 1.1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

form.stack label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
form.stack .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
    width: 100%; padding: .55rem .65rem; border: 1px solid #cfc8bf; border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 70px; }
.check { display: flex !important; gap: .5rem; align-items: center; font-weight: 400 !important; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; padding: .5rem 1rem 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee; }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.badge.bad { background: #fde8e8; color: var(--bad); }
.badge.warn { background: #fff3cd; color: var(--warn); }
.dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: middle; margin-right: .3rem; }
.muted { color: var(--muted); }

pre.ticket {
    background: #fffef8; border: 1px dashed #bbb; padding: .8rem; font-family: Consolas, "Courier New", monospace;
    font-size: 11px; line-height: 1.35; overflow-x: auto; display: block; max-width: 100%; margin: .5rem 0;
}

/* Login */
.login { max-width: 360px; margin: 10vh auto; }
.login h1 { text-align: center; }

/* Caja */
.pos { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; }
.pos .station-block { margin-bottom: 1rem; }
.pos .station-title { font-weight: 700; margin: .25rem 0 .5rem; }
.pos .products { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pos .product {
    border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: .7rem; text-align: left;
    cursor: pointer; font: inherit; border-left: 5px solid var(--c, var(--brand)); min-height: 72px;
}
.pos .product:active { transform: scale(.98); }
.pos .product b { display: block; }
.pos .cart { position: sticky; top: 1rem; align-self: start; }
.cart-line { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.cart-line .top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.cart-line .qty { display: flex; gap: .25rem; align-items: center; }
.cart-line .qty button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; }
.cart-line input { margin-top: .3rem; font-size: .85rem; padding: .3rem .5rem; }
.cart-total { font-size: 1.4rem; font-weight: 700; display: flex; justify-content: space-between; margin: .8rem 0; }
.seg { display: flex; gap: .25rem; flex-wrap: wrap; }
.seg label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: .4rem; cursor: pointer; font-weight: 400 !important; margin: 0 !important; }
.seg input { display: none; }
.seg input:checked + span { font-weight: 700; color: var(--brand-dark); }
.seg label:has(input:checked) { border-color: var(--brand); background: #fff4ec; }

/* Pantallas en vivo (estación y despacho) */
main.live { max-width: 1100px; }
.live-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.live-head h1 { margin: 0; }
.station-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.alert-banner { background: var(--brand); color: #fff; font-weight: 700; padding: .8rem 1rem; border-radius: var(--radius); margin: .8rem 0; animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.02); } }
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 1rem; }
.empty { color: var(--muted); }
.order-tile {
    display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; font: inherit; cursor: pointer;
    background: #fff; border: 1px solid var(--line); border-left: 8px solid var(--c, var(--brand)); border-radius: var(--radius);
    padding: 1rem; min-height: 84px; position: relative;
}
.order-tile .folio, .dispatch-card .folio, .sheet-head .folio { font-size: 1.7rem; font-weight: 800; }
.order-tile .tile-info { display: flex; flex-direction: column; }
.order-tile .new-badge { display: none; position: absolute; top: .5rem; right: .6rem; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }
.order-tile.is-new { box-shadow: 0 0 0 3px var(--brand); }
.order-tile.is-new .new-badge { display: inline; }
.note { font-size: .9rem; color: var(--warn); }

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-body { position: relative; background: #fffef8; width: 100%; max-width: 520px; min-height: 55vh; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 1.2rem 1.2rem 1.5rem; }
.sheet-close { position: absolute; top: .4rem; right: .6rem; border: none; background: none; font-size: 2rem; cursor: pointer; color: var(--muted); }
.ticket-sheet { border-top: 6px solid var(--c, var(--brand)); padding-top: .6rem; font-family: Consolas, "Courier New", monospace; }
.sheet-head { border-bottom: 2px dashed #bbb; padding-bottom: .6rem; margin-bottom: .4rem; }
.sheet-item { font-size: 1.25rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.done-btn { width: 100%; margin-top: 1rem; font-family: system-ui, sans-serif; }

.dispatch section { margin-bottom: 1.5rem; }
.dispatch-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; }
.dispatch-card.ready { border: 2px solid var(--ok); background: #f3fbf6; }
.dispatch-card.is-new { box-shadow: 0 0 0 3px var(--ok); }
.dispatch-card a.folio { color: inherit; text-decoration: none; }
.dispatch-total { display: flex; justify-content: space-between; align-items: baseline; margin: .3rem 0; }
.dispatch-total b { font-size: 1.3rem; }
.dispatch-delivery { margin-top: .35rem; font-size: .95rem; background: #fff8e6; border-radius: 8px; padding: .4rem .55rem; overflow-wrap: anywhere; }
.dispatch-station { margin-top: .35rem; font-size: .95rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.chip { border: 2px solid var(--c); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; color: var(--muted); }
.chip.done { background: var(--c); color: #fff; }
.chip.done.is-new { box-shadow: 0 0 0 3px #1f1b16; animation: pulse 1s ease-in-out 3; }

@media (max-width: 860px) {
    .pos { grid-template-columns: 1fr; }
    .pos .cart { position: static; }
    main { padding: 1rem; }
}

/* En celular el ticket de 48 caracteres cabe completo sin desplazarse. */
@media (max-width: 480px) {
    pre.ticket { font-size: 9px; padding: .6rem; }
}

/* Tarjeta de sellos */
.stamp-row { display: block; text-decoration: none; color: inherit; }
.stamp-row:hover { border-color: var(--brand); }
.stamp-count { font-size: 1.2rem; margin: .4rem 0 .6rem; }
.stamp-dots { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.stamp-dot { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px dashed #c9c1b6; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; }
.stamp-dot.on { border: 2px solid var(--brand); background: var(--brand); color: #fff; font-size: 1.2rem; }

/* Mesas */
.table-row-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem .7rem; }
.table-row-form input[type=text] { width: 9rem; }
.table-row-form select { width: auto; min-width: 10rem; }
.table-row-form .check { margin: 0 !important; }
.table-card.busy { border-left: 6px solid var(--warn); }
.table-card.has-ready { border-left: 6px solid var(--ok); background: #f3fbf6; }
.account-box { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; margin-top: .5rem; background: #fff; }

/* Taquería: cantidad rápida, opciones de un toque y cobro dividido */
.qty-chips { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; position: sticky; top: 0; background: var(--bg); padding: .4rem 0; z-index: 5; }
.qty-chips button, .note-chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .8rem; font: inherit; cursor: pointer; }
.qty-chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.note-chips { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .35rem; }
.note-chips button { font-size: .8rem; padding: .2rem .6rem; }
.note-chips button.on { background: #fff4ec; border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.split-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.split-row .qty { display: flex; gap: .3rem; align-items: center; }
.split-row .qty > button:not(.btn) { width: 2.4rem; height: 2.4rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 1.2rem; cursor: pointer; }
.split-row [data-count] { min-width: 1.8rem; text-align: center; font-size: 1.1rem; }
.views-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .2rem 1rem; }

/* Menú en celular: botón ☰ y cuadrícula de 3 (la última fila centrada) */
.nav-toggle { display: none; }
@media (max-width: 720px) {
    .topbar { gap: .5rem; }
    .topbar .logo { flex: 1; }
    .nav-toggle { display: inline-block; background: #3a332b; color: #fff; border: 1px solid #555; border-radius: 8px; padding: .45rem .8rem; font: inherit; cursor: pointer; }
    .topbar nav { display: none; order: 3; flex-basis: 100%; justify-content: center; gap: .4rem; }
    .topbar.nav-open nav { display: flex; }
    .topbar nav a { flex: 0 0 calc((100% - .8rem) / 3); text-align: center; background: #2b251f; padding: .6rem .3rem; font-size: .95rem; }
    .topbar .who { order: 4; flex-basis: 100%; justify-content: space-between; }
    .acting { flex-wrap: wrap; gap: .4rem; padding: .5rem 1rem; }
    .acting form { margin-left: auto; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .stat .n { font-size: 1.4rem; }
}

/* Extras y forma de pago */
.extra-chips button { border-style: dashed; }
.pay-panel { margin: 1rem 0; }
.quick-cash { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.quick-cash button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .45rem .8rem; font: inherit; cursor: pointer; }
.pay-preview { margin: .5rem 0; font-size: 1.05rem; }

/* Platos dentro del pedido */
.plate-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .8rem; }
.plate-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .4rem .8rem; font: inherit; cursor: pointer; }
.plate-tabs button.on { background: #1f1b16; color: #fff; border-color: #1f1b16; font-weight: 700; }
.plate-tabs button[data-plate=new] { border-style: dashed; color: var(--brand-dark); }
.plate-head { font-weight: 800; margin: .7rem 0 .2rem; padding: .2rem .5rem; background: #fff4ec; border-left: 4px solid var(--brand); border-radius: 4px; }
.print-btn { display: block; text-align: center; text-decoration: none; }
.plate-pay { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; margin-bottom: .7rem; }
.plate-pay .plate-info { flex: 1; min-width: 0; }
.plate-pay .plate-info .muted { margin-top: .2rem; }
.plate-pay .btn { flex-shrink: 0; white-space: nowrap; }
.row-missing td { background: #fdf0f0; }
.row-missing td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.row-done td { background: #f1faf4; }
.row-done td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.missing-btn { border-color: var(--bad); color: var(--bad); font-weight: 700; }
.picker { border: none; border-radius: var(--radius); padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.picker::backdrop { background: rgba(0, 0, 0, .45); }
.picker-body { padding: 1.2rem; }
.picker-qty { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.picker-qty button { min-width: 2.8rem; height: 2.8rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 1.3rem; cursor: pointer; }
.picker-qty button.set { font-size: 1rem; }
.picker-qty [data-qty] { min-width: 2.4rem; text-align: center; font-size: 1.5rem; }
.picker-chips button { font-size: 1rem; padding: .5rem .9rem; }
.takeout-missing { border-left: 5px solid var(--bad); }
.takeout-done { border-left: 5px solid var(--ok); background: #f1faf4; opacity: .9; }
.missing-title { color: var(--bad); }
.done-title { color: var(--ok); margin-top: 1.5rem; }
.plate-bar .plate-tabs { margin-top: 0; }
.plate-bar .plate-tabs button { padding: .5rem 1rem; font-size: 1rem; }
.append-banner { display: flex; justify-content: space-between; align-items: center; gap: .6rem; background: #fff4ec; border: 1px solid var(--brand); color: var(--brand-dark); }
.picker-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-top: .3rem; }
.picker-options button { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .8rem .5rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 1.05rem; cursor: pointer; }
.picker-options button span { color: var(--brand-dark); font-weight: 700; }
.picker-options button:active { background: #fff4ec; border-color: var(--brand); }
.picker-fast { margin-top: .8rem; }
.picker-fast .btn { flex: 1; }
.picker-options button.on { background: #fff4ec; border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.picker-mode { grid-template-columns: 1fr 1fr; }
.picker-mode button { padding: 1.2rem .5rem; font-size: 1.2rem; }
.picker-mode button span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.row-actions { gap: .4rem; }
.row-actions .btn, .row-actions form .btn { min-width: 7.2rem; min-height: 2.6rem; padding: .45rem .8rem; font-size: .95rem; justify-content: center; text-align: center; }
.row-actions form { margin: 0; }
.sold-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-bottom: 1rem; }
@media (max-width: 700px) { .sold-grid { grid-template-columns: repeat(3, 1fr); } }
.sold-grid form { margin: 0; }
.sold-tile { width: 100%; min-height: 4.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; border: 2px solid var(--ok); background: #f1faf4; border-radius: 10px; font: inherit; cursor: pointer; padding: .4rem; }
.sold-tile span { font-size: .8rem; color: var(--ok); font-weight: 700; }
.sold-tile.is-out { border-color: #bbb; background: #e9e9e9; color: #888; text-decoration: line-through; }
.sold-tile.is-out span { color: var(--bad); text-decoration: none; }
.product.sold-out, .picker-options button.sold-out { opacity: .45; filter: grayscale(1); cursor: not-allowed; }
#append-takeout { margin-bottom: .6rem; }
.product, .product b { color: var(--text, #1f1b16); }

/* Ventanita «¿Imprimir ticket de cocina?» al enviar un pedido (Android + RawBT) */
.print-ask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.print-ask-card { background: #fff; border-radius: 16px; padding: 1.3rem; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: .7rem; text-align: center; }
.print-ask-card h3 { margin: 0; font-size: 1.25rem; }
.print-ask-card p { margin: 0 0 .3rem; }
.print-ask-card .btn { width: 100%; }
.print-ask-always { font-size: .9rem; color: #555; display: flex; gap: .45rem; align-items: center; justify-content: center; margin-top: .2rem; }

/* Versión del sistema al pie y página de Novedades */
.app-version { text-align: center; color: var(--muted); font-size: .75rem; padding: 1rem; }
.app-version a { color: inherit; text-decoration: none; }
.release { margin-bottom: .8rem; }
.release h3 { margin: 0 0 .4rem; }
.release ul { margin: 0; padding-left: 1.2rem; }

/* Inicio: filas de pedidos (mesas, para llevar, a domicilio) */
.hm-legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-bottom: .6rem; }
.hm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.hm-legend i.cook { background: var(--brand); }
.hm-legend i.ready { background: var(--ok); }
.hm-sec { margin-bottom: 1rem; min-width: 0; }
.hm-head { display: flex; align-items: center; gap: 8px; margin-bottom: .5rem; }
.hm-head h2 { margin: 0; font-size: 1.05rem; }
.hm-head > span { color: var(--muted); font-size: .85rem; }
.hm-add { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 11px; background: var(--ok); color: #fff; font-size: 24px; line-height: 40px; text-align: center; text-decoration: none; cursor: pointer; }
.hm-empty { color: var(--muted); font-size: .85rem; margin: 0; }
.hm-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.hm-card { flex: 0 0 176px; height: 106px; display: flex; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer; scroll-snap-align: start; }
.hm-side { width: 56px; flex: none; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.hm-side b { font-size: .95rem; }
.hm-side svg { width: 28px; height: 28px; }
.hm-side.cook { background: var(--brand); }
.hm-side.ready { background: var(--ok); }
.hm-info { flex: 1; min-width: 0; padding: 8px 9px; display: flex; flex-direction: column; }
.hm-info b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-who { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tot { font-weight: 700; margin-top: 3px; }
.hm-time { margin-top: auto; align-self: flex-end; color: var(--muted); font-size: .7rem; }
.hm-ov { position: fixed; inset: 0; background: rgba(30,20,10,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 900; }
.hm-ov[hidden] { display: none; }
.hm-sheet { background: var(--card); width: 100%; max-width: 480px; max-height: 90%; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.hm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hm-top h3 { margin: 0; font-size: 1.25rem; }
.hm-x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.hm-sub { color: var(--muted); font-size: .85rem; margin: -6px 0 0; }
.hm-plate { border-top: 1px solid var(--line); padding-top: 8px; }
.hm-plate h4 { margin: 0 0 4px; font-size: .82rem; color: var(--brand-dark); }
.hm-li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; padding: 2px 0; }
.hm-li small { display: block; color: var(--muted); font-size: .75rem; }
.hm-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }
.hm-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.hm-b { display: flex; align-items: center; justify-content: center; min-height: 52px; box-sizing: border-box; border-radius: 11px; font: inherit; font-weight: 700; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); color: var(--ink, #2a2622); text-align: center; text-decoration: none; cursor: pointer; }
.hm-b.go { background: var(--ok); border-color: var(--ok); color: #fff; }
.hm-b.add { background: var(--brand); border-color: var(--brand); color: #fff; }
.hm-b.no { background: var(--bad); border-color: var(--bad); color: #fff; }
.hm-b.off { color: var(--muted); opacity: .5; cursor: default; }
.hm-wide { width: 100%; }
.hm-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Caja: botones de categoría */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.cat-tabs button { flex: none; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.cat-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pos > section { min-width: 0; }

/* Alta de negocio: elegir interfaz básica o multiestación */
.iface-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.iface-card { display: flex; flex-direction: column; gap: .35rem; border: 2px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; cursor: pointer; background: var(--card); font-weight: 400; }
.iface-card:has(input:checked) { border-color: var(--brand); background: #fff4ec; }
.iface-card input { width: auto; align-self: flex-start; }
.iface-card b { font-size: 1.1rem; }
.iface-card span { color: var(--muted); font-size: .9rem; }
.iface-card ul { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
form.stack .iface-card { display: flex; flex-direction: column; align-items: stretch; }
.iface-card > b, .iface-card > span { display: block; }
