/* Inter self-host (variable, latin subset — cubre acentos ES + €). Misma
   tipografía que factulens.es para que sea EL MISMO producto. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-var.woff2') format('woff2');
}

/* Paleta navy + teal de la marca (coherente con la landing). DARK-ONLY. */
:root {
  --bg: #06101F;
  --bg2: #081628;
  --card: #0B1E38;
  --card2: #102844;
  --line: #1C3350;
  --txt: #EAF2F9;
  --muted: #A9BBD0;
  --faint: #6E8199;
  --brand: #15C39A;
  --brand2: #2BD4AE;
  --brand-deep: #0C8E76;
  --good: #16A877;
  --warn: #FFB020;
  --bad: #FF6B57;
  --bad-deep: #C2391F;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--txt);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
.mono { font-family: var(--mono); }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }

/* ---------- utilidades ---------- */
.pad { padding: 20px; }
.center { display: flex; align-items: center; justify-content: center; }
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.spacer { height: 12px; }

/* ---------- botones ---------- */
button { font: inherit; cursor: pointer; border: none; border-radius: 14px; }
.btn { background: var(--brand); color: white; padding: 16px; font-size: 17px; font-weight: 700;
  width: 100%; border-radius: 16px; transition: transform .06s ease, filter .2s; }
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--card2); color: var(--txt); }
.btn.ghost { background: transparent; color: var(--brand2); box-shadow: none; font-weight: 600; }
.btn:disabled { filter: grayscale(.6) brightness(.7); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select { background: var(--bg2); border: 1px solid var(--line); color: var(--txt);
  padding: 15px; border-radius: 14px; font-size: 16px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); }

/* ---------- auth ---------- */
.auth { flex: 1; justify-content: center; }
.logo { font-size: 34px; font-weight: 800; letter-spacing: -.5px; }
.logo .dot { color: var(--brand); }
.tagline { color: var(--muted); font-size: 15px; margin-top: 6px; line-height: 1.4; }
.tabs { display: flex; background: var(--bg2); border-radius: 14px; padding: 4px; margin: 22px 0 18px; }
.tabs button { flex: 1; padding: 12px; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; }
.tabs button.active { background: var(--brand); color: white; }

/* ---------- consentimiento RGPD (checkboxes del alta) ---------- */
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; cursor: pointer;
  font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.consent input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--line); border-radius: 6px;
  background: var(--bg2); position: relative; transition: border-color .15s, background .15s; }
.consent input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
.consent input[type="checkbox"]:checked::after { content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #04121F; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.consent a { color: var(--brand2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- footer legal del auth ---------- */
.auth-foot { text-align: center; margin-top: 18px; }
.auth-foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; }
.auth-foot-links a { color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.auth-foot-links a:active { color: var(--brand2); }
.auth-foot-legal { margin-top: 8px; color: var(--faint); font-size: 10.5px; letter-spacing: .02em; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.topbar .who { font-size: 14px; color: var(--muted); }
.topbar .who b { color: var(--txt); }

/* ---------- hero previsión ---------- */
.hero { position: relative; margin: 8px 20px; overflow: hidden;
  background: linear-gradient(160deg, var(--card2) 0%, var(--card) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
/* aura sutil animada dentro del hero del dashboard (coherencia con la entrada) */
.hero::before { content: ''; position: absolute; top: -60%; right: -30%; width: 80%; height: 160%;
  background: radial-gradient(circle at 50% 50%, rgba(21,195,154,.28), transparent 65%);
  filter: blur(30px); pointer-events: none; animation: auroraFloat 16s ease-in-out infinite alternate; }
.hero > * { position: relative; z-index: 1; }
/* label del hero = registro de consola (mono, mayúsculas) — lenguaje de la landing */
.hero .lbl { color: var(--muted); font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; }
/* La CIFRA NUNCA en degradado (leería como revenue). Color liso semántico:
   deuda = rojo, a tu favor = verde, neutro = texto. */
.hero .big { font-size: 52px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 6px 0 2px;
  color: var(--txt); }
.hero .big.bad { color: var(--bad); }
.hero .big.good { color: var(--good); }
/* pill roja de vencimiento en el hero */
.due-pill { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 4px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px; background: rgba(255,107,87,.14); color: var(--bad);
  border: 1px solid rgba(255,107,87,.28); }
.due-pill.soft { background: rgba(255,176,32,.14); color: var(--warn); border-color: rgba(255,176,32,.28); }
.hero .sub { color: var(--muted); font-size: 14px; }
.hero .split { display: flex; gap: 12px; margin-top: 18px; }
.hero .split .box { flex: 1; background: rgba(255,255,255,.04); border-radius: 14px; padding: 12px 14px; }
.hero .split .box .n { font-size: 22px; font-weight: 800; }
.hero .split .box .t { font-size: 12px; color: var(--muted); }

.qbar { display: flex; gap: 6px; margin: 0 20px 4px; }
.qbar button { flex: 1; padding: 9px; border-radius: 10px; background: var(--bg2); color: var(--muted); font-weight: 700; font-size: 13px; border: 1px solid transparent; }
.qbar button.active { color: var(--txt); border-color: var(--brand); background: var(--card2); }

/* ---------- desglose ---------- */
.section-title { padding: 20px 20px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 800; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 0 20px 12px; overflow: hidden; }
.line { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: none; }
.line .l { display: flex; align-items: center; gap: 12px; }
.line .badge { width: 42px; text-align: center; font-weight: 800; font-size: 13px; background: var(--bg2); padding: 6px 0; border-radius: 8px; color: var(--brand2); }
.line .amt { font-weight: 700; }

/* ---------- avisos ---------- */
.aviso { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.aviso:last-child { border-bottom: none; }
.aviso .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.aviso.urgente .ic { background: rgba(255,107,87,.15); }
.aviso.aviso .ic { background: rgba(255,176,32,.15); }
.aviso.info .ic { background: rgba(21,195,154,.15); }
.aviso .tt { font-weight: 700; font-size: 15px; }
.aviso .dd { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.35; }

/* ---------- FAB / scan ---------- */
.fabwrap { position: sticky; bottom: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 55%, transparent); }
.fab { background: var(--brand); color: white; width: 100%; padding: 18px; border-radius: 18px; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 8px 24px rgba(21,195,154,.4); }
.fab:active { transform: scale(.97); }

/* ---------- scan result ---------- */
.scanwrap { flex: 1; }
.preview-img { width: 100%; max-height: 240px; object-fit: contain; background: var(--bg2); border-radius: 16px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.ok { background: rgba(22,168,119,.15); color: var(--good); }
.pill.rev { background: rgba(255,176,32,.15); color: var(--warn); }

/* ---------- toast / loading ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom));
  background: var(--card); border: 1px solid var(--line); color: var(--txt); padding: 12px 18px; border-radius: 14px;
  box-shadow: var(--shadow); z-index: 50; max-width: 90%; text-align: center; font-size: 14px; }
.overlay { position: fixed; inset: 0; background: rgba(6,10,20,.82); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; z-index: 60; backdrop-filter: blur(3px); }
.spinner { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--bad); font-size: 14px; margin-top: 6px; min-height: 18px; }

/* ---------- estado vacío ---------- */
.empty { text-align: center; color: var(--muted); padding: 30px 20px; line-height: 1.5; }
.empty .em { font-size: 40px; margin-bottom: 8px; }

/* ============================================================
   HERO animado (pantalla de entrada) — aurora + tarjeta 3D flotante
   ============================================================ */
.hero-screen { position: relative; flex: 1; display: flex; flex-direction: column;
  justify-content: flex-end; overflow: hidden; padding: 20px; padding-bottom: 26px; }
.aurora { position: absolute; inset: -30% -20% auto -20%; height: 90%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(45% 45% at 25% 30%, rgba(21,195,154,.55), transparent 70%),
    radial-gradient(40% 40% at 80% 20%, rgba(22,168,119,.35), transparent 70%),
    radial-gradient(50% 50% at 60% 60%, rgba(43,212,174,.35), transparent 70%);
  filter: blur(38px) saturate(1.3); animation: auroraFloat 14s ease-in-out infinite alternate; }
@keyframes auroraFloat {
  0%   { transform: translate3d(-4%, -2%, 0) scale(1.05) rotate(0deg); opacity: .85; }
  50%  { transform: translate3d(3%, 3%, 0) scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: translate3d(-2%, 5%, 0) scale(1.08) rotate(-4deg); opacity: .9; }
}
.hero-3d { position: relative; z-index: 1; perspective: 1100px; height: 44vh; min-height: 300px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.hero-card { position: relative; width: 84%; max-width: 320px; border-radius: 26px; padding: 22px;
  background: linear-gradient(160deg, rgba(16,40,68,.94) 0%, rgba(11,30,56,.94) 100%);
  border: 1px solid rgba(43,212,174,.16);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.10);
  transform-style: preserve-3d; will-change: transform;
  animation: cardFloat 7s ease-in-out infinite; transition: transform .12s ease-out; text-align: center; }
@keyframes cardFloat {
  0%,100% { transform: rotateX(6deg) rotateY(-9deg) translateY(0); }
  50%     { transform: rotateX(2deg) rotateY(-4deg) translateY(-12px); }
}
/* Gancho LEGAL (sin la cifra "396€" — eso solo vive en el dashboard tras login) */
.hero-card .hc-badge { display: inline-block; color: var(--faint); font-size: 10.5px; font-weight: 600;
  letter-spacing: .12em; transform: translateZ(30px); }
.lupa-hero { position: relative; display: block; width: 84px; height: 84px; margin: 14px auto 4px;
  border-radius: 20px; transform: translateZ(60px);
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.6), 0 0 0 1px rgba(43,212,174,.18); }
/* barrido "scan-line" sobre la lupa (respeta reduced-motion abajo) */
.lupa-hero::after { content: ''; position: absolute; left: 6%; right: 6%; top: 8%; height: 12%;
  border-radius: 8px; pointer-events: none;
  background: linear-gradient(180deg, rgba(43,212,174,0) 0%, rgba(43,212,174,.55) 50%, rgba(43,212,174,0) 100%);
  mix-blend-mode: screen; opacity: .9; animation: lupaScan 2.6s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes lupaScan {
  0%   { transform: translateY(0); opacity: 0; }
  15%  { opacity: .95; }
  85%  { opacity: .95; }
  100% { transform: translateY(560%); opacity: 0; }
}
.hero-card .hc-kicker { font-family: var(--mono); color: var(--bad); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; margin-top: 6px; transform: translateZ(45px); }
.hero-card .hc-title { font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12;
  margin: 8px 0 6px; color: var(--txt); transform: translateZ(55px); }
.hero-card .hc-sub { font-size: 13px; color: var(--muted); line-height: 1.5; transform: translateZ(20px); }
.hero-card .hc-fear { display: inline-block; margin-top: 16px; transform: translateZ(40px);
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 8px 14px; border-radius: 999px; color: var(--bad);
  background: rgba(255,107,87,.12); border: 1px solid rgba(255,107,87,.30); }
.hero-copy { position: relative; z-index: 1; text-align: center; margin-bottom: 4px; }
.hero-copy .logo { font-size: 30px; display: inline-flex; align-items: center; gap: 9px; }
.hero-copy .logo .lupa-mark { width: 26px; height: 26px; border-radius: 7px; }
.hero-copy .tagline { margin-top: 8px; }
/* wordmark: lupa 24px en la topbar del dashboard */
.topbar-lupa { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(43,212,174,.18); }
.topbar .brand { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   DOCK iOS (barra de botones al fondo, frosted glass)
   ============================================================ */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; max-width: 480px; margin: 0 auto;
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(8,22,40,.72); backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(0,0,0,.8); }
.tabbar-item { position: relative; flex: 1; min-width: 0; background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px;
  font-size: 10px; font-weight: 700; letter-spacing: .2px; transition: color .15s, transform .1s; border-radius: 12px; }
.tabbar-item svg { width: 25px; height: 25px; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.tabbar-item.active { color: var(--brand); }
.tabbar-item:active { transform: scale(.88); }
/* botón central prominente (acción primaria: escanear) — circular, teal elevado */
.tabbar-item.center { flex: 0 0 auto; margin-top: -22px; }
.tabbar-item.center .fab-btn { width: 60px; height: 60px; border-radius: 999px;
  background: linear-gradient(135deg, #22D3B0, #00B594); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(21,195,154,.4), inset 0 1px 0 rgba(255,255,255,.35); }
.tabbar-item.center .fab-btn svg { width: 28px; height: 28px; stroke-width: 2; }
.tabbar-item.center span { margin-top: 4px; }
.has-dock { padding-bottom: 96px; }

/* transición de vista tipo iOS */
.view-in { animation: viewIn .38s cubic-bezier(.22,1,.36,1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.994); } to { opacity: 1; transform: none; } }

/* ============================================================
   ONBOARDING (FE3) — tour de bienvenida de 3 pasos
   ============================================================ */
.onb { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.onb .aurora { opacity: .7; }
.onb-skip { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 18px; z-index: 3;
  background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 10px; }
.onb-track { display: flex; flex: 1; z-index: 1; transition: transform .42s cubic-bezier(.22,1,.36,1); }
.onb-slide { flex: 0 0 100%; min-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 34px; gap: 10px; }
.onb-emoji { font-size: 88px; line-height: 1; filter: drop-shadow(0 20px 40px rgba(21,195,154,.4));
  animation: cardFloat 5s ease-in-out infinite; }
.onb-title { font-size: 27px; font-weight: 850; letter-spacing: -.5px; margin-top: 10px; }
.onb-sub { color: var(--muted); font-size: 16px; line-height: 1.5; max-width: 300px; }
.onb-num { background: linear-gradient(120deg, var(--brand2), var(--good)); -webkit-background-clip: text;
  background-clip: text; color: transparent; font-weight: 800; font-size: 14px; letter-spacing: 2px; }
.onb-dots { display: flex; justify-content: center; gap: 8px; padding: 6px 0 2px; z-index: 1; }
.onb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: all .3s; }
.onb-dot.active { background: var(--brand); width: 24px; border-radius: 4px; }
.onb-actions { padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); z-index: 1; }

/* ============================================================
   MICRO-INTERACCIONES (FE1)
   ============================================================ */
/* spring en todos los botones al pulsar */
.btn, .fab, .tab, .qbar button, .tabbar-item, .line .badge { transition: transform .12s cubic-bezier(.34,1.56,.64,1), filter .2s, background .2s, color .2s, border-color .2s; }
.btn:active, .fab:active { transform: scale(.96); }
/* entrada escalonada de tarjetas dentro de una vista */
.view-in .card, .view-in .hero, .view-in .hucha, .view-in .qbar, .view-in .section-title { animation: cardUp .5s cubic-bezier(.22,1,.36,1) both; }
.view-in .hero { animation-delay: .02s; }
.view-in .qbar { animation-delay: .06s; }
.view-in .section-title:nth-of-type(1) { animation-delay: .10s; }
.view-in .card:nth-of-type(1) { animation-delay: .12s; }
.view-in .card:nth-of-type(2) { animation-delay: .18s; }
.view-in .card:nth-of-type(3) { animation-delay: .24s; }
@keyframes cardUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
/* cajas del hero: leve realce al tocar */
.hero .split .box { transition: transform .15s, background .2s; }
.hero .split .box:active { transform: translateY(-2px) scale(1.03); background: rgba(255,255,255,.08); }
/* líneas de tabla/movimientos: highlight al tocar */
.line { transition: background .18s; }
.card .line:active { background: rgba(255,255,255,.04); }
/* dock: rebote más iOS en el activo */
.tabbar-item.active svg { animation: pop .32s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* toast entra con spring */
.toast { animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.9); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
/* skeleton de carga (shimmer) */
.skeleton { position: relative; overflow: hidden; background: var(--card); border-radius: 16px; }
.skeleton::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
/* spinner con glow */
.spinner { box-shadow: 0 0 24px rgba(21,195,154,.35); }

@media (prefers-reduced-motion: reduce) {
  .aurora, .hero-card, .hero::before { animation: none !important; }
  .view-in, .view-in .card, .view-in .hero, .view-in .hucha, .view-in .qbar, .view-in .section-title,
  .tabbar-item.active svg, .toast, .skeleton::after, .hucha-pig { animation: none !important; }
}

/* La PWA es DARK-ONLY (como factulens.es). No hay tema claro ni conmutador:
   el toggle 🌙/☀️ era el tell #1 de "hecho por aficionado". */

/* ============================================================
   CONSOLA (lenguaje terminal de la landing) — usada en Cumplimiento
   ============================================================ */
.console { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--muted);
  background: #050D18; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin: 0 20px 12px; overflow-x: auto; }
.console .ln { white-space: nowrap; }
.console .ts { color: var(--good); }
.console .ok { color: var(--brand2); }
.console .warn { color: var(--warn); }

/* ============================================================
   WHATSAPP (vincular número + asistente)
   ============================================================ */
/* tarjeta de acceso desde el dashboard */
.wa-entry { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: var(--txt);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .2s; }
.wa-entry:active { transform: scale(.98); background: rgba(255,255,255,.04); }
.wa-entry-ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(37,211,102,.16);
  display: flex; align-items: center; justify-content: center; font-size: 23px; flex-shrink: 0; }
.wa-entry-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wa-entry-tx b { font-size: 15px; }
.wa-entry-tx span { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.wa-entry-arrow { color: var(--muted); font-size: 24px; font-weight: 400; line-height: 1; }

/* botón verde WhatsApp (deep link + vincular) */
.wa-open { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  background: #25D366; color: #fff; }
.wa-open:active { transform: scale(.97); }
.wa-open svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }

/* número del asistente, destacado */
.wa-num { font-size: 26px; font-weight: 850; letter-spacing: -.5px;
  background: linear-gradient(120deg, #25D366, #128C7E); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* punto de estado (vinculado) */
.wa-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--muted);
  box-shadow: 0 0 0 4px rgba(147,161,196,.14); flex-shrink: 0; }
.wa-dot.ok { background: var(--good); box-shadow: 0 0 0 4px rgba(22,168,119,.18); }

/* ============================================================
   ESCANEO DE GASTOS — CTA del dashboard, hoja de acción y preview PDF
   ============================================================ */
/* CTA principal (acción in-app, sin WhatsApp): destacada con acento de marca */
.scan-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: #fff;
  background: linear-gradient(150deg, var(--brand2), var(--brand)); border: none; border-radius: 18px;
  padding: 16px; margin-bottom: 10px; box-shadow: 0 10px 26px -8px rgba(21,195,154,.6);
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), filter .2s; }
.scan-cta:active { transform: scale(.98); filter: brightness(1.05); }
.scan-cta-ic { width: 48px; height: 48px; border-radius: 15px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 25px; flex-shrink: 0; }
.scan-cta-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.scan-cta-tx b { font-size: 16px; font-weight: 800; }
.scan-cta-tx span { font-size: 12.5px; color: rgba(255,255,255,.82); margin-top: 2px; line-height: 1.3; }
.scan-cta-arrow { color: rgba(255,255,255,.85); font-size: 26px; font-weight: 400; line-height: 1; }

/* hoja de acción inferior (bottom sheet) para elegir cámara / archivo */
.sheet-back { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(6,10,20,0); transition: background .22s ease; }
.sheet-back.open { background: rgba(6,10,20,.6); }
.sheet { background: var(--card); border-top-left-radius: 24px; border-top-right-radius: 24px;
  border-top: 1px solid var(--line); padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 40px -20px rgba(0,0,0,.7); max-width: 480px; margin: 0 auto; width: 100%;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22,1,.36,1); }
.sheet-back.open .sheet { transform: translateY(0); }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet-title { font-size: 19px; font-weight: 800; text-align: center; }
.sheet-sub { font-size: 13.5px; color: var(--muted); text-align: center; margin: 4px 0 16px; line-height: 1.4; }
.sheet-opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: var(--txt);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .2s; }
.sheet-opt:active { transform: scale(.98); background: var(--card2); }
.sheet-opt-ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(21,195,154,.16);
  display: flex; align-items: center; justify-content: center; font-size: 23px; flex-shrink: 0; }
.sheet-opt-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sheet-opt-tx b { font-size: 15px; }
.sheet-opt-tx span { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.sheet-opt-arrow { color: var(--muted); font-size: 24px; line-height: 1; }
.sheet-cancel { margin-top: 2px; }

/* preview de un PDF subido (no se puede pintar en <img>) */
.preview-pdf { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.preview-pdf-ic { font-size: 34px; line-height: 1; flex-shrink: 0; }
.preview-pdf-nm { font-size: 14px; font-weight: 700; color: var(--txt); word-break: break-word; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-back, .scan-cta { transition: none !important; }
}

/* ============================================================
   HUCHA FISCAL — cuánto apartar por semana + cuenta atrás
   ============================================================ */
.hucha { position: relative; margin: 8px 20px 12px; overflow: hidden;
  background: linear-gradient(150deg, rgba(22,168,119,.14), rgba(21,195,154,.09));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.hucha-top { display: flex; align-items: center; gap: 14px; }
.hucha-pig { font-size: 42px; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 10px 22px rgba(22,168,119,.35)); animation: huchaBob 4s ease-in-out infinite; }
@keyframes huchaBob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
.hucha-tx { flex: 1; min-width: 0; }
.hucha-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.hucha-head { font-size: 17px; font-weight: 850; letter-spacing: -.3px; }
.hucha-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--txt); }
.hucha-big small { font-size: 15px; font-weight: 700; color: var(--muted); }
.hucha-bar { margin-top: 14px; height: 10px; border-radius: 999px; background: rgba(127,127,127,.20); overflow: hidden; }
.hucha-bar > span { display: block; height: 100%; border-radius: 999px; min-width: 6px;
  background: linear-gradient(90deg, var(--good), var(--brand)); transition: width .8s cubic-bezier(.22,1,.36,1); }
.hucha-count { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.hucha-dias { font-weight: 800; color: var(--txt); }
.hucha-dl { text-align: right; margin-top: 2px; }
.hucha-ok { display: flex; align-items: center; gap: 14px; }

/* ============================================================
   CELEBRACIÓN IVA — delta animado al guardar un gasto
   ============================================================ */
.iva-cel-back { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(6,10,20,0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
  transition: background .25s ease, backdrop-filter .25s ease; }
.iva-cel-back.open { background: rgba(6,10,20,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.iva-cel { width: 82%; max-width: 320px; text-align: center; padding: 28px 22px;
  background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); transform: scale(.86); opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s; }
.iva-cel-back.open .iva-cel { transform: scale(1); opacity: 1; }
.iva-cel-emoji { line-height: 1; margin-bottom: 8px; animation: cardFloat 5s ease-in-out infinite; }
.iva-cel-emoji svg { width: 52px; height: 52px; }
.iva-cel-lbl { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; }
.iva-cel-num { font-size: 46px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 6px 0; color: var(--txt); }
.iva-cel-num.good { color: var(--good); }
.iva-cel-delta { display: inline-block; margin-top: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 14px;
  animation: pop .5s cubic-bezier(.34,1.56,.64,1) both; }
.iva-cel-delta.good { background: rgba(22,168,119,.16); color: var(--good); }
.iva-cel-delta.up { background: rgba(255,176,32,.16); color: var(--warn); }
.iva-cel-foot { margin-top: 14px; color: var(--good); font-weight: 700; font-size: 14px; }

/* ============================================================
   INVITA Y GANA (referidos) — entrada + pantalla
   ============================================================ */
.ref-entry { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: var(--txt);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .2s; }
.ref-entry:active { transform: scale(.98); background: rgba(255,255,255,.04); }
.ref-entry-ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,176,32,.16);
  display: flex; align-items: center; justify-content: center; font-size: 23px; flex-shrink: 0; }
.ref-entry-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ref-entry-tx b { font-size: 15px; }
.ref-entry-tx span { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.ref-entry-arrow { color: var(--muted); font-size: 24px; font-weight: 400; line-height: 1; }
.ref-code { font-size: 26px; font-weight: 850; letter-spacing: 2px; word-break: break-all;
  background: linear-gradient(120deg, var(--brand2), var(--good)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ref-stats { display: flex; gap: 12px; margin-top: 16px; }
.ref-stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.ref-stat .n { font-size: 26px; font-weight: 850; color: var(--txt); }
.ref-stat .t { font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .iva-cel-back, .iva-cel, .iva-cel-emoji, .iva-cel-delta, .hucha-pig, .hucha-bar > span { transition: none !important; animation: none !important; }
  .lupa-hero::after { animation: none !important; opacity: 0 !important; }
}

/* ============================================================
   ICONOS SVG DE LÍNEA — sustituyen a TODOS los emojis funcionales.
   stroke 1.5 · currentColor. Cero emojis como iconos (tell de aficionado).
   ============================================================ */
svg.ic { display: inline-block; vertical-align: middle; width: 22px; height: 22px; fill: none;
  stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* chips redondos: el icono hereda el acento del chip */
.aviso .ic svg.ic { width: 20px; height: 20px; color: var(--muted); }
.aviso.urgente .ic svg.ic { color: var(--bad); }
.aviso.aviso .ic svg.ic { color: var(--warn); }
.aviso.info .ic svg.ic { color: var(--brand); }
.scan-cta-ic svg.ic { width: 24px; height: 24px; color: #fff; }
.wa-entry-ic svg.ic { color: #25D366; }
.ref-entry-ic svg.ic { color: var(--warn); }
.sheet-opt-ic svg.ic { color: var(--brand); }
.preview-pdf-ic svg.ic { width: 30px; height: 30px; color: var(--brand2); }
.empty .em svg.ic { width: 40px; height: 40px; color: var(--faint); }
/* glifo pequeño inline con texto (títulos de página, botones ghost) */
svg.ic.ttl-ic { width: 18px; height: 18px; color: var(--brand); vertical-align: -3px; margin-right: 7px; }
/* ilustración destacada de las pantallas hero secundarias (WhatsApp / referidos) */
.feat-icon svg.ic { width: 46px; height: 46px; color: var(--brand2); margin: 0 auto 6px; display: block; }
/* lista de features de un plan */
.feat-li { display: flex; align-items: center; gap: 8px; }
.feat-li svg.ic { width: 16px; height: 16px; color: var(--good); flex-shrink: 0; }
/* hucha: euro/estado en vez de emoji cerdito */
.hucha-pig { width: 42px; height: 42px; flex-shrink: 0; color: var(--brand2);
  filter: drop-shadow(0 10px 22px rgba(21,195,154,.30)); animation: huchaBob 4s ease-in-out infinite; }
.hucha-pig svg.ic { width: 100%; height: 100%; }
/* onboarding: ilustración de línea grande */
.onb-emoji svg.ic { width: 88px; height: 88px; color: var(--brand2); stroke-width: 1.4;
  filter: drop-shadow(0 20px 40px rgba(21,195,154,.35)); }
/* botón guardar / fab / botones con icono */
.fab svg.ic, .btn svg.ic { width: 20px; height: 20px; vertical-align: -4px; }
/* filas de movimientos / listas: color carrier */
.mov-ic { display: inline-flex; flex-shrink: 0; }
.pill svg.ic { width: 15px; height: 15px; }
.iva-cel-delta svg.ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
