:root {
  --papel: #f5f1e8; --carta: #fffdf8; --tinta: #1d1b18; --tinta2: #5f584d; --tinta3: #8d8576;
  --linea: #e2dbcc; --linea2: #cfc6b3; --acento: #b5472a; --acento-osc: #923619; --acento-suave: #f6e3da;
  --verde: #2f6b3f; --verde-suave: #e0eee2; --rojo: #b3261e; --rojo-suave: #f8e1df; --ambar: #96600a; --ambar-suave: #f7ebcf;
  --radio: 10px; --sombra: 0 1px 2px rgba(29,27,24,.06), 0 6px 20px rgba(29,27,24,.06);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 var(--sans); color: var(--tinta); background: var(--papel); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
a { color: var(--acento-osc); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.suave { color: var(--tinta2); } .chico { font-size: 13px; } .neg { color: var(--rojo); } .pos { color: var(--verde); }
.cargando { display: grid; place-items: center; height: 100vh; color: var(--tinta2); font-family: var(--serif); font-size: 18px; }
[hidden] { display: none !important; }

/* ---------- Controles ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--linea2);
  background: var(--carta); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: #fff; border-color: var(--tinta3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn.pri:hover { background: var(--acento-osc); border-color: var(--acento-osc); }
.btn.osc { background: var(--tinta); border-color: var(--tinta); color: var(--papel); }
.btn.osc:hover { background: #000; }
.btn.pel { color: var(--rojo); }
.btn.liso { border-color: transparent; background: transparent; }
.btn.liso:hover { background: rgba(29,27,24,.06); }
.btn.ch { padding: 5px 10px; font-size: 13px; }
.btn.gr { padding: 14px 22px; font-size: 18px; }
.btn svg { width: 18px; height: 18px; flex: none; }
kbd { font: 600 11px var(--sans); padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
input[type=text], input[type=password], input[type=date], input[type=search], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--linea2); border-radius: 8px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 3px rgba(181,71,42,.15); }
textarea { resize: vertical; min-height: 70px; }
label.campo { display: block; }
label.campo > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--tinta2); margin-bottom: 4px; }
label.campo > small { display: block; color: var(--tinta3); font-size: 12px; margin-top: 3px; }
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 0; }
label.check input { width: 17px; height: 17px; accent-color: var(--acento); }
.form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 14px; }
.form > * { grid-column: span 6; }
.form > .a1 { grid-column: span 1; } .form > .a2 { grid-column: span 2; } .form > .a3 { grid-column: span 3; } .form > .a4 { grid-column: span 4; }
@media (max-width: 640px) { .form > .a1, .form > .a2, .form > .a3, .form > .a4 { grid-column: span 6; } }

/* ---------- Estructura ---------- */
.marco { display: grid; grid-template-columns: 216px 1fr; height: 100vh; }
.lateral { background: var(--tinta); color: #e9e2d2; display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; }
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.marca img { width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.marca b { font-family: var(--serif); font-size: 19px; color: #fff; display: block; line-height: 1.1; }
.marca small { color: #a39b89; font-size: 11.5px; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; }
.lateral nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: #d6cebd; text-decoration: none; font-weight: 500; }
.lateral nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.lateral nav a.activo { background: var(--acento); color: #fff; }
.lateral nav a svg { width: 19px; height: 19px; flex: none; }
.lateral .sep { height: 1px; background: rgba(255,255,255,.1); margin: 9px 8px; }
.lateral .pie { margin-top: auto; padding: 10px 8px 2px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.estado { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #c9c1af; }
.estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #5fba75; }
.estado.off::before { background: #e0a030; }
.estado.pend { color: #f0c36a; cursor: pointer; }
.estado.pend::before { background: #f0c36a; }
.usuario { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #fff; }
.usuario button { background: none; border: 0; color: #a39b89; cursor: pointer; padding: 4px; font-size: 12.5px; text-decoration: underline; }
.principal { overflow: auto; min-width: 0; }
.pagina { padding: 22px 26px 40px; max-width: 1400px; margin: 0 auto; }
.cab { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cab .acc { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.barra { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.barra > input, .barra > select { width: auto; min-width: 150px; }
.barra > input[type=search] { flex: 1; min-width: 220px; max-width: 420px; }
.tarjeta { background: var(--carta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta.pad { padding: 18px; }
.grilla { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.kpi { padding: 15px 17px; }
.kpi small { display: block; color: var(--tinta2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font: 700 clamp(19px, 2.1vw, 26px) var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--tinta2); }
.pest { display: flex; gap: 4px; border-bottom: 1px solid var(--linea2); margin-bottom: 18px; overflow-x: auto; }
.pest button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--tinta2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pest button.activo { color: var(--acento-osc); border-bottom-color: var(--acento); }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #ece6d8; color: var(--tinta2); white-space: nowrap; }
.chip.ok { background: var(--verde-suave); color: var(--verde); } .chip.mal { background: var(--rojo-suave); color: var(--rojo); } .chip.ojo { background: var(--ambar-suave); color: var(--ambar); }
.vacio { padding: 40px 20px; text-align: center; color: var(--tinta2); }
.nota { padding: 11px 14px; border-radius: 8px; background: var(--ambar-suave); color: #6b4500; font-size: 14px; }
.nota.info { background: #e9eef3; color: #2c4257; }

/* ---------- Tablas ---------- */
.tabla-caja { overflow: auto; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tinta2); padding: 10px 12px; border-bottom: 1px solid var(--linea2); position: sticky; top: 0; background: var(--carta); white-space: nowrap; }
.tabla td { padding: 9px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr.clic { cursor: pointer; }
.tabla tbody tr.clic:hover { background: #faf5ea; }
.tabla th.num { text-align: right; }
.tabla tr.tachada td { color: var(--tinta3); text-decoration: line-through; }
.tabla tr.tachada td .chip { text-decoration: none; }

/* ---------- Modales y avisos ---------- */
.fondo { position: fixed; inset: 0; background: rgba(29,27,24,.5); display: grid; place-items: start center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--carta); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 520px; animation: sube .14s ease-out; }
.modal.ancho { max-width: 780px; } .modal.xl { max-width: 1040px; }
@keyframes sube { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal > header button { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--tinta2); padding: 2px 6px; }
.modal > .cuerpo { padding: 16px 20px; }
.modal > footer { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#avisos { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, 90vw); }
.aviso { background: var(--tinta); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--sombra); animation: sube .15s ease-out; }
.aviso.mal { background: var(--rojo); } .aviso.ok { background: var(--verde); }

/* ---------- Acceso ---------- */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--tinta); }
.acceso .tarjeta { width: 100%; max-width: 380px; padding: 30px 28px; text-align: center; }
.acceso img { width: 150px; height: 150px; border-radius: 50%; }
.acceso h1 { margin: 10px 0 2px; } .acceso p { color: var(--tinta2); margin: 0 0 18px; }
.acceso form { display: grid; gap: 12px; text-align: left; }

/* ---------- Punto de venta ---------- */
.pos { display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(320px, 1fr); gap: 16px; height: 100vh; padding: 14px 16px; }
.pos-izq, .pos-der { display: flex; flex-direction: column; min-height: 0; }
.cuentas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; flex: none; }
.cuentas button { flex: none; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--linea2); background: var(--carta); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.cuentas button.activo { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.cuentas button.mas { border-style: dashed; color: var(--tinta2); }
.escaner { position: relative; flex: none; }
.escaner input { font-size: 19px; padding: 13px 14px 13px 44px; border-width: 2px; border-color: var(--tinta); }
.escaner > svg { position: absolute; left: 13px; top: 15px; width: 22px; height: 22px; color: var(--tinta2); }
.sugerencias { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--linea2); border-radius: 10px; box-shadow: var(--sombra); z-index: 20; max-height: 380px; overflow: auto; }
.sugerencias div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; }
.sugerencias div.sel, .sugerencias div:hover { background: var(--acento-suave); }
.sugerencias small { color: var(--tinta2); }
.ticket { flex: 1; overflow: auto; margin: 10px 0; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket td { padding: 9px 10px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.ticket td.nom b { display: block; font-weight: 600; }
.ticket td.nom small { color: var(--tinta2); }
.ticket .cant { display: inline-flex; align-items: center; gap: 2px; }
.ticket .cant button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--linea2); background: #fff; cursor: pointer; font-weight: 700; }
.ticket .cant .valor { min-width: 64px; text-align: center; font-weight: 700; cursor: pointer; padding: 3px 4px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.ticket .cant .valor:hover, .ticket .precio-u:hover { background: var(--acento-suave); }
.ticket .precio-u { cursor: pointer; border-radius: 6px; padding: 3px 5px; }
.ticket .quitar { background: none; border: 0; color: var(--tinta3); cursor: pointer; font-size: 20px; padding: 2px 8px; border-radius: 6px; }
.ticket .quitar:hover { background: var(--rojo-suave); color: var(--rojo); }
.ticket tr.nuevo { animation: destello .6s ease-out; }
@keyframes destello { from { background: var(--acento-suave); } }
.ticket-vacio { height: 100%; display: grid; place-items: center; text-align: center; color: var(--tinta3); padding: 20px; }
.ticket-vacio b { font: 700 20px var(--serif); color: var(--tinta2); display: block; margin-bottom: 6px; }
.total-caja { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--tinta); color: #fff; border-radius: var(--radio); }
.total-caja small { color: #b9b09d; display: block; font-size: 12.5px; }
.total-caja b { font: 700 34px var(--serif); font-variant-numeric: tabular-nums; }
.total-caja .btn.pri { font-size: 19px; padding: 14px 26px; }
.atajos { flex: none; display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cats { display: flex; gap: 6px; flex-wrap: wrap; flex: none; margin-bottom: 10px; max-height: 76px; overflow: auto; }
.cats button { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--linea2); background: var(--carta); cursor: pointer; font-size: 13.5px; font-weight: 600; }
.cats button.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.tiles { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; align-content: start; }
.tile { text-align: left; background: var(--carta); border: 1px solid var(--linea); border-radius: 10px; padding: 10px 11px; cursor: pointer; min-height: 78px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.tile:hover { border-color: var(--acento); box-shadow: var(--sombra); }
.tile b { font-size: 13.5px; line-height: 1.2; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile span { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--acento-osc); }
.tile span small { color: var(--tinta3); font-weight: 500; }
.tile.kg { border-left: 4px solid var(--verde); }
@media (max-width: 900px) {
  .marco { grid-template-columns: 1fr; height: auto; }
  .lateral { flex-direction: row; align-items: center; padding: 8px; overflow-x: auto; }
  .lateral nav { flex-direction: row; } .lateral nav a span, .marca div, .lateral .sep { display: none; }
  .marca { padding: 0 6px 0 0; } .lateral .pie { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0 6px; }
  .pos { grid-template-columns: 1fr; height: auto; } .ticket { min-height: 220px; } .tiles { max-height: 420px; }
  .pagina { padding: 16px 14px 30px; }
}

/* ---------- Cobro ---------- */
.cobro-total { text-align: center; padding: 6px 0 14px; }
.cobro-total small { color: var(--tinta2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.cobro-total b { display: block; font: 700 46px var(--serif); font-variant-numeric: tabular-nums; line-height: 1.1; }
.medios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.medios button { padding: 12px 6px; border-radius: 10px; border: 2px solid var(--linea2); background: #fff; cursor: pointer; font-weight: 700; }
.medios.dos { grid-template-columns: 1fr 1fr; } .medios button:disabled { opacity: .45; cursor: not-allowed; }
.pasos { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; } .pasos > li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; } .pasos h3 { margin: 2px 0 4px; font-size: 15px; } .pasos p { margin: 0 0 6px; }
.pasos .nro { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #ece6d8; } .pasos li.hecho .nro { background: var(--verde-suave); color: var(--verde); }
.medios button.activo { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-osc); }
.billetes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vuelto { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 10px; background: var(--verde-suave); color: var(--verde); font-weight: 700; margin-top: 10px; }
.vuelto b { font: 700 28px var(--serif); font-variant-numeric: tabular-nums; }
.vuelto.falta { background: var(--rojo-suave); color: var(--rojo); }
.renglon { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.renglon.fuerte { font-weight: 700; font-size: 17px; border-top: 1px solid var(--linea2); margin-top: 6px; padding-top: 10px; }
.exito { text-align: center; padding: 8px 0; }
.exito .tilde { width: 62px; height: 62px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; font-size: 34px; }
.peso-grande input { font: 700 34px var(--serif); text-align: center; padding: 12px; }

/* ---------- Gráficos simples ---------- */
.barras { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 22px; }
.barras .b { flex: 1; min-width: 6px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.barras .b i { display: block; width: 100%; max-width: 46px; background: var(--acento); border-radius: 4px 4px 0 0; min-height: 2px; }
.barras .b:hover i { background: var(--acento-osc); }
.barras .b em { font-style: normal; font-size: 11px; color: var(--tinta2); margin-top: 5px; white-space: nowrap; }
.barras .b .tip { position: absolute; bottom: 100%; background: var(--tinta); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; display: none; z-index: 5; }
.barras .b:hover .tip { display: block; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; }
.hbar .pista { height: 10px; background: #ece6d8; border-radius: 99px; overflow: hidden; }
.hbar .pista i { display: block; height: 100%; background: var(--acento); border-radius: 99px; }
.hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Impresión ---------- */
#impresion { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#impresion) { display: none !important; }
  #impresion { display: block; color: #000; }
}
.tk { font: 12px/1.35 'Courier New', Courier, monospace; color: #000; padding: 2mm 1mm; }
.tk.a58 { width: 54mm; font-size: 11px; } .tk.a80 { width: 76mm; }
.tk .c { text-align: center; } .tk .d { text-align: right; } .tk b { font-weight: 700; }
.tk h4 { font: 700 16px 'Courier New', monospace; margin: 2px 0; text-align: center; }
.tk hr { border: 0; border-top: 1px dashed #000; margin: 5px 0; }
.tk img.logo { width: 30mm; display: block; margin: 0 auto 3px; }
.tk img.qr { width: 30mm; display: block; margin: 4px auto; }
.tk table { width: 100%; border-collapse: collapse; }
.tk td { padding: 1px 0; vertical-align: top; }
.tk .tot td { font-size: 16px; font-weight: 700; padding-top: 3px; }
.tk .letra { display: inline-block; border: 2px solid #000; font-size: 22px; font-weight: 700; width: 34px; height: 34px; line-height: 30px; }
.etqs { display: flex; flex-wrap: wrap; gap: 0; }
.etq { border: 1px dashed #999; padding: 3mm; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; font-family: Arial, Helvetica, sans-serif; color: #000; break-inside: avoid; }
.etq .n { font-weight: 700; font-size: 11pt; line-height: 1.15; max-height: 2.4em; overflow: hidden; text-transform: uppercase; }
.etq .p { font-weight: 800; font-size: 26pt; line-height: 1; text-align: right; }
.etq .p small { font-size: 11pt; font-weight: 700; }
.etq .x { display: flex; justify-content: space-between; align-items: flex-end; font-size: 7.5pt; gap: 4px; }
.etq svg { height: 9mm; max-width: 34mm; }
.etq.g { width: 65mm; height: 35mm; } .etq.m { width: 49mm; height: 28mm; } .etq.m .p { font-size: 20pt; } .etq.m .n { font-size: 9pt; }
.etq.c { width: 39mm; height: 21mm; padding: 2mm; } .etq.c .p { font-size: 15pt; } .etq.c .n { font-size: 7.5pt; } .etq.c svg { display: none; }
.vista-etqs { background: #fff; border: 1px solid var(--linea); border-radius: 8px; padding: 12px; overflow: auto; max-height: 60vh; }
