/* La Yungueña · Caja
   Marco verde de marca (menú lateral en computadora/tablet, barra inferior en celular),
   franja roja-amarilla-verde como el cuello de la muñeca. */
:root {
  --bg: #EDF2E4; --surface: #FFFFFF; --sunk: #F3F7EC; --line: #D5E0C6;
  --ink: #102A16; --muted: #5B6F55;
  --brand: #12501E; --brand-2: #1F6E2B; --brand-dim: #D3EBC6;
  --leaf: #1E7A2E; --leaf-dark: #11501C; --leaf-soft: #E3F2D6;
  --lime: #7DB52A; --sun: #F2C511; --sun-soft: #FFF8DB; --chili: #C8102E; --danger: #B3261E;
  --warn-bg: #FFF3C4; --warn-ink: #5A4100; --err-bg: #FCE4E7; --err-ink: #6E0A1B;
  --f-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-brush: "Permanent Marker", "Lilita One", cursive;
  --f-ticket: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 16px;
  --shadow: 0 1px 2px rgb(16 42 22 / .06), 0 8px 22px rgb(16 42 22 / .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
[hidden] { display: none !important; }
.d { font-family: var(--f-display); font-weight: 400; letter-spacing: .01em; }
.tn { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tri { height: 5px; flex: none; background: linear-gradient(90deg, var(--chili) 0 33.3%, var(--sun) 33.3% 66.6%, var(--leaf) 66.6%); }
.lbl { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

/* ---------- marco ---------- */
.app { display: flex; min-height: 100%; }
.side { width: 220px; flex: none; background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; margin: 2px 4px 16px; }
.face { width: 46px; height: 46px; border-radius: 999px; border: 2px solid #fff; flex: none;
  background: var(--sun) url(../img/mascota.webp) no-repeat -51px -41px / 132px auto; }
.brand img { height: 30px; width: auto; min-width: 0; }
.nv { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--brand-dim);
  font-weight: 700; text-decoration: none; border: 0; background: none; width: 100%; text-align: left; }
.nv svg { width: 22px; height: 22px; flex: none; }
.nv:hover { background: rgb(255 255 255 / .08); color: #fff; }
.nv.on { background: var(--sun); color: #16310F; }
.who { margin-top: auto; display: flex; gap: 10px; align-items: center; background: rgb(0 0 0 / .2); border-radius: 14px; padding: 10px; }
.av { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: #fff; font: 18px var(--f-display); flex: none; }
.who small { display: block; font-size: 12px; color: var(--brand-dim); }
.link-claro { color: var(--brand-dim); font-size: 13px; font-weight: 700; background: none; border: 0; padding: 6px 12px; text-align: left; text-decoration: underline; }
.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.top .grow { margin-right: auto; min-width: 0; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side { width: auto; height: auto; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 2px; top: auto; }
  .side .brand, .side .who, .side .link-claro { display: none; }
  .nv { flex-direction: column; gap: 2px; font-size: 11px; padding: 7px 2px; text-align: center; justify-content: center; }
  .main { padding: 14px 14px 110px; }
  h1 { font-size: 24px; }
}

/* ---------- piezas comunes ---------- */
.card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 14px; color: var(--ink); text-decoration: none; }
.btn.pri { background: var(--leaf); border-color: var(--leaf); color: #fff; box-shadow: 0 3px 0 var(--leaf-dark); }
.btn.bad { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.chico { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; border-radius: 14px; border: 0;
  background: var(--leaf); color: #fff; font: 21px var(--f-display); box-shadow: 0 4px 0 var(--leaf-dark); }
.cta:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--leaf-dark); }
.cta:disabled { background: #B9C7AE; box-shadow: none; cursor: not-allowed; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f input, .f select, .f textarea, input.in, select.in { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; min-height: 44px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip i { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.seg { display: inline-flex; background: #DCE6D0; border-radius: 999px; padding: 4px; }
.seg button, .seg a { padding: 8px 16px; border-radius: 999px; font-weight: 800; border: 0; background: none; color: #3E5238; font-size: 14px; text-decoration: none; }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--leaf-soft); color: var(--brand); }
.pill.hot { background: var(--chili); color: #fff; }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.aviso { padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.aviso.warn { background: var(--warn-bg); color: var(--warn-ink); }
.aviso.err { background: var(--err-bg); color: var(--err-ink); }
.aviso.ok { background: var(--leaf-soft); color: var(--brand); }
.vacio { border: 2px dashed var(--line); border-radius: var(--r); padding: 24px 18px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vacio img { height: 140px; width: auto; }
.vacio b { color: var(--ink); font: 20px var(--f-display); }
.step { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--sunk); font-weight: 800; font-size: 18px; line-height: 1; flex: none; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1.5px solid var(--line); }
.tabla td { padding: 8px; border-bottom: 1.5px dashed var(--line); vertical-align: middle; }
.scroll-x { overflow-x: auto; }
.foto { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--leaf-soft); display: grid; place-items: center; color: var(--leaf); flex: none; }
.cargando { padding: 40px; text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- avisos (toast) y ventanas ---------- */
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px;
  width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px; box-shadow: 0 10px 24px rgb(16 42 22 / .18);
  pointer-events: auto; animation: entra .2s ease; }
.toast b { display: block; }
.toast span { font-size: 14px; }
.toast.ok { background: var(--brand); color: #fff; }
.toast.ok span { color: var(--brand-dim); }
.toast.warn { background: var(--warn-bg); color: var(--warn-ink); }
.toast.err { background: var(--err-bg); color: var(--err-ink); }
@keyframes entra { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.velo { position: fixed; inset: 0; z-index: 60; background: rgb(6 20 10 / .6); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.ventana { background: #fff; border-radius: 24px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 60px rgb(0 0 0 / .35); }
.ventana.ancha { width: min(820px, 100%); }
.ventana .v-in { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.ventana .cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* ---------- ingreso ---------- */
.ingreso { min-height: 100vh; display: flex; flex-wrap: wrap; }
.ingreso .heroe { flex: 1 1 420px; color: #fff; padding: 36px 40px 0; display: flex; flex-direction: column; gap: 16px; overflow: hidden;
  background: radial-gradient(120% 90% at 90% 0%, rgb(125 181 42 / .55), transparent 60%), linear-gradient(160deg, var(--brand-2), #0E3F17); }
.ingreso .heroe .mascota { height: min(420px, 50vh); width: auto; align-self: center; margin-top: auto; filter: drop-shadow(0 14px 24px rgb(0 0 0 / .35)); }
.ingreso .lado { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.ingreso .caja-ing { width: 100%; max-width: 520px; background: #fff; border-radius: 26px; overflow: hidden; box-shadow: 0 18px 40px rgb(16 42 22 / .12); }
.usuarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.usr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; border: 2px solid var(--line); background: #fff; }
.usr.on { border-color: var(--leaf); background: var(--leaf-soft); }
.usr .av { width: 54px; height: 54px; font-size: 22px; }
.puntos { display: flex; gap: 14px; justify-content: center; }
.punto { width: 18px; height: 18px; border-radius: 999px; border: 2.5px solid var(--brand); }
.punto.f { background: var(--brand); }
.teclado { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tecla { height: 60px; border-radius: 16px; border: 1.5px solid var(--line); background: #F6F9F1; font: 26px var(--f-display); }
.tecla.txt { font: 800 15px var(--f-body); color: var(--muted); }
@media (max-width: 760px) { .ingreso .heroe { padding: 24px 20px 0; flex-basis: 100%; } .ingreso .heroe .mascota { height: 200px; } }

/* ---------- caja ---------- */
.caja { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.catalogo { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.buscar { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 16px; min-height: 48px; }
.buscar input { border: 0; outline: 0; flex: 1; min-width: 0; font-weight: 600; background: transparent; }
.secnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sec-tit { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; scroll-margin-top: 12px; }
.grandes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grande { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 16px 14px; min-height: 124px;
  border-radius: 20px; border: 0; text-align: left; color: #fff; background: linear-gradient(150deg, var(--brand-2), var(--brand));
  box-shadow: 0 4px 0 #0B3513, 0 10px 22px rgb(16 42 22 / .18); overflow: hidden; }
.grande:active { transform: translateY(2px); box-shadow: 0 2px 0 #0B3513; }
.grande::after { content: ""; position: absolute; right: -26px; bottom: -30px; width: 110px; height: 110px; border-radius: 70% 0; transform: rotate(25deg); background: rgb(125 181 42 / .35); }
.grande > * { position: relative; z-index: 1; }
.grande .nom { font-weight: 800; font-size: 14px; color: #CFE6C2; }
.grande .pre { font: 38px/1 var(--f-display); }
.grande .nota { margin-top: auto; font-size: 12px; font-weight: 700; color: var(--sun); }
.grande.hot { background: linear-gradient(150deg, #A30D26, var(--chili)); box-shadow: 0 4px 0 #6E0A1B; }
.qty { position: absolute; top: -8px; right: -6px; min-width: 26px; height: 26px; border-radius: 999px; background: var(--chili); color: #fff;
  display: grid; place-items: center; font: 14px var(--f-display); border: 2px solid #fff; padding: 0 7px; z-index: 3; }
.grande .qty { top: 10px; right: 10px; background: var(--sun); color: #16310F; }
.grado { display: grid; grid-template-columns: 150px repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.grado .gnom { display: flex; flex-direction: column; justify-content: center; padding: 4px 8px; border-left: 6px solid var(--lime); border-radius: 6px; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px; min-height: 64px;
  border-radius: 14px; border: 2px solid var(--line); background: #F6F9F1; }
.opt:hover { border-color: var(--leaf); }
.opt.monto { background: var(--sun-soft); border-color: #EBD27A; }
.opt b { font: 19px/1.1 var(--f-display); }
.opt small { font-size: 12px; font-weight: 700; color: var(--muted); }
@media (max-width: 620px) { .grado { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grado .gnom { grid-column: 1 / -1; } }
.combos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.combo { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; border: 2px solid var(--sun); padding: 14px; background: #FFFBEA; border-radius: 18px; }
.combo:hover { border-color: var(--chili); }
.lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.item { position: relative; display: flex; gap: 10px; align-items: center; text-align: left; border: 0; padding: 10px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.item:hover { outline: 2px solid var(--leaf); }
.item .qty { top: -6px; right: -6px; }
.edad { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--warn-bg); color: #6B4E00; margin-left: 4px; vertical-align: 1px; }
.ticket { flex: 1 1 340px; min-width: 0; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; position: sticky; top: 16px; }
.ticket .cab { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px 6px; }
.lineas { list-style: none; margin: 0; padding: 0 20px; max-height: max(220px, calc(100vh - 470px)); overflow-y: auto; }
.linea { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1.5px dashed var(--line); }
.linea small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.linea .cant { display: flex; align-items: center; gap: 8px; }
.pago { padding: 16px 20px 20px; margin-top: 12px; border-top: 1.5px solid var(--line); background: var(--sunk); display: flex; flex-direction: column; gap: 12px; }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total b { font: 40px/1 var(--f-display); color: var(--brand); }
.metodos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 6px; font-weight: 800; min-height: 52px; }
.mt.on { border-color: var(--leaf); background: var(--leaf-soft); }
.barra-celu, .barra-cerrar { display: none; }
@media (max-width: 760px) { .barra-cerrar { display: inline-flex; } }
@media (max-width: 760px) {
  .ticket { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; border-radius: 22px 22px 0 0; max-height: 88vh; transform: translateY(105%);
    transition: transform .22s ease; box-shadow: 0 -12px 40px rgb(0 0 0 / .3); }
  .ticket.abierto { transform: none; }
  .barra-celu { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); z-index: 35; align-items: center; gap: 10px;
    padding: 10px 10px 10px 16px; background: var(--leaf); color: #fff; border: 0; border-radius: 18px; box-shadow: 0 8px 22px rgb(0 0 0 / .28); text-align: left; }
  .barra-celu b { font: 22px var(--f-display); margin-right: auto; }
  .barra-celu span { font: 16px var(--f-display); background: rgb(0 0 0 / .16); padding: 8px 14px; border-radius: 12px; }
}

/* ---------- cobro y venta cobrada ---------- */
.monto-grande { width: 100%; padding: 10px 14px; border: 2.5px solid var(--leaf); border-radius: 16px; background: #fff; font: 36px var(--f-display); }
.billetes { display: flex; gap: 6px; flex-wrap: wrap; }
.billetes button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.check { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--sunk); font-weight: 700; border: 2px solid transparent; text-align: left; width: 100%; }
.check.on { border-color: var(--leaf); background: var(--leaf-soft); }
.check .caja-check { width: 26px; height: 26px; border-radius: 8px; border: 2.5px solid #9DBB88; display: grid; place-items: center; background: #fff; color: #fff; flex: none; }
.check.on .caja-check { background: var(--leaf); border-color: var(--leaf); }
.exito { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.exito .mascota { height: 230px; width: auto; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .25)); }

/* ---------- comprobante impreso ---------- */
#comprobante { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body * { visibility: hidden; }
  #comprobante, #comprobante * { visibility: visible; }
  #comprobante { display: block; position: absolute; left: 0; top: 0; width: 76mm; padding: 2mm 3mm; font: 11px/1.45 var(--f-ticket); color: #000; }
  #comprobante .c { text-align: center; }
  #comprobante .fila { display: flex; justify-content: space-between; gap: 8px; }
  #comprobante hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #comprobante .tot { font-size: 14px; font-weight: 700; }
}

/* ---------- reportes ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; }
.kpi b { display: block; font: 26px var(--f-display); }
.kpi.prin { background: linear-gradient(110deg, var(--brand), var(--brand-2)); color: #fff; }
.kpi.prin .lbl { color: var(--brand-dim); }
.barras { display: flex; align-items: flex-end; gap: 10px; height: 220px; border-bottom: 2px solid #C9D3BF; padding: 0 4px; }
.barras .col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.barras .col span.v { font-size: 11px; font-weight: 800; text-align: center; margin-bottom: 3px; }
.etiquetas { display: flex; gap: 10px; padding: 6px 4px 0; }
.etiquetas span { flex: 1; min-width: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; margin-bottom: 12px; font-size: 14px; }
.hbar .t { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: #EEF2E8; overflow: hidden; }
.hbar .t span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--leaf), var(--lime)); }
.leyenda { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #3E5238; }
.leyenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
