/* ============================================================
   caja.css — punto de venta (mismo sistema de diseño que Último Trago)
   Pensado para tocar: botones grandes, contraste alto, sin scroll de página.
   ============================================================ */
body.es-caja{overflow:hidden}
.cj-top{background:color-mix(in srgb,var(--paper) 88%,transparent)!important;border-bottom:1px solid var(--line)!important}
.cj-top .tb-brand{gap:10px}
.cj-where{font-size:var(--fs-sm);color:var(--muted);white-space:nowrap;display:inline-flex;align-items:center;gap:8px;overflow:hidden;text-overflow:ellipsis}
.cj-where b{color:var(--text)}
.cj-tstate{font-size:var(--fs-xs);font-weight:700;border-radius:var(--r-pill);padding:2px 9px;background:var(--surface-2);color:var(--muted)}
.cj-tstate.on{background:var(--pos-bg);color:var(--pos)}
.cj-imp{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-xs);font-weight:700;border-radius:var(--r-pill);padding:4px 10px;white-space:nowrap}
.cj-imp svg{width:14px;height:14px}
.cj-imp.sim{background:var(--warn-bg);color:var(--warn-text)}
.cj-imp.ok{background:var(--pos-bg);color:var(--pos)}
.cj-menu{width:40px;height:40px;padding:0;justify-content:center}
.cj-menu svg{width:20px;height:20px}
.cj-main{position:fixed;top:var(--topbar-h);left:0;right:0;bottom:0;overflow:hidden;outline:none}

/* ---------- Venta ---------- */
.cj-pos{display:grid;grid-template-columns:minmax(0,1fr) 400px;height:100%}
.cj-left{display:flex;flex-direction:column;min-width:0;min-height:0;padding:16px 18px 0}
.cj-bar{display:flex;flex-direction:column;gap:10px;margin-bottom:12px}
.cj-cats{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.cj-cats::-webkit-scrollbar{display:none}
.cj-cats .chip-btn{padding:9px 16px;font-size:var(--fs-md);flex-shrink:0}
.cj-search{position:relative}
.cj-search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:var(--muted);pointer-events:none}
.cj-search .inp{padding-left:38px;height:44px;font-size:var(--fs-base)}
.cj-grid{flex:1;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;align-content:start;padding:2px 2px 18px}
.cj-tile{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:8px;min-height:96px;padding:12px 12px 11px 15px;text-align:left;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--shadow-1);cursor:pointer;font:inherit;color:var(--text);
  transition:transform .08s,border-color .12s,box-shadow .12s;-webkit-tap-highlight-color:transparent;user-select:none}
.cj-tile::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:4px;border-radius:0 4px 4px 0;background:var(--cat)}
.cj-tile:hover{border-color:var(--accent-ink)}
.cj-tile:active{transform:scale(.97)}
.cj-tile.pop{animation:cjPop .25s ease}
@keyframes cjPop{0%{transform:scale(.95)}60%{transform:scale(1.03)}100%{transform:scale(1)}}
.cj-tile-name{font-weight:700;font-size:var(--fs-md);line-height:1.25}
.cj-tile-price{font-family:var(--mono);font-weight:600;font-size:var(--fs-sm);color:var(--muted)}
.cj-tile-n{position:absolute;top:8px;right:8px;min-width:24px;height:24px;border-radius:12px;background:var(--accent-fill);color:#fff;font-size:var(--fs-xs);font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 6px}

.cj-ticket{display:flex;flex-direction:column;min-height:0;background:var(--surface);border-left:1px solid var(--line)}
.cj-th{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.cj-th>div{display:flex;flex-direction:column}
.cj-th b{font-size:var(--fs-lg)}
.cj-lines{flex:1;overflow-y:auto;padding:6px 10px}
.cj-line{display:grid;grid-template-columns:minmax(0,1fr) auto 90px;align-items:center;gap:8px;padding:8px 4px;border-bottom:1px solid var(--line)}
.cj-line:last-child{border-bottom:0}
.cj-line-name{display:flex;flex-direction:column;align-items:flex-start;gap:2px;background:none;border:0;padding:4px 2px;font:inherit;color:inherit;text-align:left;cursor:pointer;border-radius:var(--r-sm);min-width:0}
.cj-line-name:hover{background:var(--surface-2)}
.cj-line-name b{font-size:var(--fs-md);overflow:hidden;text-overflow:ellipsis;max-width:100%}
.cj-line.cort .cj-line-imp{color:var(--muted)}
.cj-line-imp{text-align:right;font-weight:700;font-family:var(--mono);font-size:var(--fs-sm)}
.stepper.sm{gap:4px}
.stepper.sm .btn{width:34px;height:34px}
.cj-q{min-width:26px;text-align:center;font-weight:800}
.cj-tag{display:inline-block;font-size:11px;font-weight:700;padding:0 6px;border-radius:var(--r-pill);background:var(--surface-2);color:var(--text)}
.cj-tag.gift{background:var(--pos-bg);color:var(--pos)}
.cj-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;min-height:180px;color:var(--muted);text-align:center}
.cj-empty svg{width:38px;height:38px;opacity:.6}
.cj-empty b{color:var(--text)}
.cj-tot{padding:12px 16px 4px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:4px}
.cj-total{font-size:var(--fs-xl);padding-top:4px}
.cj-total b{font-size:28px;letter-spacing:-.5px}
.cj-cobrar{margin:10px 16px 16px;height:58px;font-size:var(--fs-lg);justify-content:center;gap:10px}
.cj-cobrar kbd{font-size:11px;opacity:.75;background:rgba(255,255,255,.18);border:0;border-radius:4px;padding:1px 6px;color:#fff;font-family:var(--mono)}
.cj-mobbar{display:none}

/* ---------- Ventanas de la caja ---------- */
.cj-acc{display:flex;flex-direction:column;gap:8px}
.cj-acc-b{display:grid;grid-template-columns:28px 1fr;grid-template-rows:auto auto;column-gap:12px;align-items:center;text-align:left;padding:12px 14px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface);cursor:pointer;font:inherit;color:var(--text)}
.cj-acc-b:hover{border-color:var(--accent-ink);background:var(--surface-2)}
.cj-acc-b svg{grid-row:1/3;width:22px;height:22px;color:var(--accent-ink)}
.cj-acc-b b{font-size:var(--fs-md)}
.cj-acc-b span{font-size:var(--fs-sm);color:var(--muted)}
.cj-acc-b.danger svg,.cj-acc-b.danger b{color:var(--neg)}
.cj-acc-b.primary-acc{border-color:color-mix(in srgb,var(--accent-ink) 40%,var(--line))}
.cj-quick{display:flex;flex-wrap:wrap;gap:8px}
.cj-quick .btn{min-width:64px;height:44px;justify-content:center;font-weight:700}
.cj-money{position:relative}
.cj-money>span{position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:18px;font-weight:600;color:var(--muted);pointer-events:none}
.cj-big-inp{height:48px;font-size:20px;font-weight:700;font-family:var(--sans);font-variant-numeric:tabular-nums;padding-left:34px;padding-right:14px;letter-spacing:-.2px}
.cj-big-inp::placeholder{color:var(--muted);opacity:.55;font-weight:500}
/* Formularios de los modales: campos apilados con aire parejo */
.cj-form{display:flex;flex-direction:column;gap:16px}
.cj-form .hint{margin:0}
.cj-info{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:var(--r-sm);background:var(--surface-2);font-size:var(--fs-sm);color:var(--muted)}
.cj-info svg{width:16px;height:16px;flex:none}
.cj-info b{color:var(--text)}
/* Tamaños de modal: chico para 1-2 campos o una lista de acciones, mediano para formularios */
.modal.sm{max-width:440px}
.modal.md{max-width:580px}

.cj-pinm{max-width:380px}
.cj-pin-dots{display:flex;justify-content:center;gap:12px;margin:6px 0 4px}
.cj-pin-dots i{width:16px;height:16px;border-radius:50%;border:2px solid var(--line-strong)}
.cj-pin-dots i.on{background:var(--accent-fill);border-color:var(--accent-fill)}
.cj-pin-dots.shake{animation:cjShake .35s}
@keyframes cjShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
.cj-pin-err{min-height:20px;text-align:center;color:var(--neg);font-size:var(--fs-sm);font-weight:600}
.cj-keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:6px}
.cj-keypad .btn{height:58px;font-size:22px;font-weight:700;justify-content:center}
.cj-keypad .btn svg{width:22px;height:22px}

.cj-cobro-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.cj-cobro-total{display:flex;align-items:baseline;justify-content:space-between;padding:14px 16px;border-radius:var(--r-md);background:var(--surface-2);margin-bottom:12px}
.cj-cobro-total span{font-weight:700;color:var(--muted)}
.cj-cobro-total b{font-size:32px;letter-spacing:-.6px}
.cj-medios{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cj-medio{display:flex;align-items:center;gap:10px;padding:14px 12px;border:1.5px solid var(--line);border-radius:var(--r-md);background:var(--surface);cursor:pointer;font:inherit;font-weight:700;color:var(--text);min-height:54px}
.cj-medio svg{width:22px;height:22px;color:var(--muted)}
.cj-medio.on{border-color:var(--accent-fill);background:color-mix(in srgb,var(--accent-fill) 9%,var(--surface));color:var(--accent-ink)}
.cj-medio.on svg{color:var(--accent-ink)}
.cj-medio:last-child:nth-child(odd){grid-column:1/-1}
.cj-pagos{margin-top:12px;padding:10px 12px;border:1px dashed var(--line-strong);border-radius:var(--r-md);display:flex;flex-direction:column;gap:6px}
.cj-cobro-der{display:flex;flex-direction:column;gap:12px}
.cj-vuelto{display:flex;align-items:baseline;justify-content:space-between;padding:12px 16px;border-radius:var(--r-md);background:var(--surface-2);color:var(--muted)}
.cj-vuelto b{font-size:24px;color:var(--muted)}
.cj-vuelto.on{background:var(--pos-bg);color:var(--pos)}
.cj-vuelto.on b{color:var(--pos)}
.cj-vuelto.big b{font-size:30px}

.cj-ok{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.cj-ok>div:nth-child(2){display:flex;flex-direction:column;flex:1;min-width:160px}
.cj-ok>div:nth-child(2) b{font-size:var(--fs-lg)}
.cj-ok-ic{width:48px;height:48px;border-radius:50%;background:var(--pos-bg);color:var(--pos);display:flex;align-items:center;justify-content:center}
.cj-ok-ic svg{width:26px;height:26px}
.cj-sim-wrap{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}
.cj-sim-lbl{display:flex;align-items:center;gap:6px;font-size:var(--fs-xs);font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:6px}
.cj-sim-lbl svg{width:14px;height:14px}
.cj-paper{background:#fffef8;color:#222;font-family:var(--mono);font-size:12px;line-height:1.5;padding:14px 14px 18px;border:1px solid #e6e2d6;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.08);
  -webkit-mask:linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat,conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) bottom/12px 8px repeat-x;
  mask:linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat,conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) bottom/12px 8px repeat-x}
.cj-paper .c{text-align:center}
.cj-paper hr{border:0;border-top:1px dashed #999;margin:6px 0}
.cj-paper .u-between span:last-child{white-space:nowrap;padding-left:8px}
.cj-paper.comanda{font-size:14px}
.cj-com-l{padding:2px 0}

/* ---------- Abrir caja / cierre ---------- */
.cj-open{height:100%;overflow-y:auto;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:center;gap:20px;padding:40px 18px}
.cj-open-card{width:100%;max-width:460px;padding:26px 26px 22px;display:flex;flex-direction:column;gap:14px}
.cj-open-card h2{margin:0;font-size:var(--fs-2xl)}
.cj-open-card .hint{margin:0}
.cj-open-ic{width:52px;height:52px;border-radius:var(--r-md);background:color-mix(in srgb,var(--accent-fill) 12%,var(--surface));color:var(--accent-ink);display:flex;align-items:center;justify-content:center}
.cj-open-ic svg{width:28px;height:28px}
.cj-open-btn{height:54px;justify-content:center;font-size:var(--fs-lg)}
.cj-last{max-width:560px;padding:0}
.cj-last .table-scroll,.cj-last .hint{padding:0 18px}
.cj-last .hint{padding-bottom:16px}
.cj-arqueo{display:grid;grid-template-columns:1.3fr 1fr;gap:16px}
.cj-billetes{margin:0;padding-bottom:12px}
.cj-bill-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 16px}
.cj-bill{display:grid;grid-template-columns:1fr 92px;align-items:center;gap:8px;font-family:var(--mono);font-size:var(--fs-sm);font-weight:600}
.cj-bill .inp{text-align:center}
.cj-kpis{margin-bottom:12px}

/* ---------- Celular y tablet en vertical ---------- */
@media (max-width:860px){
  .cj-top{display:flex!important;padding:0 10px}
  .cj-top .tb-user,.cj-top .theme-switch,.cj-where .cj-tstate{display:none}
  .cj-top .tb-right{gap:8px}
  .cj-imp span{display:none}
  .cj-imp{padding:6px}
  .cj-pos{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto}
  .cj-ticket{display:none}
  .cj-left{padding:12px 12px 0}
  .cj-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px;padding-bottom:12px}
  .cj-tile{min-height:84px}
  .cj-mobbar{display:flex;gap:10px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line)}
  .cj-mobbar .btn.primary{flex:1;height:52px;justify-content:center;font-size:var(--fs-lg)}
  .cj-mob-ver{display:flex;align-items:center;gap:8px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--r-md);background:var(--surface);font:inherit;font-weight:700;color:var(--text);cursor:pointer}
  .cj-mob-ver:disabled{opacity:.5}
  .cj-mob-n{min-width:26px;height:26px;border-radius:13px;background:var(--accent-fill);color:#fff;display:flex;align-items:center;justify-content:center;font-size:var(--fs-sm)}
  .cj-cobro-grid,.cj-sim-wrap,.cj-arqueo{grid-template-columns:1fr}
  .cj-cobro-total b{font-size:26px}
  .cj-open{padding:20px 12px}
}
@media (min-width:861px) and (max-width:1100px){ .cj-pos{grid-template-columns:minmax(0,1fr) 340px} }
.es-caja .u-between{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cj-vuelto{gap:16px}
.cj-open-card .cj-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.cj-open-card .cj-quick .btn{min-width:0;padding:0 6px}
@media (max-width:420px){ .cj-open-card .cj-quick{grid-template-columns:repeat(2,minmax(0,1fr))} }
.cj-otros{display:flex;flex-direction:column;gap:14px}
.cj-otros .hint{margin:0}
@media (min-width:861px){ .cj-menu-m .cj-acc{display:grid;grid-template-columns:1fr 1fr} }
.cj-arqueo.solo{grid-template-columns:1fr}
.cj-arqueo .hint{margin:0}
.cj-ef-tot{font-size:var(--fs-lg);font-weight:700}
