/* PólizaClick — hoja única. Colores del logo: esmeralda, tinta, menta y hueso. */
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --tinta: #0B1F1A;
  --tinta-2: #2C3D38;
  --gris: #5B6B66;
  --gris-2: #8A9893;
  --linea: rgba(11, 31, 26, .10);
  --linea-2: rgba(11, 31, 26, .18);
  --fondo: #F2F7F4;
  --papel: #FFFFFF;
  --esm: #0B8A5F;
  --esm-osc: #08704D;
  --menta: #9FE3C6;
  --menta-suave: #E2F5EC;
  --ambar: #A86100;
  --ambar-suave: #FDF1DC;
  --rojo: #B3361B;
  --rojo-suave: #FBE7E1;
  --azul: #1F5F8B;
  --azul-suave: #E3EFF7;
  --radio: 14px;
  --radio-s: 10px;
  --sombra: 0 1px 2px rgba(11,31,26,.06), 0 6px 20px rgba(11,31,26,.06);
  --nav-alto: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5; font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--esm-osc); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }
:focus-visible { outline: 3px solid var(--menta); outline-offset: 2px; border-radius: 6px; }

/* ── Estructura ─────────────────────────────────────────────────────── */
.app { min-height: 100vh; min-height: 100dvh; }
.barra-sup {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(242, 247, 244, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linea);
}
.barra-sup .logo { height: 26px; width: auto; }
.barra-sup .espacio { flex: 1; }
.barra-sup .titulo-pag { font-weight: 800; font-size: 17px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-atras { border: 0; background: none; padding: 6px; margin-left: -6px; border-radius: 10px; cursor: pointer; display: flex; }
.btn-atras svg { width: 22px; height: 22px; }

.contenido { padding: 18px 16px calc(var(--nav-alto) + 28px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--papel); border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--nav-alto); color: var(--gris); font-size: 11px; font-weight: 700; position: relative;
}
.nav a svg { width: 23px; height: 23px; }
.nav a.activo { color: var(--esm); }
.nav a.activo::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--esm); }
.nav .globo { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rojo); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.nav .marca-lat { display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 236px 1fr; }
  .nav {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
    border-top: 0; border-right: 1px solid var(--linea); padding: 22px 14px; align-self: start;
  }
  .nav .marca-lat { display: block; padding: 4px 10px 22px; }
  .nav .marca-lat img { height: 28px; width: auto; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; }
  .nav a.activo { background: var(--menta-suave); color: var(--esm-osc); }
  .nav a.activo::before { display: none; }
  .nav .globo { position: static; margin-left: auto; }
  .barra-sup .logo { display: none; }
  .contenido { padding: 28px 32px 48px; }
  .principal { min-width: 0; }
}

/* ── Piezas ─────────────────────────────────────────────────────────── */
.tarjeta { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; }
.tarjeta + .tarjeta, .bloque + .bloque { margin-top: 14px; }
.bloque { margin-top: 22px; }
.bloque-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bloque-cab h2 { font-size: 16px; }
.bloque-cab a, .bloque-cab button.enlace { font-size: 13.5px; font-weight: 700; }
.saludo { margin-bottom: 18px; }
.saludo p { margin: 4px 0 0; color: var(--gris); }
.sub { color: var(--gris); font-size: 13.5px; }
.vacio { text-align: center; padding: 32px 16px; color: var(--gris); }
.vacio h3 { color: var(--tinta); margin-bottom: 6px; }
.vacio .btn { margin-top: 14px; }

.cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .cifras { grid-template-columns: repeat(4, 1fr); } }
.cifra { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 14px; display: flex; flex-direction: column; gap: 2px; border: 0; text-align: left; cursor: pointer; }
.cifra .etq { font-size: 12.5px; color: var(--gris); font-weight: 700; }
.cifra .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.cifra .det { font-size: 12.5px; color: var(--gris); }
.cifra.alerta .val { color: var(--rojo); }
.cifra.ok .val { color: var(--esm-osc); }
.cifra.aviso { background: var(--tinta); color: #fff; }
.cifra.aviso .etq, .cifra.aviso .det { color: var(--menta); }

.lista { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.fila { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--linea); color: var(--tinta); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.fila:last-child { border-bottom: 0; }
.fila:hover { background: #FAFCFB; }
.fila .cuerpo { flex: 1; min-width: 0; }
.fila .t1 { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .t2 { font-size: 13px; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .der { text-align: right; flex-shrink: 0; }
.fila .monto { font-weight: 800; font-variant-numeric: tabular-nums; }
.inicial { width: 38px; height: 38px; border-radius: 12px; background: var(--menta-suave); color: var(--esm-osc); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #EEF1F0; color: var(--tinta-2); }
.chip.pendiente { background: var(--ambar-suave); color: var(--ambar); }
.chip.atrasada { background: var(--rojo-suave); color: var(--rojo); }
.chip.reportada { background: var(--azul-suave); color: var(--azul); }
.chip.pagada, .chip.vigente, .chip.enviado, .chip.aprobado, .chip.activo { background: var(--menta-suave); color: var(--esm-osc); }
.chip.simulado { background: #EEF1F0; color: var(--gris); }
.chip.fallido, .chip.rechazado, .chip.anulada, .chip.suspendido { background: var(--rojo-suave); color: var(--rojo); }
.chip.por_revisar { background: var(--azul-suave); color: var(--azul); }

/* La tira de cuotas: cada cuota es una hoja con la esquina doblada, como el logo. */
.tira { display: flex; flex-wrap: wrap; gap: 8px; }
.hoja {
  --c: #DDE5E1; --p: #C3CEC9;
  position: relative; width: 46px; height: 56px; border: 0; padding: 0; cursor: pointer; background: none;
  font-size: 11px; font-weight: 800; color: var(--tinta-2);
}
.hoja::before { content: ''; position: absolute; inset: 0; background: var(--c); clip-path: polygon(0 0, 68% 0, 100% 26%, 100% 100%, 0 100%); border-radius: 3px; }
.hoja::after { content: ''; position: absolute; top: 0; right: 0; width: 32%; height: 26%; background: var(--p); clip-path: polygon(0 0, 0 100%, 100% 100%); }
.hoja span { position: relative; z-index: 1; display: block; padding-top: 22px; }
.hoja.pagada { --c: var(--esm); --p: var(--menta); color: #fff; }
.hoja.pagada span { padding-top: 16px; }
.hoja.pagada span::before { content: ''; display: block; width: 14px; height: 8px; margin: 0 auto 2px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg); }
.hoja.atrasada { --c: var(--rojo-suave); --p: #F2B8A8; color: var(--rojo); }
.hoja.reportada { --c: var(--azul-suave); --p: #B9D5EA; color: var(--azul); }
.hoja.pendiente { --c: var(--papel); --p: #DDE5E1; box-shadow: none; }
.hoja.pendiente::before { background: #fff; outline: 1.5px solid var(--linea-2); outline-offset: -1.5px; }
.hoja.anulada { opacity: .4; }
.hoja.sel { transform: translateY(-3px); }
.hoja.sel::before { outline: 2.5px solid var(--tinta); outline-offset: -2.5px; }

/* ── Botones y formularios ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--esm); color: #fff; font-weight: 700; font-size: 15px; text-align: center;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--esm-osc); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 19px; height: 19px; }
.btn.sec { background: var(--papel); color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--linea-2); }
.btn.sec:hover { background: #F7FAF8; }
.btn.oscuro { background: var(--tinta); }
.btn.peligro { background: var(--papel); color: var(--rojo); box-shadow: inset 0 0 0 1.5px #EBC3B8; }
.btn.wa { background: #1E8E4E; }
.btn.chico { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.bloque-btn { width: 100%; }
.botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.botones .btn { flex: 1 1 auto; }
button.enlace { border: 0; background: none; color: var(--esm-osc); font-weight: 700; cursor: pointer; padding: 0; }

.form { display: grid; gap: 14px; }
.form .doble { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .form .doble { grid-template-columns: 1fr; } }
.campo { display: grid; gap: 6px; }
.campo > span { font-size: 13px; font-weight: 700; color: var(--tinta-2); }
.campo small { color: var(--gris); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--linea-2);
  background: var(--papel); font-size: 16px; font-weight: 500; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--gris) 50%), linear-gradient(135deg, var(--gris) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--esm); box-shadow: 0 0 0 3px var(--menta-suave); }
input[type=file] { font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--esm); }
.buscar { position: relative; margin-bottom: 12px; }
.buscar input { padding-left: 40px; }
.buscar svg { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; color: var(--gris-2); }

.pestanas { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas button { flex-shrink: 0; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--papel); box-shadow: inset 0 0 0 1.5px var(--linea); font-weight: 700; font-size: 13.5px; color: var(--tinta-2); cursor: pointer; }
.pestanas button.activa { background: var(--tinta); color: #fff; box-shadow: none; }
.pestanas .cuenta { margin-left: 4px; opacity: .7; }
@media (min-width: 900px) { .pestanas { margin: 0 0 14px; padding: 0; } }

.datos { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.datos dt { color: var(--gris); font-weight: 600; }
.datos dd { margin: 0; font-weight: 700; word-break: break-word; }

.cab-ficha { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.cab-ficha .inicial { width: 52px; height: 52px; border-radius: 16px; font-size: 20px; }
.cab-ficha h1 { font-size: 22px; }

.grid-2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.aviso-barra { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radio-s); background: var(--ambar-suave); color: #6E4300; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.aviso-barra.info { background: var(--azul-suave); color: #164766; }
.aviso-barra.ok { background: var(--menta-suave); color: var(--esm-osc); }
.aviso-barra svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.aviso-barra button { margin-left: auto; }

.mensaje { white-space: pre-wrap; overflow-wrap: anywhere; background: #F6F9F7; border-radius: var(--radio-s); padding: 12px; font-size: 13.5px; border: 1px solid var(--linea); }
.pie-nota { font-size: 12.5px; color: var(--gris); margin-top: 10px; }

/* Hoja inferior (modal) */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(11,31,26,.42); display: flex; align-items: flex-end; justify-content: center; animation: aparece .15s ease-out; }
.modal { background: var(--fondo); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); animation: sube .22s cubic-bezier(.2,.8,.2,1); }
.modal .asa { width: 42px; height: 5px; border-radius: 3px; background: var(--linea-2); margin: 4px auto 14px; }
.modal h2 { margin-bottom: 14px; }
@media (min-width: 700px) { .velo { align-items: center; } .modal { border-radius: 20px; padding-top: 20px; } .modal .asa { display: none; } }
@keyframes aparece { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(40px); opacity: .6; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-alto) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.2); max-width: calc(100% - 32px); animation: sube .2s ease-out; }
.toast.error { background: var(--rojo); }

.cargando { display: grid; place-items: center; padding: 60px 0; }
.cargando::after { content: ''; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--menta-suave); border-top-color: var(--esm); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.menu-mas .fila svg { width: 22px; height: 22px; color: var(--esm); flex-shrink: 0; }

/* Acceso (entrar y registro) */
.acceso { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.acceso .caja { width: 100%; max-width: 400px; }
.acceso .logo-gr { height: 40px; width: auto; margin: 0 auto 26px; }
.acceso h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.acceso .bajada { text-align: center; color: var(--gris); margin: 0 0 22px; }
.acceso .alterna { text-align: center; margin-top: 18px; font-size: 14px; color: var(--gris); }

/* Planes */
.planes { display: grid; gap: 12px; }
@media (min-width: 760px) { .planes { grid-template-columns: repeat(3, 1fr); } }
.plan { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; }
.plan.actual { border-color: var(--esm); }
.plan .precio { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.plan .precio small { font-size: 14px; color: var(--gris); font-weight: 600; }
.plan ul { margin: 6px 0 0; padding-left: 18px; color: var(--tinta-2); font-size: 14px; }

.metodo { background: var(--papel); border-radius: var(--radio-s); box-shadow: inset 0 0 0 1.5px var(--linea); padding: 12px 14px; }
.metodo + .metodo { margin-top: 10px; }
.metodo h3 { margin-bottom: 6px; }
.dato-copia { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--linea); font-size: 14px; }
.dato-copia:first-of-type { border-top: 0; }
.dato-copia .e { color: var(--gris); font-size: 12.5px; font-weight: 700; }
.dato-copia .v { font-weight: 700; word-break: break-all; }
.dato-copia button { border: 0; background: var(--menta-suave); color: var(--esm-osc); font-weight: 700; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }

.editor-metodo { background: var(--papel); border-radius: var(--radio-s); box-shadow: inset 0 0 0 1.5px var(--linea); padding: 12px; display: grid; gap: 8px; }
.editor-metodo + .editor-metodo { margin-top: 10px; }
.editor-metodo .par { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 6px; }
.btn-x { border: 0; background: none; color: var(--rojo); font-weight: 800; font-size: 18px; cursor: pointer; padding: 0 8px; }

.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; color: var(--gris); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--linea-2); white-space: nowrap; }
.tabla td { padding: 10px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla td.d { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.banda-admin { background: var(--tinta); color: #fff; font-size: 13.5px; padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.banda-admin button { border: 0; background: var(--menta); color: var(--tinta); font-weight: 800; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.banda-prueba { background: var(--ambar-suave); color: #6E4300; font-size: 12.5px; font-weight: 700; text-align: center; padding: 6px 12px; }

.comprobante-img { border-radius: var(--radio-s); border: 1px solid var(--linea); max-height: 60vh; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.rojo { color: var(--rojo) !important; }
.buscar-doble { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
.buscar-doble select { margin-bottom: 12px; }
@media (min-width: 640px) { .buscar-doble { grid-template-columns: 1fr 210px; } }
