/* Sincro — estilos. Paleta "Pacífico": todos los textos cumplen WCAG AA (4.5:1) en claro y oscuro. */
:root {
  /* Sincro: azul marino, azul y verde menta del logo. Todos los textos cumplen WCAG AA (4.5:1). */
  --bg: #F5F7F8; --card: #FFFFFF; --ink: #0C2641; --ink2: #4A5B6E; --line: #DCE3E8; --soft: #EDF2F5;
  --navy: #0C2641; --mint: #66D0A0; --sincro: #0F6E8E;
  --good: #1B7F45; --warn: #9A6200; --bad: #B42318;
  --good-bg: #E6F3EB; --warn-bg: #FBF0DC; --bad-bg: #FBE9E7;
  /* Color del negocio (sale de su logo; la app lo ajusta para que se lea bien). Sin negocio: el azul de Sincro. */
  --primary: var(--b-l, #0F6E8E); --on-primary: var(--b-ol, #FFFFFF);
  --info-bg: var(--b-tl, #E2EEF2);
  --brand: var(--primary); --on-brand: var(--on-primary);
  --accent: #E9A23B;
  --radius: 16px; --shadow: 0 1px 2px rgba(12,38,65,.06), 0 4px 16px rgba(12,38,65,.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1626; --card: #102238; --ink: #ECF1F4; --ink2: #A9B8C6; --line: #23364F; --soft: #172B45;
  --good: #4CC985; --warn: #F1B94A; --bad: #F2877B;
  --good-bg: #15301F; --warn-bg: #33290F; --bad-bg: #3A1A17;
  --primary: var(--b-d, #66D0A0); --on-primary: var(--b-od, #0A1626);
  --info-bg: var(--b-td, #1F3D4C);
  --accent: #F2B85C;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; overflow-x: hidden; }
.card, .banner, .link-box { overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink2); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ───── botones ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .ic svg { width: 20px; height: 20px; }
.btn-main { background: var(--primary); color: var(--on-primary); }
.btn-main:hover { filter: brightness(1.08); }
.btn-brand { background: var(--brand); color: var(--on-brand); }
.btn-sec { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-sec:hover { background: var(--soft); }
.btn-ghost { background: transparent; color: var(--primary); padding: 0 12px; }
.btn-danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #0A1626; }
.btn-wa { background: #1B7F45; color: #fff; }
.btn.full { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink2); }
.icon-btn:hover { background: var(--soft); }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.actions.stack { flex-direction: column-reverse; align-items: stretch; }

/* ───── campos ───── */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field-label { font-weight: 650; font-size: 15px; }
.field-hint { color: var(--ink2); font-size: 14px; margin-top: -4px; }
.field input, .field textarea, .field select { min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); width: 100%; }
.field input:focus, .field textarea:focus { border-color: var(--primary); outline: none; }
.code-input { font-size: 28px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; min-height: 1em; }

/* ───── tarjetas y listas ───── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .card + .section-title, .section-title + .card { margin-top: 14px; }
.section-title { font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin: 22px 4px 8px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px; border: 0; background: none; width: 100%; text-align: left; text-decoration: none; color: inherit; cursor: pointer; }
.row + .row { border-top: 1px solid var(--line); }
button.row:hover, a.row:hover { background: var(--soft); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--ink2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .lead { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--primary); flex: none; }
.row .lead svg { width: 22px; height: 22px; }
.row > svg:last-child { color: var(--ink2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--ink); display: grid; place-items: center; font-weight: 750; font-size: 15px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.chip.owner { background: var(--info-bg); color: var(--primary); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--ink); margin-bottom: 14px; }
.banner svg { color: var(--warn); }
.banner.info { background: var(--info-bg); } .banner.info svg { color: var(--primary); }
.banner.bad { background: var(--bad-bg); } .banner.bad svg { color: var(--bad); }
.banner .grow { flex: 1; }
.banner .btn { min-height: 40px; margin-top: 10px; }

/* ───── estructura ───── */
#app { min-height: 100dvh; }
.center-page { max-width: 460px; margin: 0 auto; padding: 32px 20px 40px; min-height: 100dvh; display: flex; flex-direction: column; }
.logo-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--navy); display: grid; place-items: center; color: var(--mint); overflow: hidden; }
.logo-mark svg { width: 30px; height: 30px; }
.logo-mark img { width: 100%; height: 100%; display: block; }
.wordmark { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.wordmark span { color: var(--sincro); }
:root[data-theme="dark"] .wordmark span { color: var(--mint); }
.hero { margin: 28px 0 8px; }
.hero p { color: var(--ink2); margin-top: 8px; font-size: 17px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 14px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dev-code { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); font-size: 14px; }
.foot-note { margin-top: auto; padding-top: 28px; color: var(--ink2); font-size: 13px; text-align: center; }

.shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; min-height: 100dvh; }
.shell > * { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--primary); }
.biz-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.biz-logo.has-img { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.biz-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.biz-name { font-weight: 800; font-size: 17px; line-height: 1.15; }
.sync-state { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink2); }
.sync-state svg { width: 16px; height: 16px; }
.sync-state.offline, .sync-state.pending { color: var(--warn); }
.sync-state.error, .sync-state.lost { color: var(--bad); }
main.content { padding: 18px 16px 110px; max-width: 760px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.page-head h1 { flex: 1; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; min-height: 60px; border: 0; background: none;
  color: var(--ink2); font-size: 12px; font-weight: 650; text-decoration: none; cursor: pointer; }
.tab .pill { width: 56px; height: 30px; border-radius: 999px; display: grid; place-items: center; }
.tab.on { color: var(--ink); }
.tab.on .pill { background: var(--info-bg); color: var(--primary); }
.tab.on span:last-child { color: var(--primary); }
.fab { position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 7; height: 56px; padding: 0 20px 0 16px; border-radius: 18px; border: 0;
  background: var(--brand); color: var(--on-brand); font-weight: 750; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }

@media (min-width: 900px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .tabbar { position: sticky; top: 61px; align-self: start; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); height: calc(100dvh - 61px);
    background: transparent; padding: 14px 10px; gap: 4px; grid-row: 2; }
  .tab { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 0 10px; min-height: 48px; border-radius: 999px; }
  .tab .pill { width: auto; height: auto; background: none !important; }
  .tab.on { background: var(--info-bg); color: var(--primary); }
  main.content { padding-bottom: 40px; grid-row: 2; }
  .fab { bottom: 28px; right: 28px; }
}

/* ───── inicio ───── */
.greet { font-size: 15px; color: var(--ink2); }
.howami .big { font-size: 22px; font-weight: 800; margin-top: 6px; line-height: 1.3; }
.howami .light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--line); margin-right: 8px; vertical-align: middle; }
.empty { text-align: center; padding: 30px 16px; color: var(--ink2); }
.empty .em-ic { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--soft); color: var(--primary); }
.empty .em-ic svg { width: 32px; height: 32px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.roadmap { list-style: none; padding: 0; margin: 10px 0 0; }
.roadmap li { display: flex; gap: 10px; padding: 8px 0; align-items: center; }
.roadmap .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--ink2); font-size: 13px; font-weight: 800; flex: none; }
.roadmap .done .dot { background: var(--good-bg); color: var(--good); }
.roadmap .done .dot svg { width: 16px; height: 16px; }

/* ───── primer uso ───── */
.steps { display: flex; gap: 6px; margin: 4px 0 22px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--primary); }
.choice-grid { display: grid; gap: 10px; margin-top: 16px; }
.choice { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); text-align: left; cursor: pointer; min-height: 64px; }
.choice .lead { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--primary); flex: none; }
.choice.on { border-color: var(--primary); background: var(--info-bg); }
.choice .t { font-weight: 700; } .choice .s { font-size: 14px; color: var(--ink2); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips-pick button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; }
.chips-pick button.on { border-color: var(--primary); background: var(--info-bg); color: var(--primary); }
.logo-pick { display: flex; gap: 16px; align-items: center; margin-top: 18px; }
.logo-box { width: 84px; height: 84px; border-radius: 20px; border: 2px dashed var(--line); display: grid; place-items: center; overflow: hidden; background: var(--card); color: var(--ink2); cursor: pointer; flex: none; }
.logo-box img { width: 100%; height: 100%; object-fit: cover; }
.swatches { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
.preview { margin-top: 18px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.preview .bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.preview .body { padding: 12px; display: flex; gap: 8px; }
.wizard-nav { margin-top: auto; padding-top: 24px; display: flex; gap: 10px; }
.wizard-nav .btn { flex: 1; }

/* ───── hojas (diálogos) ───── */
dialog.sheet { border: 0; padding: 0; background: var(--card); color: var(--ink); width: min(520px, 100%); max-height: 92dvh; border-radius: 22px; margin: auto; }
@media (max-width: 600px) { dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); } }
dialog.sheet::backdrop { background: rgba(10, 18, 22, .5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 0 20px; }
.sheet-body { padding: 8px 20px 22px; }
.sheet-body > p + p { margin-top: 10px; }
.link-box { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--soft); font-size: 14px; word-break: break-all; font-family: ui-monospace, monospace; }

#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center; transition: .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-action { background: none; border: 0; color: var(--accent); font-weight: 800; cursor: pointer; }
.loading { display: grid; place-items: center; min-height: 100dvh; color: var(--ink2); }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: s .8s linear infinite; }
@keyframes s { to { transform: rotate(1turn); } }
.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; margin-top: 12px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 999px; background: none; font-weight: 650; cursor: pointer; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ───── recortar logo ───── */
.crop-wrap { width: min(280px, 100%); aspect-ratio: 1; margin: 14px auto 8px; border-radius: 28px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(12,38,65,.12); }
.crop-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.crop-canvas:active { cursor: grabbing; }
.crop-tools { display: flex; align-items: center; gap: 10px; max-width: 300px; margin: 0 auto; }
.crop-zoom { flex: 1; accent-color: var(--primary); height: 32px; }

/* ───── productos ───── */
.thumb { border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.empty { background: var(--info-bg); color: var(--primary); font-weight: 800; font-size: 14px; }
.row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.qty { font-size: 20px; font-weight: 800; line-height: 1; }
.qty.warn { color: var(--warn); } .qty.bad { color: var(--bad); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.inv-summary { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.inv-summary .big { font-size: 26px; font-weight: 800; }
.search { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 0 14px; min-height: 50px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); }
.search:focus-within { border-color: var(--primary); }
.search svg { color: var(--ink2); width: 20px; height: 20px; }
.search input { flex: 1; border: 0; background: none; outline: none; min-height: 46px; }
.chips-pick.filters { flex-wrap: nowrap; overflow-x: auto; margin: 12px -16px 12px; padding: 2px 16px; scrollbar-width: none; }
.chips-pick.filters button { white-space: nowrap; min-height: 38px; font-size: 14px; }
.prod-head { display: flex; gap: 16px; align-items: flex-start; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.variants { display: grid; gap: 10px; }
.variant { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.v-top { display: flex; gap: 12px; align-items: center; }
.v-top .title { font-weight: 700; } .v-top .sub { color: var(--ink2); font-size: 14px; }
.v-stock { text-align: right; } .v-stock .qty { font-size: 26px; }
.v-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.v-actions .btn { min-height: 42px; padding: 0 6px; font-size: 14px; gap: 4px; }
.v-actions .btn .ic svg { width: 18px; height: 18px; }
.row.move { cursor: default; }
.delta { min-width: 52px; font-weight: 800; font-size: 17px; text-align: center; padding: 6px 4px; border-radius: 10px; background: var(--soft); }
.delta.in { color: var(--good); background: var(--good-bg); } .delta.out { color: var(--bad); background: var(--bad-bg); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; min-width: 0; }
.mini > span:first-child { font-size: 13px; font-weight: 650; color: var(--ink2); }
.mini input { min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); width: 100%; font-variant-numeric: tabular-nums; }
.mini input:focus { border-color: var(--primary); outline: none; }
.mini.ro b { font-size: 20px; padding: 8px 0 0; }
.mini.inline { flex-direction: row; align-items: center; gap: 10px; margin: 0; }
.mini.inline > span { font-size: 15px; color: var(--ink); font-weight: 600; }
.mini.inline input { width: 80px; text-align: center; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.switch input { width: 22px; height: 22px; accent-color: var(--primary); }
.attr { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 12px; }
.attr-head { display: flex; align-items: center; gap: 8px; }
.attr-name { flex: 1; font-weight: 700; border: 0; border-bottom: 1.5px dashed var(--line); background: none; min-height: 40px; padding: 0 2px; }
.attr-name:focus { outline: none; border-bottom-color: var(--primary); }
.values { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.value { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--info-bg); color: var(--primary); font-weight: 650; font-size: 14px; }
.value button { border: 0; background: none; color: inherit; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.values input { flex: 1; min-width: 140px; min-height: 36px; border: 0; background: none; outline: none; }
.vtable { display: grid; gap: 4px; }
.vrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: end; }
.vrow:first-child { border-top: 0; }
.vrow .vname { grid-column: 1 / -1; font-weight: 750; }
.vrow .mini { margin-top: 6px; }
.vrow.all { background: var(--soft); margin: 0 -12px; padding: 10px 12px; border-radius: 12px; border: 0; }
.vrow.all .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 640px) { .vrow { grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr; } .vrow .vname { grid-column: auto; align-self: center; } .vrow.all .btn { grid-column: auto; } }
textarea.plain { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); resize: vertical; }
ul.errs { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }

/* ───── ventas y clientes ───── */
.money { font-size: 17px; font-weight: 800; }
.money.bad, .big.bad { color: var(--bad); }
.chip.good { background: var(--good-bg); color: var(--good); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stats3 .card { margin: 0 !important; padding: 12px; }
.stats3 .big { font-size: 19px; font-weight: 800; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.contact .btn { min-height: 42px; }
.pick-list { margin-top: 8px; box-shadow: none; }
.pick-list:empty { display: none; }
.row.picked { border: 0; }
.list > .row.picked { min-height: 64px; }
.items { display: grid; gap: 0; margin-top: 10px; }
.item { padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-top { display: flex; align-items: flex-start; gap: 8px; }
.item-top .title { font-weight: 700; } .item-top .sub { color: var(--ink2); font-size: 14px; }
.free-name { flex: 1; min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--card); font-weight: 650; }
.item-bottom { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 42px; height: 42px; border: 0; background: var(--soft); font-size: 22px; font-weight: 700; cursor: pointer; color: var(--primary); }
.stepper input { width: 48px; height: 42px; border: 0; text-align: center; font-weight: 750; background: var(--card); font-variant-numeric: tabular-nums; }
.stepper .unit { padding: 0 10px 0 2px; color: var(--ink2); font-size: 14px; font-weight: 650; background: var(--card); align-self: stretch; display: grid; place-items: center; }
.price-in { display: flex; align-items: center; gap: 6px; color: var(--ink2); }
.price-in input { width: 84px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; text-align: right; background: var(--card); font-variant-numeric: tabular-nums; }
.line-total { margin-left: auto; font-size: 17px; }
details.discount { margin-top: 12px; }
details.discount summary { cursor: pointer; color: var(--primary); font-weight: 650; font-size: 14px; }
details.discount .mini.inline { margin-top: 10px; }
.total-bar { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 4; margin: 18px -16px 0; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(12,38,65,.06); }
.total-bar .big { font-size: 24px; font-weight: 800; }
@media (min-width: 900px) { .total-bar { bottom: 0; margin: 18px 0 0; border-radius: 16px; border: 1px solid var(--line); } }
.qty-badge { min-width: 52px; padding: 6px 8px; border-radius: 10px; background: var(--info-bg); color: var(--primary); font-weight: 800; text-align: center; font-size: 14px; flex: none; }
.totals { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.totals > div { display: flex; justify-content: space-between; }
.totals .total { font-size: 19px; font-weight: 800; }
.paste-list { display: grid; gap: 10px; margin-top: 12px; max-height: 55dvh; overflow: auto; }
.paste-row { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.paste-row.need { border-color: var(--warn); background: var(--warn-bg); }
.paste-row.off { opacity: .55; }
.paste-line { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink2); }
.paste-line svg { width: 18px; height: 18px; color: var(--good); }
.paste-row.need .paste-line svg { color: var(--warn); }
.paste-pick { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.paste-pick select { flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--card); }
.qty-in { width: 64px; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; background: var(--card); font-weight: 750; }
.paste-pick .unit { color: var(--ink2); font-weight: 650; font-size: 14px; min-width: 18px; }
.field select { min-height: 50px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }

.howami .light.good { background: var(--good); } .howami .light.warn { background: var(--accent); } .howami .light.bad { background: var(--bad); }
.howami .good { color: var(--good); } .howami .bad { color: var(--bad); }
dialog.sheet { overflow-x: hidden; }
.paste-list > *, .paste-pick > * { min-width: 0; }
.paste-pick select { max-width: 100%; text-overflow: ellipsis; }
.item-top .grow { flex: 1; min-width: 0; }
.item-bottom { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.price-in input { width: 100%; max-width: 92px; }
.line-total { margin-left: 0; text-align: right; min-width: 64px; }
.row .title.wrap { white-space: normal; }
.row-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; border: 0; background: none; text-align: left; cursor: pointer; padding: 0; color: inherit; }

/* ───── comprobantes ───── */
.head-actions { display: flex; gap: 0; flex-wrap: wrap; justify-content: flex-end; }
.head-actions .btn { padding: 0 8px; }
.card.drop { text-align: center; border: 2px dashed var(--line); }
.card.drop .em-ic { margin: 0 auto 10px; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--info-bg); color: var(--primary); }
.receipt-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.receipt-img { width: 110px; flex: none; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: var(--card); display: block; }
.receipt-img img { width: 100%; display: block; max-height: 220px; object-fit: cover; object-position: top; }
.receipt-img.empty { height: 110px; display: grid; place-items: center; color: var(--ink2); font-weight: 800; }
.kv { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-child { border-top: 0; }
.kv span { color: var(--ink2); width: 110px; flex: none; }
.kv b { font-weight: 650; overflow-wrap: anywhere; }
ul.checks.card { list-style: none; margin-top: 14px; padding-left: 16px; }
.checks li { padding: 4px 0 4px 24px; position: relative; font-size: 15px; }
.checks li::before { position: absolute; left: 0; font-weight: 800; }
.c-ok::before { content: "✓"; color: var(--good); } .c-warn::before { content: "!"; color: var(--warn); left: 6px; } .c-bad::before { content: "✗"; color: var(--bad); }
.c-info { color: var(--ink2); } .c-info::before { content: "i"; left: 6px; font-style: italic; color: var(--ink2); }
.choice-row input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.choice-row.on { background: var(--info-bg); }
.choice-row .title { white-space: normal; }
pre.transcript { white-space: pre-wrap; background: var(--soft); padding: 12px; border-radius: 12px; font-size: 13px; max-height: 260px; overflow: auto; }
.pay-due { padding: 14px 16px; border-top: 1px solid var(--line); }
.list > .pay-due:first-child { border-top: 0; }
.pay-due .title { font-weight: 750; font-size: 17px; }
.pay-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pay-actions .btn { flex: 1; min-height: 44px; }

.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.flow b { font-size: 17px; } .flow .good { color: var(--good); } .flow .bad { color: var(--bad); }
details.more-stats summary { cursor: pointer; color: var(--primary); font-weight: 650; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.month-nav b { text-transform: capitalize; font-size: 17px; }
.deliveries { display: grid; gap: 12px; margin-top: 14px; }
.card.delivery.going { border-color: var(--primary); box-shadow: 0 0 0 2px var(--info-bg); }
.d-top { display: flex; align-items: flex-start; gap: 10px; }
.d-top .title { font-weight: 750; font-size: 17px; } .d-top .sub { color: var(--ink2); font-size: 14px; }
.d-addr { margin-top: 8px; font-weight: 600; }
.d-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.d-links .btn { min-height: 42px; padding: 0 14px; }
.d-items { margin-top: 10px; } .d-items summary { cursor: pointer; color: var(--primary); font-weight: 650; font-size: 14px; }
.d-items pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; font-size: 15px; }
.d-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.d-actions .btn { flex: 1; min-width: 120px; }
.cuadre { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cuadre .big { font-size: 22px; font-weight: 800; }
.item-bottom.buy { grid-template-columns: 1fr 1fr auto; align-items: end; }
.item-bottom.buy .mini { margin-top: 0; }
.recipe-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.recipe-btns { display: flex; gap: 6px; }
.recipe-btns .btn { min-height: 40px; }
.card.ai-fill { display: flex; align-items: center; gap: 12px; background: var(--info-bg); border-color: transparent; margin-bottom: 14px; }
.card.ai-fill .lead { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--primary); flex: none; }
.card.ai-fill .grow { flex: 1; min-width: 0; }
ul.prep { margin: 10px 0 0; padding-left: 18px; font-size: 16px; line-height: 1.7; }
body.ro .fab, body.ro a[href$="/editar"], body.ro .write { display: none !important; }
.perm-checks { display: grid; gap: 4px; margin-top: 8px; }
.perm-checks label.perm { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 2px; font-size: 16px; cursor: pointer; }
.perm-checks input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.list.log .title { white-space: normal; overflow: visible; text-overflow: clip; }
ul.plain { padding: 0; }
ul.plain li { margin: 4px 0; line-height: 1.45; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 4px 0 10px; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.meter span.full { background: var(--bad); }
.plans { display: grid; gap: 12px; }
@media (min-width: 720px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card.plan { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.card.plan.mine { border: 2px solid var(--primary); }
.plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan-top .price b { font-size: 22px; }
ul.feats { margin: 4px 0 0 18px; font-size: 15px; }
.list.admin .sub { white-space: normal; }

/* ───────── catálogo público ───────── */
.catalog { max-width: 960px; margin: 0 auto; padding: 16px 16px 120px; }
.cat-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 14px; }
.cat-head h1 { font-size: 24px; line-height: 1.2; }
.cat-note { margin-bottom: 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat-card { display: flex; flex-direction: column; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.cat-card.out { opacity: .65; }
.cat-photo { display: grid; place-items: center; aspect-ratio: 1; background: var(--tint, var(--info-bg)); font-weight: 800; font-size: 28px; color: var(--primary); }
.cat-photo img { width: 100%; height: 100%; object-fit: contain; }
.cat-info { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.cat-info .title { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.cat-info .price { color: var(--ink2); font-size: 15px; }
.cat-info .chip { align-self: flex-start; }
.cat-big { border-radius: 14px; overflow: hidden; margin-bottom: 10px; display: grid; place-items: center; max-height: 280px; }
.cat-big img { max-width: 100%; max-height: 280px; object-fit: contain; }
.chips-pick button.off { opacity: .55; text-decoration: line-through; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.qty-row b { min-width: 56px; text-align: center; font-size: 18px; }
.qty-row.small { margin-top: 0; gap: 4px; }
.qty-row.small b { min-width: 44px; font-size: 16px; }
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; }
.cart-bar .cart-btn { pointer-events: auto; width: 100%; max-width: 560px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.cat-photo.empty { aspect-ratio: 2.2; font-size: 22px; }
.icon-btn.bell { position: relative; }
.icon-btn.bell .badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
