:root {
  --bg: #09090b;
  --bg-elev: #09090b;
  --card: #131317;
  --card-2: #1d1d23;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #ececf1;
  --text-2: #9b9ba8;
  --text-3: #5f5f6c;
  /* Acentos: morado principal, azul para ingresos, morado claro para gastos, rosa solo para alertas */
  --accent: #8b7cf6;
  --accent-soft: rgba(139, 124, 246, 0.12);
  --blue: #4cc9f0;
  --blue-soft: rgba(76, 201, 240, 0.12);
  --purple: #c77dff;
  --purple-soft: rgba(199, 125, 255, 0.13);
  --alert: #f0718d;
  --alert-soft: rgba(240, 113, 141, 0.11);
  --green: var(--blue);
  --red: var(--alert);
  --orange: var(--purple);
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 288px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 600; font-size: 17px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent); color: #0b0b10;
  font-weight: 700; font-size: 16px;
}
.brand-logo { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 6px rgba(139,124,246,.35)); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 11px; font-size: 15px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav a.active { background: rgba(255,255,255,0.09); color: var(--text); }
.nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a.active svg { stroke: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 0 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.foot-label { margin: 0 0 2px; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.main { flex: 1; min-width: 0; padding: 52px 64px 80px; max-width: 1320px; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.025em; }
.page-head .sub { margin: 6px 0 0; color: var(--text-2); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 15px; border-radius: 999px;
  border: 0; font-weight: 600; font-size: 13px;
  background: var(--card-2); color: var(--text);
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #0b0b10; }
.btn.green { background: var(--card-2); color: var(--blue); }
.btn.red { background: var(--card-2); color: var(--purple); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: transparent; color: var(--text-3);
  display: inline-grid; place-items: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.icon-btn.del:hover { color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Month picker */
.month-picker {
  display: flex; align-items: center; height: 34px;
  background: var(--card); border-radius: 999px; padding: 0 4px;
}
.month-picker button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); font-size: 18px; line-height: 1; }
.month-picker button:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.month-picker select {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0;
  font-weight: 600; text-align: center; text-align-last: center; padding: 0 6px; min-width: 130px; cursor: pointer;
}
.month-picker select:focus { outline: none; }
.month-picker option { background: var(--card); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; min-width: 0; }
.card h3 { margin: 0 0 24px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h3 .muted { font-weight: 400; color: var(--text-3); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.kpi { padding: 24px 26px; }
.kpi { border: 1px solid var(--line); }
.kpi .label::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; background: var(--text-3); }
.kpi.tint-blue .label::before { background: var(--accent); }
.kpi.tint-green .label::before { background: var(--blue); }
.kpi.tint-red .label::before { background: var(--purple); }
.kpi .label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .hint { color: var(--text-3); font-size: 12px; margin-top: 8px; }
.pos { color: var(--blue); }
.neg { color: var(--alert); }
.exp { color: var(--purple); }
.grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid2.even { grid-template-columns: 1fr 1fr; }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .bar { transition: opacity .15s; }
.chart .bar:hover { opacity: .75; }
.legend-inline { display: flex; gap: 14px; color: var(--text-2); font-size: 12px; font-weight: 400; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-wrap svg { width: 150px; height: 150px; flex-shrink: 0; }
.donut-center-v { fill: var(--text); font-size: 17px; font-weight: 700; }
.donut-center-l { fill: var(--text-3); font-size: 11px; }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.legend .pct { color: var(--text-3); width: 34px; text-align: right; }
.legend .amt { width: 64px; text-align: right; }

/* Account rows */
.acc-list { display: flex; flex-direction: column; gap: 20px; }
.acc-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 9px; }
.acc-row .top .n { color: var(--text-2); display: flex; align-items: center; }
.acc-row .top .v { font-weight: 600; }
.track { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 3px; }
.acc-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 2px; font-weight: 600; }

/* Transactions list */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.tx-list li:last-child { border-bottom: 0; }
.tx-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.tx-main { flex: 1; min-width: 0; }
.tx-main .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main .s { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.tx-amt { font-weight: 600; white-space: nowrap; }
.empty { color: var(--text-3); text-align: center; padding: 28px 10px; font-size: 13px; }

/* Accounts page */
.hero { padding: 36px 36px; margin-bottom: 24px; background: var(--card); border: 1px solid var(--line); }
.hero .label { color: var(--text-2); font-weight: 500; }
.hero .value { font-size: 44px; font-weight: 700; letter-spacing: -0.035em; margin-top: 4px; }
.hero .hint { color: var(--text-3); margin-top: 2px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.acc-card { position: relative; display: flex; flex-direction: column; gap: 4px; }
.acc-card .chip { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px; }
.acc-card .chip svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.acc-card .name { font-weight: 600; font-size: 15px; }
.acc-card .type { color: var(--text-3); font-size: 12px; }
.acc-card .bal { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; margin-top: 12px; }
.acc-card .meta { color: var(--text-3); font-size: 12px; }
.acc-card .tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.acc-card:hover .tools { opacity: 1; }
.acc-card.add { align-items: center; justify-content: center; min-height: 172px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--text-2); cursor: pointer; font-weight: 500; }
.acc-card.add:hover { color: var(--text); border-color: var(--text-3); }

/* Filters + table */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.field, .filters select, .filters input {
  height: 34px; background: var(--card); border: 1px solid transparent; border-radius: 10px; padding: 0 12px;
}
.filters select { padding-right: 30px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a1a1a6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.filters input[type=search] { min-width: 200px; flex: 1; max-width: 300px; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent); }
.table-card { padding: 6px 0 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 15px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover td { background: rgba(255,255,255,0.025); }
td.r, th.r { text-align: right; }
td.note { white-space: normal; color: var(--text); min-width: 160px; }
td .cat { display: inline-flex; align-items: center; color: var(--text-2); }
td.date { color: var(--text-2); }
td.acts { width: 72px; text-align: right; padding: 4px 10px; }
.table-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; color: var(--text-2); font-size: 13px; }
.table-foot b { color: var(--text); font-weight: 600; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.in { background: var(--blue-soft); color: var(--blue); }
.pill.out { background: var(--purple-soft); color: var(--purple); }

/* Reports */
.note-banner { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); color: #c3baff; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 28px; font-size: 13px; }
.note-banner svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rep-list { display: flex; flex-direction: column; gap: 14px; }
.rep { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr) auto; align-items: center; gap: 20px; padding: 22px 28px; }
.rep .title { font-weight: 600; font-size: 15px; }
.rep .title small { display: block; color: var(--text-3); font-weight: 400; font-size: 12px; margin-top: 2px; }
.rep .stat .l { color: var(--text-3); font-size: 12px; }
.rep .stat .v { font-weight: 600; margin-top: 2px; }
.rep.current { border: 1px dashed var(--line-strong); background: transparent; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); margin-left: 6px; vertical-align: 2px; }
.badge.new { background: var(--blue-soft); color: var(--blue); }
.section-title { color: var(--text-2); font-size: 13px; font-weight: 600; margin: 36px 0 14px; }

/* Modal */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 16px; z-index: 50;
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 440px; background: #16161b;
  border: 1px solid var(--line); border-radius: 24px; padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
.modal h2 { margin: 0 0 18px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.modal p { color: var(--text-2); margin: -6px 0 18px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: rgba(118,118,128,.24); border-radius: 9px; padding: 2px; margin-bottom: 16px; }
.segmented button { border: 0; background: transparent; border-radius: 7px; height: 30px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.segmented button.on { background: #3a3a46; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.form-row label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.form-row input, .form-row select {
  height: 38px; background: rgba(118,118,128,.18); border: 1px solid transparent; border-radius: 10px; padding: 0 12px; width: 100%;
}
.form-row select { appearance: none; -webkit-appearance: none; }
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--accent); }
.form-row input.big { height: 52px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.colors button.on { border-color: #fff; }
.err { color: var(--red); font-size: 12px; min-height: 16px; margin-top: -4px; }

/* Welcome */
.welcome { max-width: 520px; margin: 10vh auto 0; text-align: center; }
.welcome .brand-mark { width: 64px; height: 64px; border-radius: 18px; font-size: 32px; margin: 0 auto 20px; }
.welcome h1 { font-size: 32px; margin: 0 0 10px; letter-spacing: -0.03em; }
.welcome p { color: var(--text-2); font-size: 15px; margin: 0 0 28px; }
.welcome .actions { justify-content: center; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #1d1d23; border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* Responsive */
/* Estado del mes (estilo tarjeta de estado) */
.mood { display: flex; align-items: center; gap: 18px; border-radius: var(--radius); padding: 22px 26px; margin-bottom: 20px; }
.mood .face { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.mood .face svg { width: 32px; height: 32px; fill: none; stroke: #000; stroke-width: 2.4; stroke-linecap: round; }
.mood .t { font-size: 17px; font-weight: 600; color: var(--text); }
.mood .s { margin-top: 3px; font-size: 14px; }
.mood.great { background: var(--accent-soft); } .mood.great .face { background: var(--accent); } .mood.great .s { color: #c3baff; }
.mood.ok { background: var(--blue-soft); } .mood.ok .face { background: var(--blue); } .mood.ok .s { color: #9adcf5; }
.mood.bad { background: var(--alert-soft); } .mood.bad .face { background: var(--alert); } .mood.bad .s { color: var(--alert); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid2.even { grid-template-columns: 1fr; }
  .rep { grid-template-columns: 1fr 1fr 1fr; }
  .rep .title { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .sidebar { width: 240px; padding: 22px 14px; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: auto; height: auto; padding: 6px 8px; z-index: 40; border-right: 0; border-top: 1px solid var(--line); background: #09090b; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 8px; }
  .nav a.active { background: transparent; color: var(--accent); }
  .main { padding: 26px 16px 110px; }
  .card { padding: 22px 20px; }
  .kpis { gap: 12px; }
  .kpi .value { font-size: 22px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut-wrap svg { margin: 0 auto; }
  .rep { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 26px; }
}

/* ---------- Mascota ---------- */
/* Contenido centrado con márgenes laterales y ancho máximo */
.main-wrap { position: relative; flex: 1; min-width: 0; max-width: 1240px; margin: 0 auto; }
.main-wrap .main { max-width: none; }
.page-head { padding-right: 160px; }
#mascot {
  position: absolute; top: 12px; right: 28px; width: 144px; height: 144px;
  z-index: 5; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
/* .m-root se desplaza y gira; el dibujo de cada pose lo deforma mascot.js punto a punto (rig). */
.m-stage { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; perspective: 500px; }
.m-root { transform-origin: 50% 100%; will-change: transform; }
.m-pose { position: relative; width: 144px; height: 144px; transform-origin: 50% 90%; }
.m-pose svg { position: absolute; bottom: 0; left: 0; right: 0; margin: 0 auto; display: block; overflow: visible;
  transform-origin: 50% 100%; filter: drop-shadow(0 0 12px rgba(139,124,246,.18)); }
.m-eye { fill: #fff; filter: drop-shadow(0 0 5px #b79cff) drop-shadow(0 0 12px rgba(183,156,255,.65)); }

/* Partículas (brasas y chispas, las mueve mascot.js) */
.m-parts { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; filter: drop-shadow(0 0 3px rgba(167,150,255,.85)); }
.p-ember { fill: #b6a8ff; }
.p-spark { fill: #e6deff; }

/* Efectos por estado */
.m-fx .fx { position: absolute; width: auto; opacity: 0; transition: opacity .25s; }
.fx-sparkle { height: 18px; }
.fx-sparkle.s0 { left: 2%; top: 26%; } .fx-sparkle.s1 { right: 2%; top: 12%; height: 14px; } .fx-sparkle.s2 { right: 6%; top: 52%; height: 11px; }
#mascot[data-fx="sparkle"] .fx-sparkle { opacity: 1; animation: m-twinkle 1.1s ease-in-out infinite; }
#mascot[data-fx="sparkle"] .fx-sparkle.s1 { animation-delay: .35s; } #mascot[data-fx="sparkle"] .fx-sparkle.s2 { animation-delay: .7s; }
@keyframes m-twinkle { 0%, 100% { transform: scale(.6) rotate(0); } 50% { transform: scale(1.15) rotate(20deg); } }
.fx-drop { height: 18px; right: 22%; top: 30%; }
#mascot[data-fx="drop"] .fx-drop { opacity: 1; animation: m-drip 2.2s ease-in infinite; }
@keyframes m-drip { 0% { transform: translateY(-4px) scale(.7); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(14px) scale(1); opacity: 0; } }
.fx-smoke { height: 26px; top: 34%; }
.fx-smoke.k0 { left: -4%; transform: scaleX(-1); } .fx-smoke.k1 { right: -4%; }
#mascot[data-fx="smoke"] .fx-smoke { opacity: 1; animation: m-puff 1.4s ease-out infinite; }
#mascot[data-fx="smoke"] .fx-smoke.k0 { animation-name: m-puff-l; animation-delay: .5s; }
@keyframes m-puff { 0% { transform: translate(0, 4px) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(8px, -12px) scale(1.1); opacity: 0; } }
@keyframes m-puff-l { 0% { transform: scaleX(-1) translate(0, 4px) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleX(-1) translate(8px, -12px) scale(1.1); opacity: 0; } }
.fx-zzz { height: 30px; right: 0; top: 26%; }
#mascot[data-fx="zzz"] .fx-zzz { opacity: 1; animation: m-zzz 2.6s ease-in-out infinite; }
@keyframes m-zzz { 0%, 100% { transform: translate(0, 4px); opacity: .5; } 50% { transform: translate(4px, -6px); opacity: 1; } }
.fx-swirl { width: 84%; height: auto; left: 8%; bottom: 16%; }
#mascot[data-fx="swirl"] .fx-swirl { opacity: .75; animation: m-swirl .9s linear; }
@keyframes m-swirl { from { transform: rotate(-12deg) scaleX(.8); } to { transform: rotate(12deg) scaleX(1.1); } }

/* Bocadillo */
.m-bubble {
  position: absolute; right: calc(100% - 8px); top: 36px; width: max-content; max-width: 240px;
  background: var(--card-2); border: 1px solid var(--line-strong); color: var(--text);
  padding: 9px 13px; border-radius: 14px 14px 4px 14px; font-size: 13px; font-weight: 500; line-height: 1.35;
  opacity: 0; transform: translateX(8px) scale(.9); transform-origin: right bottom;
  transition: opacity .16s ease-out, transform .45s var(--m-spring, cubic-bezier(.22,1.2,.36,1)); pointer-events: none; z-index: 2;
}
.m-bubble.show { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .page-head { padding-right: 84px; }
  #mascot { top: 6px; right: 4px; width: 84px; height: 84px; }
  #mascot .m-stage, #mascot .m-fx { transform: scale(.58); transform-origin: 50% 100%; }
  .m-bubble { top: 86px; right: 0; border-radius: 14px 4px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .m-fx .fx { animation: none !important; }
  .m-parts { display: none; }
  .m-bubble { transition: opacity .16s; }
}

/* ---------- Límite de gastos del mes ---------- */
.lim-card { --lr: #ff4d5e; --lr-2: #e5294a; --lr-soft: rgba(255, 77, 94, 0.12); position: relative; margin-bottom: 20px; padding: 20px 24px 18px; overflow: hidden; transition: border-color .4s, box-shadow .4s; }
.lim-card.lv0 { --lr: #ff6b78; --lr-2: #d9435a; }
.lim-head { display: flex; align-items: center; gap: 14px; }
.lim-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--lr-soft, rgba(255,77,94,.12)); color: var(--lr, #ff4d5e); }
.lim-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lim-txt { flex: 1; min-width: 0; }
.lim-label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.lim-title { font-size: 16px; font-weight: 600; margin-top: 1px; }
.lim-nums { text-align: right; }
.lim-nums b { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; color: var(--lr); }
.lim-nums span { color: var(--text-3); font-size: 13px; }
.lim-pct { color: var(--text-2); font-size: 12px; margin-top: 1px; }
.lim-bar { position: relative; height: 14px; margin: 16px 0 26px; border-radius: 999px; background: rgba(255, 77, 94, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 77, 94, 0.14); }
.lim-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--to); border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, var(--lr-2), var(--lr));
  box-shadow: 0 0 14px rgba(255, 77, 94, 0.35);
  animation: limFill 1.1s cubic-bezier(.22, 1, .36, 1) both;
}
.lim-fill::after { /* brillo que recorre la barra */
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  animation: limShine 3.2s ease-in-out 1.2s infinite;
}
.lim-over { position: absolute; top: 0; right: 0; bottom: 0; background: repeating-linear-gradient(-45deg, rgba(0,0,0,.28) 0 6px, transparent 6px 12px); animation: limStripes .8s linear infinite; background-size: 17px 17px; }
.lim-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: rgba(255,255,255,.14); border-radius: 2px; }
.lim-tick b { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 500; color: var(--text-3); }
.lim-tick.past { background: rgba(255,255,255,.45); }
.lim-tick.past b { color: var(--lr); }
.lim-pace { position: absolute; top: -6px; width: 0; height: 0; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--text-2); }
.lim-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; color: var(--text-2); font-size: 13px; }
.lim-foot .link-btn { white-space: nowrap; }
.lim-off { margin: -6px 0 18px; color: var(--text-3); font-size: 13px; }

.lim-card.lv2 { border-color: rgba(255, 77, 94, 0.28); }
.lim-card.lv3 { border-color: rgba(255, 77, 94, 0.5); animation: limGlow 1.8s ease-in-out infinite; }
.lim-card.lv3 .lim-ico, .lim-card.lv4 .lim-ico { animation: limBeat 1.2s ease-in-out infinite; }
.lim-card.lv4 { --lr: #ff3b4f; --lr-2: #c8102e; border-color: #ff3b4f; background: linear-gradient(180deg, rgba(255, 59, 79, 0.13), rgba(255, 59, 79, 0.04)), var(--card); animation: limShake .55s cubic-bezier(.36,.07,.19,.97) .9s both, limGlow 2.2s ease-in-out 1.5s infinite; }
.lim-card.lv4 .lim-title { color: var(--lr); }
.lim-card.lv4 .lim-bar { box-shadow: inset 0 0 0 1px rgba(255, 59, 79, 0.5); }

@keyframes limFill { from { width: var(--from); } to { width: var(--to); } }
@keyframes limShine { 0% { transform: translateX(-100%); } 45%, 100% { transform: translateX(100%); } }
@keyframes limStripes { to { background-position: 17px 0; } }
@keyframes limGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 79, 0); } 50% { box-shadow: 0 0 0 4px rgba(255, 59, 79, 0.12), 0 0 28px rgba(255, 59, 79, 0.18); } }
@keyframes limBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes limShake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }

/* Tarjeta Dinero de Hoy */
.hoy-lim { margin: 14px 0 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255, 77, 94, 0.06); border: 1px solid rgba(255, 77, 94, 0.14); overflow: visible; }
.hoy-lim-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); }
.hoy-lim-top b { color: var(--text); font-weight: 600; }
.hoy-lim-top .num { color: var(--lr); font-weight: 600; }
.hoy-lim .lim-bar { height: 8px; margin: 9px 0 7px; }
.hoy-lim-s { font-size: 12px; color: var(--text-3); }
.hoy-lim.lv3, .hoy-lim.lv4 { border-color: rgba(255, 59, 79, 0.45); background: rgba(255, 59, 79, 0.1); }

/* Aviso al cruzar un umbral */
.lim-alert {
  --lr: #ff4d5e; --lr-soft: rgba(255, 77, 94, 0.16);
  position: fixed; top: 22px; left: 50%; z-index: 70; width: min(460px, calc(100vw - 32px));
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 16px 16px 18px;
  background: #1a1216; border: 1px solid rgba(255, 77, 94, 0.45); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(255, 77, 94, 0.15);
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  transition: transform .5s cubic-bezier(.22, 1.4, .36, 1), opacity .25s;
}
.lim-alert.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.lim-alert.show.lv4 { animation: limShake .55s cubic-bezier(.36,.07,.19,.97) .45s both; }
.lim-alert.lv4 { --lr: #ff3b4f; background: #24070d; border-color: #ff3b4f; }
.lim-alert.show .lim-ico { animation: limBeat 1.2s ease-in-out .3s 3; }
.la-body { flex: 1; min-width: 0; }
.la-t { font-weight: 650; font-size: 15px; color: var(--lr); }
.la-s { color: var(--text); font-size: 13px; margin-top: 3px; }
.la-bar { height: 6px; border-radius: 999px; background: rgba(255, 77, 94, 0.15); margin: 10px 0 5px; overflow: hidden; }
.la-bar i { display: block; height: 100%; width: var(--to); border-radius: inherit; background: linear-gradient(90deg, #e5294a, var(--lr)); }
.lim-alert.show .la-bar i { animation: limFill 1s cubic-bezier(.22, 1, .36, 1) .25s both; --from: 0%; }
.la-n { font-size: 12px; color: var(--text-2); }
.la-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.la-acts .icon-btn svg { width: 16px; height: 16px; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.lim-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 4px 0 6px; cursor: pointer; }

@media (max-width: 760px) {
  .lim-card { padding: 16px 16px 14px; }
  .lim-head { flex-wrap: wrap; row-gap: 10px; }
  .lim-nums { flex-basis: 100%; display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
  .lim-nums b { font-size: 22px; }
  .lim-bar { margin-top: 12px; }
  .lim-foot { flex-direction: column; gap: 6px; }
  .lim-alert { top: calc(env(safe-area-inset-top, 0px) + 10px); }
}
@media (prefers-reduced-motion: reduce) {
  .lim-fill, .lim-fill::after, .lim-over, .lim-card, .lim-ico, .lim-alert, .lim-alert .la-bar i { animation: none !important; }
  .lim-alert { transition: opacity .2s; transform: translate(-50%, 0); }
}

/* ---------- Traspasos entre cuentas ---------- */
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.tx-icon.tr { background: rgba(255,255,255,.07); color: var(--text-2); }
.tx-icon.tr svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tx-amt.tr, td.r.tr { color: var(--text-2); }
.pill.tr { background: rgba(255,255,255,.07); color: var(--text-2); }
.dot.tr { background: var(--text-3); }
.tr-fx { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.tr-hint { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; font-size: 13px; color: var(--text-2); }
.tr-hint svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tr-accs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.tr-accs .form-row { min-width: 0; }
.tr-accs select { width: 100%; }
.tr-swap { margin-top: 27px; }
.tr-bal { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.qc-chip.tr { color: var(--text); }
.qc-chip.muted { background: transparent; color: var(--text-3); }
.qc-kinds { flex-wrap: wrap; }
.hoy-money-acts { flex-wrap: wrap; }
@media (max-width: 560px) {
  .tr-accs { grid-template-columns: 1fr; gap: 0; }
  .tr-swap { margin: -6px auto 8px; transform: rotate(90deg); }
}
