/* DineroControl — tema azul */
:root {
  --b950: #071a4d; --b900: #0b2a8f; --b700: #1740c7; --b600: #1d4ed8; --b500: #2f6bff; --b300: #93b4ff; --b100: #dde7ff; --b50: #eef3ff;
  --bg: #eef2fa; --card: #fff; --txt: #0e1b3d; --muted: #6b7a99; --line: #e4e9f4;
  --verde: #16a34a; --verde-bg: #dcfce7; --rojo: #dc2626; --rojo-bg: #fee2e2; --amar: #f59e0b; --amar-bg: #fef3c7;
  --sombra: 0 6px 20px rgba(13, 42, 143, .08);
  --grad: linear-gradient(135deg, #0b2a8f 0%, #1d4ed8 55%, #2f6bff 100%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--txt); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
a { color: var(--b600); }
h2 { font-size: 16px; margin: 0 0 8px; }
main { max-width: 560px; margin: 0 auto; padding: 14px 16px; }

/* Cabecera */
.top { background: var(--grad); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 20px 18px; border-radius: 0 0 26px 26px; }
.top-in { max-width: 528px; margin: 0 auto; }
.top h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.top.hero { padding-bottom: 96px; }
.top.hero h1 { font-size: 15px; font-weight: 500; opacity: .85; }
.hero-label { margin-top: 18px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--b300); }
.hero-num { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.hero-sub { font-size: 13px; color: var(--b100); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; vertical-align: middle; }
.pill.ok { background: rgba(22,163,74,.18); color: #86efac; }
.pill.mal { background: rgba(220,38,38,.22); color: #fca5a5; }

/* Tarjeta de crédito visual */
.cc { position: relative; margin: -84px 0 14px; padding: 18px 20px; border-radius: 20px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #4f8bff 0%, #2a5cf0 45%, #1a3fb8 100%); box-shadow: 0 14px 30px rgba(23, 64, 199, .35); }
.cc::before, .cc::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.cc::before { width: 220px; height: 220px; right: -70px; top: -90px; }
.cc::after { width: 160px; height: 160px; right: 40px; bottom: -110px; }
.cc > * { position: relative; }
.cc-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--b100); }
.chip { width: 34px; height: 25px; border-radius: 6px; background: linear-gradient(135deg, #ffd978, #e0a92e); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cc-num { font-size: 28px; font-weight: 800; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.cc-num small { font-size: 13px; font-weight: 500; color: var(--b100); }
.cc .barra { background: rgba(255,255,255,.22); margin: 10px 0 14px; }
.cc-pie { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 12px; color: var(--b100); }
.cc-pie b { display: block; font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; }
.cc-pie b.neg { color: #fecaca; }

/* Accesos rápidos */
.accesos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.acceso { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--txt); font-size: 12px; font-weight: 600; }
.acceso i { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(29,78,216,.3); }
.acceso i svg { width: 26px; height: 26px; }
.acceso.alerta i { background: linear-gradient(135deg, #f59e0b, #ea580c); box-shadow: 0 6px 14px rgba(234,88,12,.3); }

/* Tarjetas */
.card { background: var(--card); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--sombra); }
.card-tit { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.card-tit span { font-size: 13px; font-weight: 500; color: var(--muted); }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.label .muted { text-transform: none; letter-spacing: 0; }
.numero { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.numero.chico { font-size: 21px; }
.neg { color: var(--rojo); }
.pos { color: var(--verde); }
.muted { color: var(--muted); }
.chico { font-size: 13px; }
.center { text-align: center; }
.barra { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0 12px; }
.barra div { height: 100%; border-radius: 6px; }
.barra .verde { background: #4ade80; } .barra .amarillo { background: #fbbf24; } .barra .rojo { background: #f87171; }
.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fila3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }

/* Botones */
.btn { display: block; width: 100%; text-align: center; border: 0; border-radius: 14px; background: var(--grad); color: #fff; font: inherit; font-weight: 700; padding: 13px; margin-top: 10px; text-decoration: none; cursor: pointer; box-shadow: 0 6px 14px rgba(29,78,216,.25); }
.btn.big { font-size: 19px; padding: 16px; margin: 4px 0 14px; }
.btn.sec { background: var(--b50); color: var(--b600); box-shadow: none; }
.btn.chico { width: auto; display: inline-block; padding: 7px 16px; margin: 0; font-size: 14px; }
.btn.peligro { background: transparent; color: var(--rojo); border: 1px solid var(--rojo); box-shadow: none; }

/* Avisos */
.flash { background: var(--verde-bg); color: #166534; padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.flash.err { background: var(--rojo-bg); color: #991b1b; }
.aviso { background: var(--amar-bg); color: #78350f; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.aviso .btn { background: #f59e0b; box-shadow: none; }
p.aviso { display: block; margin: 8px 0; }

/* Tablas de detalle */
details summary { cursor: pointer; color: var(--b600); font-size: 14px; font-weight: 600; }
table.det { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
table.det td { padding: 7px 0; border-bottom: 1px solid var(--line); }
table.det td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.det tr.sub td { font-weight: 700; color: var(--b900); }
.proy { color: var(--muted); font-size: 12px; }
.resultado { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 17px; padding: 10px 14px; margin-top: 8px; border-radius: 12px; }
.resultado.pos { background: var(--verde-bg); color: #166534; }
.resultado.neg { background: var(--rojo-bg); color: #991b1b; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista .f { font-size: 12px; color: var(--muted); width: 42px; flex: none; }
.lista .d { flex: 1; color: var(--txt); text-decoration: none; min-width: 0; font-weight: 600; font-size: 15px; }
.lista .d small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .m { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.lista .m.gasto { color: var(--rojo); }
.lista .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.lista .ico svg { width: 20px; height: 20px; }
.ico.in { background: var(--verde-bg); color: var(--verde); }
.ico.out { background: var(--rojo-bg); color: var(--rojo); }
.ico.tr { background: var(--b100); color: var(--b600); }
.lista .ok { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--b50); color: var(--b600); text-align: center; line-height: 34px; text-decoration: none; font-weight: 800; }
.lista li.vencido .f { color: var(--rojo); font-weight: 700; }
.lista li.inactivo { opacity: .5; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--rojo-bg); color: var(--rojo); margin-left: 4px; }

/* Formularios */
.form label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 0; }
.form input, .form select { display: block; width: 100%; margin-top: 5px; font: inherit; font-size: 16px; color: var(--txt); padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.form input:focus, .form select:focus { outline: none; border-color: var(--b500); box-shadow: 0 0 0 3px var(--b100); }
.form label.check { display: flex; gap: 8px; align-items: center; color: var(--txt); font-weight: 500; }
.form label.check input { width: auto; margin: 0; accent-color: var(--b600); }
.form fieldset { border: 0; border-top: 1px solid var(--line); padding: 4px 0 12px; margin: 0; }
.form .monto { display: flex; align-items: center; gap: 6px; font-size: 30px; color: var(--b900); margin-top: 16px; }
.form .monto input { font-size: 36px; font-weight: 800; color: var(--b900); border: 0; border-bottom: 2px solid var(--b500); border-radius: 0; padding: 4px 0; margin: 0; box-shadow: none; }
.seg { display: flex; background: var(--b50); border-radius: 14px; padding: 4px; margin-top: 10px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 4px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--grad); color: #fff; box-shadow: 0 4px 10px rgba(29,78,216,.25); }
[hidden] { display: none !important; }

/* Navegación de mes */
.mesnav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 18px; color: var(--b900); }
.mesnav .btn.chico { padding: 7px 14px; }

/* Menú inferior */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; box-shadow: 0 -6px 24px rgba(13,42,143,.10); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .in { max-width: 560px; margin: 0 auto; display: flex; align-items: flex-end; }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 2px 12px; font-size: 11px; font-weight: 600; color: #9aa6c0; text-decoration: none; }
nav.tabs a svg { width: 23px; height: 23px; }
nav.tabs a.on { color: var(--b600); }
nav.tabs a.on::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--b600); margin-top: 1px; }
nav.tabs a.plus { color: var(--b600); }
nav.tabs a.plus i { width: 58px; height: 58px; margin-top: -28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(29,78,216,.4); border: 4px solid #fff; }
nav.tabs a.plus i svg { width: 26px; height: 26px; }
