/* --- 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;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #F5F7FA;
  color: #0A2540;
}

main {
  flex: 1;
}

/* 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: 160px;
  border: 2px solid #2d3748;
}

.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);
}

/* 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
   ======================================== */

