/* Sistema visual basado en el diseño "App de gastos personales" (Claude Design). */
:root {
  --fondo: #0E8A7A; /* color del bolsillo "fondo común" */
  --fondo-soft: #E2F4F1;
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --border: #E6E6EF;
  --border-soft: #F0F0F5;
  --text: #1B1B2F;
  --text-2: #3F4156;
  --muted: #5F6177;
  --brand: #5B4BDB;
  --brand-strong: #4A3BC4;
  --brand-hover: #35289A;
  --brand-soft: #EEEBFD;
  --brand-tint: #DAD5FA;
  --brand-line: #8B7FE8;
  --brand-dash: #C9C3F5;
  --brand-wash: #FAF9FF;
  --warm-bg: #FDEEE3;
  --warm-text: #9A3F06;
  --cool-bg: #E3F1FB;
  --cool-text: #0B4F82;
  --pos: #1F7A4D;
  --dark: #1B1B2F;
  --dark-chip: #3A2F8F;
  --dark-chip-text: #CFC8FF;
  --dark-line: #34344D;
  --dark-text: #E4E4EE;
  --dashed: #B9B9C9;
  --r-card: 20px;
  --r-kpi: 16px;
  --r-ctl: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Figtree", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
a { color: var(--brand-strong); }
a:hover { color: var(--brand-hover); }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.pequeno { font-size: 13px; }
.fuerte { font-weight: 600; }
.centro { text-align: center; }
.der { text-align: right; }
.cap { text-transform: capitalize; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.neg { color: var(--text); }
.pos { color: var(--pos); }

/* ---------- Controles ---------- */
.boton, .como-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.boton:hover, .como-boton:hover { background: var(--bg); color: var(--text); }
.boton .ic { width: 18px; height: 18px; stroke-width: 2; }
.boton.primario { height: 46px; padding: 0 20px; border: 0; background: var(--brand); color: #fff; }
.boton.primario:hover { background: var(--brand-strong); color: #fff; }
.boton:disabled { opacity: .45; cursor: default; }
.boton.primario:disabled:hover { background: var(--brand); }
.boton.ancho { width: 100%; height: 48px; }
.boton.chico { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.peligro { color: #B42318 !important; }
select, input[type="text"], input[type="search"] {
  height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 15px;
  min-width: 0;
}
select.pill { border-radius: 999px; font-size: 14px; font-weight: 600; }
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.campo .opcional { font-weight: 400; color: var(--dashed); }
.campo .ayuda { font-size: 12px; line-height: 1.4; }
.revisar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--warm-bg); color: var(--warm-text); font-size: 13px; font-weight: 500; }
.revisar .boton { height: 30px; font-size: 13px; }
.revisar small { flex-basis: 100%; font-weight: 400; }
.icono { border: 0; background: none; padding: 4px 8px; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.icono:hover { color: #B42318; background: var(--border-soft); }

.pill { display: inline-block; align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill-sube { background: var(--warm-bg); color: var(--warm-text); }
.pill-baja { background: var(--cool-bg); color: var(--cool-text); }
.pill-neutra { background: var(--border-soft); color: var(--text-2); }
.pill-marca { background: var(--brand-soft); color: var(--brand-strong); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
main { padding: 32px 40px 48px; width: 100%; min-width: 0; }
main > section { display: flex; flex-direction: column; gap: 24px; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 32px;
  padding: 28px 16px; background: var(--surface); border-right: 1px solid var(--border);
}
.marca { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.logo-marca { display: block; height: 30px; width: auto; flex: none; }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px;
  border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 500;
}
.nav-links a:hover { background: var(--bg); color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.sidebar-pie { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.escenario-activo {
  display: flex; flex-direction: column; gap: 4px; padding: 16px;
  border-radius: 14px; background: var(--bg); color: var(--text); text-decoration: none;
}
.escenario-activo:hover { color: var(--text); background: var(--brand-soft); }
.escenario-activo strong { font-size: 15px; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--muted); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--bg); }
.menu-panel {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30;
  display: flex; flex-direction: column; gap: 2px; min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(27, 27, 47, .14);
}
.menu-panel button, .menu-panel .como-boton {
  height: 38px; border: 0; background: none; justify-content: flex-start; text-align: left;
  padding: 0 10px; font-size: 14px; font-weight: 500; border-radius: 8px; cursor: pointer;
}
.menu-panel button:hover, .menu-panel .como-boton:hover { background: var(--bg); }
.menu-nota { margin: 4px 10px 6px; padding-top: 8px; border-top: 1px solid var(--border-soft); font-size: 12px; line-height: 1.4; color: var(--muted); max-width: 240px; }

.movil-header, .tabbar { display: none; }

/* ---------- Encabezados y tarjetas ---------- */
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.encabezado > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.encabezado h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.encabezado p { font-size: 15px; }
.encabezado-acciones { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.encabezado-acciones select { height: 46px; min-width: 180px; border-radius: var(--r-ctl); }
.segmentado { display: flex; padding: 4px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border); }
.segmentado button { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.segmentado button[aria-pressed="true"] { background: var(--text); color: #fff; font-weight: 600; }

.tarjeta {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.tarjeta h2 { font-size: 18px; font-weight: 600; }
.tarjeta-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fila { display: flex; gap: 24px; }
.f2 { flex: 2 1 0; }
.f3 { flex: 3 1 0; }
.vacio { align-items: center; text-align: center; padding: 56px 24px; }
.nota { margin-top: -4px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-kpi);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  color: var(--text); text-decoration: none;
}
a.kpi:hover { border-color: var(--brand-dash); color: var(--text); }
.kpi-label { font-size: 14px; color: var(--muted); }
.kpi-valor { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-sub.enlace { color: var(--brand-strong); font-weight: 600; }
.kpi .pill { white-space: normal; max-width: 100%; }

/* ---------- Gráfico mensual ---------- */
.leyenda-prom { display: flex; align-items: center; gap: 8px; }
.guion { width: 20px; border-top: 2px dashed var(--brand-line); }
.grafico-area {
  --alto: 200px;
  position: relative; height: calc(var(--alto) + 30px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  padding: 0 12px; border-bottom: 1px solid var(--border);
}
.linea-prom { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--brand-line); pointer-events: none; z-index: 1; }
.col-mes {
  flex: 1; max-width: 80px; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.col-valor { font-size: 13px; color: var(--muted); white-space: nowrap; }
.col-barra { width: 100%; max-width: 56px; border-radius: 10px 10px 0 0; background: var(--brand-tint); transition: background .15s; }
.col-mes:hover .col-barra { background: var(--brand-line); }
.col-mes.foco .col-barra { background: var(--brand); }
.col-mes.semana { cursor: default; }
.col-mes.semana:hover .col-barra { background: var(--brand-tint); }
.col-mes.semana.foco:hover .col-barra { background: var(--brand); }
.col-mes.parcial .col-barra { background: repeating-linear-gradient(135deg, var(--brand-tint) 0 6px, #EDEBFC 6px 12px); }
.col-mes.parcial.foco .col-barra { background: repeating-linear-gradient(135deg, var(--brand) 0 6px, var(--brand-line) 6px 12px); }
.sw-parcial { width: 12px; height: 12px; border-radius: 3px; margin-left: 12px; background: repeating-linear-gradient(135deg, var(--brand-tint) 0 3px, #EDEBFC 3px 6px); border: 1px solid var(--brand-tint); }
.col-mes.foco .col-valor { font-weight: 700; color: var(--text); }
.grafico-meses { display: flex; justify-content: space-between; gap: 8px; padding: 0 12px; margin-top: 8px; }
.grafico-meses span { flex: 1; max-width: 80px; text-align: center; font-size: 13px; color: var(--muted); }
.grafico-meses span.foco { font-weight: 700; color: var(--text); }

/* ---------- Barras por categoría ---------- */
.barras { display: flex; flex-direction: column; gap: 4px; }
.barra-cat {
  display: flex; flex-direction: column; gap: 8px; padding: 6px 8px; margin: 0 -8px;
  border: 0; background: none; text-align: left; border-radius: 10px; cursor: pointer;
}
.barra-cat:hover { background: var(--bg); }
.barra-cat-fila { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 500; }
.barra-cat-fila strong { font-weight: 600; }
.pista { display: block; height: 6px; border-radius: 999px; background: var(--border-soft); }
.pista span { display: block; height: 6px; border-radius: 999px; background: var(--brand); }

/* ---------- Gastos recurrentes ---------- */
.enlace-boton { border: 0; background: none; padding: 0; color: var(--brand-strong); font-size: 14px; font-weight: 600; cursor: pointer; }
.enlace-boton:hover { color: var(--brand-hover); }
.recurrentes { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.rec-resumen { display: flex; flex-direction: column; gap: 8px; }
.rec-valor { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.rec-barra { height: 10px; border-radius: 999px; background: var(--brand-tint); overflow: hidden; margin-top: 8px; }
.rec-barra span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.rec-leyenda { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.rec-leyenda span { display: flex; align-items: center; gap: 6px; }
.rec-leyenda b { color: var(--text); font-weight: 600; }
.sw-variable { background: var(--brand-tint); }
.rec-tag { color: var(--brand-strong); font-weight: 600; }
.rec-fijo { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--brand-wash); border: 1px solid var(--brand-soft); font-size: 13px; color: var(--text-2); }
.rec-fijo b { color: var(--text); }
.rec-mini {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 16px; border: 1px solid var(--brand-soft); border-radius: var(--r-ctl);
  background: var(--brand-wash); color: var(--text); font-size: 14px; cursor: pointer;
}
.rec-mini:hover, .rec-mini.activo { border-color: var(--brand-dash); background: var(--brand-soft); }
.rec-mini > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.rec-mini small { font-size: 12px; }
.rec-mini-icono { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 700; }
.rec-mini-accion { color: var(--brand-strong); font-weight: 600; white-space: nowrap; }

/* ---------- Tablas ---------- */
.tabla-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tabla-scroll.alto { max-height: 480px; overflow-y: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla th {
  text-align: left; font-weight: 500; font-size: 13px; color: var(--muted);
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.tabla th.der { text-align: right; }
.tabla td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla th:last-child, .tabla td:last-child { padding-right: 0; }
.tabla .pad-izq { padding-left: 32px; }
.tabla .fecha { white-space: nowrap; color: var(--muted); }
.tabla .desc { min-width: 200px; }
.tabla .monto { white-space: nowrap; font-weight: 600; }
.tabla select { height: 36px; padding: 0 8px; font-size: 14px; max-width: 210px; }
.tabla tr.duplicado td { opacity: .5; }
.tabla.comparar th[scope="row"] { font-size: 14px; color: var(--text-2); font-weight: 500; position: static; border-bottom-color: var(--border-soft); }
.tabla.comparar tbody tr:last-child th { border-bottom: 0; }
.origen { display: block; font-size: 12px; color: var(--muted); }
.celda-doble { display: flex; flex-direction: column; }

/* ---------- Recomendaciones ---------- */
.tarjeta.oscura { background: var(--dark); border-color: var(--dark); color: #fff; }
.consejos { display: flex; flex-direction: column; gap: 16px; }
.consejo { display: flex; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--dark-line); }
.consejo:last-child { padding-bottom: 0; border-bottom: 0; }
.consejo-n {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  background: var(--dark-chip); color: var(--dark-chip-text);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.consejo p, .consejo-vacio { font-size: 15px; line-height: 1.5; color: var(--dark-text); }
.consejo strong, .consejo b { color: #fff; }
.consejo b { font-weight: 600; }
.tarjeta.oscura .muted { color: var(--dark-text); opacity: .8; }
.tarjeta.oscura .enlace-boton, .tarjeta.oscura .enlace-fuerte { color: var(--dark-chip-text); }
.tarjeta.oscura .enlace-boton:hover, .tarjeta.oscura .enlace-fuerte:hover { color: #fff; }
.consejo .enlace-boton { white-space: nowrap; }

/* ---------- Filtros ---------- */
.filtros { display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); gap: 8px; }
.filtros select[hidden] { display: none; }

/* ---------- Calendario de pagos ---------- */
.nav-mes { display: flex; align-items: center; gap: 8px; height: 46px; }
.nav-mes strong { min-width: 150px; text-align: center; font-size: 16px; }
.nav-mes .boton { width: 36px; padding: 0; font-size: 18px; }
.leyenda.sin-borde { margin: 0; padding: 0; border: 0; gap: 14px; }
.sw-personal { background: var(--brand); }
.sw-fondo { background: var(--fondo); }
.sw-atrasado { background: var(--warm-text); }

.cal-grilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dia-nombre { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.cal-celda {
  min-height: 92px; padding: 6px; border-radius: 10px; background: var(--bg);
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.cal-celda.vacia { background: transparent; }
.cal-celda.con-pagos { background: var(--surface); border: 1px solid var(--border); padding: 5px; }
.cal-celda.hoy { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-celda.hoy .cal-num { color: var(--brand-strong); }
.chip-pago {
  display: flex; justify-content: space-between; gap: 4px; width: 100%; min-width: 0;
  padding: 3px 6px; border: 0; border-radius: 6px; cursor: pointer; text-align: left;
  font-size: 11px; line-height: 1.3; background: var(--brand-soft); color: var(--brand-strong);
}
.chip-pago.fondo { background: var(--fondo-soft); color: var(--fondo); }
.chip-pago.pagado { opacity: .55; }
.chip-pago.pagado .chip-pago-nombre { text-decoration: line-through; }
.chip-pago.atrasado { background: var(--warm-bg); color: var(--warm-text); }
.chip-pago:hover { filter: brightness(.96); }
.chip-pago-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chip-pago-monto { flex: none; }
.cal-celda .chip-pago { flex-direction: column; gap: 0; padding: 3px 5px; }
.cal-celda .chip-pago-monto { font-size: 10px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-lateral { flex: 0 0 360px; }
.cal-agenda { display: none; }
.cal-sin-dia { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cal-sin-dia:empty { display: none; }
.cal-sin-dia .agenda-items { display: flex; flex-wrap: wrap; gap: 6px; }

.bolsillo-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand-strong); white-space: nowrap; }
.bolsillo-tag.fondo { background: var(--fondo-soft); color: var(--fondo); }
.acciones-fila { white-space: nowrap; }
.acciones-fila .boton + .boton { margin-left: 6px; }

.tu-mes { display: flex; flex-direction: column; gap: 10px; }
.tu-mes-lineas { display: flex; flex-direction: column; margin-top: 6px; }
.tu-mes-lineas > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 15px; }
.tu-mes-lineas > div.total { border-bottom: 0; font-size: 17px; }
.tu-mes-lineas > div.total strong { color: var(--pos); font-size: 22px; }
.tu-mes-lineas > div.total.negativo strong { color: var(--warm-text); }
.texto-neg { color: var(--warm-text); }
.aviso-texto { color: var(--warm-text); }

.fondo-cifras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fondo-cifras > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--fondo-soft); }
.fondo-cifras strong { font-size: 20px; }
.fondo-cifras small { font-size: 12px; }
.subtitulo-tarjeta { margin: 8px 0 0; font-size: 15px; font-weight: 600; }
.input-tabla { height: 36px !important; width: 150px; text-align: right; font-size: 14px !important; }
.depositos { display: flex; flex-direction: column; }
.deposito { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto 190px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.deposito .desc { overflow-wrap: anywhere; }
.deposito select { height: 36px; font-size: 14px; }
.reparto-aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.fondo-config { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.fondo-config summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--brand-strong); margin-bottom: 12px; }

.sugerencias { display: flex; flex-direction: column; }
.sugerencia { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.sugerencia:last-child { border-bottom: 0; }

.dialogo {
  width: min(560px, calc(100vw - 32px)); padding: 24px 28px; border: 0; border-radius: var(--r-card);
  box-shadow: 0 24px 60px rgba(27, 27, 47, .3); color: var(--text);
}
.dialogo::backdrop { background: rgba(27, 27, 47, .45); }
.dialogo h2 { font-size: 20px; margin-bottom: 4px; }
.dlg-acciones { margin-top: 8px; }
.espaciador { flex: 1; }

/* ---------- Comercios ---------- */
.filtros-comercios { grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); }
.barra-seleccion {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--r-ctl); background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; font-size: 14px;
}
.barra-seleccion span { margin-right: auto; }
.tabla-comercios th.sel, .tabla-comercios td.sel { width: 28px; padding-right: 8px; }
.tabla-comercios td.sel input { width: 18px; height: 18px; accent-color: var(--brand); }
.tabla-comercios .nombre { min-width: 220px; }
.nombre-celda { display: flex; flex-direction: column; gap: 2px; }
.tabla-comercios th.parcial { color: var(--dashed); }
.tabla-comercios td { white-space: nowrap; }
.tabla-comercios tfoot td { border-top: 1px solid var(--border); border-bottom: 0; padding-top: 14px; }
.tr-click, .tabla-comercios tr.grupo { cursor: pointer; }
.tabla-comercios tr.grupo:hover td { background: var(--brand-wash); }
.tabla-comercios tr.abierto td { background: var(--brand-wash); border-bottom-color: transparent; }
.grupo-nombre { display: flex; align-items: center; gap: 8px; white-space: normal; }
.flecha { display: inline-block; width: 10px; color: var(--muted); font-size: 16px; transition: transform .15s; }
tr.abierto .flecha { transform: rotate(90deg); }
.tabla-comercios tr.detalle > td { background: var(--brand-wash); padding: 4px 16px 18px 36px; white-space: normal; }
.detalle-acciones { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.campo-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.campo-inline select { height: 36px; font-size: 14px; }
.detalle-mes { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.detalle-mes + .detalle-mes { margin-top: 8px; }
.detalle-mes-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.detalle-mes-head span { color: var(--muted); }
.detalle-mes-head b { color: var(--text); }
.detalle-mov .desc { min-width: 0; overflow-wrap: anywhere; }
.detalle-mov { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
.detalle-mov:last-child { border-bottom: 0; }

/* ---------- Cartolas ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid > *, .campo select, .campo input { min-width: 0; width: 100%; }
.zona-subida {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 32px 24px; border: 2px dashed var(--brand-dash); border-radius: 16px; background: var(--brand-wash);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.zona-subida:hover, .zona-subida.arrastrando { border-color: var(--brand); background: var(--brand-soft); }
.zona-subida strong { font-size: 16px; }
.zona-subida .boton { margin-top: 6px; pointer-events: none; }
.zona-icono { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 8px; background: var(--border-soft); font-size: 13px; max-width: 100%; }
.chip .icono { font-size: 15px; padding: 2px 6px; }

.cobertura { display: grid; grid-template-columns: minmax(140px, 220px) repeat(var(--cols, 6), minmax(0, 1fr)); gap: 8px; align-items: center; }
.cob-mes { text-align: center; font-size: 13px; color: var(--muted); }
.cob-cuenta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cob-cuenta strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cob-cuenta .enlace-boton { font-size: 12px; align-self: flex-start; padding: 6px 0; }
.cob-celda { height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 500; }
.cob-celda.cargada { background: var(--brand); color: #fff; }
.cob-celda.falta { border: 1px dashed var(--dashed); background: var(--surface); color: var(--muted); cursor: pointer; }
.cob-celda.falta:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-wash); }
.cob-vacia { grid-column: 1 / -1; }
.cobertura-wrap { container-type: inline-size; overflow-x: auto; }
/* Si la tarjeta es angosta, las celdas vacías muestran "+" en vez de "Subir". */
@container (max-width: 760px) {
  .cobertura { grid-template-columns: minmax(90px, 1fr) repeat(var(--cols, 6), minmax(0, 40px)); gap: 6px; }
  .cob-celda { height: 38px; }
  .cob-mes { font-size: 11px; }
  .cob-celda.falta { font-size: 0; }
  .cob-celda.falta::after { content: "+"; font-size: 16px; }
}
.leyenda { display: flex; flex-wrap: wrap; gap: 20px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--muted); }
.leyenda span { display: flex; align-items: center; gap: 8px; }
.sw { width: 12px; height: 12px; border-radius: 4px; }
.sw-cargada { background: var(--brand); }
.sw-falta { border: 1px dashed var(--dashed); }

.aviso { padding: 12px 16px; border-radius: var(--r-ctl); background: var(--bg); font-size: 15px; }
.aviso.ok { background: var(--brand-wash); border: 1px solid var(--brand-soft); }
.aviso.error { background: var(--warm-bg); color: var(--warm-text); }
.archivos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.archivo { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; }
.archivo > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.archivo strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archivo small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archivo b { color: var(--brand-strong); font-weight: 600; }
.archivo.error { border-color: #F2B98B; background: #FFFBF7; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Escenarios ---------- */
.escenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.escenario {
  display: flex; flex-direction: column; gap: 14px; text-align: left;
  padding: 21px 23px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; cursor: pointer;
}
.escenario:hover { border-color: var(--brand-dash); }
.escenario.activo { border: 2px solid var(--brand); padding: 20px 22px; }
.escenario-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.escenario-head strong { font-size: 17px; font-weight: 700; }
.escenario-gasto { display: flex; flex-direction: column; gap: 2px; }
.escenario-monto { font-size: 24px; font-weight: 700; }
.chips-bancos { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-bancos span { padding: 4px 10px; border-radius: 8px; background: var(--border-soft); font-size: 13px; }
.chips-bancos .vacio-chip { background: none; border: 1px dashed var(--dashed); color: var(--muted); }
.escenario.nuevo {
  align-items: center; justify-content: center; gap: 8px; min-height: 150px;
  border: 2px dashed var(--brand-dash); background: var(--brand-wash); color: var(--brand-strong); font-size: 15px; font-weight: 600;
}
.escenario.nuevo:hover { background: var(--brand-soft); }
.acciones-mini { display: flex; gap: 8px; flex-wrap: wrap; }
.grupo-banco { display: flex; flex-direction: column; gap: 4px; }
.grupo-banco + .grupo-banco { margin-top: 12px; }
.grupo-titulo { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.cuenta-fila { display: flex; align-items: center; gap: 14px; min-height: 56px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.cuenta-fila input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.cuenta-info { flex: 1; display: flex; flex-direction: column; }

/* ---------- Deudas ---------- */
.barra-apilada { display: flex; gap: 3px; height: 18px; border-radius: 999px; overflow: hidden; }
.barra-apilada span { display: block; min-width: 4px; }
.leyenda-canales { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-top: 18px; }
.leyenda-canales > div { display: flex; flex-direction: column; gap: 4px; }
.canal-nombre { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.canal-nombre i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.canal-monto { font-size: 20px; font-weight: 700; }
.canal-monto small { font-size: 13px; font-weight: 500; color: var(--muted); }
.form-deuda { display: flex; flex-direction: column; gap: 12px; }

.aviso-guardado {
  position: sticky; top: 0; z-index: 25; margin-bottom: 16px;
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  border-radius: var(--r-ctl); background: var(--warm-bg); color: var(--warm-text); border: 1px solid #F2B98B;
}
.aviso-guardado p { flex: 1; font-size: 14px; }
.panel-avisos { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-radius: var(--r-ctl); background: var(--warm-bg); color: var(--warm-text); font-size: 14px; }
.panel-avisos .enlace-boton { color: var(--warm-text); text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  padding: 10px 18px; border-radius: 999px; background: var(--dark); color: #fff;
  font-size: 14px; box-shadow: 0 8px 24px rgba(27, 27, 47, .25); max-width: calc(100vw - 32px);
}

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  main { padding: 28px 28px 40px; }
  .fila { flex-direction: column; }
  .fila > * { flex: none; }
  .recurrentes { grid-template-columns: 1fr; gap: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filtros #f-buscar, .filtros #c-buscar { grid-column: 1 / -1; }
  .filtros-comercios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar, .solo-desktop { display: none; }
  .movil-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    background: rgba(247, 247, 251, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .movil-header .marca { padding: 0; font-size: 16px; margin-right: auto; }
  .movil-header .logo-marca { height: 24px; }
  .movil-header select { max-width: 140px; height: 40px; }
  .movil-header .menu summary { font-size: 20px; line-height: 1; padding: 10px; color: var(--muted); }
  .movil-header .menu-panel { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(62px, 1fr); overflow-x: auto; scrollbar-width: none;
    height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    text-decoration: none; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: -0.01em;
  }
  .tabbar a[aria-current="page"] { color: var(--brand-strong); font-weight: 600; }
  main { padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); }
  main > section, .fila { gap: 16px; }
  .encabezado { gap: 14px; }
  .encabezado h1 { font-size: 26px; }
  .encabezado-acciones { width: 100%; }
  .encabezado-acciones .boton.primario { flex: 1; }
  .tarjeta { padding: 18px 16px; border-radius: 18px; }
  .tarjeta.vacio { padding: 32px 16px; } /* el vacío conserva aire en el celular (mismo valor que .zona-subida) */
  .tarjeta h2 { font-size: 16px; }
  .kpis, .kpis.tres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis > :first-child, .kpis > :nth-child(4):last-child { grid-column: 1 / -1; }
  .kpi { padding: 14px 16px; border-radius: 14px; }
  .kpi-valor { font-size: 22px; }
  .kpis > :first-child .kpi-valor { font-size: 34px; }
  .grafico-area { --alto: 120px; padding: 0 4px; gap: 6px; }
  .grafico-meses { padding: 0 4px; gap: 6px; }
  .col-valor { display: none; }
  .col-barra { max-width: 32px; border-radius: 8px 8px 0 0; }
  .grafico-meses span { font-size: 12px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .cob-cuenta strong { font-size: 13px; }
  .escenarios { grid-template-columns: 1fr 1fr; gap: 10px; }
  .escenario { padding: 15px 15px; gap: 10px; }
  .escenario.activo { padding: 14px; }
  .escenario-monto { font-size: 19px; }
  .escenario.nuevo { min-height: 110px; }
  .tabla { font-size: 14px; }
  .tabla .desc { min-width: 160px; }
  .tabla td { white-space: nowrap; }
  .tabla td.desc { white-space: normal; }
  .leyenda-canales { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canal-monto { font-size: 17px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .filtros-comercios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabla-comercios .nombre { min-width: 170px; }
  .rec-valor { font-size: 28px; }
  .nav-mes { width: 100%; justify-content: space-between; }
  .cal-grilla { display: none; }
  .cal-agenda { display: flex; flex-direction: column; gap: 8px; }
  .agenda-dia { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
  .agenda-dia:last-child { border-bottom: 0; }
  .agenda-fecha { width: 36px; flex: none; display: flex; flex-direction: column; align-items: center; }
  .agenda-fecha strong { font-size: 18px; }
  .agenda-fecha span { font-size: 12px; color: var(--muted); }
  .agenda-dia.hoy .agenda-fecha strong { color: var(--brand-strong); }
  .agenda-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .agenda-items .chip-pago { font-size: 13px; padding: 7px 10px; }
  .fondo-cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deposito { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .deposito select { grid-column: 1 / -1; }
  .dialogo { padding: 20px 18px; }
  .rec-mini-accion { display: none; }
  .tabla-comercios td.nombre, .tabla-comercios th.nombre { position: sticky; left: 0; background: var(--surface); z-index: 1; }
  .tabla-comercios th.nombre { z-index: 2; }
  .detalle-mov { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 8px; }
  .tabla-comercios tr.abierto td.nombre, .tabla-comercios tr.grupo:hover td.nombre { background: var(--brand-wash); }
  .tabla-comercios tr.detalle > td { padding: 4px 8px 14px; }
  .tabla-comercios tr.detalle > td > * { position: sticky; left: 8px; width: calc(100vw - 88px); }
}

/* Cuenta y sincronización con la nube */
.nube-estado { margin: 0 10px; font-size: 12px; color: var(--muted); }
.nube-estado::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #1F7A4D; vertical-align: 1px; }
.nube-estado[data-estado="guardando"]::before, .nube-estado[data-estado="cargando"]::before { background: var(--dashed); }
.nube-estado[data-estado="sin-conexion"]::before, .nube-estado[data-estado="error"]::before { background: #C2570C; }
.acciones-aviso { display: flex; flex-wrap: wrap; gap: 8px; }
#aviso-nube { flex-wrap: wrap; }
#aviso-nube p { min-width: min(100%, 280px); }
.nube-estado[data-estado="pregunta"]::before { background: #C2570C; }

/* Qué se puede hacer en cada vista (bajo el título) */
.encabezado > .ayuda-vista { flex: 1 0 100%; margin: -8px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.ayuda-vista strong { color: var(--text); }
/* Sesión: visible en el pie de la barra lateral y al inicio del menú en móvil */
.cuenta-pie { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--border-soft); }
.cuenta-pie strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuenta-pie .boton { align-self: flex-start; margin-top: 4px; }
.menu-sesion { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.menu-sesion > span { padding: 6px 10px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ----- Mi mes (portada) ----- */
.columna { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
/* Resumen del Analizador: sus KPIs y cards van dentro de un envoltorio que se oculta sin datos;
   necesita el mismo ritmo vertical que las demás vistas (24 px; 16 px en el celular). */
#panel-contenido { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 860px) { #panel-contenido { gap: 16px; } }
.kpis.cinco { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* Énfasis del DS: borde de marca sobre fondo blanco. Uno por vista, en la cifra principal
   (Inicio: disponible; Pagos: por pagar; Analizador: gasto del mes; Deudas: cuotas del mes;
   Planificación: lo que queda después del plan). */
.kpi.destacado, .tarjeta.destacada { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.respuesta { gap: 14px; }
.respuesta.atencion { border-color: #F2B98B; background: var(--warm-bg); box-shadow: none; }
.respuesta-titulo { font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.respuesta-titulo strong { font-weight: 800; color: var(--brand-strong); }
.respuesta.atencion .respuesta-titulo strong { color: var(--warm-text); }
.respuesta-detalle { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--text-2); }
.respuesta-detalle strong { color: var(--text); }
.respuesta .boton { align-self: flex-start; }
.reparto-ingreso { display: flex; gap: 3px; height: 16px; border-radius: 999px; overflow: hidden; background: var(--border-soft); }
.reparto-ingreso span { display: block; }
.reparto-ingreso .pagado, .sw-pagado { background: var(--brand); }
.reparto-ingreso .por-pagar, .sw-por-pagar { background: var(--brand-tint); }
.reparto-ingreso .disponible, .sw-disponible { background: #7BC8A4; }
.lista-pagos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.lista-pagos li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.lista-pagos li:last-child { border-bottom: 0; }
.lp-nombre { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lp-nombre strong { overflow-wrap: anywhere; } /* el nombre completo: dos pagos o deudas parecidos no deben verse iguales */
.lp-monto { white-space: nowrap; }
/* Ícono de cada pago o gasto según su categoría o tipo (assets/dominio/iconos.js): fondo suave
   del color de la categoría y el dibujo en ese color, mezclado con el texto para que se lea en
   modo claro y oscuro. */
.ico-pago {
  --c: var(--muted);
  flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 78%, var(--text));
}
.ico-pago .ic { width: 20px; height: 20px; stroke-width: 1.8; }
.ico-pago.chico { width: 28px; height: 28px; border-radius: 8px; }
.lista-proximos .ico-pago { align-self: flex-start; } /* junto al nombre, aunque debajo vengan estado y acciones */
.ico-pago.chico .ic { width: 16px; height: 16px; }
.desc-linea { display: flex; align-items: center; gap: 10px; }
.desc-linea ~ small, .desc-linea ~ .revisar { margin-left: 38px; }
.lista-avisos { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.enlace-fuerte { font-size: 14px; font-weight: 600; color: var(--brand-strong); }
.kpis.cinco .kpi-valor { font-size: 26px; }
@media (max-width: 1360px) { .kpis.cinco { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .kpis.cinco { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.cinco .kpi.destacado { grid-column: 1 / -1; }
  .respuesta-titulo { font-size: 20px; }
  .lista-pagos li { flex-wrap: wrap; }
}
#mes-desglose .tu-mes-lineas > div.total strong { color: var(--text); }

/* Tu mes (Tarea 03): el disponible es la respuesta; el resumen explica cómo se llega. */
.situacion { gap: 12px; }
.situacion-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.situacion-monto { margin: 0; font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--brand-strong); white-space: nowrap; } /* si no cabe, ajustarMontos (app.js) achica la letra */
.respuesta.atencion .situacion-monto { color: var(--warm-text); }
.situacion-sub { margin: 0; font-size: 16px; line-height: 1.45; color: var(--text-2); }
.situacion-sub strong { color: var(--text); }
.tarjeta h2.situacion-vacio-titulo { font-size: 22px; font-weight: 700; }
.situacion-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.situacion .respuesta-detalle { font-size: 14px; }
.situacion-resumen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 6px 0 0; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.situacion-resumen > div, .entender-lista > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.situacion-resumen dt, .entender-lista dt { font-size: 13px; color: var(--muted); }
.situacion-resumen dd, .entender-lista dd { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.situacion-resumen small, .entender-lista small { font-size: 12px; color: var(--muted); }
.plegable summary { cursor: pointer; width: fit-content; font-size: 14px; font-weight: 600; color: var(--brand-strong); padding: 4px 0; }
.plegable[open] summary { margin-bottom: 4px; }
.lp-acciones { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ingresos-acciones { display: flex; }
.progreso-texto { margin: 0 0 8px; font-size: 15px; line-height: 1.45; }
#mes-progreso .meta-barra + .pequeno { margin: 8px 0 0; }
.entender-lista { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.entender-lista .enlace-boton { font-size: 12px; }
.entender-lista { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.entender-patrones { padding-top: 14px; border-top: 1px solid var(--border-soft); }
.entender-patrones .subtitulo-tarjeta { margin: 0 0 8px; }
@media (max-width: 860px) {
  .situacion-monto { font-size: 42px; }
  .situacion-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entender-lista { grid-template-columns: minmax(0, 1fr); }
  /* Nombre y monto en una línea; "Marcar pagado" debajo, para no cortar el nombre. */
  #mes-pendientes .lp-nombre { flex-basis: calc(100% - 172px); }
  #mes-pendientes li .boton, .lista-ingresos .lp-acciones { margin-left: auto; }
  .lista-ingresos .lp-nombre { flex-basis: calc(100% - 120px); }
  /* En el teléfono, el disponible va primero: la ayuda de Inicio ya la dicen sus bloques. */
  [data-vista="mes"] .ayuda-vista { display: none; }
}

/* Montos sugeridos (Planificación) */
.chip-sugerido { height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.chip-sugerido:hover { border-color: var(--brand); color: var(--brand-strong); }

/* Navegación agrupada (Tarea 05) */
.sidebar { overflow-y: auto; }
.nav-links a { height: 40px; }
.nav-grupo { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.nav-grupo span { font-weight: 500; letter-spacing: 0; text-transform: none; }
@media (max-width: 860px) {
  .tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-flow: row; overflow: visible; }
}

/* Planificación */
.form-plan { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.form-plan .form-grid { align-items: end; }
.lista-metas { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.lista-metas > li { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.lista-metas > li:first-child { padding-top: 4px; }
.lista-metas > li:last-child { border-bottom: 0; }
.meta-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.meta-cabeza strong { font-size: 16px; }
.meta-barra { height: 10px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.meta-barra span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.meta-barra.cerca span { background: #E0A43A; }
.meta-barra.sobre span { background: var(--warm-text); }
.meta-texto { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.meta-texto strong { color: var(--text); }
.meta-acciones { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.meta-acciones .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--pos); }
.meta-acciones .muted.pequeno { margin-right: auto; }
.sugeridos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.celda-cambios { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
#plan-proyeccion td:first-child { min-width: 180px; }

/* Navegación: Ordenar (Inicio, Pagos, Deudas) · Entender (Analizador) · Mejorar (Planificación) */
.nav-sep { border: 0; border-top: 1px solid var(--border); margin: 10px 12px; }
.subnav { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 8px 16px; border-radius: 10px; color: var(--text-2); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.subnav a:hover { color: var(--text); background: var(--bg); }
.subnav button { flex: none; padding: 8px 16px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--text-2); font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.subnav button:hover { color: var(--text); background: var(--bg); }
.subnav button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.subnav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.menu-panel a.como-boton { text-decoration: none; }

/* Pagos */
#cal-pestanas { margin: 4px 0 0; }
.lista-proximos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.lista-proximos li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.lista-proximos li:last-child { border-bottom: 0; }
.proximos-semana { margin: 14px 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.proximos-semana:first-child { margin-top: 0; }
.lista-proximos .lp-nombre > span:last-child:not(.muted) { margin-top: 2px; }
@media (max-width: 860px) {
  .lista-proximos li { flex-wrap: wrap; row-gap: 8px; }
  .lista-proximos .lp-nombre { flex: 1 1 55%; }
  .lista-proximos .acciones-fila { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
  .lista-proximos .acciones-fila .boton + .boton { margin-left: 0; }
}

/* "+ Agregar": arriba en la barra lateral (escritorio) y flotante sobre la barra inferior (celular) */
.menu-agregar summary {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-ctl); background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
}
.menu-agregar summary:hover, .menu-agregar[open] summary { background: var(--brand-strong); color: #fff; }
.menu-agregar .menu-panel { min-width: 260px; }
.menu-agregar .menu-panel button, .menu-agregar .menu-panel .como-boton {
  display: flex; height: auto; padding: 8px 10px; flex-direction: column; align-items: flex-start; gap: 2px; color: var(--text); font-size: 15px; font-weight: 600;
}
.menu-agregar .menu-panel small { font-size: 12.5px; font-weight: 400; color: var(--muted); white-space: normal; }
.agregar-lateral { margin: 0 4px 16px; }
.agregar-lateral .menu-panel { top: calc(100% + 6px); bottom: auto; left: 0; right: 0; min-width: 0; }
.agregar-flotante { display: none; }
@media (max-width: 860px) {
  .agregar-flotante { display: block; position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 22; }
  .agregar-flotante summary { width: 56px; height: 56px; padding: 0; border-radius: 18px; box-shadow: 0 10px 24px rgba(74, 59, 196, .35); }
  .agregar-flotante summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .agregar-flotante summary .ic { width: 26px; height: 26px; stroke-width: 2.25; }
  .agregar-flotante .menu-panel { left: auto; right: 0; bottom: calc(100% + 8px); top: auto; }
  main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
}
.dialogo .form-grid { align-items: end; }

/* Barra del Analizador: pestañas y el espacio (grupo de cuentas) que se analiza */
.barra-analizador { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.barra-analizador .subnav { margin-bottom: 0; }
.espacio-sel { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.espacio-sel select { height: 40px; font-weight: 600; max-width: 200px; }
.espacio-sel a { color: var(--brand-strong); font-weight: 600; text-decoration: none; }


/* Consejos breves (Inicio y Planificación) */
.consejos-breves { gap: 12px; background: var(--brand-wash); border-color: var(--brand-tint); }
/* Asesor del mes (Inicio): análisis y hasta 3 recomendaciones (assets/dominio/asesor.js). */
.asesor h2 { display: flex; align-items: center; gap: 8px; }
.asesor h2 .ic { color: var(--brand-strong); }
.asesor-bloque + .asesor-bloque { padding-top: 16px; border-top: 1px solid var(--border-soft); }
.asesor-bloque .subtitulo-tarjeta { margin: 0 0 10px; }
.asesor-recs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.asesor-recs li { display: flex; gap: 12px; align-items: flex-start; }
.asesor-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; font-weight: 700; }
.asesor-rec { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.asesor-rec p { margin: 0; font-size: 15px; line-height: 1.5; }
.asesor-rec p.pequeno { font-size: 13px; }
.asesor-nota { margin: 0; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.consejo-breve-titulo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--brand-strong); }
.consejo-breve + .consejo-breve { padding-top: 12px; border-top: 1px solid var(--brand-tint); }
.consejo-breve p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.consejo-breve-acciones { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Cartolas cargadas en el teléfono: una fila por archivo, con "Eliminar" siempre a la vista. */
@media (max-width: 860px) {
  .tabla-cargadas thead { display: none; }
  .tabla-cargadas, .tabla-cargadas tbody { display: block; }
  #tabla-archivos tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
  #tabla-archivos td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; font-size: 14px; }
  #tabla-archivos td.fuerte { overflow-wrap: anywhere; }
  #tabla-archivos td:nth-child(4)::after { content: " movimientos"; }
  #tabla-archivos td:nth-child(5) { display: none; }
  #tabla-archivos td:last-child { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  #tabla-archivos td[colspan] { grid-column: 1 / -1; }
}

/* Fondo común como extra: sin activarlo no se ve (ver App.marcarFondo). */
body:not(.con-fondo) .solo-fondo { display: none !important; }
.cal-vistas { width: fit-content; }
.cal-vistas button { height: 40px; padding: 0 18px; font-size: 15px; }
.cal-activar-fondo { margin: 0; text-align: center; }

/* Borrar con confirmación (confirmar.js) */
.boton.boton-peligro { background: #B42318; border-color: #B42318; color: #fff; }
.boton.boton-peligro:hover { background: #912018; border-color: #912018; }
.boton.boton-peligro:disabled { opacity: .45; cursor: not-allowed; }
.confirmar-texto { display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.confirmar-texto p { margin: 0; }
.check-linea { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.check-linea input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.cal-gestion { margin: 0; text-align: center; }
.modos-reparto { width: fit-content; max-width: 100%; flex-wrap: wrap; }
.lista-checks { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.lista-checks label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.lista-checks input { width: 18px; height: 18px; }
@media (max-width: 700px) {
  .modos-reparto { flex-direction: column; width: 100%; }
  .modos-reparto button { text-align: left; }
}

/* Resumen con 12 meses: en pantallas angostas solo se rotula el mes destacado. */
@media (max-width: 860px) {
  .grafico-area.muchos .col-mes:not(.foco) .col-valor { visibility: hidden; }
  .grafico-area.muchos, .grafico-meses.muchos { gap: 3px; padding: 0 4px; }
  .grafico-meses.muchos span { font-size: 11px; }
}

/* Lectura al pie de cada tarjeta del Resumen de gastos (Lecturas): la conclusión en palabras */
.lectura { display: flex; gap: 10px; align-items: flex-start; margin-top: auto; padding: 12px 14px; border-radius: 12px; background: var(--brand-wash); border: 1px solid var(--brand-soft); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.lectura[hidden] { display: none; }
.lectura .ic { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--brand-strong); }
.lectura strong { color: var(--text); }
.tarjeta.oscura .lectura { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: var(--dark-text); }
.tarjeta.oscura .lectura strong { color: #fff; }
.tarjeta.oscura .lectura .ic { color: var(--dark-chip-text); }

/* Pestañas en celulares: en una fila no caben (y el scroll lateral no se ve), así que las cuatro
   quedan en una grilla de 2×2, todas visibles. */
@media (max-width: 480px) {
  .subnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .subnav a, .subnav button { text-align: center; padding: 8px 10px; }
  /* Un botón con texto largo baja de línea en vez de salirse de su tarjeta. */
  .boton, .como-boton { max-width: 100%; height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; white-space: normal; text-align: center; line-height: 1.25; }
  .boton.chico { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .boton.primario { min-height: 46px; }
}
/* Celulares angostos (≤ 360 px): los campos en una columna, para que las listas desplegables
   muestren la opción elegida completa. */
@media (max-width: 360px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Estado de guardado en celulares: solo cuando hay un problema (sin conexión o error). */
.nube-alerta-movil { display: none; }
@media (max-width: 860px) {
  .nube-alerta-movil:not([hidden])[data-estado="sin-conexion"], .nube-alerta-movil:not([hidden])[data-estado="error"] {
    display: block; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--warm-bg); color: var(--warm-text); font-size: 13px; font-weight: 600;
  }
}

/* Tarjeta "¿Cómo quieres que te llamemos?" (una sola vez) */
.nombre-form { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.nombre-texto { display: flex; flex-direction: column; gap: 4px; flex: 1 1 280px; }
.nombre-texto h2 { font-size: 18px; }
.nombre-fila { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; flex: 1 1 320px; }
.nombre-fila .campo { flex: 1 1 180px; }



/* ----- Ordenao 2.0 · Fase 1: entender cómo se usa la plata ----- */
/* Hallazgos (assets/entender.js › htmlHallazgos): ícono de la categoría + título + explicación +
   período. Mismo patrón visual que las listas de pagos (ico-pago) y el asesor; sin tarjeta propia. */
.hallazgos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.hallazgo { display: flex; gap: 12px; align-items: flex-start; }
.hallazgo .ico-pago { width: 32px; height: 32px; border-radius: 9px; }
.hallazgo .ico-pago .ic { width: 18px; height: 18px; }
.hallazgo-cuerpo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.hallazgo-cuerpo p { margin: 0; }
.hallazgo-titulo { font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.hallazgo-texto { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.hallazgo-texto strong { color: var(--text); }
.hallazgo-cuerpo .boton { margin-top: 4px; }
.hallazgo-evidencia { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 0; }
.hallazgo-evidencia > div { display: flex; gap: 6px; font-size: 13px; }
.hallazgo-evidencia dt { color: var(--muted); overflow-wrap: anywhere; }
.hallazgo-evidencia dd { margin: 0; font-weight: 600; color: var(--text); white-space: nowrap; }
/* ¿Dónde se va tu plata? (Inicio) */
.entender-total { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 15px; color: var(--text-2); }
.entender-total strong { font-size: 20px; color: var(--text); }
.lista-categorias .lp-nombre .pill { margin-top: 2px; }
@media (max-width: 480px) {
  .lista-categorias li { gap: 10px; }
  .lista-categorias .boton.chico { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Detalle de cada categoría en "Mayores gastos" (Análisis): la barra es el resumen del <details>. */
.cat-detalle > summary { list-style: none; }
.cat-detalle > summary::-webkit-details-marker { display: none; }
.cat-detalle[open] > summary { background: var(--bg); }
.cat-detalle-cuerpo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 12px 12px; font-size: 14px; color: var(--text-2); }
.cat-detalle-cuerpo p { margin: 0; }
.cat-detalle-cuerpo strong { color: var(--text); }
/* Tu mes habitual (Análisis) */
.habitual-lineas > div > span { display: flex; flex-direction: column; gap: 1px; }
.habitual-lineas small { font-size: 12px; }
#panel-descubrir { gap: 16px; }
.habitual-lineas > div.total strong { color: var(--text); } /* un total de gasto no es "positivo" */
/* Mayores gastos: la barra despliega su detalle; un chevron lo indica y rota al abrirse. */
.cat-detalle > summary .barra-cat-fila > span:first-child::after { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 0 2px 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.cat-detalle[open] > summary .barra-cat-fila > span:first-child::after { transform: rotate(225deg); margin-bottom: -2px; }
.cat-detalle > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Onboarding de primer uso (assets/onboarding.js, docs/ONBOARDING.md) */
.onb { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.onb-top { display: flex; align-items: center; gap: 24px; max-width: 1120px; margin: 0 auto; padding: 20px 24px; }
.onb-top .logo-marca { height: 28px; }
.onb-progreso { display: flex; gap: 6px; flex: 1; max-width: 360px; margin: 0 auto; }
.onb-progreso span { flex: 1; height: 6px; border-radius: 999px; background: var(--border); }
.onb-progreso span.hecho { background: var(--brand); }
.onb-saltar { min-height: 44px; }
.onb-hueco { visibility: hidden; display: inline-flex; align-items: center; } /* mantiene centrado el avance sin "Saltar" */
.onb-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.onb-pregunta { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.onb-etiqueta { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-strong); }
.onb-titulo { margin: 0; font-size: 36px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; outline: none; }
.onb-titulo strong { color: var(--brand-strong); font-weight: 800; }
.onb-texto { margin: 0; font-size: 17px; line-height: 1.5; color: var(--text-2); }
.onb-checks { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--text-2); }
.onb-checks li { display: flex; align-items: center; gap: 10px; }
.onb-checks .ic { color: var(--pos); stroke-width: 2.25; }
.onb-acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.onb-filas { display: flex; flex-direction: column; gap: 12px; }
.onb-fila { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 110px 44px; gap: 12px; align-items: end; }
.onb-fila input { width: 100%; }
.onb-quitar { width: 44px; height: 44px; }
.onb-sumar { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; }
.onb-sumar .ic { width: 18px; height: 18px; stroke-width: 2; }
.onb-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; margin: 0; padding: 0; list-style: none; }
.onb-opcion { display: flex; flex-direction: column; gap: 8px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); }
.onb-opcion.activa { border-color: var(--brand-line); background: var(--brand-wash); }
.onb-opcion-boton { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); text-align: left; cursor: pointer; border-radius: 10px; }
.onb-check { display: flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border: 1.5px solid var(--dashed); border-radius: 6px; background: var(--surface); }
.onb-opcion.activa .onb-check { border-color: var(--brand); background: var(--brand); color: #fff; }
.onb-check .ic { width: 16px; height: 16px; stroke-width: 2.5; }
.onb-opcion-monto { padding: 0 6px 6px 42px; }
.onb-opcion-monto input { width: 100%; }
.onb-sino { display: flex; flex-wrap: wrap; gap: 10px; }
.onb-sino .boton.activo { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.onb-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.onb-pie .enlace-boton { min-height: 44px; }
.onb-mes { gap: 10px; position: sticky; top: 24px; }
.onb-mes-titulo { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.onb-mes-monto { margin: 0; font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--brand-strong); white-space: nowrap; }
.onb-mes-monto.alerta { color: var(--warm-text); }
.onb-mes-vacio { color: var(--dashed); }
.onb-mes-filas { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 0; }
.onb-mes-filas > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.onb-mes-filas > div.actual { background: var(--brand-soft); }
.onb-mes-filas dt { color: var(--text-2); }
.onb-mes-filas dd { margin: 0; font-weight: 700; }
.onb-mes-barra { height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.onb-mes-barra span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.onb-historia { margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--brand-wash); color: var(--text-2); font-size: 14px; }
.onb-revela-titulo { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 22px; font-weight: 700; outline: none; }
.onb-revela-monto { font-size: 64px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--brand-strong); white-space: nowrap; }
.onb-revela-monto.alerta { color: var(--warm-text); }
.onb-revela-nota { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--text-2); font-size: 16px; line-height: 1.5; }
.onb-revela-nota strong { color: var(--text); }
.onb-revela-nota.alerta { background: var(--warm-bg); color: var(--warm-text); }
.onb-resto { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 8px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.onb-resto h2 { margin: 0; font-size: 18px; font-weight: 700; }
.onb-resto p { margin: 0; color: var(--text-2); line-height: 1.5; }
.onb-resto-lista { display: flex; flex-direction: column; gap: 4px; margin: 0; padding-left: 20px; color: var(--text-2); line-height: 1.5; }
.onb-consejo { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--brand-wash); color: var(--text-2); font-size: 14px; line-height: 1.5; }
.onb-adelante { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0 0 0 18px; color: var(--text-2); line-height: 1.5; }
.onb-adelante .enlace-boton { font-size: 15px; }
.onb-barra-movil { display: none; }
@media (max-width: 860px) {
  .onb-top { gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
  .onb-top .logo-marca { height: 24px; }
  .onb-progreso { order: 3; flex-basis: 100%; max-width: none; }
  .onb-saltar { margin-left: auto; font-size: 13px; }
  .onb-barra-movil { display: block; position: sticky; top: 0; z-index: 2; margin: 0; padding: 10px 16px; background: var(--brand-soft); color: var(--brand-strong); font-size: 15px; }
  .onb-barra-movil.alerta { background: var(--warm-bg); color: var(--warm-text); }
  .onb-barra-movil[hidden] { display: none; }
  .onb-cuerpo { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 20px 16px 120px; }
  .onb-mes { display: none; }
  .onb-titulo { font-size: 28px; }
  .onb-revela-monto { font-size: 48px; }
  /* Con dos botones abajo, el contenido deja espacio para ambos */
  .onb-cuerpo { padding-bottom: 170px; }
  .onb-texto { font-size: 16px; }
  .onb-fila { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .onb-opciones { grid-template-columns: minmax(0, 1fr); }
  .onb-sino .boton { flex: 1; }
  .onb-fila .campo:first-child { grid-column: 1 / -1; }
  .onb-acciones .boton, .onb-pie .boton { width: 100%; }
  .onb-acciones { flex-direction: column; }
  /* Botón principal abajo, de ancho completo */
  .onb-acciones, .onb-pie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
  .onb-pie .enlace-boton { flex: none; }
}

/* "Esto encontramos en tu plata" (Análisis, después de subir una cartola) */
#t-descubrir { outline: none; }
#panel-descubrir { scroll-margin-top: 16px; }
@media (max-width: 860px) { #panel-descubrir { scroll-margin-top: 80px; } } /* bajo la barra superior fija del celular */
.descubrir-bloque { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.descubrir-bloque:first-child { padding-top: 0; border-top: 0; }
.descubrir-bloque p { margin: 0; line-height: 1.5; }
.descubrir-bloque .hallazgos, .barras-top { width: 100%; }
.descubrir-consejo { padding: 14px; border: 0; border-radius: 12px; background: var(--brand-wash); }
.barras-top { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.barras-top li { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.barra-top { height: 10px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.barra-top span { display: block; height: 100%; border-radius: 999px; }
@media (max-width: 860px) { .barras-top li { grid-template-columns: minmax(0, 1fr) 70px auto; font-size: 14px; } }

/* ---------- Mis categorías (assets/categoria-nueva.js) ---------- */
.filtros [data-accion="mis-categorias"] { grid-column: 1 / -1; justify-self: end; }
.mis-categorias { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.mis-categorias li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); }
.mis-categorias .punto { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--c); }
.mis-categorias .nombre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mis-categorias .nombre strong { overflow-wrap: anywhere; }
.mis-categorias .vacio { border: 0; padding: 4px 0; }
