/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F5F7FA;
  color: #1E293B;
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Nav ──────────────────────────────────────────────── */
.topnav {
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.nav-brand span { color: #E84040; }
.nav-links { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nav-links a {
  color: #64748B;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: .35rem .7rem;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: #F1F5F9; color: #1E293B; }
.nav-links a.active { color: #E84040; background: #FEF2F2; }
.nav-badge {
  background: #E84040;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  margin-left: 2px;
  vertical-align: middle;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem 1rem; border-radius: 8px;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all .15s;
}
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-primary { background: #E84040; color: #fff; }
.btn-primary:hover { background: #C0392B; }
.btn-ghost { background: transparent; color: #64748B; border: 1px solid #E2E8F0; }
.btn-ghost:hover { background: #F8FAFC; color: #1E293B; }
.btn-green { background: #22C55E; color: #fff; }
.btn-green:hover { background: #16A34A; }

/* ── Container ────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a2744 0%, #0f1e3d 100%);
  margin: -1.5rem -1rem 1.5rem;
  padding: 2.5rem 1.5rem 2.2rem;
  border-radius: 0 0 28px 28px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15,30,61,.25);
}
.hero-label { font-size: .85rem; color: rgba(255,255,255,.55); font-weight: 500; margin-bottom: .4rem; letter-spacing: .5px; text-transform: uppercase; }
.hero-amount {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero-meta { font-size: .8rem; color: rgba(255,255,255,.4); margin-top: .5rem; }

/* ── Bank cards horizontal row ───────────────────────── */
.bank-cards-row {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding: .5rem 0 1rem;
  scrollbar-width: none;
}
.bank-cards-row::-webkit-scrollbar { display: none; }

.bank-card {
  flex: 0 0 auto;
  background: #fff;
  border: 2px solid #E2E8F0;
  border-top: 4px solid #E84040;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: #1E293B;
  transition: all .18s;
  min-width: 165px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.bank-card:hover { border-color: #E84040; box-shadow: 0 6px 18px rgba(232,64,64,.15); transform: translateY(-2px); }
.bank-card.active { border-color: #E84040; border-top-color: #E84040; background: #FFF5F5; box-shadow: 0 4px 16px rgba(232,64,64,.2); }
.bank-card-icon { font-size: 1.6rem; margin-bottom: .5rem; }
.bank-card-name { font-size: .72rem; font-weight: 700; color: #64748B; text-transform: uppercase; letter-spacing: .6px; }
.bank-card-balance { font-size: 1.2rem; font-weight: 800; color: #1E293B; margin-top: .25rem; }
.bank-card-sub { font-size: .7rem; color: #94A3B8; margin-top: 2px; }
.bank-card-all { border-top-color: #0f1e3d; }
.bank-card-all .bank-card-name { color: #0f1e3d; }

/* ── Month timeline ──────────────────────────────────── */
.month-timeline {
  display: flex;
  align-items: center;
  gap: .25rem;
  overflow-x: auto;
  padding: .5rem 0;
  scrollbar-width: none;
  margin-bottom: 1rem;
}
.month-timeline::-webkit-scrollbar { display: none; }
.month-btn {
  flex: 0 0 auto;
  padding: .4rem .7rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: all .15s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}
.month-btn:hover { color: #1E293B; background: #F1F5F9; }
.month-btn.active {
  color: #E84040;
  background: #FEF2F2;
  font-weight: 700;
}
.month-btn .month-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.month-btn.has-data .month-dot { opacity: 1; }

/* ── 3 stat cards ─────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  border: 1px solid #F1F5F9;
  border-left: 4px solid transparent;
}
.stat-card.ingresos { border-left-color: #16A34A; }
.stat-card.gastos { border-left-color: #DC2626; }
.stat-card.neto { border-left-color: #6366F1; }
.stat-card-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .4rem;
}
.stat-card.ingresos .stat-card-label { color: #16A34A; }
.stat-card.gastos .stat-card-label { color: #DC2626; }
.stat-card.neto .stat-card-label { color: #64748B; }
.stat-card-amount {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.5px;
}
.stat-card.ingresos .stat-card-amount { color: #16A34A; }
.stat-card.gastos .stat-card-amount { color: #DC2626; }
.stat-card.neto .stat-card-amount { color: #1E293B; }
.stat-card-neto-pos { color: #16A34A !important; }
.stat-card-neto-neg { color: #DC2626 !important; }

/* ── Summary cards grid ──────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  border: 1px solid #F1F5F9;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all .2s;
}
.summary-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.12); transform: translateY(-3px); }
.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .75rem;
}
.summary-card-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748B;
}
.summary-card-arrow {
  color: #CBD5E1;
  font-size: 1rem;
}
.summary-card:hover .summary-card-arrow { color: #E84040; }

/* Gastos Recurrentes card */
.recurrentes-card .summary-card-title { color: #7C3AED; }
.recurrentes-card .rc-count {
  font-size: 2rem;
  font-weight: 700;
  color: #1E293B;
  line-height: 1;
}
.recurrentes-card .rc-label {
  font-size: .75rem;
  color: #64748B;
  margin-bottom: .6rem;
}
.recurrentes-card .rc-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: #DC2626;
}
.recurrentes-card .rc-total-label { font-size: .75rem; color: #64748B; }
.recurrentes-card .rc-banks {
  margin-top: .6rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.rc-bank-chip {
  font-size: .7rem;
  background: #F3F0FF;
  color: #7C3AED;
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 600;
}

/* Gastos fijos card */
.gastos-fijos-card .gf-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: .85rem;
}
.gastos-fijos-card .gf-item:last-child { border-bottom: none; }
.gf-item-info { display: flex; flex-direction: column; }
.gf-item-name { font-weight: 600; color: #1E293B; font-size: .85rem; }
.gf-item-meta { font-size: .7rem; color: #94A3B8; }
.gf-item-amount { font-weight: 700; color: #DC2626; font-size: .9rem; white-space: nowrap; }
.gastos-fijos-card .gf-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .75rem; padding-top: .5rem; border-top: 2px solid #F1F5F9;
  font-weight: 700; font-size: .9rem;
}
.gf-total-amount { color: #DC2626; }

/* Últimos movimientos card */
.ultimos-card .um-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px solid #F1F5F9;
  gap: .5rem;
}
.ultimos-card .um-item:last-child { border-bottom: none; }
.um-item-left { display: flex; flex-direction: column; min-width: 0; }
.um-item-desc { font-size: .82rem; font-weight: 600; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-item-bank { font-size: .7rem; color: #94A3B8; }
.um-item-right { text-align: right; white-space: nowrap; }
.um-item-amount { font-size: .9rem; font-weight: 700; }
.um-item-amount.gasto { color: #DC2626; }
.um-item-amount.ingreso { color: #16A34A; }
.um-item-date { font-size: .7rem; color: #94A3B8; }

/* ── Chart section ────────────────────────────────────── */
.chart-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid #F1F5F9;
  margin-bottom: 1.5rem;
}
.chart-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748B;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chart-legend { display: flex; gap: 1rem; font-size: .75rem; font-weight: 600; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-ingresos .legend-dot { background: #22C55E; }
.legend-gastos .legend-dot { background: #EF4444; }
canvas#monthChart { max-height: 180px; }

/* ── Category breakdown ───────────────────────────────── */
.cat-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid #F1F5F9;
  margin-bottom: 1.5rem;
}
.cat-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748B;
  margin-bottom: 1rem;
}
.cat-list { display: flex; flex-direction: column; gap: .5rem; }
.cat-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 8px;
  transition: background .12s;
}
.cat-row:hover { background: #F8FAFC; }
.cat-icon { font-size: 1.1rem; width: 28px; text-align: center; flex-shrink: 0; }
.cat-bar-wrap { flex: 1; }
.cat-name { font-size: .82rem; font-weight: 600; color: #1E293B; }
.cat-bar {
  height: 4px; border-radius: 2px; margin-top: 3px;
  background: #E84040; opacity: .7;
  transition: width .3s ease;
}
.cat-amount { font-size: .85rem; font-weight: 700; color: #DC2626; white-space: nowrap; }

/* ── Transactions section ─────────────────────────────── */
.tx-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  border: 1px solid #F1F5F9;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.tx-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: .75rem;
}
.tx-tab {
  padding: .35rem .9rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: #64748B;
  transition: all .15s;
}
.tx-tab:hover { background: #F1F5F9; }
.tx-tab.active { background: #E84040; color: #fff; }

.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #94A3B8;
  padding: .5rem .75rem;
  border-bottom: 1px solid #F1F5F9;
}
.tx-table td {
  padding: .65rem .75rem;
  font-size: .85rem;
  border-bottom: 1px solid #F8FAFC;
  vertical-align: middle;
}
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tr:hover td { background: #FAFAFA; }
.tx-desc { font-weight: 600; color: #1E293B; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-bank { font-size: .7rem; color: #94A3B8; display: block; }
.tx-date { color: #64748B; font-size: .8rem; white-space: nowrap; }
.tx-cat select {
  font-size: .75rem;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: .2rem .4rem;
  background: #fff;
  color: #1E293B;
  cursor: pointer;
  max-width: 155px;
}
.tx-amount { font-weight: 700; text-align: right; white-space: nowrap; }
.tx-amount.gasto { color: #DC2626; }
.tx-amount.ingreso { color: #16A34A; }

/* ── Sin categorizar badge ────────────────────────────── */
.uncat-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: .3rem .8rem;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}
.uncat-badge:hover { background: #FDE68A; }

/* ── Gastos Recurrentes detail page ──────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: #1E293B; }
.page-header .back-link {
  color: #64748B; text-decoration: none; font-size: .85rem;
  display: flex; align-items: center; gap: .3rem;
}
.page-header .back-link:hover { color: #E84040; }

.rc-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.rc-summary-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid #F1F5F9;
}
.rc-summary-card .label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #64748B; }
.rc-summary-card .value { font-size: 1.6rem; font-weight: 700; color: #7C3AED; margin-top: .2rem; }
.rc-summary-card .value.red { color: #DC2626; }

.rc-bank-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid #F1F5F9;
  margin-bottom: 1rem;
}
.rc-bank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid #F1F5F9;
}
.rc-bank-name { font-size: .95rem; font-weight: 700; color: #1E293B; }
.rc-bank-total { font-size: 1rem; font-weight: 700; color: #DC2626; }

.rc-expense-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid #F8FAFC;
  gap: 1rem;
}
.rc-expense-row:last-child { border-bottom: none; }
.rc-expense-info { display: flex; flex-direction: column; }
.rc-expense-name { font-size: .875rem; font-weight: 600; color: #1E293B; }
.rc-expense-cat { font-size: .7rem; color: #94A3B8; margin-top: 1px; }
.rc-expense-meta { font-size: .7rem; color: #64748B; }
.rc-expense-amount { font-size: 1rem; font-weight: 700; color: #DC2626; white-space: nowrap; }

/* ── Alerts / notice ──────────────────────────────────── */
.notice { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 8px; padding: .75rem 1rem; font-size: .85rem; color: #166534; margin-bottom: 1rem; }
.notice.warn { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }

/* ── Stat card as link ────────────────────────────────── */
.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.stat-card-link:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

/* ── Category section with tabs ───────────────────────── */
.cat-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.cat-tabs {
  display: flex;
  gap: .35rem;
}
.cat-tab {
  padding: .3rem .75rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #fff;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: #64748B;
  transition: all .15s;
}
.cat-tab:hover { background: #F1F5F9; color: #1E293B; }
.cat-tab.active { background: #E84040; color: #fff; border-color: #E84040; }

/* cat-row as link */
.cat-row { text-decoration: none; color: inherit; }
.cat-amount.ingreso { color: #16A34A; }

/* ── Category preview in summary card ─────────────────── */
.cat-preview-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem 0;
}
.cat-preview-icon { font-size: .9rem; width: 20px; text-align: center; flex-shrink: 0; }
.cat-preview-bar-wrap { flex: 1; }
.cat-preview-name { font-size: .75rem; font-weight: 600; color: #1E293B; margin-bottom: 2px; }
.cat-preview-bar { height: 3px; border-radius: 2px; min-width: 4px; }
.cat-preview-amount { font-size: .78rem; font-weight: 700; color: #DC2626; white-space: nowrap; }

/* ── Recurrentes preview in dashboard card ────────────── */
.rc-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .3rem 0;
  border-top: 1px solid #F1F5F9;
  font-size: .78rem;
}
.rc-preview-desc { color: #475569; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.rc-preview-amount { color: #DC2626; font-weight: 700; white-space: nowrap; }
.rc-more { font-size: .75rem; color: #E84040; font-weight: 600; margin-top: .4rem; text-align: right; }

/* ── Page header (transacciones, recurrentes) ─────────── */
.page-title { font-size: 1.5rem; font-weight: 800; color: #1E293B; }
.page-subtitle { font-size: .85rem; color: #94A3B8; margin-top: .2rem; }
.back-link { color: #64748B; text-decoration: none; font-size: .85rem; white-space: nowrap; }
.back-link:hover { color: #E84040; }
.page-header { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1.5rem; }

/* ── Gastos Recurrentes page ──────────────────────────── */
.recur-hero {
  background: linear-gradient(135deg, #1a2744 0%, #0f1e3d 100%);
  border-radius: 18px;
  padding: 1.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.recur-hero-item {
  text-align: center;
  padding: .5rem 2rem;
}
.recur-hero-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
}
.recur-hero-value { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.recur-hero-label { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: .3rem; text-transform: uppercase; letter-spacing: .5px; }

.recur-filter {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.recur-filter-btn {
  padding: .3rem .75rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #fff;
  font-size: .8rem;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  transition: all .15s;
}
.recur-filter-btn:hover { background: #F1F5F9; color: #1E293B; }
.recur-filter-btn.active { background: #7C3AED; color: #fff; border-color: #7C3AED; }

.recur-list {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #F1F5F9;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  overflow: hidden;
  margin-bottom: 1rem;
}
.recur-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #F8FAFC;
  transition: background .12s;
}
.recur-item:last-child { border-bottom: none; }
.recur-item:hover { background: #FAFAFA; }
.recur-item-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.recur-item-info { flex: 1; min-width: 0; }
.recur-item-desc { font-size: .9rem; font-weight: 600; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recur-item-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.recur-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-fixed { background: #D1FAE5; color: #065F46; }
.badge-var { background: #FEF3C7; color: #92400E; }
.recur-months { font-size: .72rem; color: #94A3B8; }
.recur-cat { font-size: .72rem; color: #64748B; }
.recur-item-amounts { text-align: right; flex-shrink: 0; }
.recur-item-avg { font-size: 1rem; font-weight: 700; color: #DC2626; }
.recur-item-avg span { font-size: .7rem; font-weight: 400; color: #94A3B8; }
.recur-item-range { font-size: .7rem; color: #94A3B8; margin-top: 2px; }

.recur-total-bar {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #FEE2E2;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  font-weight: 600;
  color: #1E293B;
}
.recur-total-amount { font-size: 1.3rem; font-weight: 800; color: #DC2626; }

/* ── Transaction filters (transacciones.php) ──────────── */
.tx-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tx-filters .tx-tabs { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.tx-tab { text-decoration: none; }
.tx-cat-filter select {
  font-size: .82rem;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: .35rem .7rem;
  background: #fff;
  color: #1E293B;
  cursor: pointer;
}
.tx-acct { font-size: .7rem; color: #94A3B8; display: block; }
.tx-bank { color: #64748B; font-size: .78rem; }

/* ── Nav dot ──────────────────────────────────────────── */
.nav-dot { color: #E84040; }

/* ── Últimos movimientos amount without wrapper ───────── */
.um-item { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; border-bottom: 1px solid #F1F5F9; gap: .5rem; }
.um-item:last-child { border-bottom: none; }
.um-item-amount { font-size: .9rem; font-weight: 700; white-space: nowrap; }
.um-item-amount.gasto { color: #DC2626; }
.um-item-amount.ingreso { color: #16A34A; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-cards .neto { grid-column: 1/-1; }
  .hero-amount { font-size: 2.2rem; }
  .tx-table th:nth-child(3), .tx-table td:nth-child(3) { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .recur-hero { flex-direction: column; gap: 1rem; }
  .recur-hero-divider { width: 60px; height: 1px; }
  .recur-item { flex-wrap: wrap; }
  .cat-section-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ── Login ────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2744 0%, #0f1e3d 55%, #1a2744 100%);
  background-size: 200% 200%;
  animation: loginGradient 12s ease infinite;
  padding: 1.5rem;
}
@keyframes loginGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 22px;
  padding: 2.5rem 2.2rem 2.2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.1);
  text-align: center;
  animation: loginPop .45s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes loginPop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #E84040, #C0392B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 8px 20px rgba(232,64,64,.35);
}
.login-box h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: -.3px;
}
.login-sub {
  font-size: .85rem;
  color: #94A3B8;
  margin-top: .3rem;
  margin-bottom: 1.6rem;
}
.login-box .form-group {
  text-align: left;
  margin-bottom: 1.1rem;
}
.login-box .form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: .4rem;
}
.login-box .form-group input {
  width: 100%;
  font-size: .95rem;
  padding: .7rem .9rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
  color: #1E293B;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-box .form-group input:focus {
  outline: none;
  border-color: #E84040;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(232,64,64,.12);
}
.btn-full { width: 100%; justify-content: center; }
.login-box .btn-primary {
  padding: .8rem 1rem;
  font-size: .95rem;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(232,64,64,.3);
}
.login-box .btn-primary:hover { box-shadow: 0 8px 20px rgba(192,57,43,.4); }

.login-box .alert-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
  text-align: left;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.3rem 0;
  color: #CBD5E1;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .7rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #E2E8F0;
  background: #fff;
  color: #1E293B;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn-google:hover { background: #F8FAFC; border-color: #CBD5E1; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.login-footer {
  margin-top: 1.6rem;
  font-size: .72rem;
  color: #94A3B8;
}

@media (max-width: 420px) {
  .login-box { padding: 2rem 1.5rem 1.8rem; border-radius: 18px; }
}
