/* Único y de Todo · sistema visual
   Rojo de marca del logo, tipografía redondeada (Nunito) para títulos e Inter para texto. */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Inter:wght@400;500;600;700&family=Caveat:wght@600&display=swap');

:root {
  --rojo: #e12a06;
  --rojo-vivo: #f02d01;
  --rojo-osc: #b31f02;
  --rojo-suave: #fdece8;
  --rojo-tinte: #fff5f2;
  --tinta: #141414;
  --tinta-2: #3a3a3f;
  --gris: #6b6b72;
  --gris-2: #9b9ba3;
  --borde: #ebe7e4;
  --fondo: #faf7f5;
  --blanco: #fff;
  --ok: #1e8e4e;
  --ok-suave: #dff3e7;
  --ambar: #8a5e00;
  --ambar-suave: #fff4d6;
  --azul: #1f5fad;
  --azul-suave: #e5effb;
  --radio: 16px;
  --radio-s: 10px;
  --sombra-s: 0 1px 2px rgba(20, 20, 20, 0.06), 0 1px 1px rgba(20, 20, 20, 0.04);
  --sombra: 0 10px 30px -12px rgba(20, 20, 20, 0.18), 0 2px 6px rgba(20, 20, 20, 0.05);
  --sombra-roja: 0 12px 30px -10px rgba(225, 42, 6, 0.45);
  --t: 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  --display: 'Nunito', system-ui, sans-serif;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--tinta);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--fondo); line-height: 1.5; min-height: 100vh; }
img, svg { max-width: 100%; }
a { color: var(--rojo); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; margin: 0 0 6px; }
h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 8px; }
p.sub { color: var(--gris); margin: 0 0 18px; }
.mini { font-size: 0.82rem; color: var(--gris); }
.oculto { display: none !important; }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--rojo); font-weight: 600; margin-top: 10px; white-space: pre-wrap; }
:focus-visible { outline: 3px solid rgba(225, 42, 6, 0.35); outline-offset: 2px; }

/* ───────── Barra superior ───────── */
header.barra {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--borde);
  padding: 10px clamp(16px, 4vw, 40px); display: flex; align-items: center; gap: 14px;
}
header.barra .logo { height: 40px; width: auto; display: block; }
header.barra small { color: var(--gris); font-weight: 500; }
header.barra nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
header.barra nav a { text-decoration: none; color: var(--tinta-2); font-weight: 600; font-size: 0.92rem; padding: 8px 12px; border-radius: 99px; }
header.barra nav a:hover { background: var(--rojo-tinte); color: var(--rojo); }
header.barra nav a.cta { background: var(--rojo); color: #fff; box-shadow: var(--sombra-roja); }
header.barra nav a.cta:hover { background: var(--rojo-osc); }
header.barra nav a { white-space: nowrap; }
@media (max-width: 860px) { header.barra nav a:not(.cta) { display: none; } header.barra small { display: none; } header.barra .logo { height: 34px; } }

main { max-width: 1180px; margin: 28px auto 60px; padding: 0 16px; }

/* ───────── Tarjetas, botones, formularios ───────── */
.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: clamp(18px, 3vw, 28px); margin-bottom: 18px; box-shadow: var(--sombra-s); }
.tarjeta.elevada { box-shadow: var(--sombra); }

button, .boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--rojo); color: #fff; border: 0; border-radius: 12px; padding: 12px 20px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform var(--t), background var(--t), box-shadow var(--t);
}
button:hover, .boton:hover { background: var(--rojo-osc); }
button:active { transform: scale(0.98); }
button.grande { padding: 15px 26px; font-size: 1.02rem; box-shadow: var(--sombra-roja); }
button.sec, .boton.sec { background: var(--blanco); color: var(--tinta); border: 1px solid var(--borde); box-shadow: none; }
button.sec:hover, .boton.sec:hover { border-color: var(--tinta-2); background: var(--blanco); }
button.fantasma { background: transparent; color: var(--rojo); padding: 8px 10px; }
button.fantasma:hover { background: var(--rojo-tinte); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
button.cargando { position: relative; color: transparent !important; pointer-events: none; }
button.cargando::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: gira .7s linear infinite; }
button.sec.cargando::after { border-color: rgba(0,0,0,.15); border-top-color: var(--tinta); }

label { display: block; font-weight: 600; font-size: 0.88rem; margin: 14px 0 6px; color: var(--tinta-2); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--borde); border-radius: 12px; font: inherit;
  background: var(--blanco); transition: border-color var(--t), box-shadow var(--t);
}
input:hover, select:hover { border-color: #d8d2ce; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rojo); box-shadow: 0 0 0 4px rgba(225, 42, 6, 0.12); }
input.valido { border-color: var(--ok); }
input.invalido { border-color: var(--rojo); background: var(--rojo-tinte); }
.ayuda { font-size: 0.8rem; color: var(--gris); margin-top: 6px; min-height: 1.1em; }
.ayuda.mal { color: var(--rojo); }
.ayuda.bien { color: var(--ok); }
.campo-icono { position: relative; }
.campo-icono > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gris-2); pointer-events: none; display: flex; }
.campo-icono > input { padding-left: 42px; }

.fila { display: flex; gap: 14px; flex-wrap: wrap; }
.fila > * { flex: 1 1 220px; }
.acciones { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.acciones .empuja { margin-left: auto; }

/* Interruptores */
.switch { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--borde); border-radius: 14px; margin-bottom: 10px; cursor: pointer; transition: border-color var(--t), background var(--t); font-weight: 500; }
.switch:hover { border-color: #d8d2ce; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .pista { flex: 0 0 44px; height: 26px; border-radius: 99px; background: #ddd7d3; position: relative; transition: background var(--t); margin-top: 1px; }
.switch .pista::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sombra-s); transition: transform var(--t); }
.switch input:checked + .pista { background: var(--ok); }
.switch input:checked + .pista::after { transform: translateX(18px); }
.switch:has(input:checked) { border-color: var(--ok); background: #f6fbf8; }
.switch b { display: block; margin-bottom: 2px; }

/* Chips y estatus */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 0.74rem; font-weight: 700; background: var(--borde); color: var(--tinta-2); white-space: nowrap; }
.chip.DISPONIBLE, .chip.verde { background: var(--ok-suave); color: var(--ok); }
.chip.OCUPADO, .chip.VIGENTE, .chip.azul { background: var(--azul-suave); color: var(--azul); }
.chip.APARTADO, .chip.EN_REVISION, .chip.PAGO_EN_REVISION, .chip.ambar { background: var(--ambar-suave); color: var(--ambar); }
.chip.EN_RENOVACION, .chip.rojo { background: var(--rojo-suave); color: var(--rojo); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.filtros button { background: var(--blanco); color: var(--tinta-2); border: 1.5px solid var(--borde); padding: 7px 14px; border-radius: 99px; font-size: 0.85rem; font-weight: 600; box-shadow: none; }
.filtros button.sel { background: var(--tinta); border-color: var(--tinta); color: #fff; }

.aviso { background: var(--ambar-suave); border: 1px solid #f1d9a0; color: var(--ambar); border-radius: 12px; padding: 12px 14px; font-size: 0.92rem; }
.aviso.info { background: var(--azul-suave); border-color: #c9dcf4; color: var(--azul); }
.aviso.bien { background: var(--ok-suave); border-color: #bfe5cd; color: var(--ok); }

pre.contrato { white-space: pre-wrap; background: #fffdfb; border: 1px solid var(--borde); border-radius: 12px; padding: 22px; font-family: 'Inter', sans-serif; font-size: 0.86rem; line-height: 1.6; max-height: 420px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { color: var(--gris); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fcfaf9; }
nav.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
nav.tabs button { background: var(--blanco); color: var(--tinta-2); border: 1.5px solid var(--borde); padding: 9px 16px; box-shadow: none; }
nav.tabs button.sel { background: var(--tinta); border-color: var(--tinta); color: #fff; }

/* Compatibilidad con pantallas sencillas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.opcion { border: 1.5px solid var(--borde); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--blanco); text-align: left; color: var(--tinta); font-weight: 400; display: block; box-shadow: none; }
.opcion:hover { border-color: var(--rojo); background: var(--blanco); }
.opcion.sel { border-color: var(--rojo); background: var(--rojo-tinte); }

/* ───────── Asistente de registro ───────── */
.registro { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .registro { grid-template-columns: 1fr; } .resumen { position: static !important; order: -1; } }

.progreso { margin-bottom: 22px; }
.progreso .barra-p { height: 6px; background: #eee8e4; border-radius: 99px; overflow: hidden; }
.progreso .barra-p i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rojo-vivo), #ff7a4d); border-radius: 99px; transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.progreso ol { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 12px 0 0; gap: 4px; }
.progreso li { flex: 1; text-align: center; font-size: 0.72rem; color: var(--gris-2); font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.progreso li .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #e6dfda; color: var(--gris-2); font-size: 0.78rem; transition: all var(--t); }
.progreso li.hecho .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.progreso li.actual { color: var(--tinta); }
.progreso li.actual .n { background: var(--rojo); border-color: var(--rojo); color: #fff; box-shadow: 0 0 0 5px rgba(225, 42, 6, 0.15); }
.progreso .paso-txt { display: none; font-size: 0.82rem; font-weight: 700; color: var(--tinta-2); margin-bottom: 8px; }
@media (max-width: 720px) { .progreso li span.t { display: none; } .progreso li .n { width: 22px; height: 22px; font-size: 0.66rem; } .progreso .paso-txt { display: block; } }

.paso { animation: entra 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
.paso .encabezado { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.paso .encabezado .ico-paso { flex: 0 0 48px; height: 48px; border-radius: 14px; background: var(--rojo-tinte); color: var(--rojo); display: grid; place-items: center; }
.seccion-titulo { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.seccion-titulo .num { width: 26px; height: 26px; border-radius: 8px; background: var(--tinta); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 0.85rem; }
.seccion-titulo h2 { margin: 0; }

/* Resumen lateral */
.resumen { position: sticky; top: 84px; }
.resumen .tarjeta { padding: 0; overflow: hidden; }
.resumen .cab { background: linear-gradient(135deg, var(--rojo-vivo), #ff6a3d); color: #fff; padding: 18px 20px; position: relative; overflow: hidden; }
.resumen .cab::after { content: ''; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.12); }
.resumen .cab small { opacity: 0.85; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.72rem; }
.resumen .cab .precio { font-family: var(--display); font-size: 2.1rem; font-weight: 900; line-height: 1; margin-top: 6px; }
.resumen .cab .precio span { font-size: 0.9rem; font-weight: 700; opacity: 0.85; }
.resumen dl { margin: 0; padding: 14px 20px 18px; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 0.88rem; }
.resumen dt { color: var(--gris); }
.resumen dd { margin: 0; text-align: right; font-weight: 600; }
.resumen .vacio { color: var(--gris-2); font-weight: 500; }
.resumen .ayuda-c { padding: 14px 20px; border-top: 1px dashed var(--borde); font-size: 0.84rem; color: var(--gris); display: flex; gap: 10px; align-items: center; }
.cambio { animation: brilla 0.9s ease; }

/* Sucursales + mapa */
.sucursales { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; }
@media (max-width: 860px) { .sucursales { grid-template-columns: 1fr; } }
.lista-suc { display: flex; flex-direction: column; gap: 10px; }
.suc { text-align: left; background: var(--blanco); border: 1.5px solid var(--borde); color: var(--tinta); border-radius: 14px; padding: 14px; display: block; box-shadow: none; font-weight: 400; width: 100%; }
.suc:hover { border-color: #d6c9c2; background: var(--blanco); transform: translateY(-1px); }
.suc.sel { border-color: var(--rojo); background: var(--rojo-tinte); box-shadow: 0 0 0 4px rgba(225, 42, 6, 0.1); }
.suc .t { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.suc .t b { font-family: var(--display); font-size: 1.12rem; font-weight: 900; }
.suc .dir { font-size: 0.83rem; color: var(--tinta-2); margin: 6px 0 4px; }
.suc .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.78rem; color: var(--gris); }
.suc .meta span { display: inline-flex; align-items: center; gap: 4px; }
.disp-barra { height: 6px; background: #eee8e4; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.disp-barra i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.mapa { height: 420px; border-radius: 16px; overflow: hidden; border: 1px solid var(--borde); background: #eef0f2; position: relative; z-index: 1; }
@media (max-width: 860px) { .mapa { height: 300px; } }
.marcador { filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); transition: transform var(--t); transform-origin: 50% 100%; }
.marcador.sel { transform: scale(1.3); }
.marcador img { width: 100%; height: 100%; }
.leaflet-popup-content-wrapper { border-radius: 14px !important; box-shadow: var(--sombra) !important; }
.leaflet-popup-content { margin: 14px 16px !important; font-family: 'Inter', sans-serif; }
.pop b { font-family: var(--display); font-size: 1.05rem; }
.pop .acciones { margin-top: 10px; gap: 6px; }
.pop .boton { padding: 7px 12px; font-size: 0.8rem; color: #fff; }
.pop .boton.sec { color: var(--tinta); }

/* Tipos de espacio */
.tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.tipo { position: relative; text-align: left; background: var(--blanco); border: 1.5px solid var(--borde); color: var(--tinta); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: none; font-weight: 400; }
.tipo:hover { border-color: #d6c9c2; background: var(--blanco); transform: translateY(-2px); box-shadow: var(--sombra); }
.tipo.sel { border-color: var(--rojo); background: var(--rojo-tinte); }
.tipo .ilus { height: 74px; border-radius: 12px; background: linear-gradient(180deg, #fff7f4, #fdece8); display: grid; place-items: center; color: var(--rojo); margin-bottom: 6px; }
.tipo.sel .ilus { background: linear-gradient(180deg, #ffe3da, #ffd2c4); }
.tipo b { font-family: var(--display); font-weight: 800; font-size: 1rem; }
.tipo .precio { color: var(--rojo); font-family: var(--display); font-weight: 900; font-size: 1.3rem; line-height: 1; }
.tipo .precio small { font-size: 0.72rem; color: var(--gris); font-family: 'Inter'; font-weight: 600; }
.tipo .agotado { position: absolute; top: 10px; right: 10px; }
.tipo[disabled] { opacity: 0.5; }

/* Plano interactivo */
.plano-cont { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 16px; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--gris); margin-bottom: 12px; }
.leyenda i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; }
.plano { display: flex; flex-direction: column; gap: 14px; max-height: 460px; overflow: auto; padding: 4px; }
.pasillo { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; transition: opacity var(--t); }
.pasillo.atenuado { opacity: 0.28; }
.pasillo .rot { font-size: 0.75rem; font-weight: 700; color: var(--tinta-2); padding-top: 6px; }
.pasillo .rot small { display: block; color: var(--gris); font-weight: 500; }
.celdas { display: flex; flex-wrap: wrap; gap: 6px; }
.celda { width: 46px; height: 40px; border-radius: 9px; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; padding: 0; box-shadow: none; border: 1.5px solid transparent; }
.celda.libre { background: var(--ok-suave); color: var(--ok); border-color: #bfe5cd; cursor: pointer; }
.celda.libre:hover { background: var(--ok); color: #fff; transform: translateY(-2px) scale(1.06); }
.celda.ocupada { background: #f0ecea; color: #b8b1ad; cursor: not-allowed; background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(0,0,0,.035) 5px 10px); }
.celda.ocupada:hover { background-color: #f0ecea; }
.celda.sel { background: var(--rojo) !important; color: #fff !important; border-color: var(--rojo-osc) !important; animation: late 1.6s ease-in-out infinite; }
.tooltip { position: fixed; z-index: 2000; pointer-events: none; background: var(--tinta); color: #fff; padding: 8px 11px; border-radius: 10px; font-size: 0.78rem; box-shadow: var(--sombra); transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity 0.12s; white-space: nowrap; }
.tooltip.ver { opacity: 1; }
.tooltip b { font-family: var(--display); }

/* Barra de acción fija (móvil) */
.pie-accion { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(250,247,245,0), var(--fondo) 30%); padding: 18px 0 6px; margin-top: 10px; z-index: 5; }

/* Carga de documentos */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.drop { position: relative; border: 2px dashed #ddd4cf; border-radius: 16px; padding: 16px; background: #fffdfc; cursor: pointer; transition: all var(--t); display: flex; gap: 12px; align-items: center; min-height: 92px; }
.drop:hover, .drop.sobre { border-color: var(--rojo); background: var(--rojo-tinte); }
.drop.lleno { border-style: solid; border-color: #bfe5cd; background: #f6fbf8; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .vista { flex: 0 0 56px; height: 56px; border-radius: 10px; background: var(--rojo-suave); color: var(--rojo); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 0.7rem; }
.drop.lleno .vista { background: var(--ok-suave); color: var(--ok); }
.drop .vista img { width: 100%; height: 100%; object-fit: cover; }
.drop b { display: block; font-size: 0.9rem; }
.drop .req { color: var(--rojo); }
.drop .barra-subida { position: absolute; left: 14px; right: 14px; bottom: 8px; height: 4px; border-radius: 99px; background: #eee; overflow: hidden; }
.drop .barra-subida i { display: block; height: 100%; width: 0; background: var(--rojo); transition: width 0.15s; }
.ruta { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; margin-top: 12px; transition: all var(--t); }
.ruta.A { background: var(--ok-suave); color: var(--ok); }
.ruta.B { background: var(--ambar-suave); color: var(--ambar); }
.ruta .letra { width: 40px; height: 40px; border-radius: 12px; background: currentColor; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 1.3rem; }
.ruta .letra span { color: #fff; }

/* CLABE */
.clabe-input { font-family: 'Inter', monospace; letter-spacing: 0.08em; font-size: 1.15rem; font-weight: 600; }
.banco-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--azul-suave); color: var(--azul); font-weight: 700; font-size: 0.88rem; margin-top: 10px; animation: entra .3s ease; }

/* Meses */
.rango { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--rojo) var(--p, 0%), #eee8e4 var(--p, 0%)); padding: 0; border: 0; }
.rango:focus { box-shadow: none; }
.rango::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--rojo); box-shadow: var(--sombra); cursor: grab; }
.rango::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--rojo); cursor: grab; }
.meses-num { font-family: var(--display); font-weight: 900; font-size: 2.4rem; color: var(--rojo); line-height: 1; }
.linea-tiempo { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; margin-top: 14px; scroll-snap-type: x mandatory; }
.mes { flex: 0 0 132px; scroll-snap-align: start; border: 1.5px solid var(--borde); border-radius: 14px; padding: 12px; background: #fff; animation: entra .35s ease both; }
.mes .m { font-family: var(--display); font-weight: 900; font-size: 0.98rem; }
.mes .m::first-letter { text-transform: uppercase; }
.mes .r { font-size: 0.74rem; color: var(--gris); }
.mes .monto { font-weight: 700; margin-top: 6px; }
.mes:first-child { border-color: var(--rojo); background: var(--rojo-tinte); }
.totales { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.totales div { background: var(--fondo); border-radius: 12px; padding: 12px; }
.totales b { display: block; font-family: var(--display); font-size: 1.25rem; }

/* Códigos (OTP) */
.otp-canal { border: 1.5px solid var(--borde); border-radius: 16px; padding: 16px; margin-bottom: 12px; transition: all var(--t); }
.otp-canal.listo { border-color: var(--ok); background: #f6fbf8; }
.otp-canal .t { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.otp { display: flex; gap: 8px; }
.otp input { width: 48px; height: 56px; text-align: center; font-size: 1.5rem; font-weight: 800; font-family: var(--display); padding: 0; border-radius: 12px; }
.otp.temblor { animation: tiembla 0.4s; }
@media (max-width: 420px) { .otp input { width: 40px; height: 50px; } }

/* Métodos de pago */
.metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 560px) { .metodos { grid-template-columns: 1fr; } }
.metodo { background: #fff; color: var(--tinta); border: 1.5px solid var(--borde); border-radius: 14px; padding: 14px; flex-direction: column; align-items: flex-start; gap: 4px; box-shadow: none; text-align: left; font-weight: 400; }
.metodo:hover { background: #fff; border-color: #d6c9c2; }
.metodo.sel { border-color: var(--rojo); background: var(--rojo-tinte); }
.metodo b { font-family: var(--display); font-weight: 800; }
.tarjeta-visual { perspective: 1000px; width: min(360px, 100%); height: 210px; margin: 0 auto 18px; }
.tarjeta-visual .cara { position: absolute; inset: 0; border-radius: 18px; padding: 22px; color: #fff; backface-visibility: hidden; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 20px 40px -15px rgba(0,0,0,.45); }
.tarjeta-visual .giro { position: relative; width: 100%; height: 100%; }
.tarjeta-visual .frente { background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.25), transparent 40%), linear-gradient(135deg, #1c1c1f, #3a3a40); display: flex; flex-direction: column; justify-content: space-between; }
.tarjeta-visual .reverso { background: linear-gradient(135deg, #2a2a2e, #1c1c1f); transform: rotateY(180deg); }
.tarjeta-visual.volteada .frente { transform: rotateY(-180deg); }
.tarjeta-visual.volteada .reverso { transform: rotateY(0); }
.tarjeta-visual .chipc { width: 44px; height: 32px; border-radius: 6px; background: linear-gradient(135deg, #e8c46a, #b8913a); }
.tarjeta-visual .numero { font-family: 'Inter', monospace; font-size: 1.25rem; letter-spacing: 0.12em; font-weight: 600; }
.tarjeta-visual .pie { display: flex; justify-content: space-between; font-size: 0.75rem; text-transform: uppercase; opacity: .9; }
.tarjeta-visual .banda { height: 42px; background: #000; margin: 10px -22px 18px; }
.tarjeta-visual .cvv { background: #fff; color: #111; border-radius: 6px; padding: 8px 12px; text-align: right; font-weight: 700; font-family: monospace; }
.datos-spei { display: grid; gap: 8px; }
.copiable { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--fondo); }
.copiable span { color: var(--gris); font-size: 0.8rem; }
.copiable b { font-family: 'Inter', monospace; letter-spacing: 0.05em; }
.ref-oxxo { text-align: center; padding: 22px; border: 2px dashed #ddd4cf; border-radius: 16px; }
.ref-oxxo .codigo-barras { height: 64px; margin: 12px auto; max-width: 320px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px, #111 8px 11px, transparent 11px 12px); }
.ref-oxxo b { font-family: 'Inter', monospace; font-size: 1.4rem; letter-spacing: 0.15em; }

/* Contrato y firma */
.lectura { height: 5px; background: #eee8e4; border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.lectura i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .15s; }
.firma { font-family: 'Caveat', cursive; font-size: 2.3rem; color: #1a3f8f; min-height: 64px; border-bottom: 2px solid var(--tinta); display: flex; align-items: flex-end; padding: 0 6px 4px; margin-top: 12px; }
.firma:empty::before { content: 'Tu firma aparecerá aquí'; font-family: 'Inter'; font-size: 0.85rem; color: var(--gris-2); }

/* Éxito */
.exito { text-align: center; padding: 20px 0; }
.exito .sello { width: 96px; height: 96px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; animation: pop .6s cubic-bezier(0.2, 1.4, 0.4, 1); box-shadow: 0 0 0 12px var(--ok-suave); }
canvas.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 3000; }

/* Revisión / espera */
.espera { text-align: center; padding: 30px 10px; }
.espera .reloj { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; border: 5px solid var(--ambar-suave); border-top-color: var(--ambar); animation: gira 1.4s linear infinite; }
.cuenta-regresiva { font-family: var(--display); font-weight: 900; font-size: 1.4rem; color: var(--ambar); }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--tinta); color: #fff; border-radius: 14px; padding: 13px 16px; box-shadow: var(--sombra); display: flex; gap: 10px; align-items: flex-start; animation: sube .3s cubic-bezier(0.2, 0.8, 0.2, 1); font-size: 0.9rem; }
.toast.error { background: #fff; color: var(--tinta); border-left: 5px solid var(--rojo); font-weight: 500; margin: 0; }
.toast.bien { background: #fff; color: var(--tinta); border-left: 5px solid var(--ok); }
.toast.sale { animation: baja .25s ease forwards; }
.toast ul { margin: 6px 0 0; padding-left: 18px; color: var(--gris); font-size: 0.82rem; }

/* Esqueleto de carga */
.esqueleto { background: linear-gradient(90deg, #f1ece9 25%, #f8f5f3 50%, #f1ece9 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 12px; }

/* ───────── Portada ───────── */
.hero { position: relative; overflow: hidden; background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 35%), linear-gradient(135deg, var(--rojo-vivo) 0%, #ff5a2a 60%, #ff8a4d 100%); color: #fff; border-radius: 28px; padding: clamp(28px, 6vw, 64px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; box-shadow: var(--sombra-roja); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: #fff; }
.hero p { font-size: 1.1rem; opacity: 0.95; max-width: 520px; }
.hero .boton { background: #fff; color: var(--rojo); box-shadow: 0 10px 30px -8px rgba(0,0,0,.35); }
.hero .boton:hover { background: var(--tinta); color: #fff; }
.hero .boton.sec { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.5); box-shadow: none; }
.hero .burbujas span { position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); animation: flota 9s ease-in-out infinite; }
.hero .pin-hero { width: min(260px, 60%); margin: auto; filter: drop-shadow(0 30px 30px rgba(0,0,0,.25)); animation: rebota 3.2s ease-in-out infinite; }
.cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: -34px auto 30px; max-width: 980px; position: relative; z-index: 2; padding: 0 16px; }
@media (max-width: 720px) { .cifras { grid-template-columns: repeat(2, 1fr); } }
.cifras div { background: #fff; border-radius: 18px; padding: 18px; text-align: center; box-shadow: var(--sombra); }
.cifras b { display: block; font-family: var(--display); font-weight: 900; font-size: 2rem; color: var(--rojo); }
.cifras span { color: var(--gris); font-size: 0.85rem; font-weight: 600; }
.pasos-home { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .pasos-home { grid-template-columns: repeat(2, 1fr); } }
.pasos-home div { background: #fff; border: 1px solid var(--borde); border-radius: 18px; padding: 20px; }
.pasos-home .n { width: 38px; height: 38px; border-radius: 12px; background: var(--rojo-tinte); color: var(--rojo); display: grid; place-items: center; font-family: var(--display); font-weight: 900; margin-bottom: 10px; }
.titulo-seccion { text-align: center; margin: 44px 0 20px; }
.titulo-seccion h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 6px; }
footer.pie { text-align: center; color: var(--gris); font-size: 0.85rem; padding: 30px 16px 40px; }
footer.pie img { height: 30px; opacity: 0.85; }

.aparece { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.aparece.visible { opacity: 1; transform: none; }

/* ───────── Animaciones ───────── */
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sube { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes baja { to { opacity: 0; transform: translateY(10px); } }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes late { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 42, 6, 0.45); } 50% { box-shadow: 0 0 0 8px rgba(225, 42, 6, 0); } }
@keyframes tiembla { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes brilla { 0% { transform: scale(1.025); filter: brightness(1.12); } 100% { transform: none; filter: none; } }
@keyframes brillo { to { background-position: -200% 0; } }
@keyframes rebota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes flota { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -24px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.hero .burbujas { position: absolute; inset: 0; pointer-events: none; }
.hero > div:not(.burbujas) { position: relative; }
.leaflet-tile-pane { filter: saturate(0.75) contrast(1.02); }

/* Resumen compacto en pantallas angostas (va al final para ganar a las reglas base) */
@media (max-width: 980px) { .resumen dl, .resumen .ayuda-c { display: none; } .resumen .cab { padding: 12px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .resumen .cab .precio { font-size: 1.5rem; margin: 0; } .resumen .cab .mini { flex-basis: 100%; } .resumen { margin-bottom: -6px; } }

/* ───────── WhatsApp flotante ───────── */
.wa-flotante { position: fixed; right: 18px; bottom: 18px; z-index: 3500; display: flex; align-items: center; gap: 10px; background: #25d366; color: #fff; text-decoration: none; font-weight: 700; border-radius: 99px; padding: 12px 18px 12px 14px; box-shadow: 0 12px 28px -8px rgba(37, 211, 102, .6); transition: transform var(--t); animation: sube .5s .6s both; }
.wa-flotante:hover { transform: translateY(-3px) scale(1.03); color: #fff; }
.wa-flotante::before { content: ''; position: absolute; inset: 0; border-radius: 99px; border: 2px solid #25d366; animation: onda 2.4s ease-out infinite; }
@keyframes onda { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@media (max-width: 640px) { .wa-flotante span { display: none; } .wa-flotante { padding: 13px; } }
.toasts { bottom: 86px; }
.boton.wa { background: #25d366; box-shadow: none; }
.boton.wa:hover { background: #1ebe5b; }

/* ───────── Fotos de espacios ───────── */
.tipo .foto { height: 128px; border-radius: 12px; background: #fff; border: 1px solid var(--borde); margin-bottom: 8px; overflow: hidden; position: relative; display: grid; place-items: center; }
.tipo .foto img { width: 100%; height: 100%; object-fit: contain; padding: 6px; transition: transform .4s ease; }
.tipo:hover .foto img { transform: scale(1.06); }
.tipo .foto .lupa { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 8px; background: rgba(20,20,20,.75); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity var(--t); }
.tipo:hover .foto .lupa { opacity: 1; }
.tipo .incluye { font-size: .76rem; font-weight: 700; color: var(--azul); }
.ficha { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; background: #fff; border: 1.5px solid var(--rojo); border-radius: 16px; padding: 14px; margin-top: 14px; animation: entra .35s ease; }
@media (max-width: 640px) { .ficha { grid-template-columns: 1fr; } }
.ficha img { width: 100%; height: 170px; object-fit: contain; border-radius: 12px; background: #fff; cursor: zoom-in; }
.ficha .sin-foto { height: 170px; border-radius: 12px; background: linear-gradient(180deg, #fff7f4, #fdece8); color: var(--rojo); display: grid; place-items: center; }
.ficha h3 { font-size: 1.25rem; margin-bottom: 4px; }
.ficha ul { margin: 8px 0 0; padding-left: 18px; color: var(--tinta-2); font-size: .9rem; }
.visor { position: fixed; inset: 0; z-index: 5000; background: rgba(10,10,10,.82); display: grid; place-items: center; padding: 24px; animation: entra .2s ease; backdrop-filter: blur(4px); }
.visor.sale { animation: baja .2s ease forwards; }
.visor figure { margin: 0; max-width: min(1100px, 100%); text-align: center; }
.visor img { max-width: 100%; max-height: 80vh; border-radius: 14px; background: #fff; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.visor figcaption { color: #fff; font-family: var(--display); font-weight: 800; margin-top: 12px; font-size: 1.1rem; }
.visor .cerrar { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--tinta); padding: 0; font-size: 1.1rem; }
.fachada { position: relative; border-radius: 24px; overflow: hidden; box-shadow: var(--sombra); }
.fachada img { width: 100%; display: block; }
.fachada figcaption { position: absolute; left: 16px; bottom: 16px; background: rgba(255,255,255,.92); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: .9rem; }
.con-acciones .wa-flotante { bottom: 92px; }
.con-acciones .toasts { bottom: 156px; }

/* ───────── Panel interno ───────── */
.panel { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .panel { grid-template-columns: 1fr; } }
.menu { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 10px; }
@media (max-width: 900px) { .menu { position: static; flex-direction: row; overflow-x: auto; } }
.menu .grupo { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris-2); font-weight: 700; padding: 10px 10px 4px; }
@media (max-width: 900px) { .menu .grupo { display: none; } }
.menu button { justify-content: flex-start; background: transparent; color: var(--tinta-2); padding: 10px 12px; border-radius: 10px; font-weight: 600; box-shadow: none; white-space: nowrap; }
.menu button:hover { background: var(--fondo); color: var(--tinta); }
.menu button.sel { background: var(--rojo-tinte); color: var(--rojo); }
.menu button .num-badge { margin-left: auto; background: var(--rojo); color: #fff; border-radius: 99px; font-size: .7rem; padding: 1px 7px; }
.rol { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
.rol.ADMINISTRADOR { background: var(--tinta); color: #fff; }
.rol.MANAGER { background: var(--azul-suave); color: var(--azul); }
.rol.ALIADO { background: var(--ok-suave); color: var(--ok); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis div { background: var(--fondo); border-radius: 14px; padding: 14px; }
.kpis b { display: block; font-family: var(--display); font-size: 1.7rem; font-weight: 900; }
.kpis .rojo b { color: var(--rojo); }
.barra-acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.barra-acciones select, .barra-acciones input { width: auto; min-width: 160px; }
.tabla-cont { overflow-x: auto; }
td .acciones { margin: 0; gap: 6px; flex-wrap: nowrap; }
td button, td .boton { padding: 7px 11px; font-size: .82rem; }
.precio-fila { display: grid; grid-template-columns: 70px minmax(0, 1fr) 150px 120px auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--borde); }
@media (max-width: 760px) { .precio-fila { grid-template-columns: 60px 1fr; } }
.precio-fila img, .precio-fila .ph { width: 70px; height: 56px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--borde); }
.precio-fila .ph { display: grid; place-items: center; color: var(--rojo); background: var(--rojo-tinte); }
.precio-fila input[type=number] { font-weight: 700; font-size: 1.05rem; }
.precio-fila .cambio-pend { border-color: var(--ambar); background: var(--ambar-suave); }
.estado-u { font-size: .74rem; font-weight: 700; }
.estado-u.ACTIVO { color: var(--ok); } .estado-u.INVITADO { color: var(--azul); } .estado-u.INVITACION_VENCIDA { color: var(--ambar); } .estado-u.INACTIVO { color: var(--gris-2); }
.modal { position: fixed; inset: 0; z-index: 4500; background: rgba(10,10,10,.55); display: grid; place-items: center; padding: 16px; animation: entra .2s ease; backdrop-filter: blur(3px); }
.modal .caja { background: #fff; border-radius: 18px; padding: 24px; width: min(480px, 100%); box-shadow: var(--sombra); max-height: 90vh; overflow: auto; }
.modal .caja h2 { margin-bottom: 4px; }
.enlace-copiable { display: flex; gap: 8px; align-items: center; background: var(--fondo); border-radius: 10px; padding: 10px; font-size: .8rem; word-break: break-all; }
.diff { font-family: 'Inter', monospace; font-size: .78rem; color: var(--tinta-2); }
.diff del { color: var(--rojo); } .diff ins { color: var(--ok); text-decoration: none; }
