/* Zentry Cuentas — panel financiero. Oscuro con el azul de Zentry; las gráficas son SVG propias. */
:root {
  --bg: #07070c;
  --bg-2: #0b0c13;
  --card: #10111b;
  --card-2: #161827;
  --card-3: #1d2033;
  --line: rgba(184, 195, 255, .09);
  --line-2: rgba(184, 195, 255, .16);
  --text: #eceef8;
  --text-2: #a9adc4;
  --muted: #7f849e;
  --peri: #b8c3ff;
  --blue: #6d88ff;
  --blue-2: #4f6cff;
  --violet: #8b6cff;
  --green: #22e5a0;
  --green-bg: rgba(34, 229, 160, .12);
  --red: #ff6b81;
  --red-bg: rgba(255, 107, 129, .12);
  --amber: #ffb547;
  --amber-bg: rgba(255, 181, 71, .12);
  --sans: "Geist", -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --r: 18px;
  --r-sm: 12px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 70px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--sans); font-feature-settings: "tnum" 1, "ss01" 1;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; cursor: pointer; text-decoration: none; }
input, select, textarea { font-size: 16px; }
:focus-visible { outline: 2px solid var(--peri); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }

/* ---------- Arranque ---------- */
#app.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot-mark svg { width: 64px; height: 50px; animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .3; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { max-width: 1240px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--tab-h) + var(--safe-b) + 28px); }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar .logo { width: 34px; height: 27px; flex: none; }
.hello { flex: 1; min-width: 0; }
.hello small { display: block; color: var(--muted); font-size: 12.5px; }
.hello b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text-2);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 20px; height: 20px; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #0a0b14; background: linear-gradient(135deg, var(--peri), var(--blue)); }
.avatar:hover { filter: brightness(1.1); }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin: 0; flex: 1; }

.grid { display: grid; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; min-width: 0; position: relative;
}
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h2, .card-h h3 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; letter-spacing: -.01em; }
.card-h .sub { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card-h a, .card-h .link-btn { font-size: 13px; color: var(--peri); font-weight: 500; padding: 10px 0 10px 8px; }
.card-h a:hover, .card-h .link-btn:hover { color: #fff; }
.eyebrow { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- Tarjeta principal (saldo) ---------- */
.hero {
  padding: 20px 18px 14px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(109, 136, 255, .22), transparent 55%),
    radial-gradient(80% 80% at 0% 100%, rgba(139, 108, 255, .12), transparent 60%),
    var(--card);
  border-color: rgba(109, 136, 255, .22);
}
.hero-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.hero-top .left { flex: 1; min-width: 0; }
.big { font-size: clamp(32px, 9.5vw, 44px); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.big small { font-size: .45em; font-weight: 600; color: var(--text-2); letter-spacing: 0; margin-right: 4px; }
.big .cents { font-size: .55em; color: var(--text-2); letter-spacing: -.02em; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.up { background: var(--green-bg); color: var(--green); }
.pill.down { background: var(--red-bg); color: var(--red); }
.pill.flat { background: var(--card-3); color: var(--text-2); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.hero-meta { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.chart-wrap { position: relative; margin: 14px -6px 0; touch-action: pan-y; }
.chart-wrap svg { width: 100%; height: 170px; overflow: visible; }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none;
  background: #1c1f33; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 9px;
  font-size: 12px; white-space: nowrap; box-shadow: 0 8px 22px rgba(0,0,0,.4); opacity: 0; transition: opacity .12s;
}
.chart-tip b { display: block; font-size: 13.5px; }
.chart-tip.on { opacity: 1; }
.ranges { display: flex; gap: 4px; padding: 4px; background: rgba(7, 7, 12, .5); border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; }
.ranges button { flex: 1; min-height: 36px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ranges button:hover { color: var(--text); }
.ranges button[aria-pressed="true"] { background: var(--card-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- Indicadores ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 6px; text-align: left; }
button.stat:hover { border-color: var(--line-2); background: var(--card-2); }
.stat .val { font-size: 21px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
.stat .foot { font-size: 12px; color: var(--muted); }
.ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.ico svg { width: 18px; height: 18px; }
.ico.green { background: var(--green-bg); color: var(--green); }
.ico.red { background: var(--red-bg); color: var(--red); }
.ico.blue { background: rgba(109, 136, 255, .14); color: var(--peri); }
.ico.amber { background: var(--amber-bg); color: var(--amber); }
.net-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--card-3); margin: 12px 0 10px; gap: 2px; }
.net-bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Accesos rápidos */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 500; padding: 4px 0; border-radius: 14px; }
.quick button:hover { color: var(--text); }
.quick .q { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); transition: transform .12s, background .15s; }
.quick button:hover .q { background: var(--card-2); }
.quick button:active .q { transform: scale(.94); }
.quick .q svg { width: 22px; height: 22px; }

/* ---------- Mes ---------- */
.month-sum { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.ring { width: 96px; height: 96px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .c b { font-size: 19px; letter-spacing: -.03em; }
.ring .c small { display: block; font-size: 10.5px; color: var(--muted); }
.kv { display: grid; gap: 9px; }
.kv-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.kv-row span:first-of-type { flex: 1; color: var(--text-2); }
.kv-row b { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.compare { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Dona */
.donut-box { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.donut { position: relative; width: 150px; height: 150px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut svg circle { transition: stroke-width .15s, opacity .15s; }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.15; padding: 22px; }
.donut .c small { display: block; color: var(--muted); font-size: 11.5px; }
.donut .c b { font-size: 17px; letter-spacing: -.03em; }
.cat-list { display: grid; gap: 8px; min-width: 0; }
.cat-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 9px; align-items: center; font-size: 13px; padding: 2px 0; }
.cat-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.cat-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.cat-row .p { grid-column: 2 / -1; height: 4px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.cat-row .p i { display: block; height: 100%; border-radius: inherit; }
.cat-row .d { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); margin-top: -2px; }

/* Barras 6 meses */
.bars svg { width: 100%; height: 170px; overflow: visible; }
.bars .axis { font: 11px var(--sans); fill: var(--muted); }
.bar-axis { display: flex; margin-top: 8px; }
.bar-axis span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.bar-axis span.on { color: var(--text); font-weight: 600; }

/* Cuentas */
.acc-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 74%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.acc-scroll::-webkit-scrollbar { display: none; }
.acc {
  scroll-snap-align: start; text-align: left; border-radius: 16px; padding: 14px; min-height: 132px;
  background: linear-gradient(160deg, var(--card-3), var(--card-2)); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s;
}
.acc:hover { border-color: var(--line-2); }
.acc .t { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.acc .t .ico { width: 28px; height: 28px; border-radius: 9px; }
.acc .t .ico svg { width: 15px; height: 15px; }
.acc .v { font-size: 20px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.acc svg.spark { width: 100%; height: 34px; margin-top: auto; }
.acc.add { align-items: center; justify-content: center; color: var(--muted); border-style: dashed; background: transparent; font-weight: 500; }
.acc.add:hover { color: var(--text); }
.acc.add svg { width: 24px; height: 24px; }

/* ---------- Listas de movimientos ---------- */
.tx-list { display: grid; }
.tx {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 8px; margin: 0 -8px; border-radius: 12px; text-align: left; width: calc(100% + 16px); min-height: 56px;
}
.tx:hover { background: var(--card-2); }
.tx .ci { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.tx .ci svg { width: 19px; height: 19px; }
.tx .m { min-width: 0; }
.tx .m b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .m span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .a { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.tx .a small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.day-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.day-h span:last-child { font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); font-size: 13.5px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--blue); opacity: .8; }

/* Vencimientos */
.due { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; text-align: left; width: 100%; }
.due + .due { border-top: 1px solid var(--line); }
.due .m b { display: block; font-size: 14px; font-weight: 600; }
.due .m span { font-size: 12.5px; color: var(--muted); }

/* ---------- Movimientos ---------- */
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav .m { flex: 1; text-align: center; font-weight: 600; text-transform: capitalize; font-size: 16px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { padding: 12px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); min-width: 0; }
.mini small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.mini b { display: block; font-size: 15px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 3px; overflow-wrap: anywhere; line-height: 1.2; }
.daily svg { width: 100%; height: 120px; overflow: visible; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--text); color: #0a0b14; border-color: var(--text); font-weight: 600; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 46px; padding: 10px 14px 10px 42px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--blue); }

/* ---------- Vales ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.seg button { min-height: 42px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--card-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.debt-sum { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.debt { display: grid; gap: 12px; }
.debt-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.debt-top .who { min-width: 0; }
.debt-top .who b { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.debt-top .who span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.debt-top .left { text-align: right; }
.debt-top .left small { display: block; font-size: 11.5px; color: var(--muted); }
.debt-top .left b { font-size: 18px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.avatar-sm { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.prog { height: 8px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: inherit; }
.debt-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.debt-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.debt.closed { opacity: .65; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; width: 100%; border-radius: 14px;
  font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  background: linear-gradient(180deg, #7d95ff, var(--blue-2)); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px rgba(79, 108, 255, .28);
  transition: filter .15s, transform .08s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.985); }
.btn.sec { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.sec:hover { background: var(--card-3); filter: none; }
.btn.danger { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255, 107, 129, .3); }
.btn.danger:hover { background: rgba(255, 107, 129, .2); filter: none; }
.btn.small { min-height: 44px; font-size: 14px; width: auto; padding: 0 16px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.btns { display: grid; gap: 10px; margin-top: 18px; }
.link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--peri); font-weight: 500; }
.link:hover { color: #fff; }
.link[disabled] { color: var(--muted); pointer-events: none; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label, .lbl { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.inp {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 13px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.inp::placeholder { color: #5f6480; }
.inp:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(109, 136, 255, .2); }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
input[type="date"].inp { color-scheme: dark; }
.inp.code { font: 600 28px/1 var(--mono); letter-spacing: .45em; text-align: center; padding-left: .45em; }
.pass-wrap { position: relative; }
.pass-wrap .inp { padding-right: 76px; }
.pass-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 10px; font-size: 13px; color: var(--peri); font-weight: 500; border-radius: 9px; }
.pass-wrap button:hover { background: var(--card-2); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.meter i { height: 4px; border-radius: 999px; background: var(--card-3); transition: background .2s; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; cursor: pointer; min-height: 44px; color: var(--text-2); }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--blue); flex: none; }
.err-msg { margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: var(--red-bg); color: #ffb3bf; font-size: 13.5px; border: 1px solid rgba(255, 107, 129, .25); }
.note-msg { margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: var(--card-2); font-size: 13.5px; color: var(--text-2); border: 1px solid var(--line); }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; }
.auth-art { display: none; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 28px) 18px calc(var(--safe-b) + 28px); max-width: 460px; width: 100%; margin: 0 auto; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; margin-bottom: 30px; }
.auth-logo svg { width: 38px; height: 30px; }
.auth-logo span { color: var(--muted); font-weight: 500; }
.auth h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; line-height: 1.1; }
.auth .lead { margin: 8px 0 0; color: var(--text-2); font-size: 15px; }
.auth .lead b { color: var(--text); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 14px; margin-top: 8px; }
.auth-trust { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.auth-trust span { display: inline-flex; align-items: center; gap: 6px; }
.auth-trust svg { width: 15px; height: 15px; color: var(--green); }
.steps-ind { display: flex; gap: 6px; margin-bottom: 18px; }
.steps-ind i { height: 4px; flex: 1; border-radius: 999px; background: var(--card-3); }
.steps-ind i.on { background: var(--blue); }

/* ---------- Barra inferior ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 8px 10px calc(var(--safe-b) + 8px);
  background: rgba(10, 11, 18, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; font-size: 11px; font-weight: 500; color: var(--muted); border-radius: 12px; }
.tab svg { width: 23px; height: 23px; }
.tab:hover { color: var(--text-2); }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] svg { color: var(--peri); }
.tab.add .plus { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #7d95ff, var(--violet)); box-shadow: 0 8px 22px rgba(109, 136, 255, .4); transition: transform .1s; }
.tab.add .plus svg { width: 26px; height: 26px; color: #fff; }
.tab.add:active .plus { transform: scale(.93); }

/* ---------- Hojas ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(3, 3, 8, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 560px; margin: 0 auto;
  max-height: calc(100vh - var(--safe-t) - 12px); max-height: calc(100dvh - var(--safe-t) - 12px);
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 26px 26px 0 0;
  animation: rise .3s cubic-bezier(.2, .8, .2, 1) both;
}
.sheet::before { content: ""; width: 38px; height: 5px; border-radius: 999px; background: var(--card-3); margin: 8px auto 0; flex: none; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px 8px 20px; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; padding: 0 20px 22px; -webkit-overflow-scrolling: touch; }
.sheet-body > .card-h:first-child { margin-top: 4px; }
.sec-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-title:first-child { margin-top: 6px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; min-height: 56px; width: 100%; text-align: left; }
.list-row + .list-row { border-top: 1px solid var(--line); }
button.list-row:hover .lr-t b { color: var(--peri); }
.lr-t { flex: 1; min-width: 0; }
.lr-t b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-t span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--muted); }
.chev svg { width: 18px; height: 18px; }

/* Anotar */
.kind { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 20px; background: var(--bg-2); border-radius: 14px; border: 1px solid var(--line); }
.kind button { min-height: 42px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.kind button:hover { color: var(--text); }
.kind button[aria-pressed="true"][data-k="out"] { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255,107,129,.35); }
.kind button[aria-pressed="true"][data-k="in"] { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px rgba(34,229,160,.35); }
.kind button[aria-pressed="true"][data-k="move"] { background: rgba(109,136,255,.15); color: var(--peri); box-shadow: inset 0 0 0 1px rgba(109,136,255,.4); }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 14px 20px 6px; font-size: clamp(38px, 12vw, 52px); font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; min-height: 78px; overflow: hidden; }
.amount small { font-size: 18px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.amount.in { color: var(--green); }
.amount.out { color: var(--red); }
.amount .caret { width: 3px; height: .8em; background: currentColor; align-self: center; border-radius: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.debt-tag { margin: 4px 20px 0; padding: 10px 12px; border-radius: 12px; background: rgba(109, 136, 255, .1); border: 1px solid rgba(109, 136, 255, .25); font-size: 13px; color: var(--peri); text-align: center; }
.opts { padding: 0 0 6px; }
.opt-lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 14px 0 8px; display: block; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { min-height: 40px; padding: 0 12px 0 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); font-size: 13.5px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.pick button.noi { padding-left: 12px; }
.pick button .ci { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
.pick button .ci svg { width: 15px; height: 15px; }
.pick button:hover { border-color: var(--line-2); color: var(--text); }
.pick button[aria-pressed="true"] { border-color: var(--blue); background: rgba(109, 136, 255, .14); color: var(--text); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 14px 0; border-top: 1px solid var(--line); }
.pad button { height: 50px; border-radius: 14px; font-size: 22px; font-weight: 500; background: var(--card-2); transition: background .1s, transform .06s; }
.pad button:hover { background: var(--card-3); }
.pad button:active { transform: scale(.96); background: var(--card-3); }
.pad button.fn { color: var(--peri); font-size: 17px; background: transparent; }
.pad .ok { grid-row: span 2; height: auto; background: linear-gradient(180deg, #7d95ff, var(--blue-2)); color: #fff; font-size: 15px; font-weight: 600; }
.pad .ok:hover { background: linear-gradient(180deg, #8ea2ff, #5c78ff); }
.pad-foot { padding: 8px 14px calc(var(--safe-b) + 12px); }

/* ---------- Avisos ---------- */
#toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 90; transform: translate(-50%, -150%);
  max-width: min(92vw, 420px); padding: 12px 16px; border-radius: 14px;
  background: #1c1f33; color: var(--text); border: 1px solid var(--line-2);
  font-size: 14px; font-weight: 500; box-shadow: 0 14px 40px rgba(0,0,0,.5);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
}
#toast.on { transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(255, 107, 129, .5); color: #ffc2cc; }
.offline { margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 13px; }
.ask { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(3, 3, 8, .7); animation: fade .15s both; }
.ask-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line-2); padding: 22px; border-radius: 22px; }
.ask-card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.02em; }
.ask-card p { margin: 0; font-size: 14px; color: var(--text-2); }
.ask-card .btns { grid-template-columns: 1fr 1fr; }

/* ---------- Más ---------- */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .avatar { width: 56px; height: 56px; font-size: 22px; }
.profile b { display: block; font-size: 18px; letter-spacing: -.02em; }
.profile span { font-size: 13px; color: var(--muted); }
.menu-card { padding: 4px 18px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; font: 600 15px/1 var(--mono); }
.codes span { padding: 12px 0; text-align: center; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); letter-spacing: .06em; }
.qr { display: grid; place-items: center; margin: 14px auto 0; width: 196px; padding: 12px; background: #fff; border-radius: 16px; }
.qr svg, .qr img { width: 100%; height: auto; }
.secret { word-break: break-all; font: 600 14px/1.5 var(--mono); padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); margin-top: 10px; text-align: center; letter-spacing: .08em; user-select: all; -webkit-user-select: all; }
.steps { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--text-2); }
.steps li { margin-bottom: 7px; }
.steps b { color: var(--text); }
.share-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.gray { background: var(--card-3); color: var(--text-2); }

/* ---------- Tablet ---------- */
@media (min-width: 700px) {
  .main { padding-left: 28px; padding-right: 28px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .acc-scroll { grid-auto-columns: minmax(220px, 38%); }
  .g-2 { grid-template-columns: 1fr 1fr; }
  .three .mini b { font-size: 18px; }
  .sheet { bottom: auto; top: 50%; border-radius: 26px; border-bottom: 1px solid var(--line-2); transform: translateY(-50%); animation: pop .22s cubic-bezier(.2, .8, .2, 1) both; max-height: calc(100vh - 48px); }
  .sheet::before { display: none; }
  .sheet-head { padding-top: 14px; }
  @keyframes pop { from { opacity: 0; transform: translateY(-48%) scale(.97); } to { opacity: 1; transform: translateY(-50%); } }
}

/* ---------- Escritorio: barra lateral + panel ---------- */
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    padding: 24px 16px; border-right: 1px solid var(--line); background: var(--bg-2);
  }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 26px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
  .side .brand svg { width: 34px; height: 27px; }
  .side .brand span { color: var(--muted); font-weight: 500; }
  .side-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 14.5px; width: 100%; }
  .side-link svg { width: 20px; height: 20px; }
  .side-link:hover { background: var(--card); color: var(--text); }
  .side-link[aria-current="page"] { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
  .side-link[aria-current="page"] svg { color: var(--peri); }
  .side .btn { margin: 18px 0 8px; }
  .side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; width: 100%; }
  .side .me .avatar { width: 38px; height: 38px; font-size: 15px; }
  .side .me b { display: block; font-size: 14px; }
  .side .me span { display: block; font-size: 12px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs { display: none; }
  .main { padding: 28px 36px 48px; }
  .topbar .logo, .topbar .avatar { display: none; }
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-12 { grid-column: span 12; }
  .span-8 { grid-column: span 8; }
  .span-7 { grid-column: span 7; }
  .span-6 { grid-column: span 6; }
  .span-5 { grid-column: span 5; }
  .span-4 { grid-column: span 4; }
  .stats { grid-template-columns: 1fr; }
  .stats.row { grid-template-columns: repeat(3, 1fr); }
  .chart-wrap svg { height: 230px; }
  .acc-scroll { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; }
  .quick { display: none; }
  .page-2col { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}



/* ---------- Libretas ---------- */
.book-bar {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin: -4px 0 16px;
  padding: 8px 12px 8px 8px; min-height: 56px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  transition: border-color .15s, background .15s;
}
.book-bar:hover { border-color: var(--line-2); background: var(--card-2); }
.book-bar.shared { border-color: rgba(255, 181, 71, .28); background: linear-gradient(90deg, rgba(255, 181, 71, .08), var(--card) 60%); }
.book-bar .bb-t { flex: 1; min-width: 0; line-height: 1.2; }
.book-bar .bb-t small { display: block; font-size: 11.5px; color: var(--muted); }
.book-bar .bb-t b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-bar .bb-ch { color: var(--muted); }
.book-bar .bb-ch svg { width: 18px; height: 18px; }
.book-pick { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 52px; text-align: left; border-radius: 12px; }
.book-pick:hover .lr-t b { color: var(--peri); }
.book-pick[aria-pressed="true"] .lr-t b { color: var(--text); }
.side-sec { margin: 18px 12px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.side-link .bl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.side-link small { font-size: 11.5px; color: var(--muted); background: var(--card-3); border-radius: 999px; padding: 1px 7px; }

/* ---------- Ajustes de grilla ---------- */
.narrow { max-width: 900px; }
.stat.net { grid-column: 1 / -1; }
.g-2 { align-items: start; }
@media (min-width: 700px) { .stat.net { grid-column: auto; } }
@media (min-width: 1024px) {
  .stat.net { grid-column: auto; }
  .auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .auth-art {
    display: flex; flex-direction: column; justify-content: space-between; padding: 48px; position: relative; overflow: hidden;
    background: radial-gradient(90% 70% at 20% 10%, rgba(109,136,255,.28), transparent 60%), radial-gradient(70% 60% at 90% 90%, rgba(139,108,255,.22), transparent 60%), var(--bg-2);
    border-right: 1px solid var(--line);
  }
  .art-mark { width: 64px; height: 50px; }
  .art-copy b { display: block; font-size: 52px; line-height: 1; letter-spacing: -.05em; }
  .art-copy span { display: block; margin-top: 14px; color: var(--text-2); font-size: 17px; max-width: 30ch; }
  .art-card { width: min(420px, 100%); padding: 22px; border-radius: 22px; background: rgba(16,17,27,.75); border: 1px solid var(--line-2); backdrop-filter: blur(10px); }
  .art-card small { color: var(--muted); font-size: 13px; }
  .art-card strong { display: block; font-size: 34px; letter-spacing: -.04em; margin: 4px 0 12px; }
  .art-card strong span { color: var(--text-2); font-size: .6em; }
  .art-card svg { width: 100%; height: 90px; }
}

@media (max-width: 380px) {
  .donut-box { grid-template-columns: 1fr; justify-items: center; }
  .cat-list { width: 100%; }
  .three { grid-template-columns: 1fr 1fr; }
  .three .mini:last-child { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
