/* ========================================
   SKELETON LOADING
   ======================================== */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
  display: block;
}

.skeleton-card {
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(10,37,64,0.08);
}

/* Ocultar skeleton una vez cargado */
.page-loaded .skeleton-overlay { display: none !important; }
.page-loaded .main-content     { opacity: 1 !important; }
.main-content { transition: opacity 0.25s ease; }

/* ========================================
   FIN SKELETON LOADING
   ======================================== */

/* --- ALERTAS CON TÍTULO Y BOTÓN DE CIERRE --- */
.alert-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 0.5em;
}
.alert-title .close {
  margin-left: 1em;
  font-size: 1.5em;
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2em;
}

@media (max-width: 768px) {
  .alert-title {
    font-size: 1em;
    margin-bottom: 0.4em;
  }
  .alert-title .close {
    font-size: 1.7em;
    margin-left: 0.5em;
    padding: 0 0.1em;
  }
  .alert, .flash, .notice {
    padding-right: 1em !important;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require navbar
 *= require_self
 */

/* Custom Styles for Finanzas App - Corporate Theme */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #F5F7FA;
  color: #0A2540;
  margin: 0;
}

/* Cards con estilo corporativo */
.card {
  background: #FFFFFF;
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.08);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(10, 37, 64, 0.12);
}

/* Textos principales */
h1, h2, h3, h4, h5, h6 {
  color: #0A2540;
}

/* Links con color aqua-menta */
a {
  color: #3DE2C2;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #2BC9AA;
  text-decoration: none;
}

/* Botones primarios con aqua-menta */
.btn-primary {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  border: none;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(61, 226, 194, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2BC9AA 0%, #1FB599 100%);
  box-shadow: 0 4px 12px rgba(61, 226, 194, 0.4);
  transform: translateY(-1px);
}

/* Botón de gestionar */
.btn-manage {
  background: rgba(61, 226, 194, 0.1);
  color: #0A2540;
  border: 1px solid rgba(61, 226, 194, 0.3);
  border-radius: 8px;
  font-size: 0.875rem;
}

.btn-manage:hover {
  background: rgba(61, 226, 194, 0.2);
  color: #0A2540;
}

/* Link "ver más" */
.link-view-more {
  color: #3DE2C2;
  font-size: 0.875rem;
}

.link-view-more:hover {
  color: #2BC9AA;
}

/* Botón de agregar (CTA) */
.btn-add-primary {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 20px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(61, 226, 194, 0.25);
}

.btn-add-primary:hover {
  background: linear-gradient(135deg, #2BC9AA 0%, #1FB599 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(61, 226, 194, 0.35);
}

/* Contenedor principal con ancho máximo */
.main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   MEJORAS PARA MÓVIL - UX OPTIMIZADA
   ======================================== */

/* Prevenir zoom en inputs (iOS) - font-size mínimo 16px */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea,
.form-control,
.form-select {
  font-size: max(16px, 1rem) !important;
}

/* Formularios más compactos en móvil */
@media (max-width: 768px) {
  .main-container {
    padding: 0 12px;
  }
  
  /* Selectores y inputs más pequeños */
  .form-select,
  .form-control {
    padding: 0.5rem 0.75rem !important;
    height: auto !important;
    min-height: 38px;
  }
  
  /* Labels más compactos */
  .form-label {
    font-size: 0.75rem !important;
    margin-bottom: 0.25rem !important;
    font-weight: 600;
  }
  
  /* Botones más pequeños */
  .btn {
    font-size: 0.875rem !important;
    padding: 0.5rem 0.875rem !important;
  }
  
  .btn-sm {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.625rem !important;
  }
  
  /* Cards más compactos */
  .card {
    border-radius: 12px;
  }
  
  .card-body {
    padding: 1rem !important;
  }
  
  .card-header {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
  }
  
  /* Títulos más pequeños en móvil */
  h1 {
    font-size: 1.75rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  h4 {
    font-size: 1.1rem !important;
  }
  
  h5 {
    font-size: 1rem !important;
  }
  
  /* Reducir padding general */
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  
  .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  
  /* Page header más compacto */
  .page-header {
    margin-bottom: 1rem !important;
  }
  
  .page-header h2 {
    margin-bottom: 0.5rem !important;
  }
  
  /* Formularios en filas - hacerlos más compactos */
  .row.g-2 > * {
    padding-right: 0.375rem !important;
    padding-left: 0.375rem !important;
  }
  
  /* Inputs en grupos más compactos */
  .input-group-text {
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
  }
  
  /* Badges más pequeños */
  .badge {
    font-size: 0.7rem !important;
    padding: 0.3em 0.5em !important;
  }
  
  /* Stats cards más compactas */
  .stat-card .card-body {
    padding: 1rem !important;
  }
  
  .stat-card h2 {
    font-size: 1.5rem !important;
  }
  
  .stat-card h6 {
    font-size: 0.7rem !important;
  }
  
  .stat-icon {
    font-size: 2.5rem !important;
    opacity: 0.08 !important;
  }
  
  /* Tablas responsive más compactas */
  .table-responsive {
    font-size: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table th,
  .table td {
    padding: 0.4rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }
  
  /* Hacer columnas más estrechas en móvil */
  .table thead th {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Botones en tablas más pequeños */
  .table .btn-sm {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.7rem !important;
  }
  
  .table .btn-sm i {
    font-size: 0.75rem;
  }
  
  /* Badges en tablas más pequeños */
  .table .badge {
    font-size: 0.65rem !important;
    padding: 0.25em 0.4em !important;
  }
  
  /* Ocultar columnas menos importantes en móvil */
  .table .d-none-mobile {
    display: none !important;
  }
  
  /* Alertas más compactas */
  .alert {
    padding: 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  /* Modals más amigables */
  .modal-header,
  .modal-footer {
    padding: 0.75rem 1rem !important;
  }
  
  .modal-body {
    padding: 1rem !important;
  }
}

/* Para pantallas muy pequeñas (< 576px) */
@media (max-width: 576px) {
  .main-container {
    padding: 0 8px;
  }
  
  /* Selectores aún más compactos */
  .form-select,
  .form-control {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.6rem !important;
    min-height: 36px;
  }
  
  /* Hacer columnas full-width en móvil pequeño */
  .col-auto {
    width: 100%;
  }
  
  .col-auto .form-select,
  .col-auto .btn {
    width: 100%;
  }
  
  /* Ocultar labels "Vista:" en móvil muy pequeño para ahorrar espacio */
  .form-label.small {
    font-size: 0.7rem !important;
  }
  
  /* Botones de acción más compactos */
  .btn-group-sm > .btn {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.7rem !important;
  }
  
  /* Cards con menos padding */
  .card-body {
    padding: 0.75rem !important;
  }
  
  /* Gráficos más pequeños */
  .chart-container {
    height: 250px !important;
  }
  
  /* Filtros del dashboard más compactos */
  .dashboard-filters .form-select {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.5rem !important;
    background-size: 12px 12px;
  }
  
  .dashboard-filters .btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Filtros ultra compactos para móvil */
  .dashboard-filters-compact .form-select {
    font-size: 0.7rem !important;
    padding: 0.3rem 1.5rem 0.3rem 0.4rem !important;
    background-size: 10px 10px;
    background-position: right 0.3rem center;
    min-height: 32px;
    line-height: 1.2;
  }
  
  .dashboard-filters-compact .btn {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.85rem !important;
    min-height: 32px;
  }
  
  /* Card de filtros más compacto */
  .bg-light {
    background-color: #f8f9fa !important;
  }
}

/* Estilos adicionales para filtros compactos (todos los tamaños) */
.dashboard-filters-compact,
.transactions-filters-compact {
  width: 100%;
}

.dashboard-filters-compact .form-select,
.transactions-filters-compact .form-select {
  border-color: #dee2e6;
  transition: border-color 0.15s ease-in-out;
}

.dashboard-filters-compact .form-select:focus,
.transactions-filters-compact .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Filtros de transacciones compactos en móvil */
@media (max-width: 768px) {
  .transactions-filters-compact .form-select {
    font-size: 0.7rem !important;
    padding: 0.3rem 1.5rem 0.3rem 0.4rem !important;
    background-size: 10px 10px;
    background-position: right 0.3rem center;
    min-height: 32px;
    line-height: 1.2;
  }
  
  .transactions-filters-compact .btn {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.85rem !important;
    min-height: 32px;
  }
}

/* ========================================
   FIN MEJORAS MÓVIL
   ======================================== */

.card {
  border: none;
  border-radius: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #ffffff;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Tarjetas de totales con borde de color */
.stat-card {
  background: #ffffff;
  border: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(10, 37, 64, 0.15);
}

.stat-card.success {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
}

.stat-card.danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.stat-card.info {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
}

.stat-card.warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.stat-card .card-body {
  padding: 1.5rem;
  position: relative;
}

.stat-card h6 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  opacity: 0.95;
}

.stat-card h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 2;
}

.stat-icon {
  font-size: 4rem;
  opacity: 0.08;
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

.table {
  font-size: 0.95rem;
}

.badge {
  font-weight: 500;
  padding: 0.4em 0.8em;
  border-radius: 8px;
}

.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 600;
}

/* Chart containers */
.card-body canvas {
  max-height: 300px;
}

/* Headers mejorados */
.page-header {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ========================================
   COMPONENTES DASHBOARD
   ======================================== */

/* Tarjeta Saldo (Hero) */
.card-saldo {
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  border: 2px solid #2d3748;
}

.card-saldo.positive {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
  box-shadow: 0 6px 24px rgba(10, 37, 64, 0.25);
}

.card-saldo.negative {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.25);
}

.card-saldo-icon {
  font-size: 80px;
  opacity: 0.08;
  color: white;
  z-index: 0;
  pointer-events: none;
}

.card-saldo-body {
  z-index: 2;
}

.card-saldo-title {
  font-size: 0.875rem;
  opacity: 0.9;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-saldo-amount {
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.card-saldo-date {
  opacity: 0.8;
  font-size: 0.875rem;
}

.card-saldo-badge {
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.875rem;
}

.card-saldo.positive .card-saldo-badge:first-of-type {
  background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
  border-color: #3B82F6;
  color: #1E40AF;
}

.card-saldo .card-saldo-badge:last-of-type {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  border-color: #EF4444;
  color: #B91C1C;
}

/* Tarjetas de Ingresos/Egresos */
.card-summary {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 20px;
  height: 200px;
  border: 2px solid #2d3748;
}

@media (max-width: 576px) {
  .card-summary {
    height: 185px;
  }
}

.card-summary.ingresos {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  box-shadow: 0 4px 12px rgba(61, 226, 194, 0.15);
}

.card-summary.egresos {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.card-summary:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-summary-body {
  overflow: hidden;
}

.card-summary-icon-header {
  font-size: 28px;
  opacity: 0.95;
}

.card-summary-title {
  font-size: 0.875rem;
  opacity: 0.95;
  letter-spacing: 0.5px;
  line-height: 1;
}

.card-summary-amount {
  font-size: 2.25rem;
  line-height: 1;
}

.card-summary-cta {
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.9rem;
}

.card-summary-cta-icon {
  font-size: 14px;
}

.card-summary-icon-bg {
  font-size: 80px;
  opacity: 0.08;
  color: white;
  pointer-events: none;
}

.card-summary-cta-icon {
  font-size: 13px;
  color: #2d3748;
}

.card-summary-icon-bg {
  font-size: 100px;
  opacity: 0.04;
  color: #2d3748;
  pointer-events: none;
  bottom: -10px;
  right: -10px;
}

/* Card genérica blanca */
.card-white {
  background: #FFFFFF;
  border-radius: 20px;
}

/* ========================================
   CUENTAS BANCARIAS - HEADER DE PATRIMONIO
   ======================================== */

/* Header genérico para cards */
.card-header-title {
  color: #0A2540;
  font-size: 1.125rem;
  line-height: 1;
  margin: 0;
}

.page-title-icon {
  color: #3DE2C2;
  font-size: 1.375rem;
  margin-right: 8px;
}

/* Header de patrimonio */
.patrimony-header {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.15);
}

.patrimony-title {
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  opacity: 0.9;
}

.patrimony-amount {
  font-size: 2rem;
  letter-spacing: -0.5px;
}

.patrimony-accounts {
  opacity: 0.85;
  font-size: 0.8125rem;
}

/* Items de lista de cuentas */
.list-item {
  background: #F8F9FA;
  transition: all 0.2s ease;
  border-left-width: 4px !important;
}

.list-item:hover {
  background: #E8EDF3;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.08);
}

.list-item-icon-wrapper {
  width: 42px;
  height: 42px;
}

.list-item-name {
  color: #0A2540;
  font-size: 0.9375rem;
  font-weight: 600;
}

.list-item-bank {
  color: #6c757d;
  font-size: 0.8125rem;
}

.list-item-balance {
  color: #0A2540;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ========================================
   METAS DE AHORRO
   ======================================== */

/* Goal Item - Fondo gris claro (dashboard) */
.goal-item {
  background: #F5F7FA;
  transition: all 0.3s ease;
  border: 1px solid rgba(10, 37, 64, 0.05);
}

.goal-item:hover {
  background: #E8EDF3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.08);
}

.goal-name {
  color: #0A2540;
  font-size: 0.9375rem;
}

.goal-date {
  font-size: 0.75rem;
}

.goal-badge {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white;
  padding: 0.375rem 0.75rem;
}

.goal-progress-bar {
  height: 6px;
  background: rgba(10, 37, 64, 0.08);
  border-radius: 10px;
}

.goal-progress-fill {
  background: linear-gradient(90deg, #3DE2C2 0%, #2BC9AA 100%);
}

.goal-amount {
  font-size: 0.8125rem;
  color: #0A2540;
}

.goal-amount-label {
  font-size: 0.75rem;
}

.goal-amount-target {
  color: #0A2540;
  font-size: 0.8125rem;
}

/* Empty State */
.goal-empty-icon-wrapper {
  width: 70px;
  height: 70px;
  margin: 0 auto;
  background: rgba(61, 226, 194, 0.1);
  border-radius: 50%;
}

.goal-empty-icon {
  font-size: 2.2rem;
  color: #3DE2C2;
  opacity: 0.5;
}

.goal-empty-title {
  color: #0A2540;
  font-size: 0.95rem;
}

.goal-empty-text {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ========================================
   TABLAS DE CATEGORÍAS (INGRESOS/EGRESOS)
   ======================================== */

/* Card de categoría */
.category-card {
  border-radius: 20px;
}

.category-card-header-ingresos {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  border-radius: 20px 20px 0 0;
}

.category-card-header-egresos {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border-radius: 20px 20px 0 0;
}

.category-card-title {
  font-size: 1rem;
}

/* Tabla de categorías con scroll */
.category-table-wrapper {
  max-height: 440px; /* ~10 filas de 44px cada una */
  overflow-y: auto;
  border-radius: 0.375rem;
}

/* Scrollbar personalizado */
.category-table-wrapper::-webkit-scrollbar {
  width: 6px;
}

.category-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.category-table-wrapper::-webkit-scrollbar-thumb {
  background: #3DE2C2;
  border-radius: 10px;
}

.category-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #2BC9AA;
}

/* Header de tabla */
.category-table-header {
  font-size: 0.75rem;
}

/* Items de categoría */
.category-item {
  min-height: 44px;
  background: white;
  padding-top: 10px;
  padding-bottom: 10px;
}

.category-item:hover {
  background: #F8F9FA;
}

.category-color-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
}

.category-name {
  color: #212529;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-amount {
  color: #0A2540;
  font-size: 0.875rem;
  min-width: 100px;
  line-height: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.category-percentage {
  font-size: 0.8125rem;
  min-width: 60px;
  margin-left: 12px;
  line-height: 0.8125rem;
}

.category-total-row {
  background: #F8F9FA;
}

.category-total-label {
  color: #0A2540;
  font-size: 0.875rem;
}

.category-total-amount-ingresos {
  color: #3DE2C2;
  font-size: 0.9375rem;
  min-width: 100px;
}

.category-total-amount-egresos {
  color: #EF4444;
  font-size: 0.9375rem;
  min-width: 100px;
}

.category-total-percentage {
  color: #0A2540;
  font-size: 0.8125rem;
  min-width: 60px;
  margin-left: 12px;
}

/* Empty state de categorías */
.category-empty-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: rgba(61, 226, 194, 0.1);
  border-radius: 50%;
}

.category-empty-icon {
  font-size: 2.5rem;
  color: #3DE2C2;
  opacity: 0.5;
}

/* ========================================
   BOTONES DE ACCIÓN EN TRANSACCIONES
   ======================================== */

/* Botones de acción en tabla */
.transaction-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 36px;
  height: 36px;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  border-width: 1.5px;
  font-weight: 500;
}

.transaction-action-btn i {
  font-size: 1rem;
}

/* Botón de pagar */
.transaction-action-btn.btn-pay {
  color: #198754;
  border-color: #198754;
  background: rgba(25, 135, 84, 0.05);
}

.transaction-action-btn.btn-pay:hover {
  color: white;
  background: #198754;
  border-color: #198754;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(25, 135, 84, 0.25);
}

/* Botón de reabrir (paid -> unpaid) */
.transaction-action-btn.btn-reopen {
  color: #D97706;
  border-color: #D97706;
  background: rgba(217, 119, 6, 0.08);
}

.transaction-action-btn.btn-reopen:hover {
  color: white;
  background: #D97706;
  border-color: #D97706;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(217, 119, 6, 0.3);
}

/* Botón de editar */
.transaction-action-btn.btn-edit {
  color: #0A2540;
  border-color: #0A2540;
  background: rgba(10, 37, 64, 0.05);
}

.transaction-action-btn.btn-edit:hover {
  color: white;
  background: #0A2540;
  border-color: #0A2540;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(10, 37, 64, 0.25);
}

/* Botón de eliminar */
.transaction-action-btn.btn-delete {
  color: #EF4444;
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.05);
}

.transaction-action-btn.btn-delete:hover {
  color: white;
  background: #EF4444;
  border-color: #EF4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
}

.transaction-action-btn.btn-duplicate {
  color: #7c3aed;
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.05);
}

.transaction-action-btn.btn-duplicate:hover {
  color: white;
  background: #7c3aed;
  border-color: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(124, 58, 237, 0.25);
}

/* Texto solo visible en desktop */
.transaction-action-text {
  display: none;
}

@media (min-width: 992px) {
  .transaction-action-btn {
    min-width: auto;
    padding: 0.375rem 0.75rem;
  }
  
  .transaction-action-text {
    display: inline;
  }
}

/* ========================================
   FORMULARIOS DE METAS DE AHORRO
   ======================================== */

/* Header del formulario */
.goal-form-header {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  border: none;
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: 20px 20px 0 0;
}

.goal-form-header h5 {
  color: white;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.goal-form-header i {
  font-size: 1.375rem;
  margin-right: 0.5rem;
}

/* Card de consejos estilo Mercado Libre */
.goal-tips-card {
  background: #FFF9E6;
  border: 1px solid #FFE066;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.goal-tips-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #0A2540;
}

.goal-tips-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goal-tips-icon i {
  color: white;
  font-size: 1.125rem;
}

.goal-tips-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #0A2540;
}

.goal-tips-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.goal-tips-list li {
  padding-left: 2rem;
  position: relative;
  margin-bottom: 0.75rem;
  color: #495057;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.goal-tips-list li:last-child {
  margin-bottom: 0;
}

.goal-tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #FFC107;
  font-weight: bold;
  font-size: 1.125rem;
}

/* Input con placeholder que se limpia */
.form-control.has-placeholder:focus::placeholder {
  color: transparent;
}

/* Labels mejorados */
.goal-form-label {
  color: #0A2540;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.goal-form-label i {
  color: #2d3748;
  margin-right: 0.375rem;
  font-size: 1rem;
}

/* Input group mejorado */
.goal-input-group .input-group-text {
  background: #2d3748;
  border: none;
  color: white;
  font-weight: 600;
}

/* Botones del formulario */
.goal-form-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.btn-goal-submit {
  background: #2d3748;
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(45, 55, 72, 0.25);
}

.btn-goal-submit:hover {
  background: #1a202c;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(45, 55, 72, 0.35);
}

.btn-goal-cancel {
  background: white;
  border: 1.5px solid #dee2e6;
  color: #6c757d;
  font-weight: 500;
  padding: 0.75rem 2rem;
  border-radius: 10px;
}

.btn-goal-cancel:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

/* Botón submit de aportes */
.goal-contribution-btn {
  background: #2d3748;
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.goal-contribution-btn:hover {
  background: #1a202c;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(45, 55, 72, 0.3);
}

.goal-contribution-btn:active {
  transform: translateY(0);
}

/* ========================================
   FIN FORMULARIOS
   ======================================== */

/* ========================================
   METAS DE AHORRO - CARDS DE RESUMEN
   ======================================== */

/* Header de cards de metas con fondo oscuro */
.goal-card-header-dark {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
  color: white !important;
}

.goal-card-header-dark h5,
.goal-card-header-dark h6,
.goal-card-header-dark i {
  color: white !important;
}

/* Header de cards de metas completadas (verde) */
.goal-card-header-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white !important;
}

.goal-card-header-success h5,
.goal-card-header-success h6,
.goal-card-header-success i {
  color: white !important;
}

/* Cards de resumen similares al dashboard */
.goal-summary-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 20px;
  height: 160px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
}

.goal-summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Card de Metas Activas (aqua-mint) - clickeable */
.goal-summary-card.active-goals {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white;
}

/* Card de Completadas (verde) */
.goal-summary-card.completed-goals {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

/* Card de Total Ahorrado (azul oscuro) */
.goal-summary-card.total-saved {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
  color: white;
}

/* Body de la card */
.goal-summary-card .card-body {
  position: relative;
  z-index: 2;
  color: white;
}

/* Ícono de fondo */
.goal-summary-card-icon-bg {
  font-size: 80px;
  opacity: 0.08;
  color: white;
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

/* Ícono principal */
.goal-summary-card-icon {
  font-size: 2rem;
  opacity: 0.95;
  margin-bottom: 0.5rem;
  color: white;
}

/* Título */
.goal-summary-card-title {
  font-size: 0.875rem;
  opacity: 0.95;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  color: white;
}

/* Valor/Número */
.goal-summary-card-value {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0;
  line-height: 1;
  color: white;
}

/* Valor más pequeño para montos largos */
.goal-summary-card-value.small {
  font-size: 1.75rem;
  color: white;
}

/* CTA para card clickeable */
.goal-summary-card-cta {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: inline-block;
  color: white;
}

.goal-summary-card.active-goals:hover .goal-summary-card-cta {
  background: rgba(255, 255, 255, 0.35);
}

/* ========================================
   FIN METAS DE AHORRO - CARDS DE RESUMEN
   ======================================== */

/* Badge de porcentaje de progreso */
.goal-progress-badge {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .goal-progress-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
}

/* ========================================
   VISTA DE DETALLE DE META (SHOW)
   ======================================== */

/* Header aqua-mint para progreso */
.goal-detail-header-progress {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white !important;
  border: none;
}

.goal-detail-header-progress h5,
.goal-detail-header-progress h6,
.goal-detail-header-progress i,
.goal-detail-header-progress .badge {
  color: white !important;
}

/* Header azul oscuro para plan de ahorro */
.goal-detail-header-plan {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
  color: white !important;
  border: none;
}

.goal-detail-header-plan h5,
.goal-detail-header-plan h6,
.goal-detail-header-plan i,
.goal-detail-header-plan .badge {
  color: white !important;
}

/* Header naranja para recordatorios */
.goal-detail-header-reminder {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white !important;
  border: none;
}

.goal-detail-header-reminder h5,
.goal-detail-header-reminder h6,
.goal-detail-header-reminder i,
.goal-detail-header-reminder .badge {
  color: white !important;
}

/* Header rojo para vencida */
.goal-detail-header-overdue {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white !important;
  border: none;
}

.goal-detail-header-overdue h5,
.goal-detail-header-overdue h6,
.goal-detail-header-overdue i,
.goal-detail-header-overdue .badge {
  color: white !important;
}

/* Círculo de progreso grande */
.goal-progress-circle {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.goal-progress-percentage-large {
  font-size: 3rem;
  font-weight: 700;
  color: #3DE2C2;
}

.goal-progress-label {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Cards de estadísticas en detalle */
.goal-stat-card {
  background: #F8F9FA;
  border-radius: 12px;
  border: 1px solid rgba(10, 37, 64, 0.08);
  transition: all 0.2s ease;
}

.goal-stat-card:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.1);
}

.goal-stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.goal-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.goal-stat-value.success {
  color: #3DE2C2;
}

.goal-stat-value.primary {
  color: #0A2540;
}

.goal-stat-value.danger {
  color: #EF4444;
}

/* Barra de progreso mejorada */
.goal-progress-bar-large {
  height: 40px;
  background: rgba(10, 37, 64, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

.goal-progress-fill-large {
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  transition: width 0.5s ease;
}

/* Alerta/mensaje estilo Mercado Libre */
.goal-alert-info {
  background: #E3F2FD;
  border: 1px solid #90CAF9;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.goal-alert-success {
  background: #E8F5E9;
  border: 1px solid #A5D6A7;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.goal-alert-warning {
  background: #FFF3E0;
  border: 1px solid #FFCC80;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.goal-alert-danger {
  background: #FFEBEE;
  border: 1px solid #EF9A9A;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

/* ========================================
   FIN VISTA DE DETALLE DE META
   ======================================== */

/* ========================================
   BOTÓN FLOTANTE "VOLVER ARRIBA"
   ======================================== */

.scroll-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(61, 226, 194, 0.4);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top-btn:hover {
  background: linear-gradient(135deg, #2BC9AA 0%, #1FB599 100%);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(61, 226, 194, 0.5);
}

.scroll-to-top-btn:active {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 1.125rem;
  }
}

.comparativa-row {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    120px
    120px
    120px
    100px;
  align-items: center;
}


/* ========================================
   FIN BOTÓN FLOTANTE
   ======================================== */

/* ========================================
   FORMULARIOS DE METAS DE AHORRO
   ======================================== */

/* ========================================
   TARJETAS DASHBOARD – MODO NORMAL / COMPACTO
   ======================================== */

/* Estado normal */
.tarjeta-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.tarjeta-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10) !important;
}
.tarjeta-body {
  transition: min-height 0.25s ease, padding 0.2s ease;
}
.tarjeta-subtitulo {
  overflow: hidden;
  transition: opacity 0.2s ease;
}

/* ── Modo Compacto ─────────────────────────────────────────── */
.tarjetas-row.modo-compacto .tarjeta-col {
  flex: 0 0 25% !important;
  max-width: 25% !important;
}
@media (max-width: 767px) {
  .tarjetas-row.modo-compacto .tarjeta-col {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

.tarjetas-row.modo-compacto .tarjeta-card {
  min-height: 0 !important;
  overflow: hidden !important;
}
.tarjetas-row.modo-compacto .tarjeta-body {
  min-height: 0 !important;
  padding: 0.5rem !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem;
  overflow: hidden !important;
  flex-wrap: nowrap !important;
}
/* Oculta el ícono decorativo de fondo */
.tarjetas-row.modo-compacto .tarjeta-body > i.position-absolute {
  display: none !important;
}
/* Ícono circular más pequeño, nunca se encoge */
.tarjetas-row.modo-compacto .tarjeta-body .rounded-circle {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
}
.tarjetas-row.modo-compacto .tarjeta-body .rounded-circle i {
  font-size: 0.8rem !important;
}
/* Bloque de texto: se encoge y corta con ellipsis */
.tarjetas-row.modo-compacto .tarjeta-body > div.position-relative {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;       /* clave: permite que flex item se encoja */
  overflow: hidden;
  width: 100%;
}
.tarjetas-row.modo-compacto .tarjeta-titulo {
  font-size: 0.72rem !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0;
  display: block;
  max-width: 100%;
}
.tarjetas-row.modo-compacto .tarjeta-subtitulo {
  display: none !important;
}

/* ========================================
   DASHBOARD REDESIGN — layout compacto
   ======================================== */

/* Month nav inline */
.dash-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-month-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  text-decoration: none;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}

.dash-month-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.dash-month-center {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dash-month-label {
  background: none;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: #2d3748;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dash-month-label i {
  font-size: 0.82rem;
  color: #94a3b8;
}

.dash-today-badge {
  background: #667eea;
  color: white !important;
  font-size: 0.62rem;
  border-radius: 999px;
  padding: 2px 8px;
  text-decoration: none;
  font-weight: 600;
}

.dash-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #475569;
  font-size: 0.78rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.dash-pdf-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Hero saldo compacto */
.dash-hero {
  border-radius: 20px;
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
}

.dash-hero.positive {
  background: linear-gradient(135deg, #0A2540 0%, #134068 100%);
  box-shadow: 0 6px 24px rgba(10, 37, 64, 0.22);
}

.dash-hero.negative {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.22);
}

.dash-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-hero-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 1.2px;
  font-weight: 600;
  text-transform: uppercase;
}

.dash-hero-badge {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  padding: 2px 9px;
  border-radius: 999px;
}

.dash-hero-amount {
  font-size: clamp(1.9rem, 7vw, 2.75rem);
  font-weight: 800;
  color: white;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 12px;
  text-align: center;
}

.dash-hero-breakdown {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.dash-hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

.dash-hero-stat.ingreso { color: #6ee7b7; }
.dash-hero-stat.egreso  { color: #fca5a5; }

/* Acciones rápidas */
.dash-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash-quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 12px;
  border-radius: 14px;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.dash-quick-btn i { font-size: 1rem; }

.dash-quick-btn.ingreso {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.dash-quick-btn.egreso {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.dash-quick-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.dash-quick-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* Alertas compactas */
.dash-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.dash-alert.danger {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}

.dash-alert.danger > i { color: #ef4444; }

.dash-alert.warning {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #92400e;
}

.dash-alert.warning > i { color: #f59e0b; }

/* Nav grid compacta */
.dash-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 576px) {
  .dash-nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .dash-nav-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.dash-nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  text-decoration: none;
  background: white;
  border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  min-height: 78px;
  justify-content: center;
}

.dash-nav-item i {
  font-size: 1.25rem;
}

.dash-nav-item span {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
}

/* Blue */
.dash-nav-item.blue { border-color: rgba(37,99,235,0.18); color: #1e3a5f; }
.dash-nav-item.blue i { color: #2563eb; }
.dash-nav-item.blue:hover {
  background: rgba(37,99,235,0.05);
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.1);
  color: #1e3a5f;
}

/* Green */
.dash-nav-item.green { border-color: rgba(5,150,105,0.18); color: #064e3b; }
.dash-nav-item.green i { color: #059669; }
.dash-nav-item.green:hover {
  background: rgba(5,150,105,0.05);
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5,150,105,0.1);
  color: #064e3b;
}

/* Purple */
.dash-nav-item.purple { border-color: rgba(124,58,237,0.18); color: #4c1d95; }
.dash-nav-item.purple i { color: #7c3aed; }
.dash-nav-item.purple:hover {
  background: rgba(124,58,237,0.05);
  border-color: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.1);
  color: #4c1d95;
}

/* Racha card — min-height en mobile para no colapsar */
@media (max-width: 767px) {
  .dash-racha-card {
    min-height: 130px;
  }
}

/* Gráfico semanal (lun–dom, día a día) */
.dash-weekly-chart {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.dash-weekly-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dash-weekly-amount {
  font-size: 0.6rem;
  font-weight: 700;
  color: #6b7280;
  height: 14px;
  line-height: 14px;
  text-align: center;
}

.dash-weekly-bar-wrap {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: flex-end;
}

.dash-weekly-bar {
  width: 100%;
  border-radius: 5px 5px 0 0;
  transition: height 0.45s ease;
}

.dash-weekly-label {
  font-size: 0.68rem;
  color: #9ca3af;
  text-align: center;
  white-space: nowrap;
}

.dash-weekly-col.today .dash-weekly-label {
  color: #667eea;
  font-weight: 700;
}

.dash-weekly-col.today .dash-weekly-bar {
  box-shadow: 0 0 0 2px #667eea, 0 0 0 4px rgba(102,126,234,0.2);
}

/* ========================================
   APP SHELL — Sidebar + Mobile Nav
   ======================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-main > main {
  flex: 1;
}

/* Sidebar */
.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  background: #0A2540; /* sólido: mismo color que logo-finaxy-dark.png */
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: none;
}
.app-sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(61,226,194,0.15);
  border: 1.5px solid rgba(61,226,194,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #3DE2C2;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
}

.sidebar-link.active {
  background: rgba(61,226,194,0.15);
  color: #3DE2C2;
  font-weight: 600;
}

.sidebar-link.active i { color: #3DE2C2; }

.sidebar-section-label {
  margin: 14px 12px 4px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.sidebar-divider {
  height: 1px;
  margin: 8px 12px;
  background: rgba(255,255,255,0.07);
}

.sidebar-bottom {
  padding: 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #F59E0B;
  color: #0A2540;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}

.sidebar-add-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #0A2540;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.sidebar-user-btn::after {
  margin-left: auto;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
}

.sidebar-user-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(61,226,194,0.2);
  border: 1.5px solid rgba(61,226,194,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: #3DE2C2;
  flex-shrink: 0;
}

.sidebar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.sidebar-dropdown {
  background: #1a3050 !important;
  border: 1px solid rgba(61,226,194,0.2) !important;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  min-width: 180px;
}

.sidebar-dropdown .dropdown-item {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  padding: 8px 16px;
}

.sidebar-dropdown .dropdown-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.sidebar-dropdown .dropdown-item.text-danger { color: #fca5a5 !important; }

.sidebar-dropdown .dropdown-divider { border-color: rgba(255,255,255,0.1); }

.sidebar-dropdown-email {
  font-size: 0.72rem;
  color: #64748b;
  padding: 6px 16px 2px;
  word-break: break-all;
  white-space: normal;
}

/* Mobile components hidden on desktop */
.mobile-topbar,
.mobile-bottomnav { display: none; }

/* Mobile top bar */
.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #0A2540; /* sólido: mismo color que logo-finaxy-dark.png */
  z-index: 200;
  padding: 0 16px;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 1rem;
}

.mobile-logo i {
  font-size: 1.2rem;
  color: #3DE2C2;
}

.mobile-patrimonio {
  font-size: 0.78rem;
  font-weight: 700;
  color: #3DE2C2;
  background: rgba(61,226,194,0.1);
  border: 1px solid rgba(61,226,194,0.25);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.mobile-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}

.mobile-icon-btn:hover { background: rgba(255,255,255,0.18); }
.mobile-icon-btn.dropdown-toggle::after { display: none; }

/* Mobile bottom nav */
.mobile-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-top: 1px solid #e2e8f0;
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.6rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 10px;
  transition: color 0.15s;
}

.mobile-nav-item i { font-size: 1.2rem; }

.mobile-nav-item.active { color: #667eea; }

.mobile-nav-add {
  flex: 0 0 auto;
  padding: 0;
}

.mobile-nav-add-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(102,126,234,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.mobile-nav-add:hover .mobile-nav-add-circle {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(102,126,234,0.5);
}

/* Responsive: mobile breakpoint */
@media (max-width: 767px) {
  .app-sidebar { display: none !important; }
  .app-main {
    margin-left: 0;
    padding-top: 52px;
    padding-bottom: 60px;
  }
  .mobile-topbar,
  .mobile-bottomnav { display: flex; }
}

/* Dark mode */
[data-bs-theme="dark"] .mobile-bottomnav {
  background: #1e293b;
  border-top-color: #334155;
}

[data-bs-theme="dark"] .mobile-nav-item { color: #64748b; }
[data-bs-theme="dark"] .mobile-nav-item.active { color: #818cf8; }

/* ========================================
   TRANSACTIONS PAGE — txn-*
   ======================================== */

.txn-page {
  padding: 20px 24px 40px;
}

/* Header */
.txn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.txn-title {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  color: #0A2540;
  margin: 0;
}

.txn-title i { color: #667eea; margin-right: 6px; }

.txn-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
  white-space: nowrap;
}

.txn-new-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: white;
}

/* Filters */
.txn-filters-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.txn-filters-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.txn-filter-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.txn-filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.txn-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.83rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
  cursor: pointer;
}

.txn-select:focus {
  border-color: #667eea;
  background: white;
}

.txn-filter-search {
  flex: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  transition: border-color 0.15s;
}

.txn-filter-search:focus-within {
  border-color: #667eea;
  background: white;
}

.txn-search-icon { color: #94a3b8; font-size: 0.85rem; flex-shrink: 0; }

.txn-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.83rem;
  color: #1e293b;
  width: 100%;
  min-width: 0;
}

.txn-search-input::placeholder { color: #cbd5e1; }

.txn-search-clear {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.txn-filter-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.txn-extra-toggle,
.txn-reset-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
}

.txn-extra-toggle:hover,
.txn-reset-btn:hover {
  border-color: #667eea;
  color: #667eea;
  background: rgba(102,126,234,0.05);
}

.txn-extra-toggle.is-active {
  border-color: #667eea;
  background: rgba(102,126,234,0.1);
  color: #667eea;
}

.txn-filter-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #667eea;
  border: 1.5px solid white;
}

/* Extra filters panel */
.txn-filters-extra {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.txn-filters-extra.is-open { display: block; }

.txn-filters-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .txn-filters-extra-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Summary bar */
.txn-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.txn-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.txn-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #667eea;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  min-width: 28px;
}

.txn-summary-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

.txn-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.txn-sum-item {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.txn-sum-in { color: #059669; }
.txn-sum-out { color: #DC2626; }
.txn-sum-bal { color: #0A2540; }
.txn-sum-sep { color: #e2e8f0; font-size: 0.8rem; }

.txn-csv-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: white;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.txn-csv-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

/* Bulk actions */
.txn-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(102,126,234,0.08);
  border: 1.5px solid rgba(102,126,234,0.25);
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #4338ca;
  font-weight: 500;
}

.txn-bulk-del {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #EF4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.txn-bulk-del:hover { filter: brightness(1.08); }

/* Table */
.txn-table-wrap {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}

.txn-table {
  width: 100%;
  border-collapse: collapse;
}

.txn-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.txn-table thead th {
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.txn-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.txn-row:last-child { border-bottom: none; }
.txn-row:hover { background: #fafbff; }

.txn-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* Checkbox col */
.txn-col-check { width: 36px; }
.txn-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #667eea;
}

/* Date col */
.txn-col-date { width: 54px; }
.txn-date-day {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}
.txn-date-mon {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

/* Main col */
.txn-main-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.txn-type-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.txn-type-ingreso {
  background: rgba(16,185,129,0.12);
  color: #059669;
}

.txn-type-egreso {
  background: rgba(239,68,68,0.1);
  color: #DC2626;
}

.txn-main-content { flex: 1; min-width: 0; }

.txn-desc-wrap { display: flex; align-items: center; gap: 6px; }

.txn-desc {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-desc:hover { border-bottom-color: #94a3b8; }

.txn-desc-input {
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid #667eea;
  border-radius: 6px;
  padding: 3px 8px;
  outline: none;
  color: #1e293b;
  width: 100%;
  max-width: 260px;
}

.txn-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.txn-date-mobile {
  font-size: 0.68rem;
  color: #94a3b8;
}

.txn-cat-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.txn-goal-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
}

.txn-notes {
  font-size: 0.68rem;
  color: #94a3b8;
  font-style: italic;
}

.txn-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

.txn-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 600;
  color: white;
}

/* Amount col */
.txn-col-amount { width: 110px; }

.txn-amount {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.txn-amount-ingreso { color: #059669; }
.txn-amount-egreso { color: #DC2626; }

.txn-status-dot {
  display: inline-block;
  font-size: 0.72rem;
  margin-top: 2px;
}

.txn-status-dot.is-paid { color: #059669; }
.txn-status-dot.is-pending { color: #D97706; }

/* Status col */
.txn-col-status { width: 100px; }

.txn-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.txn-status-badge.is-paid {
  background: #d1fae5;
  color: #065f46;
}

.txn-status-badge.is-pending {
  background: #fef3c7;
  color: #92400e;
}

/* Actions col */
.txn-col-actions { width: 80px; }

.txn-actions-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.txn-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  background: white;
}

.txn-btn-primary.is-pending {
  border-color: #10B981;
  color: #059669;
}

.txn-btn-primary.is-pending:hover {
  background: #10B981;
  color: white;
}

.txn-btn-primary.is-paid {
  border-color: #94a3b8;
  color: #64748b;
}

.txn-btn-primary.is-paid:hover {
  border-color: #F59E0B;
  color: #D97706;
}

.txn-btn-menu {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #64748b;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.txn-btn-menu:hover {
  border-color: #94a3b8;
  color: #1e293b;
}

.txn-dropdown-menu {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 6px;
  min-width: 150px;
}

.txn-dropdown-menu .dropdown-item {
  border-radius: 8px;
  font-size: 0.83rem;
  padding: 7px 12px;
  color: #374151;
}

.txn-dropdown-menu .dropdown-item:hover {
  background: #f1f5f9;
}

.txn-dropdown-menu .dropdown-divider {
  border-color: #f1f5f9;
  margin: 4px 0;
}

/* Empty state */
.txn-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.txn-empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.txn-empty-state p {
  font-size: 0.95rem;
  margin: 0;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .txn-page { padding: 14px 12px 32px; }

  /* Filter: grid 2-row layout */
  .txn-filters-row {
    display: grid;
    grid-template-areas:
      "month year btns"
      "search search search";
    grid-template-columns: 1fr 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
  }
  .txn-filters-row .txn-filter-item:nth-child(1) { grid-area: month; }
  .txn-filters-row .txn-filter-item:nth-child(2) { grid-area: year; }
  .txn-filters-row .txn-filter-item:nth-child(3) { display: none !important; }
  .txn-filters-row .txn-filter-search { grid-area: search; flex: unset; min-width: 0; }
  .txn-filters-row .txn-filter-btns { grid-area: btns; align-self: center; }

  /* Summary bar */
  .txn-summary-bar {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .txn-summary-label { display: none; }
  .txn-sum-item { font-size: 0.78rem; }

  /* Table cells */
  .txn-table { table-layout: fixed; }
  .txn-table td { padding: 9px 6px; }
  .txn-col-check { width: 32px; padding-left: 10px; }
  .txn-col-amount { width: 86px; }
  .txn-col-actions { width: 70px; padding-right: 8px; }

  /* Amount */
  .txn-amount { font-size: 0.8rem; }

  /* Action buttons — bigger tap targets */
  .txn-btn-primary { padding: 5px 7px; font-size: 0.72rem; }
  .txn-btn-menu { width: 38px; height: 38px; }
  .txn-btn-edit-mobile { color: #475569; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; }

  /* Descripción: permite que el texto haga wrap en vez de cortarse con "..." —
     en una pantalla angosta el texto es lo único que identifica el movimiento.
     min-width:0 es necesario para que un hijo flex pueda encogerse y hacer wrap
     de verdad (si no, el flex item no se angosta más que su contenido). */
  .txn-desc {
    font-size: 0.8rem;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    min-width: 0;
    flex: 1 1 auto;
  }
  .txn-main-content { overflow: hidden; min-width: 0; }
  .txn-type-dot { width: 20px; height: 20px; font-size: 0.65rem; flex-shrink: 0; }
  .txn-main-row { gap: 6px; }
}

/* Dark mode */
[data-bs-theme="dark"] .txn-filters-card,
[data-bs-theme="dark"] .txn-summary-bar,
[data-bs-theme="dark"] .txn-table-wrap { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .txn-title { color: #f1f5f9; }
[data-bs-theme="dark"] .txn-select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .txn-filter-search { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .txn-search-input { color: #e2e8f0; }
[data-bs-theme="dark"] .txn-extra-toggle,
[data-bs-theme="dark"] .txn-reset-btn { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .txn-row:hover { background: #0f172a; }
[data-bs-theme="dark"] .txn-row { border-bottom-color: #1e293b; }
[data-bs-theme="dark"] .txn-table thead tr { background: #0f172a; border-bottom-color: #334155; }
[data-bs-theme="dark"] .txn-desc { color: #e2e8f0; }
[data-bs-theme="dark"] .txn-date-day { color: #f1f5f9; }
[data-bs-theme="dark"] .txn-btn-menu { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .txn-btn-primary { background: #0f172a; }
[data-bs-theme="dark"] .txn-dropdown-menu { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .txn-dropdown-menu .dropdown-item { color: #e2e8f0; }
[data-bs-theme="dark"] .txn-dropdown-menu .dropdown-item:hover { background: #0f172a; }

/* ========================================
   EDIT / NEW FORM — ef-*
   ======================================== */

.ef-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 48px;
  min-height: calc(100vh - 60px);
}

.ef-card {
  width: 100%;
  max-width: 560px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.09);
  overflow: hidden;
}

/* Header */
.ef-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  color: white;
}

.ef-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ef-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ef-header-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.ef-header-title {
  font-size: 1.1rem;
  font-weight: 800;
}

/* Amount zone */
.ef-amount-zone {
  padding: 20px 24px 16px;
  background: #fafbff;
  border-bottom: 1px solid #f1f5f9;
}

.ef-amount-hint {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ef-amount-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ef-currency {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  color: #94a3b8;
  line-height: 1;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.ef-amount-input {
  border: none;
  outline: none;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  width: 100%;
  background: transparent;
  -moz-appearance: textfield;
  line-height: 1;
}

.ef-amount-input::-webkit-inner-spin-button,
.ef-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.ef-amount-input::placeholder { color: #e2e8f0; }

/* Body */
.ef-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Field */
.ef-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ef-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ef-label i { color: #94a3b8; }

.ef-badge-opt {
  font-size: 0.62rem;
  font-weight: 500;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 2px;
}

/* Inputs */
.ef-input,
.ef-select,
.ef-textarea {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.88rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.ef-input:focus,
.ef-select:focus,
.ef-textarea:focus {
  border-color: #0A2540;
  background: white;
  box-shadow: 0 0 0 3px rgba(10,37,64,0.08);
}

.ef-input-error { border-color: #EF4444 !important; }
.ef-field-error {
  font-size: 0.72rem;
  color: #DC2626;
  font-weight: 500;
}

.ef-textarea { resize: vertical; min-height: 72px; }

.ef-select { cursor: pointer; }

.ef-hint-link {
  font-size: 0.72rem;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}
.ef-hint-link:hover { text-decoration: underline; color: #4338ca; }

/* 2-column grid */
.ef-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Estado toggle */
.ef-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ef-toggle-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  transition: all 0.15s;
  margin: 0;
  text-align: center;
}

.ef-toggle-opt:has(input:checked) {
  border-color: #0A2540;
  background: rgba(10,37,64,0.07);
  color: #0A2540;
  font-weight: 600;
}

/* Período */
.ef-period-row {
  display: flex;
  gap: 8px;
}

.ef-period-row .ef-select:first-child { flex: 1; }

.ef-select-narrow { width: 100px; flex-shrink: 0; }

/* Extras (colapsable) */
.ef-extra {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

.ef-extra-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.ef-extra-btn:hover { color: #667eea; }
.ef-extra-btn i { font-size: 0.72rem; }

.ef-extra-hint {
  font-weight: 400;
  font-size: 0.72rem;
  color: #94a3b8;
}

.ef-extra-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

/* Errors */
.ef-errors {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 20px;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  color: #DC2626;
  font-size: 0.83rem;
}

/* Footer */
.ef-footer {
  display: flex;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}

.ef-cancel-btn {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  background: white;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.ef-cancel-btn:hover {
  border-color: #94a3b8;
  color: #1e293b;
}

.ef-submit-btn {
  flex: 2;
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}

.ef-submit-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.ef-submit-btn:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

/* Mobile */
@media (max-width: 575px) {
  .ef-page { padding: 12px 8px 32px; align-items: flex-start; }
  .ef-card { border-radius: 16px; }
  .ef-body { padding: 16px 16px 20px; gap: 14px; }
  .ef-header { padding: 14px 16px; }
  .ef-amount-zone { padding: 14px 16px 12px; }
  .ef-grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .ef-toggle-group { grid-template-columns: 1fr 1fr; }
  .ef-footer { padding-top: 4px; }
}

/* Profile card — wider on desktop */
.ef-card-profile {
  max-width: 560px;
}

@media (min-width: 768px) {
  .ef-card-profile {
    max-width: 760px;
  }

  .ef-card-profile .ef-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
  }

  /* Email ocupa todo el ancho */
  .ef-card-profile .ef-body > .ef-field:first-of-type { grid-column: 1 / -1; }

  /* Divisores y footer ocupan ancho completo */
  .ef-card-profile .user-edit-divider,
  .ef-card-profile .ef-footer,
  .ef-card-profile .user-edit-danger { grid-column: 1 / -1; }

  /* El último ef-field (contraseña actual) ocupa ancho completo */
  .ef-card-profile .ef-body > .ef-field:last-of-type { grid-column: 1 / -1; }
}

/* Divider with label (user edit form) */
.user-edit-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-edit-divider::before,
.user-edit-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f1f5f9;
}

/* Danger zone */
.user-edit-danger {
  margin-top: 8px;
  padding: 14px 16px;
  background: #fff5f5;
  border: 1.5px solid #fecaca;
  border-radius: 12px;
}

.user-edit-danger-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #DC2626;
  margin-bottom: 4px;
}

.user-edit-danger-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 10px;
}

.user-edit-danger-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  background: white;
  color: #DC2626;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.user-edit-danger-btn:hover {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}

/* Pagination */
.txn-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid #f1f5f9;
}

.txn-page-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}

.txn-page-btn:hover { border-color: #667eea; color: #667eea; }
.txn-page-btn.is-disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.txn-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.txn-page-num {
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  padding: 0 8px;
}

.txn-page-num:hover { border-color: #667eea; color: #667eea; background: rgba(102,126,234,0.05); }

.txn-page-num.is-current {
  background: #667eea;
  border-color: #667eea;
  color: white;
  font-weight: 700;
}

.txn-page-ellipsis {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 0 2px;
}

/* Dark mode */
[data-bs-theme="dark"] .ef-card { background: #1e293b; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
[data-bs-theme="dark"] .ef-amount-zone { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .ef-amount-input { color: #f1f5f9; }
[data-bs-theme="dark"] .ef-input,
[data-bs-theme="dark"] .ef-select,
[data-bs-theme="dark"] .ef-textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .ef-toggle-opt { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .ef-cancel-btn { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .ef-extra { border-top-color: #334155; }
[data-bs-theme="dark"] .ef-footer { border-top-color: #334155; }
[data-bs-theme="dark"] .ef-badge-opt { background: #0f172a; }
[data-bs-theme="dark"] .ef-label { color: #94a3b8; }

/* ============================================================
   ie-* — Ingresos & Egresos page
   ============================================================ */

/* Page wrapper */
.ie-page {
  padding: 20px 24px 48px;
}

/* ── Header ── */
.ie-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.ie-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ie-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0A2540;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ie-back-btn:hover { background: #e2e8f0; color: #0A2540; }
.ie-title {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 700;
  color: #0A2540;
  margin: 0;
  line-height: 1.2;
}
.ie-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 2px 0 0;
  text-transform: capitalize;
}

/* Period selector */
.ie-period-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ie-select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.85rem;
  color: #0A2540;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.ie-select:focus { border-color: #0A2540; }

/* ── Summary bar ── */
.ie-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.ie-sum-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ie-sum-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}
.ie-sum-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ie-sum-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.ie-sum-amount {
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  font-weight: 700;
  color: #0A2540;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Income accent */
.ie-sum-in .ie-sum-icon { color: #10B981; }
.ie-sum-in { border-left: 3px solid #10B981; }

/* Expense accent */
.ie-sum-out .ie-sum-icon { color: #EF4444; }
.ie-sum-out { border-left: 3px solid #EF4444; }

/* Balance */
.ie-sum-bal.is-pos .ie-sum-icon { color: #059669; }
.ie-sum-bal.is-pos { border-left: 3px solid #059669; }
.ie-sum-bal.is-pos .ie-sum-amount { color: #059669; }
.ie-sum-bal.is-neg .ie-sum-icon { color: #DC2626; }
.ie-sum-bal.is-neg { border-left: 3px solid #DC2626; }
.ie-sum-bal.is-neg .ie-sum-amount { color: #DC2626; }

/* ── Grid ── */
.ie-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .ie-page { padding: 14px 12px 32px; }
  .ie-grid { grid-template-columns: 1fr; }
  .ie-summary-bar { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ie-sum-card { padding: 10px 12px; gap: 8px; }
  .ie-sum-icon { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .ie-summary-bar { grid-template-columns: 1fr 1fr; }
  .ie-sum-bal { grid-column: span 2; }
}

/* ── Card ── */
.ie-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ie-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfd;
}
.ie-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ie-card-header-in .ie-card-dot { background: #10B981; }
.ie-card-header-out .ie-card-dot { background: #EF4444; }
.ie-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0A2540;
  flex: 1;
}
.ie-card-total {
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
}

/* ── Donut ── */
.ie-donut-wrap {
  padding: 16px 16px 8px;
}

/* ── Insight chip ── */
.ie-insight {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #92400e;
  position: relative;
}
.ie-insight-icon {
  color: #d97706;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.ie-insight span { flex: 1; }
.ie-insight-close {
  background: none;
  border: none;
  padding: 0 2px;
  color: #92400e;
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.ie-insight-close:hover { opacity: 1; }

/* ── Category list ── */
.ie-cat-list {
  padding: 0 0 4px;
}
.ie-cat-thead {
  display: grid;
  grid-template-columns: 1fr 110px 52px;
  padding: 8px 16px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
}
.ie-cat-row {
  display: grid;
  grid-template-columns: 1fr 110px 52px;
  grid-template-rows: auto auto;
  padding: 10px 16px 0;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.12s;
}
.ie-cat-row.is-expandable { cursor: pointer; }
.ie-cat-row.is-expandable:hover { background: #f8fafc; }
.ie-cat-row.ie-cat-sub {
  padding: 7px 16px 0;
  background: #fafbfd;
}
.ie-cat-row.ie-cat-sub:hover { background: #f1f5f9; }

.ie-col-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  color: #1e293b;
  overflow: hidden;
  padding-bottom: 8px;
}
.ie-col-amount {
  font-size: 0.84rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  padding-bottom: 8px;
}
.ie-col-pct {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: right;
  padding-bottom: 8px;
}

.ie-cat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ie-dot-sub { opacity: 0.55; width: 7px; height: 7px; margin-left: 11px; }
.ie-cat-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ie-subname { color: #64748b; font-size: 0.8rem; }
.ie-chevron {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-left: 2px;
  flex-shrink: 0;
}
.ie-sub-amount { opacity: 0.75; }

/* Progress bar — spans all 3 cols */
.ie-bar-track {
  grid-column: 1 / -1;
  height: 3px;
  background: #f1f5f9;
  border-radius: 999px;
  margin-bottom: 10px;
  overflow: hidden;
}
.ie-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.ie-bar-in  { background: #10B981; }
.ie-bar-out { background: #EF4444; }

/* Total row */
.ie-cat-total {
  display: grid;
  grid-template-columns: 1fr 110px 52px;
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0A2540;
}
.ie-cat-total .ie-col-amount,
.ie-cat-total .ie-col-pct { font-weight: 700; }

/* Colors */
.ie-color-in  { color: #059669; }
.ie-color-out { color: #DC2626; }

/* Empty state */
.ie-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: #94a3b8;
  gap: 10px;
}
.ie-empty i { font-size: 2rem; }
.ie-empty p { margin: 0; font-size: 0.875rem; }

/* Dark mode */
[data-bs-theme="dark"] .ie-card { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .ie-card-header { background: #0f172a; border-bottom-color: #334155; }
[data-bs-theme="dark"] .ie-cat-list { color: #e2e8f0; }
[data-bs-theme="dark"] .ie-cat-thead { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .ie-cat-row { border-bottom-color: #1e293b; }
[data-bs-theme="dark"] .ie-cat-row.is-expandable:hover { background: #0f172a; }
[data-bs-theme="dark"] .ie-cat-row.ie-cat-sub { background: #0f172a; }
[data-bs-theme="dark"] .ie-col-name { color: #e2e8f0; }
[data-bs-theme="dark"] .ie-bar-track { background: #334155; }
[data-bs-theme="dark"] .ie-cat-total { background: #0f172a; border-top-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .ie-sum-card { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .ie-sum-amount { color: #e2e8f0; }
[data-bs-theme="dark"] .ie-select { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .ie-back-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .ie-title { color: #e2e8f0; }
[data-bs-theme="dark"] .ie-card-title { color: #e2e8f0; }
[data-bs-theme="dark"] .ie-insight { background: #1c1507; border-color: #78350f; color: #fde68a; }

/* ============================================================
   cmp-* — Comparison page
   ============================================================ */

.cmp-page {
  padding: 20px 24px 48px;
}

/* ── Header ── */
.cmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.cmp-header-left { display: flex; align-items: center; gap: 14px; }

/* Month navigation */
.cmp-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cmp-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0A2540;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: background 0.15s;
}
.cmp-nav-arrow:hover { background: #e2e8f0; color: #0A2540; }
.cmp-period-form { display: flex; align-items: center; gap: 6px; }

/* ── Insights ── */
.cmp-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 768px) {
  .cmp-page { padding: 14px 12px 32px; }
}
@media (max-width: 520px) {
  .cmp-insights { grid-template-columns: 1fr; }
}
.cmp-insight-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.cmp-insight-card.cmp-insight-up  { border-left: 3px solid #EF4444; }
.cmp-insight-card.cmp-insight-down { border-left: 3px solid #10B981; }
.cmp-insight-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.cmp-insight-card.cmp-insight-up  .cmp-insight-label i { color: #EF4444; }
.cmp-insight-card.cmp-insight-down .cmp-insight-label i { color: #10B981; }
.cmp-insight-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0A2540;
  margin-bottom: 4px;
}
.cmp-insight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cmp-insight-diff {
  font-size: 0.95rem;
  font-weight: 700;
}
.cmp-insight-sub {
  font-size: 0.75rem;
  color: #64748b;
}

/* ── Card wrapper ── */
.cmp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cmp-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfd;
}
.cmp-card-icon { color: #F59E0B; font-size: 1rem; }
.cmp-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0A2540;
  flex: 1;
  text-transform: capitalize;
}
.cmp-card-year {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Table layout — Desktop grid (5 cols) ── */
.cmp-thead,
.cmp-row,
.cmp-total {
  display: grid;
  grid-template-columns: 1fr 90px 90px 105px 72px;
  align-items: center;
}

/* Header */
.cmp-thead {
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
}
.cmp-thead span { text-align: right; }
.cmp-thead span:first-child { text-align: left; }

/* Rows */
.cmp-row {
  padding: 0 16px;
  border-bottom: 1px solid #f8fafc;
  min-height: 46px;
  transition: background 0.12s;
}
.cmp-row-expandable { cursor: pointer; }
.cmp-row-expandable:hover { background: #f8fafc; }
.cmp-row-sub {
  background: #fafbfd;
  min-height: 38px;
}
.cmp-row-sub:hover { background: #f1f5f9; }

/* Total */
.cmp-total {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  min-height: 48px;
}
.cmp-total-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0A2540;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cmp-total-curr { font-weight: 700; color: #0A2540; }

/* Columns */
.cmp-col-cat {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 10px 0;
}
.cmp-col-num  { text-align: right; font-size: 0.82rem; color: #475569; padding: 10px 0; }
.cmp-col-diff { text-align: right; font-size: 0.82rem; font-weight: 600; padding: 10px 0; }
.cmp-col-pct  { text-align: right; padding: 10px 0; }

.cmp-prev-val { color: #94a3b8; }
.cmp-curr-val { color: #1e293b; font-weight: 600; }
.cmp-sub-val  { opacity: 0.7; font-size: 0.77rem; }

.cmp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cmp-dot-sub { opacity: 0.5; width: 7px; height: 7px; margin-left: 11px; }
.cmp-cat-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-sub-cat  { padding-left: 0; }
.cmp-sub-name { color: #64748b; font-size: 0.8rem; font-weight: 400; }
.cmp-chevron  { font-size: 0.65rem; color: #94a3b8; flex-shrink: 0; }

/* Color semantics */
.cmp-up      { color: #DC2626; }
.cmp-down    { color: #059669; }
.cmp-neutral { color: #94a3b8; }

/* Badges */
.cmp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.cmp-badge-up      { background: #fee2e2; color: #991b1b; }
.cmp-badge-down    { background: #d1fae5; color: #065f46; }
.cmp-badge-neutral { background: #f1f5f9; color: #94a3b8; }

/* Mobile detail line — hidden on desktop */
.cmp-mobile-detail { display: none; }

/* ── Mobile layout (< 600px) ── */
@media (max-width: 599px) {
  /* Switch to 2-col grid on mobile: [name+detail] [badge] */
  .cmp-thead { display: none; }

  .cmp-row,
  .cmp-total {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0;
    min-height: unset;
    padding: 10px 14px;
  }

  /* Show mobile detail, hide desktop cols */
  .cmp-col-num,
  .cmp-col-diff { display: none; }

  .cmp-col-cat {
    grid-column: 1;
    grid-row: 1;
    padding: 0 0 4px;
  }
  .cmp-col-pct {
    grid-column: 2;
    grid-row: 1;
    padding: 0 0 4px;
    text-align: right;
  }

  .cmp-mobile-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.75rem;
    padding-bottom: 2px;
  }
  .cmp-mobile-months { color: #64748b; }
  .cmp-mobile-diff   { font-weight: 600; font-size: 0.78rem; }

  /* Sub rows on mobile */
  .cmp-row-sub .cmp-col-cat { padding-left: 4px; }

  /* Total on mobile */
  .cmp-total-label {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 4px;
  }
  .cmp-total .cmp-col-pct {
    grid-column: 2;
    grid-row: 1;
  }
  .cmp-total .cmp-col-num,
  .cmp-total .cmp-col-diff { display: none; }
}

/* ── Empty state ── */
.cmp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  color: #94a3b8;
  gap: 12px;
  text-align: center;
}
.cmp-empty i  { font-size: 2.5rem; }
.cmp-empty p  { margin: 0; font-size: 0.875rem; max-width: 280px; }

/* Dark mode */
[data-bs-theme="dark"] .cmp-card           { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .cmp-card-header    { background: #0f172a; border-bottom-color: #334155; }
[data-bs-theme="dark"] .cmp-card-title     { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-thead          { background: #0f172a; border-bottom-color: #334155; }
[data-bs-theme="dark"] .cmp-row            { border-bottom-color: #1e293b; }
[data-bs-theme="dark"] .cmp-row-expandable:hover { background: #0f172a; }
[data-bs-theme="dark"] .cmp-row-sub        { background: #0f172a; }
[data-bs-theme="dark"] .cmp-cat-name       { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-curr-val       { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-total          { background: #0f172a; border-top-color: #334155; }
[data-bs-theme="dark"] .cmp-total-label    { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-total-curr     { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-insight-card   { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .cmp-insight-name   { color: #e2e8f0; }
[data-bs-theme="dark"] .cmp-nav-arrow      { background: #1e293b; border-color: #334155; color: #e2e8f0; }

/* ============================================================
   cat-* — Categories settings page
   ============================================================ */

.cat-page { padding: 20px 24px 48px; }
@media (max-width: 768px) { .cat-page { padding: 14px 12px 32px; } }

/* ── Header ── */
.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.cat-header-left  { display: flex; align-items: center; gap: 14px; }
.cat-header-actions { display: flex; align-items: center; gap: 8px; }

.cat-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: opacity 0.15s, transform 0.1s;
}
.cat-add-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.cat-add-in  { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.cat-add-out { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ── Tabs bar ── */
.cat-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 0;
  white-space: nowrap;
}
.cat-tab:hover { color: #0A2540; }
.cat-tab.active { color: #0A2540; border-bottom-color: #0A2540; }
.cat-tab-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-tab-dot-in  { background: #10B981; }
.cat-tab-dot-out { background: #EF4444; }
.cat-tab-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 20px;
  padding: 1px 7px;
}
.cat-tab.active .cat-tab-badge { background: #0A2540; color: #fff; }
.cat-tabs-spacer { flex: 1; }
.cat-tab-actions { display: flex; align-items: center; }

/* Panel */
.cat-panel { }

/* ── Two-column grid (kept for possible future use) ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 640px) { .cat-grid { grid-template-columns: 1fr; } }

/* Mobile: stack tab actions below tabs */
@media (max-width: 640px) {
  .cat-tabs-bar { flex-wrap: wrap; }
  .cat-tabs-spacer { display: none; }
  .cat-tab-actions { width: 100%; padding: 8px 0 4px; border-top: 1px solid #f1f5f9; }
  .cat-add-btn { width: 100%; justify-content: center; }
}

/* ── Column ── */
.cat-col {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cat-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfd;
}
.cat-col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-col-header-in .cat-col-dot  { background: #10B981; }
.cat-col-header-out .cat-col-dot { background: #EF4444; }
.cat-col-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0A2540;
  flex: 1;
}
.cat-col-count {
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── Category item ── */
.cat-item {
  border-bottom: 1px solid #f8fafc;
}
.cat-item:last-child { border-bottom: none; }

.cat-item-main {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  min-height: 48px;
}
.cat-item-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-item-name {
  font-size: 0.87rem;
  font-weight: 500;
  color: #1e293b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sub count + chevron toggle */
.cat-item-subbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
  transition: background 0.12s;
}
.cat-item-subbtn:hover { background: #f1f5f9; }
.cat-item-subcnt {
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
  border-radius: 10px;
  padding: 1px 6px;
}
.cat-item-chevron {
  font-size: 0.65rem;
  transition: transform 0.2s;
}
.cat-item-subbtn[aria-expanded="true"] .cat-item-chevron { transform: rotate(180deg); }

/* Actions */
.cat-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.cat-item:hover .cat-item-actions { opacity: 1; }
@media (max-width: 640px) { .cat-item-actions { opacity: 1; } }

.cat-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
}
.cat-action-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #0A2540; }
.cat-action-del:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
/* Make button_to form inline */
.cat-action-btn form,
form.cat-action-btn { display: contents; }

/* ── Subcategory panel ── */
.cat-subs {
  padding: 6px 14px 10px 34px;
  background: #fafbfd;
  border-top: 1px solid #f1f5f9;
}
.cat-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}
.cat-sub-icon { font-size: 0.7rem; color: #94a3b8; flex-shrink: 0; }
.cat-sub-name { font-size: 0.8rem; color: #475569; }

.cat-sub-hint { padding: 0 14px 8px 34px; background: #fafbfd; }
.cat-sub-add-link {
  font-size: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  transition: color 0.12s;
}
.cat-sub-add-link:hover { color: #0A2540; }
.cat-sub-add-empty { padding: 8px 0; }

/* Empty state */
.cat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  gap: 8px;
  color: #94a3b8;
  text-align: center;
}
.cat-empty i { font-size: 1.8rem; }
.cat-empty p { margin: 0; font-size: 0.85rem; }
.cat-empty-link {
  font-size: 0.8rem;
  color: #0A2540;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: background 0.12s;
}
.cat-empty-link:hover { background: #f1f5f9; }

/* ── Form: color palette ── */
.cat-color-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
  outline: none;
}
.cat-color-swatch:hover  { transform: scale(1.15); }
.cat-color-swatch.is-active { border-color: #0A2540; transform: scale(1.1); box-shadow: 0 0 0 3px rgba(10,37,64,0.15); }
.cat-color-custom {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  padding: 0;
  cursor: pointer;
  background: none;
}

/* ── Form: subcategory fields ── */
.cat-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cat-sub-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0A2540;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.cat-sub-addbtn:hover { background: #e2e8f0; }
.cat-sub-list { display: flex; flex-direction: column; gap: 6px; }
.cat-sub-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-sub-input { flex: 1; margin-bottom: 0 !important; }
.cat-sub-remove {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
}
.cat-sub-remove:hover { background: #fee2e2; }

/* Dark mode */
[data-bs-theme="dark"] .cat-col       { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .cat-col-header { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .cat-col-title  { color: #e2e8f0; }
[data-bs-theme="dark"] .cat-item       { border-color: #1e293b; }
[data-bs-theme="dark"] .cat-item-main:hover { background: #0f172a; }
[data-bs-theme="dark"] .cat-item-name  { color: #e2e8f0; }
[data-bs-theme="dark"] .cat-action-btn { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .cat-subs       { background: #0f172a; border-color: #334155; }
[data-bs-theme="dark"] .cat-sub-hint   { background: #0f172a; }
[data-bs-theme="dark"] .cat-add-in     { background: #022c22; border-color: #065f46; }
[data-bs-theme="dark"] .cat-add-out    { background: #450a0a; border-color: #991b1b; }
[data-bs-theme="dark"] .cat-color-swatch.is-active { border-color: #e2e8f0; }
[data-bs-theme="dark"] .cat-sub-addbtn { background: #0f172a; border-color: #334155; color: #e2e8f0; }

/* ═══════════════════════════════════════════════════════════════
   rd-* — Recurring Debts
   ═══════════════════════════════════════════════════════════════ */

.rd-page {
  padding: 20px 24px 60px;
  max-width: 100%;
}

/* ── Header ── */
.rd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.rd-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Section ── */
.rd-section { margin-bottom: 32px; }
.rd-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 14px;
}
.rd-section-done { color: #059669; }
.rd-section-hist { color: #94a3b8; }
.rd-section-count {
  background: #f1f5f9;
  color: #475569;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}
.rd-count-done { background: #d1fae5; color: #059669; }

/* ── Cards grid ── */
.rd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

/* ── Card ── */
.rd-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s;
}
.rd-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }

.rd-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.rd-card-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rd-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  white-space: normal;
  word-break: break-word;
}
.rd-card-meta { flex-shrink: 0; text-align: right; }
.rd-card-amount { font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.rd-card-freq { font-size: 0.75rem; font-weight: 400; color: #94a3b8; }

.rd-cat-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
}

/* ── Progress ── */
.rd-progress-wrap { display: flex; flex-direction: column; gap: 4px; }
.rd-progress-bar {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}
.rd-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #D97706);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.rd-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
}
.rd-progress-count { font-weight: 600; }
.rd-progress-pct { color: #F59E0B; font-weight: 700; }

/* ── Card dates & footer ── */
.rd-card-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  gap: 4px;
}
.rd-date-end { color: #64748b; }
.rd-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  gap: 8px;
}
.rd-months-left { font-size: 0.78rem; font-weight: 600; color: #64748b; }
.rd-card-actions { display: flex; gap: 6px; }

/* ── Action buttons ── */
.rd-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}
.rd-action-btn:hover { background: #f1f5f9; color: #0f172a; }
.rd-action-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.rd-action-complete:hover { background: #d1fae5; border-color: #6ee7b7; color: #059669; }

/* ── Empty state ── */
.rd-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}
.rd-empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.rd-empty p { margin: 0 0 12px; font-size: 0.9rem; }

/* ── List (history / done) ── */
.rd-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.rd-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.rd-list-row:last-child { border-bottom: none; }
.rd-list-done { background: #f0fdf4; }
.rd-list-cancelled { opacity: 0.7; }
.rd-list-name { font-size: 0.9rem; font-weight: 600; color: #0f172a; flex: 1; min-width: 120px; }
.rd-list-total { font-size: 0.85rem; color: #475569; margin-left: auto; }
.rd-list-actions { display: flex; gap: 6px; }

/* ── Badge status ── */
.rd-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.rd-status-active  { background: #fef3c7; color: #92400e; }
.rd-status-done    { background: #d1fae5; color: #065f46; }
.rd-status-cancelled { background: #fee2e2; color: #991b1b; }

/* ── rd-list: main/actions sub-layout ── */
.rd-list-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }

/* ── rd-ready (listas para cerrar) ── */
.rd-ready-section { margin-top: 16px; }
.rd-ready-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0A2540;
  margin-bottom: 8px;
  padding: 0 2px;
}

/* ── rd-hist (finalizadas / canceladas) ── */
.rd-hist-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}
.rd-hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}
.rd-hist-row:last-child { border-bottom: none; }
.rd-hist-row:hover { background: #fafbff; }
.rd-hist-row-cancelled { opacity: 0.8; }
.rd-hist-icon { flex-shrink: 0; width: 28px; text-align: center; }
.rd-hist-body { flex: 1; min-width: 0; }
.rd-hist-name { font-size: 0.9rem; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-hist-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.rd-hist-cuotas { font-size: 0.72rem; color: #94a3b8; display: flex; align-items: center; gap: 4px; }
.rd-hist-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.rd-hist-total { font-size: 0.92rem; font-weight: 800; }
.rd-hist-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rd-hist-badge-done      { background: #d1fae5; color: #065f46; }
.rd-hist-badge-cancelled { background: #f1f5f9; color: #64748b; }

/* ── rd-empty hint ── */
.rd-empty-hint { font-size: 0.75rem; color: #cbd5e1; display: block; }

@media (max-width: 480px) {
  .rd-hist-row { gap: 8px; padding: 12px 12px; }
  .rd-hist-right { align-items: flex-start; }
  .rd-hist-row { flex-wrap: wrap; }
  .rd-hist-body { width: calc(100% - 40px); }
  .rd-hist-right { flex-direction: row; align-items: center; gap: 8px; width: 100%; justify-content: space-between; }
}

/* ═══════════════════════════════════════════════════════════════
   rd-show — Recurring Debt Show page
   ═══════════════════════════════════════════════════════════════ */

.rd-show-badges { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.rd-show-actions { display: flex; gap: 8px; align-items: center; }

/* ── Summary bar ── */
.rd-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.rd-sum-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-sum-label { font-size: 0.72rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.rd-sum-value { font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.rd-sum-pct { color: #F59E0B; }

/* ── Progress card ── */
.rd-prog-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.rd-prog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.rd-prog-label { font-size: 0.82rem; font-weight: 600; color: #475569; }
.rd-prog-pct { font-size: 1.1rem; font-weight: 800; color: #F59E0B; }
.rd-prog-bar-lg { height: 12px !important; margin-bottom: 10px; }
.rd-prog-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Notes ── */
.rd-notes-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.rd-notes-icon { color: #D97706; font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.rd-notes-text { font-size: 0.85rem; color: #78350f; margin: 0; }

/* ── Installments ── */
.rd-install-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}
.rd-install-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}
.rd-install-title { font-size: 0.9rem; font-weight: 700; color: #0f172a; }

/* ── Table grid: checkbox 28 | # 36 | date 1fr | amount 110 | status 90 | actions 60 ── */
.rd-install-thead,
.rd-install-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr 110px 90px 60px;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
}
.rd-install-thead {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.rd-install-row {
  border-bottom: 1px solid #f8fafc;
  transition: background 0.1s;
}
.rd-install-row:last-child { border-bottom: none; }
.rd-install-row:hover { background: #f8fafc; }
.rd-row-paid { opacity: 0.6; }
.rd-row-paid:hover { opacity: 1; }

.rd-checkbox { accent-color: #F59E0B; cursor: pointer; }
.rd-num-val { font-size: 0.78rem; font-weight: 700; color: #64748b; text-align: center; }
.rd-date-val { font-size: 0.82rem; color: #334155; }
.rd-amt-val { font-size: 0.88rem; font-weight: 700; color: #0f172a; }
.rd-col-chk { display: flex; justify-content: center; }
.rd-col-num { text-align: center; }
.rd-col-act { display: flex; justify-content: flex-end; }

/* Pill status */
.rd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.rd-pill-paid { background: #d1fae5; color: #065f46; }
.rd-pill-pending { background: #fef3c7; color: #92400e; }
.rd-pill-sm { font-size: 0.68rem; padding: 2px 6px; }

/* Install action buttons */
.rd-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.rd-btn-pay { background: #d1fae5; color: #065f46; }
.rd-btn-pay:hover { background: #10B981; color: #fff; }
.rd-btn-reopen { background: #f1f5f9; color: #64748b; }
.rd-btn-reopen:hover { background: #e2e8f0; color: #0f172a; }
.rd-btn-sm { padding: 2px 8px; font-size: 0.72rem; height: 24px; }

/* Mobile row — only shown on small screens */
.rd-mobile-row { display: none; }

/* Footer total */
.rd-install-foot {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

/* Pay multiple button */
.rd-pay-multi-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.12s;
}
.rd-pay-multi-btn:hover { opacity: 0.88; }

/* ── Modal ── */
.rd-modal-info-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
}
.rd-modal-info-label { font-size: 0.72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
.rd-modal-info-val { font-size: 0.88rem; font-weight: 700; color: #0f172a; }
.rd-modal-multi-list { display: flex; flex-direction: column; gap: 4px; }
.rd-modal-multi-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 8px;
}
.rd-modal-total-label { font-size: 0.72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; display: block; margin-bottom: 4px; }
.rd-modal-total { font-size: 1.6rem; font-weight: 900; color: #0f172a; }

/* ── Preview chip (form) ── */
.rd-preview-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fef3c7, #fff7ed);
  border: 1px solid #fde68a;
  border-radius: 12px;
  margin-bottom: 4px;
}
.rd-preview-icon { font-size: 1.2rem; color: #D97706; flex-shrink: 0; }
.rd-preview-body { display: flex; flex-direction: column; gap: 2px; }
.rd-preview-total { font-size: 1.1rem; font-weight: 800; color: #92400e; }
.rd-preview-detail { font-size: 0.75rem; color: #78350f; }

/* ── Danger zone (edit page) ── */
.ef-danger-zone {
  margin-top: 16px;
  text-align: center;
}
.ef-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.ef-delete-btn:hover { background: #fee2e2; border-color: #ef4444; }

/* ── Mobile responsive ── */
@media (max-width: 700px) {
  .rd-page { padding: 12px 12px 80px; }

  /* Summary bar → 2-col */
  .rd-summary-bar { grid-template-columns: 1fr 1fr; }

  /* Cards → 1 col */
  .rd-cards { grid-template-columns: 1fr; }

  /* Desktop table → single flex row on mobile */
  .rd-install-thead { display: none !important; }
  .rd-install-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
  }
  /* Hide all desktop columns */
  .rd-col-num    { display: none; }
  .rd-col-date   { display: none; }
  .rd-col-amt    { display: none; }
  .rd-col-status { display: none; }
  .rd-col-act    { display: none; }
  /* Mobile row is the main content */
  .rd-mobile-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .rd-mobile-date { flex: 1; font-size: 0.85rem; font-weight: 600; color: #0f172a; white-space: nowrap; }
  .rd-mobile-amt  { font-size: 0.85rem; font-weight: 700; color: #0f172a; flex-shrink: 0; }
  .rd-install-foot { font-size: 0.82rem; }
}

/* ── Dark mode ── */
[data-bs-theme="dark"] .rd-card           { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .rd-card-name      { color: #f1f5f9; }
[data-bs-theme="dark"] .rd-card-amount    { color: #f1f5f9; }
[data-bs-theme="dark"] .rd-section-count  { background: #1e293b; color: #94a3b8; }
[data-bs-theme="dark"] .rd-list           { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .rd-list-row       { border-color: #0f172a; }
[data-bs-theme="dark"] .rd-list-done      { background: #022c22; }
[data-bs-theme="dark"] .rd-list-name      { color: #f1f5f9; }
[data-bs-theme="dark"] .rd-sum-card       { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .rd-sum-value      { color: #f1f5f9; }
[data-bs-theme="dark"] .rd-prog-card      { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .rd-notes-card     { background: #291d00; border-color: #78350f; }
[data-bs-theme="dark"] .rd-install-card   { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .rd-install-thead  { background: #0f172a; }
[data-bs-theme="dark"] .rd-install-row    { border-color: #0f172a; }
[data-bs-theme="dark"] .rd-install-row:hover { background: #0f172a; }
[data-bs-theme="dark"] .rd-install-foot   { background: #0f172a; border-color: #334155; color: #f1f5f9; }
[data-bs-theme="dark"] .rd-action-btn     { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-bs-theme="dark"] .rd-date-val       { color: #cbd5e1; }
[data-bs-theme="dark"] .rd-amt-val        { color: #f1f5f9; }
[data-bs-theme="dark"] .rd-num-val        { color: #94a3b8; }
[data-bs-theme="dark"] .rd-progress-bar   { background: #0f172a; }
[data-bs-theme="dark"] .rd-preview-chip   { background: #291d00; border-color: #78350f; }

/* ═══════════════════════════════════════════════════════════════
   mob-drawer-* — Mobile "Más" bottom sheet
   ═══════════════════════════════════════════════════════════════ */

.mob-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.25s;
}
.mob-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.mob-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 1050;
  padding: 10px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.15);
}
.mob-drawer.open {
  transform: translateY(0);
}

.mob-drawer-handle {
  width: 36px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  margin: 0 auto 14px;
}

.mob-drawer-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 14px;
}

.mob-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.mob-drawer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: #f8fafc;
  border-radius: 14px;
  text-decoration: none;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all 0.12s;
}
.mob-drawer-item i { font-size: 1.3rem; }
.mob-drawer-item:hover,
.mob-drawer-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1D4ED8;
}

.mob-drawer-foot {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}
.mob-drawer-signout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: transparent;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.mob-drawer-signout:hover { background: #fee2e2; }

/* Dark mode drawer */
[data-bs-theme="dark"] .mob-drawer { background: #1e293b; }
[data-bs-theme="dark"] .mob-drawer-item { background: #0f172a; color: #94a3b8; }
[data-bs-theme="dark"] .mob-drawer-item:hover,
[data-bs-theme="dark"] .mob-drawer-item.active { background: #1e3a5f; border-color: #3b82f6; color: #93c5fd; }
[data-bs-theme="dark"] .mob-drawer-title { color: #475569; }
[data-bs-theme="dark"] .mob-drawer-foot { border-color: #334155; }

/* ========================================
   SAVING GOALS PAGE — sg-*
   ======================================== */
.sg-page { padding: 20px 24px 40px; }
.sg-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sg-title { font-size: clamp(1.2rem, 4vw, 1.5rem); font-weight: 800; color: #0A2540; margin: 0; }
.sg-title i { color: #3DE2C2; margin-right: 6px; }
.sg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sg-stat-card { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 10px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.sg-stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; color: white; font-size: 1rem; }
.sg-stat-value { font-size: 1.4rem; font-weight: 800; color: #0A2540; line-height: 1.1; }
.sg-stat-value-sm { font-size: 0.92rem; }
.sg-stat-label { font-size: 0.7rem; color: #64748b; font-weight: 600; margin-top: 2px; }
.sg-section { background: white; border: 1px solid #e2e8f0; border-radius: 14px; margin-bottom: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.sg-section-header { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 8px; }
.sg-section-title { font-size: 0.85rem; font-weight: 700; color: #0A2540; flex: 1; }
.sg-section-count { font-size: 0.72rem; font-weight: 700; background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 999px; }
.sg-goal-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid #f8fafc; text-decoration: none; color: inherit; transition: background 0.15s; }
.sg-goal-item:last-child { border-bottom: none; }
.sg-goal-item:hover { background: #fafbff; color: inherit; }
.sg-goal-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, #3DE2C2, #2BC9AA); color: white; font-size: 1.1rem; }
.sg-goal-body { flex: 1; min-width: 0; }
.sg-goal-name { font-size: 0.88rem; font-weight: 700; color: #0A2540; margin-bottom: 2px; }
.sg-goal-meta { font-size: 0.72rem; color: #94a3b8; margin-bottom: 6px; }
.sg-progress { height: 6px; border-radius: 999px; background: #f1f5f9; margin: 8px 0 6px; }
.sg-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3DE2C2, #2BC9AA); transition: width 0.6s ease; }
.sg-goal-amounts { display: flex; gap: 14px; }
.sg-amount-item small { display: block; font-size: 0.62rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.sg-amount-item strong { font-size: 0.82rem; }
.sg-pct-badge { padding: 3px 10px; border-radius: 999px; background: #f1f5f9; font-size: 0.72rem; font-weight: 700; color: #0A2540; white-space: nowrap; flex-shrink: 0; }
.sg-badge { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.sg-badge-danger { background: #FEE2E2; color: #DC2626; }
.sg-badge-success { background: #D1FAE5; color: #059669; }
.sg-empty { padding: 40px 16px; text-align: center; color: #94a3b8; }
.sg-empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.sg-empty p { font-size: 0.88rem; margin-bottom: 16px; }
.sg-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0A2540;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.sg-quick-chip:hover { border-color: #3DE2C2; background: #f0fdfb; transform: translateY(-1px); color: #0A2540; }

/* ========================================
   BANK ACCOUNTS PAGE — ba-*
   ======================================== */
.ba-page { padding: 20px 24px 40px; }
.ba-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ba-title { font-size: clamp(1.2rem, 4vw, 1.5rem); font-weight: 800; color: #0A2540; margin: 0; }
.ba-title i { color: #667eea; margin-right: 6px; }
.ba-netear-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; background: white; color: #EF4444; border: 1.5px solid #fecaca; border-radius: 10px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.ba-netear-btn:hover { background: #FEF2F2; border-color: #f87171; }
.ba-patrimony-card { background: linear-gradient(135deg, #0A2540 0%, #1a3a5c 100%); border-radius: 14px; padding: 20px; margin-bottom: 14px; text-align: center; }
.ba-patrimony-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.ba-patrimony-value { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; color: white; line-height: 1.1; }
.ba-patrimony-sub { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 4px; }
.ba-section { background: white; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.ba-section-header { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 8px; }
.ba-section-title { font-size: 0.85rem; font-weight: 700; color: #0A2540; flex: 1; }
.ba-section-count { font-size: 0.72rem; font-weight: 700; background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 999px; }
.ba-account-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #f8fafc; border-left: 3px solid transparent; transition: background 0.15s; }
.ba-account-item:last-child { border-bottom: none; }
.ba-account-item:hover { background: #fafbff; }
.ba-account-inactive { opacity: 0.65; }
.ba-account-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; }
.ba-account-body { flex: 1; min-width: 0; }
.ba-account-name { font-size: 0.88rem; font-weight: 700; color: #0A2540; }
.ba-account-type { font-size: 0.72rem; color: #94a3b8; }

.ba-cash-warning {
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #B45309;
  cursor: help;
}
.ba-cash-warning i { margin-right: 2px; }
.ba-account-balance { text-align: right; flex-shrink: 0; }
.ba-balance-value { font-size: 0.95rem; font-weight: 800; color: #0A2540; }
.ba-balance-currency { font-size: 0.68rem; color: #94a3b8; }
.ba-menu-btn { background: none; border: none; color: #94a3b8; padding: 6px 8px; border-radius: 6px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.ba-menu-btn:hover { background: #f1f5f9; color: #0A2540; }
.ba-empty { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 48px 24px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.ba-empty-icon { font-size: 3rem; color: #e2e8f0; margin-bottom: 16px; }
.ba-empty-title { font-size: 1.1rem; font-weight: 800; color: #0A2540; margin-bottom: 8px; }
.ba-empty-text { font-size: 0.85rem; color: #94a3b8; margin-bottom: 20px; }

/* ========================================
   BUDGETS PAGE — bud-*
   ======================================== */
.bud-page { padding: 20px 24px 40px; }
.bud-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.bud-title { font-size: clamp(1.2rem, 4vw, 1.5rem); font-weight: 800; color: #0A2540; margin: 0; }
.bud-title i { color: #667eea; margin-right: 6px; }
.bud-period-label { font-size: 0.8rem; font-weight: 600; color: #0A2540; white-space: nowrap; padding: 0 4px; }
.bud-summary-card { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.bud-summary-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bud-summary-item { flex: 1; display: flex; flex-direction: column; }
.bud-summary-label { font-size: 0.68rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.bud-summary-value { font-size: 1rem; font-weight: 800; color: #0A2540; }
.bud-summary-divider { width: 1px; height: 32px; background: #e2e8f0; flex-shrink: 0; }
.bud-pct-badge { font-size: 0.85rem; font-weight: 800; flex-shrink: 0; }
.bud-summary-progress { height: 8px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.bud-section { background: white; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.bud-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f8fafc; transition: background 0.15s; }
.bud-item:last-child { border-bottom: none; }
.bud-item:hover { background: #fafbff; }
.bud-item-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bud-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bud-item-info { min-width: 0; }
.bud-item-name { font-size: 0.88rem; font-weight: 700; color: #0A2540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bud-item-amounts { font-size: 0.78rem; color: #64748b; }
.bud-item-sep { margin: 0 3px; color: #e2e8f0; }
.bud-item-total { color: #94a3b8; }
.bud-item-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.bud-item-progress { width: 120px; }
.bud-item-bar { height: 6px; border-radius: 999px; background: #f1f5f9; margin-bottom: 3px; overflow: hidden; }
.bud-item-status { text-align: right; }
.bud-action-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; background: #f8fafc; border: 1px solid #e2e8f0; color: #64748b; font-size: 0.78rem; text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s; cursor: pointer; }
.bud-action-btn:hover { background: #f1f5f9; color: #0A2540; border-color: #cbd5e1; }
.bud-action-danger:hover { background: #FEF2F2; color: #DC2626; border-color: #fecaca; }
.bud-add-categories { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.bud-add-label { font-size: 0.75rem; font-weight: 600; color: #64748b; margin-bottom: 10px; }
.bud-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bud-cat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid; font-size: 0.75rem; font-weight: 600; text-decoration: none; transition: opacity 0.15s, transform 0.15s; background: white; }
.bud-cat-chip:hover { opacity: 0.8; transform: translateY(-1px); }
.bud-cat-chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ========================================
   HELP PAGE — help-*
   ======================================== */
.help-page { padding: 20px 24px 40px; max-width: 860px; margin: 0 auto; }
.help-header { text-align: center; margin-bottom: 24px; }
.help-icon { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.6rem; margin: 0 auto 14px; }
.help-title { font-size: clamp(1.4rem, 4vw, 1.8rem); font-weight: 800; color: #0A2540; margin-bottom: 6px; }
.help-subtitle { font-size: 0.88rem; color: #64748b; }
.help-restore-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: white; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 0.82rem; font-weight: 600; color: #667eea; cursor: pointer; transition: border-color 0.15s, background 0.15s; margin-bottom: 24px; }
.help-restore-btn:hover { border-color: #667eea; background: #f8f7ff; }
.help-section { background: white; border: 1px solid #e2e8f0; border-radius: 16px; margin-bottom: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.help-section-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; }
.help-section-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.95rem; flex-shrink: 0; }
.help-section-title { font-size: 0.95rem; font-weight: 800; color: #0A2540; }
.help-body { padding: 16px 18px; }
.help-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #f8fafc; margin-bottom: 8px; border-left: 3px solid #e2e8f0; }
.help-step-num { width: 22px; height: 22px; border-radius: 50%; background: #667eea; color: white; font-size: 0.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.help-step-text strong { font-size: 0.84rem; color: #0A2540; display: block; margin-bottom: 2px; }
.help-step-text small { font-size: 0.78rem; color: #64748b; }
.help-alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-start; }
.help-alert-warning { background: #FFFBEB; border: 1.5px solid #FCD34D; }
.help-alert-info { background: #EFF6FF; border: 1.5px solid #93C5FD; }
.help-alert-danger { background: #FEF2F2; border: 1.5px solid #FCA5A5; }
.help-alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.help-alert-text { font-size: 0.82rem; color: #374151; }
.help-alert-text strong { display: block; margin-bottom: 3px; }
.help-list { list-style: none; padding: 0; margin: 0; }
.help-list li { padding: 6px 0; font-size: 0.84rem; color: #374151; display: flex; gap: 8px; align-items: flex-start; border-bottom: 1px solid #f8fafc; }
.help-list li:last-child { border-bottom: none; }
.help-list li::before { content: '·'; color: #3DE2C2; font-weight: 800; flex-shrink: 0; }
.help-faq-item { border-bottom: 1px solid #f1f5f9; }
.help-faq-item:last-child { border-bottom: none; }
.help-faq-btn { width: 100%; background: none; border: none; text-align: left; padding: 12px 14px; font-size: 0.85rem; font-weight: 600; color: #0A2540; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: background 0.15s; }
.help-faq-btn:hover { background: #f8fafc; }
.help-faq-btn[aria-expanded="true"] { color: #667eea; }
.help-faq-answer { padding: 0 14px 12px; font-size: 0.82rem; color: #64748b; line-height: 1.6; }

@media (max-width: 576px) {
  .sg-page, .ba-page, .bud-page, .help-page { padding: 16px 16px 40px; }
  .bud-item-progress { width: 80px; }
  .sg-stat-value { font-size: 1.1rem; }
  .sg-stat-value-sm { font-size: 0.8rem; }
}

/* ========================================
   AUTH PAGES — auth-* (login / sign up / password)
   ======================================== */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}
.auth-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(10,37,64,0.10), 0 2px 8px rgba(10,37,64,0.06);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
/* Fondo sólido idéntico al del logo aplanado (logo-finaxy-dark.png) — un
   degradado o decoración aquí haría visible el rectángulo de la imagen,
   sobre todo en navegadores mobile con modo oscuro forzado. */
.auth-banner {
  background: #0A2540;
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3DE2C2, #2BC9AA);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.6rem;
  color: white;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(61,226,194,0.35);
}
.auth-app-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}
.auth-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  position: relative;
  z-index: 1;
}
.auth-body {
  padding: 28px 28px 24px;
}
.auth-subtitle {
  font-size: 1rem;
  font-weight: 800;
  color: #0A2540;
  margin-bottom: 20px;
}
.auth-field {
  margin-bottom: 16px;
}
.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.auth-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #0A2540;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}
.auth-input:focus {
  border-color: #3DE2C2;
  box-shadow: 0 0 0 3px rgba(61,226,194,0.15);
}
.auth-input::placeholder { color: #cbd5e1; }
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
}
.auth-remember input[type="checkbox"] { accent-color: #3DE2C2; width: 16px; height: 16px; }
.auth-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #3DE2C2 0%, #2BC9AA 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(61,226,194,0.30);
  margin-bottom: 20px;
}
.auth-submit:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(61,226,194,0.35); }
.auth-submit:active { transform: translateY(0); }
.auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.auth-link {
  font-size: 0.82rem;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.auth-link:hover { color: #4f59c8; text-decoration: underline; }
.auth-divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 16px 0;
}
.auth-error-box {
  background: #FEF2F2;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: #DC2626;
}
.auth-error-box i { margin-right: 6px; }

[data-bs-theme="dark"] .auth-card { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .auth-subtitle { color: #e2e8f0; }
[data-bs-theme="dark"] .auth-label { color: #94a3b8; }
[data-bs-theme="dark"] .auth-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .auth-input:focus { border-color: #3DE2C2; }
[data-bs-theme="dark"] .auth-remember { color: #94a3b8; }

/* ── Scroll infinito mobile (txn-*) ── */
.txn-load-more {
  display: flex;
  justify-content: center;
  padding: 20px 16px;
}
.txn-load-spinner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
}
.txn-load-end {
  display: flex;
  justify-content: center;
  padding: 16px;
  font-size: 0.8rem;
  color: #94a3b8;
  gap: 6px;
  align-items: center;
}

/* ========================================
   RECURRING DEBTS — responsive móvil (rd-*)
   ======================================== */
@media (max-width: 640px) {
  .rd-page { padding: 16px 14px 48px; }

  /* Header: botón "Nueva deuda" a lo ancho debajo del título */
  .rd-header { gap: 14px; }
  .rd-header-left { flex: 1; min-width: 0; }

  /* Cards: una sola columna (evita desborde del minmax 300px) */
  .rd-cards { grid-template-columns: 1fr; gap: 12px; }
  .rd-card { padding: 16px; }

  /* Card top: monto debajo del nombre, no apretado a la derecha */
  .rd-card-top { flex-direction: column; align-items: stretch; gap: 8px; }
  .rd-card-meta { text-align: left; }
  .rd-card-name { white-space: normal; }

  /* Resumen del show: 2 columnas en vez de 4 */
  .rd-summary-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rd-sum-card { padding: 12px 14px; }

  /* ── Tabla de cuotas → modo lista compacta ── */
  .rd-install-thead { display: none; }            /* ocultar cabecera de tabla */
  .rd-install-header { padding: 12px 14px; }

  .rd-install-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
  }
  /* Ocultar columnas de escritorio */
  .rd-col-date, .rd-col-amt, .rd-col-status, .rd-col-act { display: none; }
  /* Mantener checkbox (pago múltiple) y número de cuota */
  .rd-col-chk { flex-shrink: 0; }
  .rd-col-num { display: block; flex-shrink: 0; min-width: 20px; }

  /* Fila móvil: fecha · monto · acción */
  .rd-mobile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
  }
  .rd-mobile-date { font-size: 0.82rem; color: #475569; white-space: nowrap; }
  .rd-mobile-amt { font-size: 0.9rem; font-weight: 700; color: #0f172a; margin-left: auto; white-space: nowrap; }

  .rd-install-foot { padding: 12px 14px; }

  /* Modal de pago múltiple: filas más compactas */
  .rd-modal-multi-row { grid-template-columns: 1fr auto; gap: 4px 8px; }
  .rd-modal-total { font-size: 1.4rem; }

  /* Historial / listas: total a línea aparte si no cabe */
  .rd-list-total { margin-left: 0; }
}

