/* ============================================================
   TPV MCM — Terminal de pedidos Mercamadrid · v3
   Identidad FRUSANGAR (brandbook Pomelli / manual corporativo):
   Pale Greige #D9D0C2 · Peony Pink #E28BCA (CTA) ·
   Cocoa Brown #3C2B17 (titulares) · Verde oliva #C1CC7D ·
   Tipografía: Montserrat (display) + Roboto (texto) + Satisfy (marca)
   Tema claro · animaciones 60–180 ms solo transform/opacity
   ============================================================ */
:root {
  /* Marca */
  --greige: #d9d0c2;
  --pink: #e28bca;
  --pink-d: #c2569f;
  --pink-t: #f9ebf5;
  --cocoa: #3c2b17;
  --cocoa-2: #5a4530;
  --olive: #c1cc7d;
  --olive-d: #7c8a35;
  --olive-t: #f2f5e0;

  /* Sistema */
  --bg: #efeae2;
  --bg2: #e7e0d4;
  --sf: #ffffff;
  --sf2: #faf7f2;
  --sf3: #f1ece3;
  --br: #e3dccf;
  --brb: #c9bfac;
  --tx: #2b2012;
  --txd: #6e6354;
  --txh: #9c917e;
  --rd: #c8473e;
  --rd-t: #f8e6e4;

  --c-patata: #c98a2b;
  --c-cebolla: #9a5fb5;
  --c-ajo: #5e8fb8;
  --c-zanahoria: #d2691e;
  --c-boniato: #b85450;
  --c-limon: #ab9b22;
  --c-naranja: #d87e2e;
  --c-otros: #3fa98c;

  --sh-sm: 0 1px 3px rgba(60, 43, 23, .1);
  --sh-md: 0 3px 10px rgba(60, 43, 23, .12);
  --sh-lg: 0 18px 50px rgba(60, 43, 23, .28);
  --ease: cubic-bezier(.25, .9, .3, 1);
  --pop: cubic-bezier(.34, 1.4, .5, 1);
  --r: 10px;
  --rs: 7px;
  --f-disp: Montserrat, Bahnschrift, "Segoe UI", Roboto, sans-serif;
  --f-text: Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--f-text);
  user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea {
  font-family: inherit; background: var(--sf); border: 1px solid var(--brb);
  border-radius: var(--rs); color: var(--tx); outline: none; padding: 10px 14px; font-size: 18px;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--txh); }
input:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(226, 139, 202, .18); }
.hidden { display: none !important; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* ================= CABECERA (barra de marca cocoa) ================= */
.hdr {
  display: flex; align-items: stretch; gap: 8px;
  background: linear-gradient(180deg, #4a3620, var(--cocoa));
  padding: 8px 10px; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(60, 43, 23, .35);
}
.hdr-brand {
  display: flex; flex-direction: column; justify-content: center; padding: 0 8px 0 4px;
}
.hdr-brand .hb-name { font-family: Satisfy, "Segoe Script", cursive; font-size: 24px; color: var(--greige); line-height: 1; }
.hdr-brand .hb-sub { font-family: var(--f-disp); font-size: 8px; font-weight: 700; letter-spacing: .22em; color: #a8987f; text-transform: uppercase; margin-top: 2px; }
.hdr-vendor {
  background: rgba(255, 255, 255, .08); border: 1px solid #6b563c; border-radius: var(--rs);
  font-family: var(--f-disp); font-weight: 700; font-size: 14px; letter-spacing: .08em; color: var(--pink);
  padding: 0 15px; text-transform: uppercase;
  transition: transform .08s var(--ease), border-color .12s;
}
.hdr-vendor:active { transform: scale(.94); border-color: var(--pink); }
.hdr-client {
  flex: 1; display: flex; align-items: baseline; gap: 10px; text-align: left;
  background: var(--sf); border: 1px solid var(--sf); border-radius: var(--rs); padding: 8px 16px;
  overflow: hidden; box-shadow: var(--sh-sm);
  transition: transform .08s var(--ease), box-shadow .15s;
}
.hdr-client.has-client { box-shadow: 0 0 0 2px var(--olive), var(--sh-sm); }
.hdr-client:active { transform: scale(.99); }
.hc-label { font-family: var(--f-disp); font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--txh); }
.hc-name { font-family: var(--f-disp); font-size: 20px; font-weight: 800; color: var(--cocoa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-name.placeholder { color: var(--txh); font-weight: 500; }
.hc-sub { font-size: 12px; color: var(--txd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-btn {
  background: rgba(255, 255, 255, .08); border: 1px solid #6b563c; border-radius: var(--rs);
  font-family: var(--f-disp); font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--greige); padding: 0 14px;
  white-space: nowrap; transition: transform .08s var(--ease), border-color .12s;
}
.hdr-btn:active { transform: scale(.94); border-color: var(--greige); }
.badge {
  display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 11px;
  background: var(--pink); color: #fff; font-size: 12px; font-weight: 800; text-align: center;
}
.badge-dim { background: rgba(255, 255, 255, .14); color: var(--greige); }
.hdr-clock { display: flex; align-items: center; font-size: 15px; font-weight: 600; color: #a8987f; padding: 0 6px; font-variant-numeric: tabular-nums; }

/* ================= LAYOUT ================= */
.main { display: grid; grid-template-columns: 1fr 420px; flex: 1; min-height: 0; min-width: 0; }

/* ================= CATÁLOGO ================= */
.catalog { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cat-top { display: flex; gap: 8px; padding: 10px 10px 8px; align-items: center; flex-wrap: wrap; }
.cat-tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 11px 18px; border-radius: var(--rs); background: var(--sf);
  border: 1px solid var(--br); box-shadow: var(--sh-sm);
  font-family: var(--f-disp); font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--txd);
  transition: transform .08s var(--ease), background .12s, color .12s, box-shadow .15s;
}
.cat-tab:active { transform: scale(.95); }
.cat-tab.active { background: var(--cocoa); border-color: var(--cocoa); color: #fff; box-shadow: var(--sh-md); }
.cat-search { width: 220px; font-size: 15px; padding: 9px 12px; }
.btn-assign {
  width: 46px; border-radius: var(--rs); font-family: var(--f-disp); font-size: 15px; font-weight: 800;
  background: var(--sf); border: 1px solid var(--br); color: var(--pink-d); box-shadow: var(--sh-sm);
  transition: transform .08s var(--ease), background .12s, box-shadow .15s;
}
.btn-assign:active { transform: scale(.92); }
.btn-assign.on {
  background: var(--pink); border-color: var(--pink); color: #fff;
  animation: assignPulse 1.4s ease-in-out infinite;
}
@keyframes assignPulse { 50% { box-shadow: 0 0 0 6px rgba(226, 139, 202, .25); } }
.assign-hint {
  margin: 0 10px 6px; padding: 9px 14px; border-radius: var(--rs);
  background: var(--pink-t); border: 1px solid var(--pink); color: var(--pink-d);
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  display: flex; align-items: center; gap: 10px;
  animation: slideDown .18s var(--pop);
}
.assign-hint b { color: var(--pink-d); }
.assign-hint .ah-text { flex: 1; }
.btn-codelist {
  padding: 8px 14px; border-radius: var(--rs); background: var(--sf); border: 1px solid var(--pink);
  font-family: var(--f-disp); font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--pink-d);
  white-space: nowrap; transition: transform .08s var(--ease);
}
.btn-codelist:active { transform: scale(.93); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }

.repeat-banner {
  margin: 0 10px 6px; padding: 12px 16px; border-radius: var(--rs);
  background: var(--olive-t); border: 1px solid var(--olive-d); color: var(--olive-d);
  font-size: 15px; font-weight: 700; cursor: pointer; display: flex; gap: 10px; align-items: center;
  box-shadow: var(--sh-sm);
  transition: transform .08s var(--ease), box-shadow .15s;
  animation: slideDown .18s var(--pop);
}
.repeat-banner:active { transform: scale(.99); box-shadow: var(--sh-md); }

.prod-grid {
  flex: 1; overflow-y: auto; padding: 8px 10px 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; align-content: start;
  overscroll-behavior: contain;
}
.prod-grid::-webkit-scrollbar { width: 6px; }
.prod-grid::-webkit-scrollbar-thumb { background: var(--brb); border-radius: 3px; }
.ptile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 94px; padding: 10px 10px 8px; text-align: left;
  background: var(--sf); border: 1px solid var(--br); border-radius: var(--r);
  box-shadow: inset 3px 0 0 var(--fc, var(--brb)), var(--sh-sm);
  transition: transform .08s var(--ease), border-color .12s, box-shadow .15s;
}
.ptile:active { transform: scale(.955); border-color: var(--fc, var(--brb)); }
.ptile:hover { box-shadow: inset 3px 0 0 var(--fc, var(--brb)), var(--sh-md); }
.ptile.selected {
  background: var(--pink-t); border-color: var(--pink);
  box-shadow: inset 3px 0 0 var(--pink), 0 0 0 2px rgba(226, 139, 202, .3), var(--sh-md);
}
.assign-mode .ptile { border-style: dashed; border-color: var(--pink); }
.pt-name { font-family: var(--f-disp); font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--cocoa);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pt-meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.pt-fmt {
  font-size: 10px; font-weight: 800; letter-spacing: .07em; padding: 2px 7px;
  border-radius: 4px; background: var(--sf3); color: var(--fc, var(--txd));
  border: 1px solid var(--br);
}
.pt-kb { font-size: 11px; font-weight: 700; color: var(--txd); }
.pt-ref { margin-left: auto; font-size: 10px; color: var(--txh); font-weight: 600; }
.pt-star { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--pink-d); }
.pt-starin { color: var(--pink-d); font-size: 12px; }
.pt-code {
  position: absolute; top: -7px; right: -6px; min-width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; padding: 0 7px;
  background: var(--cocoa); color: #fff;
  font-family: var(--f-disp); font-size: 14px; font-weight: 800; border-radius: 13px;
  box-shadow: var(--sh-md);
  transition: transform .12s var(--pop), background .12s;
  transform-origin: top right; z-index: 2;
}
/* Aprendizaje de atajos: al pasar el ratón la insignia crece */
.ptile:hover .pt-code { transform: scale(1.55); background: var(--pink-d); }
.grid-section {
  grid-column: 1 / -1; font-family: var(--f-disp); font-size: 11px; font-weight: 800; letter-spacing: .16em;
  color: var(--txh); padding: 8px 2px 0; text-transform: uppercase;
}
.grid-empty { grid-column: 1 / -1; text-align: center; color: var(--txh); padding: 40px 0; font-size: 15px; }

/* ================= TICKET ================= */
.ticket {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--sf); border-left: 1px solid var(--br);
  box-shadow: -4px 0 16px rgba(60, 43, 23, .06);
}
.mob-back { display: none; }
.tk-obs { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 12px 0; }
.tk-obs .obs-tag {
  font-size: 11px; font-weight: 800; letter-spacing: .05em; color: var(--pink-d);
  background: var(--pink-t); border: 1px solid var(--pink); border-radius: 4px; padding: 3px 8px;
  animation: popIn .14s var(--pop);
}
@keyframes popIn { from { opacity: 0; transform: scale(.7); } }
.tk-lines { flex: 1; overflow-y: auto; min-height: 60px; overscroll-behavior: contain; }
.tk-lines::-webkit-scrollbar { width: 6px; }
.tk-lines::-webkit-scrollbar-thumb { background: var(--brb); }
.tk-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 6px; color: var(--txh); font-size: 14px; font-weight: 600; }
.tk-empty-icon { font-size: 30px; opacity: .35; }
.tk-empty-hint { font-size: 12px; opacity: .8; }

.tline {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--br); cursor: pointer;
  transition: background .1s;
}
.tline:active, .tline.editing { background: var(--sf3); }
.tline.editing { box-shadow: inset 3px 0 0 var(--pink); }
@keyframes lineIn { 0% { opacity: 0; transform: translateX(14px); background: var(--olive-t); } 60% { background: var(--olive-t); } 100% { background: transparent; } }
.tline.flash { animation: lineIn .4s var(--ease); }
.tl-name { font-family: var(--f-disp); font-size: 13.5px; font-weight: 700; color: var(--cocoa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-amount { font-size: 15px; font-weight: 800; color: var(--olive-d); text-align: right; font-variant-numeric: tabular-nums; }
.tl-detail { font-size: 12px; color: var(--txd); font-variant-numeric: tabular-nums; }
.tl-detail b { color: var(--pink-d); font-size: 13px; }

/* ================= BARRA DE CÓDIGO RÁPIDO ================= */
.code-bar {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  margin: 0 10px; padding: 10px 14px; border-radius: var(--r);
  background: var(--cocoa); box-shadow: var(--sh-md);
  animation: slideDown .15s var(--pop);
}
.cb-num { font-family: var(--f-disp); font-size: 30px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; min-width: 56px; }
.cb-num::before { content: 'Nº '; font-size: 13px; color: var(--greige); font-weight: 700; vertical-align: middle; }
.cb-match { flex: 1; font-size: 16px; font-weight: 700; color: var(--greige); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-match.none { color: #a8987f; font-weight: 400; }
.cb-x { font-size: 15px; color: var(--greige); padding: 4px 12px; border: 1px solid #6b563c; border-radius: 5px; transition: transform .08s var(--ease); }
.cb-x:active { transform: scale(.9); }

/* ================= PANEL DE ENTRADA ================= */
.entry {
  background: var(--sf2); border-top: 2px solid var(--br); padding: 8px 10px; flex-shrink: 0;
  transition: border-color .15s;
}
.entry.active { border-top-color: var(--pink); }
.entry-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.entry-prod { flex: 1; font-family: var(--f-disp); font-size: 14px; font-weight: 700; color: var(--txh); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry.active .entry-prod { color: var(--cocoa); }
.entry-cancel { font-size: 16px; color: var(--txd); padding: 2px 12px; border: 1px solid var(--brb); border-radius: 5px; transition: transform .08s var(--ease); }
.entry-cancel:active { transform: scale(.88); }
.packaging-picker {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 6px;
  max-height: 108px; overflow-y: auto; overflow-x: hidden; padding: 7px 2px 3px 0;
  overscroll-behavior: contain;
}
.packaging-picker::-webkit-scrollbar { width: 5px; }
.packaging-picker::-webkit-scrollbar-thumb { background: var(--brb); border-radius: 4px; }
.pack-chip {
  min-width: 0; min-height: 42px; padding: 6px 9px; border-radius: var(--rs); background: var(--sf);
  border: 1px solid var(--brb); color: var(--txd);
  font-family: var(--f-disp); text-align: left;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  transition: transform .07s var(--ease), border-color .12s, background .12s;
}
.pack-chip:active { transform: scale(.97); }
.pack-chip.on { background: var(--olive-t); border-color: var(--olive-d); color: var(--olive-d); }
.pack-name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 800; letter-spacing: .025em;
}
.pack-qty { display: block; font-size: 9px; font-weight: 700; color: var(--txh); white-space: nowrap; }
.pack-chip.on .pack-qty { color: var(--olive-d); }
.pack-direct { border-style: dashed; }
.entry-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 6px; }
.efield {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; text-align: left;
  background: var(--sf); border: 1px solid var(--br); border-radius: var(--rs); cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: border-color .12s, background .12s, box-shadow .15s;
}
.efield.focus {
  border-color: var(--pink); background: var(--pink-t);
  box-shadow: 0 0 0 3px rgba(226, 139, 202, .15);
}
.efield-ro { cursor: default; background: var(--sf3); }
.ef-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--txh); display: flex; gap: 6px; align-items: center; }
.ef-unit {
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px;
  background: var(--sf3); border: 1px solid var(--brb); color: var(--pink-d);
}
.ef-unit-btn { cursor: pointer; transition: transform .08s var(--ease); }
.ef-unit-btn:active { transform: scale(.88); }
.ef-value { font-family: var(--f-disp); font-size: clamp(20px, 3vh, 26px); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cocoa); line-height: 1.15; }
.efield.focus .ef-value { color: var(--pink-d); }
.ef-amount { color: var(--olive-d); }

/* ================= ATAJOS + NUMPAD ================= */
.qchips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 6px 10px 0; flex-shrink: 0; }
.qchip {
  padding: 9px 0; border-radius: var(--rs); background: var(--sf);
  border: 1px solid var(--br); box-shadow: var(--sh-sm);
  font-family: var(--f-disp); font-size: 14px; font-weight: 800; color: var(--txd);
  transition: transform .07s var(--ease), color .1s, border-color .1s;
}
.qchip:active { transform: scale(.9); color: var(--pink-d); border-color: var(--pink); }
.qchip-last { color: var(--pink-d); }

.numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 10px 0; flex-shrink: 0; }
.nk {
  height: clamp(40px, 6.4vh, 58px); border-radius: var(--rs);
  background: var(--sf); border: 1px solid var(--br); border-bottom: 3px solid var(--brb);
  font-family: var(--f-disp); font-size: 28px; font-weight: 700; color: var(--cocoa); font-variant-numeric: tabular-nums;
  box-shadow: var(--sh-sm);
  transition: transform .06s var(--ease), background .06s, border-color .1s;
}
.nk:active { transform: translateY(2px) scale(.97); background: var(--sf3); border-bottom-width: 1px; }
.nk-fn { background: var(--sf3); color: var(--pink-d); font-size: 21px; }
.nk-fn.active-mode { background: var(--pink); border-color: var(--pink-d); border-bottom-color: var(--pink-d); color: #fff; }
.nk-del { background: var(--rd-t); border-color: var(--rd); border-bottom-color: var(--rd); color: var(--rd); font-size: 20px; }
.nk-del:disabled { background: var(--sf3); border-color: var(--br); border-bottom-color: var(--brb); color: var(--txh); opacity: .5; }

.btn-add {
  margin: 8px 10px 0; height: clamp(44px, 6.8vh, 58px); border-radius: var(--r); flex-shrink: 0;
  background: linear-gradient(180deg, #95a649, var(--olive-d));
  border-bottom: 3px solid #5a652a;
  color: #fff; font-family: var(--f-disp); font-size: 19px; font-weight: 800; letter-spacing: .09em;
  box-shadow: 0 3px 12px rgba(124, 138, 53, .35);
  transition: transform .07s var(--ease), filter .07s;
}
.btn-add:active { transform: translateY(2px) scale(.99); filter: brightness(1.08); border-bottom-width: 1px; }
.btn-add:disabled {
  background: var(--sf3); color: var(--txh); border-bottom: 1px solid var(--br); box-shadow: none;
}
.btn-add.editing { background: linear-gradient(180deg, var(--pink), var(--pink-d)); border-bottom-color: #93407a; box-shadow: 0 3px 12px rgba(226, 139, 202, .35); }
.btn-add.code-mode { background: linear-gradient(180deg, #5a4530, var(--cocoa)); border-bottom-color: #241809; box-shadow: 0 3px 12px rgba(60, 43, 23, .3); }

/* ================= PIE TICKET ================= */
.tk-foot {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; flex-shrink: 0;
  border-top: 1px solid var(--br); margin-top: 8px; background: var(--sf2);
}
.tk-total { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tt-meta { font-size: 10px; font-weight: 700; color: var(--txh); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-val { font-family: var(--f-disp); font-size: 22px; font-weight: 800; color: var(--cocoa); font-variant-numeric: tabular-nums; white-space: nowrap; transform-origin: left center; }
.tt-val.pulse { animation: totalPulse .25s var(--pop); }
@keyframes totalPulse { 40% { transform: scale(1.12); color: var(--olive-d); } }
.btn-obs, .btn-park {
  height: clamp(42px, 6vh, 52px); padding: 0 12px; border-radius: var(--rs);
  background: var(--sf); border: 1px solid var(--brb); box-shadow: var(--sh-sm);
  font-family: var(--f-disp); font-size: 12px; font-weight: 700;
  letter-spacing: .05em; color: var(--txd); white-space: nowrap;
  transition: transform .07s var(--ease), color .1s, border-color .1s;
}
.btn-obs:active, .btn-park:active { transform: scale(.93); color: var(--cocoa); }
.btn-park:disabled, .btn-obs:disabled { opacity: .5; }
.btn-confirm {
  height: clamp(42px, 6vh, 52px); padding: 0 18px; border-radius: var(--rs);
  background: linear-gradient(180deg, var(--pink), var(--pink-d));
  border: none; border-bottom: 3px solid #93407a; color: #fff;
  font-family: var(--f-disp); font-size: 15px; font-weight: 800; letter-spacing: .07em; white-space: nowrap;
  box-shadow: 0 3px 12px rgba(226, 139, 202, .35);
  transition: transform .07s var(--ease), filter .1s;
}
.btn-confirm:active { transform: scale(.96); filter: brightness(1.08); }
.btn-confirm:disabled { background: var(--sf3); border-bottom: 1px solid var(--br); color: var(--txh); box-shadow: none; }
.btn-block { width: 100%; }

/* ================= OVERLAYS ================= */
.overlay {
  position: fixed; inset: 0; background: rgba(60, 43, 23, .45); z-index: 40;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px;
  backdrop-filter: blur(3px);
  animation: ovIn .12s var(--ease);
}
@keyframes ovIn { from { opacity: 0; } }
.sheet {
  background: var(--sf); border-radius: 14px;
  width: min(660px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--sh-lg);
  animation: sheetIn .18s var(--pop);
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.sheet-sm { width: min(480px, 100%); }
.sheet-xs { width: min(360px, 100%); padding-bottom: 14px; }
.sheet-xs input { margin: 14px 14px 10px; }
.sheet-xs .btn-block { width: calc(100% - 28px); margin: 0 14px; height: 52px; }
.vendor-list { max-height: 42vh; overflow-y: auto; padding: 10px 14px 2px; }
.vendor-intro { padding: 12px 14px 2px; color: var(--txd); font-size: 12px; text-align: center; }
.vendor-row { display: flex; gap: 6px; margin-bottom: 6px; }
.vendor-pick {
  flex: 1; padding: 12px; border: 1px solid var(--brb); border-radius: var(--rs);
  background: var(--sf2); text-align: left; font-family: var(--f-disp); font-weight: 800;
}
.vendor-pick b, .vendor-pick small { display: block; }
.vendor-pick small { margin-top: 2px; color: var(--txh); font-size: 10px; font-weight: 600; }
.vendor-pick.on { border-color: var(--olive-d); background: var(--olive-t); color: var(--olive-d); }
.vendor-del { width: 42px; border: 1px solid var(--br); border-radius: var(--rs); color: var(--rd); }
.vendor-add { display: flex; gap: 6px; margin: 8px 14px 2px; }
.sheet-xs .vendor-add input { flex: 1; min-width: 0; margin: 0; font-size: 14px; }
.sheet-xs .vendor-add .btn-confirm { height: auto; padding: 0 12px; font-size: 11px; }
.sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  background: var(--cocoa); color: var(--greige);
  font-family: var(--f-disp); font-size: 13px; font-weight: 800; letter-spacing: .14em;
}
.sheet-head span { flex: 1; }
.sheet-x { font-size: 18px; color: var(--greige); padding: 4px 13px; border: 1px solid #6b563c; border-radius: 5px; transition: transform .08s var(--ease); }
.sheet-x:active { transform: scale(.88); }
.sheet-search { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--br); }
.sheet-search input { flex: 1; font-size: 20px; }
.btn-quick {
  background: var(--pink-t); border: 1px solid var(--pink); color: var(--pink-d); border-radius: var(--rs);
  font-family: var(--f-disp); font-weight: 800; font-size: 13px; padding: 0 16px; letter-spacing: .05em;
  transition: transform .08s var(--ease);
}
.btn-quick:active { transform: scale(.94); }
.recents { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 4px; }
.recents:empty { display: none; }
.rchip {
  padding: 10px 16px; border-radius: 20px; background: var(--sf3);
  border: 1px solid var(--brb);
  font-family: var(--f-disp); font-size: 14px; font-weight: 800; color: var(--cocoa);
  transition: transform .08s var(--ease), border-color .1s;
}
.rchip:active { transform: scale(.92); border-color: var(--pink); }
.sheet-list { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sheet-list::-webkit-scrollbar { width: 6px; }
.sheet-list::-webkit-scrollbar-thumb { background: var(--brb); }
.crow {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  padding: 13px 16px; border-bottom: 1px solid var(--br);
  transition: background .1s;
}
.crow:active { background: var(--sf3); }
.cr-alias { font-family: var(--f-disp); font-size: 16px; font-weight: 800; color: var(--cocoa); white-space: nowrap; }
.cr-name { flex: 1; font-size: 13px; color: var(--txd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-city { font-size: 12px; color: var(--txh); white-space: nowrap; }
.list-empty { padding: 30px; text-align: center; color: var(--txh); font-size: 14px; }
.list-more { padding: 12px; text-align: center; color: var(--txh); font-size: 12px; }

/* Observaciones */
.obs-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; }
.obs-chip {
  padding: 13px 16px; border-radius: var(--rs); background: var(--sf);
  border: 1px solid var(--brb); box-shadow: var(--sh-sm);
  font-family: var(--f-disp); font-size: 13px; font-weight: 800; color: var(--txd); letter-spacing: .03em;
  transition: transform .08s var(--ease), background .12s, color .12s, border-color .12s;
}
.obs-chip:active { transform: scale(.93); }
.obs-chip.on { background: var(--pink); border-color: var(--pink-d); color: #fff; }
#ovObs textarea { margin: 0 14px 12px; resize: none; font-size: 16px; }
#ovObs .btn-block { width: calc(100% - 28px); margin: 0 14px 14px; height: 52px; }

/* Aparcados / historial */
.hrow { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--br); }
.hr-main { flex: 1; min-width: 0; }
.hr-title { font-family: var(--f-disp); font-size: 14px; font-weight: 700; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-title b { color: var(--cocoa); }
.hr-sub { font-size: 12px; color: var(--txd); }
.hr-total { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--olive-d); }
.hr-btn {
  padding: 11px 13px; border-radius: var(--rs); background: var(--sf);
  border: 1px solid var(--brb); box-shadow: var(--sh-sm);
  font-family: var(--f-disp); font-size: 12px; font-weight: 800; color: var(--txd); white-space: nowrap;
  transition: transform .08s var(--ease), border-color .1s, color .1s;
}
.hr-btn:active { transform: scale(.92); color: var(--cocoa); }
.hr-btn.green { background: var(--olive-t); border-color: var(--olive-d); color: var(--olive-d); }
.hr-btn.red { color: var(--rd); border-color: var(--rd); background: var(--rd-t); }
.st-chip {
  padding: 9px 11px; border-radius: 5px; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; border: 1px solid; white-space: nowrap;
  transition: transform .08s var(--ease);
}
.st-chip:active { transform: scale(.92); }
.st-CONFIRMADO { color: var(--pink-d); border-color: var(--pink); background: var(--pink-t); }
.st-PREPARACION { color: #1f6e9c; border-color: #5e9fc4; background: #e7f2f9; }
.st-ENTREGADO { color: var(--olive-d); border-color: var(--olive-d); background: var(--olive-t); }
.st-COBRADO { color: var(--txd); border-color: var(--brb); background: var(--sf3); }
.btn-export { font-family: var(--f-disp); font-size: 11px; font-weight: 800; color: var(--greige); border: 1px solid #6b563c; border-radius: 5px; padding: 7px 13px; letter-spacing: .07em; transition: transform .08s var(--ease); }
.btn-export:active { transform: scale(.93); }

/* Confirmación */
.confirm-body { padding: 16px; font-size: 15px; line-height: 1.7; }
.confirm-body b { color: var(--cocoa); }
.confirm-body .cf-total { font-family: var(--f-disp); font-size: 30px; font-weight: 800; color: var(--olive-d); }
.confirm-assignee { margin: 0 14px 14px; padding: 12px; border: 1px solid var(--br); border-radius: var(--rs); background: var(--sf2); }
.confirm-assignee label { display: block; margin-bottom: 7px; font-family: var(--f-disp); font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--cocoa); }
.confirm-assignee label span { color: var(--txh); font-weight: 600; letter-spacing: 0; }
.employee-picker { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; padding-right: 3px; overscroll-behavior: contain; }
.employee-picker::-webkit-scrollbar { width: 5px; }
.employee-picker::-webkit-scrollbar-thumb { background: var(--brb); border-radius: 4px; }
.employee-option {
  width: 100%; min-height: 48px; display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border: 1px solid var(--brb); border-radius: var(--rs);
  background: var(--sf); text-align: left; transition: transform .07s var(--ease), border-color .12s, background .12s;
}
.employee-option:active { transform: scale(.98); }
.employee-option.on { border-color: var(--olive-d); background: var(--olive-t); box-shadow: inset 0 0 0 1px var(--olive-d); }
.employee-check {
  width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--brb); border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800;
}
.employee-option.on .employee-check { border-color: var(--olive-d); background: var(--olive-d); }
.employee-option span:last-child { min-width: 0; }
.employee-option b, .employee-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-option b { font-family: var(--f-disp); font-size: 12px; color: var(--cocoa); }
.employee-option small { margin-top: 2px; color: var(--txh); font-size: 10px; }
.confirm-assignee-hint { margin-top: 6px; color: var(--txh); font-size: 10px; }
.confirm-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.confirm-actions .btn-park { height: 52px; }

/* Asignación de código rápido */
.code-prod { padding: 14px 16px 4px; font-family: var(--f-disp); font-size: 14px; font-weight: 700; color: var(--cocoa); line-height: 1.35; }
.code-display {
  margin: 8px 16px; padding: 8px; text-align: center;
  font-family: var(--f-disp); font-size: 40px; font-weight: 800; color: var(--cocoa); font-variant-numeric: tabular-nums;
  background: var(--sf3); border: 1px solid var(--brb); border-radius: var(--rs);
}
.code-display.taken { color: var(--rd); border-color: var(--rd); background: var(--rd-t); }
.code-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 16px 12px; }
.code-pad button {
  height: 52px; border-radius: var(--rs);
  background: var(--sf); border: 1px solid var(--br); border-bottom: 3px solid var(--brb);
  font-family: var(--f-disp); font-size: 24px; font-weight: 700; color: var(--cocoa);
  box-shadow: var(--sh-sm);
  transition: transform .06s var(--ease), background .06s;
}
.code-pad button:active { transform: translateY(2px) scale(.95); background: var(--sf3); }
.code-pad .ck-del { font-size: 13px; font-weight: 800; color: var(--rd); background: var(--rd-t); border-color: var(--rd); border-bottom-color: var(--rd); letter-spacing: .05em; }

/* Lista de atajos */
.codelist-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--br);
}
.cl-num {
  min-width: 44px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: var(--cocoa); color: #fff; border-radius: 15px;
  font-family: var(--f-disp); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.cl-name { flex: 1; font-family: var(--f-disp); font-size: 13.5px; font-weight: 700; color: var(--tx); }
.cl-fmt { font-size: 11px; color: var(--txd); white-space: nowrap; }
.cl-fam { width: 10px; height: 26px; border-radius: 3px; }
.btn-print { font-family: var(--f-disp); font-size: 11px; font-weight: 800; color: var(--greige); border: 1px solid #6b563c; border-radius: 5px; padding: 7px 13px; letter-spacing: .07em; transition: transform .08s var(--ease); }
.btn-print:active { transform: scale(.93); }

/* Borrado de datos */
.btn-wipe {
  width: calc(100% - 28px); margin: 10px 14px 0; height: 44px; border-radius: var(--rs);
  background: none; border: 1px dashed var(--brb); color: var(--txh);
  font-family: var(--f-disp); font-size: 11px; font-weight: 800; letter-spacing: .08em;
  transition: all .12s var(--ease);
}
.btn-wipe.arm { border: 2px solid var(--rd); background: var(--rd-t); color: var(--rd); animation: assignPulse 1s infinite; }

/* Botón config Odoo (en overlay vendedor) */
.btn-odoo-cfg {
  width: calc(100% - 28px); margin: 8px 14px 14px; height: 40px; border-radius: var(--rs);
  background: none; border: 1px solid var(--cocoa-2); color: var(--cocoa);
  font-family: var(--f-disp); font-size: 11px; font-weight: 800; letter-spacing: .08em;
  transition: all .12s var(--ease);
}
.btn-odoo-cfg:active { background: var(--sf3); transform: scale(.97); }

/* ================= PUNTO DE SINCRONIZACIÓN (cabecera) ================= */
.hdr-sync {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  align-self: center; margin: 0 6px; cursor: pointer;
  transition: background .3s, box-shadow .3s, transform .1s var(--ease);
}
.hdr-sync:active { transform: scale(.8); }
.hdr-sync.sync-none { background: #6b563c; }
.hdr-sync.sync-idle { background: var(--greige); }
.hdr-sync.sync-ok   { background: #6bbd6e; box-shadow: 0 0 0 3px rgba(107,189,110,.3); }
.hdr-sync.sync-pending {
  background: var(--olive); box-shadow: 0 0 0 3px rgba(193,204,125,.35);
  animation: syncPulse 1.2s ease-in-out infinite;
}
.hdr-sync.sync-err { background: var(--rd); box-shadow: 0 0 0 3px rgba(200,71,62,.25); }
@keyframes syncPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); }
}

/* ================= BADGE ODOO EN HISTORIAL ================= */
.sync-badge {
  font-family: var(--f-disp); font-size: 9px; font-weight: 800; letter-spacing: .07em;
  padding: 2px 7px; border-radius: 10px; white-space: nowrap; align-self: center;
}
.sync-ok  { background: #e0f5e1; color: #2e7d32; border: 1px solid #c3e6c4; }
.sync-pte { background: var(--olive-t); color: var(--olive-d); border: 1px solid #d2db99; }
.sync-err { background: var(--rd-t); color: var(--rd); border: 1px solid #f0c4c1; cursor: help; }

/* ================= FORMULARIO ODOO ================= */
.odoo-form {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 18px 12px;
}
.of-label {
  font-family: var(--f-disp); font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: var(--txd); text-transform: uppercase; margin-top: 6px;
}
.of-opt { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 10px; }
.odoo-form input { font-size: 14px; padding: 8px 12px; }
.odoo-test-result {
  margin: 6px 18px 4px;
  padding: 10px 14px; border-radius: var(--rs);
  font-family: var(--f-disp); font-size: 13px; font-weight: 700;
}
.odoo-test-result.test-ok { background: #e6f4e6; color: #2e7d32; border: 1px solid #b7dfb7; }
.odoo-test-result.test-err { background: var(--rd-t); color: var(--rd); border: 1px solid #f0c4c1; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(24px) scale(.95);
  background: var(--cocoa); color: var(--greige);
  font-family: var(--f-disp); font-size: 14px; font-weight: 800; padding: 13px 26px; border-radius: var(--r);
  opacity: 0; transition: opacity .18s var(--ease), transform .18s var(--pop);
  pointer-events: none; z-index: 90; white-space: nowrap; letter-spacing: .04em;
  box-shadow: var(--sh-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.toast.err { background: var(--rd); color: #fff; }

/* ================= MEMORIA DE PRECIO ODOO (UPV/UPF) ================= */
.price-mem {
  display: flex; gap: 8px; margin-top: 8px;
}
.price-mem .pm-item {
  flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: var(--sf2); border: 1px solid var(--br); border-radius: var(--rs);
  padding: 6px 12px; text-align: left;
  transition: transform .08s var(--ease), border-color .12s, background .12s;
}
.price-mem .pm-item:not(.pm-ro) { cursor: pointer; }
.price-mem #pmUseUPV:not(:disabled):active { transform: scale(.97); }
.price-mem #pmUseUPV:not(:disabled):hover { border-color: var(--olive-d); background: var(--olive-t); }
.price-mem #pmUseUPV:disabled { opacity: .55; cursor: default; }
.price-mem .pm-on { border-color: var(--olive-d) !important; background: var(--olive-t) !important; box-shadow: inset 0 0 0 1px var(--olive-d); }
.pm-k { font-family: var(--f-disp); font-size: 9px; font-weight: 800; letter-spacing: .1em; color: var(--txh); }
.pm-v { font-family: var(--f-disp); font-size: 18px; font-weight: 800; color: var(--cocoa); font-variant-numeric: tabular-nums; }
.pm-ro .pm-v { color: var(--txd); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================= RESPONSIVE — ESCRITORIO ================= */
@media (max-width: 1100px) { .main { grid-template-columns: 1fr 380px; } }

/* Tablet landscape (≤900px) */
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr 340px; }
  .cat-search { width: 150px; }
}

/* Tablet portrait (≤820px) — tabs en fila propia para scroll completo */
@media (max-width: 820px) {
  .main { grid-template-columns: 1fr 300px; }
  .hdr-clock { display: none; }
  .hb-sub { display: none; }
  .hdr-btn { font-size: 10px; letter-spacing: .04em; padding: 0 8px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  /* Tabs en su propia fila completa para que el scroll horizontal funcione */
  .cat-tabs { flex: 0 0 100%; }
  .cat-search { flex: 1; width: auto; min-width: 0; }
  .cat-top { padding: 8px 8px 6px; gap: 6px; }
}

/* Phablet (≤680px) */
@media (max-width: 680px) {
  .main { grid-template-columns: 1fr 260px; }
  #btnHistory { display: none; }
  .cat-tab { padding: 9px 11px; font-size: 11px; }
  .nk { font-size: 24px; }
}

/* ================= MÓVIL / TABLET PORTRAIT — un panel a la vez (≤768px) ================= */
@media (max-width: 768px) {
  /* Header compacto */
  .hdr { padding: 6px 8px; gap: 6px; }
  .hdr-brand { padding: 0 4px 0 0; }
  .hb-name { font-size: 18px; }
  .hb-sub { display: none; }
  .hdr-vendor { font-size: 12px; padding: 0 9px; }
  .hc-label { display: none; }
  .hc-sub { display: none; }
  .hc-name { font-size: 16px; }
  .hdr-btn { display: none; }   /* pasan al mob-nav */
  .hdr-clock { display: none; }

  /* Un solo panel visible a la vez */
  .main { grid-template-columns: 1fr; }
  .ticket {
    grid-row: 1; grid-column: 1;
    border-left: none; box-shadow: none;
    border-top: 2px solid var(--br);
  }
  body:not(.mob-ticket) .ticket { display: none; }
  body.mob-ticket .catalog   { display: none; }
  .mob-back {
    display: block; flex-shrink: 0; padding: 8px 12px; text-align: left;
    background: var(--sf2); border-bottom: 1px solid var(--br);
    color: var(--pink-d); font-family: var(--f-disp); font-size: 11px; font-weight: 800; letter-spacing: .06em;
  }

  /* Catálogo: tabs en fila propia */
  .cat-tabs { flex: 0 0 100%; }
  .cat-search { flex: 1; width: auto; min-width: 0; }
  .cat-top { padding: 8px 8px 6px; gap: 6px; }
  .cat-tab { padding: 9px 12px; font-size: 11px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 7px; }

  /* Numpad táctil */
  .nk { height: clamp(46px, 9vh, 64px); font-size: 26px; }
  .btn-add { height: clamp(48px, 8vh, 62px); font-size: 18px; }
  .qchip { padding: 11px 0; }

  /* Pie: que OBS/APARCAR/CONFIRMAR quepan en pantalla estrecha */
  .tk-foot { gap: 5px; padding: 8px; }
  .btn-obs, .btn-park { padding: 0 9px; font-size: 11px; }
  .btn-confirm { padding: 0 12px; font-size: 14px; }
  .tt-val { font-size: 19px; }

  /* Nav inferior */
  .mob-nav { display: flex; }
}

/* ================= FRANJA "VER PEDIDO" al pie del catálogo ================= */
/* Visible en tablet/móvil (≤900px) cuando hay líneas — JS añade .has-lines */
.cat-order-strip {
  display: none;
  flex-shrink: 0;
  align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #4a3620, var(--cocoa));
  border-top: 2px solid #6b563c;
  box-shadow: 0 -4px 12px rgba(60, 43, 23, .2);
  animation: slideDown .15s var(--pop);
}
@media (max-width: 900px) {
  .cat-order-strip.has-lines { display: flex; }
}
.cos-info {
  flex: 1;
  font-family: var(--f-disp); font-size: 12px; font-weight: 700;
  color: #a8987f; letter-spacing: .03em;
}
.cos-total {
  font-size: 18px; font-weight: 800; color: var(--olive);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.cos-btn {
  flex-shrink: 0;
  padding: 9px 16px; border-radius: var(--rs);
  background: var(--pink); border-bottom: 2px solid var(--pink-d); color: #fff;
  font-family: var(--f-disp); font-size: 12px; font-weight: 800; letter-spacing: .06em;
  white-space: nowrap;
  transition: transform .07s var(--ease), filter .07s;
}
.cos-btn:active { transform: scale(.94); filter: brightness(1.1); }

/* ================= BARRA DE NAVEGACIÓN MÓVIL ================= */
/* Oculta por defecto; visible en ≤768px */
.mob-nav {
  display: none;
  flex-shrink: 0;
  background: linear-gradient(180deg, #4a3620, var(--cocoa));
  border-top: 2px solid #6b563c;
  box-shadow: 0 -4px 16px rgba(60, 43, 23, .25);
  padding-bottom: env(safe-area-inset-bottom, 0px); /* notch iOS */
}
.mob-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 9px 4px 11px;
  color: #a8987f;
  font-family: var(--f-disp); font-size: 8px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase;
  border-right: 1px solid #4a3620;
  position: relative;
  transition: color .1s var(--ease), background .12s;
  -webkit-tap-highlight-color: transparent;
}
.mob-tab:last-child { border-right: none; }
.mob-tab:active { background: rgba(255, 255, 255, .08); }
.mob-tab.mob-active { color: var(--pink); }
.mob-tab.mob-active::after {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%;
  height: 2px; background: var(--pink); border-radius: 0 0 2px 2px;
}
.mt-icon { font-size: 17px; line-height: 1.2; }
.mt-label { line-height: 1; }
.mob-badge {
  display: none;
  position: absolute; top: 5px; right: calc(50% - 20px);
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--pink); color: #fff;
  font-size: 9px; font-weight: 800; text-align: center; line-height: 15px;
}
.mob-badge.vis { display: block; }

/* ================= LOGIN / AUTENTICACIÓN ================= */
.login-screen {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #4a3620, #271b0d);
}
.login-screen.hidden { display: none; }
.login-card {
  width: min(380px, 100%); background: var(--sf); border-radius: 16px;
  padding: 34px 28px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
  text-align: center; animation: popIn .2s var(--pop);
}
.login-brand { font-family: Satisfy, "Segoe Script", cursive; font-size: 44px; color: var(--cocoa); line-height: 1; }
.login-sub { font-family: var(--f-disp); font-size: 11px; font-weight: 800; letter-spacing: .28em; color: var(--txh); text-transform: uppercase; margin: 4px 0 26px; }
#loginForm { display: flex; flex-direction: column; gap: 10px; }
#loginForm input { width: 100%; text-align: center; font-size: 17px; }
.login-error, .cp-form .login-error, .users-add .login-error {
  background: var(--rd-t); color: var(--rd); border-radius: var(--rs);
  padding: 8px 10px; font-size: 13px; font-weight: 600;
}
.login-foot { margin-top: 18px; font-size: 11px; color: var(--txh); letter-spacing: .03em; }
.login-card .btn-confirm { height: 52px; font-size: 17px; margin-top: 4px; }

/* Toast propio de auth (encima de todo) */
.auth-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--cocoa); color: #fff; padding: 11px 20px; border-radius: 24px;
  font-family: var(--f-disp); font-weight: 700; font-size: 14px; z-index: 6000;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: var(--sh-lg);
}
.auth-toast.show { opacity: 1; transform: translate(-50%, 0); }
.auth-toast.bad { background: var(--rd); }

/* Cuenta dentro del panel de ajustes */
.acct-box { margin: 6px 14px 2px; font-family: var(--f-disp); font-size: 12px; font-weight: 700; color: var(--olive-d); letter-spacing: .02em; text-align: center; }

/* Cambiar contraseña */
.cp-form { display: flex; flex-direction: column; gap: 9px; padding: 4px 16px 8px; }
.cp-form input { width: 100%; font-size: 16px; }
.cp-hint { background: var(--olive-t); color: var(--olive-d); border-radius: var(--rs); padding: 8px 10px; font-size: 12.5px; font-weight: 600; }
#ovChangePw .btn-confirm { width: calc(100% - 32px); margin: 0 16px 14px; height: 50px; }

/* Gestión de usuarios */
.urow { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--br); }
.ur-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ur-name { font-family: var(--f-disp); font-weight: 800; font-size: 14px; color: var(--cocoa); }
.ur-meta { font-size: 11.5px; color: var(--txh); }
.ur-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ur-btn { font-family: var(--f-disp); font-weight: 700; font-size: 11px; color: var(--txd); border: 1px solid var(--brb); border-radius: var(--rs); padding: 6px 9px; background: var(--sf2); }
.ur-btn:active { transform: scale(.94); }
.ur-btn.ur-del { color: var(--rd); border-color: #e9b8b4; }
.ur-btn:disabled { opacity: .35; }
.users-loading { padding: 20px; text-align: center; color: var(--txh); font-size: 13px; }
.users-add { border-top: 2px solid var(--br); padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 8px; background: var(--sf2); }
.ua-title { font-family: var(--f-disp); font-weight: 800; font-size: 13px; color: var(--cocoa); letter-spacing: .02em; }
.users-add input { width: 100%; font-size: 15px; }
.ua-admin { display: flex; align-items: center; gap: 8px; font-family: var(--f-disp); font-weight: 700; font-size: 13px; color: var(--txd); }
.ua-admin input { width: 18px; height: 18px; }
.users-add .confirm-actions { margin-top: 2px; }
