/* ÍNDICE: temas · acceso · encabezado · finanzas · modales · metas · PWA · perfil · admin · tarjetas · importación · gastos fijos · paginación · 50/30/20 · adaptación móvil. */
/* ══ TEMA MUJER (default) ══ */
:root {
  --bg: #fff0f5;
  --white: #fff;
  --h1: #7d1a44;
  --h2: #9e2257;
  --green: #1a7a42;
  --red: #b71c1c;
  --pink: #c2185b;
  --fuchsia: #e91e8c;
  --border: #f0b8d0;
  --muted: #b06080;
  --text: #4a0e28;
  --i-tot: #f9cde4;
  --e-tot: #ead5f5;
  --s-tot: #fce4ec;
  --auth-grad: linear-gradient(145deg, #4a0e28 0%, #7d1a44 45%, #c2185b 100%);
  --sav-grad: linear-gradient(135deg, #7d1a44, #c2185b);
  --feat-grad: linear-gradient(135deg, #7d1a44, #c2185b);
  --cc-grad: linear-gradient(135deg, #7d1a44 0%, #c2185b 60%, #e91e8c 100%);
  --btn-grad: linear-gradient(135deg, #7d1a44, #c2185b);
  --hdr-shadow: rgba(100, 0, 40, .4);
  --nav-inactive: #f9a8c9;
  --nav-active-border: #f8bbd0;
  --sub-color: #f9a8c9;
  --avatar-bg: #f06292;
  --add-btn: #f06292;
  --notif-dot: #f06292;
  --inst-btn: #f06292;
  --theme-ico: 💗;
  --r: 12px;
  --sh: 0 2px 12px rgba(125, 26, 68, .12);
  --font: 'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
}

/* ══ TEMA VARÓN ══ */
[data-theme="varon"] {
  --bg: #f0f4f8;
  --white: #ffffff;
  --h1: #1a3a5c;
  --h2: #1e4976;
  --green: #1a7a42;
  --red: #b71c1c;
  --pink: #1565c0;
  --fuchsia: #1976d2;
  --border: #b0c4de;
  --muted: #5a7a9a;
  --text: #0d2137;
  --i-tot: #dbeafe;
  --e-tot: #e0d7f5;
  --s-tot: #dbeafe;
  --auth-grad: linear-gradient(145deg, #0d2137 0%, #1a3a5c 45%, #1565c0 100%);
  --sav-grad: linear-gradient(135deg, #1a3a5c, #1565c0);
  --feat-grad: linear-gradient(135deg, #1a3a5c, #1565c0);
  --cc-grad: linear-gradient(135deg, #1a3a5c 0%, #1565c0 60%, #1976d2 100%);
  --btn-grad: linear-gradient(135deg, #1a3a5c, #1565c0);
  --hdr-shadow: rgba(0, 30, 80, .4);
  --nav-inactive: #90b4d8;
  --nav-active-border: #90caf9;
  --sub-color: #90b4d8;
  --avatar-bg: #1976d2;
  --add-btn: #1976d2;
  --notif-dot: #1976d2;
  --inst-btn: #1976d2;
  --theme-ico: 🧔;
  --r: 12px;
  --sh: 0 2px 12px rgba(0, 30, 80, .12);
  --font: 'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ─── AUTH SCREEN ───────────────────────────── */
#auth-screen {
  min-height: 100dvh;
  background: var(--auth-grad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-logo {
  font-size: 3.5rem;
  margin-bottom: 8px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.08)
  }
}

.auth-title {
  font-family: var(--font-display);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 4px;
  text-align: center;
}

.auth-sub {
  color: rgba(255, 255, 255, .6);
  font-size: .8rem;
  margin-bottom: 32px;
  text-align: center;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.auth-card h2 {
  font-family: var(--font-display);
  color: var(--h1);
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.auth-fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.auth-fg label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.auth-fg input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  font-family: var(--font);
  font-size: .88rem;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border .18s;
}

.auth-fg input:focus {
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 3px rgba(233, 30, 140, .08);
}

.auth-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: var(--btn-grad);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity .18s;
}

.auth-btn:active {
  opacity: .85;
}

.auth-err {
  background: #fde8e8;
  border: 1px solid #f9b4b4;
  color: var(--red);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}

.auth-err.on {
  display: block;
}

/* ─── MAIN APP ─────────────────────────────── */
#app {
  display: none;
}

#app.on {
  display: block;
}

/* ─── HEADER ───────────────────────────────── */
.hdr {
  background: var(--h1);
  padding: 12px 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 20px var(--hdr-shadow);
}

.hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hdr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.hdr-brand h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdr-brand .sub {
  color: var(--sub-color);
  font-size: .58rem;
  margin-top: 1px;
}

.hdr-acts {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: nowrap;
}

.bhdr {
  border: none;
  color: #fff;
  padding: 7px 11px;
  border-radius: 7px;
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s, transform .15s;
}

.bhdr:active {
  opacity: .82;
  transform: scale(.96);
}

.bhdr.add {
  background: var(--add-btn);
}

.bhdr.xl {
  background: #1d6f42;
}

.bhdr.adm {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
}

/* ─── BARRA IMPORTACIÓN MÓVIL ─────────────────── */
.mobile-import-bar {
  display: none;
}

/* ─── RESPONSIVE HEADER ─────────────────────── */




/* Avatar */
.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2.5px solid rgba(255, 255, 255, .5);
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .18s;
}

.avatar-btn:hover {
  border-color: #fff;
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-btn .av-init {
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

/* NAV */
.nav {
  display: flex;
  background: var(--h2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid rgba(255, 255, 255, .07);
}

.nav::-webkit-scrollbar {
  display: none;
}

.ntab {
  padding: 10px 13px;
  color: var(--nav-inactive);
  font-size: .68rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  flex-shrink: 0;
  transition: all .15s;
}

.ntab.on {
  color: #fff;
  border-color: var(--nav-active-border);
  background: rgba(255, 255, 255, .07);
}

/* ── Botón toggle tema ── */
.theme-toggle-btn {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .18s, border-color .18s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .6);
}

/* ─── WRAP ──────────────────────────────────── */
.wrap {
  padding: 14px;
  max-width: 900px;
  margin: 0 auto;
}

/* ─── INSTALL BANNER ────────────────────────── */
.inst {
  background: var(--h1);
  color: #fff;
  border-radius: var(--r);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.inst-t {
  flex: 1;
  font-size: .7rem;
}

.inst-t b {
  display: block;
  font-weight: 700;
  margin-bottom: 1px;
}

.b-inst {
  background: var(--inst-btn);
  border: none;
  color: #fff;
  padding: 6px 11px;
  border-radius: 6px;
  font-weight: 700;
  font-size: .68rem;
  cursor: pointer;
}

.b-dis {
  background: none;
  border: none;
  color: var(--nav-inactive);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ─── BANK PICKER ─────────────────────────── */
.bank-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.bchip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.bchip:hover {
  border-color: var(--h1);
  color: var(--h1);
}

.bchip.on {
  background: var(--h1);
  color: #fff;
  border-color: var(--h1);
}

/* ─── VIEWS ──────────────────────────────────── */
.view {
  display: none;
}

.view.on {
  display: block;
}

/* ─── MONTH NAV ─────────────────────────────── */
.mnav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border-radius: var(--r);
  padding: 10px 12px;
  border: 1px solid var(--border);
  box-shadow: var(--sh);
  margin-bottom: 12px;
}

.mbtn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--h1);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.mbtn:active {
  background: #ffd6e8;
}

.mnav-c {
  flex: 1;
  text-align: center;
}

.mlbl {
  font-size: 1rem;
  font-weight: 800;
  color: var(--h1);
}

.pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s;
}

.pill.on {
  background: var(--h1);
  color: #fff;
  border-color: var(--h1);
}

/* ─── CARDS ──────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.card {
  background: var(--white);
  border-radius: var(--r);
  padding: 12px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--sh);
}

.cl {
  font-size: .58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 5px;
}

.cv {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.cs {
  font-size: .6rem;
  color: var(--muted);
  margin-top: 3px;
}

.cg {
  color: var(--green);
}

.cr {
  color: var(--red);
}

.cp {
  color: var(--pink);
}

.cf {
  color: var(--fuchsia);
}

.bdg {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 700;
  margin-top: 4px;
}

.bdg.pos {
  background: #fce4ec;
  color: var(--pink);
  border: 1px solid #f48fb1;
}

.bdg.neg {
  background: #fde8e8;
  color: var(--red);
  border: 1px solid #f9b4b4;
}

/* ─── SECTION HEADER ────────────────────────── */
.sh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
}

.sh-t {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.bsm {
  background: var(--h1);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: .67rem;
  font-weight: 700;
  cursor: pointer;
}

.bsm:active {
  background: var(--h2);
}

/* ─── PROGRESS BAR ───────────────────────────── */
.pb-wrap {
  background: var(--white);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 13px 15px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
}

.pb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.pb-lbl {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
}

.pb-val {
  font-size: .88rem;
  font-weight: 800;
}

.pb-bg {
  background: var(--s-tot);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 5px;
}

.pb-fg {
  height: 100%;
  border-radius: 999px;
  transition: width .4s;
  background: var(--btn-grad);
}

.pb-fg.over {
  background: linear-gradient(90deg, var(--add-btn), #b71c1c);
}

.pb-sub {
  display: flex;
  justify-content: space-between;
  font-size: .6rem;
  color: var(--muted);
}

/* ─── SAVINGS CARD ───────────────────────────── */
.sav-c {
  background: var(--sav-grad);
  border-radius: var(--r);
  padding: 16px;
  color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
}

.sav-lbl {
  color: rgba(255, 255, 255, .75);
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.sav-inp {
  background: rgba(255, 255, 255, .2);
  border: 1.5px solid rgba(255, 255, 255, .4);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
  font-family: var(--font);
}

.sav-inp::placeholder {
  color: rgba(255, 255, 255, .45);
}

.sav-inp:focus {
  background: rgba(255, 255, 255, .28);
  border-color: #fff;
  outline: none;
}

.sav-bot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 10px;
}

.sav-big {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.5px;
}

.sav-sub {
  font-size: .62rem;
  opacity: .75;
  margin-top: 2px;
}

.sav-pct {
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .64rem;
  font-weight: 700;
}

/* ─── TABLE CARD ──────────────────────────────── */
.tc {
  background: var(--white);
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: 10px;
}

.tc table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.tc .ths {
  padding: 8px 12px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  text-transform: uppercase;
}

.tc th {
  padding: 6px 10px;
  font-size: .61rem;
  font-weight: 600;
  color: #fff;
  text-align: left;
}

.tc th.r,
.tc td.r {
  text-align: right;
}

.tc td {
  padding: 8px 10px;
  border-bottom: 1px solid #fce4ec;
}

.tc tr:last-child td {
  border-bottom: none;
}

.tc .nm {
  color: var(--muted);
  font-size: .65rem;
}

tr.ir td {
  background: #fff5f9;
}

tr.er td {
  background: #fdf5ff;
}

tr.sr td {
  background: #fce4ec;
}

tr.gr td {
  background: #e8f5ee;
}

[data-theme="varon"] tr.ir td {
  background: #f0f6ff;
}

[data-theme="varon"] tr.er td {
  background: #f4f0ff;
}

[data-theme="varon"] tr.sr td {
  background: #e8f0fb;
}

tr.tot-r td {
  font-weight: 700;
  border-top: 2px solid #f48fb1;
}

[data-theme="varon"] tr.tot-r td {
  border-top-color: #90caf9;
}

tr.tot-i td {
  background: var(--i-tot) !important;
}

tr.tot-e td {
  background: var(--e-tot) !important;
}

tr.tot-s td {
  background: var(--s-tot) !important;
  color: var(--pink);
}

tr.tot-g td {
  background: #d4edda !important;
  color: var(--green);
}

.em td {
  color: #cca0b8;
  font-style: italic;
  font-size: .7rem;
  padding: 16px 12px;
  text-align: center;
}

/* ── Ahorro editable ── */
.sav-input-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.sav-inp-tbl {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  width: 90px;
  text-align: right;
  outline: none;
  transition: border .18s;
}

.sav-inp-tbl:focus {
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, .08);
}

.sav-row-cur td {
  background: var(--i-tot) !important;
}

/* ─── ANNUAL TABLE ──────────────────────────── */
.sx {
  overflow-x: auto;
  border-radius: var(--r);
  box-shadow: var(--sh);
  margin-bottom: 14px;
}

.atbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: var(--white);
  font-size: .69rem;
}

.atbl td,
.atbl th {
  padding: 5px 7px;
  white-space: nowrap;
}

.atbl td {
  border-bottom: 1px solid #fce4ec;
}

.atbl tr:last-child td {
  border-bottom: none;
}

.atbl .lc {
  text-align: left;
  font-weight: 500;
  min-width: 100px;
}

.atbl .rc {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── ACTION BUTTONS ─────────────────────────── */
.acts {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.be {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .63rem;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font);
}

.be:hover,
.be:active {
  border-color: var(--pink);
  color: var(--pink);
}

.bd {
  background: none;
  border: 1px solid #fca5a5;
  color: #dc2626;
  font-size: .63rem;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font);
}

.bd:hover,
.bd:active {
  background: #fde8e8;
}

/* ─── MODAL ──────────────────────────────────── */
.ov {
  position: fixed;
  inset: 0;
  background: rgba(60, 0, 20, .55);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.ov.on {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 22px 18px 36px;
  transform: translateY(40px);
  transition: transform .25s;
  max-height: 92dvh;
  overflow-y: auto;
}

.ov.on .modal {
  transform: translateY(0);
}

.m-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.m-ttl {
  font-size: 1rem;
  font-weight: 800;
  color: var(--h1);
  font-family: var(--font-display);
}

.m-cls {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
}

.trow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.tbtn {
  padding: 9px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: transparent;
  font-family: var(--font);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: all .17s;
}

.tbtn.i.on {
  border-color: #c2185b;
  color: #c2185b;
  background: #fce4ec;
}

.tbtn.e.on {
  border-color: #6b2060;
  color: #6b2060;
  background: #fdf0ff;
}

.fgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.fg.full {
  grid-column: 1 / -1;
}

.fl {
  font-size: .59rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}

input,
select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: var(--font);
  font-size: .82rem;
  color: var(--text);
  outline: none;
  transition: border .18s;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 3px rgba(233, 30, 140, .08);
}

.b-save {
  width: 100%;
  padding: 13px;
  border-radius: 9px;
  border: none;
  background: var(--h1);
  color: #fff;
  font-family: var(--font);
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  margin-top: 6px;
}

.b-save:active {
  background: var(--h2);
}

.b-can {
  width: 100%;
  padding: 10px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font);
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  margin-top: 8px;
  color: var(--muted);
}

/* ─── YEAR NAV ───────────────────────────────── */
.ynav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.yb {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--h1);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: .82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.yb:active {
  background: #ffd6e8;
}

.ylbl {
  font-size: .82rem;
  font-weight: 800;
  color: var(--h1);
  min-width: 38px;
  text-align: center;
}

/* ─── CONFIRM DIALOG ─────────────────────────── */
.cov {
  position: fixed;
  inset: 0;
  background: rgba(60, 0, 20, .55);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  padding: 20px;
}

.cov.on {
  opacity: 1;
  pointer-events: all;
}

.cbox {
  background: var(--white);
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.c-ico {
  font-size: 2rem;
  margin-bottom: 10px;
}

.c-ttl {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.c-sub {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.c-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.c-can {
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font);
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  color: var(--muted);
}

.c-del {
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #dc2626;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
}

/* ─── TOAST ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: var(--h1);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  opacity: 0;
  z-index: 999;
  transition: all .28s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
}

.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════
   METAS DE AHORRO
═══════════════════════════════════════════════ */
.metas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (min-width: 1024px) {
  .metas-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

.metas-cargando {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: .8rem;
}

/* ── Estado vacío ── */
.metas-vacio {
  text-align: center;
  padding: 32px 22px;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--r);
}

.metas-vacio .mv-ico {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.metas-vacio .mv-t {
  font-weight: 800;
  color: var(--h1);
  font-size: .95rem;
  margin-bottom: 6px;
}

.metas-vacio .mv-s {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto 16px;
}

/* ── Tarjeta de meta ── */
.mt-card {
  --mt-color: #10b981;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mt-color);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mt-card.done {
  background: linear-gradient(180deg, rgba(16, 185, 129, .07), var(--white) 60%);
}

.mt-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.mt-ico {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--mt-color) 16%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.mt-head {
  flex: 1;
  min-width: 0;
}

.mt-nombre {
  font-weight: 800;
  font-size: .95rem;
  color: var(--h1);
  line-height: 1.25;
  word-break: break-word;
}

.mt-desc {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-word;
}

.mt-acts {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.mt-act {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  font-size: .78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt-act:hover {
  background: var(--white);
}

/* ── Cifras ── */
.mt-cifras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}

.mt-c-lbl {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
}

.mt-c-val {
  font-size: .88rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
  word-break: break-all;
}

.mt-c-val.ok {
  color: var(--green);
}

.mt-c-val.falta {
  color: var(--pink);
}

/* ── Barra de progreso ── */
.mt-bar-bg {
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.mt-bar-fg {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,
      color-mix(in srgb, var(--mt-color) 65%, white),
      var(--mt-color));
  transition: width .45s ease;
}

.mt-bar-lbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--h1);
}

.mt-bdg {
  font-size: .62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.mt-bdg.ok {
  background: #e8f5ee;
  color: #1a7a42;
}

.mt-bdg.go {
  background: color-mix(in srgb, var(--mt-color) 15%, transparent);
  color: var(--mt-color);
}

.mt-bdg.risk {
  background: #fff3e0;
  color: #e65100;
}

.mt-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.mt-plazo.late {
  color: var(--red);
  font-weight: 700;
}

/* ── Ritmo necesario ── */
.mt-ritmo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mt-r-item {
  background: color-mix(in srgb, var(--mt-color) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--mt-color) 22%, transparent);
  border-radius: 9px;
  padding: 7px 6px;
  text-align: center;
}

.mt-r-lbl {
  display: block;
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 700;
}

.mt-r-val {
  display: block;
  font-size: .8rem;
  font-weight: 800;
  color: var(--h1);
  margin-top: 2px;
}

.mt-est {
  font-size: .7rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.4;
}

.mt-botones {
  display: flex;
  gap: 8px;
}

.mt-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--h1);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.mt-btn.primary {
  background: var(--btn-grad);
  border-color: transparent;
  color: #fff;
}

.mt-btn:active {
  transform: scale(.98);
}

.ic-opt {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ic-opt.on {
  border-color: var(--pink);
  background: var(--white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pink) 25%, transparent);
}

.meta-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .75rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ── Modal de aporte ── */
.aporte-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.aporte-meta .ap-ico {
  font-size: 1.6rem;
}

.aporte-meta .ap-i-t {
  font-size: .8rem;
  font-weight: 700;
  color: var(--h1);
}

.aporte-meta .ap-i-s {
  font-size: .7rem;
  color: var(--muted);
}

.ap-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.ap-q {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--h1);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.ap-q:hover {
  background: var(--white);
  border-color: var(--pink);
}

/* ── Historial de aportes ── */
.hist-list {
  max-height: 52vh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.hist-ico {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .8rem;
}

.hist-ico.in {
  background: #e8f5ee;
  color: #1a7a42;
}

.hist-ico.out {
  background: #fdecea;
  color: #b71c1c;
}

.hist-mid {
  flex: 1;
  min-width: 0;
}

.hist-monto {
  font-size: .85rem;
  font-weight: 800;
}

.hist-monto.in {
  color: var(--green);
}

.hist-monto.out {
  color: var(--red);
}

.hist-sub {
  font-size: .68rem;
  color: var(--muted);
  word-break: break-word;
}

.hist-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  padding: 6px;
}

.hist-del:hover {
  color: var(--red);
}

.hist-vacio {
  text-align: center;
  padding: 22px;
  color: var(--muted);
  font-size: .78rem;
}

/* ─── BANNER DE ACTUALIZACIÓN ─────────────────── */
.update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .18);
  max-width: 520px;
  margin: 0 auto;
}

.update-banner .ub-ico {
  font-size: 1.3rem;
  line-height: 1;
}

.update-banner .ub-txt {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.update-banner .ub-txt b {
  font-size: .8rem;
  color: var(--h1);
}

.update-banner .ub-txt span {
  font-size: .68rem;
  color: var(--muted);
}

.update-banner .ub-btn {
  background: var(--btn-grad);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.update-banner .ub-dis {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  padding: 4px;
}

.app-update-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
}
.app-update-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-update-info [data-app-version] { font-size: .72rem; font-weight: 700; color: var(--h1); }
.app-update-info [data-app-update-status] { font-size: .68rem; color: var(--muted); overflow-wrap: anywhere; }
.app-update-button {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--btn-grad);
  color: #fff;
  font-family: inherit;
  font-size: .74rem;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}
[data-app-update-button]:disabled { opacity: .65; cursor: wait; }
.app-update-auth { width: min(100%, 380px); margin: 18px auto 0; }


/* ─── PROFILE MODAL ──────────────────────────── */
.prof-av-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.av-opt {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg);
}

.av-opt.on {
  border-color: var(--fuchsia);
}

.av-opt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av-upload-lbl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  cursor: pointer;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
  transition: all .18s;
}

.av-upload-lbl:hover {
  border-color: var(--fuchsia);
  color: var(--fuchsia);
}

.av-upload-lbl input {
  display: none;
}

/* ─── ADMIN PANEL ──────────────────────────────  */
.admin-wrap {
  padding: 14px;
  max-width: 600px;
  margin: 0 auto;
}

.admin-section {
  background: var(--white);
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--sh);
  padding: 16px;
  margin-bottom: 14px;
}

.admin-section h3 {
  font-family: var(--font-display);
  color: var(--h1);
  font-size: .95rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child {
  border-bottom: none;
}

.user-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.user-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
}

.user-role {
  font-size: .62rem;
  color: var(--muted);
}

.user-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 700;
}

.tag.active {
  background: #e8f5ee;
  color: var(--green);
  border: 1px solid #a5d6a7;
}

.tag.disabled {
  background: #fde8e8;
  color: var(--red);
  border: 1px solid #fca5a5;
}

.tag.admin {
  background: #fce4ec;
  color: var(--pink);
  border: 1px solid #f48fb1;
}

.cred-box {
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 9px;
  padding: 13px;
  font-size: .78rem;
  font-family: monospace;
  color: var(--text);
  line-height: 1.6;
}

/* ─── CREDIT CARDS ───────────────────────────── */
.cc-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.cc-card {
  background: var(--cc-grad);
  border-radius: 14px;
  padding: 18px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
}

.cc-card::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.cc-card::after {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -40px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}

.cc-bank {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .75;
  margin-bottom: 12px;
}

.cc-num {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .2em;
  margin-bottom: 12px;
  font-family: monospace;
}

.cc-holder {
  font-size: .72rem;
  font-weight: 600;
  opacity: .85;
  margin-bottom: 8px;
}

.cc-dates {
  display: flex;
  gap: 16px;
}

.cc-date-box {}

.cc-date-lbl {
  font-size: .53rem;
  opacity: .65;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.cc-date-val {
  font-size: .78rem;
  font-weight: 700;
}

.cc-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 5px;
  z-index: 1;
}

.cc-act-btn {
  background: rgba(255, 255, 255, .2);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}

.cc-act-btn:hover {
  background: rgba(255, 255, 255, .35);
}

.cc-alert {
  margin-top: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .15);
  border-radius: 7px;
  font-size: .66rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc-alert.warning {
  background: rgba(255, 200, 0, .25);
}

.cc-alert.urgent {
  background: rgba(255, 80, 80, .3);
  animation: blink .8s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .7
  }
}

/* ─── NOTIFICATION BELL ──────────────────────── */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255, 255, 255, .8);
  font-size: 1.1rem;
}

.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--notif-dot);
  border-radius: 50%;
  border: 1.5px solid var(--h1);
  display: none;
}

.notif-dot.on {
  display: block;
}

.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 100vw);
  height: 100dvh;
  background: var(--white);
  z-index: 500;
  transform: translateX(100%);
  transition: transform .28s;
  box-shadow: -4px 0 20px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
}

.notif-panel.on {
  transform: translateX(0);
}

.notif-hdr {
  background: var(--h1);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-hdr h3 {
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
}

.notif-cls {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .7);
  font-size: 1.2rem;
  cursor: pointer;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  border-radius: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
}

.notif-item.urgent {
  border-color: #fca5a5;
  background: #fde8e8;
}

.notif-item.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.notif-item.ok {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.notif-item-title {
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.notif-item-sub {
  font-size: .68rem;
  color: var(--muted);
}

.notif-empty {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 40px 20px;
}

/* ─── HOME SCREEN ─────────────────────────────── */
#home-screen {
  display: none;
}

#home-screen.on {
  display: block;
}

.home-wrap {
  padding: 20px 16px;
  max-width: 400px;
  margin: 0 auto;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-greeting {
  margin-bottom: 24px;
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-greeting .g-hi {
  font-size: .9rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-greeting .g-name {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--h1);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.home-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  animation: fadeInUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}

.home-module {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(125, 26, 68, 0.08);
  padding: 22px 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

[data-theme="varon"] .home-module {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 32px rgba(0, 30, 80, 0.06);
}

.home-module::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  transition: all 0.6s ease;
}

.home-module:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 14px 40px rgba(125, 26, 68, 0.15);
  border-color: rgba(255, 255, 255, 0.9);
}

[data-theme="varon"] .home-module:hover {
  box-shadow: 0 14px 40px rgba(0, 30, 80, 0.12);
}

.home-module:hover::after {
  left: 200%;
}

.home-module.featured {
  grid-column: 1 / -1;
  background: var(--feat-grad);
  color: #fff;
  padding: 26px 24px;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  border: none;
  box-shadow: 0 10px 30px rgba(194, 24, 91, 0.3);
}

[data-theme="varon"] .home-module.featured {
  box-shadow: 0 10px 30px rgba(21, 101, 192, 0.3);
}

.home-module.featured:hover {
  box-shadow: 0 16px 45px rgba(194, 24, 91, 0.45);
  transform: translateY(-4px) scale(1.01);
}

[data-theme="varon"] .home-module.featured:hover {
  box-shadow: 0 16px 45px rgba(21, 101, 192, 0.45);
}

.hm-ico {
  font-size: 2.2rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}

.home-module:hover .hm-ico {
  transform: scale(1.15) rotate(-5deg);
}

.hm-label {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
}

.hm-sub {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
}

.home-module.featured .hm-label {
  color: #fff;
  font-size: 1.25rem;
  font-family: var(--font-display);
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
  margin-bottom: 5px;
}

.home-module.featured .hm-sub {
  color: rgba(255, 255, 255, .85);
  font-size: 0.8rem;
}

.home-module.featured .hm-ico {
  font-size: 3.5rem;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
}

/* ─── OVERLAY BACKDROP ───────────────────────── */
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  z-index: 499;
  display: none;
}

.notif-backdrop.on {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ─── BOTÓN YAPE ──────────────────────────── */
.bhdr.yape {
  background: linear-gradient(135deg, #7b2fff, #5b21b6);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s, transform .15s;
}

.bhdr.yape:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* ─── BOTÓN INTERBANK ─────────────────────── */
.bhdr.ibk {
  background: linear-gradient(135deg, #00a138, #007727);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s, transform .15s;
}

.bhdr.ibk:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* ─── MODAL IMPORTACIÓN YAPE & INTERBANK ─────────────── */
#ov-yape,
#ov-ibk {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 800;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
}

#ov-yape.on,
#ov-ibk.on {
  display: flex;
}

.yape-modal {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp .28s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(60px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.yape-modal-hdr {
  background: linear-gradient(135deg, #7b2fff, #5b21b6);
  color: #fff;
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.yape-modal-hdr h2 {
  font-size: .95rem;
  font-weight: 700;
}

.yape-modal-hdr .yape-logo {
  font-size: 1.4rem;
}

.yape-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
}

.yape-drop {
  border: 2.5px dashed #c4b5fd;
  border-radius: 14px;
  background: #f5f3ff;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

.yape-drop:hover,
.yape-drop.drag-over {
  border-color: #7b2fff;
  background: #ede9fe;
}

.yape-drop input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.yape-drop-ico {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

.yape-drop-txt {
  font-size: .82rem;
  color: #6d28d9;
  font-weight: 600;
}

.yape-drop-sub {
  font-size: .7rem;
  color: #8b5cf6;
  margin-top: 4px;
}

.yape-info {
  background: #ede9fe;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .72rem;
  color: #5b21b6;
  margin-top: 12px;
  line-height: 1.5;
}

.yape-preview {
  margin-top: 14px;
}

.yape-preview-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.yape-preview-badge {
  background: #7b2fff;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .65rem;
}

.yape-tbl-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e0d7ff;
}

.yape-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .7rem;
}

.yape-tbl th {
  background: #7b2fff;
  color: #fff;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.yape-tbl td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0ebff;
  white-space: nowrap;
}

.yape-tbl tr:last-child td {
  border-bottom: none;
}

.yape-tbl .tag-inc {
  background: #d1fae5;
  color: #065f46;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .6rem;
  font-weight: 700;
}

.yape-tbl .tag-exp {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .6rem;
  font-weight: 700;
}

.yape-tbl .tag-skip {
  background: #f3f4f6;
  color: #9ca3af;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .6rem;
}

.yape-modal-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: var(--white);
}

.yape-btn-cancel {
  flex: 1;
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}

.yape-btn-import {
  flex: 2;
  background: linear-gradient(135deg, #7b2fff, #5b21b6);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}

.yape-btn-import:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.yape-stats {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.yape-stat {
  flex: 1;
  background: var(--white);
  border: 1px solid #e0d7ff;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.yape-stat-n {
  font-size: 1.1rem;
  font-weight: 700;
}

.yape-stat-l {
  font-size: .62rem;
  color: var(--muted);
}

.yape-stat.inc .yape-stat-n {
  color: #065f46;
}

.yape-stat.exp .yape-stat-n {
  color: #991b1b;
}

.yape-stat.skip .yape-stat-n {
  color: #9ca3af;
}

/* === ESTILOS DEL BADGE DE SINCRONIZACIÓN === */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 6px;
}
.sync-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sync-badge.connected {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.sync-badge.connected::before {
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}
.sync-badge.offline {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.3);
}
.sync-badge.offline::before {
  background: #f1c40f;
  box-shadow: 0 0 6px #f1c40f;
}
.sync-badge.syncing {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}
.sync-badge.syncing::before {
  background: #3498db;
  box-shadow: 0 0 6px #3498db;
  animation: blink-sync 1.5s infinite alternate;
}
.sync-badge.pending {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}
.sync-badge.pending::before {
  background: #e67e22;
  box-shadow: 0 0 6px #e67e22;
}

@keyframes blink-sync {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.gf-currency-picker { color: #fff; font-size: .7rem; display:flex; align-items:center; gap:5px; }
.gf-currency-picker select { border:0; border-radius:7px; padding:5px; }
.gf-actions { display:flex; gap:8px; flex-wrap:wrap; }
.gf-inline { display:flex; align-items:center; gap:6px; margin:8px 0; font-size:.8rem; }
.gf-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:7px; margin:14px 0; }
.gf-filters input,.gf-filters select { min-width:0; padding:9px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.gf-stats { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.gf-alert-setting { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:.75rem; margin:10px 0; }
.gf-alert-setting input { width:55px; padding:7px; border:1px solid var(--border); border-radius:7px; }
.gf-stat { padding:10px 12px; background:var(--card,#fff); border:1px solid var(--border); border-radius:10px; font-size:.8rem; font-weight:600; }
.gf-dashboard-lists { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin:12px 0; }
.gf-dashboard-lists > div,.gf-detail { background:var(--card,#fff); border:1px solid var(--border); border-radius:12px; padding:13px; }
.gf-dashboard-lists p { margin:6px 0; font-size:.75rem; }
.gf-empty { padding:15px; color:var(--muted); }
.gf-detail { margin:16px 0; }
.gf-scroll { overflow:auto; }
.gf-modal { max-height:90vh; overflow:auto; }
.gf-preview { margin:10px 0; max-height:170px; overflow:auto; font-size:.78rem; }
.gf-preview ol { columns:2; padding-left:22px; }
.gf-permission-row { display:block; padding:9px; border-bottom:1px solid var(--border); font-size:.82rem; }


/* ══════════════════════════════════════════════════
   MEJORAS DE MODAL DE FINANZAS / EGRESOS
══════════════════════════════════════════════════ */
.modal-finance {
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  position: relative;
}
@media (min-width: 1024px) {
  .modal-finance {
    border-radius: 20px;
  }
}
.m-ttl-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.m-ico {
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.m-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}
.trow-pill {
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  gap: 4px;
}
.trow-pill .tbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 9px;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
}
.trow-pill .tbtn.i.on {
  background: #fff;
  color: #2e7d32;
  box-shadow: 0 2px 8px rgba(46,125,50,0.15);
}
.trow-pill .tbtn.e.on {
  background: #fff;
  color: #c2185b;
  box-shadow: 0 2px 8px rgba(194,24,91,0.15);
}
.tbtn-ico {
  font-size: 1rem;
}
.inp-group {
  position: relative;
  display: flex;
  align-items: center;
}
.inp-ico {
  position: absolute;
  left: 11px;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.7;
}
.inp-group input,
.inp-group select {
  padding-left: 36px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s;
}
.inp-group input:focus,
.inp-group select:focus {
  border-color: var(--h1);
  box-shadow: 0 0 0 3px rgba(194,24,91,0.12);
}
.inp-amount-group {
  position: relative;
}
.inp-curr {
  position: absolute;
  left: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--h1);
  pointer-events: none;
}
.inp-amount-group .inp-amount {
  padding-left: 44px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--h1);
  background: #fff;
  border: 2px solid var(--border);
  letter-spacing: 0.02em;
}
.modal-finance.is-expense .inp-amount-group .inp-amount {
  color: #c2185b;
  border-color: rgba(194,24,91,0.25);
}
.modal-finance.is-expense .inp-amount-group .inp-amount:focus {
  border-color: #c2185b;
  box-shadow: 0 0 0 4px rgba(194,24,91,0.15);
}
.quick-amounts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.q-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.q-chip:hover, .q-chip:active {
  background: #fce4ec;
  color: #c2185b;
  border-color: #f48fb1;
  transform: translateY(-1px);
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.modal-actions .b-save {
  background: linear-gradient(135deg, var(--h1), var(--h2));
  box-shadow: 0 4px 14px rgba(125,26,68,0.25);
  transition: all 0.2s;
}
.modal-actions .b-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(125,26,68,0.32);
}

/* Formulario de Gastos Fijos por secciones */
.gf-form-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.gf-sec-ttl {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--h1);
  margin-bottom: 10px;
}
.b-can-preview {
  background: #fff;
  color: var(--h1);
  border-color: var(--h1);
  font-weight: 700;
}
.b-can-preview:hover {
  background: #fdf0ff;
}

/* ══════════════════════════════════════════════════
   MÓDULO Y TABLA DE EGRESOS
══════════════════════════════════════════════════ */
.eg-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bsm-eg-add {
  background: linear-gradient(135deg, #d81b60, #ad1457);
  box-shadow: 0 3px 10px rgba(216,27,96,0.25);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.75rem;
}
.eg-summary-cards {
  margin-bottom: 14px;
}
.card-eg-total {
  border-left: 4px solid #e91e63;
}
.card-eg-paid {
  border-left: 4px solid #2e7d32;
}
.card-eg-pending {
  border-left: 4px solid #8e24aa;
}
.card-eg-avg {
  border-left: 4px solid #0288d1;
}
.eg-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.eg-toggle-future {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.eg-toggle-future input {
  width: 16px;
  height: 16px;
  accent-color: var(--h1);
  cursor: pointer;
}
.eg-search-wrap {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}
.eg-search-wrap input {
  padding: 7px 11px;
  font-size: 0.78rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.eg-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}
.eg-table thead tr {
  background: linear-gradient(90deg, #6b2060, #882255);
  color: #fff;
}
.eg-table th {
  padding: 9px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.eg-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.eg-table tbody tr:hover {
  background: rgba(233,30,140,0.03);
}
.eg-table td {
  padding: 10px 10px;
  vertical-align: middle;
}
.eg-date-cell {
  font-weight: 700;
  color: var(--text);
  font-size: 0.78rem;
}
.eg-paid-date {
  font-size: 0.65rem;
  color: #2e7d32;
  font-weight: 600;
  margin-top: 2px;
}
.eg-concept-txt {
  font-weight: 700;
  color: var(--h1);
  font-size: 0.82rem;
}
.eg-benef-txt {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 1px;
}
.eg-amount-val {
  color: #c2185b;
  font-weight: 800;
  font-size: 0.86rem;
}
.eg-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-paid {
  background: #e8f5ee;
  color: #1b5e20;
  border-color: #a5d6a7;
}
.status-pending {
  background: #fff8e1;
  color: #b78103;
  border-color: #ffe082;
}
.status-overdue {
  background: #ffebee;
  color: #c62828;
  border-color: #ef9a9a;
}
.origin-fixed {
  background: #f3e5f5;
  color: #7b1fa2;
  border-color: #ce93d8;
}
.origin-manual {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}
.eg-badge-cat {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.cat-none {
  opacity: 0.6;
}
.eg-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.eg-row-actions .be {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--h1);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.eg-row-actions .be:hover {
  background: var(--h1);
  color: #fff;
}
.eg-row-actions .bsm-pay {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.eg-row-actions .bsm-pay:hover {
  background: #1b5e20;
}
.eg-empty-state {
  text-align: center;
  padding: 36px 16px;
  background: var(--white);
  border-radius: 14px;
  border: 1px dashed var(--border);
  margin: 12px 0;
}
.eg-empty-ico {
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.eg-empty-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--h1);
}
.eg-empty-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════
   GESTIÓN DE CUENTAS FINANCIERAS
══════════════════════════════════════════════════ */
.modal-accounts {
  max-width: 540px;
}
.gf-account-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}
.gf-acc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  transition: all 0.2s;
}
.gf-acc-item:hover {
  border-color: var(--h1);
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}
.gf-acc-item.is-archived {
  opacity: 0.6;
  background: var(--bg);
}
.gf-acc-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gf-acc-item-ico {
  font-size: 1.4rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.gf-acc-item-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--h1);
}
.gf-acc-item-sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 1px;
}
.gf-acc-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gf-acc-item-balance {
  font-size: 0.92rem;
  font-weight: 800;
  text-align: right;
}
.gf-acc-item-actions {
  display: flex;
  gap: 4px;
}
.gf-acc-item-actions .be,
.gf-acc-item-actions .bd {
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 6px;
}

/* Icon picker */
.icon-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.ip-btn {
  width: 38px;
  height: 38px;
  font-size: 1.25rem;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.ip-btn:hover {
  background: #fdf0ff;
  border-color: var(--h1);
  transform: scale(1.05);
}
.ip-btn.on {
  border-color: var(--h1);
  background: #fce4ec;
  box-shadow: 0 0 0 2px rgba(194,24,91,0.2);
}

/* Barra de Cuentas en Pantalla Gastos Fijos */
.gf-accounts-strip {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}
.gf-accounts-strip-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--h1);
  margin-bottom: 10px;
}
.gf-strip-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--h1);
  cursor: pointer;
  transition: all 0.15s;
}
.gf-strip-btn:hover {
  background: var(--h1);
  color: #fff;
}
.gf-accounts-strip-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.gf-acc-card {
  min-width: 140px;
  max-width: 180px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.gf-acc-card:hover {
  border-color: var(--h1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.gf-acc-card.is-archived {
  opacity: 0.55;
}
.gf-acc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gf-acc-ico {
  font-size: 1.25rem;
}
.gf-acc-type-bdg {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--muted);
}
.gf-acc-card-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--h1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-acc-card-bank {
  font-size: 0.64rem;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gf-acc-card-bal {
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 6px;
}
.gf-acc-card-bal.pos {
  color: #1b5e20;
}
.gf-acc-card-bal.neg {
  color: #c2185b;
}
.gf-acc-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  gap: 4px;
}
.gf-acc-card-add:hover {
  background: #fdf0ff;
  border-color: var(--h1);
  color: var(--h1);
}

/* ══════════════════════════════════════════════════
   MÓDULO DE GASTOS FIJOS
══════════════════════════════════════════════════ */
.gf-summary-cards {
  margin-bottom: 14px;
}
.card-gf-active {
  border-left: 4px solid #8e24aa;
}
.card-gf-prog {
  border-left: 4px solid #d81b60;
}
.card-gf-paid {
  border-left: 4px solid #2e7d32;
}
.card-gf-pend {
  border-left: 4px solid #e65100;
}
.gf-dashboard-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.gf-dash-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  box-shadow: var(--sh);
}
.gf-dash-box b {
  font-size: 0.75rem;
  color: var(--h1);
  display: block;
  margin-bottom: 8px;
}
.gf-dash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.gf-dash-item:last-child {
  border-bottom: none;
}
.gf-dash-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.gf-dash-sub {
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 1px;
}
.gf-dash-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gf-dash-amount {
  font-size: 0.82rem;
  font-weight: 800;
  color: #c2185b;
}
.gf-empty-mini {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 6px 0;
}
.gf-filter-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
.gf-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.gf-filters-grid input,
.gf-filters-grid select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.76rem;
}
.gf-alert-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════
   DETALLE DEL GASTO FIJO
══════════════════════════════════════════════════ */
.gf-det-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  margin: 16px 0;
}
.gf-det-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.gf-det-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--h1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gf-code-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.05em;
}
.gf-det-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.75rem;
}
.gf-det-dates {
  color: var(--muted);
  font-weight: 600;
  margin-left: 2px;
}
.gf-det-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.gf-det-prog-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.gf-det-prog-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text);
  margin-bottom: 6px;
}
.gf-det-prog-lbl b {
  color: var(--h1);
}
.gf-det-prog-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 999px;
  overflow: hidden;
}
.gf-det-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.gf-det-stats-grid {
  margin-bottom: 16px;
}
.gf-det-table-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--h1);
  margin-bottom: 8px;
}
.er-overdue {
  background: #fff5f5;
}
.er-overdue td {
  border-bottom-color: #fee2e2;
}
.gf-audit-sec {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.gf-audit-hdr {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--h1);
  margin-bottom: 10px;
}
.gf-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gf-hist-item {
  display: flex;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
}
.gf-hist-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--h1);
  margin-top: 5px;
  flex-shrink: 0;
}
.gf-hist-body {
  flex: 1;
}
.gf-hist-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
}
.gf-hist-act {
  font-weight: 800;
  color: var(--h1);
}
.gf-hist-date {
  color: var(--muted);
  font-size: 0.7rem;
}
.gf-hist-user {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.gf-hist-details {
  margin-top: 6px;
  font-size: 0.72rem;
}
.gf-hist-details summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 600;
}
.gf-hist-details pre {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: monospace;
  font-size: 0.68rem;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── PAGINADOR ─────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 6px;
  flex-wrap: wrap;
}
.pager-info {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}
.pager-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  transition: all .18s;
}
.pager-btn:hover:not(:disabled) {
  background: var(--h1);
  color: #fff;
  border-color: var(--h1);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.pager-btn.active {
  background: var(--h1);
  color: #fff;
  border-color: var(--h1);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.pager-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.pager-dots {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 2px;
}
.pager-select {
  font-size: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.pager-wrap {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 2px;
}
/* ─── FIN PAGINADOR ───────────────────────────────── */

/* ═══════════════════════════════════════════════════════
   MÓDULO: REGLA 50 / 30 / 20
   ═══════════════════════════════════════════════════════ */
#tab-regla5030 { padding-bottom: 40px; }

.r5030-hero {
  background: var(--feat-grad);
  border-radius: var(--r);
  padding: 22px 20px 18px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 4px 20px var(--hdr-shadow);
  position: relative;
  overflow: hidden;
}
.r5030-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(255,255,255,.15) 0%, transparent 70%);
  pointer-events: none;
}
.r5030-hero-title { font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.r5030-hero-sub   { font-size: .82rem; color: rgba(255,255,255,.8); margin-top: 4px; }
.r5030-hero-edit-btn {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s ease;
  font-family: var(--font);
}
.r5030-hero-edit-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.r5030-hero-edit-btn.active {
  background: #fff;
  color: var(--h1);
  border-color: #fff;
}

/* Editor de porcentajes */
.r5030-editor-panel {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--sh);
  animation: r5030SlideDown .25s ease-out;
}
@keyframes r5030SlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.r5030-editor-title {
  font-size: .92rem;
  font-weight: 800;
  color: var(--h1);
  margin-bottom: 4px;
}
.r5030-editor-hint {
  font-size: .74rem;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.4;
}
.r5030-slider-group {
  margin-bottom: 14px;
}
.r5030-slider-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.r5030-slider-ico {
  font-size: 1.1rem;
  margin-right: 6px;
}
.r5030-slider-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.r5030-slider-pct-badge {
  font-size: .82rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 8px;
  color: #fff;
}
.r5030-badge-needs { background: #e53935; }
.r5030-badge-wants { background: #8e24aa; }
.r5030-badge-save  { background: #2e7d32; }

.r5030-slider-wrap {
  width: 100%;
}
.r5030-range {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.r5030-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .15s;
}
.r5030-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.r5030-range-needs::-webkit-slider-thumb { background: #e53935; }
.r5030-range-wants::-webkit-slider-thumb { background: #8e24aa; }
.r5030-range-save::-webkit-slider-thumb  { background: #2e7d32; }

.r5030-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.r5030-editor-total {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.r5030-total-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--green);
}
.r5030-total-val.bad {
  color: var(--red);
}
.r5030-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.r5030-btn-reset {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font);
}
.r5030-btn-reset:hover {
  color: var(--text);
  border-color: var(--text);
}
.r5030-btn-save-pct {
  background: var(--btn-grad);
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font);
}
.r5030-btn-save-pct:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
}
.r5030-btn-save-pct:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.r5030-income-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}
.r5030-income-label {
  font-size: .78rem; font-weight: 700; color: var(--h1);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}
.r5030-income-total { display: block; font-size: 1.6rem; font-weight: 800; color: var(--h1); margin-top: 8px; }
.r5030-negative, .r5030-excess { color: var(--red) !important; }
.r5030-excess { margin-top: 6px; font-size: .78rem; font-weight: 700; }
.r5030-income-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.r5030-income-period {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 90px;
  gap: 12px;
  margin: 8px 0 16px;
}
.r5030-income-period .r5030-income-month { width: 100%; margin-bottom: 0; min-width: 0; }
#r5030-income-year { width: 110px; }
.r5030-income-month {
  display: block;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  font: inherit;
}
.r5030-income-input-wrap {
  display: flex; align-items: center;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; flex: 1 1 160px; min-width: 140px; overflow: hidden;
}
.r5030-curr { padding: 0 10px; font-weight: 700; color: var(--h1); font-size: .9rem; white-space: nowrap; }
.r5030-income-inp {
  border: none; background: transparent; padding: 10px 10px 10px 0;
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  font-family: var(--font); flex: 1; outline: none; min-width: 0;
}
.r5030-btn-auto {
  background: var(--btn-grad); color: #fff; border: none;
  border-radius: 10px; padding: 10px 14px; font-size: .8rem;
  font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: opacity .2s, transform .1s; font-family: var(--font);
}
.r5030-btn-auto:hover  { opacity: .88; transform: translateY(-1px); }
.r5030-btn-auto:active { transform: scale(.97); }
.r5030-income-hint { font-size: .77rem; color: var(--muted); margin-top: 8px; display: none; }

.r5030-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.r5030-card {
  background: var(--white); border-radius: var(--r); padding: 16px;
  box-shadow: var(--sh); border-top: 4px solid transparent;
  transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden;
}
.r5030-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 50%; opacity: .07; pointer-events: none;
}
.r5030-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.1); }

.r5030-needs { border-top-color: #e53935; }
.r5030-needs::before { background: #e53935; }
.r5030-wants { border-top-color: #8e24aa; }
.r5030-wants::before { background: #8e24aa; }
.r5030-save  { border-top-color: #2e7d32; }
.r5030-save::before  { background: #2e7d32; }

.r5030-card-hdr { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.r5030-card-ico   { font-size: 2rem; line-height: 1; }
.r5030-card-title { font-size: .88rem; font-weight: 700; color: var(--text); }
.r5030-card-pct   { font-size: 1.4rem; font-weight: 800; color: var(--h1); line-height: 1; }
.r5030-card-desc  { font-size: .74rem; color: var(--muted); margin-bottom: 12px; line-height: 1.4; }

.r5030-budget-row, .r5030-used-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}
.r5030-budget-lbl, .r5030-used-lbl { font-size: .73rem; color: var(--muted); font-weight: 600; }
.r5030-budget-val { font-size: .88rem; font-weight: 800; color: var(--h1); }
.r5030-used-val   { font-size: .88rem; font-weight: 700; color: var(--text); }

.r5030-bar-bg { background: var(--bg); border-radius: 999px; height: 8px; margin: 8px 0 4px; overflow: hidden; }
.r5030-bar-fg { height: 100%; border-radius: 999px; transition: width .55s cubic-bezier(.4,0,.2,1); min-width: 0; }
.r5030-bar-needs { background: linear-gradient(90deg, #ff6f61, #e53935); }
.r5030-bar-wants { background: linear-gradient(90deg, #ce93d8, #8e24aa); }
.r5030-bar-save  { background: linear-gradient(90deg, #66bb6a, #2e7d32); }
.r5030-bar-fg.r5030-bar-over { background: linear-gradient(90deg, #ff9800, #d32f2f) !important; }
.r5030-bar-lbl { font-size: .72rem; color: var(--muted); text-align: right; }

.r5030-summary-box {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 16px; margin-bottom: 14px; box-shadow: var(--sh);
}
.r5030-summary-title {
  font-size: .82rem; font-weight: 700; color: var(--h1);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px;
}
.r5030-stacked-bar {
  display: flex; height: 32px; border-radius: 10px;
  overflow: hidden; margin-bottom: 10px; gap: 2px;
}
.r5030-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff;
  transition: width .5s ease; min-width: 28px;
}
.r5030-seg-needs { background: linear-gradient(135deg, #ff6f61, #e53935); border-radius: 10px 0 0 10px; }
.r5030-seg-wants { background: linear-gradient(135deg, #ce93d8, #8e24aa); }
.r5030-seg-save  { background: linear-gradient(135deg, #66bb6a, #2e7d32); border-radius: 0 10px 10px 0; }

.r5030-legend {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px; font-size: .78rem; color: var(--text); font-weight: 600;
}
.r5030-leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.r5030-dot-needs { background: #e53935; }
.r5030-dot-wants { background: #8e24aa; }
.r5030-dot-save  { background: #2e7d32; }

.r5030-tot-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: .82rem; color: var(--text);
}
.r5030-tot-row:last-child { border-bottom: none; }
.r5030-tot-surplus { font-weight: 700; }
.r5030-tot-val { font-weight: 800; }
.r5030-tot-val.cg { color: var(--green); }
.r5030-tot-val.cr { color: var(--red); }
.r5030-tot-empty { text-align: center; color: var(--muted); font-size: .82rem; padding: 12px 0; }

.r5030-info {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(125,26,68,.05); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 14px;
  font-size: .78rem; color: var(--muted); line-height: 1.5;
}
.r5030-info-ico { font-size: 1.3rem; flex-shrink: 0; }
.r5030-info b  { color: var(--h1); }
.r5030-info em { color: var(--text); font-style: normal; font-weight: 600; }


/* ─── FIN MÓDULO 50/30/20 ──────────────────────────── */

/* 01. Accesibilidad compartida: conserva temas, radios, sombras e iconos. */
.mobile-only, .responsive-view-toolbar, .responsive-filter-toggle, .responsive-metrics-toggle { display: none; }
[hidden] { display: none !important; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--fuchsia); outline-offset: 2px;
}
.ui-field-error { color: var(--red); font-size: 1rem; line-height: 1.5; margin-top: 4px; }
.ui-async-status { margin: 8px 0; padding: 8px 12px; color: var(--muted); overflow-wrap: anywhere; }
.ui-async-status button { margin: 4px 8px; }
html.navigation-open, body.navigation-open, html.ui-modal-open { overflow: hidden; }
@media (min-width: 1024px) {
  .ui-modal-open .ov, .ui-modal-open .cov, .ui-modal-open #ov-yape, .ui-modal-open #ov-ibk { right: var(--ui-scrollbar-width, 0px); }
}

/* 02. Base móvil. Las propiedades visuales se heredan de cada componente. */
@media (max-width: 1023px) {
  body { font-size: 16px; }
  .mobile-only { display: flex; }
  .desktop-only { display: none !important; }
  [data-mobile-primary] { display: none !important; }
  button, summary, [role="button"], .pill, .bchip, .ic-opt, .ip-btn, .notif-btn, .avatar-btn {
    min-width: 44px; min-height: 44px;
  }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    min-width: 0; min-height: 44px; font-size: 16px !important; max-width: 100%;
  }
  label:has(input[type="checkbox"]), label:has(input[type="radio"]) {
    min-height: 44px; display: flex; align-items: center; gap: 8px;
  }
  input[type="checkbox"], input[type="radio"] { flex-shrink: 0; }
  .wrap, .home-wrap, .admin-wrap { width: 100%; min-width: 0; padding: 16px; }
  .view, .view > *, .cards > *, .home-modules > *, .metas-grid > *, .gf-dashboard-lists > * { min-width: 0; }
  .hdr { padding: max(8px, env(safe-area-inset-top)) 12px 0; }
  .hdr-top { flex-wrap: nowrap; gap: 8px; min-height: 44px; }
  .hdr-brand { min-width: 0; gap: 8px; }
  .hdr-brand > div { min-width: 0; flex: 1; }
  .hdr-brand h1 { font-size: 1.05rem; }
  .hdr-brand .sub { display: none; }
  .hdr-acts { gap: 8px; }
  .hdr-menu { padding: 8px; color: #fff; background: none; border: none; font-size: 1rem; align-items: center; justify-content: center; }
  .hdr .avatar-btn, .hdr .notif-btn { width: 44px; height: 44px; }
  .hdr-status-strip { min-height: 44px; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
  .hdr-status-strip .gf-currency-picker { width: auto; min-width: 0; gap: 8px; }
  .hdr-status-strip .gf-currency-picker select { width: 84px; }
  .hdr-status-strip .sync-badge { margin-left: 0; max-width: 52%; white-space: normal; font-size: .65rem; overflow-wrap: anywhere; order: -1; }
  .mobile-currency-label { color: #fff; font-size: .875rem; }
  #fin-nav, .mobile-import-bar { display: none; }
  .responsive-view-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .responsive-view-title { flex: 1 1 100%; font-family: var(--font-display); color: var(--h1); font-size: 1.1rem; min-width: 0; }
  .mobile-more-actions { position: relative; }
  .mobile-more-actions:not([open]) > .mobile-action-list { display: none; }
  .mobile-more-actions summary { display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .mobile-action-list { position: absolute; top: 100%; right: 0; z-index: 110; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); width: max-content; max-width: calc(100vw - 32px); }
  .mobile-action-list .bhdr { display: block; font-size: .875rem; }
  .app-drawer-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(60, 0, 20, .55); }
  .app-drawer { width: min(320px, calc(100vw - 32px)); height: 100dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
  .drawer-heading { color: var(--h1); font-family: var(--font-display); }
  .drawer-close { background: none; border: none; color: var(--muted); font-size: 1.3rem; }
  .drawer-group { margin: 16px 0 8px; color: var(--muted); font-size: .875rem; }
  .drawer-link { display: flex; align-items: center; width: 100%; text-align: left; padding: 8px 12px; background: none; border: none; color: var(--text); font-family: var(--font); font-size: 1rem; border-radius: var(--r); }
  .drawer-link[aria-current="page"] { background: var(--h1); color: #fff; }
  .responsive-filter-toggle { display: flex; align-items: center; margin-bottom: 8px; }
  .responsive-filter-panel:not(.is-expanded) { display: none !important; }
  .responsive-metrics-toggle { display: block; margin: 8px 0 16px; }
  .cards .mobile-secondary-metric { display: none; }
  .cards.show-secondary .mobile-secondary-metric { display: block; }

  /* 03. Métricas y contenido: una columna y ajuste real de importes largos. */
  .cards, .home-modules, .metas-grid, .gf-dashboard-lists, .r5030-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cards { margin-bottom: 16px; }
  .card { padding: 12px 16px; }
  .cv, .sav-big, .meta-num-val, .gf-acc-card-bal, .r5030-income-total, .r5030-budget-val, .r5030-used-val, .cc-date-val { overflow-wrap: anywhere; line-height: 1.35; }
  .cl, .cs, .nm { font-size: .875rem; }
  .eg-concept-txt, .eg-amount-val, .eg-date-cell, .gf-dash-title, .gf-dash-amount, .hm-label, .user-name, .gf-acc-item-title { font-size: 1rem; }
  .sh { flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
  .sh-t { font-size: .875rem; }
  .sh > div, .mnav-c, .user-info, .gf-dash-item > div { min-width: 0; }
  .pills { flex-wrap: wrap; gap: 8px; overflow: visible; }
  .pill, .bchip { display: inline-flex; align-items: center; justify-content: center; }
  .pill { font-size: .875rem; }
  .pb-sub, .sav-bot, .gf-dash-item, .gf-det-prog-lbl { gap: 8px; flex-wrap: wrap; }
  .gf-filter-container, .eg-filter-bar { padding: 12px; }
  .gf-filters-grid, .gf-filters { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .eg-search-wrap { min-width: 0; max-width: none; width: 100%; flex-basis: 100%; }
  .gf-accounts-strip-list { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; gap: 12px; }
  .gf-acc-card { min-width: 0; max-width: none; }
  .gf-det-title, .gf-det-dates, .gf-code-badge, .home-greeting, .hm-label, .hm-sub, .user-name, .user-role, .hist-sub, .gf-dash-title, .gf-dash-amount { overflow-wrap: anywhere; }
  .cc-bank { padding-right: 104px; overflow-wrap: anywhere; }
  .cc-holder, .cc-num { overflow-wrap: anywhere; }
  .cc-dates { flex-wrap: wrap; gap: 12px; }
  .cc-actions { gap: 8px; }
  .user-row, .gf-acc-item { flex-wrap: wrap; gap: 12px; }
  .user-actions, .gf-acc-item-right, .gf-acc-item-actions { flex-wrap: wrap; gap: 8px; }
  .user-info { flex-basis: calc(100% - 56px); }
  .gf-acc-item-left { min-width: 0; }
  .gf-acc-item-title, .gf-acc-item-sub, .gf-acc-item-balance { overflow-wrap: anywhere; }
  .pager { flex-wrap: wrap; gap: 8px; }
  .pager-btn { min-width: 44px; min-height: 44px; }
  .gf-det-hdr > div { min-width: 0; }
  .gf-det-meta .eg-badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .gf-det-table-hdr { flex-wrap: wrap; gap: 8px; }
  .r5030-income-period, .r5030-editor-grid { grid-template-columns: minmax(0, 1fr); }
  #r5030-income-year { width: 100%; }
  .r5030-income-row { flex-direction: column; }
  .r5030-budget-row, .r5030-used-row { flex-wrap: wrap; gap: 8px; }
  .r5030-editor-actions, .r5030-legend, .r5030-totals { flex-wrap: wrap; gap: 8px; }
  .r5030-legend { display: flex; }
  .app-update-control, .update-banner { flex-wrap: wrap; gap: 8px; }
  .update-banner { max-width: calc(100vw - 24px); }

  /* 04. Tablas convertidas en registros con todos sus campos; Anual conserva scroll. */
  .ui-record-table, .ui-record-table tbody { display: block; width: 100%; min-width: 0; }
  .ui-record-table thead, .ui-record-table tr:has(th) { display: none; }
  .ui-record-table tr { display: block; padding: 12px; border-bottom: 1px solid var(--border); }
  .tc .ui-record-table td, .ui-record-table td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; padding: 8px 0; text-align: left !important; white-space: normal; overflow-wrap: anywhere; border-bottom: none; flex-wrap: wrap; font-size: 1rem; }
  .ui-record-table td::before { content: attr(data-label); color: var(--muted); font-size: .875rem; font-weight: 600; }
  .ui-record-table td > * { min-width: 0; max-width: 100%; }
  .ui-record-table .acts, .ui-record-table .eg-row-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .sx:has(.ui-record-table), .gf-scroll:has(.ui-record-table) { overflow: visible; }
  .sav-input-cell { width: 100%; justify-content: flex-start; }
  .sav-inp-tbl { flex: 1; }
  .yape-table-wrap { max-width: 100%; }

  /* 05. Modales: cabecera y acciones visibles, scroll solamente del cuerpo. */
  .ov, #ov-yape, #ov-ibk { top: var(--ui-viewport-top, 0px); bottom: auto; height: var(--ui-viewport-height, 100dvh); }
  .ui-modal-layout { display: flex; flex-direction: column; max-height: calc(var(--ui-viewport-height, 100dvh) - 16px); overflow: hidden; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
  .ui-modal-layout .m-hdr { flex-shrink: 0; gap: 8px; margin-bottom: 12px; }
  .ui-modal-layout .m-ttl-wrap { min-width: 0; }
  .ui-modal-layout .m-ttl, .ui-modal-layout .m-sub { overflow-wrap: anywhere; }
  .ui-modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 4px 0; }
  .ui-modal-footer { flex-shrink: 0; padding-top: 12px; background: var(--white); }
  .ui-form-status { font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
  .ui-modal-footer .modal-actions { margin-top: 0; }
  [data-ui-fullscreen] > .modal, [data-ui-fullscreen] > .yape-modal { max-width: none; height: var(--ui-viewport-height, 100dvh); max-height: var(--ui-viewport-height, 100dvh); }
  [data-ui-fullscreen] > .ui-modal-layout { padding-top: max(16px, env(safe-area-inset-top)); }
  .yape-modal.ui-modal-layout { padding: 0; }
  .yape-modal-hdr { padding: max(16px, env(safe-area-inset-top)) 16px 16px; gap: 8px; }
  .yape-modal-body { min-height: 0; padding: 16px; overscroll-behavior: contain; }
  .yape-modal-foot { flex-wrap: wrap; gap: 8px; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
  .yape-modal-foot > button { flex: 1; }
  .fgrid, .gf-form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fg { gap: 8px; margin-bottom: 12px; }
  .fl, .auth-fg label { font-size: .875rem; }
  .quick-amounts, .icon-picker { flex-wrap: wrap; gap: 8px; }
  .quick-amounts button { flex: 1; }
  .gf-preview ol { columns: 1; }
  .ui-optional { margin: 8px 0 12px; }
  .ui-optional-summary { color: var(--muted); cursor: pointer; padding: 8px 0; font-size: 1rem; }
  .auth-card { padding: 24px 16px; }
  .auth-fg { margin-bottom: 16px; gap: 8px; }
  .prof-av-grid { gap: 12px; }
}

/* 06. Dos columnas solo cuando hay espacio; importes extensos vuelven a una. */
@media (min-width: 375px) and (max-width: 1023px) {
  .cards, .home-modules, .gf-accounts-strip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.ui-wide-amounts, .cards.large-values { grid-template-columns: minmax(0, 1fr); }
  .responsive-view-title { flex-basis: auto; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .gf-dashboard-lists, .metas-grid, .gf-filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r5030-income-period { grid-template-columns: minmax(0, 1fr) 110px 90px; }
  .r5030-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Bloqueo de acceso hasta validar servidor, sesión y recuperación. */
.connection-required { position:fixed; inset:0; z-index:99999; display:flex; align-items:center; justify-content:center; padding:20px; background:var(--bg,#fff0f5); }
.connection-required[hidden] { display:none; }
.connection-required { border:0; max-width:none; max-height:none; width:100%; height:100%; margin:0; box-sizing:border-box; }
.connection-required::backdrop { background:var(--bg,#fff0f5); }
.connection-card { max-width:440px; width:100%; padding:28px; border-radius:20px; background:var(--card,#fff); color:var(--text,#301822); box-shadow:0 8px 40px #0002; text-align:center; overflow-wrap:anywhere; }
.connection-card button { margin:8px; padding:12px 18px; border-radius:12px; cursor:pointer; }
