/* Inventario: blanco con oro líquido. */
:root {
  --white: #ffffff;
  --paper: #fbf9f4;
  --ink: #2b2414;
  --ink-2: #7a6c4e;
  --line: #ece4d0;
  --gold: #b8892b;
  --gold-deep: #8a6418;
  --liquid: linear-gradient(115deg, #7d5a12 0%, #c99a35 18%, #fff0c2 32%, #d6ab4a 46%, #8f6a1c 62%, #f3d98c 78%, #a57a23 100%);
  --r: 14px;
  /* Relieve (el lenguaje visual de la oficina, en dorado): fondo tibio, tarjetas blancas con sombra en capas,
     brillo dorado en la esquina y botones con luz arriba y sombra abajo. */
  --display: "Inter", system-ui, sans-serif;
  --bg: #faf8f3;
  --edge: rgba(43, 36, 20, .09);
  --muted: rgba(43, 36, 20, .05);
  --sh-xs: 0 1px 2px rgba(43, 36, 20, .06);
  --sh-card: 0 1px 2px rgba(43, 36, 20, .05), 0 8px 20px -12px rgba(43, 36, 20, .22);
  --sh-pop: 0 24px 60px -20px rgba(43, 36, 20, .45);
  --relieve: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(90, 60, 0, .18), 0 1px 2px rgba(90, 60, 0, .3), 0 6px 14px -6px rgba(90, 60, 0, .5);
  --tint: radial-gradient(130% 90% at 0% 0%, rgba(214, 171, 74, .12), transparent 55%);
  --ring: 0 0 0 3px rgba(214, 171, 74, .28);
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--white); color: var(--ink); }
body {
  font: 15px/1.45 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 calc(96px + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--gold-deep); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Oro líquido: un degradado metálico que fluye despacio. */
.liquid { background: var(--liquid); background-size: 320% 100%; animation: flow 9s ease-in-out infinite alternate; }
.liquid-text {
  background: var(--liquid); background-size: 320% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: flow 9s ease-in-out infinite alternate;
}
@keyframes flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { .liquid, .liquid-text { animation: none; } }

header { padding: 24px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font: 600 32px/1.05 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.who { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.menu-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold-deep); display: grid; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; }
.rule { height: 2px; border-radius: 2px; margin: 12px 0 16px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.stat b { display: block; font: 600 20px/1.1 var(--display); }
.stat span { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.btn.gold { color: #2a1f05; }
.btn.line { border: 1.5px solid var(--gold); color: var(--gold-deep); background: var(--white); }
.btn.ghost { color: var(--ink-2); }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 20px; height: 20px; }

.engine { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 10px; }
.engine button { height: 38px; border-radius: 999px; font-size: 13px; color: var(--ink-2); line-height: 1.1; }
.engine button.on { color: #2a1f05; font-weight: 600; }
.engine button small { display: block; font-size: 10.5px; font-weight: 400; opacity: .8; }
.engine button:disabled { opacity: .4; }

.recv { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-bottom: 10px; }
.recv-note { font-size: 12px; color: var(--ink-2); margin: -4px 0 10px; }

.capture { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.capture .btn { height: 58px; font-size: 16px; padding: 0 12px; }

.tray { display: none; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 18px; background: var(--paper); }
.tray.on { display: block; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { position: relative; flex: 0 0 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); font-size: 14px; line-height: 22px; }
.tray-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.hint { font-size: 12px; color: var(--ink-2); }

.loader { display: none; text-align: center; padding: 28px 0; }
.loader.on { display: block; }
.loader .bar { height: 6px; border-radius: 6px; margin: 0 auto 12px; max-width: 260px; }
.loader p { color: var(--ink-2); font-size: 13px; }

.review { margin-bottom: 22px; }
.meta { font-size: 12px; color: var(--ink-2); margin: 0 0 10px; }
.card { border: 1.5px solid var(--gold); border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: var(--white); }
.card h3 { font: 600 18px/1.2 var(--display); margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
label input, label select {
  display: block; width: 100%; margin-top: 4px; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 15px; text-transform: none; letter-spacing: 0;
}
label input:focus, label select:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: transparent; }
label.doubt input { border-color: var(--gold); background: #fffaf0; }
label.doubt::after { content: ' · revisar'; color: var(--gold-deep); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tog { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.tog.on { border-color: transparent; color: #2a1f05; font-weight: 600; }
.note { font-size: 12px; color: var(--gold-deep); margin-top: 10px; }
.warn { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--gold); font-size: 13px; font-weight: 600; color: var(--gold-deep); }
.dup { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: 13px; display: grid; gap: 8px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }
.card-foot > div:last-child { display: flex; gap: 4px; }
.card-foot .btn { padding: 0 16px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 40px; }
.stepper button { width: 40px; height: 40px; font-size: 20px; color: var(--gold-deep); }
.stepper span { min-width: 26px; text-align: center; font-weight: 600; }

.filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar, .thumbs::-webkit-scrollbar, .photos::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); background: var(--white); }
.chip.on { border-color: var(--gold); color: var(--gold-deep); font-weight: 600; }
.find { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.search, .find select { height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--white); min-width: 0; }
.find select { max-width: 150px; font-size: 13px; color: var(--ink-2); }
.search:focus, .find select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

.list { border-top: 1px solid var(--line); }
.item { border-bottom: 1px solid var(--line); }
.item-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; width: 100%; text-align: left; }
.item-row img, .ph { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--paper); }
.item-name { font-weight: 600; line-height: 1.25; }
.item-sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.due { text-align: right; font-size: 12px; white-space: nowrap; }
.due b { display: block; font: 600 15px/1.2 var(--display); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; justify-content: flex-end; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.tag.fill { color: #2a1f05; }
.tag.edge { border: 1px solid var(--gold); color: var(--gold-deep); }
.tag.soft { color: var(--ink-2); border: 1px solid var(--line); }
.item.vencido .item-name, .item.muestra .item-name { text-decoration: line-through; text-decoration-color: var(--gold); }
.detail { display: none; padding: 0 0 14px 64px; }
.item.open .detail { display: block; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--ink-2); }
.kv dd { font-variant-numeric: tabular-nums; word-break: break-word; }
.photos { display: flex; gap: 6px; margin: 10px 0; overflow-x: auto; }
.photos img { height: 110px; border-radius: 10px; border: 1px solid var(--line); }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 0; }

/* Ingreso */
.auth { min-height: 86dvh; display: grid; place-items: center; padding: 24px 0; }
.auth form { width: min(420px, 100%); }
.auth h1 { font-size: 44px; text-align: center; margin-bottom: 6px; }
.auth .lead { text-align: center; color: var(--ink-2); margin-bottom: 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { height: 44px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--gold-deep); font-weight: 600; border-color: var(--gold); }
.stack { display: grid; gap: 12px; }
.sub { font-weight: 600; font-size: 13px; margin-top: 6px; }
.types { display: grid; gap: 8px; }
.type { text-align: left; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.type b { display: block; font: 600 17px/1.2 var(--display); }
.type span { font-size: 12.5px; color: var(--ink-2); }
.type.on { border: 1.5px solid var(--gold); background: #fffaf0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { height: 36px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.seg button.on { color: #2a1f05; font-weight: 600; }
.auth .btn.gold { width: 100%; margin-top: 4px; }
.err { color: var(--gold-deep); font-size: 13px; min-height: 20px; text-align: center; }

/* Menú */
.sheet-bg { position: fixed; inset: 0; background: rgba(43, 36, 20, .25); display: none; z-index: 10; }
.sheet-bg.on { display: block; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--white); z-index: 11; overflow-y: auto;
  transform: translateX(100%); transition: transform .25s; padding: calc(20px + env(safe-area-inset-top)) 18px 40px; border-left: 1px solid var(--line); }
.sheet.on { transform: none; }
.sheet h2 { font: 600 24px/1.1 var(--display); padding-right: 40px; }
.sheet h4 { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 8px; }
.sheet .close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; font-size: 24px; color: var(--ink-2); }
.code { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px dashed var(--gold); border-radius: var(--r); padding: 10px 14px; }
.code b { font: 600 22px/1 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: var(--gold-deep); }
.prov { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.prov small { display: block; color: var(--ink-2); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

[hidden] { display: none !important; }

/* Vistas: resumen, inventario y ventas */
.views { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 16px; }
.views button { height: 40px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }
.views button.on { color: #2a1f05; font-weight: 600; }
.views .n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--gold); color: var(--gold-deep); background: var(--white); }
.brief { border: 1.5px solid var(--gold); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; background: var(--paper); }
.brief h2 { font: 600 18px/1.2 var(--display); margin-bottom: 6px; }
.brief p { font-size: 14.5px; line-height: 1.5; }
.brief p + p { margin-top: 6px; }
.sec { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 6px; }
.aviso { display: grid; grid-template-columns: 104px 1fr; gap: 2px 10px; width: 100%; text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); }
.aviso .tag { justify-self: start; align-self: start; margin-top: 2px; white-space: nowrap; }
.aviso b { font-weight: 600; line-height: 1.3; }
.aviso p { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.aviso .go { color: var(--gold-deep); font-weight: 600; white-space: nowrap; }
.hrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hrow small { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.hbar { grid-column: 1 / -1; height: 6px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--gold); }
.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; height: 160px; border-bottom: 1px solid var(--ink-2); }
.chart .col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 1px; }
.chart .bar { width: 100%; max-width: 24px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--gold); transition: opacity .15s; }
.chart .col.hoy .bar { background: var(--gold-deep); }
.chart .lbl { font-size: 10.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart.sel .col:not(.on) .bar { opacity: .4; }
.xaxis { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; margin-top: 4px; font-size: 10.5px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; }
.readout { min-height: 20px; margin-top: 8px; font-size: 13px; }
.per { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.per button { height: 34px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.per button.on { color: #2a1f05; font-weight: 600; }
.mov { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mov small { color: var(--ink-2); font-size: 12px; }
.mov .r { text-align: right; font-variant-numeric: tabular-nums; }
.mov button { color: var(--gold-deep); font-size: 12px; font-weight: 600; }
.salida { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.salida .t, .salida .full { grid-column: 1 / -1; }
.salida .t { font-size: 13px; font-weight: 600; }
.demo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.demo .filters { justify-content: center; flex-wrap: wrap; margin: 8px 0 6px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 20;
  background: var(--ink); color: var(--white); padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .detail { padding-left: 0; }
}

/* ---------- Módulos ---------- */
.top { padding: 18px 0 6px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.top h1 { font-size: 26px; }
.back { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold-deep); display: grid; place-items: center; font-size: 20px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; text-align: left; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 14px 14px; min-height: 128px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: var(--white); }
.tile:first-child { border: 1.5px solid var(--gold); }
.tile svg { width: 28px; height: 28px; color: var(--gold-deep); }
.tile b { display: block; font: 600 18px/1.15 var(--display); }
.tile small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.3; }
.tile .dot { position: absolute; top: 14px; right: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px #fff3d6; }
.tile .n { position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #2a1f05; }
.bar-top { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.bar-top .search { flex: 1; }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.row { text-decoration: none; color: inherit; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; width: 100%; text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row .r { text-align: right; font-variant-numeric: tabular-nums; }
.row small, .row .sub2 { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.row b.big { font: 600 17px/1.2 var(--display); }
.list.rows { border-top: 1px solid var(--line); }
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: var(--white); }
.panel.gold { border: 1.5px solid var(--gold); }
.panel.paper { background: var(--paper); }
.panel h3 { font: 600 18px/1.2 var(--display); margin-bottom: 8px; }
.lote { border-top: 1px solid var(--line); padding: 12px 0; }
.lote:first-child { border-top: 0; }
.lote-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.mini th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mini td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.mini td.r, .mini th.r { text-align: right; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btns .btn { flex: 1; min-width: 120px; }
.wide { width: 100%; }
.up { color: var(--gold-deep); font-weight: 600; }
.down { color: var(--ink-2); font-weight: 600; }

/* Caja */
.pos-results { border: 1px solid var(--line); border-radius: var(--r); margin: -4px 0 12px; overflow: hidden; }
.pos-results button { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.pos-results button:last-child { border-bottom: 0; }
.pos-results small { color: var(--ink-2); font-size: 12px; }
.pos-results .r { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-results button:disabled { opacity: .45; }
.tline { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.tline .r { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tline small { color: var(--ink-2); font-size: 12px; }
.tline .stepper { height: 36px; justify-self: start; }
.tline .stepper button { width: 36px; height: 36px; }
.pay-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--white); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.pay-bar .wrap2 { max-width: 688px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.pay-bar .t { font: 600 24px/1 var(--display); }
.pay-bar .t small { display: block; font: 12px Inter, sans-serif; color: var(--ink-2); margin-top: 3px; }
.pay-bar .btn { height: 52px; padding: 0 26px; font-size: 16px; }
.total-big { font: 600 40px/1 var(--display); text-align: center; margin: 6px 0 2px; }
.total-sub { text-align: center; color: var(--ink-2); font-size: 13px; margin-bottom: 14px; }
.medios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.medio { height: 44px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.medio.on { border-color: transparent; color: #2a1f05; font-weight: 600; }
.pago { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.pago .t { grid-column: 1 / -1; display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.bills { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.cambio { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 12px; background: var(--paper); }
.cambio b { font: 600 26px/1 var(--display); }
.falta { color: var(--gold-deep); font-weight: 600; text-align: center; margin: 8px 0; }
.receipt { border: 1.5px dashed var(--gold); border-radius: var(--r); padding: 18px 16px; font-variant-numeric: tabular-nums; background: var(--white); }
.receipt h3 { text-align: center; font: 600 20px/1.2 var(--display); }
.receipt .c { text-align: center; color: var(--ink-2); font-size: 12px; }
.receipt .ln { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 14px; padding: 4px 0; }
.receipt hr { border: 0; border-top: 1px dashed var(--line); margin: 10px 0; }
.receipt .tot { font: 600 20px/1.2 var(--display); }
.cajabar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: 12px; font-size: 13px; }
.cajabar b { font-weight: 600; }
.cajabar .btns { margin: 0; flex-wrap: nowrap; }
.cajabar .btns .btn { min-width: 0; flex: none; }
video.scan { width: 100%; border-radius: var(--r); margin-bottom: 12px; background: #000; max-height: 240px; object-fit: cover; }
body.pos { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- Celular primero ---------- */
body { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
body.pos { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
/* 16 px en los campos: con menos, el iPhone hace zoom al escribir. */
input, select, .search, label input, label select { font-size: 16px; }
.top { padding: 14px 0 4px; grid-template-columns: auto 1fr; }
.top h1 { font-size: 24px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center;
  backdrop-filter: blur(8px); }
.dock-side { display: grid; justify-items: center; gap: 2px; color: var(--ink-2); font-size: 11px; text-decoration: none; padding: 4px 0; }
.dock-side svg { width: 24px; height: 24px; color: var(--gold-deep); }
.dock-main { height: 56px; border-radius: 999px; display: grid; place-items: center; padding: 0 18px; font-weight: 600; font-size: 17px;
  color: #2a1f05; text-decoration: none; box-shadow: 0 6px 18px rgba(138, 100, 24, .28); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-main:disabled { opacity: .45; box-shadow: none; }
.dock-main > span, .dock-main > small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dock-main.doble { align-content: center; gap: 1px; line-height: 1.1; }
.dock-main.doble > small { font-size: 13px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.hero { border: 1.5px solid var(--gold); border-radius: 18px; padding: 16px; margin-bottom: 12px; background: var(--paper); }
.hero .k { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.hero .v { font: 600 40px/1.05 var(--display); margin: 4px 0; }
.hero .s { font-size: 13px; color: var(--ink-2); }
.delta { font-weight: 600; font-size: 13px; }
.delta.up { color: var(--gold-deep); }
.delta.down { color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.kpi b { display: block; font: 600 22px/1.1 var(--display); }
.kpi span { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.kpi .delta { display: block; margin-top: 4px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.qt { position: relative; min-height: 78px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; background: var(--white); }
.qt b { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.qt span { font-size: 13px; color: var(--gold-deep); font-weight: 600; font-variant-numeric: tabular-nums; }
.qt .q { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #2a1f05; }
.qt:disabled { opacity: .4; }
.qt:active { transform: scale(.97); }
.alerts { display: grid; gap: 8px; }
.alert { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.alert.alta { border: 1.5px solid var(--gold); background: #fffaf0; }
.alert .lv { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gold); }
.alert.alta .lv { background: var(--gold-deep); border-color: var(--gold-deep); }
.alert.media .lv { background: var(--gold); }
.alert b { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.alert .chev { color: var(--ink-2); }
.alert p { grid-column: 2 / -1; font-size: 13px; color: var(--ink-2); }
.pick { display: grid; gap: 8px; }
.pick button { text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pick button small { color: var(--ink-2); font-size: 12px; display: block; margin-top: 2px; }
.pick button.on { border: 2px solid var(--gold); background: #fffaf0; font-weight: 600; }
.step { font-size: 13px; font-weight: 600; color: var(--gold-deep); margin: 18px 0 8px; }
.step:first-of-type { margin-top: 6px; }
.sumbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--paper); margin-bottom: 12px; font-size: 14px; }
.sumbar b { font: 600 20px/1 var(--display); }
.add { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 600; color: #2a1f05; flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--gold-deep); font-weight: 600; font-size: 14px; padding: 8px 0; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-size: 15px; }
.check .box { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--gold); display: grid; place-items: center; flex: none; color: #2a1f05; font-weight: 700; }
.check.on .box { background: var(--gold); }
.check small { display: block; color: var(--ink-2); font-size: 12px; }
@media (min-width: 560px) { .quick { grid-template-columns: repeat(4, 1fr); } .dock { grid-template-columns: 80px minmax(0, 420px) 80px; justify-content: center; } }

/* ---------- Relieve: el estilo de la oficina, en dorado ----------
   Solo cambia la apariencia; la estructura y los botones siguen donde estaban. */
html, body { background: radial-gradient(900px 420px at 100% -8%, rgba(214, 171, 74, .13), transparent 62%), var(--bg); }
body { font-feature-settings: "cv11", "ss01"; }
h1 { font-weight: 800; letter-spacing: -0.035em; }
.top h1 { font-size: 26px; }
.rule { height: 1.5px; -webkit-mask: linear-gradient(90deg, #000 55%, transparent); mask: linear-gradient(90deg, #000 55%, transparent); }
.card h3, .panel h3, .tile b, .type b, .brief h2, .sheet h2, .receipt h3 { font-weight: 700; letter-spacing: -0.02em; }
.hero .v, .kpi b, .stat b, .total-big, .pay-bar .t, .cambio b, .sumbar b, .due b, .row b.big, .receipt .tot { font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sec { font-size: 10.5px; letter-spacing: .14em; color: rgba(122, 108, 78, .9); }

/* Tarjetas: blancas, borde fino, sombra en capas y un brillo dorado en la esquina. */
.tile, .panel, .kpi, .stat, .card, .alert, .pick button, .qt, .type, .brief, .tray, .salida, .pos-results, .list, .cajabar, .code, .auth form {
  background: var(--tint), var(--white); border: 1px solid var(--edge); box-shadow: var(--sh-card);
}
.tile, .panel, .card, .alert, .pick button, .type, .list, .auth form { border-radius: 18px; }
.list { border-top: 1px solid var(--edge); padding: 0 14px; }
.list > :last-child, .list .item:last-child { border-bottom: 0; }
.tile:first-child, .panel.gold, .card, .alert.alta, .pick button.on, .type.on {
  border-color: rgba(184, 137, 43, .5);
  background: radial-gradient(130% 90% at 0% 0%, rgba(214, 171, 74, .2), transparent 58%), var(--white);
  box-shadow: var(--sh-card), 0 0 0 3px rgba(214, 171, 74, .1);
}
.pick button.on { border-width: 1px; }
.panel.paper, .sumbar, .cambio, .dup { background: linear-gradient(180deg, #fffdf8, #f7f1e3); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 #fff; }
.code { border-style: dashed; border-color: rgba(184, 137, 43, .6); }
.auth form { padding: 24px 20px; }
.tile:active, .qt:active, .pick button:active, .alert:active, .row:active, .type:active { transform: scale(.98); }
.tile, .qt, .pick button, .alert, .row, .type { transition: transform .12s, box-shadow .2s, border-color .2s; }

/* Ícono de cada módulo dentro de una ficha con relieve. */
.tile svg { width: 46px; height: 46px; padding: 10px; border-radius: 14px; color: var(--gold-deep);
  background: linear-gradient(180deg, #fffaf0, #f4e7c6); box-shadow: inset 0 0 0 1px rgba(184, 137, 43, .28), inset 0 1px 0 #fff, 0 2px 6px -2px rgba(90, 60, 0, .25); }
.tile b { font-size: 17px; }

/* Halo que da la vuelta por el borde (el BorderBeam de la oficina). */
@property --giro { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes giro { to { --giro: 360deg; } }
.tile:first-child::after, .hero::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--giro), transparent 0 68%, rgba(201, 154, 53, .5) 76%, #fff0c2 82%, #c99a35 87%, transparent 93%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: giro 7s linear infinite;
}

/* La cifra grande: oro líquido que se mueve detrás, como el encabezado de la oficina. */
.hero { position: relative; isolation: isolate; overflow: hidden; border: 1px solid rgba(184, 137, 43, .35); border-radius: 22px; padding: 18px;
  background: radial-gradient(70% 100% at 100% 0%, rgba(243, 217, 140, .5), transparent 62%), linear-gradient(165deg, #fff 0%, #fbf5e6 100%);
  box-shadow: var(--sh-card), inset 0 1px 0 #fff; }
.hero::before { content: ""; position: absolute; z-index: -1; right: -28%; top: -70%; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from var(--giro), #e6c573, #fff4d1, #d9b053, #fff9e6, #f0d282, #e6c573); filter: blur(34px); opacity: .6;
  animation: giro 16s linear infinite; }
.hero .k { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--gold-deep);
  background: rgba(255, 255, 255, .75); border: 1px solid rgba(184, 137, 43, .3); box-shadow: var(--sh-xs); }
.hero .v { font-size: 44px; margin: 10px 0 6px; }

/* Cifras pequeñas: vidrio sobre el fondo. */
.kpi, .stat { background: var(--tint), rgba(255, 255, 255, .78); backdrop-filter: blur(10px); border-radius: 16px; }
.kpi b { font-size: 23px; }
.kpi span { letter-spacing: .08em; font-size: 10.5px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.delta.up { background: rgba(214, 171, 74, .18); color: var(--gold-deep); }
.delta.down { background: var(--muted); color: var(--ink-2); }
.kpi .delta { display: flex; width: fit-content; margin-top: 6px; }

/* Botones con relieve: luz arriba, sombra abajo; al tocar se hunden. */
.btn, .add, .medio, .tog, .chip, .back, .menu-btn, .stepper button, .dock-side { transition: transform .12s, box-shadow .15s, background-color .15s, border-color .15s; }
.btn.gold, .add, .medio.on, .tog.on, .per .on, .seg .on, .engine .on, .views .on, .qt .q, .tile .n, .tag.fill {
  box-shadow: var(--relieve); text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.gold { border: 1px solid rgba(138, 100, 24, .45); }
.btn:active:not(:disabled), .add:active, .medio:active, .tog:active, .chip:active, .back:active, .menu-btn:active { transform: translateY(1px) scale(.98); }
.btn.gold:active:not(:disabled), .add:active { box-shadow: inset 0 2px 4px rgba(90, 60, 0, .35); }
.btn.line { background: linear-gradient(180deg, #fff, #fcf8ee); border: 1px solid rgba(184, 137, 43, .45); box-shadow: inset 0 1px 0 #fff, var(--sh-xs); }
.btn.ghost:active { background: var(--muted); }
.back, .menu-btn { background: linear-gradient(180deg, #fff, #f8f3e7); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 #fff, var(--sh-xs), 0 4px 10px -6px rgba(43, 36, 20, .25); }

/* Opciones sueltas y controles segmentados: riel hundido, opción elegida en relieve. */
.chip, .tog, .medio, .stepper { background: linear-gradient(180deg, #fff, #fbf8f1); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 #fff, var(--sh-xs); }
.chip.on { background: linear-gradient(180deg, #fffaf0, #f6ebcd); border-color: rgba(184, 137, 43, .5); color: var(--gold-deep); box-shadow: inset 0 1px 0 #fff, 0 2px 6px -2px rgba(90, 60, 0, .25); }
.tog.on, .medio.on { border-color: rgba(138, 100, 24, .45); background: var(--liquid); background-size: 320% 100%; }
.per, .seg, .engine, .views { background: var(--muted); border: 1px solid rgba(43, 36, 20, .06); box-shadow: inset 0 1px 2px rgba(43, 36, 20, .08); }

/* Campos: borde fino, sombra mínima y anillo dorado al escribir. */
label input, label select, .search, .find select { border: 1px solid rgba(43, 36, 20, .13); background: var(--white); box-shadow: var(--sh-xs); }
label input:focus, label select:focus, .search:focus, .find select:focus { outline: 0; border-color: var(--gold); box-shadow: var(--ring); }
label.doubt input { box-shadow: var(--ring); }

/* Insignias: fondo al 18 % del color, sin mayúsculas. */
.tag { text-transform: none; letter-spacing: 0; font-size: 11.5px; padding: 2px 9px; }
.tag.edge { border: 1px solid transparent; background: rgba(214, 171, 74, .18); color: var(--gold-deep); }
.tag.soft { border: 1px solid transparent; background: var(--muted); color: var(--ink-2); }
.tile .n, .qt .q { border: 1.5px solid #fff; }
.dot { box-shadow: 0 0 0 3px rgba(214, 171, 74, .22), 0 0 10px rgba(214, 171, 74, .8); animation: latido 1.8s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 6px rgba(214, 171, 74, .08), 0 0 14px rgba(214, 171, 74, .5); } }

/* Avisos. */
.alert .lv { box-shadow: 0 0 0 4px rgba(214, 171, 74, .16); }
.alert.alta .lv { box-shadow: 0 0 0 4px rgba(138, 100, 24, .16), 0 0 8px rgba(184, 137, 43, .6); }

/* Gráficas: rejilla tenue y barras con degradado. */
.chart { border-bottom: 1px solid rgba(43, 36, 20, .2); background: repeating-linear-gradient(to top, rgba(43, 36, 20, .06) 0 1px, transparent 1px 25%); }
.chart .bar { background: linear-gradient(180deg, #e6c573, var(--gold)); }
.chart .col.hoy .bar { background: linear-gradient(180deg, #c99a35, var(--gold-deep)); box-shadow: 0 0 12px -2px rgba(184, 137, 43, .6); }
.hbar { height: 8px; background: linear-gradient(90deg, #e6c573, var(--gold)); }

/* Fotos y comprobante. */
.item-row img, .ph, .thumb { border-color: var(--edge); box-shadow: var(--sh-xs); }
.receipt { box-shadow: var(--sh-card); background: linear-gradient(180deg, #fff, #fffdf7); }

/* Barra de abajo: vidrio. El botón central es la píldora oscura con anillo de oro líquido de la oficina. */
.dock { background: rgba(255, 255, 255, .78); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid var(--edge); box-shadow: 0 -12px 30px -20px rgba(43, 36, 20, .45); }
.dock-side:active { transform: scale(.94); }
.dock-main.liquid { position: relative; isolation: isolate; color: #fff3d0; border: 2px solid transparent;
  background: linear-gradient(180deg, #3d3322, #100c05) padding-box, var(--liquid) border-box; background-size: 100% 100%, 320% 100%;
  box-shadow: 0 0 0 1px rgba(43, 36, 20, .2), 0 18px 14px -14px rgba(43, 36, 20, .35), 0 8px 10px -4px rgba(43, 36, 20, .25), 0 2px 5px rgba(43, 36, 20, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5); letter-spacing: -0.01em; transition: transform .12s, box-shadow .15s; }
.dock-main.liquid::before { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 240, 194, .2) 48%, transparent 60%); background-size: 260% 100%; animation: reflejo 4.5s ease-in-out infinite; }
@keyframes reflejo { 0%, 30% { background-position: 130% 0; } 70%, 100% { background-position: -30% 0; } }
.dock-main.liquid:active:not(:disabled) { transform: translateY(1px) scale(.98); box-shadow: 0 0 0 1px rgba(43, 36, 20, .3), 0 1px 2px rgba(43, 36, 20, .3), inset 0 2px 4px rgba(0, 0, 0, .4); }
.dock-main.liquid:disabled { opacity: .45; }

/* Menú lateral y aviso flotante. */
.sheet-bg { background: rgba(43, 36, 20, .28); backdrop-filter: blur(3px); }
.sheet { background: var(--tint), var(--bg); border-left: 1px solid var(--edge); border-radius: 22px 0 0 22px; box-shadow: var(--sh-pop); transition: transform .32s cubic-bezier(.2, .9, .25, 1); }
.sheet:not(.on) { box-shadow: none; }
.toast { background: linear-gradient(180deg, #3d3322, #100c05); border: 1px solid rgba(255, 255, 255, .1); color: #fff3d0;
  box-shadow: 0 12px 30px -10px rgba(43, 36, 20, .6), inset 0 1px 0 rgba(255, 255, 255, .1); bottom: calc(96px + env(safe-area-inset-bottom)); }

/* Entrada suave de cada pantalla. */
@keyframes subir { from { opacity: 0; transform: translateY(8px); } }
#app.entra > :not(.dock) { animation: subir .32s cubic-bezier(.2, .8, .2, 1) both; }
#app.entra > :nth-child(2) { animation-delay: .03s; }
#app.entra > :nth-child(3) { animation-delay: .06s; }
#app.entra > :nth-child(n+4):not(.dock) { animation-delay: .09s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.cajabar .btns .btn, .cajabar > .btn { white-space: nowrap; }
/* Títulos en oro líquido más oscuro: con el tono claro del degradado, las letras gruesas se perdían sobre el fondo. */
.liquid-text { background-image: linear-gradient(115deg, #7d5a12 0%, #b8892b 25%, #d9b053 45%, #9a7220 65%, #c99a35 85%, #7d5a12 100%); }
/* Precio de referencia en una tienda en línea. */
.refp { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: var(--ink); background: linear-gradient(180deg, #fffdf8, #f7f1e3); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 #fff; font-size: 14px; }
.refp small { display: block; color: var(--ink-2); font-size: 12px; }
.refp b { color: var(--gold-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Etiquetas QR y NFC. */
.labels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.label { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px 10px; border-radius: 16px; background: var(--white);
  border: 1px solid var(--edge); box-shadow: var(--sh-card); break-inside: avoid; }
.label .qr { width: 100%; max-width: 150px; }
.label b { font-size: 13.5px; line-height: 1.25; }
.label .lp { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.label small { color: var(--ink-2); font-size: 11px; }
.label-act { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.tagbox { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.tagbox .btns { margin-top: 8px; }
.tphoto { width: 120px; height: 120px; object-fit: contain; border-radius: 14px; background: #fff; display: block; margin: 0 auto 10px; box-shadow: var(--sh-xs); }
.nfc-on { background: var(--liquid); background-size: 320% 100%; animation: flow 9s ease-in-out infinite alternate; color: #2a1f05; }
.nfc-aviso { margin: -4px 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--gold-deep);
  background: rgba(214, 171, 74, .16); border: 1px solid rgba(184, 137, 43, .35); }
a.menu-btn { text-decoration: none; }
@media (min-width: 560px) { .labels { grid-template-columns: repeat(3, 1fr); } }
@media print {
  body { background: #fff; padding: 0; }
  .dock, .top, .rule, .no-print, .toast { display: none !important; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .label { box-shadow: none; border: 1px dashed #999; border-radius: 4mm; }
  #app.entra > * { animation: none; }
}
/* Foto del producto en los mosaicos de la venta. */
.qt img { width: 100%; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; }
.qt b { font-size: 12.5px; }

/* ---------- Modo oscuro ----------
   Los mismos tokens con valores de noche: fondo café casi negro, tarjetas un tono arriba y el oro más claro para que
   se lea como texto. Lo que lleva un degradado claro escrito a mano se repinta aquí. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --white: #1d1910;
  --paper: #231e14;
  --ink: #f3ead6;
  --ink-2: #b6a888;
  --line: rgba(255, 236, 190, .12);
  --gold: #d6ab4a;
  --gold-deep: #ebc66c;
  --bg: #13100a;
  --edge: rgba(255, 236, 190, .1);
  --muted: rgba(255, 236, 190, .06);
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .45);
  --sh-card: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 24px -14px rgba(0, 0, 0, .8);
  --sh-pop: 0 24px 60px -20px rgba(0, 0, 0, .85);
  --tint: radial-gradient(130% 90% at 0% 0%, rgba(214, 171, 74, .1), transparent 55%);
  --ring: 0 0 0 3px rgba(214, 171, 74, .3);
}
:root[data-theme="dark"] .liquid-text { background-image: var(--liquid); }
:root[data-theme="dark"] a { color: var(--gold-deep); }

/* Superficies con degradado claro escrito a mano. */
:root[data-theme="dark"] .panel.paper, :root[data-theme="dark"] .sumbar, :root[data-theme="dark"] .cambio, :root[data-theme="dark"] .dup,
:root[data-theme="dark"] .refp, :root[data-theme="dark"] .receipt, :root[data-theme="dark"] .brief, :root[data-theme="dark"] .tray, :root[data-theme="dark"] .salida {
  background: linear-gradient(180deg, #262016, #1c180f); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .05);
}
:root[data-theme="dark"] .tile:first-child, :root[data-theme="dark"] .panel.gold, :root[data-theme="dark"] .card, :root[data-theme="dark"] .alert.alta,
:root[data-theme="dark"] .pick button.on, :root[data-theme="dark"] .type.on {
  background: radial-gradient(130% 90% at 0% 0%, rgba(214, 171, 74, .16), transparent 58%), var(--white);
  border-color: rgba(214, 171, 74, .45); box-shadow: var(--sh-card), 0 0 0 3px rgba(214, 171, 74, .08);
}
:root[data-theme="dark"] .hero { background: radial-gradient(70% 100% at 100% 0%, rgba(214, 171, 74, .22), transparent 62%), linear-gradient(165deg, #241e13 0%, #17130c 100%);
  border-color: rgba(214, 171, 74, .3); box-shadow: var(--sh-card), inset 0 1px 0 rgba(255, 236, 190, .06); }
:root[data-theme="dark"] .hero::before { opacity: .22; }
:root[data-theme="dark"] .hero .k { background: rgba(0, 0, 0, .35); border-color: rgba(214, 171, 74, .3); }
:root[data-theme="dark"] .kpi, :root[data-theme="dark"] .stat { background: var(--tint), rgba(29, 25, 16, .82); }
:root[data-theme="dark"] .tile svg { background: linear-gradient(180deg, #2c2518, #201b11); box-shadow: inset 0 0 0 1px rgba(214, 171, 74, .3), inset 0 1px 0 rgba(255, 236, 190, .08), 0 2px 6px -2px rgba(0, 0, 0, .6); }

/* Botones y opciones. */
:root[data-theme="dark"] .btn.line { background: linear-gradient(180deg, #262016, #1c180f); border-color: rgba(214, 171, 74, .4); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .06), var(--sh-xs); }
:root[data-theme="dark"] .back, :root[data-theme="dark"] .menu-btn { background: linear-gradient(180deg, #262016, #1c180f); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .06), var(--sh-xs); }
:root[data-theme="dark"] .chip, :root[data-theme="dark"] .tog, :root[data-theme="dark"] .medio, :root[data-theme="dark"] .stepper {
  background: linear-gradient(180deg, #241f15, #1b170f); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .05), var(--sh-xs); }
:root[data-theme="dark"] .tog.on, :root[data-theme="dark"] .medio.on { background: var(--liquid); background-size: 320% 100%; }
:root[data-theme="dark"] .chip.on { background: linear-gradient(180deg, #3a301b, #2a2313); border-color: rgba(214, 171, 74, .5); color: var(--gold-deep); }
:root[data-theme="dark"] label input, :root[data-theme="dark"] label select, :root[data-theme="dark"] .search, :root[data-theme="dark"] .find select { background: #17130c; border-color: rgba(255, 236, 190, .14); }
:root[data-theme="dark"] label.doubt input { background: #2a2213; }
:root[data-theme="dark"] .views .n, :root[data-theme="dark"] .thumb button { background: var(--white); }
:root[data-theme="dark"] .tile .n, :root[data-theme="dark"] .qt .q { border-color: var(--white); }
:root[data-theme="dark"] .dot { box-shadow: 0 0 0 3px rgba(214, 171, 74, .2), 0 0 10px rgba(214, 171, 74, .7); }

/* Barra de abajo, menú y gráficas. */
:root[data-theme="dark"] .dock { background: rgba(19, 16, 10, .82); box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, .9); }
:root[data-theme="dark"] .dock-main.liquid { background: linear-gradient(180deg, #2f271a, #0b0905) padding-box, var(--liquid) border-box; background-size: 100% 100%, 320% 100%; }
:root[data-theme="dark"] .sheet-bg { background: rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .chart { border-bottom-color: rgba(255, 236, 190, .2); background: repeating-linear-gradient(to top, rgba(255, 236, 190, .06) 0 1px, transparent 1px 25%); }
:root[data-theme="dark"] .toast { background: linear-gradient(180deg, #f3ead6, #d9cba8); color: #1b1710; border-color: transparent; }
:root[data-theme="dark"] .nfc-aviso { background: rgba(214, 171, 74, .12); }
/* Las fotos de producto y los QR van sobre blanco: así se ven y se escanean bien. */
:root[data-theme="dark"] .item-row img { background: #fff; }
:root[data-theme="dark"] .ph { background: var(--paper); }
:root[data-theme="dark"] .label .qr svg, :root[data-theme="dark"] .tagbox .qr svg { box-shadow: 0 0 0 4px #fff; }
@media print { :root[data-theme="dark"] { --white: #fff; --ink: #2b2414; --ink-2: #7a6c4e; --bg: #fff; } :root[data-theme="dark"] .label { background: #fff; color: #2b2414; } }

/* Modo soporte: un administrador mira la cuenta en solo lectura. */
.soporte { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 14px; background: #7a2e12; color: #fff3e8; font-size: 13px; font-weight: 600; }
.soporte button { background: #fff3e8; color: #7a2e12; border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer; }

/* Artículos: alta a la vista (foto, código, vencimientos) y existencias arriba del detalle. */
.alta { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.alta .btn { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 140px; justify-content: center; }
.alta .btn svg { width: 20px; height: 20px; }
.scanv { width: 100%; border-radius: var(--r); margin-bottom: 10px; background: #000; }
.existencias { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.exist-n { display: grid; justify-items: center; min-width: 92px; }
.exist-n b { font: 800 40px/1 var(--display); letter-spacing: -0.03em; }
.exist-n span { font-size: 12px; color: var(--ink-2); text-align: center; }
.exist-v { display: grid; gap: 2px; }
.exist-v span { font-size: 12px; color: var(--ink-2); }
.exist-v b { font-size: 18px; }
.exist-v small { color: var(--ink-2); }
.lote.agotado { opacity: .55; }

/* Vencimientos en semáforo. */
.venc-vencido { box-shadow: inset 3px 0 0 #b3261e; padding-left: 10px; }
.venc-pronto { box-shadow: inset 3px 0 0 #c98a1b; padding-left: 10px; }
.venc-ok { box-shadow: inset 3px 0 0 #2f7d4f; padding-left: 10px; }

/* Pacientes e historia clínica. */
.alerta-txt { color: #b3261e !important; font-weight: 600; }
.atencion { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; background: var(--white, #fff); display: grid; gap: 6px; }
.atencion-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.atencion-h span { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.atencion p { margin: 0; }
.atencion .btn { justify-self: start; }
.aplicado { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--tint, rgba(184, 134, 43, .08)); }
.aplicado span { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.aplicado small { color: var(--ink-2); }
.aclaracion { border-left: 3px solid var(--gold, #b8862b); padding: 4px 0 4px 10px; font-size: 14px; }
.aclaracion p { margin: 2px 0 0; }
:root[data-theme="dark"] .atencion { background: var(--paper); }
label textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; color: inherit; background: var(--white, #fff); resize: vertical; }
:root[data-theme="dark"] label textarea { background: var(--paper); }
#lq { width: 100%; margin: 4px 0 8px; }
.lote.agotado .photos, .lote.agotado .hint { display: none; }

/* Lecturas por foto agotadas: se sigue a mano (Artículos y Compras). */
.sin-creditos { display: grid; gap: 10px; margin-bottom: 14px; }
.sin-creditos p { font-size: 14px; line-height: 1.4; }
/* Menú del dueño: saldo, plan y soporte. */
.saldo-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.saldo-menu div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.saldo-menu b { display: block; font: 800 22px/1.1 var(--display); }
.saldo-menu span { font-size: 12px; color: var(--ink-2); }
.terminos { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); }
label.terminos input { display: inline-block; width: 22px; height: 22px; margin: 0; padding: 0; flex: none; border: 0; box-shadow: none; accent-color: var(--gold); }
label.terminos a { color: var(--gold-deep); font-weight: 600; }

/* ---------- Consola de administración (admin.html, body.consola) ----------
   Celular primero: cuatro pestañas abajo con el botón principal al centro, cifras grandes, chips de color y cuadritos. */
.consola .dock { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 2.5fr) repeat(2, minmax(0, 1fr)); gap: 2px; padding-left: 4px; padding-right: 4px; }
.consola .dock-side { font-size: 11px; }
.consola .dock-side.on { color: var(--ink); font-weight: 700; }
.consola .dock-main { height: 52px; font-size: 14.5px; padding: 0 8px; }
@media (min-width: 560px) { .consola .dock { grid-template-columns: 76px 76px minmax(0, 320px) 76px 76px; justify-content: center; } }
.c-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0 6px; }
.c-top h1 { font-size: 26px; margin: 0; }
.c-top .who { margin-top: 2px; }
.c-back { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-deep); font-weight: 600; font-size: 14px; text-decoration: none; padding: 12px 0 2px; }

/* Estado de salud y estado del cobro. */
.est, .cob { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.est::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.est.activo, .cob.al_dia { color: #2f7d4f; background: rgba(47, 125, 79, .11); }
.est.en_riesgo, .cob.por_vencer { color: #9a5f08; background: rgba(201, 138, 27, .15); }
.est.inactivo, .cob.vencido, .cob.suspendido { color: #b3261e; background: rgba(179, 38, 30, .1); }
.est.nunca_arranco { color: #7a2e12; background: rgba(122, 46, 18, .11); }
.est.en_arranque, .cob.prueba { color: var(--gold-deep); background: rgba(184, 137, 43, .13); }
.est.pausado, .cob.sin_plan, .cob.sin_pago, .cob.pausada, .cob.cancelada { color: var(--ink-2); background: var(--muted); }
:root[data-theme="dark"] .est.activo, :root[data-theme="dark"] .cob.al_dia { color: #86d3a4; }
:root[data-theme="dark"] .est.en_riesgo, :root[data-theme="dark"] .cob.por_vencer { color: #f2b65c; }
:root[data-theme="dark"] .est.inactivo, :root[data-theme="dark"] .cob.vencido, :root[data-theme="dark"] .cob.suspendido { color: #ff8f84; }
:root[data-theme="dark"] .est.nunca_arranco { color: #ffab91; }

/* Contadores de Hoy: tocar uno filtra el tablero. */
.cuentas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 18px; }
.cuenta { display: grid; gap: 4px; padding: 12px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); color: inherit; text-decoration: none; box-shadow: var(--sh-xs); }
.cuenta b { font: 800 30px/1 var(--display); letter-spacing: -0.03em; }
.cuenta span { font-size: 12px; color: var(--ink-2); line-height: 1.2; }
.cuenta.en_riesgo b { color: #9a5f08; }
.cuenta.inactivo b, .cuenta.nunca_arranco b { color: #b3261e; }
.cuenta.activo b { color: #2f7d4f; }
:root[data-theme="dark"] .cuenta.en_riesgo b { color: #f2b65c; }
:root[data-theme="dark"] .cuenta.inactivo b, :root[data-theme="dark"] .cuenta.nunca_arranco b { color: #ff8f84; }
:root[data-theme="dark"] .cuenta.activo b { color: #86d3a4; }
/* .alta también es la clase del alta de artículos: aquí manda la grilla de la alerta. */
.consola .alert { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; align-items: start; }
.consola .alert .lv { margin-top: 5px; }
.consola .alert.baja .lv { border-style: dashed; }
.consola .alert .btns { grid-column: 2; margin-top: 4px; }
.consola .alert .btns .btn { flex: none; min-width: 0; }

/* Tarjeta de un negocio en el tablero. */
.tenant { display: grid; gap: 9px; width: 100%; text-align: left; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; margin-bottom: 10px; background: var(--white); box-shadow: var(--sh-card); }
.tenant-h { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.tenant-h b { display: block; font-size: 17px; font-weight: 700; line-height: 1.2; }
.tenant .motivo { font-size: 13.5px; line-height: 1.35; }
.tenant-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cuadros { display: inline-flex; gap: 3px; align-items: center; }
.cuadros i { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line); }
.cuadros i.si { background: var(--gold); border-color: var(--gold); }
.cuadros i.hoy { margin-left: 5px; border-style: dashed; }
.cuadros i.hoy.si { background: transparent; border: 2px solid var(--gold); }
.mods { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.mods span { position: relative; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); opacity: .75; }
.mods span svg { width: 17px; height: 17px; }
.mods span.usado { color: var(--gold-deep); border-color: rgba(184, 137, 43, .55); opacity: 1; }
.mods span.usado::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--white); }
.credito { display: grid; gap: 4px; min-width: 130px; flex: 1; font-size: 12px; color: var(--ink-2); }
.credito b { color: var(--ink); }
.credito .barra { height: 6px; border-radius: 6px; background: var(--muted); overflow: hidden; }
.credito .barra i { display: block; height: 100%; border-radius: 6px; background: var(--gold); }
.credito.bajo .barra i { background: #c98a1b; }
.credito.agotado .barra i { background: #b3261e; opacity: .35; }

/* Detalle: bloques, embudo, semanas y listas. */
.bloque { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: var(--white); }
.bloque > h3 { font: 700 16px/1.2 var(--display); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bloque > h3 small { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.motivos { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.motivos li::before { content: "· "; color: var(--gold-deep); font-weight: 700; }
.paso { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.paso:last-child { border-bottom: 0; }
.paso .ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: transparent; }
.paso.si .ck { background: var(--gold); border-color: var(--gold); color: #2a1f05; }
.paso:not(.si) { color: var(--ink-2); }
.paso small { color: var(--ink-2); font-size: 12px; text-align: right; white-space: nowrap; }
.semanas { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 110px; border-bottom: 1px solid var(--line); }
.semanas .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
.semanas .bar { width: 100%; max-width: 30px; min-height: 2px; border-radius: 5px 5px 0 0; background: var(--gold); }
.semanas .lbl { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.semanas-x { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 4px; font-size: 10.5px; color: var(--ink-2); text-align: center; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-bottom: 10px; }
.cifras div { padding: 10px; border-radius: 12px; background: var(--paper); }
.cifras b { display: block; font: 800 22px/1.05 var(--display); letter-spacing: -0.02em; }
.cifras span { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.fila:last-child { border-bottom: 0; }
.fila small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 1px; }
.fila .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila.anulado > span:first-child { text-decoration: line-through; text-decoration-color: var(--gold); }
.fila .acc { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mes { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; }
.mes b { font-size: 16px; }

/* Hoja que sube desde abajo: flujos por pasos (registrar pago, negocio nuevo, ver como, casos). */
.hoja-bg { position: fixed; inset: 0; z-index: 10; display: none; background: rgba(43, 36, 20, .28); backdrop-filter: blur(3px); }
.hoja-bg.on { display: block; }
.hoja { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; margin: 0 auto; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--tint), var(--bg); box-shadow: var(--sh-pop);
  transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .9, .25, 1), visibility 0s linear .3s; }
.hoja.on { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .9, .25, 1); }
.hoja::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: -6px auto 12px; }
.hoja h2 { font: 700 22px/1.15 var(--display); letter-spacing: -0.02em; padding-right: 44px; }
.hoja .close { position: absolute; top: 14px; right: 12px; width: 40px; height: 40px; font-size: 24px; color: var(--ink-2); }
.hoja .stack { margin-top: 12px; }
.pasos { display: flex; gap: 4px; margin: 10px 0 4px; }
.pasos i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.pasos i.on { background: var(--gold); }
.hoja .btn.wide { height: 54px; font-size: 16px; }
.grande { font: 800 34px/1.1 var(--display); letter-spacing: .06em; text-align: center; padding: 10px 0; overflow-wrap: anywhere; }
:root[data-theme="dark"] .hoja-bg { background: rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .tenant, :root[data-theme="dark"] .bloque, :root[data-theme="dark"] .cuenta { background: var(--tint), var(--white); }
/* Las tarjetas son enlaces: en oscuro no toman el dorado de los enlaces. */
:root[data-theme="dark"] .tenant, :root[data-theme="dark"] .cuenta { color: var(--ink); }

/* ---------- Restaurante: salón, cocina y carta ---------- */
/* Mesas: un mosaico por mesa; la ocupada muestra lo que falta por cobrar y la que tiene algo listo se resalta en verde. */
.mesas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mesa { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-height: 104px; padding: 12px; border-radius: 18px;
  text-decoration: none; color: inherit; background: var(--tint), var(--white); border: 1px solid var(--edge); box-shadow: var(--sh-card); transition: transform .12s; }
.mesa:active { transform: scale(.97); }
.mesa b { font: 700 17px/1.15 var(--display); letter-spacing: -0.02em; }
.mesa .t { font: 800 20px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mesa small { font-size: 12px; color: var(--ink-2); }
.mesa .libre { color: #2f7d4f; font-weight: 600; }
.mesa.ocupada { border-color: rgba(184, 137, 43, .55); background: radial-gradient(130% 90% at 0% 0%, rgba(214, 171, 74, .22), transparent 60%), var(--white); }
.mesa.lista { box-shadow: var(--sh-card), 0 0 0 3px rgba(47, 125, 79, .4); }
.badge { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #2a1f05; }
.badge.soft { background: var(--muted); color: var(--ink-2); }
@media (min-width: 560px) { .mesas { grid-template-columns: repeat(4, 1fr); } }

/* Pedido: mosaicos de platos con "quedan" y "se acabó"; puesto y nota para la cocina. */
.quick.platos .qt small.quedan { font-size: 11px; color: #c98a1b; font-weight: 700; }
.qt.acabado b { text-decoration: line-through; text-decoration-color: var(--gold); }
.puestos { align-items: center; }
.puestos .hint { flex: none; margin-right: 2px; }
.pedido { padding: 4px 14px; }
.pedido .tline:last-child { border-bottom: 0; }
.pedido em { font-style: normal; font-weight: 700; color: #b3261e; }
.enlace { color: var(--gold-deep); font-weight: 600; font-size: 12px; padding: 0; }
.aviso-lista { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 10px; padding: 12px 14px;
  border-radius: 16px; border: 1.5px solid rgba(47, 125, 79, .55); background: rgba(47, 125, 79, .1); font-size: 14px; }
.aviso-lista .btn { flex: none; pointer-events: none; }

/* Comandas dentro de la cuenta, con su estado. */
.comanda-mini { border: 1px solid var(--edge); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; background: var(--white); }
.comanda-mh { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comanda-mh small { margin-left: auto; color: var(--ink-2); font-size: 12px; }
.comanda-mini .ln { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.comanda-mini .ln em, .comanda li em { display: block; font-style: normal; font-weight: 700; color: #b3261e; font-size: 13px; }
.comanda-mini .ln .r { text-align: right; font-variant-numeric: tabular-nums; }
.ln.anulada > span:first-child, li.anulada span { text-decoration: line-through; opacity: .55; }
.estado { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.estado.nueva { background: rgba(214, 171, 74, .22); color: var(--gold-deep); }
.estado.preparando { background: rgba(201, 138, 27, .2); color: #8a5a06; }
.estado.lista { background: rgba(47, 125, 79, .18); color: #2f7d4f; }
.estado.entregada { background: var(--muted); color: var(--ink-2); }

/* Pantalla de cocina: tarjetas grandes para una tablet o un televisor; la espera se pone ámbar a los 12 min y roja a los 25. */
body.ancho .wrap { max-width: 1280px; }
.kds-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.kds-bar .per { margin: 0; min-width: 260px; }
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.comanda { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--white); border: 1px solid var(--edge); box-shadow: var(--sh-card); }
.comanda.nueva { border: 2px solid rgba(184, 137, 43, .7); }
.comanda.preparando { border: 2px solid rgba(201, 138, 27, .7); }
.comanda.lista { border: 2px solid rgba(47, 125, 79, .7); background: rgba(47, 125, 79, .06); }
.comanda-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.comanda-h b { font: 800 24px/1.05 var(--display); letter-spacing: -0.03em; }
.espera { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.comanda.demora .espera { color: #c98a1b; }
.comanda.tarde .espera { color: #b3261e; }
.comanda.tarde { box-shadow: var(--sh-card), 0 0 0 3px rgba(179, 38, 30, .25); }
.comanda-s { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.comanda ul { list-style: none; padding: 0; display: grid; gap: 6px; flex: 1; }
.comanda li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; font-size: 18px; line-height: 1.25; }
.comanda li > b { font: 800 22px/1.1 var(--display); text-align: right; }
.comanda li small { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.btn.grande { height: 56px; font-size: 18px; }

/* Carta y recetas. */
.row.plato-row { grid-template-columns: 48px 1fr auto; }
.plato-row .ph { width: 48px; height: 48px; }
.plato-ico { display: grid; place-items: center; color: var(--gold-deep); }
.plato-ico svg { width: 24px; height: 24px; }
.receta-l { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.receta-l small { display: block; color: var(--ink-2); font-size: 12px; }
.receta-l .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rq { display: flex; gap: 4px; }
.rq input { width: 76px; height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(43, 36, 20, .13); background: var(--white); text-align: right; }
.rq select { height: 42px; border-radius: 10px; border: 1px solid rgba(43, 36, 20, .13); background: var(--white); padding: 0 6px; }
.per.cuatro { grid-template-columns: repeat(4, 1fr); }
.leyenda { font-size: 11px; line-height: 1.45; color: var(--ink-2); margin-top: 8px; }
.leyenda-c { margin-top: 6px; }
.afiche { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 22px 18px; border-radius: 18px; border: 1.5px dashed rgba(184, 137, 43, .6); background: var(--white); }
.afiche h2 { font: 800 26px/1.1 var(--display); letter-spacing: -0.03em; }
.afiche .qr { width: 200px; }
.stepper .cantn { width: auto; min-width: 40px; padding: 0 6px; font-size: 15px; font-weight: 600; color: inherit; }
@media (max-width: 420px) { .receta-l { grid-template-columns: 1fr auto; } .receta-l .rq { grid-column: 1; } }

/* Carta pública (/carta/<código>): sin barra de abajo. */
body.carta-pub { padding-bottom: 40px; }
.cp-top { padding-top: 22px; }
.cp-plato { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cp-plato:not(:has(img)) { grid-template-columns: 1fr auto; }
.cp-plato img { width: 76px; height: 76px; object-fit: cover; border-radius: 14px; }
.cp-plato h3 { font: 700 17px/1.25 var(--display); letter-spacing: -0.01em; }
.cp-plato p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.cp-plato small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.cp-plato .btn { margin-top: 8px; }
.cp-precio { text-align: right; display: grid; gap: 4px; justify-items: end; }
.cp-precio b { font: 800 18px/1.1 var(--display); letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-plato.agotado h3, .cp-plato.agotado .cp-precio b { opacity: .5; }
.cp-pie { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: grid; gap: 6px; }
.cp-qr { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(43, 36, 20, .4); padding: 16px; }
.cp-qr-in { display: grid; justify-items: center; gap: 10px; max-width: 320px; padding: 20px; border-radius: 20px; background: var(--white); text-align: center; box-shadow: var(--sh-pop); }
.cp-qr-in .qr { width: 220px; background: #fff; border-radius: 10px; }

:root[data-theme="dark"] .mesa.ocupada { background: radial-gradient(130% 90% at 0% 0%, rgba(214, 171, 74, .18), transparent 60%), var(--white); }
:root[data-theme="dark"] .mesa .libre, :root[data-theme="dark"] .estado.lista { color: #6fcf97; }
:root[data-theme="dark"] .estado.preparando { color: #f0b65a; }
:root[data-theme="dark"] .comanda-mini .ln em, :root[data-theme="dark"] .comanda li em, :root[data-theme="dark"] .pedido em, :root[data-theme="dark"] .comanda.tarde .espera { color: #ff8a80; }
:root[data-theme="dark"] .rq input, :root[data-theme="dark"] .rq select { background: #17130c; border-color: rgba(255, 236, 190, .14); }
:root[data-theme="dark"] .afiche .qr svg, :root[data-theme="dark"] .cp-qr-in .qr svg { box-shadow: 0 0 0 4px #fff; }
@media print {
  body.carta-pub { padding: 0; }
  body.carta-pub .cp-plato img { width: 56px; height: 56px; }
  .afiche { break-inside: avoid; border: 1px dashed #999; }
}

/* ---------- Agenda, fiado, reposición y nevera ----------
   Colores de estado con su versión de noche: verde = bien, rojo = mal, azul = en sala. */
:root { --ok: #2f7d4f; --mal: #b3261e; --sala: #1f63a8; --ok-bg: rgba(47, 125, 79, .12); --mal-bg: rgba(179, 38, 30, .1); --sala-bg: rgba(31, 99, 168, .11); }
:root[data-theme="dark"] { --ok: #6cc28f; --mal: #f08a80; --sala: #7fb2ea; --ok-bg: rgba(108, 194, 143, .14); --mal-bg: rgba(240, 138, 128, .13); --sala-bg: rgba(127, 178, 234, .14); }
.linkbtn { color: var(--gold-deep); font-weight: 600; font-size: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.msg { white-space: pre-line; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--ok-bg); border: 1px solid rgba(47, 125, 79, .25); font-size: 14.5px; line-height: 1.45; }
label.si { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); padding: 8px 0; }
label.si input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--gold-deep); }
label input.grande { height: 64px; font: 700 34px/1 var(--display); text-align: center; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lote.fuera-pedido { opacity: .6; }
.pago .full { grid-column: 1 / -1; }
.cita-h small + small { margin-top: 0; }

.estado { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--muted); color: var(--ink-2); }
.estado.e-confirmada { background: var(--ok-bg); color: var(--ok); }
.estado.e-llego { background: var(--sala-bg); color: var(--sala); }
.estado.e-atendida { background: var(--muted); color: var(--ok); }
.estado.e-no_asistio { background: var(--mal-bg); color: var(--mal); }
.estado.e-cancelada { background: var(--muted); color: var(--ink-2); text-decoration: line-through; }

.diabar { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; text-align: center; margin-bottom: 10px; }
.diabar b { display: block; font: 700 18px/1.2 var(--display); }
.diabar small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.cuenta-dia { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin: 4px 0 10px; }
.cuenta-dia .big { font: 800 32px/1 var(--display); letter-spacing: -0.03em; margin-right: 2px; }
.cuenta-dia > span:nth-child(2) { margin-right: 6px; color: var(--ink-2); }
.agenda-dia { display: grid; gap: 8px; }
.cita { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; text-decoration: none; color: inherit;
  background: var(--tint), var(--white); border: 1px solid var(--edge); box-shadow: var(--sh-card); border-left: 5px solid var(--gold); }
.cita-h b { display: block; font: 700 17px/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cita-h small, .cita-q small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.cita-q b { display: block; font-weight: 600; line-height: 1.25; }
.cita.est-confirmada { border-left-color: var(--ok); }
.cita.est-llego { border-left-color: var(--sala); background: linear-gradient(var(--sala-bg), var(--sala-bg)), var(--white); }
.cita.est-atendida { border-left-color: var(--ok); opacity: .72; }
.cita.est-no_asistio { border-left-color: var(--mal); opacity: .72; }
.cita.est-cancelada { border-left-color: var(--line); opacity: .5; }
.cita.est-cancelada .cita-q b { text-decoration: line-through; }
.cita.bloq { border-left-color: var(--ink-2); background: repeating-linear-gradient(135deg, var(--muted) 0 8px, transparent 8px 16px), var(--white); box-shadow: none; }
.cita.libre { border: 1.5px dashed rgba(184, 137, 43, .55); border-left-width: 5px; box-shadow: none; background: transparent; }
.cita.libre .cita-q b { color: var(--gold-deep); }
.cita:active { transform: scale(.98); }
.dia-sem { display: block; text-decoration: none; color: inherit; padding: 12px 14px; margin-bottom: 8px; border-radius: 16px; background: var(--tint), var(--white); border: 1px solid var(--edge); box-shadow: var(--sh-card); }
.dia-sem.hoy { border-color: rgba(184, 137, 43, .6); box-shadow: var(--sh-card), 0 0 0 3px rgba(214, 171, 74, .14); }
.dia-sem.pasado { opacity: .7; }
.dia-sem-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dia-sem-h b { font: 700 17px/1.2 var(--display); text-transform: capitalize; }
.dia-sem-h small { color: var(--gold-deep); font-weight: 600; font-size: 12px; }
.dia-sem-h .big { font: 800 26px/1 var(--display); letter-spacing: -0.03em; }
.mini-citas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mcita { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--muted); color: var(--ink); font-variant-numeric: tabular-nums; }
.mcita.e-confirmada { background: var(--ok-bg); }
.mcita.e-llego { background: var(--sala-bg); }
.mcita.e-no_asistio { background: var(--mal-bg); }
.mcita.e-cancelada { text-decoration: line-through; opacity: .6; }
.mcita.e-atendida { opacity: .6; }
.horas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hora { height: 52px; border-radius: 14px; font: 700 16px/1 var(--display); font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff, #fbf8f1); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 #fff, var(--sh-xs); }
.hora.on { color: #2a1f05; border-color: rgba(138, 100, 24, .45); box-shadow: var(--relieve); }
.acciones-cita { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.accion { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; font-size: 13.5px; font-weight: 600; background: var(--tint), var(--white); border: 1px solid var(--edge); box-shadow: var(--sh-card); }
.accion span { font-size: 22px; line-height: 1; }
.accion.e-confirmada, .accion.e-atendida { color: var(--ok); }
.accion.e-llego { color: var(--sala); }
.accion.e-no_asistio, .accion.e-cancelada { color: var(--mal); }
.accion:active { transform: scale(.97); }
label.dia-tog { text-transform: none; letter-spacing: 0; position: relative; }
.dia-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dia-tog span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: 14px; color: var(--ink-2);
  background: linear-gradient(180deg, #fff, #fbf8f1); border: 1px solid var(--edge); }
.dia-tog input:checked + span { color: #2a1f05; background: var(--liquid); background-size: 320% 100%; border-color: rgba(138, 100, 24, .45); box-shadow: var(--relieve); }
.dia-tog input:disabled + span { opacity: .6; }

/* Nevera */
.nev { display: block; text-decoration: none; color: inherit; }
.nev.fuera { border-color: var(--mal); box-shadow: var(--sh-card), 0 0 0 3px var(--mal-bg); }
.nev-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nev-h small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.nev-t { font: 800 34px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nev.fuera .nev-t { color: var(--mal); }
.turnos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.turno { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--muted); }
.turno b { font: 700 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.turno small { font-size: 12px; color: var(--ink-2); }
.turno.ok { background: var(--ok-bg); }
.turno.ok b { color: var(--ok); }
.turno.falta { background: var(--mal-bg); }
.turno.falta b { color: var(--mal); }
.hero.hero-alerta { border-color: var(--mal); background: radial-gradient(70% 100% at 100% 0%, var(--mal-bg), transparent 62%), var(--white); }
.hero.hero-alerta .v { color: var(--mal); }
.plan { display: grid; gap: 8px; padding-left: 22px; font-size: 15px; line-height: 1.4; margin-bottom: 10px; }
.planilla-h { font-size: 13px; line-height: 1.5; margin: 6px 0 10px; }
.tabla-x { overflow-x: auto; border-radius: 12px; border: 1px solid var(--edge); background: var(--white); }
.planilla { min-width: 640px; }
.planilla th, .planilla td { text-align: center; padding: 6px 4px; border: 1px solid var(--line); }
.planilla td.obs { text-align: left; font-size: 12px; color: var(--ink-2); min-width: 160px; }
.planilla td.fuera { color: var(--mal); font-weight: 700; background: var(--mal-bg); }
.planilla td.vacio { color: var(--ink-2); }
.firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; font-size: 12px; color: var(--ink-2); }
.firmas span { border-top: 1px solid var(--ink-2); padding-top: 4px; }
@media print { .tabla-x { overflow: visible; border: 0; } .planilla { min-width: 0; font-size: 10.5px; } .planilla td.fuera { background: none; } .tagbox .btns, .tagbox .hint { display: none; } }
:root[data-theme="dark"] .hora, :root[data-theme="dark"] .dia-tog span { background: linear-gradient(180deg, #241f15, #1b170f); }
:root[data-theme="dark"] .hora.on, :root[data-theme="dark"] .dia-tog input:checked + span { background: var(--liquid); background-size: 320% 100%; }
:root[data-theme="dark"] .msg { border-color: rgba(108, 194, 143, .3); }
@media (min-width: 560px) { .horas { grid-template-columns: repeat(4, 1fr); } }

/* Compras: la línea tal como vino en la factura, para ver si se emparejó bien; pedido contra lo recibido. */
.enfactura { display: grid; gap: 6px; margin: -2px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px dashed var(--gold); font-size: 13px; color: var(--ink-2); }
.enfactura b { color: var(--ink); font-weight: 600; word-break: break-word; }
.enfactura .btns { margin: 0; }
.enfactura .btns .btn { min-width: 0; }
label.doubt select { border-color: var(--gold); background: #fffaf0; }
.pedido-r { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
:root[data-theme="dark"] .enfactura { background: #1d1810; }
:root[data-theme="dark"] label.doubt select { background: #2a2213; }
/* Artículos: corregir el lote o la fecha de un lote, con su rastro. */
.lote .corregir { margin-top: 8px; }
.lote .cambios { margin-top: 4px; line-height: 1.5; }
.lote .cambios b { color: var(--ink); font-weight: 600; }
.salida .capture { margin: 0; }
/* Reportes → Cajas: quién cerró la caja de otro y lo que se anuló después del cierre. */
.row small.full { grid-column: 1 / -1; }
.row small.ajuste { color: var(--gold-deep); }
/* Salón → plano 3D y editor del plano (plano.js). */
.vista-seg { margin: 0 0 12px; }
.seg a { display: grid; place-items: center; height: 36px; border-radius: 999px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.seg a.on { color: #2a1f05; font-weight: 600; }
.seg.tres { grid-template-columns: repeat(3, 1fr); }
.plano-chips .chip small { color: var(--ink-2); font-weight: 500; margin-left: 2px; }
.plano3d { position: relative; height: min(64vh, 560px); min-height: 360px; border-radius: 22px; overflow: hidden; touch-action: none;
  border: 1px solid var(--line); box-shadow: var(--sh-card);
  background: radial-gradient(120% 80% at 50% 0%, #fffaf0 0%, #f3e9d6 55%, #e9dcc3 100%); }
.plano3d canvas { display: block; }
.plano-carga { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font-size: 14px; }
.plano-ley { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 2px 6px; font-size: 12px; color: var(--ink-2); }
.plano-ley i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.plano-ed { width: 100%; max-height: 62vh; margin: 8px 0 6px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--sh-card); touch-action: none; }
.plano-ed svg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
.ed-suelo { fill: #f1e6cf; }
.ed-reja { fill: none; stroke: rgba(138, 100, 24, .14); stroke-width: .02; }
.ed-borde { fill: none; stroke: var(--gold); stroke-width: .08; }
.ed-deco { fill: rgba(122, 108, 78, .14); stroke: rgba(122, 108, 78, .45); stroke-width: .04; stroke-dasharray: .15 .1; }
.ed-deco.esc { fill: rgba(122, 108, 78, .08); }
.ed-deco-t { font: 600 .34px Inter, system-ui, sans-serif; fill: var(--ink-2); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.ed-mesa { cursor: grab; }
.ed-mesa:active { cursor: grabbing; }
.ed-toque { fill: transparent; }
.ed-tapa { fill: #a8774a; stroke: #7d5533; stroke-width: .04; }
.ed-silla { fill: #fbf6ec; stroke: #b99c6a; stroke-width: .03; }
.ed-nombre { font: 800 .42px Inter, system-ui, sans-serif; fill: #fff; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(60, 40, 10, .55); stroke-width: .06; }
.ed-mesa.ocupada .ed-tapa { fill: #d6ab4a; }
.ed-mesa.sel .ed-toque { fill: rgba(214, 171, 74, .16); stroke: var(--gold); stroke-width: .06; stroke-dasharray: .2 .12; }
.ed-sel .fila-ed, .fila-ed { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.fila-ed .stepper b { min-width: 34px; text-align: center; color: var(--ink); }
.fila-ed .chips { margin: 0; }
:root[data-theme="dark"] .plano3d { background: radial-gradient(120% 80% at 50% 0%, #2a2214 0%, #1a150d 60%, #120e08 100%); border-color: rgba(214, 171, 74, .22); }
:root[data-theme="dark"] .plano-ed { background: #17130c; border-color: rgba(214, 171, 74, .22); }
:root[data-theme="dark"] .ed-suelo { fill: #2a2216; }
:root[data-theme="dark"] .ed-reja { stroke: rgba(214, 171, 74, .12); }
:root[data-theme="dark"] .ed-silla { fill: #3b3122; stroke: #8a7650; }
:root[data-theme="dark"] .seg a.on { color: #1b1406; }
:root[data-theme="dark"] .plano-ley i { box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
/* Editor del plano: la paleta para armar el salón, el fantasma que sigue el dedo y las mesas que chocan. */
.ed-marcador { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); margin: 4px 2px 0; }
.ed-marcador b { color: var(--ink); }
.ed-aviso { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(229, 83, 61, .1); color: #b3412e; font-size: 12.5px; font-weight: 600; }
.paleta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.pal { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border-radius: 16px; background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--sh-card); touch-action: none; user-select: none; -webkit-user-select: none; }
.pal svg { width: 56px; height: 56px; }
.pal b { font-size: 12.5px; color: var(--ink); }
.pal small { font-size: 11px; color: var(--ink-2); }
.pal:active { transform: scale(.96); }
.pal-fantasma { position: fixed; left: 0; top: 0; width: 68px; height: 68px; z-index: 60; pointer-events: none; border-radius: 50%;
  background: rgba(255, 250, 238, .9); box-shadow: var(--sh-pop); display: grid; place-items: center; transition: background-color .15s; }
.pal-fantasma svg { width: 54px; height: 54px; }
.pal-fantasma.encima { background: rgba(214, 171, 74, .35); }
.ed-sombra { opacity: .55; pointer-events: none; }
.ed-mesa.choca .ed-tapa { stroke: #e5533d; stroke-width: .1; }
.ed-mesa.choca .ed-toque { fill: rgba(229, 83, 61, .12); }
.ed-cuerpo { transform-box: fill-box; transform-origin: center; }
.ed-mesa.nueva .ed-cuerpo { animation: aterriza .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes aterriza { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
:root[data-theme="dark"] .pal { background: #1e1a12; border-color: rgba(214, 171, 74, .22); }
:root[data-theme="dark"] .pal-fantasma { background: rgba(30, 26, 18, .92); }
:root[data-theme="dark"] .ed-aviso { color: #f08a74; }
/* Editor del plano: los espacios (cocina, nevera, baños…), las manijas para girar y estirar, y su paleta. */
.ed-esp { cursor: grab; }
.ed-e-f { fill: rgba(122, 108, 78, .16); stroke: rgba(122, 108, 78, .55); stroke-width: .04; }
.ed-e-t { font-family: Inter, system-ui, sans-serif; font-weight: 700; fill: var(--ink-2); text-anchor: middle; pointer-events: none; }
.t-cocina .ed-e-f { fill: rgba(140, 150, 160, .32); stroke: #7d8791; }
.t-bar .ed-e-f, .t-caja .ed-e-f { fill: rgba(156, 106, 60, .3); stroke: #8a5d33; }
.t-nevera .ed-e-f { fill: #eef3f7; stroke: #8ea3b5; }
.t-banos .ed-e-f { fill: rgba(76, 127, 174, .18); stroke: #4c7fae; }
.t-bodega .ed-e-f { fill: rgba(156, 106, 60, .18); stroke: #8a5d33; stroke-dasharray: .12 .08; }
.t-escalera .ed-e-f { fill: rgba(246, 239, 226, .9); stroke: #b99c6a; }
.t-columna .ed-e-f, .t-pared .ed-e-f { fill: #6f6656; stroke: #4e463a; }
.t-planta .ed-e-f { fill: rgba(79, 154, 87, .45); stroke: #3f7a46; }
.t-entrada .ed-e-f { fill: rgba(201, 154, 53, .35); stroke: var(--gold); }
.t-zona .ed-e-f { fill: url(#ed-rayas); stroke: rgba(229, 83, 61, .55); stroke-dasharray: .15 .1; }
.ed-raya { stroke: rgba(229, 83, 61, .35); stroke-width: .08; }
.ed-esp.sel .ed-e-f { stroke: var(--gold); stroke-width: .07; }
.ed-esp.choca .ed-e-f { stroke: #e5533d; stroke-width: .1; }
.ed-esp.nueva .ed-cuerpo { animation: aterriza .55s cubic-bezier(.2, 1.6, .4, 1); }
.ed-marco { fill: none; stroke: var(--gold); stroke-width: .05; stroke-dasharray: .18 .1; pointer-events: none; }
.ed-asa-l { stroke: var(--gold); stroke-width: .05; pointer-events: none; }
.ed-asa { cursor: pointer; }
.ed-asa-toque { fill: transparent; }
.ed-asa-v { fill: #fff; stroke: var(--gold); stroke-width: .07; }
.ed-asa-t { font: 800 .36px Inter, system-ui, sans-serif; fill: var(--gold-deep); text-anchor: middle; pointer-events: none; }
.paleta.espacios .pal { padding: 8px 2px 9px; }
.pal-i { font-size: 26px; line-height: 34px; }
.pal-fantasma .pal-i { font-size: 32px; }
:root[data-theme="dark"] .ed-e-t { fill: #d9cdb2; }
:root[data-theme="dark"] .t-nevera .ed-e-f { fill: #3a434b; }
:root[data-theme="dark"] .t-escalera .ed-e-f { fill: rgba(59, 49, 34, .9); }
:root[data-theme="dark"] .ed-asa-v { fill: #1e1a12; }
/* Con el teclado del celular abierto, la barra de abajo se esconde (core.js le pone .teclado al body). */
body.teclado .dock { display: none; }
