/* ===== Variables y tema ===== */
:root {
  --bg: #f5f3ef; --card: #fff; --ink: #1f2328; --muted: #6b7280; --line: #e5e1d8;
  --brand: #d9480f; --brand-ink: #fff; --brand-soft: #fff0e8;
  --ok: #2f9e44; --ok-soft: #e6f6ea; --warn: #e67700; --warn-soft: #fff4e0; --bad: #c92a2a; --bad-soft: #fdeaea; --info: #1c7ed6; --info-soft: #e7f1fc;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --r: 12px; --top: 56px;
}
:root[data-theme=dark] {
  --bg: #15171a; --card: #1f2227; --ink: #eceef1; --muted: #9aa3ad; --line: #30353c;
  --brand: #ff7a45; --brand-ink: #1a1a1a; --brand-soft: #3a2519;
  --ok: #51cf66; --ok-soft: #1b3324; --warn: #ffa94d; --warn-soft: #3a2c14; --bad: #ff6b6b; --bad-soft: #3a1c1c; --info: #74c0fc; --info-soft: #172a3d;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #15171a; --card: #1f2227; --ink: #eceef1; --muted: #9aa3ad; --line: #30353c;
    --brand: #ff7a45; --brand-ink: #1a1a1a; --brand-soft: #3a2519;
    --ok: #51cf66; --ok-soft: #1b3324; --warn: #ffa94d; --warn-soft: #3a2c14; --bad: #ff6b6b; --bad-soft: #3a1c1c; --info: #74c0fc; --info-soft: #172a3d;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; } h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--brand); } code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .grow { flex: 1; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.bad-t { color: var(--bad); } .warn-t { color: var(--warn); } .ok-t { color: var(--ok); }
.err { color: var(--bad); font-weight: 600; }
[hidden] { display: none !important; }

/* ===== Controles ===== */
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 42px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--brand); }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inrow { display: flex; gap: 6px; } .inrow select { width: 90px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; touch-action: manipulation; }
.btn:hover { border-color: var(--brand); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { background: transparent; } .btn.sm { min-height: 34px; padding: 4px 10px; font-size: .85rem; } .btn.big { min-height: 54px; font-size: 1.05rem; } .btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; padding: 8px 14px; width: 100%; text-align: left; cursor: pointer; }
form.inline { display: inline; }

/* ===== Cabecera ===== */
.top { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo { font-size: 24px; } .brand-t { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; } .brand-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; } .brand-t small { color: var(--muted); }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; flex: 1; }
.nav > a, .more > summary { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; white-space: nowrap; }
.nav > a:hover, .more > summary:hover { background: var(--bg); } .nav > a.on { background: var(--brand-soft); color: var(--brand); }
.more { position: relative; } .more > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; top: 110%; left: 0; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; } .menu a:hover, .linkbtn:hover { background: var(--bg); }
.right-menu { left: auto; right: 0; } .who { padding: 8px 12px; display: flex; flex-direction: column; } .who small { color: var(--muted); }
.right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ibtn { background: none; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; color: var(--ink); }
.userm > summary { font-size: 20px; padding: 6px 10px; }
.suc-sel select { min-height: 38px; padding: 4px 8px; width: auto; max-width: 160px; }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; font-size: 20px; color: var(--ink); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; text-align: center; font-weight: 700; }
.badge.warn { background: var(--warn); color: #fff; }

.flashes { max-width: 1280px; margin: 10px auto 0; padding: 0 16px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; font-weight: 600; }
.flash.ok { background: var(--ok-soft); color: var(--ok); } .flash.err { background: var(--bad-soft); color: var(--bad); }

/* ===== Página y tarjetas ===== */
.page { max-width: 1280px; margin: 0 auto; padding: 16px; }
.page.pos-page, .page.kds-page { max-width: none; padding: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.narrow, .narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card.alert { border-color: var(--warn); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .toolbar h1, .toolbar h2 { margin: 0; } .toolbar.tight { margin-bottom: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; } .filters label { min-width: 140px; } .filters label.check { min-width: 0; } .filters input, .filters select { width: auto; min-width: 140px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; } .grid2 .card { margin-bottom: 0; }
.grid2 + .grid2, .kpis + .card, .card + .grid2 { margin-top: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; } .tabs a.on { color: var(--brand); border-color: var(--brand); }
.chips, .presets { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .88rem; cursor: pointer; font-family: inherit; } .chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .78rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.pill.ready, .pill.st-listo, .pill.st-entregado { background: var(--ok-soft); color: var(--ok); } .pill.warn, .pill.prep, .pill.st-preparando { background: var(--warn-soft); color: var(--warn); }
.pill.new, .pill.st-nuevo { background: var(--info-soft); color: var(--info); } .pill.st-anulado, .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.off { background: var(--bg); color: var(--muted); }

/* KPI y gráficos */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); } .kpi span { color: var(--muted); font-size: .82rem; } .kpi b { font-size: 1.2rem; }
.kpi.warn { border-color: var(--warn); } .kpi.bad { border-color: var(--bad); }
.chart { width: 100%; height: auto; } .chart .bar { fill: var(--brand); } .chart .grid { stroke: var(--line); stroke-width: 1; } .chart .lbl { fill: var(--muted); font-size: 11px; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; } .hb-top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; } .hb { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; } .hb i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
ul.plain { list-style: none; margin: 0 0 10px; padding: 0; } ul.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; } .right-t { margin-left: auto; font-weight: 700; }

/* ===== Tablas ===== */
.tablewrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; } .table th.num { text-align: right; }
.table tr.off td { opacity: .55; } .table td.act { white-space: nowrap; text-align: right; } .table td.act .btn { margin-left: 4px; }
.orders .orow { cursor: pointer; } .orders .orow:hover td { background: var(--bg); } .drow td { background: var(--bg); }
.detail { padding: 4px 4px 8px; } .mini { width: 100%; border-collapse: collapse; } .mini td { padding: 4px 6px; border: 0; vertical-align: top; } .mini .q { width: 36px; font-weight: 700; }
.opt { font-size: .85rem; color: var(--muted); } .opt span { font-weight: 600; color: var(--ink); } .opt.note { color: var(--warn); }
.sum { margin-top: 6px; font-size: .88rem; }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.search { max-width: 260px; display: inline-block; margin-right: 8px; }

/* recetas / filas dinámicas */
.rrow { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; } .rrow.r3 { grid-template-columns: 2fr 1fr 1fr auto; } .rrow.head { font-size: .78rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 10px 0; }

/* ===== Diálogos ===== */
dialog.dlg { border: 0; border-radius: 16px; padding: 20px; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: auto; }
dialog.dlg.wide { width: min(680px, calc(100vw - 24px)); } dialog::backdrop { background: rgba(0,0,0,.5); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }

/* ===== Acceso ===== */
.guest { display: grid; min-height: 100vh; place-items: center; }
.login-wrap { width: 100%; padding: 16px; } .login { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; } .login h1 { text-align: center; font-size: 1.3rem; margin: 0; } .login-logo { text-align: center; font-size: 46px; }

/* ===== POS (cajero) ===== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; height: calc(100dvh - var(--top)); }
.pos-menu { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 12px 12px 0; }
.pos-bar { display: flex; gap: 8px; margin-bottom: 10px; } .pos-bar input { flex: 1; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; flex-shrink: 0; }
.cats button { flex: 0 0 auto; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.cats button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.grid-prod { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: min-content; gap: 10px; padding: 4px 2px 90px; align-content: start; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 4px; min-height: 104px; padding: 12px; text-align: left; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; user-select: none; }
.tile.drink { border-left-color: var(--info); } .tile:active { transform: scale(.97); } .tile:disabled { opacity: .45; cursor: not-allowed; }
.tn { font-weight: 700; font-size: 1rem; line-height: 1.2; } .td { font-size: .78rem; color: var(--muted); } .tp { font-weight: 800; color: var(--brand); font-size: 1.05rem; }
.tb { position: static; order: -1; align-self: flex-start; font-style: normal; font-size: .65rem; padding: 1px 7px; border-radius: 10px; background: var(--bg); color: var(--muted); font-weight: 700; } .tb.off { background: var(--bad-soft); color: var(--bad); } .tb.warn { background: var(--warn-soft); color: var(--warn); }
#btnListos.alerting { border-color: var(--ok); color: var(--ok); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(47,158,68,.2); } }

.pos-cart { display: flex; flex-direction: column; min-height: 0; background: var(--card); border-left: 1px solid var(--line); }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.seg { display: flex; gap: 4px; padding: 10px 12px 0; } .seg button { flex: 1; min-height: 42px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; } .seg button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.seg.paym { padding: 0; flex-wrap: wrap; } .seg.paym button { min-width: 120px; }
.cart-fields { padding: 8px 12px; }
.lines { flex: 1; overflow-y: auto; padding: 4px 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.line { padding: 10px 0; border-bottom: 1px dashed var(--line); } .lh { display: flex; justify-content: space-between; gap: 8px; } .ln { font-weight: 700; }
.lop { font-size: .83rem; color: var(--muted); padding-left: 10px; } .lop span { color: var(--ink); font-weight: 600; } .lop.note { color: var(--warn); }
.lc { display: flex; gap: 6px; margin-top: 6px; align-items: center; } .lc button { min-width: 42px; height: 38px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; font-size: 16px; cursor: pointer; color: var(--ink); touch-action: manipulation; } .lq { min-width: 28px; text-align: center; font-size: 1.05rem; }
.cart-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.tot { display: flex; justify-content: space-between; font-size: 1.25rem; }
.cart-fab { display: none; }
.only-m { display: none; }

.optgroup { border: 1px solid var(--line); border-radius: 12px; padding: 10px; } .og-h { display: flex; justify-content: space-between; margin-bottom: 8px; align-items: baseline; }
.optlist { display: flex; flex-wrap: wrap; gap: 8px; } .optchip { min-height: 46px; padding: 0 16px; border-radius: 23px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; touch-action: manipulation; } .optchip i { font-style: normal; color: var(--muted); font-size: .8rem; } .optchip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.opt-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 4px; } .stepper button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 22px; cursor: pointer; color: var(--ink); } .stepper b { min-width: 34px; text-align: center; font-size: 1.2rem; }
.paytotal { display: flex; justify-content: space-between; align-items: baseline; background: var(--brand-soft); border-radius: 12px; padding: 12px 16px; } .paytotal b { font-size: 2rem; color: var(--brand); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; } .quick button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); touch-action: manipulation; }
.change { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; } .change b { font-size: 1.6rem; color: var(--ok); } .change.bad b { color: var(--bad); }
.pay-actions { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); } .lrow span { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 200; box-shadow: var(--shadow); max-width: 90vw; } .toast.bad { background: var(--bad); }

/* ===== Cocina ===== */
.kds { padding: 12px; min-height: calc(100dvh - var(--top)); }
.kds-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 1.1rem; } .btn.on { border-color: var(--ok); color: var(--ok); }
.kds-recent { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; color: var(--muted); font-size: .85rem; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.kempty { grid-column: 1/-1; text-align: center; color: var(--muted); font-size: 1.4rem; padding: 80px 0; }
.kcard { background: var(--card); border: 2px solid var(--line); border-top-width: 8px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.kcard.ok { border-top-color: var(--ok); } .kcard.mid { border-top-color: var(--warn); } .kcard.late { border-top-color: var(--bad); } .kcard.preparando { border-color: var(--info); border-top-color: inherit; }
.kcard.fresh { animation: fresh 1.2s ease 3; } @keyframes fresh { 50% { box-shadow: 0 0 0 6px var(--brand); } }
.kcard header { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; flex-wrap: wrap; } .kcard header b { font-size: 1.8rem; } .kt { font-weight: 700; flex: 1; } .age { font-weight: 800; margin-left: auto; }
.kcard.void { border-color: var(--bad); background: var(--bad-soft); border-top-color: var(--bad); } .kcard.void header span { color: var(--bad); font-weight: 800; }
.knote { margin: 0 12px 6px; padding: 6px 10px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; font-weight: 700; }
.kcard ul { list-style: none; margin: 0; padding: 0 8px; } .kcard li { border-top: 1px solid var(--line); }
.kitem { display: flex; gap: 10px; width: 100%; padding: 10px 6px; background: none; border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.chk { flex: 0 0 30px; height: 30px; border: 2px solid var(--muted); border-radius: 8px; display: grid; place-items: center; font-weight: 900; color: #fff; } li.done .chk { background: var(--ok); border-color: var(--ok); }
li.done .kb { opacity: .45; text-decoration: line-through; }
.kb { display: flex; flex-direction: column; gap: 2px; } .kn { font-size: 1.2rem; } .ko { font-size: 1.02rem; } .ko i { font-style: normal; font-weight: 700; color: var(--brand); } .ko.note { color: var(--warn); font-weight: 700; }
.kcard footer { display: flex; gap: 8px; padding: 10px 12px; align-items: center; border-top: 1px solid var(--line); } .prog { color: var(--muted); font-weight: 700; margin-right: auto; }
.kbtn { min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; touch-action: manipulation; } .kbtn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .burger { display: block; } .brand-t b { max-width: 130px; }
  .nav { display: none; position: absolute; top: var(--top); left: 0; right: 0; flex-direction: column; align-items: stretch; margin: 0; padding: 8px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; } .nav .more .menu { position: static; box-shadow: none; border: 0; }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos-cart { position: fixed; inset: var(--top) 0 0 0; z-index: 40; transform: translateY(100%); transition: transform .22s ease; border-left: 0; }
  .pos-cart.open { transform: none; }
  .only-m { display: inline-flex; }
  .cart-fab { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 30; display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--brand); color: var(--brand-ink); font: inherit; font-size: 1.1rem; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
  .grid-prod { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding-bottom: 90px; }
  .page { padding: 12px; } .two { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; }
  .rrow, .rrow.r3 { grid-template-columns: 1fr 1fr auto; } .rrow.head { display: none; }
}
@media (max-width: 520px) { .tile { min-height: 96px; padding: 10px; } .btn { padding: 8px 12px; } .kpis { grid-template-columns: 1fr 1fr; } .suc-sel select { max-width: 110px; } .dlg-actions .btn { flex: 1; } }
@media print { .top, .flashes, .noprint, .tabs, .filters, .toolbar .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; } .drow[hidden] { display: table-row !important; } }

.superbar { background: var(--warn-soft); color: var(--warn); padding: 6px 14px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; }
.pill.free { background: var(--info-soft); color: var(--info); }
.payrow { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; align-items: center; margin-bottom: 8px; } .payrow b { font-weight: 700; }
.paysum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 1.05rem; flex-wrap: wrap; } .paysum b { font-size: 1.5rem; } .paysum .okv { color: var(--ok); } .paysum .badv { color: var(--bad); }
.editbar { background: var(--warn-soft); color: var(--warn); padding: 8px 14px; font-weight: 700; text-align: center; }

.heat { border-collapse: collapse; width: 100%; font-size: .8rem; } .heat th, .heat td { padding: 5px 4px; text-align: center; border: 1px solid var(--line, #e5e7eb); min-width: 28px; } .heat th { font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.okv { color: var(--ok); font-weight: 700; } .badv { color: var(--bad); font-weight: 700; }

.tot.promo { color: var(--ok); }
.dayset { display: flex; flex-wrap: wrap; gap: 8px; } .dayset label { display: inline-flex; gap: 4px; align-items: center; }
.prodpick { max-height: 240px; overflow: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 6px; display: grid; gap: 4px; } .prodpick label { display: grid; grid-template-columns: 1fr 70px; gap: 8px; align-items: center; }
