/* Caja La Negra 24/7 — tema oscuro (negro, violeta y rosa), pensado para pantallas táctiles y uso de noche */
:root {
  --fondo: #0d0812; --panel: #17101f; --panel2: #211630; --borde: #34244a; --texto: #f4eefb; --suave: #b9a8cf;
  --violeta: #a855f7; --rosa: #ec4899; --ok: #22c55e; --mal: #f43f5e; --amarillo: #facc15;
  --grad: linear-gradient(135deg, #a855f7, #ec4899);
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
a { color: #d8b4fe; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; } h2 { font-size: 1.08rem; margin: 1.1rem 0 .6rem; color: #e9d5ff; } h2:first-child { margin-top: 0; } h3 { font-size: 1rem; }
.sub { color: var(--suave); font-size: .9rem; } .centro { text-align: center; } .der { text-align: right; } .ok { color: var(--ok); } .mal { color: var(--mal); }
.cargando { padding: 3rem; text-align: center; color: var(--suave); }

/* botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .62rem 1rem; border-radius: 10px; border: 1px solid var(--borde);
  background: var(--panel2); color: var(--texto); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--violeta); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.activo { background: #3b2160; border-color: var(--violeta); }
.btn-primario { background: var(--grad); border: 0; color: #fff; }
.btn-peligro { background: #4c0f1f; border-color: #9f1239; color: #fecdd3; }
.btn-chico { min-height: 34px; padding: .3rem .7rem; font-size: .88rem; }
.btn-grande { width: 100%; min-height: 56px; font-size: 1.15rem; margin-top: .6rem; }
.link { background: none; border: 0; color: #d8b4fe; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
input, select, textarea { width: 100%; font: inherit; color: var(--texto); background: #0f0a16; border: 1px solid var(--borde); border-radius: 10px; padding: .6rem .75rem; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violeta); outline-offset: 0; border-color: transparent; }
label { display: block; font-size: .85rem; color: var(--suave); margin-bottom: .25rem; font-weight: 600; }
.campo { margin-bottom: .8rem; flex: 1; min-width: 0; }
.fila { display: flex; gap: .7rem; flex-wrap: wrap; } .fila > * { flex: 1 1 150px; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--texto); font-weight: 500; font-size: .95rem; margin: .4rem 0; }
.check input { width: 20px; min-height: 20px; height: 20px; accent-color: var(--violeta); }
.monto-grande { font-size: 1.6rem; font-weight: 700; text-align: right; }
.aviso { background: #3a2a05; border: 1px solid #854d0e; color: #fde68a; padding: .6rem .8rem; border-radius: 10px; margin: .5rem 0; }
.aviso.error { background: #3f0d1a; border-color: #9f1239; color: #fecdd3; }
.pill { padding: .2rem .6rem; border-radius: 99px; font-size: .82rem; font-weight: 700; text-decoration: none; }
.pill.ok { background: #14532d; color: #bbf7d0; } .pill.mal { background: #4c0519; color: #fecdd3; }

/* barra superior */
.barra { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .8rem; padding: .5rem 1rem; background: #0a0610ee; border-bottom: 1px solid var(--borde); backdrop-filter: blur(6px); flex-wrap: wrap; }
.marca { text-decoration: none; }
.logo { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 800; font-size: 1.35rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.logo.grande { font-size: 2.4rem; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a { color: var(--suave); text-decoration: none; padding: .55rem .8rem; border-radius: 10px; font-weight: 600; }
.nav a.activo, .nav a:hover { background: var(--panel2); color: #fff; }
.estado-red { font-size: .82rem; font-weight: 700; padding: .3rem .7rem; border-radius: 99px; margin-left: auto; }
.estado-red.ok { color: #86efac; } .estado-red.subiendo { color: var(--amarillo); } .estado-red.sin { background: #4c0519; color: #fecdd3; }
.usuario { display: flex; align-items: center; gap: .6rem; }
main { padding: 1rem; max-width: 1500px; margin: 0 auto; }

/* ingreso */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 20% 10%, #3b0764 0, transparent 45%), radial-gradient(circle at 90% 90%, #500724 0, transparent 40%); }
.acceso-caja { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--borde); border-radius: 20px; padding: 1.6rem; box-shadow: 0 20px 60px #0008; }
.acceso-caja.ancha { width: min(560px, 100%); }
.acceso-marca { text-align: center; margin-bottom: 1rem; } .acceso-marca small { display: block; color: var(--suave); }
.personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; margin: .8rem 0; }
.persona { background: var(--panel2); border: 2px solid var(--borde); border-radius: 14px; color: var(--texto); font: inherit; font-weight: 700; padding: .9rem .5rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.persona.activa { border-color: var(--rosa); background: #3b1a3f; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: 1.4rem; color: #fff; }
.pin-puntos { display: flex; justify-content: center; gap: .7rem; margin: .6rem 0 1rem; }
.pin-puntos i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--violeta); }
.pin-puntos i.lleno { background: var(--grad); border-color: transparent; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.teclado button { min-height: 64px; font-size: 1.6rem; font-weight: 700; border-radius: 14px; border: 1px solid var(--borde); background: var(--panel2); color: var(--texto); cursor: pointer; }
.teclado button:active { background: #3b2160; }
.teclado .tecla-ok { background: var(--grad); border: 0; font-size: 1.1rem; } .teclado .tecla-func { font-size: 1.3rem; }
.teclado.chico button { min-height: 52px; font-size: 1.3rem; }

/* pantalla de venta */
.pos { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 1rem; height: calc(100vh - 90px); }
.pos-izq, .pos-der { min-height: 0; display: flex; flex-direction: column; }
.buscador { position: relative; }
.buscador input { font-size: 1.15rem; min-height: 54px; }
.sugerencias { position: absolute; z-index: 5; left: 0; right: 0; top: 58px; background: var(--panel); border: 1px solid var(--violeta); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px #000a; }
.sug { display: flex; justify-content: space-between; width: 100%; padding: .75rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--borde); color: var(--texto); font: inherit; cursor: pointer; text-align: left; }
.sug.marcada, .sug:hover { background: #2b1840; } .sug-vacia { padding: .8rem 1rem; color: var(--suave); }
.rubros { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .5rem; margin: .7rem 0; }
.rubro { --c: #7c3aed; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 78px; border-radius: 14px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 18%, #120b19); color: #fff; font: inherit; font-size: 1.7rem; }
.rubro span { font-size: .86rem; font-weight: 700; } .rubro.activo { background: color-mix(in srgb, var(--c) 55%, #120b19); border-color: #fff; }
.rubro.inactivo { opacity: .35; }
.rubros-config { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.productos-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: min-content; gap: .5rem; padding-bottom: 1rem; }
.prod { --c: #7c3aed; min-height: 86px; border-radius: 12px; border: 1px solid var(--borde); background: var(--panel); color: var(--texto); font: inherit; cursor: pointer; padding: .6rem; display: flex; flex-direction: column; justify-content: space-between; text-align: left; gap: .3rem; }
.prod:active { transform: scale(.97); } .prod b { color: #f5d0fe; font-size: 1.1rem; } .p-nom { font-weight: 600; font-size: .95rem; }
.prod.libre { border: 2px dashed var(--c); background: color-mix(in srgb, var(--c) 14%, #120b19); align-items: center; justify-content: center; text-align: center; font-weight: 700; }
.p-emoji { font-size: 1.6rem; } .sin-stock { color: var(--mal); font-weight: 700; }
.ayuda-grid { grid-column: 1 / -1; padding: 1rem; }
.pos-der { background: var(--panel); border: 1px solid var(--borde); border-radius: 18px; overflow: hidden; }
.ticket-cab { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--borde); }
.ticket-cab h2 { margin: 0; }
.ticket-lineas { flex: 1; overflow: auto; padding: .3rem .6rem; }
.ticket-vacio { color: var(--suave); text-align: center; padding: 2.5rem 1rem; }
.linea { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: .5rem; padding: .55rem .4rem; border-bottom: 1px solid #2a1d3a; }
.linea.flash { animation: flash .6s; } @keyframes flash { from { background: #4c1d95; } to { background: transparent; } }
.l-desc { font-weight: 600; } .l-desc small { display: block; color: var(--suave); font-weight: 400; }
.l-cant { display: flex; align-items: center; gap: .3rem; } .l-cant span { min-width: 2.2ch; text-align: center; font-weight: 700; }
.l-cant button, .l-quitar { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--borde); background: var(--panel2); color: var(--texto); font-size: 1.1rem; cursor: pointer; }
.l-quitar { color: #fda4af; } .l-sub { min-width: 80px; text-align: right; }
.ticket-pie { padding: .8rem 1rem 1rem; border-top: 1px solid var(--borde); background: #120b19; }
.fila-desc { display: flex; justify-content: space-between; color: var(--suave); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: .3rem 0 .6rem; }
.total span { color: var(--suave); font-weight: 700; } .total b { font-size: 2.6rem; }
.btn-cobrar { width: 100%; min-height: 70px; font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; border: 0; border-radius: 14px; background: var(--grad); color: #fff; cursor: pointer; }
.btn-cobrar small { font-size: .8rem; opacity: .8; font-weight: 600; } .btn-cobrar:disabled { opacity: .35; cursor: not-allowed; }

/* cobro */
.cobro-total { font-size: 3rem; font-weight: 800; text-align: center; margin: .2rem 0 .8rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.medio { min-height: 58px; border-radius: 12px; border: 2px solid var(--borde); background: var(--panel2); color: var(--texto); font: inherit; font-weight: 700; cursor: pointer; }
.medio.activo { border-color: var(--rosa); background: #3b1a3f; }
.billetes { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.billetes button { flex: 1 1 80px; min-height: 48px; border-radius: 10px; border: 1px solid #166534; background: #052e16; color: #bbf7d0; font: inherit; font-weight: 700; cursor: pointer; }
.vuelto { font-size: 1.5rem; text-align: center; margin: .6rem 0; } .vuelto b { color: #86efac; font-size: 2rem; }
.fila-pago { display: grid; grid-template-columns: 1fr 160px; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.exito { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #0d0812d9; text-align: center; animation: aparecer .15s; }
.exito > div { background: var(--panel); border: 2px solid var(--ok); border-radius: 24px; padding: 2rem 3rem; font-size: 1.3rem; }
.exito-ok { font-size: 4rem; color: var(--ok); line-height: 1; } .exito-vuelto { font-size: 2.6rem; font-weight: 800; color: #86efac; margin-top: .4rem; }
.exito small { display: block; color: var(--suave); margin-top: .4rem; font-size: .9rem; }
@keyframes aparecer { from { opacity: 0; } }

/* paneles, tablas y reportes */
.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--r); padding: 1.1rem; margin-bottom: 1rem; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; } .acciones.izq { justify-content: flex-start; margin-bottom: .5rem; }
.columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--r); padding: 1rem; }
.tarjeta span { color: var(--suave); font-weight: 600; font-size: .9rem; } .tarjeta b { display: block; font-size: 1.9rem; margin: .2rem 0; } .tarjeta small { color: var(--suave); }
.tabla { width: 100%; border-collapse: collapse; } .tabla td, .tabla th { padding: .5rem .45rem; border-bottom: 1px solid #2a1d3a; text-align: left; vertical-align: top; }
.tabla th { color: var(--suave); font-size: .82rem; } .tabla .der { text-align: right; } .tabla tr.anulado { opacity: .45; text-decoration: line-through; }
.tabla.grande tr[data-id], .tabla tr.clic, .tabla.ventas tr { cursor: pointer; } .tabla tr[data-id]:hover, .tabla tr.clic:hover, .tabla.ventas tr:hover { background: #22162f; }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; } .filtros > input, .filtros > select { flex: 1 1 200px; width: auto; }
.filtros label { display: flex; align-items: center; gap: .4rem; margin: 0; } .rapidos { display: flex; gap: .3rem; flex-wrap: wrap; }
.barras { display: grid; gap: .35rem; } .barra-fila { display: grid; grid-template-columns: 130px 1fr auto; gap: .6rem; align-items: center; font-size: .92rem; }
.barra-graf { height: 14px; background: #2a1d3a; border-radius: 99px; overflow: hidden; } .barra-graf i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.vacio { text-align: center; padding: 3rem 1rem; color: var(--suave); } .vacio.grande h1 { color: var(--texto); } .vacio .emoji { font-size: 4rem; }
.vacio.grande .btn-grande { width: auto; padding: 0 2.5rem; }
.centrado { display: grid; place-items: center; } .ancho-medio { width: min(620px, 100%); }
details summary { cursor: pointer; color: #d8b4fe; margin: .3rem 0 .8rem; font-weight: 600; }
.conteo { display: grid; gap: .3rem; margin-bottom: .8rem; }
.conteo-fila { display: grid; grid-template-columns: 100px 18px 1fr 110px; align-items: center; gap: .4rem; margin: 0; color: var(--texto); font-weight: 600; }
.conteo-fila input { min-height: 40px; padding: .35rem .6rem; text-align: right; } .conteo-fila b { text-align: right; color: #86efac; }
.dif { font-size: 1.3rem; font-weight: 700; text-align: center; min-height: 1.6em; margin-bottom: .5rem; }

/* diálogos y avisos */
dialog { width: min(520px, 94vw); max-height: 92vh; overflow: auto; background: var(--panel); color: var(--texto); border: 1px solid var(--violeta); border-radius: 18px; padding: 1.3rem; box-shadow: 0 30px 80px #000c; }
dialog::backdrop { background: #05020acc; }
dialog h2 { margin-top: 0; font-size: 1.3rem; }
.pie-form { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 150%); background: #14532d; color: #dcfce7; padding: .8rem 1.3rem; border-radius: 12px; font-weight: 600; z-index: 60; transition: transform .25s; max-width: 92vw; box-shadow: 0 10px 30px #000a; }
.toast.ver { transform: translate(-50%, 0); } .toast.error { background: #881337; color: #ffe4e6; }

/* ticket impreso (impresora térmica de 58/80 mm) */
.ticket-papel { background: #fff; color: #111; font: 13px/1.35 "Courier New", monospace; padding: .8rem; border-radius: 8px; }
.ticket-papel hr { border: 0; border-top: 1px dashed #999; } .tl { display: flex; justify-content: space-between; gap: .5rem; }
#impresion { display: none; }
@media print {
  body > *:not(#impresion) { display: none !important; }
  #impresion { display: block; } .ticket-papel.impreso { width: 72mm; padding: 0; border-radius: 0; }
  @page { margin: 2mm; size: 80mm auto; }
}

/* tablets en vertical y celulares */
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; height: auto; } .pos-der { order: -1; } .ticket-lineas { max-height: 32vh; }
  .total b { font-size: 2rem; } .estado-red { margin-left: 0; } .nav a { padding: .45rem .55rem; }
  .columnas { grid-template-columns: 1fr; } .barra-fila { grid-template-columns: 90px 1fr auto; }
}

/* personal por turno */
.persona small { font-weight: 500; font-size: .75rem; color: var(--suave); }
.persona.de-turno { border-color: #6d28d9; }
.tabla-personal select { min-width: 120px; }
.tabla-personal .check { margin: 0; white-space: nowrap; }
.tabla-personal .fila-alta td { border-bottom: 0; padding-top: .8rem; }

/* productos: fotos */
.mini-foto { width: 52px; } .mini-foto img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.foto-producto { display: flex; gap: .9rem; align-items: center; margin: .3rem 0 .6rem; }
.foto-vista { width: 110px; height: 110px; border-radius: 12px; background: #0f0a16; border: 1px dashed var(--borde); display: grid; place-items: center; text-align: center; color: var(--suave); font-size: .8rem; overflow: hidden; flex: none; }
.foto-vista img { width: 100%; height: 100%; object-fit: cover; }
.foto-producto .btn { margin-bottom: .35rem; }

/* pedidos de la tienda */
.badge { display: inline-block; min-width: 1.3rem; padding: 0 .4rem; border-radius: 99px; background: var(--panel2); border: 1px solid var(--borde); color: #fff; font-size: .75rem; text-align: center; }
.badge.alerta { background: var(--rosa); border-color: var(--rosa); animation: latido 1.2s infinite; }
@keyframes latido { 50% { transform: scale(1.12); } }
.pestanas { margin-bottom: 1rem; }
.pedidos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.pedido { background: var(--panel); border: 1px solid var(--borde); border-left: 5px solid var(--borde); border-radius: var(--r); padding: .9rem 1rem; }
.pedido.nuevo { border-left-color: var(--rosa); box-shadow: 0 0 0 1px #ec489955; } .pedido.prep { border-left-color: var(--amarillo); }
.pedido.listo, .pedido.camino { border-left-color: var(--violeta); } .pedido.ok { opacity: .75; border-left-color: var(--ok); } .pedido.mal { opacity: .6; border-left-color: var(--mal); }
.pedido header { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; } .pedido header .sub { margin-left: auto; }
.pedido-num { font-size: 1.35rem; }
.pill.est-nuevo { background: #831843; color: #fce7f3; } .pill.est-prep { background: #713f12; color: #fef9c3; } .pill.est-listo, .pill.est-camino { background: #4c1d95; color: #ede9fe; }
.pill.est-ok { background: #14532d; color: #bbf7d0; } .pill.est-mal { background: #4c0519; color: #fecdd3; }
.pedido-cli, .pedido-entrega { margin-bottom: .35rem; }
.nivel { font-size: .8rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: #2a1d3a; white-space: nowrap; }
.pedido-items { list-style: none; padding: .4rem 0; margin: 0; border-top: 1px dashed var(--borde); border-bottom: 1px dashed var(--borde); }
.pedido-items li { display: flex; justify-content: space-between; gap: .5rem; padding: .12rem 0; }
.pedido-total { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin: .45rem 0; } .pedido-total b { font-size: 1.25rem; }
.pedido-nota { background: #2a1d3a; border-radius: 8px; padding: .4rem .6rem; margin-bottom: .4rem; }
.pedido .acciones { margin-top: .6rem; }
.badge[hidden] { display: none; }

/* ingreso del personal en la pantalla de acceso */
.bloque-personal { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); text-align: center; }
.bloque-personal p { margin: 0 0 .6rem; }
.bloque-personal .btn { width: 100%; }
.acceso-caja h2 { margin: .25rem 0 .75rem; font-size: 1.15rem; }
.dlg-cuerpo ol { padding-left: 1.2rem; } .dlg-cuerpo li { margin: .4rem 0; }
section.panel { scroll-margin-top: 9rem; }
.codigo-alta { font: 700 2rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .15em; text-align: center; padding: .8rem; border: 2px dashed var(--borde, #6b21a8); border-radius: 12px; user-select: all; }
