/* ClientRewards: la boleta de talonario. Papel, tinta plana, casilleros numerados y troquel. */

@font-face {
  font-family: 'Archivo';
  src: url('/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Chivo Mono';
  src: url('/chivo-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --papel: #f4f4ef;
  --blanco: #ffffff;
  --tinta: #15151a;
  --tinta-2: #45454d;
  --linea: #d8d8cf;
  --borde-campo: #84848d;
  --canario: #ffd52e;
  --canario-claro: #fff4c2;
  --sello: #2335c8;
  --sello-hondo: #18248f;
  --rojo: #b42318;
  --rojo-claro: #fdecea;
  --verde: #12693a;
  --verde-claro: #e3f3e8;
  --suelo: var(--papel);
  --c: var(--sello);
  --radio: 14px;
  --texto: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --numeros: 'Chivo Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Las seis tintas de la tarjeta. Todas dan AA con blanco encima y sobre blanco. */
.color-azul { --c: #1d3fbf; }
.color-verde { --c: #0e6b3a; }
.color-rojo { --c: #b42318; }
.color-naranja { --c: #b54708; }
.color-violeta { --c: #5b2a9e; }
.color-negro { --c: #1b1b1f; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--texto);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--canario); color: var(--tinta); }

:focus-visible { outline: 3px solid var(--anillo, var(--sello)); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--texto);
  font-stretch: 75%;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 0.6rem;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; margin-top: 0; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; text-wrap: pretty; }

a { color: var(--sello); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--sello-hondo); }

b, strong { font-weight: 700; }

.oculto {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- La marca ---------- */

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-stretch: 72%;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.005em;
  color: var(--tinta);
  text-decoration: none;
}
.marca:hover { color: var(--tinta); }
.marca-sello {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--sello);
  box-shadow: inset 0 0 0 3px var(--sello), inset 0 0 0 4.5px var(--blanco);
  transform: rotate(-10deg);
  flex: none;
}

/* ---------- Botones ---------- */

button, .boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--sello);
  color: var(--blanco);
  font: inherit;
  font-weight: 700;
  font-stretch: 90%;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease-out, transform 120ms ease-out;
}
button:hover, .boton:hover { background: var(--sello-hondo); color: var(--blanco); }
button:active, .boton:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.boton.grande { min-height: 3.5rem; font-size: 1.125rem; padding: 0.85rem 1.5rem; }
.boton.ancho, .ancho { width: 100%; }
.boton.chico { min-height: 2.5rem; padding: 0.45rem 0.8rem; font-size: 0.9rem; }
.boton.secundario { background: transparent; color: var(--tinta); border-color: var(--tinta); }
.boton.secundario:hover { background: var(--tinta); color: var(--blanco); }
.boton.peligro, button.peligro { background: var(--rojo); color: var(--blanco); }
.boton.peligro:hover { background: #8e1b12; }
.boton.secundario.peligro { background: transparent; color: var(--rojo); border-color: var(--rojo); }
.boton.secundario.peligro:hover { background: var(--rojo); color: var(--blanco); }
.boton-texto, button.boton-texto {
  min-height: 2.75rem;
  padding: 0.5rem 0.25rem;
  background: none;
  border: 0;
  color: var(--sello);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.boton-texto:hover, button.boton-texto:hover { background: none; color: var(--sello-hondo); }
.boton-texto.peligro, button.boton-texto.peligro { background: none; color: var(--rojo); }
a.peligro { color: var(--rojo); font-weight: 700; }

.fila-botones { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.fila-botones form { margin: 0; }

/* ---------- Formularios ---------- */

.formulario { display: grid; gap: 1rem; }
.formulario > button, .formulario > .boton { justify-self: start; }
.formulario > .ancho { justify-self: stretch; }
label { display: block; font-weight: 600; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 0.4rem; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--borde-campo);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--tinta);
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
}
input:focus-visible, select:focus-visible { border-color: var(--anillo, var(--sello)); }
input::placeholder { color: #6b6b74; }
input[type="file"] { min-height: 0; padding: 0.6rem; }
input[readonly] { background: var(--papel); font-family: var(--numeros); font-size: 0.9rem; }
.casilla { display: flex; align-items: center; gap: 0.6rem; }
.casilla input { width: 1.35rem; height: 1.35rem; min-height: 0; margin: 0; flex: none; accent-color: var(--sello); }
.campo-pin input { font-family: var(--numeros); font-size: 1.5rem; letter-spacing: 0.5em; text-align: center; padding-left: 1.2rem; }

.colores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.colores legend { grid-column: 1 / -1; }
.muestra-color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--linea);
  border-radius: 10px;
  background: var(--blanco);
  font-weight: 600;
  cursor: pointer;
}
.muestra-color::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--c);
  flex: none;
  order: -1;
}
.muestra-color input { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; accent-color: var(--c); order: 2; margin-left: auto; }
.muestra-color:has(input:checked) { border-color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }

/* ---------- Avisos ---------- */

.aviso {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #e9c547;
  background: var(--canario-claro);
  color: var(--tinta);
  font-weight: 600;
}
.aviso.mal { background: var(--rojo-claro); border-color: #efb0aa; color: #8a1c13; }
.aviso.bien { background: var(--verde-claro); border-color: #a9d8b8; color: #0f532e; }
.aviso.cartel-plan { background: var(--canario); border-color: var(--canario); color: var(--tinta); }
.aviso.cartel-plan a { color: var(--tinta); font-weight: 800; }
.nota { color: var(--tinta-2); }
.vacio { color: var(--tinta-2); padding: 1rem 0; }

/* ---------- La boleta: la tarjeta del cliente ---------- */

.tarjeta, .tarjeta-alta {
  position: relative;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  border-radius: var(--radio);
  background: var(--blanco);
  color: var(--tinta);
  box-shadow: 0 1px 2px rgba(15, 15, 25, 0.12), 0 22px 44px -24px rgba(15, 15, 25, 0.55);
  overflow: hidden;
  --anillo: var(--c);
}
.cabeza {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--c);
  color: var(--blanco);
}
.cabeza h1, .cabeza h2 { flex: 1; min-width: 0; margin: 0; font-size: 1.4rem; color: var(--blanco); overflow-wrap: anywhere; }
.cabeza .logo {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
  padding: 4px;
  border-radius: 10px;
  background: var(--blanco);
}
.numeradora {
  flex: none;
  margin: 0;
  font-family: var(--numeros);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
.numeradora b { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.04em; }
.numeradora span { font-size: 1rem; font-weight: 500; }
.cuerpo { padding: 1.1rem 1.25rem 1.25rem; }
.hola { margin: 0 0 0.9rem; font-weight: 700; color: var(--c); font-size: 1.05rem; }
.cuenta { margin: 1rem 0 0; font-weight: 600; }

.sellos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  counter-reset: sello;
}
.sellos:not(:has(> :nth-child(9))) { grid-template-columns: repeat(4, 1fr); }
.sellos:not(:has(> :nth-child(4))) { grid-template-columns: repeat(3, 1fr); }
.sello {
  --giro: 0deg;
  position: relative;
  aspect-ratio: 1;
  max-width: 4.25rem;
  width: 100%;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--numeros);
  font-size: 0.95rem;
  font-weight: 600;
  counter-increment: sello;
}
.sello::before { content: counter(sello, decimal-leading-zero); }
.sello.vacio { border: 2px dashed var(--c); color: var(--c); }
.sello.vacio:last-child { background: color-mix(in srgb, var(--c) 9%, var(--blanco)); border-style: solid; }
.sello.vacio:last-child::before {
  content: "premio";
  font-family: var(--texto);
  font-stretch: 70%;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sello.lleno {
  background: var(--c);
  color: var(--blanco);
  box-shadow: inset 0 0 0 3px var(--c), inset 0 0 0 5px rgba(255, 255, 255, 0.9);
  transform: rotate(var(--giro));
  font-weight: 700;
}
.sello.lleno:nth-child(3n + 1) { --giro: -9deg; }
.sello.lleno:nth-child(3n + 2) { --giro: 7deg; }
.sello.lleno:nth-child(3n) { --giro: -3deg; }
.sello[data-recien] { animation: golpe 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.sello[data-recien]::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 3px solid var(--c);
  animation: onda 520ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}
@keyframes golpe {
  0% { transform: scale(1.9) rotate(-28deg); opacity: 0; }
  55% { opacity: 1; }
  78% { transform: scale(0.94) rotate(var(--giro)); }
  100% { transform: scale(1) rotate(var(--giro)); opacity: 1; }
}
@keyframes onda {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(1.55); opacity: 0; }
}

/* El talón, separado por el troquel. Las muescas toman el color del suelo. */
.talon {
  position: relative;
  margin: 0;
  padding: 1rem 1.25rem 1.15rem;
  border-top: 2px dashed color-mix(in srgb, var(--c) 45%, var(--blanco));
  font-size: 0.95rem;
}
.talon::before, .talon::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--suelo);
}
.talon::before { left: -11px; }
.talon::after { right: -11px; }
.talon b { display: block; margin-top: 0.1rem; font-stretch: 75%; font-weight: 800; font-size: 1.3rem; line-height: 1.1; color: var(--c); }
[data-llena] .talon { background: var(--c); color: var(--blanco); border-top-color: var(--c); }
[data-llena] .talon b { color: var(--blanco); }

/* ---------- La página del cliente ---------- */

body.cliente { background: var(--c); --suelo: var(--c); --anillo: var(--blanco); color: var(--blanco); }
body.cliente main { max-width: 27rem; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }
body.cliente .tarjeta, body.cliente .tarjeta-alta { color: var(--tinta); }
.pedido { font-weight: 600; }
.consentimiento { margin: 1rem 0 0; font-size: 0.85rem; color: var(--tinta-2); }
.tarjeta-alta .formulario .boton, .canje .boton { background: var(--c); color: var(--blanco); justify-self: stretch; }
.tarjeta-alta .formulario .boton:hover, .canje .boton:hover { background: var(--tinta); }
.estado p { margin: 1rem 0 0; font-weight: 700; font-size: 1.1rem; text-align: center; }
body.cliente .estado p { color: var(--blanco); }
body.cliente > main > .aviso { margin-top: 1rem; }
.sumar { margin-top: 1rem; }
.sumar .boton { width: 100%; background: var(--blanco); color: var(--c); }
.sumar .boton:hover { background: var(--canario-claro); color: var(--c); }
.sumar label, .canje label { color: inherit; }
.sumar .campo-pin { color: var(--blanco); margin-bottom: 0.75rem; }
.canje {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radio);
  background: var(--blanco);
  color: var(--tinta);
  display: grid;
  gap: 1rem;
  --anillo: var(--c);
}
.canje-titulo { margin: 0; font-stretch: 72%; font-weight: 800; font-size: 2rem; line-height: 1; color: var(--c); }
.salir { margin-top: 1.25rem; text-align: center; }
body.cliente .salir .boton-texto { color: var(--blanco); }
.pie-cliente { margin: 1.5rem 0 0; text-align: center; font-size: 0.8rem; color: var(--blanco); }

/* ---------- Páginas sueltas: entrar, registro, errores ---------- */

body.suelta { background: var(--canario); --suelo: var(--canario); }
.barra-suelta { max-width: 30rem; margin: 0 auto; padding: 1.25rem 1rem 0.5rem; }
body.suelta main { max-width: 30rem; margin: 0 auto; padding: 0.75rem 1rem 3rem; }
.boleta {
  padding: 1.5rem 1.25rem;
  border-radius: 16px;
  background: var(--blanco);
  box-shadow: 0 1px 2px rgba(15, 15, 25, 0.1), 0 22px 44px -26px rgba(15, 15, 25, 0.5);
}
.boleta h1 { font-size: 2rem; }
.bajada-boleta { color: var(--tinta-2); }
.al-pie { margin: 1.5rem -1.25rem 0; padding: 1rem 1.25rem 0; border-top: 2px dashed var(--linea); }
.numerito { margin: 0; font-family: var(--numeros); font-size: 3rem; font-weight: 700; color: var(--sello); }
body.suelta.admin { background: var(--tinta); --suelo: var(--tinta); }
body.suelta.admin .marca { color: var(--blanco); }

/* ---------- Panel del comercio y panel general ---------- */

.franja-admin {
  padding: 0.6rem 1rem;
  background: var(--tinta);
  color: var(--blanco);
  text-align: center;
  font-weight: 600;
}
.franja-admin a { color: var(--canario); margin-left: 0.75rem; font-weight: 800; }

.barra { background: var(--blanco); border-bottom: 1px solid var(--linea); }
.barra-fila {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.6rem 1rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.barra-fila form { margin: 0 0 0 auto; }
.etiqueta-admin { font-weight: 700; color: var(--tinta-2); }
.menu { max-width: 72rem; margin: 0 auto; padding: 0 0.5rem; }
.menu ul {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.5rem 0.6rem;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: var(--tinta);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.menu a:hover { background: var(--papel); }
.menu a.actual { background: var(--canario); font-weight: 800; }

body.panel main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; --suelo: var(--papel); }
body.panel main > h1 { font-size: 2.25rem; margin-bottom: 1rem; }
body.panel main > .aviso { margin-bottom: 1.25rem; }
body.panel h2 { font-size: 1.35rem; }
.volver { margin-bottom: 0.5rem; font-weight: 600; }
.direccion-tarjeta { color: var(--tinta-2); }
.direccion-tarjeta b, .url { font-family: var(--numeros); font-weight: 600; color: var(--tinta); overflow-wrap: anywhere; }

.hoja {
  padding: 1.25rem;
  border-radius: var(--radio);
  border: 1px solid var(--linea);
  background: var(--blanco);
}
.hoja + .hoja { margin-top: 1rem; }
.hoja > :last-child { margin-bottom: 0; }

.dos-columnas { display: grid; gap: 1.5rem; }
.vista-previa h2 { font-size: 1.1rem; color: var(--tinta-2); }
.ajustes { min-width: 0; }

.inicio-grilla { display: grid; gap: 2rem; margin-top: 1.5rem; }
.numeros {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.numeros li {
  padding: 0.9rem 0.85rem 1rem;
  border-radius: var(--radio);
  border: 1px solid var(--linea);
  background: var(--blanco);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
}
.numeros li b, .numeros li strong {
  display: block;
  margin-bottom: 0.3rem;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--sello);
}

.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; counter-reset: paso; }
.paso {
  position: relative;
  padding: 1rem 1rem 1rem 4.25rem;
  border-radius: var(--radio);
  border: 1px solid var(--linea);
  background: var(--blanco);
  color: var(--tinta-2);
  counter-increment: paso;
}
.paso::before {
  content: counter(paso);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px dashed var(--sello);
  color: var(--sello);
  font-family: var(--numeros);
  font-weight: 700;
}
.paso a { font-weight: 800; font-size: 1.1rem; color: var(--tinta); }
.paso.hecho::before {
  border: 0;
  background: var(--sello);
  color: var(--blanco);
  box-shadow: inset 0 0 0 2.5px var(--sello), inset 0 0 0 4px var(--blanco);
  transform: rotate(-8deg);
}
.paso.hecho a { text-decoration-line: line-through; text-decoration-thickness: 2px; color: var(--tinta-2); }
.listo { color: var(--verde); font-weight: 700; }

.actividad { list-style: none; margin: 0; padding: 0; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); }
.actividad li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; padding: 0.8rem 1rem; border-top: 1px solid var(--linea); }
.actividad li:first-child { border-top: 0; }
.actividad .que { color: var(--tinta-2); }
.actividad .es-canje .que { color: var(--verde); font-weight: 700; }
.cuando { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 0.88rem; color: var(--tinta-2); }

.logo-actual .logo { max-width: 8rem; max-height: 6rem; border-radius: 10px; border: 1px solid var(--linea); padding: 0.4rem; background: var(--blanco); }
.subir input { margin-top: 0.5rem; }
.estado:empty { display: none; }

.titulo-con-accion { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 1rem; }
.titulo-con-accion h1 { margin: 0; font-size: 2.25rem; }
.buscador {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: var(--radio);
  background: var(--blanco);
  border: 1px solid var(--linea);
}

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-stretch: 75%; font-weight: 800; font-size: 1.35rem; line-height: 1.1; padding-bottom: 0.6rem; }
th {
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tinta-2);
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--tinta);
  white-space: nowrap;
}
td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--linea); vertical-align: middle; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-acciones { white-space: nowrap; }
.col-acciones form { display: inline; margin: 0 0 0 0.4rem; }
.tabla-ancha { overflow-x: auto; }
.tabla-ancha, .avisos-admin { margin-top: 1.25rem; }

.tabla-clientes { background: var(--blanco); border-radius: var(--radio); }

.dato b { font-variant-numeric: tabular-nums; }
.visitas { list-style: none; margin: 0; padding: 0; }
.visitas li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--linea); }
.visitas li:first-child { border-top: 0; }
.visitas .cuando { margin-left: 0; order: -1; }
.visitas .origen { color: var(--tinta-2); }
.visitas form { margin: 0 0 0 auto; }
.visitas .anulada { color: var(--tinta-2); text-decoration: line-through; }
.borrar-enlace { margin-top: 1.5rem; }

.confirmar { max-width: 34rem; }

/* Mi plan: el estado como sello de goma. */
.plan-hoja { max-width: 36rem; }
.sello-estado {
  float: right;
  margin: 0 0 0.75rem 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 3px solid currentColor;
  border-radius: 8px;
  font-stretch: 70%;
  font-weight: 800;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transform: rotate(-7deg);
  color: var(--sello);
}
.estado-activo .sello-estado { color: var(--verde); }
.estado-pausado .sello-estado { color: var(--rojo); }
.monto-plan b { font-stretch: 75%; font-weight: 800; font-size: 1.8rem; }
.troquel { position: relative; clear: both; height: 0; margin: 1.25rem -1.25rem; border-top: 2px dashed var(--linea); }
.troquel::before, .troquel::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--suelo);
  border: 1px solid var(--linea);
}
.troquel::before { left: -12px; }
.troquel::after { right: -12px; }
.cancelar { margin-top: 0.5rem; }
.soporte { margin-top: 1.25rem; }

.qr-grilla { display: grid; gap: 1.25rem; align-items: start; }
.qr svg { display: block; width: 100%; max-width: 18rem; height: auto; margin: 0 auto; }

/* Panel general */
.estado-chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-family: var(--texto);
  font-size: 0.8rem;
  font-weight: 700;
  font-stretch: 90%;
  letter-spacing: 0;
  vertical-align: middle;
  background: var(--canario-claro);
  color: var(--tinta);
}
.estado-chip.estado-activo { background: var(--verde-claro); color: #0f532e; }
.estado-chip.estado-pausado { background: var(--rojo-claro); color: #8a1c13; }
.numeros-admin { grid-template-columns: repeat(2, 1fr); }
.numeros-admin strong { color: var(--tinta); }
.numeros-admin .ingreso strong { color: var(--sello); }
.avisos-admin { display: grid; gap: 1rem; }
.avisos-admin .hoja + .hoja { margin-top: 0; }
.ya-autorizo { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--verde-claro); color: #0f532e; font-weight: 700; font-size: 0.85rem; }
.datos { display: grid; grid-template-columns: 1fr; gap: 0.1rem; margin: 0; }
.datos dd + dt { margin-top: 0.55rem; }
.datos dt { color: var(--tinta-2); font-weight: 600; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.dos-columnas > .hoja + .hoja { margin-top: 0; }
.acciones-admin .formulario, .acciones-admin .separado { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px dashed var(--linea); }
.enlace-copiar { width: 100%; }

/* ---------- Página de venta ---------- */

body.venta { background: var(--papel); }
.barra-venta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1rem, calc((100% - 72rem) / 2 + 1rem));
  background: var(--canario);
}
.barra-venta nav { margin-left: auto; }
.entrar { display: inline-block; padding: 0.55rem 1rem; border-radius: 999px; border: 2px solid var(--tinta); color: var(--tinta); font-weight: 700; text-decoration: none; }
.entrar:hover { background: var(--tinta); color: var(--canario); }

body.venta main > section { padding: 3.5rem max(1rem, calc((100% - 72rem) / 2 + 1rem)); }
body.venta main > section h2 { font-size: 2.5rem; }

.portada {
  --suelo: var(--canario);
  display: grid;
  gap: 2.5rem;
  background: var(--canario);
  padding-top: 1.5rem !important;
}
.portada h1 {
  font-size: clamp(3.1rem, 12vw, 6rem);
  font-stretch: 68%;
  font-weight: 850;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.bajada { font-size: 1.15rem; max-width: 34rem; margin-bottom: 1.5rem; }
.acciones { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.portada .acciones .boton.grande { flex: 1 1 16rem; }
.portada .acciones .boton.secundario { flex: 1 1 12rem; min-height: 3.5rem; }
.letra-chica { margin: 1rem 0 0; font-size: 0.92rem; font-weight: 600; color: var(--tinta-2); }

.muestra { margin: 0; display: grid; gap: 0.85rem; justify-items: center; }
.muestra-tarjeta { transform: rotate(-1.5deg); }
.muestra-premio {
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: var(--tinta);
  color: var(--canario);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.25rem;
  text-align: center;
  animation: aparece 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.muestra-premio[hidden] { display: none; }
@keyframes aparece { from { transform: translateY(6px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.sellar { width: 100%; max-width: 26rem; min-height: 3.5rem; font-size: 1.1rem; background: var(--tinta); }
.sellar:hover { background: #000; }
.sellar[hidden] { display: none; }
.muestra figcaption { max-width: 26rem; font-size: 0.85rem; color: var(--tinta-2); text-align: center; }

.pasos-venta { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 2rem; }
.paso-venta { border-top: 2px dashed var(--tinta); padding-top: 1.25rem; }
.paso-numero {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--sello);
  color: var(--blanco);
  box-shadow: inset 0 0 0 3px var(--sello), inset 0 0 0 5px var(--blanco);
  font-family: var(--numeros);
  font-weight: 700;
  font-size: 1.3rem;
  transform: rotate(-8deg);
}
.paso-venta h3 { font-size: 1.6rem; }
.paso-venta p { color: var(--tinta-2); max-width: 30rem; }

.dueno { --suelo: var(--tinta); display: grid; gap: 1.5rem; background: var(--tinta); color: var(--blanco); }
.dueno p { color: #d4d4da; font-size: 1.1rem; }
.lista-dueno { list-style: none; margin: 0; padding: 0; }
.lista-dueno li { padding: 1rem 0; border-top: 1px solid rgba(255, 255, 255, 0.22); font-size: 1.05rem; color: #e6e6ea; }
.lista-dueno b { color: var(--canario); }

.precio { --suelo: var(--papel); }
.boleta-precio {
  position: relative;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border: 2px solid var(--tinta);
  border-radius: 16px;
  background: var(--blanco);
}
.boleta-precio h2 { font-size: 2rem !important; }
.boleta-precio .troquel { margin: 1.5rem -1.5rem; border-top-color: var(--tinta); }
.boleta-precio .troquel::before, .boleta-precio .troquel::after { border: 2px solid var(--tinta); }
.boleta-precio .troquel::before { left: -13px; }
.boleta-precio .troquel::after { right: -13px; }
.monto { margin: 0.25rem 0 1.25rem; }
.monto b { display: block; font-stretch: 72%; font-size: 4rem; font-weight: 850; letter-spacing: -0.01em; line-height: 1; }
.monto span { font-weight: 700; color: var(--tinta-2); }
.incluye { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.incluye li { position: relative; padding-left: 1.75rem; }
.incluye li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--sello);
  box-shadow: inset 0 0 0 2px var(--sello), inset 0 0 0 3px var(--blanco);
}
.talon-precio { color: var(--tinta-2); }

.preguntas { max-width: 50rem; margin: 0 auto; padding-left: 1rem !important; padding-right: 1rem !important; }
.pregunta { border-bottom: 1.5px solid var(--tinta); }
.pregunta:first-of-type { border-top: 1.5px solid var(--tinta); margin-top: 1.25rem; }
.pregunta summary {
  position: relative;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
}
.pregunta summary::-webkit-details-marker { display: none; }
.pregunta summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  background:
    linear-gradient(var(--tinta), var(--tinta)) center / 100% 2.5px no-repeat,
    linear-gradient(var(--tinta), var(--tinta)) center / 2.5px 100% no-repeat;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pregunta[open] summary::after { transform: rotate(45deg); }
.pregunta p { color: var(--tinta-2); max-width: 42rem; padding-bottom: 0.5rem; }

.cierre { background: var(--sello); color: var(--blanco); text-align: center; }
.cierre h2 { font-size: clamp(2.25rem, 7vw, 3.75rem) !important; max-width: 18ch; margin: 0 auto 1.5rem; }
.cierre .acciones { justify-content: center; }
.cierre .boton.grande { background: var(--canario); color: var(--tinta); }
.cierre .boton.grande:hover { background: var(--blanco); color: var(--tinta); }
.boton.secundario.sobre-tinta { color: var(--blanco); border-color: var(--blanco); min-height: 3.5rem; }
.boton.secundario.sobre-tinta:hover { background: var(--blanco); color: var(--sello); }
.cierre :focus-visible { outline-color: var(--canario); }

.pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding: 2rem max(1rem, calc((100% - 72rem) / 2 + 1rem)); }
.pie p { margin: 0; }

/* ---------- El cartel A5 ---------- */

body.cartel { background: #e6e6e0; }
body.cartel main { padding: 0 1rem 2rem; }
.barra-cartel { display: flex; align-items: center; justify-content: center; gap: 1.5rem; padding: 1rem 0; margin: 0; }
.hoja-cartel {
  position: relative;
  width: 148mm;
  max-width: 100%;
  min-height: 210mm;
  margin: 0 auto;
  padding: 12mm 11mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4mm;
  background: #fff;
  color: #000;
  text-align: center;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.45);
}
.hoja-cartel::before {
  content: "";
  position: absolute;
  inset: 5mm;
  border: 2px dashed #000;
  border-radius: 6mm;
  pointer-events: none;
}
.hoja-cartel > * { margin: 0; }
.hoja-cartel .logo { max-width: 40mm; max-height: 20mm; object-fit: contain; }
.hoja-cartel h1 { font-size: 30pt; font-stretch: 70%; line-height: 0.95; color: #000; max-width: 100%; overflow-wrap: anywhere; }
.hoja-cartel .premio { font-size: 13pt; }
.hoja-cartel .premio b { display: block; font-stretch: 75%; font-weight: 800; font-size: 20pt; line-height: 1.05; }
.consigna {
  padding: 2.5mm 6mm;
  border-radius: 3mm;
  background: #000;
  color: #fff;
  font-stretch: 72%;
  font-weight: 800;
  font-size: 22pt;
  line-height: 1.05;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.hoja-cartel .qr svg { width: 88mm; height: 88mm; max-width: 100%; }
.direccion { font-family: var(--numeros); font-size: 10pt; font-weight: 600; overflow-wrap: anywhere; }
.ayuda-cartel { font-size: 10pt; max-width: 100mm; }

@page { size: A5; margin: 0; }

/* ---------- Pantallas más anchas ---------- */

@media (min-width: 720px) {
  h1 { font-size: 2.75rem; }
  .colores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .datos { grid-template-columns: minmax(0, 13rem) 1fr; gap: 0.45rem 1rem; }
  .datos dd + dt { margin-top: 0; }
  .buscador { grid-template-columns: 1fr 17rem auto; align-items: end; }
  .numeros-admin { grid-template-columns: repeat(4, 1fr); }
  .qr-grilla { grid-template-columns: minmax(14rem, 20rem) 1fr; }
  .pasos-venta { grid-template-columns: repeat(3, 1fr); }
  .avisos-admin { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .portada {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 3rem;
    padding-top: 3.5rem !important;
    padding-bottom: 5rem !important;
  }
  .portada .acciones .boton.grande, .portada .acciones .boton.secundario { flex: 0 1 auto; }
  .bajada { font-size: 1.25rem; }
  .muestra-tarjeta { transform: rotate(-3deg); }
  .dueno { grid-template-columns: 0.8fr 1.2fr; align-items: start; gap: 3rem; }
  body.venta main > section { padding-top: 5rem; padding-bottom: 5rem; }
  body.venta main > section h2 { font-size: 3rem; }
  .dos-columnas { grid-template-columns: 22rem 1fr; align-items: start; gap: 2rem; }
  .vista-previa { position: sticky; top: 1rem; }
  .inicio-grilla { grid-template-columns: 1fr 1fr; }
  .numeros-seccion { grid-column: 1 / -1; }
  .numeros li b { font-size: 3rem; }
  .admin-detalle { grid-template-columns: 1fr 1fr; }
}

/* En el celular, cada cliente es una ficha en vez de una fila. */
@media (max-width: 519px) {
  .menu ul { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.2rem; padding: 0.35rem 0.5rem 0.6rem; overflow: visible; }
  .menu a { padding: 0.55rem 0.2rem; min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 0.86rem; text-align: center; }
  .admin .menu ul { grid-template-columns: auto; justify-content: start; }
  .admin .menu a { padding: 0.55rem 0.95rem; min-height: 44px; }
}

@media (max-width: 719px) {
  .tabla-clientes { background: none; }
  .tabla-clientes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabla-clientes tr {
    display: grid;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--linea);
    border-radius: var(--radio);
    background: var(--blanco);
  }
  .tabla-clientes td { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border: 0; }
  .tabla-clientes td::before { content: attr(data-etiqueta); font-family: var(--texto); font-weight: 600; color: var(--tinta-2); font-size: 0.9rem; }
  .tabla-clientes td.col-nombre { font-size: 1.15rem; font-weight: 800; padding-bottom: 0.4rem; }
  .tabla-clientes td.col-nombre::before, .tabla-clientes td.col-acciones::before { content: none; }
  .tabla-clientes td.col-acciones { flex-wrap: wrap; justify-content: flex-start; gap: 0.5rem; padding-top: 0.6rem; white-space: normal; }
  .tabla-clientes .col-acciones form { margin: 0; }
}

/* El cartel en pantalla chica; al imprimir valen los tamaños del diseño. */
@media screen and (max-width: 719px) {
  .hoja-cartel { min-height: 0; padding: 9mm 7mm; }
  .hoja-cartel h1 { font-size: 24pt; }
  .consigna { font-size: 17pt; }
  .hoja-cartel .qr svg { width: 100%; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .barra, .menu, .solo-pantalla, .franja-admin { display: none !important; }
  body, body.cartel { background: #fff; }
  body.cartel main { padding: 0; }
  .hoja-cartel {
    width: 148mm;
    height: 209mm;
    min-height: 0;
    margin: 0;
    box-shadow: none;
    overflow: hidden;
    break-inside: avoid;
  }
}
