/* Rumbo — estilos */
:root {
  --bg: #f3f5f4; --card: #fff; --ink: #0f1a17; --muted: #66756f; --line: #e3e8e6; --soft: #eef2f0;
  --brand: #0e7c66; --brand-soft: #e1f2ec;
  --ing: #10935a; --gas: #d9434b; --aho: #3b5bdb; --gus: #e09a12; --nec: #0e7c66;
  --r: 22px;
  --shadow: 0 1px 2px rgba(15, 26, 23, .04), 0 8px 24px rgba(15, 26, 23, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --rebote: cubic-bezier(.3, 1.35, .5, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a100e; --card: #131b18; --ink: #e7eeeb; --muted: #8b9a94; --line: #22302b; --soft: #1a2420;
    --brand: #1aa386; --brand-soft: #12302a;
    --ing: #34c27f; --gas: #f06a70; --aho: #7a95ff; --gus: #f2b33d; --nec: #1aa386;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100dvh; overscroll-behavior-y: none;
}
body.bloq { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h3 { font-size: 16px; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
small.muted { font-size: 13px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Splash y logo ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; transition: opacity .45s var(--ease); }
.splash svg { width: 72px; height: 72px; animation: latido 1.1s var(--ease) infinite alternate; }
.splash.fuera { opacity: 0; pointer-events: none; }
@keyframes latido { from { transform: scale(.94); } to { transform: scale(1.04); } }
.trazo { stroke-dasharray: 60; stroke-dashoffset: 60; animation: trazar .9s var(--ease) .25s forwards; }
.trazo.t2 { animation-delay: .85s; }
@keyframes trazar { to { stroke-dashoffset: 0; } }

/* ---------- Acceso ---------- */
.auth {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 26px;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  max-width: 440px; margin: 0 auto; animation: sube .6s var(--ease) both;
}
.auth-brand { text-align: center; }
.auth-brand .logo { width: 76px; height: 76px; filter: drop-shadow(0 14px 24px rgba(14, 124, 102, .35)); }
.auth-brand h1 { font-size: 34px; letter-spacing: -.035em; margin-top: 14px; }
.auth-brand p { color: var(--muted); margin: 6px auto 0; max-width: 320px; }
.auth-card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth-err { color: var(--gas); font-size: 13px; min-height: 1.2em; margin: -4px 0; }
.auth-nota { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
#campoNombre { animation: sube .35s var(--ease); }

/* ---------- Campos ---------- */
.campo { display: grid; gap: 6px; }
.campo > span { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.campo > span b { color: var(--brand); }
.campo input, .campo select, .input-pre {
  height: 48px; width: 100%; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg);
  padding: 0 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.campo input:focus, .campo select:focus, .input-pre:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--card); }
.campo input[type=range] { height: 28px; border: 0; padding: 0; background: none; box-shadow: none; accent-color: var(--brand); }
.campo small { font-size: 12px; }
.input-pre { display: flex; align-items: center; gap: 6px; }
.input-pre i { font-style: normal; color: var(--muted); }
.input-pre input { border: 0 !important; height: 100%; padding: 0; background: none !important; box-shadow: none !important; }

/* ---------- Botones ---------- */
.btn {
  height: 50px; width: 100%; border-radius: 15px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 20px; position: relative; transition: transform .15s var(--ease), opacity .2s, background-color .3s, color .3s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -8px var(--brand); }
.btn.sec { background: var(--brand-soft); color: var(--brand); width: auto; flex: none; }
.btn.peligro { background: var(--gas); color: #fff; }
.btn.ghost { background: none; color: var(--gas); height: 42px; font-size: 14px; }
.btn.ghost.confirmar { background: color-mix(in srgb, var(--gas) 12%, transparent); }
.btn.sm { height: 42px; width: auto; font-size: 14px; }
.btn.cargando { color: transparent !important; }
.btn.cargando::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: gira .7s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
.link { color: var(--brand); font-weight: 600; font-size: 14px; transition: opacity .2s; }
.link:active { opacity: .6; }

/* ---------- Control segmentado (píldora que se desliza) ---------- */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 14px; padding: 4px; --k: 0; }
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: 10px;
  background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 10px rgba(0, 0, 0, .04);
  transform: translateX(calc(var(--k) * 100%)); transition: transform .42s var(--rebote), background-color .3s;
}
.seg button { position: relative; z-index: 1; height: 38px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .25s; }
.seg button.on { color: var(--ink); }
.seg.seg4 button { font-size: 13px; }

/* ---------- Estructura de la app ---------- */
#app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(112px + env(safe-area-inset-bottom)); }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
}
.top-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-l small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.top-l b { display: block; font-size: 19px; letter-spacing: -.02em; line-height: 1.25; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 12px; background: linear-gradient(135deg, #17a887, #0b5446); color: #fff; display: grid; place-items: center; font-weight: 700; }
.mes { display: flex; align-items: center; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); height: 38px; flex: none; }
.mes button { width: 32px; height: 38px; font-size: 20px; color: var(--muted); transition: transform .15s var(--ease), opacity .2s; }
.mes button:active { transform: scale(.8); }
.mes button:disabled { opacity: .25; }
.mes span { font-size: 13px; font-weight: 650; min-width: 98px; text-align: center; }

.vista { display: grid; gap: 14px; padding-top: 6px; }
.vista > * { animation: sube .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.vista[data-dir=l] > * { animation-name: desdeIzq; }
.vista[data-dir=r] > * { animation-name: desdeDer; }
.vista[data-dir=x] > * { animation: none; }
@keyframes sube { from { opacity: 0; transform: translateY(12px); } }
@keyframes desdeIzq { from { opacity: 0; transform: translateX(-20px); } }
@keyframes desdeDer { from { opacity: 0; transform: translateX(20px); } }

.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.seccion { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 4px -6px; font-weight: 650; }
.aviso { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 20px 8px; }

/* ---------- Tarjeta principal ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 20px 20px 16px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .18), transparent 55%), linear-gradient(140deg, #14a083 0%, #0b5446 100%);
  box-shadow: 0 18px 40px -18px rgba(11, 84, 70, .6);
}
.hero::after { content: ""; position: absolute; width: 230px; height: 230px; right: -80px; bottom: -120px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.hero-l { font-size: 13px; opacity: .85; }
.hero-monto { font-size: 40px; font-weight: 750; letter-spacing: -.035em; margin: 2px 0 2px; line-height: 1.15; }
.hero-monto.neg { color: #ffd2d4; }
.hero-sub { font-size: 12px; opacity: .7; margin-bottom: 14px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .15); }
.hero-stats small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .85; }
.hero-stats small i { width: 7px; height: 7px; border-radius: 50%; }
.hero-stats b { font-size: 15px; font-weight: 650; }
.hero-acc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; position: relative; z-index: 1; }
.hero-acc button {
  height: 42px; border-radius: 13px; background: rgba(255, 255, 255, .15); color: #fff; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .2s, transform .15s var(--ease);
}
.hero-acc button:active { transform: scale(.94); background: rgba(255, 255, 255, .26); }
.hero-acc i { font-style: normal; font-size: 17px; line-height: 1; }
.p-ing { background: #7ef0b6; } .p-gas { background: #ffb3b7; } .p-aho { background: #b9c8ff; }

/* ---------- Salud financiera ---------- */
.salud { display: flex; align-items: center; gap: 18px; }
.anillo { position: relative; flex: none; }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 10; }
.anillo-bg { stroke: var(--soft); }
.anillo-v { stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease) .1s; }
.anillo-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anillo-c b { font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.anillo-c small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpis { display: grid; gap: 11px; flex: 1; min-width: 0; }
.kpi { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi span { font-size: 13px; color: var(--muted); line-height: 1.25; }
.kpi span em { display: block; font-style: normal; font-size: 11px; opacity: .8; }
.kpi b { font-size: 16px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.kpi b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.kpi.ok b::before { background: var(--ing); } .kpi.mid b::before { background: var(--gus); } .kpi.bad b::before { background: var(--gas); }
.tag { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--ing) 14%, transparent); color: var(--ing); }
.tag.mid { background: color-mix(in srgb, var(--gus) 16%, transparent); color: #b87b00; }
.tag.bad { background: color-mix(in srgb, var(--gas) 14%, transparent); color: var(--gas); }
@media (prefers-color-scheme: dark) { .tag.mid { color: var(--gus); } }
.nota { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- 50/30/20 ---------- */
.b532 { position: relative; display: flex; height: 14px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.b532 span { width: 0; transition: width 1s var(--ease); }
.b532 span + span { box-shadow: -2px 0 0 var(--card); }
.b532 span:nth-child(2) { transition-delay: .12s; } .b532 span:nth-child(3) { transition-delay: .24s; }
.b532 i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: .35; }
.s-nec { background: var(--nec); } .s-gus { background: var(--gus); } .s-aho { background: var(--aho); }
.b532-ejes { position: relative; height: 16px; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.b532-ejes span { position: absolute; transform: translateX(-50%); }
.leyenda { list-style: none; padding: 0; display: grid; gap: 9px; margin-top: 10px; }
.leyenda li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.leyenda li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.leyenda li span { flex: 1; }
.leyenda li small { color: var(--muted); font-size: 12px; width: 76px; text-align: right; }
.leyenda li b { width: 44px; text-align: right; }
.leyenda li.mal b { color: var(--gas); }

/* ---------- Recomendaciones ---------- */
.rec { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.rec:first-of-type { border-top: 0; padding-top: 0; }
.rec:last-child { padding-bottom: 0; }
.rec-i { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--soft); }
.r-alerta .rec-i { background: color-mix(in srgb, var(--gas) 13%, transparent); }
.r-meta .rec-i { background: color-mix(in srgb, var(--gus) 16%, transparent); }
.r-logro .rec-i { background: color-mix(in srgb, var(--ing) 14%, transparent); }
.r-info .rec-i { background: color-mix(in srgb, var(--aho) 13%, transparent); }
.rec b { font-size: 14.5px; display: block; line-height: 1.3; }
.rec p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.rec small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; font-style: italic; opacity: .9; }

/* ---------- Categorías ---------- */
.cat { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.cat-i { width: 36px; height: 36px; border-radius: 11px; background: var(--soft); display: grid; place-items: center; font-size: 17px; flex: none; }
.cat-b { flex: 1; min-width: 0; }
.cat-t { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.cat-bar { height: 6px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.cat-bar span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .9s var(--ease); }
.cat-bar .nec { background: var(--nec); } .cat-bar .gus { background: var(--gus); }
.cat-p { width: 34px; text-align: right; color: var(--muted); font-size: 12px; }

/* ---------- Tendencia ---------- */
.tend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.tend-c { display: grid; justify-items: center; gap: 8px; padding: 8px 0 6px; border-radius: 12px; transition: background-color .25s; }
.tend-c.on { background: var(--soft); }
.tend-c:active { transform: scale(.96); }
.tend-b { height: 104px; display: flex; align-items: flex-end; gap: 4px; }
.tend-b span { width: 11px; height: 0; border-radius: 5px; transition: height .9s var(--ease); }
.tend-c small { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.tend-c.on small { color: var(--ink); font-weight: 650; }
.b-ing { background: var(--ing); } .b-gas { background: var(--gas); }
.tend-ley { display: flex; gap: 16px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.tend-ley i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; }

/* ---------- Movimientos ---------- */
.lista { display: grid; }
.card .lista { margin: 0 -10px -8px; }
.card.lista { padding: 6px; }
.mov { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: 14px; transition: background-color .2s, transform .15s var(--ease); }
.mov:active { background: var(--soft); transform: scale(.985); }
.mov.nuevo { animation: destello 1.6s var(--ease); }
@keyframes destello { 0%, 30% { background: var(--brand-soft); } 100% { background: transparent; } }
.mov-i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--soft); }
.mov-i.t-ingreso { background: color-mix(in srgb, var(--ing) 13%, transparent); }
.mov-i.t-ahorro { background: color-mix(in srgb, var(--aho) 13%, transparent); }
.mov-t { flex: 1; min-width: 0; }
.mov-t b { display: block; font-size: 14.5px; font-weight: 600; }
.mov-t small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-m { font-weight: 650; font-size: 15px; white-space: nowrap; }
.mov-m.t-ingreso { color: var(--ing); } .mov-m.t-ahorro { color: var(--aho); }

.filtros { display: grid; gap: 10px; }
.buscar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.buscar input { flex: 1; border: 0; outline: 0; background: none; height: 100%; min-width: 0; }
.buscar svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; flex: none; }
.resumen-movs { display: flex; justify-content: space-between; padding: 0 6px; font-size: 13px; color: var(--muted); }
.resumen-movs b { color: var(--ink); }
#lista { display: grid; gap: 14px; }
.dia { display: grid; gap: 6px; animation: sube .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.dia-h { display: flex; justify-content: space-between; padding: 0 6px; font-size: 13px; font-weight: 650; color: var(--muted); }
.vacio { text-align: center; padding: 36px 20px; display: grid; justify-items: center; gap: 6px; }
.vacio-i { font-size: 44px; animation: flota 3s ease-in-out infinite; }
@keyframes flota { 50% { transform: translateY(-6px); } }
.vacio p { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* ---------- Plan ---------- */
.plan-h { display: flex; align-items: center; gap: 16px; }
.plan-h h3 { font-size: 20px; letter-spacing: -.02em; }
.plan-h p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.plan-h .anillo-c b { font-size: 26px; }
.regla { border-top: 1px solid var(--line); padding: 13px 0; }
.regla:first-child { border-top: 0; padding-top: 0; }
.regla:last-child { padding-bottom: 0; }
.regla summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.regla summary::-webkit-details-marker { display: none; }
.regla-t { flex: 1; min-width: 0; }
.regla-t b { display: block; font-size: 14.5px; }
.regla-t small { display: block; font-size: 12.5px; color: var(--muted); }
.regla-bar { height: 6px; background: var(--soft); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.regla-bar span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 1s var(--ease); }
.regla-chev { color: var(--muted); font-size: 20px; transition: transform .3s var(--ease); }
.regla[open] .regla-chev { transform: rotate(90deg); }
.regla p { font-size: 13.5px; color: var(--muted); margin-top: 10px; animation: sube .35s var(--ease); }
.regla > small { display: block; font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 6px; }
.fv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.fv div { background: var(--soft); border-radius: 14px; padding: 12px; }
.fv small { font-size: 12px; color: var(--muted); }
.fv b { display: block; font-size: 18px; letter-spacing: -.02em; }
.p-ok { background: var(--ing); } .p-mid { background: var(--gus); } .p-bad { background: var(--gas); }

/* ---------- Bienvenida ---------- */
.bienvenida h3 { font-size: 18px; }
.bienvenida p { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.bienvenida ol { padding-left: 20px; display: grid; gap: 6px; font-size: 14px; margin-bottom: 16px; }

/* ---------- Ajustes ---------- */
.card > .campo + .campo { margin-top: 14px; }
.card > .btn { margin-top: 16px; }
.regalo { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--brand-soft), var(--card) 80%); }
.regalo div { flex: 1; }
.regalo p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.opciones { padding: 6px; }
.opcion { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border-radius: 14px; font-weight: 550; text-align: left; transition: background-color .2s; }
.opcion:active { background: var(--soft); }
.opcion.peligro { color: var(--gas); }
.eliminar { padding: 4px 12px 12px; display: grid; gap: 10px; animation: sube .3s var(--ease); }
.eliminar p { font-size: 13px; color: var(--muted); }
.eliminar input { height: 46px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 14px; outline: none; }

/* ---------- Barra inferior ---------- */
.nav {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 24px), 496px); height: 66px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px);
  border-radius: 22px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .25), 0 0 0 1px var(--line); z-index: 10;
}
.nav button { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); transition: color .25s; }
.nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--rebote); }
.nav button.on { color: var(--brand); }
.nav button.on svg { transform: translateY(-1px) scale(1.1); }
.nav button:active svg { transform: scale(.86); }
.nav .fab {
  width: 56px; height: 56px; margin: auto; border-radius: 18px; color: #fff; display: grid; place-items: center;
  background: linear-gradient(140deg, #17a887, #0b5446); box-shadow: 0 10px 22px -8px rgba(11, 84, 70, .8);
  transform: translateY(-14px); transition: transform .2s var(--ease);
}
.nav .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
.nav .fab:active { transform: translateY(-14px) scale(.9); }
body.bloq .nav .fab svg { transform: rotate(45deg); }

/* ---------- Hoja para registrar ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(5, 12, 10, .45); opacity: 0; transition: opacity .35s var(--ease); }
.sheet-panel {
  --c: var(--gas);
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px; max-height: 94dvh; overflow-y: auto;
  background: var(--card); border-radius: 28px 28px 0 0; padding: 0 18px calc(14px + env(safe-area-inset-bottom));
  display: grid; gap: 12px; transform: translateY(105%); transition: transform .48s var(--spring); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
}
.sheet.abierta .sheet-bg { opacity: 1; }
.sheet.abierta .sheet-panel { transform: none; }
.sheet-panel[data-tipo=ingreso] { --c: var(--ing); }
.sheet-panel[data-tipo=ahorro] { --c: var(--aho); }
.grab { height: 26px; display: grid; place-items: center; touch-action: none; cursor: grab; margin: 0 -18px -6px; }
.grab::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
#segTipo .seg-pill { background: var(--c); }
#segTipo button.on { color: #fff; }
.monto { font-size: 46px; font-weight: 750; letter-spacing: -.04em; text-align: center; line-height: 1.1; padding-top: 4px; transition: color .3s; }
.monto .cur { font-size: .52em; color: var(--muted); margin-right: 4px; vertical-align: .38em; font-weight: 600; }
.monto.cero { color: var(--muted); }
.monto.tick { animation: tick .22s var(--ease); }
@keyframes tick { 40% { transform: scale(1.05); } }
.ayuda { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.chips {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 74px; gap: 8px;
  overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -18px; padding: 2px 18px 4px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 26px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: grid; justify-items: center; align-content: start; gap: 4px; padding: 9px 3px 8px; border-radius: 15px; background: var(--soft);
  font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.15; text-align: center; scroll-snap-align: start;
  border: 1.5px solid transparent; transition: transform .15s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.chip span { font-size: 21px; line-height: 1; }
.chip:active { transform: scale(.92); }
.chip.on { background: color-mix(in srgb, var(--c) 10%, var(--card)); border-color: var(--c); color: var(--ink); animation: pop .32s var(--rebote); }
@keyframes pop { 50% { transform: scale(1.08); } }
.fila2 { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.fila2 input { height: 44px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 12px; outline: none; min-width: 0; transition: border-color .2s; }
.fila2 input:focus { border-color: var(--c); }
.fila2 input[type=date] { width: 148px; font-size: 14px; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.teclado button { height: 50px; border-radius: 14px; font-size: 22px; font-weight: 550; background: var(--soft); transition: transform .1s var(--ease), background-color .15s; }
.teclado button:active { transform: scale(.93); background: var(--line); }
#mGuardar { background: var(--c); color: #fff; box-shadow: 0 8px 18px -8px var(--c); }
@media (max-height: 700px) { .teclado button { height: 44px; } .monto { font-size: 40px; } }

.sacude { animation: sacude .4s; }
@keyframes sacude { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -150%); opacity: 0;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 16px; max-width: calc(100% - 32px);
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4);
  z-index: 40; transition: transform .45s var(--spring), opacity .3s;
}
.toast.ver { transform: translate(-50%, 0); opacity: 1; }
.toast svg { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--ing); padding: 4px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.toast svg path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.toast.ver svg path { animation: trazar .4s var(--ease) .15s forwards; }
.toast .x { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--gas); color: #fff; display: grid; place-items: center; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
