/**
 * styles.css
 * Mente Financiera - Hojas de Estilos Modernas y Mobile-First
 */

/* ==========================================================================
   1. VARIABLES DE DISEÑO & PALETA DE COLORES
   ========================================================================== */
:root {
  /* Tipografía */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-accent: 'Outfit', sans-serif;

  /* Paleta Light Theme */
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  
  --border-color: #E2E8F0;
  
  --primary: #4F46E5;       /* Indigo Moderno */
  --primary-hover: #4338CA;
  
  --danger: #FF4D5E;        /* Coral Energetico (Alta Prioridad) */
  --success: #10B981;       /* Esmeralda / Ahorro */
  --warning: #F5B942;       /* Dorado / Libertad Financiera */
  --info: #8B5CF6;          /* Violeta / Educacion */
  --accent: #F97316;        /* Naranja / Juego */
  --giving: #22C55E;        /* Verde Donación */

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-nav: 0 -4px 12px rgba(0, 0, 0, 0.03);

  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Alturas y Espaciados */
  --bottom-nav-height: 72px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Modo Oscuro (Dark Theme) */
html.dark {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  
  --border-color: #334155;
  
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-nav: 0 -4px 12px rgba(0, 0, 0, 0.4);
}

/* Reset General */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  user-select: none;
  min-height: 100vh;
}

/* ==========================================================================
   2. DISEÑO DEL SHELL & MOBILE LAYOUT
   ========================================================================== */
#app-shell {
  width: 100%;
  max-width: 480px; /* Ancho máximo de celular simulado */
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 20px calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 24px) 20px;
  position: relative;
  background-color: var(--bg-primary);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
}

/* Paneles de Vista */
.view-panel {
  display: none;
  animation: viewFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-panel.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   3. ESTILOS DE ELEMENTOS COMUNES / COMPONENTES CARD
   ========================================================================== */
.card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.card:active {
  transform: scale(0.995);
  box-shadow: var(--shadow-sm);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.view-title {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   4. COMPONENTES DE FORMULARIO
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-group.font-large label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.amount-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-field {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-accent);
  padding-left: 54px;
  height: 60px;
  border-radius: var(--radius-sm);
}

.currency-symbol {
  position: absolute;
  left: 16px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: var(--font-accent);
}

.help-block {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ==========================================================================
   5. BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background-color: var(--bg-tertiary);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF;
}

.btn-warning {
  background-color: var(--warning);
  color: #0F172A;
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-icon.delete:hover {
  color: var(--danger);
  background-color: rgba(255, 77, 94, 0.1);
}

/* ==========================================================================
   6. NAVEGACIÓN INFERIOR & FAB
   ========================================================================== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-area-bottom);
  box-shadow: var(--shadow-nav);
  z-index: 100;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-tertiary);
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: color 0.2s ease;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 20px;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
}

.nav-fab-space {
  width: 56px;
  height: 56px;
}

/* FAB */
.fab-btn {
  position: fixed;
  bottom: calc(20px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
  z-index: 101;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-btn:active {
  transform: translateX(-50%) scale(0.9);
  background-color: var(--primary-hover);
}

/* ==========================================================================
   7. DASHBOARD / VISTA INICIO
   ========================================================================== */
.dashboard-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.welcome-title {
  font-family: var(--font-accent);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.month-selector-wrapper input {
  padding: 6px 12px;
  font-size: 12px;
}

.financial-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-item {
  background-color: var(--bg-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-val {
  font-family: var(--font-accent);
  font-size: 16px;
  font-weight: 700;
}

/* Banner de Pagarse Primero */
.pay-first-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.1) 100%);
  border-left: 4px solid var(--primary);
}

.pay-first-banner.status-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-left-color: var(--success);
}

.pay-first-banner.status-warning {
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.05) 0%, rgba(245, 185, 66, 0.1) 100%);
  border-left-color: var(--warning);
}

.pay-first-banner.status-danger {
  background: linear-gradient(135deg, rgba(255, 77, 94, 0.05) 0%, rgba(255, 77, 94, 0.1) 100%);
  border-left-color: var(--danger);
}

.banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.banner-title {
  font-size: 14px;
  font-weight: 700;
}

.banner-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  background-color: var(--bg-secondary);
}

.banner-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.banner-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 10px;
}

.banner-progress {
  height: 6px;
  background-color: var(--bg-tertiary);
}

/* Hábitos Diarios "Hoy" */
.habits-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.habit-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
}

.habit-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.habit-value {
  font-family: var(--font-accent);
  font-size: 20px;
  font-weight: 800;
  margin: 6px 0;
}

.habit-value-sub {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Score Financiero */
.circular-score-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 5px solid var(--border-color);
  border-top-color: var(--score-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.score-number {
  font-family: var(--font-accent);
  font-size: 20px;
  font-weight: 800;
}

.score-label-sub {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.score-card {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
}

.score-desc {
  font-size: 11px;
  color: var(--text-secondary);
  flex: 1;
  padding-left: 20px;
}

/* Alertas */
.alerts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.08);
  color: var(--success);
}

.alert-warning {
  background-color: rgba(245, 185, 66, 0.08);
  color: var(--warning);
}

.alert-error {
  background-color: rgba(255, 77, 94, 0.08);
  color: var(--danger);
}

/* Miniatures */
.upcoming-pay-mini, .priority-goal-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pay-name {
  font-size: 11px;
  font-weight: 600;
}

.pay-amount {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-accent);
}

.pay-due {
  font-size: 9px;
  color: var(--text-tertiary);
}

.goal-name-mini {
  font-size: 11px;
  font-weight: 600;
}

.goal-percent-mini {
  font-size: 9px;
  color: var(--text-secondary);
  align-self: flex-end;
}

/* Gráficos */
.charts-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-card-wrapper {
  padding: 16px;
}

.chart-title-text {
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.canvas-container {
  position: relative;
  height: 200px;
  width: 100%;
}

/* ==========================================================================
   8. TRANSACCIONES VIEW
   ========================================================================== */
.filters-card {
  padding: 12px;
}

.filter-row {
  display: flex;
  margin-bottom: 8px;
}

.filter-row-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.search-group {
  position: relative;
}

.filter-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

#tx-search {
  padding-left: 36px;
  font-size: 12px;
  height: 38px;
}

.filter-group label {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.filter-group select {
  height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}

/* Lista */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tx-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-details {
  min-width: 0;
  flex: 1;
}

.tx-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-category {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.priority-pill {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
}

.badge-high {
  background-color: rgba(255, 77, 94, 0.1);
  color: var(--danger);
}

.badge-normal {
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}

.badge-low {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.tx-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.tx-note {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.tx-amount {
  font-family: var(--font-accent);
  font-size: 16px;
  font-weight: 700;
}

.tx-amount-income {
  color: var(--success);
}

.tx-amount-expense {
  color: var(--text-primary);
}

.tx-amount-saving {
  color: var(--info);
}

.tx-amount-investment {
  color: var(--warning);
}

.tx-amount-debt {
  color: var(--danger);
}

.tx-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

.badge-income { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-expense { background-color: rgba(15, 23, 42, 0.05); color: var(--text-secondary); }
.badge-saving { background-color: rgba(139, 92, 246, 0.1); color: var(--info); }
.badge-investment { background-color: rgba(245, 185, 66, 0.1); color: var(--warning); }
.badge-debt { background-color: rgba(255, 77, 94, 0.1); color: var(--danger); }

/* Acciones en hover/click para móvil */
.tx-actions-hover {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

/* ==========================================================================
   9. METAS & DEUDAS VIEW
   ========================================================================== */
.goals-grid, .debts-grid, .recurring-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goal-card, .debt-card, .recurring-card {
  position: relative;
  border-top: 3px solid var(--border-color);
}

.goal-card-high, .debt-card-high {
  box-shadow: 0 4px 14px rgba(255, 77, 94, 0.1);
  border-top-color: var(--danger) !important;
}

.goal-card-header, .debt-header, .rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.goal-icon-wrapper, .account-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.goal-priority-badge, .debt-priority-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
}

.goal-title, .debt-title, .rec-name {
  font-family: var(--font-accent);
  font-size: 16px;
  font-weight: 700;
}

.goal-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.goal-progress-details, .debt-financials {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.goal-progress-current, .highlighted-debt {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-accent);
}

.goal-progress-target, .debt-fin-val {
  font-size: 12px;
  color: var(--text-secondary);
}

.goal-progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-progress-bar, .debt-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.goal-footer, .debt-footer-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

.goal-actions-row, .debt-actions-row, .rec-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.goal-actions-menu, .debt-actions-menu, .rec-meta-actions {
  display: flex;
  gap: 4px;
}

/* Debts Dashboard */
.debt-summary-dashboard {
  background-color: var(--bg-secondary);
  margin-bottom: 24px;
}

.debt-summary-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  text-align: center;
  margin-bottom: 16px;
}

.debt-sum-col {
  display: flex;
  flex-direction: column;
}

.debt-sum-num {
  font-family: var(--font-accent);
  font-size: 14px;
  font-weight: 700;
}

.overall-debt-progress {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 6px;
}

.debt-details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.debt-detail-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   10. MODALES & DIÁLOGOS
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  transform: translateY(16px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Quick Action selector styling */
.quick-selector-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 16px 0;
}

.quick-option-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.quick-option-btn:hover {
  background-color: var(--bg-primary);
}

.quick-option-btn i {
  font-size: 28px;
}

/* ==========================================================================
   11. CUENTAS (WALLETS) / CONFIG / RECURRING
   ========================================================================== */
.accounts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.account-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-type-badge {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.account-info {
  margin-top: 12px;
}

.account-name {
  font-size: 15px;
  font-weight: 600;
}

.account-balance {
  font-family: var(--font-accent);
  font-size: 20px;
  font-weight: 800;
}

.positive-balance {
  color: var(--text-primary);
}

.negative-balance {
  color: var(--danger);
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.net-worth-card {
  text-align: center;
}

/* Config sliders */
.jar-slider-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jar-slider-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

.jar-total-indicator {
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.total-correct {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.total-incorrect {
  background-color: rgba(255, 77, 94, 0.1);
  color: var(--danger);
}

/* Switch toggle styling */
.flex-row-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .2s;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
}

input:checked + .slider-toggle {
  background-color: var(--primary);
}

input:checked + .slider-toggle:before {
  transform: translateX(20px);
}

.slider-toggle.round {
  border-radius: 34px;
}

.slider-toggle.round:before {
  border-radius: 50%;
}

.border-box {
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* Data backup */
.data-buttons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.btn-file-upload {
  cursor: pointer;
}

.data-danger-zone {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Recurring */
.recurring-paused {
  opacity: 0.6;
  background-color: var(--bg-tertiary);
}

.rec-title-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rec-frequency-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.rec-body {
  margin-top: 8px;
}

.rec-amount {
  font-family: var(--font-accent);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.rec-details {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   12. ONBOARDING & TOAST ALERTS
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.onboarding-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.onboarding-box {
  width: 100%;
  max-width: 400px;
  padding: 30px 24px;
}

.onboarding-logo {
  font-size: 48px;
  color: var(--primary);
  margin-bottom: 12px;
}

.onboarding-header {
  text-align: center;
  margin-bottom: 24px;
}

.onboarding-header h2 {
  font-family: var(--font-accent);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.onboarding-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

.onboarding-step {
  display: none;
}

.onboarding-step.active {
  display: block;
}

.step-title {
  font-family: var(--font-accent);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 6px;
}

.onboarding-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 40px);
  max-width: 380px;
}

.toast-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.toast-icon {
  font-size: 20px;
}

.toast-info { border-left: 4px solid var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

/* Animaciones */
.animate-fade-in { animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.animate-fade-out { animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.animate-scale-up { animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, -10px); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 48px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Margin helpers */
.mt-4 { margin-top: 24px; }
.mt-3 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.mt-1 { margin-top: 4px; }
.mb-4 { margin-bottom: 24px; }
.mb-3 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }

/* ==========================================================================
   14. REFINAMIENTO: INGRESOS EXTRA, MANUAL Y PALETA EXTENDIDA
   ========================================================================== */
:root {
  --priority-high: #FF4D5E;
  --priority-normal: #4F46E5;
  --priority-low: #64748B;
  --jar-needs: #2563EB;
  --jar-freedom: #F5B942;
  --jar-education: #8B5CF6;
  --jar-long-term: #10B981;
  --jar-play: #F97316;
  --jar-giving: #22C55E;
  --extra-income: #06B6D4;
  --extra-income-2: #14B8A6;
  --wealth-gold: #F59E0B;
  --debt-red: #DC2626;
  --soft-pink: #EC4899;
}

.text-sky { color: var(--extra-income); }
.tx-amount-extra { color: var(--extra-income); }
.badge-extra-income {
  background-color: rgba(6, 182, 212, 0.12);
  color: var(--extra-income);
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-mini-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

.settings-mini-btn:active {
  transform: scale(0.95);
}

.extra-income-snapshot {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(6, 182, 212, 0.25);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(20, 184, 166, 0.06));
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.extra-income-snapshot strong {
  display: block;
  font-family: var(--font-accent);
  font-size: 24px;
  color: var(--extra-income);
  margin: 4px 0;
}

.extra-income-snapshot small {
  color: var(--text-secondary);
  font-size: 11px;
}

.extra-snapshot-icon,
.extra-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--extra-income);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.mindset-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.08), rgba(249, 115, 22, 0.05));
  border-color: rgba(245, 185, 66, 0.25);
}

.mindset-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(245, 185, 66, 0.14);
  color: var(--wealth-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.mindset-card h3 {
  font-family: var(--font-accent);
  font-size: 16px;
  margin: 2px 0 4px;
}

.mindset-card p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.extra-hero-card {
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 42%), var(--bg-secondary);
  border-color: rgba(6, 182, 212, 0.25);
}

.extra-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.extra-hero-amount {
  font-family: var(--font-accent);
  font-weight: 800;
  font-size: 32px;
  color: var(--extra-income);
  letter-spacing: -0.7px;
}

.extra-plan-grid,
.projection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.projection-grid {
  grid-template-columns: repeat(2, 1fr);
}

.extra-plan-grid div,
.projection-grid div {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.extra-plan-grid strong,
.projection-grid strong {
  font-family: var(--font-accent);
  font-size: 14px;
}

.extra-plan-grid span,
.projection-grid span {
  color: var(--text-tertiary);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.extra-source-list,
.extra-movements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.extra-source-item,
.extra-movement-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.extra-source-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.extra-source-main {
  flex: 1;
  min-width: 0;
}

.extra-source-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.extra-source-title-row span {
  font-family: var(--font-accent);
  font-weight: 800;
  color: var(--source-color);
  white-space: nowrap;
}

.extra-source-main small {
  color: var(--text-tertiary);
  font-size: 10px;
}

.mini-progress {
  height: 5px;
  margin: 6px 0 3px;
}

.extra-rule-card {
  border-left: 4px solid var(--extra-income);
}

.extra-rule-card h3 {
  font-family: var(--font-accent);
  font-size: 16px;
  margin-bottom: 8px;
}

.extra-rule-card p {
  color: var(--text-secondary);
  font-size: 12px;
}

.compact-empty {
  padding: 28px 16px;
}

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

.palette-chip {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 0 8px;
  align-items: center;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.palette-chip span {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}

.palette-chip strong {
  font-size: 11px;
}

.palette-chip small {
  font-size: 9px;
  color: var(--text-tertiary);
}

.user-manual-card details {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.user-manual-card summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.user-manual-card p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.quick-selector-row {
  flex-wrap: wrap;
  gap: 10px;
}

.quick-option-btn {
  min-width: 110px;
}

@media (max-width: 380px) {
  .nav-label { font-size: 9px; }
  .nav-icon { font-size: 18px; }
  .extra-hero-amount { font-size: 28px; }
  .extra-plan-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: 1fr; }
}
