/* Cartera — estilo iOS: fondo agrupado, tarjetas, títulos grandes y vidrio esmerilado. */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card2: #f2f2f7;
  --fill: rgba(118, 118, 128, 0.12);
  --fill2: rgba(118, 118, 128, 0.2);
  --ink: #0b0b0b;
  --ink2: #52514e;
  --ink3: #8a8a8e;
  --line: rgba(60, 60, 67, 0.13);
  --glass: rgba(249, 249, 249, 0.78);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 120, 214, 0.12);

  /* Serie categórica validada (orden fijo). */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  /* Estados: reservados para prioridad, siempre con texto. */
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
  --pos: #0b7f3a; --neg: #c0322f;

  --hero: linear-gradient(140deg, #0b1630 0%, #13306b 55%, #2a78d6 120%);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --r: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card2: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill2: rgba(118, 118, 128, 0.36);
    --ink: #f2f2f7;
    --ink2: #c3c2b7;
    --ink3: #8d8d93;
    --line: rgba(84, 84, 88, 0.5);
    --glass: rgba(22, 22, 24, 0.78);
    --accent: #3d8ff0;
    --accent-soft: rgba(61, 143, 240, 0.18);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --pos: #3ccf74; --neg: #ff6b66;
    --hero: linear-gradient(140deg, #0a1124 0%, #12295c 55%, #2465b8 125%);
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ── Bloqueo ─────────────────────────────────────────────────────────────── */
.lock {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--hero);
  color: #fff;
  padding: calc(var(--safe-t) + 24px) 16px calc(var(--safe-b) + 24px);
}
.lock-inner { width: min(320px, 100%); text-align: center; }
.lock-logo img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.lock h1 { font-size: 20px; font-weight: 600; margin: 18px 0 4px; }
.lock-sub { min-height: 20px; margin: 0 0 18px; font-size: 14px; color: rgba(255, 255, 255, .75); }
.dots { display: flex; gap: 16px; justify-content: center; height: 16px; margin-bottom: 38px; }
.dot-pin { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; transition: background .12s; }
.dot-pin.on { background: #fff; }
.dots.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; justify-content: center; }
.pad button {
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 32px; font-weight: 400; line-height: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background .15s;
}
.pad button small { font-size: 10px; letter-spacing: .14em; font-weight: 600; margin-top: 2px; opacity: .85; }
.pad button:active { background: rgba(255, 255, 255, .42); }
.pad .pad-text { background: none; font-size: 16px; backdrop-filter: none; }
.pad .pad-text:active { background: rgba(255, 255, 255, .12); }

/* ── Estructura ──────────────────────────────────────────────────────────── */
.app { min-height: 100%; }
.main { padding: calc(var(--safe-t) + 8px) 16px calc(var(--safe-b) + 96px); }
.view { max-width: 1040px; margin: 0 auto; animation: viewIn .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.side { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(var(--safe-b) + 4px);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--ink3); font-size: 10.5px; font-weight: 500; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--accent); }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    padding: 22px 12px 16px;
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-right: 0.5px solid var(--line);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; padding: 0 10px 22px; }
  .side-brand img { width: 30px; height: 30px; border-radius: 8px; }
  .side-item {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 9px 10px; border-radius: 10px; font-size: 15px; font-weight: 500; color: var(--ink);
  }
  .side-item svg { width: 20px; height: 20px; color: var(--accent); }
  .side-item:hover { background: var(--fill); }
  .side-item.on { background: var(--accent); color: var(--accent-ink); }
  .side-item.on svg { color: var(--accent-ink); }
  .side-item .badge { margin-left: auto; }
  .side-foot { margin-top: auto; }
  .main { padding: 28px 36px 48px; }
}

/* ── Encabezado ──────────────────────────────────────────────────────────── */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 4px 14px; }
.head h1 { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.head p { margin: 4px 0 0; color: var(--ink3); font-size: 15px; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; margin: 4px 0 -6px -4px; }
.back svg { width: 22px; height: 22px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fill); color: var(--accent);
  transition: transform .12s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.solid { background: var(--accent); color: var(--accent-ink); }
.icon-btn:active { transform: scale(.92); }

/* ── Mes ─────────────────────────────────────────────────────────────────── */
.month {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 14px; padding: 4px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.month button { width: 40px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); }
.month button:active { background: var(--fill); }
.month button svg { width: 20px; height: 20px; }
.month span { font-weight: 600; font-size: 16px; text-transform: capitalize; }

/* ── Tarjetas ────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .span2 { grid-column: 1 / -1; }
}
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink3); margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 a, .link { color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; cursor: pointer; }
.section-title { font-size: 20px; font-weight: 700; margin: 22px 4px 10px; display: flex; align-items: center; justify-content: space-between; }

.hero {
  background: var(--hero); color: #fff;
  border-radius: 22px; padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: 0 14px 40px rgba(19, 48, 107, .28);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%);
  pointer-events: none;
}
.hero .label { font-size: 14px; color: rgba(255, 255, 255, .78); font-weight: 500; }
.hero .big { font-size: 42px; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0 8px; line-height: 1.05; }
.hero .big small { font-size: .5em; font-weight: 600; opacity: .8; }
.hero .chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .16); }
.hero-row div { min-width: 0; }
.hero-row span { display: block; font-size: 12px; color: rgba(255, 255, 255, .72); }
.hero-row b { display: block; font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-row button { color: inherit; text-align: left; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card2); border-radius: 12px; padding: 10px 12px; min-width: 0; text-align: left; }
.stat span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.stat b { display: block; font-size: clamp(14px, 4vw, 17px); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.on { outline: 2px solid var(--accent); }
.kpi { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-sub { color: var(--ink3); font-size: 14px; margin: 2px 0 14px; }

/* ── Listas estilo iOS ───────────────────────────────────────────────────── */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.list.flat { box-shadow: none; background: var(--card2); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 16px; text-align: left; position: relative;
  transition: background .12s;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 64px; border-top: 0.5px solid var(--line); }
.row.plain + .row.plain::before { left: 16px; }
button.row:active, .row.tap:active { background: var(--fill); }
.row .ico {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 19px; background: var(--fill);
}
.row .ico.round { border-radius: 50%; font-size: 15px; font-weight: 700; color: #fff; }
.row .txt { flex: 1; min-width: 0; }
.row .t1 { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { font-size: 13.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .amt { text-align: right; flex-shrink: 0; }
.row .amt b { display: block; font-weight: 600; }
.row .amt small { display: block; font-size: 12.5px; color: var(--ink3); margin-top: 1px; }
.row .chev { color: var(--ink3); width: 16px; height: 16px; flex-shrink: 0; }
.day-head { font-size: 13px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .03em; padding: 16px 6px 6px; display: flex; justify-content: space-between; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink3); }
.empty .e-ico { font-size: 40px; margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Píldoras: el color va en el punto, el texto en tinta normal. */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--ink); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ink3)); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--crit); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.rank.first { background: var(--accent); color: var(--accent-ink); }

/* ── Controles ───────────────────────────────────────────────────────────── */
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { flex: 1; padding: 7px 8px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .18s, box-shadow .18s; }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { padding: 7px 13px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow); }
.chip-btn.on { background: var(--accent); color: var(--accent-ink); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 14px 16px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 17px;
  transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: rgba(208, 59, 59, .12); color: var(--neg); }
.btn.ghost { background: var(--fill); color: var(--ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Hojas (sheets) ──────────────────────────────────────────────────────── */
.layer { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .38); animation: fade .25s; }
.layer.out .scrim { animation: fadeOut .22s forwards; }
.sheet {
  position: relative; width: 100%; max-height: calc(100% - var(--safe-t) - 18px);
  background: var(--bg); border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column;
  animation: up .38s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
.layer.out .sheet { animation: down .24s ease-in forwards; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@media (min-width: 700px) {
  .layer { align-items: center; padding: 24px; }
  .sheet { width: 560px; max-height: calc(100vh - 48px); border-radius: 16px; animation: pop .3s cubic-bezier(.2, .9, .25, 1); }
  .layer.out .sheet { animation: popOut .2s ease-in forwards; }
  @keyframes pop { from { opacity: 0; transform: scale(.94); } }
  @keyframes popOut { to { opacity: 0; transform: scale(.96); } }
  .grabber { display: none; }
}
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill2); margin: 7px auto 0; flex-shrink: 0; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 14px 8px; flex-shrink: 0; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-head .l { justify-self: start; color: var(--accent); font-size: 17px; }
.sheet-head .r { justify-self: end; color: var(--accent); font-size: 17px; font-weight: 600; }
.sheet-head .r:disabled { opacity: .4; }
.sheet-body { overflow-y: auto; padding: 6px 16px calc(var(--safe-b) + 22px); -webkit-overflow-scrolling: touch; }
.sheet-body > * + * { margin-top: 14px; }

/* Formularios agrupados */
.form { background: var(--card); border-radius: 14px; overflow: hidden; }
.field { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--line); }
.field label { flex-shrink: 0; min-width: 110px; color: var(--ink); }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; text-align: right; padding: 12px 0;
  font-size: 17px; color: var(--ink2);
}
.field textarea { text-align: left; resize: none; min-height: 70px; }
.field select { appearance: none; -webkit-appearance: none; text-align-last: right; direction: rtl; }
.field .suffix { color: var(--ink3); }
.field.col { flex-direction: column; align-items: stretch; padding: 12px 16px; gap: 8px; }
.field.col label { min-width: 0; font-size: 14px; color: var(--ink3); }
.form-note { font-size: 13px; color: var(--ink3); padding: 6px 16px 0; margin-top: 6px !important; }
.form-label { font-size: 13px; color: var(--ink3); text-transform: uppercase; letter-spacing: .03em; padding: 0 16px; margin-bottom: -8px; }

.amount-box { text-align: center; padding: 10px 0 2px; }
.amount-box label { display: block; color: var(--ink3); font-size: 14px; }
.amount-wrap { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.amount-wrap span { font-size: 34px; font-weight: 600; color: var(--ink3); }
.amount-input {
  width: 100%; max-width: 300px; border: 0; outline: 0; background: none; text-align: center;
  font-size: 52px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); padding: 0;
  font-variant-numeric: tabular-nums;
}
.amount-input::placeholder { color: var(--fill2); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px; border-radius: 12px; background: var(--card);
  font-size: 12px; font-weight: 500; color: var(--ink2);
  transition: transform .12s;
}
.cat em { font-style: normal; font-size: 24px; }
.cat.on { background: var(--accent); color: var(--accent-ink); }
.cat:active { transform: scale(.95); }

.preview { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; color: var(--ink); }
.preview b { font-weight: 650; }

/* ── Barras y gráficas ───────────────────────────────────────────────────── */
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--fill); }
.stack i { display: block; height: 100%; min-width: 3px; }
.legend { display: grid; gap: 10px; margin-top: 14px; }
.legend button, .legend div { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend .lg-name { flex: 1; color: var(--ink2); font-size: 15px; }
.legend .lg-val { font-weight: 600; font-size: 15px; }
.legend .lg-pct { width: 44px; text-align: right; color: var(--ink3); font-size: 13px; }

.bars-cat { display: grid; gap: 12px; }
.bar-cat .top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 5px; }
.bar-cat .top span { color: var(--ink2); }
.bar-cat .track { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar-cat .fill { height: 100%; border-radius: 4px; background: var(--s1); transform-origin: left; animation: grow .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes grow { from { transform: scaleX(0); } }

.progress { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--s3); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--ink3); font-family: inherit; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--card); color: var(--ink); border-radius: 10px; padding: 7px 10px;
  font-size: 13px; line-height: 1.35; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); border: 0.5px solid var(--line);
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.tip b { font-weight: 650; }
.tip .k { display: flex; align-items: center; gap: 6px; color: var(--ink2); }
.tip .k i { width: 8px; height: 8px; border-radius: 2px; }

/* Simulador */
.sim-out { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sim-out .kpi { font-size: 30px; }
.sim-days { font-size: 15px; color: var(--ink2); }
.range { width: 100%; margin: 14px 0 4px; accent-color: var(--accent); height: 28px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.quick button { padding: 6px 11px; border-radius: 999px; background: var(--fill); font-size: 13.5px; font-weight: 600; }
.quick button.on { background: var(--accent); color: var(--accent-ink); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12.5px; color: var(--ink3); font-weight: 600; padding: 0 0 6px; }
.table th:not(:first-child), .table td:not(:first-child) { text-align: right; }
.table td { padding: 9px 0; border-top: 0.5px solid var(--line); }
.table td.neg { color: var(--neg); font-weight: 600; }
.x { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(208, 59, 59, .12); color: var(--neg); margin-left: 6px; }

.metas { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.meta { background: var(--card); border-radius: var(--r); padding: 14px; text-align: left; box-shadow: var(--shadow); transition: transform .12s; display: flex; flex-direction: column; gap: 6px; }
.meta:active { transform: scale(.98); }
.meta .m-top { display: flex; justify-content: space-between; align-items: flex-start; }
.meta .m-emoji { font-size: 28px; }
.meta .m-name { font-weight: 600; }
.meta .m-amt { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.meta .m-goal { font-size: 13px; color: var(--ink3); }
.meta.add { align-items: center; justify-content: center; color: var(--accent); font-weight: 600; min-height: 140px; border: 1.5px dashed var(--fill2); background: none; box-shadow: none; }
.ring { width: 44px; height: 44px; }

.explain { font-size: 14px; color: var(--ink2); line-height: 1.45; }
.fun { font-size: 14px; color: var(--ink2); background: var(--card2); border-radius: 12px; padding: 10px 12px; }

/* ── Aviso flotante ──────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 92px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(30, 30, 32, .92); color: #fff; padding: 11px 18px; border-radius: 14px;
  font-size: 15px; font-weight: 500; transition: all .28s cubic-bezier(.2, .9, .25, 1);
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

@media (max-width: 380px) {
  .head h1 { font-size: 30px; }
  .hero .big { font-size: 36px; }
  .pad { grid-template-columns: repeat(3, 70px); gap: 14px 22px; }
  .pad button { width: 70px; height: 70px; }
}
.stat .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.row .t2.wrap { white-space: normal; line-height: 1.5; }
.meta.add svg { width: 26px; height: 26px; }
