/* Panel de la tienda — TruVaBo (18-oct-2026).
   Marca: fondo crema, tinta carbón, verde SOLO en acciones, terracota de acento, Nunito.
   Pensado para PC (1280–1920 px) y aceptable en tableta. */

:root {
  color-scheme: light;
  --fondo: #FAF7F2;
  --papel: #FFFFFF;
  --tinta: #1F2A27;
  --suave: #56625E;
  --borde: #E4DED3;
  --borde-fuerte: #CFC7BA;
  --hueso: #F3EEE6;
  --verde: #2E6B5E;
  --verde-fuerte: #245A4E;
  --verde-claro: #E5EFEC;
  --terracota: #A65035;
  --terracota-claro: #F6E6DF;
  --ambar: #8A5A00;
  --ambar-claro: #FBF0D9;
  --rojo: #A3301F;
  --rojo-claro: #F9E4E0;
  --azul: #2C4F73;
  --azul-claro: #E7EEF6;
  --letra: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radio: 14px;
  --radio-chico: 9px;
  --sombra: 0 1px 2px rgba(31, 42, 39, .06), 0 4px 14px rgba(31, 42, 39, .05);
  --sombra-alta: 0 12px 40px rgba(31, 42, 39, .18);
  --ancho-menu: 228px;
  --t-ui: 160ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: var(--letra); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
a { color: var(--verde-fuerte); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--terracota); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.suave { color: var(--suave); }
.chico { font-size: .875rem; }
.nums, .num { font-variant-numeric: tabular-nums; }
.centrado { text-align: center; margin-top: .8rem; }
.solo-imprimir { display: none; }
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 42px; padding: .5em 1.05em; border-radius: var(--radio-chico); border: 1.5px solid transparent; background: var(--hueso); color: var(--tinta); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background var(--t-ui), border-color var(--t-ui), transform 80ms; }
.btn:hover { background: #ECE5DA; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primario { background: var(--verde); color: #fff; }
.btn-primario:hover { background: var(--verde-fuerte); }
.btn-secundario { background: var(--papel); border-color: var(--verde); color: var(--verde-fuerte); }
.btn-secundario:hover { background: var(--verde-claro); }
.btn-suave { background: var(--papel); border-color: var(--borde-fuerte); }
.btn-suave:hover { background: var(--hueso); }
.btn-peligro { background: var(--rojo); color: #fff; }
.btn-peligro:hover { background: #86271A; }
.btn-alerta { background: var(--terracota); color: #fff; }
.btn-alerta:hover { background: #8D432C; }
.peligro-texto { color: var(--rojo) !important; }
.btn-grande { min-height: 50px; font-size: 1.06rem; padding: .55em 1.3em; }
.btn-chico { min-height: 34px; padding: .3em .8em; font-size: .9rem; }
.btn-bloque { width: 100%; }
.btn-icono { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; font-size: 1rem; color: var(--suave); }
.btn-icono:hover { background: var(--hueso); color: var(--tinta); }
.btn-icono:disabled { opacity: .35; cursor: default; }
.btn-icono-texto { min-height: 42px; padding: .4em .7em; border-radius: var(--radio-chico); border: 1.5px solid var(--borde-fuerte); background: var(--papel); cursor: pointer; }
.btn-icono-texto:hover { background: var(--hueso); }
.fila-botones { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.girando { display: inline-block; width: 1em; height: 1em; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; vertical-align: -.15em; margin-right: .35em; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Campos ---------- */
.campo { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.campo label, .etiqueta-campo { font-weight: 700; font-size: .92rem; }
.campo.crece { flex: 1 1 260px; }
.campo.corto { width: 92px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-height: 42px; padding: .45em .7em; border: 1.5px solid var(--borde-fuerte); border-radius: var(--radio-chico); background: var(--papel); width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--verde); outline: none; box-shadow: 0 0 0 3px rgba(46, 107, 94, .18); }
input:disabled, select:disabled, textarea:disabled { background: var(--hueso); color: var(--suave); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--verde); flex: none; margin: 0; }
.ayuda { color: var(--suave); font-size: .82rem; }
.fila-campos { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-start; }
.fila-campos > .campo { flex: 1 1 180px; }
.fila-campos > .campo.corto { flex: 0 0 92px; }
.pila { display: flex; flex-direction: column; gap: .9rem; }
.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 600; }
.check.grande { font-size: 1.02rem; margin: .4rem 0; }
.radio { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1.5px solid var(--borde); border-radius: var(--radio-chico); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.opciones-radio { border: 0; padding: 0; margin: .8rem 0; display: grid; gap: .45rem; }
.opciones-radio legend { font-weight: 800; margin-bottom: .45rem; }
.error-form { background: var(--rojo-claro); color: var(--rojo); border-radius: var(--radio-chico); padding: .6rem .8rem; font-weight: 700; }
.con-sufijo { display: flex; align-items: center; gap: .4rem; }
.con-sufijo input { width: 110px !important; }
.input-codigo { font-size: 1.6rem !important; letter-spacing: .35em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.input-codigo.grande { font-size: 2.2rem !important; max-width: 220px; margin: 0 auto; }
.campo-buscar { flex: 1 1 260px; max-width: 380px; }

/* ---------- Bandas y avisos ---------- */
.banda { padding: .7rem 1rem; border-radius: var(--radio-chico); font-size: .95rem; }
.banda-info { background: var(--azul-claro); color: var(--azul); }
.banda-aviso { background: var(--ambar-claro); color: var(--ambar); }
.banda-error { background: var(--rojo-claro); color: var(--rojo); }
.banda-ok { background: var(--verde-claro); color: var(--verde-fuerte); }
.banda-demo { background: var(--ambar-claro); color: #5C3D00; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.banda-recoger { background: var(--terracota-claro); color: #7C3923; margin: .6rem 0; }
#avisos { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: .5rem; z-index: 300; max-width: min(440px, calc(100vw - 36px)); }
.toast { background: var(--tinta); color: #fff; padding: .8rem 1rem; border-radius: 12px; box-shadow: var(--sombra-alta); font-weight: 600; animation: entra .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--verde-fuerte); }
.toast.error { background: var(--rojo); }
.toast.sale { opacity: 0; transform: translateY(8px); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Insignias y etiquetas ---------- */
.insignia { display: inline-flex; align-items: center; padding: .12em .6em; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.insignia.nuevo { background: var(--terracota); color: #fff; }
.insignia.prep { background: var(--verde-claro); color: var(--verde-fuerte); }
.insignia.listo { background: #DDF0E2; color: #1E5A35; }
.insignia.camino { background: var(--azul-claro); color: var(--azul); }
.insignia.fin { background: var(--hueso); color: var(--suave); }
.insignia.mal { background: var(--rojo-claro); color: var(--rojo); }
.etq { display: inline-block; padding: .08em .5em; border-radius: 6px; font-size: .78rem; font-weight: 700; background: var(--hueso); color: var(--suave); margin: 0 .25rem .2rem 0; }
.etq.recoger { background: var(--terracota-claro); color: #7C3923; }
.etq.domicilio { background: var(--azul-claro); color: var(--azul); }
.etq.pago { background: #F1EEE8; }

/* ---------- Entrar ---------- */
#pantalla-entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.entrar-marco { width: min(1040px, 100%); display: flex; flex-direction: column; gap: 1.2rem; }
.entrar-cab { display: flex; align-items: center; gap: 1rem; }
.entrar-sub { font-weight: 800; color: var(--terracota); font-size: 1.1rem; padding-left: 1rem; border-left: 2px solid var(--borde); }
.entrar-cuerpo { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--papel); border-radius: 22px; box-shadow: var(--sombra); overflow: hidden; border: 1px solid var(--borde); }
.entrar-qr { padding: 2.2rem; border-right: 1px solid var(--borde); }
.entrar-qr h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.pasos { margin: 0 0 1.2rem; padding-left: 1.3rem; display: grid; gap: .35rem; font-size: 1.02rem; }
.qr-caja { display: flex; flex-direction: column; align-items: center; gap: .7rem; min-height: 330px; justify-content: center; background: var(--fondo); border-radius: 18px; padding: 1.2rem; }
.qr-img svg { display: block; border-radius: 10px; box-shadow: 0 0 0 1px var(--borde); }
.qr-codigo { font-size: 2rem; font-weight: 900; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.qr-estado { color: var(--suave); font-weight: 600; display: flex; align-items: center; gap: .3rem; }
.qr-error, .qr-ok, .qr-cargando { text-align: center; display: grid; gap: .6rem; justify-items: center; }
.ok-grande { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--verde); color: #fff; font-size: 2.2rem; font-weight: 900; }
.entrar-numero { padding: 2.2rem; display: flex; flex-direction: column; gap: 1rem; }
.entrar-numero h2 { font-size: 1.3rem; }
.nombre-equipo { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--borde); }
.entrar-pie { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.elegir { border: 0; padding: 0; display: grid; gap: .5rem; }
.elegir legend { font-weight: 800; margin-bottom: .4rem; }

/* ---------- Carga ---------- */
#pantalla-carga { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.carga-caja { text-align: center; display: grid; gap: .8rem; justify-items: center; max-width: 420px; }

/* ---------- Marco ---------- */
#app { display: grid; grid-template-columns: var(--ancho-menu) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--tinta) var(--ancho-menu), var(--fondo) var(--ancho-menu)); }
#lateral { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--tinta); color: #E8EEEB; padding: 1rem .7rem; gap: .8rem; }
.marca { display: flex; align-items: center; gap: .6rem; padding: .2rem .5rem .6rem; }
.marca img { width: 30px; height: auto; }
.marca .nombre { display: flex; flex-direction: column; min-width: 0; }
.marca b { font-size: 1.15rem; letter-spacing: -.01em; }
.marca small { color: #B9C6C1; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.tienda-chip { display: flex; align-items: center; gap: .6rem; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: .6rem; }
.tienda-chip img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: #fff; }
.tienda-chip .t-txt { min-width: 0; display: flex; flex-direction: column; }
#tienda-nombre { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#quien { font-size: .8rem; color: #B9C6C1; display: flex; flex-direction: column; }
#quien b { color: #E8EEEB; font-weight: 700; }
#nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
#nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px; color: #D5DFDB; text-decoration: none; font-weight: 700; position: relative; }
#nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
#nav a[aria-current=page] { background: #FAF7F2; color: var(--tinta); }
#nav a[aria-current=page] .ico { color: var(--verde); }
#nav .contador { margin-left: auto; background: var(--terracota); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: .82rem; padding: 0 .4rem; animation: latido 1.2s ease-in-out infinite; }
.pie-menu { margin-top: auto; display: grid; gap: .4rem; }
.pie-menu .btn { background: transparent; color: #D5DFDB; border-color: rgba(255, 255, 255, .18); justify-content: flex-start; }
.pie-menu .btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

#contenido { min-width: 0; display: flex; flex-direction: column; }
#barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .8rem 1.6rem; background: rgba(250, 247, 242, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--borde); }
#titulo-vista { font-size: 1.45rem; }
.barra-der { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.estado-vivo { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 700; color: var(--suave); }
.estado-vivo .punto { width: 10px; height: 10px; border-radius: 50%; background: #9AA5A1; }
.estado-vivo.ok .punto { background: #2F9A5B; box-shadow: 0 0 0 3px rgba(47, 154, 91, .18); }
.estado-vivo.mal { color: var(--ambar); }
.estado-vivo.mal .punto { background: #D49A1E; animation: latido 1s infinite; }
.interruptor { display: inline-flex; align-items: center; gap: .55rem; border: 1.5px solid var(--borde-fuerte); background: var(--papel); border-radius: 999px; padding: .3rem .9rem .3rem .35rem; cursor: pointer; font-weight: 800; min-height: 42px; }
.interruptor .pista { width: 44px; height: 26px; border-radius: 999px; background: #C9C2B6; position: relative; transition: background var(--t-ui); }
.interruptor .bola { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t-ui); }
.interruptor.abierta { border-color: var(--verde); color: var(--verde-fuerte); }
.interruptor.abierta .pista { background: var(--verde); }
.interruptor.abierta .bola { transform: translateX(18px); }
.interruptor.cerrada { color: var(--rojo); }
.interruptor.mini { min-height: 34px; padding: .15rem .6rem .15rem .2rem; font-size: .88rem; }
.interruptor.mini .pista { width: 36px; height: 22px; }
.interruptor.mini .bola { width: 16px; height: 16px; }
.interruptor.mini.abierta .bola { transform: translateX(14px); }
.estado-tienda { font-weight: 800; padding: .35rem .8rem; border-radius: 999px; }
.estado-tienda.abierta { background: var(--verde-claro); color: var(--verde-fuerte); }
.estado-tienda.cerrada { background: var(--rojo-claro); color: var(--rojo); }
.estado-tienda.pendiente { background: var(--ambar-claro); color: var(--ambar); }
#banda-conexion, #banda-version, #banda-nuevos { margin: .8rem 1.6rem 0; }
#banda-conexion { background: var(--ambar-claro); color: #5C3D00; }
#banda-version { display: flex; align-items: center; gap: .8rem; background: var(--azul-claro); color: var(--azul); }
#banda-version span { flex: 1; }
#banda-nuevos { display: flex; align-items: center; gap: .8rem; background: var(--terracota); color: #fff; font-size: 1.05rem; animation: latido-fondo 1.4s ease-in-out infinite; }
#banda-nuevos span { flex: 1; }
#banda-nuevos .btn-primario { background: #fff; color: var(--terracota); }
main { padding: 1.2rem 1.6rem 2.4rem; min-width: 0; }
main:focus { outline: none; }
@keyframes latido { 50% { opacity: .55; } }
@keyframes latido-fondo { 50% { background: #8D432C; } }

/* ---------- Tarjetas de panel, tablas ---------- */
.tarjeta-panel { background: var(--papel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.2rem 1.3rem; box-shadow: var(--sombra); margin-bottom: 1.1rem; }
.tarjeta-panel > h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.titulo-seccion { display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; margin-bottom: .6rem; }
.titulo-chico { font-size: 1rem; color: var(--suave); margin-bottom: .6rem; }
.barra-herr { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.barra-herr select { width: auto; min-width: 170px; }
.espacio { flex: 1; }
.tabla-caja { overflow: auto; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--papel); }
.tabla-caja.bajo { max-height: 360px; }
.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); background: #FBF9F5; padding: .65rem .8rem; border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 1; }
.tabla td { padding: .6rem .8rem; border-bottom: 1px solid #EFEAE2; vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; }
.tabla tbody tr:hover { background: #FCFAF7; }
.acciones-fila { white-space: nowrap; text-align: right; }
.acciones-fila .btn + .btn { margin-left: .35rem; }
tr.agotado td:not(:last-child):not(:nth-last-child(2)) { opacity: .55; }
tr.apagado { opacity: .6; }
.vacio { text-align: center; padding: 2.4rem 1rem; display: grid; gap: .5rem; justify-items: center; }
.negativo { color: var(--rojo); font-weight: 700; }
.positivo { color: #1E5A35; font-weight: 700; }
.dos-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.det-datos { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: .4rem 0; }
.det-datos dt { color: var(--suave); font-weight: 700; }
.det-datos dd { margin: 0; }

/* ---------- Pedidos ---------- */
.pedidos-cab { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.resumen-hoy { display: flex; gap: .6rem; flex-wrap: wrap; }
.dato-hoy { background: var(--papel); border: 1px solid var(--borde); border-radius: 12px; padding: .4rem .9rem; display: flex; flex-direction: column; }
.dato-hoy span { font-size: .78rem; color: var(--suave); font-weight: 700; }
.dato-hoy b { font-size: 1.2rem; }
.pedidos-acciones { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.estado-carga:empty { display: none; }
.estado-carga { margin-bottom: .6rem; }
.tablero { display: grid; grid-template-columns: repeat(3, minmax(270px, 1fr)) minmax(210px, .72fr); gap: .9rem; align-items: stretch; height: calc(100vh - 175px); min-height: 460px; }
.col { background: #F2EDE5; border-radius: 16px; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--borde); }
.col h2 { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem .6rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.col .cuenta { background: var(--papel); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: .9rem; padding: 0 .45rem; }
.col-nuevos .cuenta { background: var(--terracota); color: #fff; }
.col-lista { overflow-y: auto; padding: 0 .65rem .8rem; display: flex; flex-direction: column; gap: .65rem; flex: 1; }
.col-lista > * { flex-shrink: 0; }
.col-vacia { color: var(--suave); text-align: center; padding: 1.6rem .6rem; font-size: .95rem; }
.tarjeta { background: var(--papel); border-radius: 14px; border: 1.5px solid var(--borde); box-shadow: var(--sombra); overflow: hidden; }
.tarjeta.est-created { border-color: var(--terracota); }
.tarjeta.sonando { animation: borde-late 1.1s ease-in-out infinite; }
@keyframes borde-late { 50% { box-shadow: 0 0 0 4px rgba(166, 80, 53, .28), var(--sombra); } }
.tarjeta-abrir { display: flex; flex-direction: column; gap: .4rem; width: 100%; text-align: left; border: 0; background: transparent; padding: .8rem .9rem .6rem; cursor: pointer; }
.tarjeta-abrir:hover { background: #FCFAF7; }
.t-cab { display: flex; align-items: center; gap: .3rem .5rem; flex-wrap: wrap; }
.t-codigo { font-size: 1.35rem; font-weight: 900; letter-spacing: .02em; }
.reloj { margin-left: auto; font-size: .85rem; font-weight: 800; color: var(--suave); white-space: nowrap; }
.reloj.atento { color: var(--ambar); }
.reloj.urgente { color: var(--rojo); }
.t-cliente { font-weight: 700; }
.t-etqs { display: block; }
.lineas { list-style: none; margin: .1rem 0; padding: 0; display: grid; gap: .25rem; }
.lineas li { display: flex; gap: .45rem; font-size: 1rem; }
.lineas .cant { font-weight: 900; min-width: 2.1em; color: var(--terracota); }
.lineas .nom { display: flex; flex-direction: column; font-weight: 700; }
.lineas .op { font-weight: 500; color: var(--suave); font-size: .86rem; }
.lineas .nota { color: var(--ambar); font-style: italic; }
.lineas .quitada .nom { text-decoration: line-through; color: var(--suave); }
.lineas em { display: inline-block; text-decoration: none; font-style: normal; font-weight: 700; color: var(--rojo); font-size: .8rem; }
.t-nota { background: var(--ambar-claro); color: #5C3D00; border-radius: 8px; padding: .35rem .55rem; font-size: .9rem; }
.t-si-falta { font-size: .85rem; color: var(--suave); }
.t-total { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px dashed var(--borde); padding-top: .45rem; font-weight: 700; color: var(--suave); }
.monto { display: inline-flex; flex-direction: column; align-items: flex-end; }
.monto .usd { font-size: 1.15rem; font-weight: 900; color: var(--tinta); }
.monto .bs { font-size: .78rem; color: var(--suave); font-weight: 600; }
.t-rep { font-size: .85rem; }
.t-acciones { display: flex; flex-wrap: wrap; gap: .45rem; padding: .3rem .9rem .9rem; align-items: center; }
.t-acciones .btn-grande { flex: 1; }
.aceptar-grupo { display: flex; flex: 1 1 100%; gap: .4rem; }
.aceptar-grupo .btn { flex: 1; }
.aceptar-grupo select { width: 108px; min-height: 50px; font-weight: 700; }
.tarjeta.corta .tarjeta-abrir { padding: .6rem .8rem; }
.tarjeta.corta .t-codigo { font-size: 1.05rem; }
.tarjeta.corta .t-cliente { font-size: .9rem; font-weight: 600; color: var(--suave); }

/* Detalle (panel lateral) */
.modal.lateral { position: fixed; right: 0; top: 0; bottom: 0; height: 100vh; max-height: none; width: min(560px, 100vw); border-radius: 18px 0 0 18px; animation: desde-der .2s ease-out; }
@keyframes desde-der { from { transform: translateX(30px); opacity: 0; } }
.det-estado { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: .6rem; }
.det-acciones { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--borde); }
.det-acciones .aceptar-grupo { flex-basis: 100%; }
.det-tel { margin-top: .35rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.det-extra { padding-left: 1.1rem; margin: .6rem 0; }
.det-dinero { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; }
.det-dinero dt { color: var(--suave); }
.det-dinero dd { margin: 0; text-align: right; }

/* Calificar */
.estrellas { display: flex; gap: .3rem; justify-content: center; margin: .4rem 0 .8rem; }
.estrella { font-size: 2.4rem; line-height: 1; border: 0; background: none; color: #D8D1C5; cursor: pointer; padding: .1rem; border-radius: 8px; }
.estrella.on { color: #E0A21B; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: .8rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--borde-fuerte); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; font-weight: 700; }
.chip:has(input:checked) { background: var(--verde-claro); border-color: var(--verde); }

/* ---------- Cocina ---------- */
body.modo-cocina { background: #121816; color: #EEF3F1; }
body.modo-cocina #lateral, body.modo-cocina #barra, body.modo-cocina #banda-nuevos { display: none; }
body.modo-cocina #app { grid-template-columns: 1fr; background: #121816; }
body.modo-cocina main { padding: 1rem 1.2rem; }
.cocina-barra { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cocina-titulo { font-size: 1.8rem; }
#cocina-hora { font-size: 1.5rem; color: #A6DCCB; margin-left: .6rem; font-weight: 800; }
.cocina-botones { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.btn-cocina { background: #1F2A27; color: #EEF3F1; border-color: #3A4744; }
.btn-cocina:hover { background: #2A3734; }
.cocina-nuevos { background: var(--terracota); color: #fff; padding: .55rem 1rem; border-radius: 999px; font-weight: 800; animation: latido 1.2s infinite; }
.cocina-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.cocina-tarjeta { background: #1A2220; border: 2px solid #3A4744; border-radius: 18px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; font-size: 1.25rem; }
.cocina-tarjeta.atento { border-color: #D49A1E; }
.cocina-tarjeta.urgente { border-color: #E2553F; }
.cocina-tarjeta header { display: flex; align-items: center; gap: .6rem; }
.cocina-codigo { font-size: 2.3rem; font-weight: 900; }
.cocina-tarjeta .reloj { font-size: 1.1rem; color: #BFC9C5; }
.cocina-tarjeta .reloj.atento { color: #F2C14E; }
.cocina-tarjeta .reloj.urgente { color: #FF8A73; }
.cocina-tipo { font-size: 1rem; color: #A6DCCB; font-weight: 800; letter-spacing: .03em; }
.cocina-lineas { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.cocina-lineas li { display: flex; flex-direction: column; font-weight: 700; }
.cl-fila b { display: inline-block; min-width: 2.2rem; color: #F2C14E; }
.cocina-lineas small { font-size: 1rem; color: #BFC9C5; font-weight: 600; padding-left: 2.2rem; }
.cocina-lineas small.nota { color: #F2C14E; }
.cocina-lineas .quitada { text-decoration: line-through; opacity: .5; }
.cocina-nota { background: #3B3115; color: #F7E2A8; border-radius: 10px; padding: .5rem .7rem; font-size: 1.05rem; }
.cocina-extra { color: #A6DCCB; font-size: 1rem; font-weight: 700; }
.cocina-tarjeta footer { display: flex; gap: .6rem; margin-top: auto; }
.btn-cocina-listo, .btn-cocina-sec { flex: 1; min-height: 64px; font-size: 1.35rem; border-radius: 14px; }
.btn-cocina-listo { background: #2F9A5B; color: #fff; }
.btn-cocina-listo:hover { background: #267E4A; }
.btn-cocina-sec { background: #2A3734; color: #EEF3F1; }
.cocina-vacia { grid-column: 1 / -1; text-align: center; font-size: 1.6rem; font-weight: 800; padding: 4rem 1rem; color: #BFC9C5; }
.cocina-vacia span { font-size: 1.1rem; font-weight: 600; }

/* ---------- Menú ---------- */
.tabla-menu .c-foto { width: 64px; }
.tabla-menu img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--hueso); display: block; }
.sin-foto { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--hueso); color: var(--suave); }
.recorte { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input-precio { width: 104px !important; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; min-height: 38px !important; }
.input-precio.guardando { border-color: var(--ambar) !important; }
.input-precio.guardado { border-color: #2F9A5B !important; box-shadow: 0 0 0 3px rgba(47, 154, 91, .2); }
.editor-prod { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; }
.editor-col { display: flex; flex-direction: column; gap: .9rem; }
.editor-opciones { grid-column: 1 / -1; border-top: 1px solid var(--borde); padding-top: .6rem; }
.editor-opciones h3 { margin: .4rem 0; }
.editor-prod .error-form { grid-column: 1 / -1; }
.zona-foto { position: relative; border: 2px dashed var(--borde-fuerte); border-radius: var(--radio); min-height: 210px; display: grid; place-items: center; text-align: center; cursor: pointer; background: #FCFAF7; overflow: hidden; padding: .8rem; }
.zona-foto:hover, .zona-foto.encima { border-color: var(--verde); background: var(--verde-claro); }
.zona-foto.inactiva { cursor: default; }
.zona-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.zona-foto img + .zona-txt { position: relative; background: rgba(255, 255, 255, .92); border-radius: 8px; padding: .3rem .6rem; align-self: end; font-size: .85rem; }
.zona-txt { color: var(--suave); font-weight: 600; }
.zona-foto.chica { min-height: 120px; width: 140px; }
.zona-foto.portada { min-height: 120px; }
.zona-archivo { min-height: 128px; flex: 1 1 260px; }
.grupo { border: 1.5px solid var(--borde); border-radius: var(--radio); padding: .8rem; margin: 0 0 .8rem; background: #FCFAF7; }
.grupo-cab { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.grupo-cab .campo:first-child { flex: 1 1 220px; }
.grupo-botones { display: flex; gap: .1rem; margin-left: auto; }
.opciones { display: grid; gap: .4rem; margin: .5rem 0; }
.opcion { display: flex; align-items: center; gap: .5rem; }
.opcion > input:first-of-type { flex: 1; }
.prefijo { color: var(--suave); font-weight: 700; }
.import-resumen { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.import-resumen div { background: var(--hueso); border-radius: 12px; padding: .6rem; text-align: center; display: flex; flex-direction: column; }
.import-resumen b { font-size: 1.5rem; }
.import-resumen .mal { background: var(--rojo-claro); color: var(--rojo); }
.fila-error { background: #FDF3F1; }
.error-celda { color: var(--rojo); font-size: .82rem; font-weight: 700; }
.import-paso { margin-bottom: .6rem; }
.import-paso p { margin-bottom: .8rem; }

/* ---------- Tienda ---------- */
.rejilla-tienda { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; }
.col-der { position: sticky; top: 90px; }
.estado-grande { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: 12px; }
.estado-grande.abierta { background: var(--verde-claro); }
.estado-grande.cerrada { background: var(--rojo-claro); }
.estado-grande b { font-size: 1.2rem; }
.horario { display: grid; gap: .4rem; margin: .6rem 0; }
.dia { display: grid; grid-template-columns: 150px 150px auto 150px 1fr; align-items: center; gap: .5rem; }
.dia input[type=time] { min-height: 38px; }
.fotos-tienda { align-items: stretch; }
.tel-marco { background: #121816; border-radius: 34px; padding: 12px; box-shadow: var(--sombra-alta); }
.tel-pantalla { background: #fff; border-radius: 24px; overflow: hidden; min-height: 520px; }
.vc-portada { height: 140px; background: linear-gradient(135deg, #2E6B5E, #1F4F45); }
.vc-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-cuerpo { padding: 0 1rem 1rem; }
.vc-logo { width: 72px; height: 72px; border-radius: 18px; border: 4px solid #fff; margin-top: -36px; background: var(--hueso); overflow: hidden; display: grid; place-items: center; font-weight: 900; font-size: 1.8rem; color: var(--terracota); box-shadow: var(--sombra); position: relative; }
.vc-logo img { width: 100%; height: 100%; object-fit: cover; }
.vc-cuerpo h3 { font-size: 1.3rem; margin: .5rem 0 .2rem; }
.vc-meta { color: var(--suave); font-size: .9rem; }
.vc-estado { display: inline-block; margin: .4rem 0; font-weight: 800; font-size: .82rem; padding: .1rem .55rem; border-radius: 999px; }
.vc-estado.si { background: var(--verde-claro); color: var(--verde-fuerte); }
.vc-estado.no { background: var(--rojo-claro); color: var(--rojo); }
.vc-desc { font-size: .92rem; color: var(--suave); margin-bottom: .6rem; }
.vc-prod { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem 0; border-top: 1px solid var(--borde); }
.vc-prod div { display: flex; flex-direction: column; }
.vc-prod span { color: var(--verde-fuerte); font-weight: 800; }
.vc-prod s { color: var(--suave); font-weight: 500; }
.vc-prod img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }

/* ---------- Reportes y dinero ---------- */
.presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.rango { display: flex; align-items: center; gap: .45rem; }
.rango input { width: auto !important; }
.rango label { font-weight: 700; font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.kpi { background: var(--papel); border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--sombra); }
.kpi span { font-size: .82rem; font-weight: 800; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.kpi b { font-size: 1.6rem; font-weight: 900; }
.kpi.grande b { font-size: 2rem; }
.kpi small { color: var(--suave); font-weight: 600; }
.kpi.alerta b { color: var(--rojo); }
.svg-grafico { width: 100%; height: auto; display: block; overflow: visible; }
.g-reja { stroke: #ECE6DC; stroke-width: 1; }
.g-eje { fill: #6B7672; font-size: 12px; font-family: var(--letra); font-weight: 600; }
.g-barra rect { transition: opacity var(--t-ui); }
.g-barra:hover rect { opacity: .8; }
.datos-tabla { margin-top: .6rem; }
.datos-tabla summary { cursor: pointer; font-weight: 700; color: var(--verde-fuerte); }
.barras-h { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.barras-h li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr minmax(150px, auto); gap: .8rem; align-items: center; }
.barras-h.numerada { counter-reset: n; }
.barras-h.numerada .bh-nombre::before { counter-increment: n; content: counter(n) ". "; color: var(--suave); font-weight: 800; }
.bh-nombre { font-weight: 700; overflow-wrap: anywhere; }
.bh-pista { background: var(--hueso); border-radius: 999px; height: 14px; overflow: hidden; }
.bh-barra { display: block; height: 100%; background: var(--verde); border-radius: 999px; }
.bh-valor { font-size: .88rem; color: var(--suave); font-weight: 700; text-align: right; }

/* ---------- Equipo / registro ---------- */
.perfiles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; }
.perfiles legend, .permisos legend { font-weight: 800; margin-bottom: .5rem; }
.perfil { display: flex; gap: .5rem; align-items: flex-start; border: 1.5px solid var(--borde); border-radius: 12px; padding: .6rem; cursor: pointer; }
.perfil:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.perfil span, .permiso span { display: flex; flex-direction: column; }
.perfil small, .permiso small { color: var(--suave); font-weight: 500; font-size: .82rem; }
.permisos { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .9rem; }
.permisos p { grid-column: 1 / -1; }
.permiso { align-items: flex-start; }
.lista-pcs { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lista-pcs li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--borde); border-radius: 12px; }
.registro { list-style: none; margin: .8rem 0 0; padding: 0; }
.registro li { display: grid; grid-template-columns: 170px 190px 1fr 60px; gap: .8rem; padding: .6rem .2rem; border-bottom: 1px solid #EFEAE2; align-items: baseline; }
.registro time { color: var(--suave); font-size: .88rem; font-variant-numeric: tabular-nums; }

/* ---------- Ajustes ---------- */
.segmentado { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.segmentado legend { font-weight: 800; margin-bottom: .45rem; }
.segmentado label { cursor: pointer; }
.segmentado input { position: absolute; opacity: 0; }
.segmentado span { display: flex; flex-direction: column; align-items: center; border: 1.5px solid var(--borde-fuerte); border-radius: 10px; padding: .5rem .9rem; font-weight: 700; min-width: 96px; text-align: center; background: var(--papel); }
.segmentado small { font-weight: 600; color: var(--suave); font-size: .78rem; }
.segmentado input:checked + span { border-color: var(--verde); background: var(--verde-claro); color: var(--verde-fuerte); }
.segmentado input:focus-visible + span { outline: 3px solid var(--terracota); outline-offset: 2px; }
.muestra-ticket { margin-top: .8rem; background: #E9E4DB; border-radius: 12px; padding: .8rem; text-align: center; }
.marco-muestra { border: 0; background: #fff; box-shadow: var(--sombra); max-width: 100%; min-height: 200px; }
.atajos { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
kbd { font-family: inherit; background: var(--hueso); border: 1px solid var(--borde-fuerte); border-bottom-width: 2px; border-radius: 6px; padding: 0 .4em; font-size: .85em; font-weight: 700; }

/* ---------- Ventanas ---------- */
.modal-fondo { position: fixed; inset: 0; background: rgba(18, 24, 22, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: aparece .15s ease-out; }
@keyframes aparece { from { opacity: 0; } }
.modal { background: var(--papel); border-radius: 18px; box-shadow: var(--sombra-alta); width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.ancho { width: min(860px, 100%); }
.modal.muy-ancho { width: min(1100px, 100%); }
.modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem .6rem; }
.modal-cab h2 { font-size: 1.25rem; }
.modal-cuerpo { padding: .3rem 1.2rem 1rem; overflow-y: auto; }
.texto-modal p + p { margin-top: .5rem; }
.modal-cuerpo .campo { margin-top: .8rem; }
.modal-pie { display: flex; justify-content: flex-end; gap: .6rem; padding: .8rem 1.2rem 1rem; border-top: 1px solid var(--borde); flex-wrap: wrap; }

/* ---------- Tableta ---------- */
@media (max-width: 1180px) {
  .tablero { grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; }
  .col { max-height: 70vh; }
  .rejilla-tienda { grid-template-columns: 1fr; }
  .col-der { position: static; max-width: 380px; }
}
@media (max-width: 900px) {
  :root { --ancho-menu: 78px; }
  #lateral { padding: .8rem .45rem; }
  .marca .nombre, .tienda-chip .t-txt, #nav a span, .pie-menu .btn span { display: none; }
  .tienda-chip { justify-content: center; }
  #nav a { justify-content: center; padding: .7rem; }
  #nav .contador { position: absolute; top: 2px; right: 2px; margin: 0; }
  .entrar-cuerpo { grid-template-columns: 1fr; }
  .entrar-qr { border-right: 0; border-bottom: 1px solid var(--borde); }
  .dos-col, .editor-prod { grid-template-columns: 1fr; }
  .dia { grid-template-columns: 130px 1fr auto 1fr; }
  .dia [data-cerrado] { grid-column: 1 / -1; }
  .registro li { grid-template-columns: 1fr; gap: .2rem; }
  .permisos { grid-template-columns: 1fr; }
  #barra, main { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 640px) {
  .tablero { grid-template-columns: 1fr; }
  .barras-h li { grid-template-columns: 1fr; gap: .2rem; }
  #titulo-vista { font-size: 1.15rem; }
  .estado-vivo { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Imprimir (reportes en PDF) ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  #lateral, #barra, #banda-conexion, #banda-version, #banda-nuevos, #avisos, .no-imprimir, .modal-fondo { display: none !important; }
  #app { display: block; }
  main { padding: 0; }
  .solo-imprimir { display: block; margin-bottom: 4mm; font-size: 13pt; }
  .tarjeta-panel, .kpi { box-shadow: none; break-inside: avoid; }
  .dos-col { grid-template-columns: 1fr 1fr; }
  .bh-barra, .g-barra rect, .insignia { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
