/* =====================================================================
   Mamma Mia · sistema operativo
   Albahaca (estructura) · Tomate (acción) · Corteza (alertas)
   Archivo condensada para cifras: se lee de lejos en la tablet del mostrador.
   ===================================================================== */
:root {
  --basil: #1E3B2F; --basil-2: #2C5443; --basil-ink: #E8F0EA;
  --tomato: #C4361C; --tomato-2: #A82C15; --tomato-soft: #FBE9E4;
  --crust: #B97814; --crust-soft: #FCF1DC;
  --ok: #2F7A4E; --ok-soft: #E3F2E8; --bad: #B3261E; --bad-soft: #FBE6E4; --info: #2B5C8A; --info-soft: #E4EEF8;
  --bg: #F4F5F2; --card: #FFFFFF; --ink: #1D2125; --ink-2: #5D646B; --line: #DFE1DA; --field: #FFFFFF;
  --r-s: 6px; --r: 10px; --r-l: 16px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 18px rgba(20, 30, 25, .05);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --basil: #12241C; --basil-2: #1E3B2F; --basil-ink: #DCE8DF;
    --tomato: #E2553A; --tomato-2: #C94328; --tomato-soft: #3A1F19;
    --crust: #E3A845; --crust-soft: #3A2D16; --ok: #5BBF85; --ok-soft: #173025; --bad: #F07167; --bad-soft: #3B1C1A; --info: #7FB1E3; --info-soft: #1B2B3B;
    --bg: #111416; --card: #1A1E21; --ink: #ECEEEF; --ink-2: #9AA3AA; --line: #2B3135; --field: #14181B;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { --bg: #111416; --card: #1A1E21; --ink: #ECEEEF; --ink-2: #9AA3AA; --line: #2B3135; --field: #14181B; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); font-variation-settings: "wdth" 100; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.6rem; font-variation-settings: "wdth" 80; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; margin-top: 1.2rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tomato) 60%, transparent); outline-offset: 2px; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--crust); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Estructura */
.has-shell { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: 56px 1fr; min-height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--basil); color: var(--basil-ink); position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.05rem; font-variation-settings: "wdth" 75; letter-spacing: .01em; }
.topbar-ctx { flex: 1; display: flex; justify-content: center; }
.ctx-pill { background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 99px; font-size: .88rem; }
.suc-switch select { background: rgba(255,255,255,.12); color: inherit; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 6px 30px 6px 12px; min-height: 36px; }
.suc-switch option { color: #111; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.user-name { display: flex; flex-direction: column; text-align: right; font-size: .9rem; line-height: 1.2; }
.user-name small { opacity: .75; }
.icon-btn { display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; color: inherit; border-radius: var(--r); cursor: pointer; font-size: 1.3rem; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

.sidenav { background: var(--card); border-right: 1px solid var(--line); padding: 12px 10px 24px; overflow-y: auto; position: sticky; top: 56px; height: calc(100dvh - 56px); }
.nav-group { font-size: .78rem; color: var(--ink-2); padding: 16px 10px 6px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); min-height: 40px; }
.nav-link:hover { background: var(--bg); }
.nav-link.is-active { background: var(--tomato-soft); color: var(--tomato-2); font-weight: 600; }
.nav-link.is-active .ic { stroke: var(--tomato); }
.nav-foot { font-size: .75rem; color: var(--ink-2); padding: 18px 10px 0; margin: 0; }
.nav-scrim { display: none; }
.main { padding: 24px clamp(16px, 3vw, 36px) 64px; min-width: 0; max-width: 1280px; width: 100%; }
.is-wide .main { max-width: none; }
.no-shell .main { margin: 0 auto; }
.only-mobile { display: none !important; }

@media (max-width: 1023px) {
  .has-shell { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid !important; }
  .sidenav { position: fixed; top: 56px; left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 40; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .nav-open .sidenav { transform: none; }
  .nav-open .nav-scrim { display: block; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.35); z-index: 35; }
  .user-name { display: none; }
}
@media (max-width: 560px) {
  .brand span { display: none; }
  .main { padding: 16px 16px 96px; }
  h1 { font-size: 1.35rem; }
}

/* ---------- Encabezados, alertas, tarjetas */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { margin: 28px 0 12px; }
.alert { padding: 12px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-warn { background: var(--crust-soft); color: var(--crust); border-color: color-mix(in srgb, var(--crust) 30%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
@media (max-width: 860px) { .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; } }
.empty { border: 2px dashed var(--line); border-radius: var(--r-l); padding: 32px 18px; text-align: center; color: var(--ink-2); }
.note { background: var(--bg); border-left: 3px solid var(--crust); padding: 10px 12px; border-radius: 0 var(--r-s) var(--r-s) 0; font-size: .92rem; }
.is-off { opacity: .55; }
.stack { display: grid; gap: 8px; margin-top: 12px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--ink-2); font-size: .88rem; }
.dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.dl .big { font-size: 1.5rem; font-weight: 800; font-variation-settings: "wdth" 70; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; font-size: .9rem; }
.error-page { max-width: 520px; margin: 10vh auto; text-align: center; }

/* ---------- Botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--tomato); border-color: var(--tomato); color: #fff; }
.btn-primary:hover { background: var(--tomato-2); border-color: var(--tomato-2); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn-small { min-height: 34px; padding: 0 10px; font-size: .85rem; border-radius: var(--r-s); }
.btn-lg { min-height: 54px; padding: 0 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.inline-form { display: inline; }
.form { display: grid; gap: 14px; }
.form.narrow { max-width: 460px; }
label { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: 400 1rem var(--font); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 11px; min-height: var(--tap); width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--basil-2); outline: 3px solid color-mix(in srgb, var(--basil-2) 18%, transparent); }
textarea { min-height: 80px; resize: vertical; }
.input-sm { max-width: 120px; min-height: 38px; padding: 6px 8px; text-align: right; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); align-self: end; min-height: var(--tap); }
label.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--tomato); }
.row-2, .row-3 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .row-2, .row-3 { grid-template-columns: 1fr; } }
.field-end { display: flex; align-items: end; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; max-width: 280px; }
.inline-grid { display: grid; grid-template-columns: 1.2fr .8fr 1.5fr auto; gap: 8px; margin-bottom: 12px; }
@media (max-width: 720px) { .inline-grid { grid-template-columns: 1fr 1fr; } }
.with-unit { display: inline-flex; align-items: center; gap: 6px; }
.with-unit input { width: 110px; text-align: right; }
.with-unit em { font-style: normal; color: var(--ink-2); font-size: .85rem; min-width: 26px; }
.switch { display: inline-flex; position: relative; width: 44px; height: 26px; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; min-height: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- Tablas (se vuelven fichas en el teléfono) */
.table-wrap { overflow-x: auto; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--ink-2); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.table.compact td { padding: 7px 10px; font-size: .9rem; }
.table tfoot td { border-bottom: 0; }
.num { text-align: right; }
.actions { text-align: right; white-space: nowrap; }
.actions .btn + .btn, .actions .btn + form, .actions form + .btn { margin-left: 4px; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; padding: 6px 4px; background: var(--card); }
  .table td { border: 0; padding: 5px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td[data-l]::before { content: attr(data-l); color: var(--ink-2); font-size: .82rem; text-align: left; font-weight: 600; }
  .table td.actions { justify-content: flex-end; padding-top: 8px; }
  .table tfoot tr { border: 0; }
  .input-sm { max-width: 140px; }
}

/* Renglones editables (compras, recetas, traspasos) */
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-size: .8rem; color: var(--ink-2); padding: 6px; }
.lines td { padding: 6px; border-top: 1px solid var(--line); }
.lines select { min-width: 200px; }
@media (max-width: 720px) {
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
  .lines td { border: 0; padding: 0; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines tfoot tr { display: flex; justify-content: space-between; }
}

/* ---------- Estados */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--crust-soft); color: var(--crust); } .badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.tabs a.is-active { color: var(--ink); border-color: var(--tomato); }

/* ---------- Inicio: la línea de producción (el elemento distintivo) */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 22px; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.station { position: relative; padding: 16px 18px 18px 26px; text-decoration: none; display: grid; gap: 2px; border-right: 1px solid var(--line); }
.station:first-child { padding-left: 18px; }
.station:last-child { border-right: 0; }
.station:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 16px; height: 16px; background: var(--card); border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.station:hover { background: var(--bg); }
.station:hover::after { background: var(--bg); }
.st-name { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.station b { font-size: 2.6rem; line-height: 1; font-weight: 800; font-variation-settings: "wdth" 62; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.station small { color: var(--ink-2); }
.station.is-hot { background: var(--basil); color: var(--basil-ink); }
.station.is-hot .st-name, .station.is-hot small { color: color-mix(in srgb, var(--basil-ink) 75%, transparent); }
.station.is-hot::after { background: var(--basil); border-color: var(--basil); }
@media (max-width: 960px) {
  .flow { grid-template-columns: 1fr; }
  .station { border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr auto; align-items: baseline; padding: 14px 18px; }
  .station b { font-size: 2rem; grid-row: 1 / 3; grid-column: 2; }
  .station::after { display: none; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; display: grid; gap: 2px; }
.kpi small { color: var(--ink-2); font-weight: 600; }
.kpi b { font-size: 1.9rem; font-weight: 800; font-variation-settings: "wdth" 66; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi span { color: var(--ink-2); font-size: .85rem; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 120px 1fr auto; gap: 4px 10px; align-items: center; }
.bars small { grid-column: 3; color: var(--ink-2); text-align: right; }
.bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--tomato); border-radius: 99px; }

/* ---------- Producción y delivery: tableros */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 960px) { .board { grid-template-columns: 1fr; } }
.lane { background: color-mix(in srgb, var(--line) 35%, var(--bg)); border-radius: var(--r-l); padding: 12px; display: grid; gap: 10px; }
.lane h2 { font-size: .95rem; display: flex; justify-content: space-between; margin: 2px 4px 2px; }
.count { background: var(--card); border-radius: 99px; padding: 0 9px; font-size: .85rem; }
.lane-empty { margin: 4px; }
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 4px; text-decoration: none; color: var(--ink); font-size: .92rem; box-shadow: var(--shadow); }
a.ticket:hover { border-color: var(--basil-2); }
.ticket header { display: flex; justify-content: space-between; }
.ticket.is-done { box-shadow: none; opacity: .85; }
.ticket.is-late { border-left: 4px solid var(--bad); }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.ticket-actions select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .85rem; }
.stage { justify-self: start; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; color: #fff; }
.stage-1 { background: var(--crust); } .stage-2 { background: var(--tomato); }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 8px 0 40px; font-weight: 600; color: var(--ink-2); display: grid; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--card); }
.steps li.done { color: var(--ink); } .steps li.done::before { background: var(--ok); border-color: var(--ok); color: #fff; content: "✓"; }
.steps li.now { color: var(--ink); } .steps li.now::before { border-color: var(--tomato); color: var(--tomato); }
.steps small { font-weight: 400; color: var(--ink-2); }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; gap: 10px; } }
.recipe header h2 { margin-top: 6px; }
.ing { list-style: none; padding: 0; margin: 10px 0; }
.ing li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dotted var(--line); font-variant-numeric: tabular-nums; }
.recipe footer { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; font-size: .9rem; color: var(--ink-2); }
.recipe footer b { color: var(--ink); }

/* ---------- Punto de venta */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.pos-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 0 16px; min-height: 40px; font: 600 .92rem var(--font); cursor: pointer; white-space: nowrap; }
.chip.is-active { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-item { min-height: 104px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; font-family: var(--font); box-shadow: var(--shadow); touch-action: manipulation; }
.pos-item:active { transform: scale(.98); }
.pos-item:hover { border-color: var(--tomato); }
.pi-name { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.pi-price { font-weight: 800; font-size: 1.35rem; font-variation-settings: "wdth" 68; color: var(--tomato); font-variant-numeric: tabular-nums; }
.pos-item.is-flash { border-color: var(--ok); }
.pos-cart { position: sticky; top: 72px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; display: grid; gap: 12px; max-height: calc(100dvh - 90px); overflow-y: auto; box-shadow: var(--shadow); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: var(--r); padding: 4px; gap: 4px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg label { display: grid; place-items: center; min-height: 40px; border-radius: var(--r-s); cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .9rem; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; min-height: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.cart-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cart-line .cl-name { font-weight: 600; }
.cart-line .cl-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-ctl { display: inline-flex; align-items: center; gap: 2px; }
.qty-ctl button { width: 36px; height: 36px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.qty-ctl b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-line input { grid-column: 1 / -1; min-height: 34px; font-size: .85rem; padding: 4px 8px; }
.delivery-fields { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.cart-totals .tr, .ticket-paper .tr { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.cart-totals .big { font-size: 1.9rem; font-weight: 800; font-variation-settings: "wdth" 66; }
label.inline { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
label.inline input { width: 110px; min-height: 36px; }
.cash { display: grid; gap: 8px; margin-top: 8px; }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-cash button { flex: 1; min-height: 40px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 700 .95rem var(--font); cursor: pointer; }
.change { margin: 0; text-align: right; font-size: 1.1rem; }
.change b { font-size: 1.4rem; color: var(--ok); }
.cart-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.cart-fab { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 29; min-height: 56px; border: 0; border-radius: var(--r-l); background: var(--tomato); color: #fff; font: 700 1.05rem var(--font); box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; }
@media (max-width: 1023px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: fixed; inset: auto 0 0 0; top: 56px; max-height: none; border-radius: var(--r-l) var(--r-l) 0 0; z-index: 28; transform: translateY(105%); transition: transform .22s ease; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .cart-open .pos-cart { transform: none; }
  .cart-open .cart-fab { background: var(--basil); }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding-bottom: 80px; }
}

/* ---------- Acceso */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--basil); color: var(--basil-ink); display: grid; place-content: center; justify-items: center; gap: 22px; padding: 32px; }
.login-flow { font-size: 1.05rem; font-variation-settings: "wdth" 75; font-weight: 700; letter-spacing: .02em; margin: 0; text-align: center; }
.login-flow span { color: var(--tomato); margin: 0 6px; }
.login-card { align-self: center; justify-self: center; width: min(400px, 92vw); display: grid; gap: 14px; }
.login-card h1 { font-size: 2.2rem; font-variation-settings: "wdth" 70; margin: 0; }
.no-shell .main:has(.login) { padding: 0; max-width: none; }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login-art { padding: 28px; } .login-art img { width: 56px; height: 56px; } }

/* ---------- Documentos e impresión (ticket 80 mm, remisión carta) */
.print-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.ticket-paper { width: 80mm; max-width: 100%; background: #fff; color: #000; padding: 14px 12px; font: 13px/1.35 ui-monospace, "SF Mono", Menlo, Consolas, monospace; border-radius: 4px; box-shadow: var(--shadow); }
.ticket-paper h1 { font: 800 18px/1.2 var(--font); text-align: center; margin-bottom: 4px; }
.ticket-paper .c { text-align: center; }
.ticket-paper .b { font-weight: 800; font-size: 15px; }
.ticket-paper .sm { font-size: 11px; }
.ticket-paper hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.ticket-paper p { margin: 6px 0; }
.ticket-paper .sign { margin-top: 28px; }
.doc { background: #fff; color: #111; padding: 28px; border-radius: var(--r); max-width: 860px; box-shadow: var(--shadow); }
.doc header { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; margin-bottom: 20px; }
.doc header h1 { margin: 0; }
.doc header dl { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; font-size: .9rem; }
.doc header dt { color: #666; }
.doc header dd { margin: 0; font-weight: 600; }
.doc .table td, .doc .table th { color: #111; border-color: #ccc; }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 64px; text-align: center; font-size: .85rem; }
.signs span { border-top: 1px solid #333; padding-top: 6px; }
@media print {
  @page { margin: 8mm; }
  body { background: #fff; display: block; }
  .topbar, .sidenav, .nav-scrim, .no-print, .print-actions, .alert, .cart-fab { display: none !important; }
  .main { padding: 0; max-width: none; }
  .ticket-paper, .doc { box-shadow: none; padding: 0; }
  .doc .table, .doc .table tbody, .doc .table tr, .doc .table td { display: revert; }
  .doc .table thead { display: table-header-group; }
  .doc .table td::before { content: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
