﻿:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-teal-600-rgb: 29, 116, 128;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;
  --sidebar-width: 260px;
  --navbar-height: 80px;

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-surface-raised: var(--color-white);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);

/* Typing Indicator Styles */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
  animation: typingBounce 1.4s infinite ease-in-out;
  opacity: 0.7;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Goals Chart Container */
.goals-chart-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.goals-progress-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--color-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition: color 0.3s ease;
}

.goals-progress-value.positive {
  color: var(--color-success);
}

.goals-progress-value.negative {
  color: var(--color-error);
}

/* ================================
   PREMIUM DASHBOARD STYLES
   ================================ */

/* Main Dashboard Layout */
.premium-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
  transition: gap 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Removed duplicate dashboard-grid - keeping the one in GRID LAYOUTS section */

/* === DASHBOARD GRID === */
.chart-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.cards-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.main-value {
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 700;
}

/* Progress Components */
.progress-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.progress-value {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.progress-fill.necessary {
  background: var(--color-success);
}

.progress-fill.unnecessary {
  background: var(--color-warning);
}

/* Payment Components */
.payment-count {
  color: var(--color-warning);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.payments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-12);
  background: var(--color-secondary);
  border-radius: var(--radius-base);
  border-left: 3px solid;
  transition: all 0.3s ease;
}

.payment-item.urgent {
  border-left-color: var(--color-error);
}

.payment-item.warning {
  border-left-color: var(--color-warning);
}

.payment-item.normal {
  border-left-color: var(--color-success);
}

.payment-item:hover {
  background: var(--color-border);
}

.payment-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.payment-description {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.payment-date {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.payment-amount {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

/* Goals Components */
.cta-button {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border: none;
  border-radius: var(--radius-base);
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.cta-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.goals-summary {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.circular-progress {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--color-border);
}

.progress-ring-fill {
  fill: none;
  stroke: var(--color-success);
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 1s ease;
}

.progress-center {
  position: absolute;
  color: var(--color-success);
  font-size: var(--font-size-lg);
}

.goals-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.goals-text {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.goals-percentage {
  color: var(--color-success);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

/* Left Panel - Chart */
.chart-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container-premium {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  height: auto;
  min-height: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.chart-container-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Trend Chart Alignment */
.chart-column > .chart-container-premium:nth-child(2) {
  margin-top: var(--space-16);
  min-height: 250px;
  max-height: 280px;
}

/* Specific styling for trend chart container */
.chart-container-premium:has(.trend-chart-wrapper) {
  padding: var(--space-16);
  min-height: 250px;
  max-height: 280px;
}

/* Wave Animation for Trend Chart */
@keyframes wave-breath {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.03); }
}

#trendChart {
  animation: wave-breath 4s ease-in-out infinite;
  transform-origin: bottom;
}


/* === NEW LOGO STYLING === */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-svg {
  width: 36px;
  height: 36px;
  transition: transform 0.3s ease;
}

.navbar__logo:hover .logo-svg {
  transform: scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin: 0;
}

.brand-suite {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-white);
  margin: 0;
  letter-spacing: 0.5px;
}

.beta-badge {
  background: linear-gradient(45deg, #ff6b6b, #ffa500);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: beta-pulse 2s ease-in-out infinite;
}

@keyframes beta-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === PROFESSIONAL FOOTER === */
.footer {
  background: linear-gradient(to bottom, var(--color-surface), var(--color-background));
  border-top: 2px solid var(--color-border);
  margin-top: var(--space-64);
  margin-left: 260px;
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-64) var(--space-48) var(--space-40);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-64);
  margin-bottom: var(--space-48);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding-right: var(--space-32);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-bottom: var(--space-8);
}

.logo-icon-footer {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(14, 165, 233, 0.3));
}

.logo-icon-footer .logo-svg {
  width: 100%;
  height: 100%;
  animation: subtleFloat 4s ease-in-out infinite;
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.footer-brand-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #0ea5e9, #0d9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.footer-tagline {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.footer-description {
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: var(--font-size-base);
  max-width: 480px;
  margin: 0;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-48);
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.footer-column-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-8) 0;
  letter-spacing: 0.3px;
  font-size: 13px;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.footer-link-item {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  position: relative;
}

.footer-link-item::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.footer-link-item:hover {
  color: var(--color-primary);
  transform: translateX(4px);
}

.footer-link-item:hover::before {
  width: 100%;
}

.footer-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border), transparent);
  margin: var(--space-24) 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-24);
}

.footer-copyright {
  margin: 0;
}

.footer-copyright p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
  font-weight: 500;
}

.footer-social {
  display: flex;
  gap: var(--space-12);
  align-items: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: 0;
}

.social-link i {
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  color: inherit;
}

.social-link:hover {
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-4px) rotate(5deg);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.social-link:hover::before {
  width: 120%;
  height: 120%;
}

.social-link:hover i {
  transform: scale(1.15);
}



@media (max-width: 768px) {
  .footer {
    margin-left: 0;
  }

  .footer-container {
    padding: var(--space-48) var(--space-24) var(--space-32);
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--space-40);
  }

  .footer-brand {
    padding-right: 0;
    text-align: center;
    align-items: center;
  }

  .footer-description {
    max-width: 100%;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .footer-column {
    text-align: center;
    align-items: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-20);
    text-align: center;
  }

  .footer-social {
    gap: var(--space-12);
  }

  .social-link {
    width: 44px;
    height: 44px;
  }
}

/* === LAZY LOADING STYLES === */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-loaded {
  opacity: 1;
}

/* Placeholder para imágenes lazy */
.lazy-load {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Carousel lazy loading */
.carousel-track {
  animation-play-state: paused;
}

.carousel-lazy-loaded .carousel-track {
  animation-play-state: running;
}

/* Chart containers optimization */
.chart-container-premium {
  min-height: 300px;
  max-height: 500px;
  width: 100%;
  height: fit-content;
}

.chart-container-premium.lazy-loading {
  background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 2s infinite;
}

/* === SCROLL ANIMATIONS === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Fade animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleInUp {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(40px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Rotate animations */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* Animation classes */
.animate-fadeIn {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.8s ease-out forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-slideInUp {
  animation: slideInUp 0.8s ease-out forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.8s ease-out forwards;
}

.animate-scaleInUp {
  animation: scaleInUp 0.8s ease-out forwards;
}

.animate-rotateIn {
  animation: rotateIn 0.8s ease-out forwards;
}

/* Special effects for financial elements */
.stat-card.animated {
  transform: translateY(0) scale(1);
  box-shadow: var(--shadow-lg);
}

.stat-card.animated .stat-value {
  animation: countUp 1s ease-out 0.3s both;
}

@keyframes countUp {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Chart animation enhancement */
.chart-container-premium.animated {
  transform: translateY(0);
  box-shadow: var(--shadow-xl);
}

.chart-container-premium.animated canvas {
  animation: chartReveal 1.2s ease-out 0.2s both;
}

@keyframes chartReveal {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


.chart-header {
  text-align: center;
  margin-bottom: 0.8rem;
  position: relative;
  z-index: 10;
}

.chart-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.chart-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  opacity: 0.8;
  line-height: 1.2;
}

/* Burger Chart Wrapper */
.burger-chart-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
  height: 280px;
  width: 100%;
  overflow: visible;
}

#premiumChart {
  width: 280px !important;
  height: 280px !important;
  max-width: 100% !important;
  max-height: 280px !important;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  #premiumChart {
    width: 240px !important;
    height: 240px !important;
  }
}

@media (max-width: 480px) {
  #premiumChart {
    width: 200px !important;
    height: 200px !important;
  }
}

/* Additional chart size constraints */
#expenseChart {
  width: 100% !important;
  height: 320px !important;
  max-width: 400px !important;
  max-height: 320px !important;
}

#goalChart, #userExpenseChart, #necessityChart {
  width: 100% !important;
  height: 280px !important;
  max-width: 400px !important;
  max-height: 280px !important;
}

#trendChart {
  width: 100% !important;
  height: 180px !important;
  max-width: 100% !important;
  max-height: 180px !important;
}

#premiumChart:hover {
  transform: scale(1.02);
}

/* Center Info */
.chart-center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.total-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.total-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Premium Legend */
.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  width: 100%;
  max-width: 420px;
  overflow: visible;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  max-width: 110px;
}

.legend-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.legend-item:hover .legend-color {
  transform: scale(1.2);
}

.legend-text {
  font-size: 0.65rem;
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
  flex: 1;
}

.legend-percentage {
  font-size: 0.6rem;
  color: var(--color-text-secondary);
  margin-left: 0.1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Right Panel - Insights */
.insights-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: var(--space-16);
}

/* Floating Keywords */
.floating-keywords {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
}

.keyword-cloud {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.keyword {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg,
    rgba(var(--color-teal-500-rgb), 0.1),
    rgba(var(--color-teal-400), 0.05));
  border: 1px solid rgba(var(--color-teal-500-rgb), 0.2);
  border-radius: 20px;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  animation: floatIn 0.6s ease forwards;
}

.keyword:nth-child(odd) {
  animation-delay: var(--delay, 0s);
}

.keyword:nth-child(even) {
  animation-delay: var(--delay, 0s);
}

@keyframes floatIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.keyword:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 24px rgba(var(--color-teal-500-rgb), 0.3);
  background: linear-gradient(135deg,
    rgba(var(--color-teal-500-rgb), 0.2),
    rgba(var(--color-teal-400), 0.1));
}

/* Insight Cards */
.insights-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insight-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateX(30px);
  animation: slideIn 0.6s ease forwards;
}

.insight-card:nth-child(1) { animation-delay: 0.2s; }
.insight-card:nth-child(2) { animation-delay: 0.4s; }
.insight-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
  border-color: rgba(var(--color-primary-rgb), 0.3);
}

.insight-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    rgba(var(--color-primary-rgb), 0.1),
    rgba(var(--color-primary-rgb), 0.05));
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.insight-card:hover .insight-icon {
  transform: scale(1.1) rotate(5deg);
}

.insight-content h4 {
  margin: 0 0 0.5rem 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
}

.insight-content p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
  .premium-dashboard {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .keyword-cloud {
    gap: 0.5rem;
  }

  .keyword {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .chart-container-premium {
    padding: 1.5rem;
  }
}
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;

  /* Spacing */
  --space-0: 0;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================================
   DARK MODE THEME
   Professional dark theme with proper contrast and readability
   ============================================================================ */

[data-theme="dark"] {
  /* Backgrounds - usando grises oscuros profesionales, NO negro puro */
  --color-background: #121212;
  --color-surface: #1e1e1e;
  --color-surface-raised: #2a2a2a;
  --color-surface-hover: #333333;
  --color-overlay: rgba(0, 0, 0, 0.7);

  /* Text - blanco suave para reducir fatiga visual */
  --color-text: #e0e0e0;
  --color-text-secondary: #b0b0b0;
  --color-text-tertiary: #808080;
  --color-text-inverted: #121212;

  /* Borders - sutiles pero visibles */
  --color-border: #333333;
  --color-border-light: #2a2a2a;
  --color-border-strong: #404040;

  /* Primary - mantener teal pero ajustado para dark mode */
  --color-primary: #3da1ac;
  --color-primary-hover: #2b7980;
  --color-primary-active: #1f5a5f;
  --color-primary-subtle: rgba(61, 161, 172, 0.1);

  /* Secondary */
  --color-secondary: rgba(176, 176, 176, 0.1);
  --color-secondary-hover: rgba(176, 176, 176, 0.15);

  /* Semantic States - ajustados para dark mode */
  --color-success: #4caf50;
  --color-success-dark: #388e3c;
  --color-success-bg: rgba(76, 175, 80, 0.1);
  --color-error: #f44336;
  --color-error-bg: rgba(244, 67, 54, 0.1);
  --color-warning: #ff9800;
  --color-warning-bg: rgba(255, 152, 0, 0.1);
  --color-info: #2196f3;
  --color-info-bg: rgba(33, 150, 243, 0.1);

  /* RGB for semantic tokens */
  --color-success-rgb: 76, 175, 80;
  --color-error-rgb: 244, 67, 54;
  --color-warning-rgb: 255, 152, 0;
  --color-info-rgb: 33, 150, 243;

  /* Buttons */
  --color-btn-primary-bg: var(--color-primary);
  --color-btn-primary-text: var(--color-white);
  --color-btn-primary-hover: var(--color-primary-hover);
  --color-btn-secondary-bg: var(--color-surface-raised);
  --color-btn-secondary-text: var(--color-text);
  --color-btn-secondary-hover: var(--color-surface-hover);

  /* Shadows - más sutiles en dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

  /* RGB versions for alpha channels */
  --color-primary-rgb: 61, 161, 172;
  --color-text-rgb: 224, 224, 224;
  --color-text-secondary-rgb: 176, 176, 176;
  --color-background-rgb: 18, 18, 18;
  --color-surface-rgb: 30, 30, 30;
}

/* === RESET AND BASE STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 14px;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: var(--line-height-normal);
  overflow-x: hidden;
  min-height: 100vh;
}

/* === FONT AWESOME OVERRIDE === */
/* Sobrescribir display de Font Awesome para permitir centrado perfecto */
.fa, .fas, .far, .fal, .fab {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* === Z-INDEX HIERARCHY === */
.overlay {
  z-index: 800;
}

.sidebar {
  z-index: 900;
}

.navbar {
  z-index: 1000;
}

.modal {
  z-index: 9000;
}

.toast {
  z-index: 9999;
}

/* === LAYOUT COMPONENTS === */

/* Header/Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background-color: var(--color-primary);
  color: var(--color-btn-primary-text);
  padding: 0 var(--space-24);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.navbar__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: var(--space-12); /* Espacio entre elementos */
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

/* === PROFILE MENU COMPONENTS === */
.profile-menu-container {
  position: relative;
}

.profile-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 80%;
  transition: all var(--duration-fast) ease;
  position: relative;
}

.profile-avatar-btn:hover {
  transform: scale(1.05);
}

.profile-avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Profile Avatar */
.profile-avatar {
 
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all var(--duration-fast) ease;
  position: relative;
  z-index: 2;
}

/* Animated Ring for Pro Users */
.profile-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
  z-index: 1;
}

.profile-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.profile-ring-track {
  stroke: rgba(255, 255, 255, 0.2);
}

.profile-ring-progress {
  stroke: url(#profileGradient);
  stroke-linecap: round;
  stroke-dasharray: 175.9;
  stroke-dashoffset: 175.9;
  animation: profileRingPulse 3s ease-in-out infinite;
}

/* Pro user ring visibility */
.profile-avatar-wrapper.user-pro .profile-ring {
  opacity: 1;
}

.profile-avatar-wrapper.user-pro .profile-avatar {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Verification Badge */
.profile-verification-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
  border-radius: 50%;
  border: 2px solid var(--color-surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all var(--duration-fast) ease;
  z-index: 3;
}

.profile-verification-badge i {
  font-size: 8px;
  color: white;
}

.profile-avatar-wrapper.user-pro .profile-verification-badge {
  opacity: 1;
  transform: scale(1);
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + var(--space-8));
  right: 0;
  width: 280px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: all var(--duration-normal) var(--ease-standard);
  z-index: 1001;
}

.profile-dropdown:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Profile Dropdown Header */
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-20);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: white;
}

.profile-header-avatar {
  position: relative;
  flex-shrink: 0;
}

.profile-header-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.profile-header-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  border-radius: 50%;
  border: 2px solid var(--color-surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all var(--duration-fast) ease;
}

.profile-header-badge i {
  font-size: 10px;
  color: white;
}

.profile-dropdown-header.user-pro .profile-header-badge {
  opacity: 1;
  transform: scale(1);
}

.profile-header-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-4) 0;
  color: white;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.profile-plan {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.8);
  font-weight: var(--font-weight-medium);
}

.profile-plan.plan-pro {
  color: #ffd700;
  font-weight: var(--font-weight-bold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Profile Menu Items */
.profile-dropdown-menu {
  padding: var(--space-8) 0;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-20);
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all var(--duration-fast) ease;
  text-align: left;
}

.profile-menu-item:hover {
  background-color: var(--color-hover);
  color: var(--color-primary);
}

.profile-menu-item i {
  width: 16px;
  text-align: center;
  color: var(--color-text-secondary);
  transition: color var(--duration-fast) ease;
}

.profile-menu-item:hover i {
  color: var(--color-primary);
}

.profile-menu-logout {
  color: var(--color-error);
}

.profile-menu-logout:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.profile-menu-logout i {
  color: var(--color-error);
}

.profile-menu-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-8) var(--space-20);
}

/* Profile Dropdown Footer */
.profile-dropdown-footer {
  padding: var(--space-12) var(--space-20);
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface-variant);
}

.profile-upgrade-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-10) var(--space-16);
  background: linear-gradient(135deg, #ffd700, #ffa500);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.profile-upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.profile-upgrade-btn i {
  font-size: var(--font-size-xs);
}

/* Hide upgrade button for Pro users */
.profile-dropdown-footer.user-pro {
  display: none;
}

/* Default Avatars for Free Users */
.avatar-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-12);
}

.avatar-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  object-fit: cover;
}

.avatar-option:hover {
  transform: scale(1.1);
  border-color: var(--color-primary);
}

.avatar-option.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.3);
}

/* Animations */
@keyframes profileRingPulse {
  0%, 100% {
    stroke-dashoffset: 175.9;
    opacity: 0.8;
  }
  50% {
    stroke-dashoffset: 87.95;
    opacity: 1;
  }
}

@keyframes profileGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  }
}

.profile-avatar-wrapper.user-pro .profile-avatar {
  animation: profileGlow 2s ease-in-out infinite;
}

/* Gradient definition for SVG */
.profile-ring-svg defs {
  display: none;
}

/* Add gradient inline styles via JavaScript */

/* === UPGRADE MODAL STYLES === */
.upgrade-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 9000;
  padding: var(--space-20);
}

.upgrade-modal.show {
  display: flex;
}

.upgrade-modal .modal-content {
  max-width: 400px;
  text-align: center;
}

.upgrade-modal-content {
  background: var(--color-surface-raised);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upgrade-modal-content .modal-header {
  background: var(--color-surface-raised);
  padding: var(--space-24);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.upgrade-modal-content .modal-header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-2xl);
}

.upgrade-modal-content .modal-body {
  background: var(--color-surface-raised);
  padding: var(--space-32);
}

.upgrade-modal-content .modal-footer {
  background: var(--color-surface-raised);
  padding: var(--space-24);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-12);
  justify-content: center;
}

.upgrade-features {
  margin: var(--space-20) 0;
}

.upgrade-features h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-16);
  font-size: var(--font-size-lg);
}

.upgrade-features ul {
  list-style: none;
  padding: 0;
  margin: var(--space-16) 0;
}

.upgrade-features li {
  padding: var(--space-8) 0;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  text-align: left;
}

.upgrade-price {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: white;
  padding: var(--space-16);
  border-radius: var(--radius-lg);
  margin-top: var(--space-20);
}

.upgrade-price .price {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
}

.upgrade-price .price-desc {
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

/* Mobile responsive updates for profile menu */
@media (max-width: 768px) {
  .profile-dropdown {
    width: 260px;
    right: var(--space-8);
  }

  .profile-avatar-wrapper {
    width: 36px;
    height: 36px;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
  }

  .profile-ring {
    width: 36px;
    height: 36px;
  }

  .navbar__actions .profile-menu-container {
    order: 1;
  }
}

/* Desktop: ocultar completamente el menú hamburguesa */
.navbar .icon-btn.hamburger-menu {
  display: none !important; /* Especificidad máxima para desktop */
  order: 3; /* Asegura que esté al final en flex */
}

.icon-btn.hamburger-menu {
  display: none !important; /* Respaldo adicional */
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 80px;
  bottom: 0;
  width: 260px;
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 0;
  overflow-y: auto;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  z-index: 900;
}

/* Mobile Profile Banner */
.mobile-profile-banner {
  display: none;
  position: relative;
  margin-bottom: var(--space-16);
}

.mobile-banner-cover {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-700) 100%);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-banner-cover:hover {
  filter: brightness(1.1);
}

.mobile-banner-cover:hover::after {
  content: '📷 Cambiar portada';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

.mobile-banner-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="white" stroke-opacity="0.1" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

/* Botón Hamburguesa (Avatar Sidebar) */
.banner-hamburger-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 150;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
}

.banner-hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-hamburger-btn:active {
  transform: scale(0.95);
}

.banner-hamburger-btn i {
  font-size: 20px;
  color: white;
}

/* === CAMPANA DE NOTIFICACIONES EN BANNER === */
.banner-notification-btn {
  position: absolute;
  top: var(--space-12);
  right: var(--space-12);
  z-index: 150;
}

.banner-notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner-notification-bell:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-notification-bell:active {
  transform: scale(0.95);
}

.banner-notification-bell i {
  font-size: 20px;
  color: white;
}

.banner-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  border: 2px solid white;
  animation: pulse 2s infinite;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.5);
}

.banner-notification-badge i {
  font-size: 10px;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

.mobile-profile-info {
  padding: 0 var(--space-20) var(--space-16);
  margin-top: -40px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-avatar-container {
  width: 80px;
  height: 80px;
  position: relative;
  margin: 0 auto; /* Centrado */
  cursor: pointer;
}

/* Icono de cámara deshabilitado - ahora se usa el menú del avatar */
.mobile-avatar-container::after {
  display: none;
}

.mobile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--color-surface);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mobile-avatar:active {
  transform: scale(0.98);
}

.mobile-avatar-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  /* Gradiente multicolor estilo Google: Azul, Rojo, Amarillo, Verde */
  background: linear-gradient(45deg,
    #4285F4 0%,
    #EA4335 25%,
    #FBBC04 50%,
    #34A853 75%,
    #4285F4 100%) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ringPulse 3s ease-in-out infinite, ringRotate 6s linear infinite;
}

/* Anillo multicolor animado estilo Google */
@keyframes ringPulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) rotate(180deg);
  }
}

@keyframes ringRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.mobile-user-details {
  margin-top: var(--space-8);
  text-align: center; /* Centrado */
  order: -1; /* Mover antes del avatar */
  display: flex;
  flex-direction: column;
}

.mobile-username {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-8) 0;
}

.mobile-user-quote {
  display: none; /* Ocultar frase */
}

.mobile-user-stats {
  display: none; /* Ocultar estadísticas */
}

.sidebar.sidebar-hidden {
  transform: translateX(0); /* Always visible for dashboard */
}

.sidebar.sidebar-visible {
  transform: translateX(0);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-24) var(--space-16);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  width: 100%;
  padding: var(--space-12) var(--space-16);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  text-align: left;
}

.nav-item:hover {
  background-color: rgba(var(--color-teal-500-rgb), 0.1);
  color: var(--color-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background-color: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.nav-item i {
  width: 20px;
  text-align: center;
}

/* Nav items that require authentication */
.nav-item.requires-auth.hidden {
  display: none;
}

.nav-item.requires-auth.locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

.nav-item.requires-auth.locked::after {
  content: '\f023';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: var(--space-16);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.nav-item.requires-auth.locked:hover {
  background-color: rgba(var(--color-error-rgb), 0.1);
  color: var(--color-error);
  transform: translateX(0);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  padding: var(--space-32);
  min-height: calc(100vh - var(--navbar-height));
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: margin-left;
}

body.sidebar-collapsed .main-content {
  margin-left: 0;
}

.sidebar.sidebar-hidden ~ .main-content {
  margin-left: 0;
}

/* === SECTION STYLES === */
.section {
  display: none;
}

.section.active {
  display: block;
}

.section-header {
  margin-bottom: var(--space-32);
}

.section-header h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.section-header p {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
}

/* === CARD COMPONENTS === */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-24);
}

/* Hide cards when their content is empty */
.card:has(.card__body:empty),
.card:has(#aiRecommendations:empty),
.card:has(#recentTransactions:empty) {
  display: none;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-20);
}

.card__header h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.card__body {
  /* No specific styles needed, inherits from card */
}

/* Quick Access Card Styles */
.greeting {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.quick-access-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.last-transaction {
  padding: var(--space-16);
  background-color: var(--color-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-secondary);
}

.transaction-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
}

.transaction-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-desc {
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.transaction-amount {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-20);
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.quick-action-btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.quick-action-btn:active {
  background-color: var(--color-primary-active);
  transform: translateY(0);
}

/* === GRID LAYOUTS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-24);
  margin-bottom: var(--space-32);
}


.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-20);
  margin-bottom: var(--space-24);
  align-items: start;
  transition: gap 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-24);
  margin-bottom: var(--space-32);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-20);
}

/* === STAT CARDS === */
.stat-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  display: flex;
  align-items: center;
  gap: var(--space-16);
  transition: all var(--duration-fast) var(--ease-standard);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--color-primary);
}

.btn-save-to-goals:hover {
  opacity: 0.9;
  transform: translateX(2px);
}

.stat-card--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-btn-primary-text);
  border: none;
}

.stat-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: rgba(var(--color-primary-rgb, 0), 0.1);
}

.stat-icon {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
}

.stat-card--primary .stat-icon {
  color: var(--color-btn-primary-text);
}

/* Balance negativo - mostrar en rojo */
.stat-card.balance-negative .stat-value {
  color: var(--color-red-500) !important;
}

.stat-card.balance-negative .stat-icon {
  color: var(--color-red-500) !important;
}

.stat-card.balance-negative .stat-icon-wrapper {
  background-color: rgba(var(--color-red-500-rgb), 0.1) !important;
}

.stat-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.stat-details h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  letter-spacing: 0.03em;
}

.stat-card--primary .stat-details h3 {
  color: rgba(255, 255, 255, 0.8);
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  transition: all var(--duration-fast) var(--ease-standard);
}

.stat-card:hover .stat-value {
  transform: scale(1.05);
  color: var(--color-primary);
}

.stat-card--primary .stat-value {
  color: var(--color-btn-primary-text);
}

.stat-card--primary:hover .stat-value {
  transform: scale(1.05);
  color: var(--color-btn-primary-text);
}

/* === SAVINGS CARD SPECIFIC STYLES === */
.stat-card--savings {
  position: relative;
  overflow: visible;
}

.savings-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.savings-progress-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.progress-circle {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
  z-index: 1;
}

.progress-circle-bg {
  stroke: var(--color-border);
  opacity: 0.3;
}

.progress-circle-fill {
  stroke: #ef4444;
  stroke-linecap: round;
  transition: all var(--duration-slow) ease;
  transform-origin: center;
}

.savings-progress-ring[data-progress="low"] .progress-circle-fill {
  stroke: #ef4444;
}

.savings-progress-ring[data-progress="medium"] .progress-circle-fill {
  stroke: #f97316;
}

.savings-progress-ring[data-progress="high"] .progress-circle-fill {
  stroke: #22c55e;
}

.savings-progress-ring[data-progress="complete"] .progress-circle-fill {
  stroke: #16a34a;
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.4));
}

.savings-icon-wrapper .stat-icon {
  position: relative;
  z-index: 2;
  color: var(--color-primary);
  transition: all var(--duration-medium) ease;
}

.savings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.savings-header h3 {
  margin: 0;
  margin-bottom: var(--space-4);
}

.savings-check {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  opacity: 0.3;
  transition: all var(--duration-medium) ease;
  margin-bottom: var(--space-4);
}

.savings-check[data-status="initial"] {
  opacity: 0.3;
  color: var(--color-text-secondary);
}

.savings-check[data-status="progress"] {
  opacity: 0.7;
  color: #f97316;
  transform: scale(1.1);
}

.savings-check[data-status="high"] {
  opacity: 0.9;
  color: #22c55e;
  transform: scale(1.2);
}

.savings-check[data-status="complete"] {
  opacity: 1;
  color: #16a34a;
  transform: scale(1.3);
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.4));
  animation: checkPulse 2s infinite;
}

.savings-progress-text {
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-medium) ease;
}

.savings-progress-text[data-level="low"] {
  color: #ef4444;
}

.savings-progress-text[data-level="medium"] {
  color: #f97316;
}

.savings-progress-text[data-level="high"] {
  color: #22c55e;
}

.savings-progress-text[data-level="complete"] {
  color: #16a34a;
  font-weight: var(--font-weight-bold);
}

@keyframes checkPulse {
  0%, 100% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(1.4);
  }
}

/* Hover effects for savings card */
.stat-card--savings:hover .progress-circle-fill {
  filter: brightness(1.1);
}

.stat-card--savings:hover .savings-check[data-status="complete"] {
  animation: checkPulse 1s infinite;
}

.stat-change {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.stat-change.positive {
  color: var(--color-success);
}

.stat-change.negative {
  color: var(--color-error);
}

.stat-change.warning {
  color: #f59e0b;
}

.stat-change.neutral {
  color: var(--color-text-secondary);
}

/* === BUTTON COMPONENTS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-20);
  border: 1px solid transparent;
  border-radius: var(--radius-base);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn--secondary {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-secondary-hover);
}

.btn--success {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-700) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--color-teal-500-rgb), 0.3);
}

.btn--success:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-teal-700) 0%, var(--color-primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-teal-500-rgb), 0.4);
}

.btn--success:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(var(--color-teal-500-rgb), 0.3);
}

.btn--danger {
  background-color: var(--color-error);
  color: white;
}

.btn--danger:hover:not(:disabled) {
  background-color: var(--color-red-400);
}

.btn--sm {
  padding: var(--space-8) var(--space-16);
  font-size: var(--font-size-sm);
}

.btn--lg {
  padding: var(--space-16) var(--space-32);
  font-size: var(--font-size-lg);
}

.btn--full-width {
  width: 100%;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: inherit;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Login Icon Button - Modern UX Design */
.login-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
  animation: pulse-login 2s ease-in-out infinite;
}

/* Match notification bell size in mobile */
@media (max-width: 768px) {
  .login-icon-btn {
    font-size: 22px;
  }

  .login-icon-btn i {
    font-size: 22px;
  }
}

@keyframes pulse-login {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
}

.login-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
  animation: none;
}

.login-icon-btn:active {
  transform: scale(0.95);
}

/* Mobile Profile & Logout Buttons */
.mobile-profile-btn,
.mobile-logout-btn {
  display: none;
  color: white;
  font-size: 18px;
}

.mobile-profile-btn:hover,
.mobile-logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Show in mobile when user is logged in */
@media (max-width: 768px) {
  .mobile-profile-btn.show,
  .mobile-logout-btn.show {
    display: flex;
    font-size: 22px;
  }

  .mobile-profile-btn.show i,
  .mobile-logout-btn.show i {
    font-size: 22px;
    color: white;
  }
}

/* === FORM COMPONENTS === */
.form-container {
  margin-bottom: var(--space-32);
}

.form-group {
  margin-bottom: var(--space-20);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.form-control {
  width: 100%;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  font-size: var(--font-size-md);
  font-family: inherit;
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--duration-fast) var(--ease-standard);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.form-control::placeholder {
  color: var(--color-text-secondary);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
  appearance: none;
}

.form-actions {
  display: flex;
  gap: var(--space-16);
  justify-content: flex-start;
  margin-top: var(--space-24);
}

/* === PROGRESS COMPONENTS === */
.progress-bar {
  height: 8px;
  background-color: var(--color-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-8) 0;
}

.progress-fill {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-standard);
}

.progress-bar-container {
  width: 100%;
  margin: var(--space-8) 0;
}

/* === GOAL COMPONENTS === */
.goal-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  margin-bottom: var(--space-16);
  transition: all var(--duration-fast) var(--ease-standard);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.goal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Goal Header */
.goal-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-20);
}

.goal-check-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-border);
  transition: all var(--duration-medium) ease;
}

.goal-check {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  transition: all var(--duration-medium) ease;
}

.goal-check[data-status="progress"] {
  color: #f97316;
}

.goal-check[data-status="progress"] + .goal-check-wrapper,
.goal-check-wrapper:has(.goal-check[data-status="progress"]) {
  background-color: rgba(249, 115, 22, 0.1);
}

.goal-check[data-status="achieved"] {
  color: #22c55e;
  font-size: var(--font-size-md);
}

.goal-check[data-status="achieved"] + .goal-check-wrapper,
.goal-check-wrapper:has(.goal-check[data-status="achieved"]) {
  background-color: rgba(34, 197, 94, 0.1);
}

.goal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  flex: 1;
}

/* Goal Body */
.goal-body {
  margin-bottom: var(--space-20);
}

.goal-progress-container {
  position: relative;
}

.goal-progress-bar {
  position: relative;
  height: 24px;
  background-color: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.goal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: all var(--duration-slow) ease;
  position: relative;
  overflow: hidden;
}

/* Progress Color States */
.goal-progress-bar[data-progress="low"] .goal-progress-fill {
  background-color: #ef4444;
}

.goal-progress-bar[data-progress="medium"] .goal-progress-fill {
  background-color: #f97316;
}

.goal-progress-bar[data-progress="high"] .goal-progress-fill {
  background-color: #22c55e;
}

.goal-progress-bar[data-progress="complete"] .goal-progress-fill {
  background: linear-gradient(45deg, #22c55e, #16a34a);
  animation: sparkle 2s infinite;
}

.goal-progress-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.goal-motivation-message {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-align: center;
  margin-top: var(--space-8);
  animation: slideDown 0.3s ease-out;
}

.goal-motivation-message.hidden {
  display: none;
}

/* Goal Footer */
.goal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-meta-info {
  display: flex;
  gap: var(--space-16);
  width: 100%;
}

.goal-target {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-medium) ease;
}

.goal-saved {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-left: auto;
}

/* Dynamic target color based on progress */
.goal-card[data-progress-level="low"] .goal-target {
  color: #ef4444;
}

.goal-card[data-progress-level="medium"] .goal-target {
  color: #f97316;
}

.goal-card[data-progress-level="high"] .goal-target {
  color: #22c55e;
}

.goal-card[data-progress-level="complete"] .goal-target {
  color: #16a34a;
  font-weight: var(--font-weight-bold);
}

/* Animations */
@keyframes sparkle {
  0%, 100% {
    background: linear-gradient(45deg, #22c55e, #16a34a);
  }
  50% {
    background: linear-gradient(45deg, #16a34a, #15803d, #22c55e);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Legacy compatibility - hide old styles */
.goal-amount,
.goal-progress,
.goal-percentage,
.goal-deadline {
  display: none;
}

/* === BRAND CAROUSEL SECTION === */
.brand-carousel-container {
  margin: var(--space-16) 0 var(--space-32) 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.brand-carousel-wrapper {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 15%,
    rgba(255, 255, 255, 0.02) 85%,
    transparent 100%
  );
}

.brand-carousel-track {
  display: flex;
  height: 100%;
  animation: brandScrollRTL 80s linear infinite;
  gap: var(--space-24);
  align-items: center;
  width: max-content;
}

.brand-carousel-track:hover {
  animation-play-state: paused;
}

.brand-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) var(--space-24);
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.brand-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
  z-index: 1;
}

.brand-card:hover::before {
  left: 100%;
}

.brand-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: transparent;
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.brand-card:hover .brand-icon {
  transform: rotate(5deg) scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.brand-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  z-index: 2;
}

.brand-content h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0;
  line-height: 1.2;
}

.brand-content p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.3;
}

/* Gradient Icon Classes */
.gradient-blue {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

.gradient-purple {
  background: linear-gradient(135deg, #6f42c1, #4c2a85);
}

.gradient-green {
  background: linear-gradient(135deg, #28a745, #1e7e34);
}

.gradient-orange {
  background: linear-gradient(135deg, #fd7e14, #e55a00);
}

.gradient-red {
  background: linear-gradient(135deg, #dc3545, #bd2130);
}

.gradient-teal {
  background: linear-gradient(135deg, #20c997, #17a085);
}

.gradient-pink {
  background: linear-gradient(135deg, #e83e8c, #c2185b);
}

.gradient-indigo {
  background: linear-gradient(135deg, #6610f2, #4c0bce);
}

/* Brand Scroll Animation - Right to Left */
@keyframes brandScrollRTL {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Dark mode adjustments */
[data-theme="dark"] .brand-carousel-wrapper {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.01) 15%,
    rgba(255, 255, 255, 0.01) 85%,
    transparent 100%
  );
}

[data-theme="dark"] .brand-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .brand-card::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
}

[data-theme="dark"] .brand-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  border-color: var(--color-border-hover);
}

/* Responsive design */
@media (max-width: 768px) {
  .brand-carousel-container {
    margin: var(--space-24) 0;
  }

  .brand-carousel-wrapper {
    height: 100px;
  }

  .brand-card {
    padding: var(--space-12) var(--space-16);
    gap: var(--space-12);
  }

  .brand-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .brand-content h3 {
    font-size: var(--font-size-sm);
  }

  .brand-content p {
    font-size: var(--font-size-xs);
  }

  .brand-carousel-track {
    animation-duration: 60s;
    gap: var(--space-16);
  }
}

@media (max-width: 480px) {
  .brand-carousel-wrapper {
    height: 90px;
  }

  .brand-card {
    padding: var(--space-8) var(--space-12);
    gap: var(--space-8);
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .brand-carousel-track {
    animation-duration: 50s;
    gap: var(--space-12);
  }
}

/* === AI RECOMMENDATIONS === */
.ai-recommendations-scroll {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin-right: -8px;
}

/* Scrollbar personalizado */
.ai-recommendations-scroll::-webkit-scrollbar {
  width: 6px;
}

.ai-recommendations-scroll::-webkit-scrollbar-track {
  background: var(--color-border);
  border-radius: 10px;
}

.ai-recommendations-scroll::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}

.ai-recommendations-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

.ai-recommendation-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  padding: var(--space-20);
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-16);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateX(-20px);
}

.ai-recommendation-card.visible {
  opacity: 1;
  transform: translateX(0);
}

.ai-recommendation-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  border-color: var(--color-primary);
}

.ai-rec-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-rec-icon .fin-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: white;
}

.ai-rec-content {
  flex: 1;
}

.ai-rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.ai-rec-content h5 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  margin: 0;
  letter-spacing: 0.3px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-badge.premium {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  font-weight: 800;
}

/* === TARJETAS BLOQUEADAS (PREMIUM) === */
.ai-recommendation-card.locked {
  position: relative;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border: 2px dashed rgba(102, 126, 234, 0.3);
  cursor: not-allowed;
  overflow: hidden;
}

.ai-recommendation-card.locked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(102, 126, 234, 0.03) 10px,
    rgba(102, 126, 234, 0.03) 20px
  );
  pointer-events: none;
  z-index: 1;
}

.ai-recommendation-card.locked .ai-rec-icon {
  background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.ai-recommendation-card.locked .ai-rec-icon i {
  font-size: 20px;
  color: white;
}

.ai-recommendation-card.locked .ai-rec-content {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
  opacity: 0.6;
  position: relative;
  z-index: 0;
}

.ai-recommendation-card.locked .ai-rec-content.blurred {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.unlock-btn {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 24px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}

.unlock-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.unlock-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.unlock-btn i {
  font-size: 14px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Responsive para tarjetas bloqueadas */
@media (max-width: 768px) {
  .unlock-btn {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    margin-top: 12px;
    justify-content: center;
  }

  .unlock-btn:hover {
    transform: scale(1.02);
  }

  .ai-recommendation-card.locked {
    flex-direction: column;
  }

  .ai-recommendation-card.locked .ai-rec-content {
    filter: blur(3px);
  }
}

/* === MODAL PREMIUM === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.premium-modal {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: rotate(90deg);
}

.premium-header {
  text-align: center;
  margin-bottom: 32px;
}

.premium-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.premium-icon i {
  font-size: 36px;
  color: white;
}

.premium-header h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.premium-subtitle {
  color: #666;
  font-size: 16px;
}

.premium-benefits {
  margin-bottom: 32px;
}

.premium-benefits h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
}

.premium-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.premium-benefits li {
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
}

.premium-benefits li:last-child {
  border-bottom: none;
}

.premium-benefits li i {
  color: #4CAF50;
  font-size: 18px;
  flex-shrink: 0;
}

.premium-pricing {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.price-tag {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-amount {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-period {
  font-size: 14px;
  color: #666;
}

.premium-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-premium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-premium i {
  animation: pulse 2s ease-in-out infinite;
}

.btn-secondary {
  background: transparent;
  color: #666;
  padding: 12px 32px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #667eea;
  color: #667eea;
}

.premium-footer {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin: 0;
}

/* Toast Premium */
.premium-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 10001;
}

.premium-toast.show {
  transform: translateX(0);
}

.premium-toast i {
  font-size: 24px;
  animation: pulse 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .premium-modal {
    padding: 24px;
    width: 95%;
  }

  .premium-header h2 {
    font-size: 24px;
  }

  .price-amount {
    font-size: 28px;
  }

  .premium-toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

/* === PREMIUM STATUS WIDGET === */
.premium-status-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 16px 0;
}

.premium-status-card.premium-active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
  border: 2px solid #FFD700;
}

.premium-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.premium-badge-large {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
}

.premium-badge-large.free {
  background: #e0e0e0;
  color: #666;
}

.premium-badge-large i {
  font-size: 16px;
}

.premium-manage-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  color: #666;
}

.premium-manage-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.premium-status-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.premium-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #333;
}

.premium-feature-item i {
  color: #4CAF50;
  font-size: 16px;
}

.premium-status-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.premium-expiry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

/* Medidor de mensajes */
.premium-messages-meter {
  margin: 20px 0;
}

.messages-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.messages-count {
  font-weight: 700;
  color: #667eea;
}

.messages-progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.messages-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.messages-info {
  margin-top: 8px;
  font-size: 12px;
  color: #999;
  text-align: center;
}

.premium-upgrade-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.premium-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.premium-upgrade-btn i {
  font-size: 20px;
  margin-bottom: 4px;
}

.premium-upgrade-btn small {
  font-size: 11px;
  opacity: 0.9;
  font-weight: 500;
}

/* Widget compacto para chat */
.premium-compact-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.premium-compact-widget.premium {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  color: #F57C00;
}

.premium-compact-widget i {
  font-size: 14px;
}

.premium-icon {
  color: #FFD700;
}

/* Toast variantes */
.premium-toast-warning {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.premium-toast-error {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.premium-toast-success {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.toast-action-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 12px;
}

.toast-action-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Modal de gestión */
.premium-management-modal {
  max-width: 600px;
}

.premium-management-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.premium-management-header i {
  font-size: 32px;
  color: #FFD700;
}

.premium-management-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 12px;
}

.info-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #333;
}

.info-card p {
  font-size: 13px;
  margin: 8px 0;
  color: #666;
}

.info-card strong {
  color: #333;
}

.premium-management-actions {
  display: flex;
  gap: 12px;
}

.btn-danger {
  background: #f44336;
  color: white;
  flex: 1;
}

.btn-danger:hover {
  background: #d32f2f;
}

@media (max-width: 768px) {
  .premium-management-info {
    grid-template-columns: 1fr;
  }

  .premium-management-actions {
    flex-direction: column;
  }
}

/* === CONVERSATIONAL EXPENSE MODAL === */
.conversational-expense-modal .conversational-content {
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.conversational-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fin-avatar-modal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #667eea;
}

.header-subtitle {
  font-size: 13px;
  color: #999;
}

.progress-bar-container {
  padding: 16px 24px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 12px;
  color: #666;
  display: block;
  text-align: center;
}

/* Chat container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f5f5;
}

.chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: slideInMessage 0.3s ease;
}

@keyframes slideInMessage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user-message {
  justify-content: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fin-bubble {
  background: white;
  border-bottom-left-radius: 4px;
}

.user-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Suggestions */
.suggestions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border-top: 1px solid #e0e0e0;
  min-height: 60px;
}

.suggestion-chip {
  padding: 8px 16px;
  background: white;
  border: 1.5px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #667eea;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: fadeInChip 0.3s ease;
}

@keyframes fadeInChip {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.suggestion-chip:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
}

/* Input */
.chat-input-container {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: white;
  border-top: 2px solid #e0e0e0;
}

#expenseChatInput {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#expenseChatInput:focus {
  border-color: #667eea;
}

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

/* Confirmation card */
.confirmation-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slideInMessage 0.4s ease;
}

.confirmation-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.confirmation-emoji {
  font-size: 32px;
}

.confirmation-header h4 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.confirmation-details {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  color: #666;
  font-weight: 600;
}

.detail-value {
  font-size: 14px;
  color: #333;
  font-weight: 700;
}

.confirmation-analysis {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.confirmation-analysis.success {
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid #4CAF50;
}

.confirmation-analysis.info {
  background: rgba(33, 150, 243, 0.1);
  border-left: 4px solid #2196F3;
}

.confirmation-analysis.warning {
  background: rgba(255, 152, 0, 0.1);
  border-left: 4px solid #FF9800;
}

.confirmation-analysis.alert {
  background: rgba(244, 67, 54, 0.1);
  border-left: 4px solid #f44336;
}

.confirmation-analysis i {
  font-size: 20px;
}

.confirmation-analysis.success i {
  color: #4CAF50;
}

.confirmation-analysis.warning i {
  color: #FF9800;
}

.confirmation-analysis.alert i {
  color: #f44336;
}

.confirmation-analysis p {
  margin: 0;
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

.confirmation-actions {
  display: flex;
  gap: 12px;
}

.confirmation-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.confirmation-btn.save {
  background: #4CAF50;
  color: white;
}

.confirmation-btn.save:hover {
  background: #388E3C;
}

.confirmation-btn.edit {
  background: #2196F3;
  color: white;
}

.confirmation-btn.edit:hover {
  background: #1976D2;
}

.confirmation-btn.cancel {
  background: #f44336;
  color: white;
}

.confirmation-btn.cancel:hover {
  background: #d32f2f;
}

/* Responsive */
@media (max-width: 768px) {
  .conversational-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .message-bubble {
    max-width: 80%;
  }

  .confirmation-actions {
    flex-direction: column;
  }
}

.ai-rec-content p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.6;
  font-weight: 500;
}

/* === DEMO CONTENT === */
.demo-notice {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12);
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: var(--border-radius-md);
  margin-bottom: var(--space-16);
}

.demo-notice i {
  color: #ffc107;
  font-size: 16px;
}

.demo-notice p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.demo-item {
  opacity: 0.8;
  background: rgba(var(--color-primary-rgb), 0.02);
  border-left: 3px solid var(--color-primary);
}

.demo-item:hover {
  opacity: 1;
  background: rgba(var(--color-primary-rgb), 0.05);
}

/* DASHBOARD CONTROL */
#dashboard {
  display: block;
}

#new-dashboard {
  display: none;
}

/* === NEW DASHBOARD - CLEAN VERSION === */
#new-dashboard {
  padding: var(--space-24);
  gap: var(--space-24);
  display: flex;
  flex-direction: column;
}

.new-dashboard-header {
  text-align: center;
  margin-bottom: var(--space-32);
}

.new-dashboard-header h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-8) 0;
}

.new-dashboard-header p {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin: 0;
}

/* New Stats Grid */
.new-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-20);
  margin-bottom: var(--space-32);
}

.new-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-24);
  display: flex;
  align-items: center;
  gap: var(--space-16);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.new-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.new-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
}

.new-stat-card:hover::before {
  transform: scaleY(1);
}

.new-stat-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.new-stat-card .stat-icon i {
  margin: 0;
  padding: 0;
  line-height: 1;
}

/* Unified monochrome icon style */
.balance-card .stat-icon,
.expenses-card .stat-icon,
.savings-card .stat-icon,
.goals-card .stat-icon {
  color: var(--color-primary);
}

.stat-content h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-4) 0;
  letter-spacing: 0.3px;
}

.stat-content .stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-4) 0;
}

.stat-trend {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.stat-trend.positive {
  color: var(--color-success);
}

.stat-trend.negative {
  color: var(--color-danger);
}

/* Main Dashboard Grid */
.new-dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-24);
  margin-bottom: var(--space-32);
}

.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

/* Chart Cards */
.chart-card, .trend-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-24);
  height: fit-content;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-20);
}

.chart-header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.chart-period span {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  background: var(--color-background);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--border-radius-full);
  border: 1px solid var(--color-border);
}

.chart-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-16);
}

.chart-center-info {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.total-amount {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.total-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.trend-chart-wrapper {
  height: 200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-top: var(--space-12);
}

/* Quick Actions Card */
.quick-actions-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-24);
  height: fit-content;
}

.quick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-20);
}

.quick-header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.quick-header span {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-20);
}

.quick-btn {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--color-text);
}

.quick-btn:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-btn i {
  font-size: 18px;
}

.quick-btn span {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.last-transaction {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-16);
}

.transaction-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.transaction-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.transaction-amount {
  font-size: var(--font-size-sm);
  color: var(--color-danger);
  font-weight: var(--font-weight-semibold);
}

/* Recommendations and Transactions Cards */
.recommendations-card, .transactions-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-24);
  height: fit-content;
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.card-header h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.card-header i {
  color: var(--color-primary);
}

.recommendations-content, .transactions-content {
  max-height: 300px;
  overflow-y: auto;
}

/* Floating Keywords */
.new-floating-keywords {
  margin: var(--space-32) 0;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  justify-content: center;
  align-items: center;
}

.keyword {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  animation: float 3s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 0.2s);
}

.keyword:nth-child(1) { --delay: 0; }
.keyword:nth-child(2) { --delay: 1; }
.keyword:nth-child(3) { --delay: 2; }
.keyword:nth-child(4) { --delay: 3; }
.keyword:nth-child(5) { --delay: 4; }
.keyword:nth-child(6) { --delay: 5; }
.keyword:nth-child(7) { --delay: 6; }
.keyword:nth-child(8) { --delay: 7; }

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

/* Responsive */
@media (max-width: 1024px) {
  .new-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-right {
    order: -1;
  }
}

@media (max-width: 768px) {
  #new-dashboard {
    padding: var(--space-16);
  }

  .new-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .keywords-container {
    gap: var(--space-8);
  }

  .keyword {
    font-size: var(--font-size-xs);
    padding: var(--space-6) var(--space-12);
  }
}

/* === TRANSACTION COMPONENTS === */
.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

.transaction-item:hover {
  background: var(--color-background-secondary);
}

.transaction-info h4 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.transaction-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.transaction-amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.transaction-amount.expense {
  color: var(--color-error);
}

.transaction-amount.income {
  color: var(--color-success);
}

/* === SHOPPING LIST COMPONENTS === */
.shopping-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.shopping-checkbox {
  width: 18px;
  height: 18px;
}

.shopping-content {
  flex: 1;
}

.shopping-product {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.shopping-details {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.shopping-separator {
  color: var(--color-text-secondary);
}

.necessity-badge {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.necessity-badge.necessary {
  background-color: rgba(var(--color-success-rgb), 0.1);
  color: var(--color-success);
}

.necessity-badge.not-necessary {
  background-color: rgba(var(--color-warning-rgb), 0.1);
  color: var(--color-warning);
}

/* === ANALYSIS COMPONENTS === */
.unnecessary-expense {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.unnecessary-info h4 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.unnecessary-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.unnecessary-amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-error);
}

/* === INSIGHT CARDS === */
.insight-card {
  display: flex;
  gap: var(--space-16);
  padding: var(--space-16);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-16);
}

.insight-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-base);
  background-color: rgba(var(--color-primary-rgb, 0), 0.1);
  color: var(--color-primary);
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.insight-card__icon i {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.insight-card__content {
  flex: 1;
}

.insight-card__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.insight-card__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

/* === CHART COMPONENTS === */
.chart-container {
  position: relative;
  width: 100%;
  height: 350px;
  max-width: 450px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
}

/* === CHAT COMPONENTS === */
.chat-history {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-16);
  background-color: var(--color-background);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-16);
}

.chat-message {
  margin-bottom: var(--space-16);
}

.chat-message.user .chat-bubble {
  background-color: var(--color-primary);
  color: var(--color-btn-primary-text);
  margin-left: auto;
  max-width: 80%;
}

.chat-message.ai .chat-bubble {
  background-color: var(--color-surface);
  color: var(--color-text);
  margin-right: auto;
  max-width: 80%;
}

.chat-bubble {
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-base);
  display: inline-block;
}

.chat-form {
  display: flex;
  gap: var(--space-12);
  align-items: center;
}

.chat-form .form-control {
  flex: 1;
}

/* === MODAL COMPONENTS === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 9000;
}

.modal.show,
.modal.active {
  display: flex;
}

.modal-dialog {
  display: flex;
  background: var(--color-surface);
  width: 90%;
  max-width: 700px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Branding sutil para modales grandes */
.modal-lg {
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--color-primary);
}

.modal-lg .modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 80px);
  padding-right: var(--space-16);
}

.modal-lg .modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-lg .modal-body::-webkit-scrollbar-track {
  background: var(--color-background);
  border-radius: var(--border-radius-sm);
}

.modal-lg .modal-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
}

.modal-lg .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.auth-dialog {
  max-width: 800px;
}

.modal-illustration {
  flex: 1;
  background: linear-gradient(135deg, #eef3ff, #f9fcff);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-32);
}

.modal-illustration img {
  max-width: 90%;
  max-height: 220px;
  object-fit: contain;
  margin-bottom: var(--space-16);
}

.modal-illustration h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: black;
  text-align: center;
  margin-bottom: var(--space-8);
}

.modal-illustration p {
  font-size: var(--font-size-md);
  color: black;
  text-align: center;
}

.modal-content {
  flex: 1;
  padding: var(--space-32);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-24);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  color: var(--color-text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-base);
  transition: background-color var(--duration-fast);
}

.modal-close:hover {
  background-color: var(--color-secondary);
}

.modal-body {
  flex: 1;
  margin-bottom: var(--space-24);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-12);
}

/* ============================================================================
   MODAL BEM STYLES (for new modal structure)
   ============================================================================ */

.modal__content {
  background: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal--md .modal__content {
  max-width: 600px;
}

.modal--lg .modal__content {
  max-width: 900px;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-24);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.modal__header h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.modal__header h3 i {
  color: var(--color-primary);
}

.modal__close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-secondary);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-base);
  transition: all var(--duration-fast);
  padding: 0;
}

.modal__close:hover {
  background-color: var(--color-secondary);
  color: var(--color-text);
  transform: rotate(90deg);
}

.modal__body {
  padding: var(--space-24);
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.modal__body::-webkit-scrollbar {
  width: 8px;
}

.modal__body::-webkit-scrollbar-track {
  background: var(--color-background);
  border-radius: var(--radius-sm);
}

.modal__body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-sm);
}

.modal__body::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.modal__footer {
  padding: var(--space-20) var(--space-24);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-12);
}

/* Modal form actions override */
.modal__body .form-actions-premium {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: var(--space-12);
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border);
}

.modal__body .form-actions-premium .btn-premium {
  flex: 0 1 auto;
  min-width: 120px;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal__content {
    width: 95%;
    max-height: 95vh;
  }

  .modal__header {
    padding: var(--space-16);
  }

  .modal__body {
    padding: var(--space-16);
  }

  .modal__footer {
    padding: var(--space-16);
  }

  .modal__body .form-actions-premium {
    flex-direction: column;
  }

  .modal__body .form-actions-premium .btn-premium {
    width: 100%;
  }
}

/* ============================================================================
   COMING SOON MODAL
   Elegant small modal for features in development
   ============================================================================ */

.modal-dialog-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.modal-sm {
  max-width: 480px;
  width: 90%;
  margin: 0 auto;
}

.coming-soon-modal {
  background: var(--color-surface-raised);
  border-radius: var(--radius-xl);
  padding: 0;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.coming-soon-modal .modal-close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  background: transparent;
  border: none;
  font-size: var(--font-size-2xl);
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) ease;
  z-index: 10;
}

.coming-soon-modal .modal-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  transform: rotate(90deg);
}

.coming-soon-modal .modal-body {
  padding: var(--space-40) var(--space-32);
}

.coming-soon-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-24);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px rgba(var(--color-primary-rgb), 0);
  }
}

.coming-soon-icon i {
  font-size: var(--font-size-3xl);
  color: var(--color-white);
}

.coming-soon-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-16);
  line-height: 1.2;
}

.coming-soon-message {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-32);
  line-height: 1.6;
}

.coming-soon-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
  padding: var(--space-24);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
}

.coming-soon-feature {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  text-align: left;
}

.coming-soon-feature i {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.coming-soon-feature span {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .modal-sm {
    width: 95%;
  }

  .coming-soon-modal .modal-body {
    padding: var(--space-32) var(--space-20);
  }

  .coming-soon-icon {
    width: 64px;
    height: 64px;
  }

  .coming-soon-icon i {
    font-size: var(--font-size-2xl);
  }

  .coming-soon-title {
    font-size: var(--font-size-xl);
  }

  .coming-soon-features {
    padding: var(--space-16);
  }
}

/* Premium Coming Soon Modal Styles */
.premium-coming-soon-modal {
  background: linear-gradient(135deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-radius: var(--radius-xl);
  padding: 0;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 215, 0, 0.2);
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.premium-coming-soon-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.premium-coming-soon-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-24);
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPulse 2s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4);
  position: relative;
}

.premium-coming-soon-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  opacity: 0.3;
  filter: blur(10px);
  z-index: -1;
}

.premium-coming-soon-icon i {
  font-size: 48px;
  color: var(--color-white);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.premium-coming-soon-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 var(--space-16);
  line-height: 1.2;
}

.premium-coming-soon-message {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-32);
  line-height: 1.6;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.premium-coming-soon-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
  padding: var(--space-24);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 215, 0, 0.1);
}

.premium-coming-soon-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  text-align: center;
  padding: var(--space-12);
  background: var(--color-surface-raised);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.premium-coming-soon-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.premium-coming-soon-feature i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  color: #FFA500;
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.premium-coming-soon-feature span {
  font-size: var(--font-size-xs);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

.premium-cta-btn {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
  color: var(--color-white) !important;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
  transition: all 0.3s ease;
}

.premium-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.6);
}

@media (max-width: 576px) {
  .premium-coming-soon-features {
    grid-template-columns: 1fr;
    padding: var(--space-16);
  }

  .premium-coming-soon-icon {
    width: 80px;
    height: 80px;
  }

  .premium-coming-soon-icon i {
    font-size: 36px;
  }

  .premium-coming-soon-title {
    font-size: var(--font-size-xl);
  }
}

/* Register Prompt Modal */
.register-prompt-modal {
  background: linear-gradient(135deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-40) var(--space-32);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalBounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
  overflow: hidden;
}

.register-prompt-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-teal-600), var(--color-primary));
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes modalBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.modal-close-elegant {
  position: absolute;
  top: var(--space-12);
  right: var(--space-12);
  background: rgba(0, 0, 0, 0.1);
  border: none;
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close-elegant:hover {
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-text);
  transform: rotate(90deg);
}

.register-prompt-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-20);
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  box-shadow: 0 10px 30px rgba(var(--color-primary-rgb), 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(var(--color-primary-rgb), 0.4);
  }
  50% {
    box-shadow: 0 10px 40px rgba(var(--color-primary-rgb), 0.6);
  }
}

.register-prompt-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0 0 var(--space-12) 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.register-prompt-message {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--space-24) 0;
}

.register-prompt-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin-bottom: var(--space-32);
  text-align: left;
}

.prompt-feature {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
  background: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.prompt-feature:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.15);
}

.prompt-feature i {
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.prompt-feature span {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
}

.register-prompt-btn {
  margin-bottom: var(--space-16);
  box-shadow: 0 6px 20px rgba(var(--color-primary-rgb), 0.3);
  transition: all 0.3s ease;
}

.register-prompt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--color-primary-rgb), 0.4);
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  padding: var(--space-8);
  transition: color 0.2s ease;
}

.btn-text:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

@media (max-width: 576px) {
  .register-prompt-modal {
    padding: var(--space-32) var(--space-24);
  }

  .register-prompt-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .register-prompt-title {
    font-size: var(--font-size-xl);
  }

  .register-prompt-message {
    font-size: var(--font-size-sm);
  }
}

/* Logout Confirmation Modal */
.logout-confirm-modal {
  background: var(--color-surface-raised);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logout-confirm-modal .modal-header {
  padding: var(--space-32) var(--space-32) var(--space-20);
  text-align: center;
  border-bottom: none;
  position: relative;
}

.logout-confirm-modal .modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-16);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--color-error);
}

.logout-confirm-modal .modal-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0;
}

.logout-confirm-modal .modal-close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  background: transparent;
  border: none;
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.logout-confirm-modal .modal-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  transform: rotate(90deg);
}

.logout-confirm-modal .modal-body {
  padding: 0 var(--space-32) var(--space-32);
  text-align: center;
}

.logout-confirm-message {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.logout-confirm-modal .modal-footer {
  padding: var(--space-24) var(--space-32) var(--space-32);
  display: flex;
  gap: var(--space-12);
  justify-content: center;
  border-top: none;
}

.logout-confirm-modal .modal-footer .btn {
  flex: 1;
  max-width: 200px;
}

@media (max-width: 576px) {
  .logout-confirm-modal .modal-header {
    padding: var(--space-24) var(--space-20) var(--space-16);
  }

  .logout-confirm-modal .modal-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .logout-confirm-modal .modal-title {
    font-size: var(--font-size-xl);
  }

  .logout-confirm-modal .modal-body {
    padding: 0 var(--space-20) var(--space-24);
  }

  .logout-confirm-modal .modal-footer {
    padding: var(--space-20);
    flex-direction: column;
  }

  .logout-confirm-modal .modal-footer .btn {
    max-width: none;
  }
}

.auth-footer {
  justify-content: center;
  text-align: center;
}

.btn-cancel {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  padding: var(--space-12) var(--space-20);
  border-radius: var(--radius-base);
  transition: color var(--duration-fast);
}

.btn-cancel:hover {
  color: var(--color-text);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border: none;
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-base);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  transition: background-color var(--duration-fast);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

/* === INPUT GROUP COMPONENTS === */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  padding: var(--space-12) var(--space-16);
  margin-bottom: var(--space-16);
  gap: var(--space-12);
  transition: border-color var(--duration-fast);
}

.input-group:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.input-group i {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.input-group input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--font-size-md);
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
}

.input-group input::placeholder {
  color: var(--color-text-secondary);
}

.input-group .password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 16px;
  z-index: 10;
  padding: 8px;
  transition: color 0.2s;
}

.input-group .password-toggle:hover {
  color: var(--color-primary);
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--space-24) 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

.auth-divider span {
  padding: 0 var(--space-16);
}

/* Social login buttons */
.social-login-buttons {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-16);
}

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-12);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-base);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-social:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-google:hover {
  border-color: #4285f4;
  color: #4285f4;
}

.btn-facebook:hover {
  border-color: #1877f2;
  color: #1877f2;
}

/* Goal Inspiration Panel */
.goal-form-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-32);
  align-items: start;
}

.goal-inspiration-panel {
  position: sticky;
  top: var(--space-24);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.inspiration-image-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.inspiration-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1.5s ease-in-out, transform 8s ease-in-out;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Asegurar que la imagen cubra todo el contenedor con el zoom */
.inspiration-image-wrapper .inspiration-image {
  min-width: 110%;
  min-height: 110%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
}

.inspiration-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: var(--space-24);
  color: white;
}

.inspiration-text {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: opacity 1s ease-in-out;
}

@media (max-width: 768px) {
  .goal-form-container {
    grid-template-columns: 1fr;
  }

  .goal-inspiration-panel {
    position: relative;
    top: 0;
    margin-bottom: var(--space-24);
  }

  .inspiration-image-wrapper {
    height: 250px;
  }
}

/* === NOTIFICATION COMPONENTS === */
.notifications {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #ff4757, #ff6348);
  border: 2px solid var(--color-surface);
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: white;
  animation: notificationPulse 2s ease-in-out infinite;
}

.notification-badge i {
  font-size: 10px;
  color: white;
}

/* Animación de pulso para llamar la atención */
@keyframes notificationPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 2px 12px rgba(255, 71, 87, 0.6);
  }
}


/* === NOTIFICATION DROPDOWN REDESIGN === */
.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 500px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  margin-top: var(--space-8);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: all var(--duration-normal) var(--ease-standard);
  z-index: 1000;
}

.notification-dropdown:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) var(--space-20);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.notification-header h4 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.notification-header-action {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-8);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) ease;
  font-size: var(--font-size-sm);
}

.notification-header-action:hover {
  background-color: var(--color-hover);
  color: var(--color-primary);
  transform: scale(1.05);
}

/* Body */
.notification-body {
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.notification-body::-webkit-scrollbar {
  width: 6px;
}

.notification-body::-webkit-scrollbar-track {
  background: transparent;
}

.notification-body::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: var(--radius-full);
}

.notification-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-secondary);
}

.notification-list {
  padding: var(--space-8) 0;
}

/* Individual Notification Item */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-20);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  position: relative;
  overflow: hidden;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background-color: var(--color-hover);
  transform: translateX(2px);
}

.notification-item.read {
  opacity: 0.6;
  background-color: var(--color-surface-variant);
}

.notification-item.priority-high {
  border-left: 4px solid #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05), transparent);
}

.notification-item.priority-medium {
  border-left: 4px solid #f97316;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.05), transparent);
}

.notification-item.priority-low {
  border-left: 4px solid #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.05), transparent);
}

/* Notification Icon */
.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: var(--font-size-md);
  flex-shrink: 0;
  margin-top: var(--space-2);
}

.notification-icon.category-food {
  background-color: rgba(251, 191, 36, 0.1);
  color: var(--color-orange-400);
}

.notification-icon.category-transport {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.notification-icon.category-entertainment {
  background-color: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.notification-icon.category-health {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.notification-icon.category-services {
  background-color: rgba(var(--color-teal-500-rgb), 0.1);
  color: var(--color-primary);
}

.notification-icon.category-shopping {
  background-color: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.notification-icon.category-goal {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.notification-icon.category-protected {
  background-color: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* Notification Content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin: 0 0 var(--space-4) 0;
  line-height: 1.4;
}

.notification-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.3;
}

.notification-amount {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.notification-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: var(--space-4);
}

/* Quick Actions */
.notification-actions {
  display: flex;
  gap: var(--space-4);
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--duration-fast) ease;
  align-self: flex-start;
  margin-top: var(--space-2);
}

.notification-item:hover .notification-actions {
  opacity: 1;
  transform: translateX(0);
}

.notification-action-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  transition: all var(--duration-fast) ease;
}

.notification-action-btn:hover {
  background-color: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

/* Empty State */
.notification-empty {
  text-align: center;
  padding: var(--space-40) var(--space-20);
  color: var(--color-text-secondary);
}

.notification-empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-16);
  opacity: 0.5;
}

.notification-empty h5 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  margin: 0 0 var(--space-8) 0;
}

.notification-empty p {
  font-size: var(--font-size-sm);
  margin: 0;
  line-height: 1.4;
}

/* Footer */
.notification-footer {
  padding: var(--space-12) var(--space-20);
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface-variant);
}

.notification-settings-btn {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-8);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  transition: all var(--duration-fast) ease;
  justify-content: center;
}

.notification-settings-btn:hover {
  background-color: var(--color-hover);
  color: var(--color-primary);
}

/* Animations */
@keyframes slideInNotification {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive: Mobile notifications */
@media (max-width: 768px) {
  .notification-dropdown {
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - var(--navbar-height));
    margin-top: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--color-border);
  }

  .notification-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    top: -6px;
    right: -2px;
  }

  /* Hacer el icono de notificaciones más visible en mobile */
  .notifications {
    font-size: 22px;
    padding: var(--space-8);
  }

  .notifications i {
    font-size: 22px;
  }
}

@keyframes fadeOutNotification {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

.notification-item.new {
  animation: slideInNotification 0.3s ease-out;
}

.notification-item.removing {
  animation: fadeOutNotification 0.2s ease-out forwards;
}

/* Priority indicators */
.notification-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: transparent;
  transition: all var(--duration-fast) ease;
}

.notification-item.priority-high::before {
  background: #ef4444;
}

.notification-item.priority-medium::before {
  background: #f97316;
}

.notification-item.priority-low::before {
  background: #22c55e;
}

/* Protected badge for sensitive notifications */
.notification-protected-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: var(--radius-full);
  margin-left: var(--space-4);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.notification-protected-badge i {
  font-size: 10px;
  color: white;
}

/* AI notification icon */
.notification-icon.category-ai {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
}

/* Change notification categories */
.notification-icon.category-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.notification-icon.category-warning {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
}

.notification-icon.category-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

/* === TOAST COMPONENTS === */
.toast {
  position: fixed;
  top: var(--space-24);
  right: var(--space-24);
  background-color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 320px;
  max-width: 420px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.hidden {
  transform: translateX(400px);
  opacity: 0;
}

@keyframes slideIn {
  0% {
    transform: translateX(400px);
    opacity: 0;
  }
  50% {
    transform: translateX(-10px);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
  }
}

/* Toast con gradiente sutil en el borde izquierdo */
.toast.success {
  border-left: 4px solid #10b981;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.05) 0%, #ffffff 100%);
}

.toast.error {
  border-left: 4px solid #ef4444;
  background: linear-gradient(to right, rgba(239, 68, 68, 0.05) 0%, #ffffff 100%);
}

.toast.info {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(to right, rgba(59, 130, 246, 0.05) 0%, #ffffff 100%);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.toast-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: #ffffff;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: successPulse 0.6s ease-out;
}

.toast.error .toast-icon {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.toast.info .toast-icon {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

@keyframes successPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.toast-message {
  font-size: 15px;
  color: #1f2937;
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
}

/* === OVERLAY COMPONENT === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
}

/* === RADAR CHART STYLES === */
.radar-chart-card {
  grid-column: span 2;
}

.radar-chart-container {
  position: relative;
  height: 400px;
  padding: var(--space-16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-24);
  margin-bottom: var(--space-24);
}

/* === ACHIEVEMENTS SECTION === */
.achievements-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-16);
  margin-bottom: var(--space-32);
}

.achievement-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-20);
  display: flex;
  align-items: center;
  gap: var(--space-16);
  box-shadow: var(--shadow-sm);
}

.achievement-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-500));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.achievement-stat-card .stat-icon i {
  margin: 0;
  padding: 0;
  line-height: 1;
  font-size: var(--font-size-lg);
  color: var(--color-surface);
}

.achievement-stat-card .stat-content {
  display: flex;
  flex-direction: column;
}

.achievement-stat-card .stat-number {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  line-height: 1;
}

.achievement-stat-card .stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-4);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-24);
}

.achievement-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-card.unlocked {
  border-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(45, 166, 178, 0.2);
}

.achievement-card.unlocked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-teal-500));
}

.achievement-card.locked {
  filter: grayscale(100%);
  opacity: 0.6;
}

.achievement-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-16);
  background: rgba(var(--color-primary-rgb), 0.1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.achievement-card.locked .achievement-icon {
  background: rgba(var(--color-text-secondary-rgb), 0.1);
}

.achievement-icon i {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
}

.achievement-card.locked .achievement-icon i {
  color: var(--color-text-secondary);
}

.achievement-card.unlocked .achievement-icon::after {
  content: '✓';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  background: var(--color-success);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  border: 2px solid var(--color-surface);
}

.achievement-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.achievement-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-16);
}

.achievement-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-style: italic;
}

.achievement-card.locked .achievement-date::before {
  content: '🔒 ';
}

.achievement-card.unlocked .achievement-date::before {
  content: '🎉 Desbloqueado el ';
}

@media (max-width: 768px) {
  .radar-chart-card {
    grid-column: span 1;
  }

  .radar-chart-container {
    height: 300px;
    padding: var(--space-12);
  }

  .analysis-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .achievements-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .achievement-card {
    padding: var(--space-20);
  }

  .achievement-icon {
    width: 60px;
    height: 60px;
  }

  .achievement-icon i {
    font-size: var(--font-size-xl);
  }
}

/* === UTILITY CLASSES === */
.hidden {
  display: none !important;
}

.mt-16 {
  margin-top: var(--space-16);
}

.text-center {
  text-align: center;
}

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-32);
  text-align: center;
}

.empty-state i {
  font-size: var(--font-size-4xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-16);
}

.empty-state h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.empty-state p {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
}

/* === ANIMATED EMPTY GOALS STATE === */
.empty-goals-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-raised) 100%);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.6s ease-out;
}

.empty-goals-state::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

.floating-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

.animated-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.75rem;
  color: var(--color-text);
  animation: slideInLeft 0.6s ease-out 0.2s both;
}

.animated-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  line-height: 1.5;
  animation: slideInRight 0.6s ease-out 0.4s both;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease-out 0.6s both;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.progress-dots .dot.active {
  transform: scale(1.2);
  box-shadow: 0 0 10px currentColor;
}

.create-goal-btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.6s ease-out 0.8s both;
  position: relative;
  overflow: hidden;
}

.create-goal-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.create-goal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.create-goal-btn:hover::before {
  left: 100%;
}

.create-goal-btn:active {
  transform: translateY(0);
}

.create-goal-btn i {
  margin-right: 0.5rem;
}

/* === KEYFRAME ANIMATIONS === */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-30px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* === FORM LINK === */
.form-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  margin: var(--space-12) 0;
  display: inline-block;
}

.form-link:hover {
  text-decoration: underline;
}

/* === DELETE BUTTON === */
.btn-delete {
  background-color: var(--color-error);
  color: white;
  border: none;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.btn-delete:hover {
  background-color: var(--color-red-400);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* === OCULTAR NAVBAR SUPERIOR EN MÓVIL === */
  .navbar {
    display: none !important; /* Ya no necesitamos navbar superior */
  }

  /* === BANNER FIJO ARRIBA === */
  .mobile-profile-banner {
    display: block !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-bottom: 0 !important;
    background: transparent;
    height: auto; /* Altura automática para ajustarse al contenido */
  }

  /* Banner cover (fondo) */
  .mobile-banner-cover {
    height: 140px !important;
  }

  /* Perfil info con avatar saliendo del banner */
  .mobile-profile-info {
    margin-top: -40px !important; /* Avatar sale mitad del banner */
    padding-bottom: var(--space-12) !important;
    background: var(--color-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  /* === NAVBAR AL PIE (BOTTOM NAVIGATION) === */
  .sidebar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    height: auto !important;
    width: 100% !important;
    transform: none !important;
    z-index: 1000 !important;
    background: var(--color-surface) !important;
    border-top: 1px solid var(--color-border) !important;
    border-left: none !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
  }

  .sidebar.open,
  .sidebar.sidebar-hidden,
  .sidebar.sidebar-visible {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
  }

  /* Navegación horizontal en el pie */
  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: var(--space-8) 0 !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  /* Botones de navegación compactos */
  .sidebar-nav .nav-item {
    flex-direction: column !important;
    padding: var(--space-8) var(--space-4) !important;
    min-width: 60px !important;
    font-size: 0.7rem !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .sidebar-nav .nav-item i {
    font-size: 1.2rem !important;
    margin-bottom: 4px !important;
    margin-right: 0 !important;
  }

  .sidebar-nav .nav-item span {
    font-size: 0.65rem !important;
    white-space: nowrap;
  }

  .sidebar-nav .nav-item.active {
    background: transparent !important;
    color: var(--color-primary) !important;
  }

  /* Ocultar elementos no esenciales en navbar móvil */
  .sidebar .nav-auth {
    display: none !important;
  }

  .sidebar .sidebar-footer {
    display: none !important;
  }

  /* Main content con espacio para banner arriba y navbar abajo */
  .main-content {
    margin-left: 0 !important;
   
    padding-bottom: 80px !important; /* Espacio para navbar inferior */
    padding-left: var(--space-20);
    padding-right: var(--space-20);
    width: 100%;
    box-sizing: border-box;
    min-height: 100vh;
  }

  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .overlay.active {
    display: block;
  }

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }


  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    flex-direction: column;
    width: 95%;
    max-width: 95vw;
    max-height: 85vh;
    margin: auto;
    overflow-y: auto;
  }

  .modal-illustration {
    display: none;
  }

  .modal-illustration h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
  }

  .modal-illustration p {
    font-size: var(--font-size-sm);
  }

  .modal-content {
    padding: var(--space-24) var(--space-20);
  }

  .modal-header {
    position: relative;
    margin-bottom: var(--space-20);
  }

  .modal-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-surface-raised);
    border: 2px solid var(--color-border);
  }

  .modal-title {
    font-size: var(--font-size-lg);
    padding-right: var(--space-32);
  }

  .input-group {
    position: relative;
  }

  .input-group .toggle-pass {
    position: absolute;
    right: var(--space-12);
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--color-text-secondary);
    z-index: 10;
  }

  .toast {
    left: var(--space-16);
    right: var(--space-16);
    top: var(--space-16);
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 var(--space-12); /* Menos padding en móviles pequeños */
  }

  .navbar__logo span {
    font-size: var(--font-size-md); /* Aún más pequeño en pantallas muy pequeñas */
    max-width: 160px; /* Limita el ancho máximo */
  }

  .navbar__actions {
    gap: var(--space-4); /* Gap mínimo */
  }

  .navbar .icon-btn.hamburger-menu {
    width: 36px; /* Botón hamburguesa más pequeño */
    height: 36px;
    display: flex !important; /* Asegura que se muestre en móviles pequeños */
  }

  .main-content {
    padding: var(--space-16);
    margin-left: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  .card {
    padding: var(--space-16);
  }

  .stat-card {
    padding: var(--space-16);
  }

  .section-header h1 {
    font-size: var(--font-size-3xl);
  }
}

/* === FOCUS STYLES === */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}


/* ===== CORRECCIÓN DASHBOARD SIEMPRE VISIBLE ===== */

#dashboard {
  display: none !important;
  position: relative !important;
  z-index: auto !important;
}

#dashboard.active {
  display: block !important;
  position: relative !important;
  z-index: auto !important;
}

.section {
  display: none !important;
  position: relative !important;
  z-index: auto !important;
}

.section.active {
  display: block !important;
  position: relative !important;
  z-index: auto !important;
}

/* Forzar corrección en todas las secciones */
#dashboard,
#expenses,
#goals,
#analysis,
#shopping,
#config,
#achievements {
  position: relative !important;
  z-index: auto !important;
  top: auto !important;
  left: auto !important;
}

.main-content {
  position: relative !important;
  z-index: auto !important;
}

/* ====== PREMIUM EXPENSE FORM STYLES ====== */

.form-grid-premium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-24);
  margin-bottom: var(--space-24);
}

.form-group-premium {
  position: relative;
}

.form-label-premium {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-12);
  font-size: var(--font-size-sm);
  letter-spacing: 0.3px;
}

.label-icon {
  color: var(--color-primary);
  font-size: var(--font-size-xs);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: var(--space-16);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  z-index: 2;
  transition: color 0.3s ease;
}

.form-control-premium {
  width: 100%;
  padding: var(--space-16) var(--space-16) var(--space-16) var(--space-48);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-control-premium:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
  background: var(--color-white);
}

.form-control-premium:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--color-primary);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '\f078';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: var(--space-16);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
  transition: color 0.3s ease;
}

.select-wrapper:focus-within::after {
  color: var(--color-primary);
}

.form-control-premium[type="date"] {
  padding-right: var(--space-16);
}

/* Necessity Selector */
.necessity-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-12);
  margin-top: var(--space-12);
}

.necessity-btn {
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.necessity-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

.necessity-btn:hover::before {
  left: 100%;
}

.necessity-btn.high {
  border-color: var(--color-error);
  color: var(--color-error);
}

.necessity-btn.high:hover,
.necessity-btn.high.active {
  background: var(--color-error);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--color-error-rgb), 0.3);
}

.necessity-btn.medium {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.necessity-btn.medium:hover,
.necessity-btn.medium.active {
  background: var(--color-warning);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--color-warning-rgb), 0.3);
}

.necessity-btn.low {
  border-color: var(--color-success);
  color: var(--color-success);
}

.necessity-btn.low:hover,
.necessity-btn.low.active {
  background: var(--color-success);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--color-success-rgb), 0.3);
}

/* Premium Submit Button */
.btn-premium {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-16) var(--space-32);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
  width: 100%;
}

.btn-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.btn-premium:hover::before {
  left: 100%;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.4);
}

.btn-premium:active {
  transform: translateY(0);
}

.btn-premium.loading {
  background: var(--color-text-tertiary);
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn-premium.loading .btn-text {
  opacity: 0;
}

.btn-premium.loading .loading-spinner {
  opacity: 1;
}

.btn-premium.success {
  background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
  animation: successPulse 0.6s ease-out;
}

.loading-spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(var(--color-text-rgb), 0.3);
  border-top: 2px solid var(--color-text);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.success-icon {
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  font-size: var(--font-size-lg);
}

.btn-premium.success .success-icon {
  opacity: 1;
}

.btn-premium.success .btn-text {
  opacity: 0;
}

/* Security Notice */
.security-notice {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-16);
  background: rgba(var(--color-success-rgb), 0.1);
  border: 1px solid rgba(var(--color-success-rgb), 0.2);
  border-radius: var(--radius-md);
  color: var(--color-success-dark);
  font-size: var(--font-size-xs);
  margin-top: var(--space-16);
}

.security-notice i {
  color: var(--color-success);
}

/* Form Actions */
.form-actions-premium {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border-light);
}

/* Auto-fill indicators */
.auto-filled {
  background: rgba(var(--color-info-rgb), 0.05) !important;
  border-color: var(--color-info) !important;
}

.auto-filled .input-icon {
  color: var(--color-info) !important;
}

/* Hidden user selector for personal accounts */
.user-selector-hidden {
  display: none;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group-premium {
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.form-group-premium:nth-child(1) { animation-delay: 0.1s; }
.form-group-premium:nth-child(2) { animation-delay: 0.2s; }
.form-group-premium:nth-child(3) { animation-delay: 0.3s; }
.form-group-premium:nth-child(4) { animation-delay: 0.4s; }
.form-group-premium:nth-child(5) { animation-delay: 0.5s; }

/* Responsive Design */
@media (max-width: 768px) {
  .expense-form-premium {
    padding: var(--space-24);
    margin: var(--space-16);
  }

  .form-grid-premium {
    grid-template-columns: 1fr;
    gap: var(--space-20);
  }

  .necessity-selector {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .necessity-btn {
    padding: var(--space-16);
    font-size: var(--font-size-md);
  }
}

/* Focus and validation states */
.form-control-premium.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(var(--color-error-rgb), 0.1);
}

.form-control-premium.success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(var(--color-success-rgb), 0.1);
}

.error-message {
  color: var(--color-error);
  font-size: var(--font-size-xs);
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.success-message {
  color: var(--color-success);
  font-size: var(--font-size-xs);
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Onboarding Tour Styles */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  opacity: 0;
  /* <-- AÑADIDO: Oculto por defecto */
  pointer-events: none;
  /* <-- AÑADIDO: No interactivo por defecto */
  transition: opacity 0.3s ease;
  /* Transición suave */
}
.tour-overlay.hidden {
  display: none;
}

.tour-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
}

.tour-spotlight {
  position: absolute;
  background: transparent;
  border-radius: var(--radius-xl);
  box-shadow: 0 0 0 3px var(--color-primary),
              0 0 0 9999px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.tour-tooltip {
  position: absolute;
  max-width: 400px;
  min-width: 320px;
  background: var(--color-surface-raised);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
}

.tour-tooltip.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.tour-tooltip-content {
  padding: 0;
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-20) var(--space-24) var(--space-16);
  border-bottom: 1px solid var(--color-border);
}

.tour-title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
}

.tour-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
  font-size: var(--font-size-sm);
}

.tour-close:hover {
  background: var(--color-error);
  color: var(--color-white);
  transform: scale(1.1);
}

.tour-body {
  padding: var(--space-20) var(--space-24);
}

.tour-description {
  margin: 0;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.tour-footer {
  padding: var(--space-16) var(--space-24) var(--space-20);
  border-top: 1px solid var(--color-border);
}

.tour-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-16);
}

.tour-step-counter {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.tour-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  margin-left: var(--space-16);
  overflow: hidden;
}

.tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  width: 0%;
}

.tour-actions {
  display: flex;
  gap: var(--space-16);
  justify-content: space-between;
  align-items: center;
}

.tour-nav-buttons {
  display: flex;
  gap: var(--space-12);
}

.tour-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tour-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.tour-btn.tour-next,
.tour-btn.tour-finish {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.tour-btn.tour-next:hover,
.tour-btn.tour-finish:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
}

.tour-btn.tour-skip {
  color: var(--color-text-tertiary);
  border-color: transparent;
  background: transparent;
}

.tour-btn.tour-skip:hover {
  color: var(--color-error);
  background: var(--color-error-light);
  border-color: var(--color-error);
}

.tour-btn.hidden {
  display: none;
}

.tour-skip-prominent {
  background: transparent !important;
  color: var(--color-text-tertiary) !important;
  border: 1px solid var(--color-border) !important;
  padding: var(--space-8) var(--space-20) !important;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tour-skip-prominent:hover {
  background: var(--color-error-bg) !important;
  color: var(--color-error) !important;
  border-color: var(--color-error) !important;
  transform: translateY(-1px);
}

/* Tour Start Button - Oculto, solo se accede desde Centro de Ayuda en el footer */
.tour-start-btn {
  display: none !important;
}

/* Tour element highlighting */
.tour-highlighted {
  position: relative;
  z-index: 9999;
}

/* Tour Completion Modal */
.tour-completion-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.tour-final-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin-top: var(--space-16);
}

.tour-final-options .btn {
  justify-content: flex-start;
  gap: var(--space-12);
  padding: var(--space-16);
  font-size: var(--font-size-base);
}

/* Tour tooltip positioning classes */
.tour-tooltip.position-top {
  transform-origin: bottom center;
}

.tour-tooltip.position-bottom {
  transform-origin: top center;
}

.tour-tooltip.position-left {
  transform-origin: right center;
}

.tour-tooltip.position-right {
  transform-origin: left center;
}

/* Responsive adjustments for tour */
@media (max-width: 768px) {
  .tour-tooltip {
    max-width: 90vw;
    min-width: 280px;
    margin: var(--space-16);

    /* --- LÍNEAS AÑADIDAS --- */
    max-height: 85vh;
    /* 1. Limita la altura máxima al 85% de la pantalla */
    display: flex;
    /* 2. Usa Flexbox para controlar el layout interno */
    flex-direction: column;
    /* 3. Apila el header, body y footer verticalmente */
    /* --- FIN DE LÍNEAS AÑADIDAS --- */
  }

  .tour-header,
  .tour-body,
  .tour-footer {
    padding: var(--space-16);
  }

  /* --- SELECTOR AÑADIDO --- */
  .tour-body {
    overflow-y: auto;
    /* 4. Habilita el scroll SOLO en el cuerpo del modal */
    flex-shrink: 1;
    /* 5. Permite que el cuerpo se encoja para dar espacio al footer */
  }

  /* --- FIN DE SELECTOR AÑADIDO --- */


  .tour-actions {
    flex-wrap: wrap;
    gap: var(--space-8);
  }

  .tour-btn {
    flex: 1;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .tour-tooltip {
    max-width: 95vw;
    min-width: 260px;
  }

  .tour-progress {
    flex-direction: column;
    gap: var(--space-8);
  }

  .tour-progress-bar {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tour-tooltip {
    max-width: 95vw;
    min-width: 260px;
  }

  .tour-progress {
    flex-direction: column;
    gap: var(--space-8);
  }

  .tour-progress-bar {
    margin-left: 0;
    width: 100%;
  }
}

/* ========================================
   AUDIT HISTORY SECTION
   ======================================== */

.audit-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-24);
}

.audit-filters {
  display: flex;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
  flex-wrap: wrap;
  background: var(--color-surface-raised);
  padding: var(--space-20);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: var(--space-10) var(--space-12);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-base);
  background: var(--color-background);
  color: var(--color-text);
}

.audit-list {
  background: var(--color-surface-raised);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.audit-empty {
  text-align: center;
  padding: var(--space-48);
  color: var(--color-text-secondary);
}

.audit-empty i {
  font-size: 48px;
  margin-bottom: var(--space-16);
  opacity: 0.5;
}

.audit-item {
  display: flex;
  gap: var(--space-16);
  padding: var(--space-20);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s;
}

.audit-item:last-child {
  border-bottom: none;
}

.audit-item:hover {
  background: var(--color-background);
}

.audit-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-lg);
}

.audit-icon.added {
  background: rgba(var(--color-success-rgb), 0.1);
  color: var(--color-success);
}

.audit-icon.edited {
  background: rgba(var(--color-warning-rgb), 0.1);
  color: var(--color-warning);
}

.audit-icon.deleted {
  background: rgba(var(--color-error-rgb), 0.1);
  color: var(--color-error);
}

.audit-content {
  flex: 1;
}

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--space-8);
}

.audit-title {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.audit-date {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.audit-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

.audit-reason {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  padding: var(--space-8) var(--space-12);
  background: var(--color-background);
  border-radius: var(--border-radius-md);
  border-left: 3px solid var(--color-primary);
}

.audit-reason strong {
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 768px) {
  .audit-filters {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .audit-item {
    flex-direction: column;
  }

  .audit-header {
    flex-direction: column;
    gap: var(--space-8);
  }
}

/* ========================================
   SAVINGS MANAGEMENT
   ======================================== */

.savings-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.savings-form-section {
  background: var(--color-background);
  padding: var(--space-24);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
}

.savings-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.form-group-flex {
  flex: 1;
}

.savings-list-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.savings-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-16);
  padding: var(--space-20);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-600) 100%);
  border-radius: var(--border-radius-lg);
  color: white;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.summary-label {
  font-size: var(--font-size-sm);
  opacity: 0.9;
  font-weight: var(--font-weight-medium);
}

.summary-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

.savings-accounts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  min-height: 200px;
}

.savings-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.savings-account-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.savings-account-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-xl);
  flex-shrink: 0;
}

.savings-account-icon.retirement {
  background: rgba(var(--color-teal-500-rgb), 0.1);
  color: rgb(99, 102, 241);
}

.savings-account-icon.emergency {
  background: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}

.savings-account-icon.investment {
  background: rgba(34, 197, 94, 0.1);
  color: rgb(34, 197, 94);
}

.savings-account-icon.savings_account {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
}

.savings-account-icon.cash {
  background: rgba(245, 158, 11, 0.1);
  color: rgb(245, 158, 11);
}

.savings-account-icon.goal {
  background: rgba(168, 85, 247, 0.1);
  color: rgb(168, 85, 247);
}

.savings-account-icon.other {
  background: rgba(100, 116, 139, 0.1);
  color: rgb(100, 116, 139);
}

.savings-account-info {
  flex: 1;
  margin-left: var(--space-16);
  min-width: 0;
}

.savings-account-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
}

.savings-account-meta {
  display: flex;
  gap: var(--space-12);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.savings-account-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.savings-account-amount {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  white-space: nowrap;
}

.savings-account-actions {
  display: flex;
  gap: var(--space-8);
  margin-left: var(--space-16);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--color-background);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-text-secondary);
}

.btn-icon:hover {
  background: var(--color-primary);
  color: white;
}

.btn-icon.delete:hover {
  background: var(--color-error);
}

.empty-state-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-32);
  color: var(--color-text-secondary);
  text-align: center;
}

.empty-state-small i {
  font-size: 48px;
  margin-bottom: var(--space-12);
  opacity: 0.3;
}

.empty-state-small p {
  margin: 0;
}

@media (max-width: 768px) {
  .savings-form .form-row {
    grid-template-columns: 1fr;
  }

  .savings-summary {
    grid-template-columns: 1fr;
  }

  .savings-account-item {
    flex-wrap: wrap;
  }

  .savings-account-info {
    flex: 1 1 100%;
    margin-left: 0;
    margin-top: var(--space-12);
  }

  .savings-account-amount {
    margin-top: var(--space-12);
  }

  .savings-account-actions {
    margin-left: 0;
    margin-top: var(--space-12);
  }
}

/* Savings Detail Modal */
.savings-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.detail-summary-card {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-20);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-600) 100%);
  border-radius: var(--border-radius-lg);
  color: white;
}

.detail-summary-card i {
  font-size: 32px;
  opacity: 0.9;
}

.detail-summary-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

.detail-summary-card h2 {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

.savings-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.breakdown-item {
  display: flex;
  align-items: center;
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.breakdown-item:hover {
  border-color: var(--color-primary);
}

.breakdown-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  font-size: 24px;
  flex-shrink: 0;
}

.breakdown-info {
  flex: 1;
  margin-left: var(--space-16);
  min-width: 0;
}

.breakdown-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.breakdown-meta {
  display: flex;
  gap: var(--space-16);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.breakdown-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.breakdown-amount {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  white-space: nowrap;
}

.breakdown-percentage {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .savings-detail-summary {
    grid-template-columns: 1fr;
  }

  .breakdown-item {
    flex-direction: column;
    text-align: center;
  }

  .breakdown-info {
    margin-left: 0;
    margin-top: var(--space-12);
  }

  .breakdown-amount {
    margin-top: var(--space-12);
  }
}

/* ============================================
   RECURRING PAYMENTS MANAGEMENT SYSTEM
   ============================================ */

/* Payments Configuration Card */
.payments-config-card {
  margin-bottom: var(--space-24);
}

.payments-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-24);
}

.payments-form-section {
  border-right: 1px solid var(--color-border);
  padding-right: var(--space-24);
}

.payments-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.payments-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-20);
}

.payments-summary .summary-item {
  padding: var(--space-16);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1) 0%, rgba(var(--color-teal-600-rgb, 13, 148, 136), 0.05) 100%);
  border-radius: var(--border-radius-md);
  text-align: center;
}

.payments-summary .summary-label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.payments-summary .summary-value {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.payments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--space-8);
}

.payment-item {
  display: flex;
  align-items: center;
  padding: var(--space-12);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.payment-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.payment-item-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  font-size: 20px;
  flex-shrink: 0;
}

/* Payment Type Icons Colors */
.payment-item-icon.electricity {
  background: rgba(245, 158, 11, 0.1);
  color: rgb(245, 158, 11);
}

.payment-item-icon.water {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
}

.payment-item-icon.phone {
  background: rgba(139, 92, 246, 0.1);
  color: rgb(139, 92, 246);
}

.payment-item-icon.internet {
  background: rgba(6, 182, 212, 0.1);
  color: rgb(6, 182, 212);
}

.payment-item-icon.tv {
  background: rgba(236, 72, 153, 0.1);
  color: rgb(236, 72, 153);
}

.payment-item-icon.rent {
  background: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}

.payment-item-icon.gas {
  background: rgba(249, 115, 22, 0.1);
  color: rgb(249, 115, 22);
}

.payment-item-icon.insurance {
  background: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
}

.payment-item-icon.subscription {
  background: rgba(var(--color-teal-500-rgb), 0.1);
  color: rgb(99, 102, 241);
}

.payment-item-icon.other {
  background: rgba(100, 116, 139, 0.1);
  color: rgb(100, 116, 139);
}

.payment-item-info {
  flex: 1;
  margin-left: var(--space-12);
  min-width: 0;
}

.payment-item-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
}

.payment-item-meta {
  display: flex;
  gap: var(--space-12);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.payment-item-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.payment-item-amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  white-space: nowrap;
  margin-right: var(--space-12);
}

.payment-item-actions {
  display: flex;
  gap: var(--space-8);
}

/* Dashboard Payments Card */
.upcoming-payments-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.upcoming-payments-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.payments-scroll-container {
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-8);
  margin: calc(var(--space-8) * -1);
}

.payments-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.payments-scroll-container::-webkit-scrollbar-track {
  background: var(--color-background);
  border-radius: var(--border-radius-sm);
}

.payments-scroll-container::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
}

.payments-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.payments-list .payment-item-compact {
  display: flex;
  align-items: center;
  padding: var(--space-12);
  background: var(--color-surface-raised);
  border-radius: var(--border-radius-md);
  margin-bottom: var(--space-8);
  transition: all 0.2s;
}

.payment-item-compact:hover {
  background: var(--color-surface-hover);
}

.payment-item-compact .payment-item-icon {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

.payment-item-compact.pending {
  border-left: 3px solid var(--color-warning);
  background: rgba(var(--color-warning-rgb, 245, 158, 11), 0.05);
}

.payment-item-compact.paid {
  border-left: 3px solid var(--color-success);
  background: rgba(var(--color-success-rgb), 0.05);
  opacity: 0.8;
}

.payment-item-status {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.payment-item-status.pending {
  color: var(--color-warning);
}

.payment-item-status.paid {
  color: var(--color-success);
}

.payment-item-status i {
  font-size: 16px;
}

.payment-date-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  background: var(--color-background);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.payment-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-12);
  background: rgba(var(--color-warning-rgb, 245, 158, 11), 0.1);
  color: var(--color-warning);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.empty-state-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-8);
  opacity: 0.7;
}

/* Payments Detail Modal */
.payments-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.detail-summary-card.pending-card {
  background: linear-gradient(135deg, rgb(245, 158, 11) 0%, rgb(251, 191, 36) 100%);
}

.detail-summary-card.paid-card {
  background: linear-gradient(135deg, rgb(16, 185, 129) 0%, rgb(52, 211, 153) 100%);
}

.detail-summary-card.total-card {
  background: linear-gradient(135deg, rgb(99, 102, 241) 0%, rgb(129, 140, 248) 100%);
}

.payments-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.payments-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) 0;
  border-bottom: 2px solid var(--color-border);
  margin-top: var(--space-16);
}

.payments-section-title:first-child {
  margin-top: 0;
}

.payments-section-title i {
  font-size: 20px;
  color: var(--color-warning);
}

.payments-section-title.paid-section i {
  color: var(--color-success);
}

.payments-section-title h4 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.payment-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.payment-detail-item {
  display: flex;
  align-items: center;
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.payment-detail-item.pending {
  border-left: 4px solid var(--color-warning);
  background: rgba(var(--color-warning-rgb, 245, 158, 11), 0.03);
}

.payment-detail-item.paid {
  border-left: 4px solid var(--color-success);
  background: rgba(var(--color-success-rgb), 0.03);
}

.payment-detail-item:hover {
  transform: translateX(4px);
}

.payment-detail-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  font-size: 24px;
  flex-shrink: 0;
}

.payment-detail-info {
  flex: 1;
  margin-left: var(--space-16);
  min-width: 0;
}

.payment-detail-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-8);
}

.payment-detail-meta {
  display: flex;
  gap: var(--space-16);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.payment-detail-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.payment-detail-amount {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  white-space: nowrap;
}

.payment-detail-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-8);
  margin-left: var(--space-16);
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.payment-status-badge.pending {
  background: rgba(var(--color-warning-rgb, 245, 158, 11), 0.15);
  color: var(--color-warning);
}

.payment-status-badge.paid {
  background: rgba(var(--color-success-rgb), 0.15);
  color: var(--color-success);
}

.payment-paid-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-align: right;
}

.payment-action-button {
  margin-top: var(--space-8);
  padding: var(--space-8) var(--space-16);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s;
}

.payment-action-button:hover {
  background: var(--color-primary-hover);
  transform: scale(1.05);
}

.payment-action-button.mark-paid {
  background: var(--color-success);
}

.payment-action-button.mark-paid:hover {
  background: rgb(5, 150, 105);
}

@media (max-width: 768px) {
  .payments-section {
    grid-template-columns: 1fr;
  }

  .payments-form-section {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0;
    padding-bottom: var(--space-24);
    margin-bottom: var(--space-24);
  }

  .payments-form .form-row {
    grid-template-columns: 1fr;
  }

  .payments-summary {
    grid-template-columns: 1fr;
  }

  .payments-detail-summary {
    grid-template-columns: 1fr;
  }

  .payment-detail-item {
    flex-wrap: wrap;
  }

  .payment-detail-info {
    flex: 1 1 100%;
    margin-left: 0;
    margin-top: var(--space-12);
  }

  .payment-detail-status {
    margin-left: 0;
    margin-top: var(--space-12);
    width: 100%;
    align-items: flex-start;
  }

  .payment-detail-amount {
    margin-top: var(--space-12);
  }
}

/* ============================================
   EXPENSES DETAIL MODAL
   ============================================ */

.stat-card--clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.stat-card--clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-xl .modal-dialog {
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--color-primary);
  box-shadow: 0 -3px 0 0 rgba(var(--color-primary-rgb), 0.1);
}

.modal-xl .modal-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-xl .modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 80px);
  padding-right: var(--space-16);
}

.modal-xl .modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-xl .modal-body::-webkit-scrollbar-track {
  background: var(--color-background);
  border-radius: var(--border-radius-sm);
}

.modal-xl .modal-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--border-radius-sm);
}

.modal-xl .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.expenses-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-24);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-600) 100%);
  border-radius: var(--border-radius-lg);
  color: white;
  margin-bottom: var(--space-24);
}

.summary-period {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.summary-period i {
  font-size: 48px;
  opacity: 0.9;
}

.summary-period h4 {
  margin: 0;
  font-size: var(--font-size-sm);
  opacity: 0.9;
  font-weight: var(--font-weight-normal);
}

.summary-period p {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.summary-total-expenses {
  text-align: right;
}

.summary-total-expenses h4 {
  margin: 0;
  font-size: var(--font-size-sm);
  opacity: 0.9;
  font-weight: var(--font-weight-normal);
}

.summary-total-expenses h2 {
  margin: 0;
  font-size: 48px;
  font-weight: var(--font-weight-bold);
}

/* Container for horizontal scroll */
.expenses-stats-container {
  position: relative;
  margin-bottom: var(--space-32);
}

.expenses-stats-grid {
  display: flex;
  gap: var(--space-16);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: var(--space-8) var(--space-4);

  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.expenses-stats-grid::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.expense-stat-card {
  flex: 0 0 auto;
  min-width: 250px;
  max-width: 280px;
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-20);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  transition: all 0.2s;
}

/* Scroll Buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  opacity: 0.9;
}

.scroll-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.scroll-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.scroll-btn-left {
  left: -10px;
}

.scroll-btn-right {
  right: -10px;
}

.scroll-btn.hidden {
  display: none;
}

.expense-stat-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.expense-stat-card .stat-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  font-size: 28px;
  flex-shrink: 0;
}

/* Unified monochrome icon style */
.expense-stat-card.transactions .stat-icon,
.expense-stat-card.necessity .stat-icon,
.expense-stat-card.unnecessary .stat-icon,
.expense-stat-card.services .stat-icon {
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
}

.expense-stat-card .stat-content {
  flex: 1;
}

.expense-stat-card .stat-content h4 {
  margin: 0 0 var(--space-8) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.expense-stat-card .stat-number {
  margin: 0 0 var(--space-4) 0;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.expense-stat-card .stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.section-title-row {
  display: flex;
  align-items: center;
  padding-bottom: var(--space-12);
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-20);
}

.section-title-row h4 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.section-title-row i {
  color: var(--color-primary);
}

.expenses-necessity-section,
.expenses-services-section,
.expenses-categories-section,
.expenses-transactions-section {
  margin-bottom: var(--space-32);
}

.necessity-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.necessity-bar-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.necessity-bar-label {
  min-width: 180px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.necessity-bar-wrapper {
  flex: 1;
  height: 40px;
  background: var(--color-background);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  position: relative;
}

.necessity-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--space-16);
  color: white;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  transition: width 0.6s ease;
}

.necessity-bar-fill.very-necessary {
  background: linear-gradient(90deg, rgb(16, 185, 129) 0%, rgb(5, 150, 105) 100%);
}

.necessity-bar-fill.necessary {
  background: linear-gradient(90deg, rgb(59, 130, 246) 0%, rgb(37, 99, 235) 100%);
}

.necessity-bar-fill.little-necessary {
  background: linear-gradient(90deg, rgb(245, 158, 11) 0%, rgb(217, 119, 6) 100%);
}

.necessity-bar-fill.not-necessary {
  background: linear-gradient(90deg, rgb(239, 68, 68) 0%, rgb(220, 38, 38) 100%);
}

.necessity-bar-fill.impulse {
  background: linear-gradient(90deg, rgb(168, 85, 247) 0%, rgb(147, 51, 234) 100%);
}

.necessity-bar-value {
  min-width: 100px;
  text-align: right;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.services-paid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-16);
}

.service-paid-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.service-paid-item:hover {
  border-color: var(--color-primary);
}

.service-paid-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  font-size: 20px;
  flex-shrink: 0;
}

.service-paid-info {
  flex: 1;
}

.service-paid-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

.service-paid-amount {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

.categories-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-16);
}

.category-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.category-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.category-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  font-size: 18px;
}

.category-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.category-amount {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.category-count {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-height: 400px;
  overflow-y: auto;
  padding-right: var(--space-8);
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s;
}

.transaction-item:hover {
  border-color: var(--color-primary);
}

.transaction-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  font-size: 20px;
  flex-shrink: 0;
}

.transaction-info {
  flex: 1;
}

.transaction-description {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
}

.transaction-meta {
  display: flex;
  gap: var(--space-16);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.transaction-amount {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  white-space: nowrap;
}

.financial-insights {
  margin-top: var(--space-32);
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-20);
  padding: var(--space-24);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1) 0%, rgba(var(--color-teal-600-rgb, 13, 148, 136), 0.05) 100%);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius-md);
}

.insight-card i {
  font-size: 32px;
  color: var(--color-primary);
  margin-top: var(--space-4);
}

.insight-content h5 {
  margin: 0 0 var(--space-12) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.insight-content p {
  margin: 0;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .categories-breakdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-paid-list {
    grid-template-columns: 1fr;
  }

  /* Scroll buttons más pequeños en tablets */
  .scroll-btn {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 768px) {
  .expenses-summary-header {
    flex-direction: column;
    gap: var(--space-20);
    text-align: center;
  }

  .summary-period {
    flex-direction: column;
    text-align: center;
  }

  .summary-total-expenses {
    text-align: center;
  }

  /* En mobile, las tarjetas se adaptan mejor al scroll horizontal */
  .expense-stat-card {
    min-width: 220px;
    max-width: 240px;
  }

  /* Scroll buttons aún más pequeños en mobile */
  .scroll-btn {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-sm);
  }

  .scroll-btn-left {
    left: 0;
  }

  .scroll-btn-right {
    right: 0;
  }

  .categories-breakdown {
    grid-template-columns: 1fr;
  }

  .necessity-bar-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .necessity-bar-label {
    min-width: auto;
  }

  .transaction-item {
    flex-wrap: wrap;
  }

  .transaction-info {
    flex: 1 1 100%;
  }

  .transaction-amount {
    flex: 1 1 100%;
    text-align: left;
    margin-top: var(--space-8);
  }
}

/* ========================================
   BUDGET SECTION STYLES
   ======================================== */

.budget-summary-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-700) 100%);
  color: white;
  border: none;
}

.budget-summary-card .card__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-16);
}

.budget-summary-card h3 {
  color: white;
}

.budget-month-selector {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.budget-month-label {
  font-size: 1rem;
  font-weight: 600;
  min-width: 150px;
  text-align: center;
}

.budget-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-20);
  margin-bottom: var(--space-24);
}

.budget-stat {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.budget-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--color-primary);
}

/* Budget stat icons with semantic colors */
.budget-stat-icon--primary {
  background: #181d354a;
  color: rgb(255, 255, 255);
}

.budget-stat-icon--warning {
  background:#181d354a;
  color: rgb(255, 255, 255);
}

.budget-stat-icon--success {
  background: #181d354a;
  color: rgb(255, 255, 255);
}

.budget-stat-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.budget-stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

.budget-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.budget-overall-progress {
  margin-top: var(--space-20);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  font-size: 0.875rem;
  font-weight: 600;
}

.progress-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-teal-500) 0%, var(--color-teal-400) 100%);
  border-radius: 999px;
  transition: width 0.5s ease-in-out;
}

.progress-fill.warning {
  background: linear-gradient(90deg, var(--color-orange-400) 0%, var(--color-orange-400) 100%);
}

.progress-fill.danger {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

/* Budget Setup Grid */
.budget-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-20);
  margin-bottom: var(--space-24);
}

.budget-category-item {
  padding: var(--space-16);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.budget-category-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(var(--color-teal-500-rgb), 0.1);
}

.budget-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.category-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--color-primary);
}

/* Unified monochrome icon style - using brand color only */
.category-icon--food,
.category-icon--transport,
.category-icon--entertainment,
.category-icon--health,
.category-icon--services,
.category-icon--shopping,
.category-icon--other {
  color: var(--color-primary);
}

.category-name {
  font-weight: 600;
  font-size: 1rem;
}

/* Budget Categories Progress */
#budgetCategoriesProgress {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.budget-category-progress {
  padding: var(--space-16);
  background: var(--color-background);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.budget-category-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-12);
}

.budget-category-info {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.budget-category-amounts {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.budget-category-amounts-row {
  display: flex;
  gap: var(--space-16);
  font-size: 0.875rem;
}

.budget-amount-label {
  color: var(--color-text-secondary);
}

.budget-amount-value {
  font-weight: 600;
}

.budget-amount-value.spent {
  color: var(--color-warning);
}

.budget-amount-value.available {
  color: var(--color-success);
}

.budget-amount-value.exceeded {
  color: var(--color-danger);
}

.budget-alert {
  margin-top: var(--space-12);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.budget-alert.warning {
  background: var(--color-cream-50);
  color: #92400e;
  border: 1px solid var(--color-orange-400);
}

.budget-alert.danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* ========================================
   LEISURE BUDGET STYLES
   ======================================== */

.leisure-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin-bottom: var(--space-20);
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-4);
}

.leisure-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: linear-gradient(135deg, rgba(var(--color-teal-500-rgb), 0.05), rgba(var(--color-purple-500-rgb), 0.05));
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.leisure-item:hover {
  border-color: var(--color-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(var(--color-teal-500-rgb), 0.15);
}

.leisure-item-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-700));
  color: white;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.leisure-item-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-12);
}

.leisure-item-description {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
  display: flex;
  align-items: center;
}

.leisure-item-amount {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  display: flex;
  align-items: center;
}

.leisure-item-delete {
  padding: var(--space-8) var(--space-12);
  background: rgba(255, 84, 89, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(255, 84, 89, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.leisure-item-delete:hover {
  background: var(--color-danger);
  color: white;
  transform: scale(1.05);
}

.leisure-item-form {
  padding: var(--space-20);
  background: linear-gradient(135deg, rgba(var(--color-teal-500-rgb), 0.03), rgba(var(--color-purple-500-rgb), 0.03));
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-16);
}

.leisure-item-form .form-row {
  display: flex;
  gap: var(--space-12);
  align-items: stretch;
}

.leisure-item-form .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  justify-content: flex-start;
}

.leisure-item-form label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0;
  line-height: 1.2;
}

.leisure-item-form .form-control {
  height: 44px;
  padding: var(--space-12);
}

.leisure-item-form small {
  display: block;
  margin-top: 4px;
  line-height: 1.2;
}

.leisure-item-form .btn {
  height: 44px;
  margin-top: auto;
}

/* Responsive adjustments for leisure items */
@media (max-width: 768px) {
  /* Formulario */
  .leisure-item-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .leisure-item-form .form-group {
    width: 100% !important;
    flex: 1 !important;
  }

  .leisure-item-form .form-group label {
    visibility: visible !important;
  }

  .leisure-item-form .btn {
    width: 100%;
    margin-top: 0;
  }

  /* Items de la lista */
  .leisure-item {
    flex-wrap: wrap;
    align-items: center;
  }

  .leisure-item-icon {
    order: 1;
  }

  .leisure-item-content {
    order: 2;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .leisure-item-description {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .leisure-item-amount {
    flex-shrink: 0;
    margin-left: var(--space-8);
  }

  .leisure-item-delete {
    order: 3;
    margin-left: auto;
  }
}

/* ========================================
   FAB (Floating Action Button) - DEPRECATED
   Reemplazado por Instagram-style FAB
   ======================================== */

.fab {
  display: none !important; /* Ocultado - Usar fab-instagram en su lugar */
}

/* ========================================
   INSTAGRAM-STYLE FAB & QUICK ACTIONS
   ======================================== */

.fab-instagram {
  display: flex; /* Visible en todas las pantallas */
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(131, 58, 180, 0.4);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.fab-instagram:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 24px rgba(131, 58, 180, 0.6);
}

.fab-instagram:active {
  transform: scale(0.95) rotate(90deg);
}

@media (max-width: 768px) {
  .fab-instagram {
    bottom: 80px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}

/* Quick Actions Menu */
.quick-actions-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  transition: opacity 0.3s ease;
}

.quick-actions-menu.hidden {
  display: none;
}

.quick-actions-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.quick-actions-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-24);
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.quick-actions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-20);
}

.quick-actions-header h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0;
}

.quick-actions-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: none;
  color: var(--color-text);
  font-size: var(--font-size-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quick-actions-close:hover {
  background: var(--color-secondary-hover);
  transform: scale(1.1);
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.quick-action-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.quick-action-item:hover {
  background: var(--color-secondary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-action-item:active {
  transform: translateX(2px);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.quick-action-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.quick-action-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.quick-action-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ========================================
   QUICK EXPENSE MODAL
   ======================================== */

.modal--sm .modal__content {
  max-width: 500px;
}

/* === DELETE CONFIRMATION MODAL === */
.delete-expense-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-16);
  background: linear-gradient(135deg, rgba(255, 84, 89, 0.05), rgba(192, 21, 47, 0.05));
  border: 1px solid rgba(255, 84, 89, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-16);
}

.expense-detail {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--font-size-base);
  color: var(--color-text);
}

.expense-detail i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--color-teal-500-rgb), 0.1);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.expense-detail span {
  font-weight: var(--font-weight-medium);
}

.delete-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  background: rgba(var(--color-teal-500-rgb), 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  margin-top: var(--space-16);
}

.delete-warning i {
  color: var(--color-primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.delete-warning span {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-24);
}

.modal-actions .btn {
  flex: 1;
  justify-content: center;
  padding: var(--space-12) var(--space-20);
}

.btn--danger {
  background: linear-gradient(135deg, #FF5459, #C0152F);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn--danger:hover {
  background: linear-gradient(135deg, #C0152F, #a0111f);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(192, 21, 47, 0.3);
}

.btn--danger:active {
  transform: translateY(0);
}

.btn--danger::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn--danger:hover::before {
  width: 300px;
  height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .delete-expense-info {
    padding: var(--space-12);
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal--sm .modal__content {
    max-width: 95%;
    margin: var(--space-16);
  }

  .expense-detail {
    font-size: var(--font-size-sm);
  }

  .delete-warning {
    padding: var(--space-10);
  }

  .delete-warning span {
    font-size: var(--font-size-xs);
  }
}

.quick-templates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-bottom: var(--space-20);
  padding-bottom: var(--space-20);
  border-bottom: 1px solid var(--color-border);
}

.quick-template {
  padding: var(--space-8) var(--space-12);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.quick-template:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(var(--color-teal-500-rgb), 0.2);
}

.quick-template i {
  font-size: 0.75rem;
}

.form-control--lg {
  font-size: 1.25rem;
  padding: var(--space-12) var(--space-16);
  font-weight: 600;
}

.quick-actions {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-20);
}

.quick-actions .btn {
  flex: 1;
}

/* Empty state for templates */
.quick-templates-empty {
  text-align: center;
  padding: var(--space-16);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.quick-templates-empty i {
  font-size: 2rem;
  margin-bottom: var(--space-8);
  opacity: 0.5;
}

/* Expense Mode Selector */
.expense-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
  padding: var(--space-4);
  background: var(--color-background);
  border-radius: var(--radius-lg);
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-family: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
}

.mode-btn i {
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.mode-btn span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-primary);
}

.mode-btn small {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-4);
}

.mode-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.15);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mode-btn.active i {
  color: white;
}

.mode-btn.active span,
.mode-btn.active small {
  color: white;
}

/* Responsive: Mobile adjustments */
@media (max-width: 768px) {
  .expense-mode-selector {
    gap: var(--space-8);
    padding: var(--space-2);
  }

  .mode-btn {
    padding: var(--space-12) var(--space-8);
    min-height: 80px;
  }

  .mode-btn i {
    font-size: 1.25rem;
  }

  .mode-btn span {
    font-size: 0.85rem;
  }

  .mode-btn small {
    font-size: 0.7rem;
    display: block;
    margin-top: var(--space-2);
  }
}

@media (max-width: 480px) {
  .expense-mode-selector {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .mode-btn {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    min-height: auto;
    padding: var(--space-12);
  }

  .mode-btn i {
    font-size: 1.5rem;
    margin-right: var(--space-8);
  }

  .mode-btn span {
    font-size: 0.9rem;
  }

  .mode-btn small {
    display: none;
  }
}

/* Autocomplete Suggestions */
.input-with-autocomplete {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.autocomplete-suggestion {
  padding: var(--space-12) var(--space-16);
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--color-border);
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

.autocomplete-suggestion:hover {
  background: var(--color-primary-light);
}

.autocomplete-suggestion-text {
  font-weight: 600;
  color: var(--color-text-primary);
  display: block;
}

.autocomplete-suggestion-meta {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.autocomplete-suggestion-badge {
  padding: 2px 8px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}

/* Normal Mode Fields */
.normal-mode-fields {
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid var(--color-border);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .budget-summary-stats {
    grid-template-columns: 1fr;
  }

  .budget-setup-grid {
    grid-template-columns: 1fr;
  }

  .budget-month-selector {
    width: 100%;
    justify-content: center;
  }

  .quick-actions {
    flex-direction: column;
  }
}

/* ================================================
   PREMIUM EXPENSE FORM - ENTERPRISE LEVEL
   ================================================ */

.expense-form-premium {
  background: var(--color-surface-raised);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: var(--space-32);
}

/* Expense Form Tabs */
.expense-form-tabs {
  display: flex;
  gap: 0;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  padding: var(--space-4);
}

.expense-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-16);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.expense-tab-btn:hover {
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
}

.expense-tab-btn.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal-700) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--color-teal-500-rgb), 0.3);
}

.expense-tab-btn i {
  font-size: 1.125rem;
}

/* Form Content */
.expense-form-content {
  padding: var(--space-32);
  position: relative;
  overflow: visible;
}

/* Amount Section - Featured */
.expense-amount-section {
  text-align: center;
  padding: var(--space-32) 0;
  margin-bottom: var(--space-32);
  border-bottom: 2px solid var(--color-border);
}

.expense-amount-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-12);
  letter-spacing: 0.3px;
}

.expense-amount-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 400px;
  width: 100%;
}

.expense-currency {
  position: absolute;
  left: var(--space-20);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.expense-amount-input {
  width: 100%;
  font-size: 3rem;
  font-weight: 700;
  padding: var(--space-16) var(--space-16) var(--space-16) 60px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
  color: #1f2937;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.expense-amount-input:hover {
  border-color: #d1d5db;
  background: #ffffff;
}

.expense-amount-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: scale(1.01);
  background: #ffffff;
}

.expense-amount-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

.expense-amount-suggestions {
  display: flex;
  gap: var(--space-8);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-16);
}

.amount-suggestion-chip {
  padding: var(--space-8) var(--space-16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.amount-suggestion-chip:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-teal-500-rgb), 0.3);
}

/* Form Group Premium */
.form-group-premium {
  margin-bottom: 16px;
  position: relative;
  overflow: visible;
}

.form-label-premium {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
  font-size: 0.875rem;
}

.form-label-premium i {
  color: var(--color-primary);
  font-size: 1rem;
}

/* Input with Icon */
.input-with-icon {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface-raised);
  border: 2px solid var(--color-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.autocomplete-item {
  padding: var(--space-12) var(--space-16);
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--color-surface);
}

.autocomplete-item i {
  color: var(--color-text-secondary);
}

/* Form Grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-16);
  position: relative;
  z-index: auto;
  overflow: visible;
}

/* Category Selector Premium */
.category-selector-premium {
  position: relative;
}

.category-select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%236366f1" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
  padding-right: 48px;
}

/* ========================================
   MODERN SELECT DROPDOWNS - 2024 DESIGN
   ======================================== */

/* Base styles para todos los selects en el formulario */
select.form-input-premium,
select.form-select-premium {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Layout */
  width: 100%;
  padding: 10px 48px 10px 14px;

  /* Typography */
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.5;

  /* Background */
  background-color: #ffffff;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%236366f1" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;

  /* Border */
  border: 2px solid #e5e7eb;
  border-radius: 10px;

  /* Effects */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

/* Hover state - Elegante y sutil */
select.form-input-premium:hover,
select.form-select-premium:hover {
  border-color: #c7d2fe;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

/* Focus state - Destacado con anillo */
select.form-input-premium:focus,
select.form-select-premium:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  background-image: url('data:image/svg+xml;utf8,<svg fill="%234f46e5" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

/* Active state (mientras se abre el dropdown) */
select.form-input-premium:active,
select.form-select-premium:active {
  transform: scale(0.99);
}

/* Disabled state */
select.form-input-premium:disabled,
select.form-select-premium:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%239ca3af" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

/* Estilos para las opciones del dropdown */
select.form-input-premium option,
select.form-select-premium option {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  background-color: #ffffff;
  transition: background-color 0.2s ease;
}

/* Efecto hover en opciones (funciona en algunos navegadores) */
select.form-input-premium option:hover,
select.form-select-premium option:hover {
  background-color: #f3f4f6;
  color: #6366f1;
}

/* Opción seleccionada */
select.form-input-premium option:checked,
select.form-select-premium option:checked {
  background-color: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

/* Placeholder (primera opción vacía) */
select.form-input-premium option[value=""],
select.form-select-premium option[value=""] {
  color: #9ca3af;
  font-weight: 400;
}

/* Animación de pulso sutil al hacer focus */
@keyframes selectPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

select.form-input-premium:focus,
select.form-select-premium:focus {
  animation: selectPulse 0.6s ease-out;
}

/* Mejora para select de categorías con iconos */
.category-selector-premium select {
  font-size: 15px;
  font-weight: 500;
}

/* Estados especiales por tipo de select */
#necessity {
  /* El select de necesidad tiene estrellas, hacerlo más ancho visualmente */
  letter-spacing: 0.02em;
}

#category option,
#necessity option,
#user option {
  padding: 10px 16px;
}

/* ========================================
   MODERN TEXT & DATE INPUTS - MATCHING DESIGN
   ======================================== */

/* Inputs de texto y descripción */
input.form-input-premium:not([type="date"]),
textarea.form-input-premium {
  width: 100%;
  padding: 10px 14px;

  /* Typography */
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.5;

  /* Background */
  background-color: #ffffff;

  /* Border */
  border: 2px solid #e5e7eb;
  border-radius: 10px;

  /* Effects */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Textarea específico */
textarea.form-input-premium {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

/* Hover state para inputs */
input.form-input-premium:not([type="date"]):hover,
textarea.form-input-premium:hover {
  border-color: #c7d2fe;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

/* Focus state para inputs */
input.form-input-premium:not([type="date"]):focus,
textarea.form-input-premium:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Placeholder styling */
input.form-input-premium::placeholder,
textarea.form-input-premium::placeholder {
  color: #9ca3af;
  font-weight: 400;
  opacity: 1;
}

/* Input de fecha - Estilo especial */
input[type="date"].form-input-premium,
#date {
  width: 100%;
  padding: 10px 14px;

  /* Typography */
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.5;

  /* Background */
  background-color: #ffffff;

  /* Border */
  border: 2px solid #e5e7eb;
  border-radius: 10px;

  /* Effects */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Hover state para input de fecha */
input[type="date"].form-input-premium:hover,
#date:hover {
  border-color: #c7d2fe;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

/* Focus state para input de fecha */
input[type="date"].form-input-premium:focus,
#date:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Icono del calendario (Chrome, Edge, Safari) */
input[type="date"].form-input-premium::-webkit-calendar-picker-indicator,
#date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: opacity(0.6);
  transition: filter 0.2s ease;
}

input[type="date"].form-input-premium:hover::-webkit-calendar-picker-indicator,
#date:hover::-webkit-calendar-picker-indicator {
  filter: opacity(1);
}

/* ========================================
   CUSTOM DROPDOWN - DISEÑO MODERNO 2024
   ======================================== */

/* Ocultar los select nativos cuando hay dropdown custom */
.custom-dropdown-wrapper {
  position: relative;
  width: 100%;
  z-index: 1;
}

/* Cuando el dropdown está abierto, elevar el z-index */
.custom-dropdown-wrapper:has(.custom-dropdown-menu.open) {
  z-index: 1001;
}

.custom-dropdown-wrapper select {
  display: none;
}

/* Trigger del dropdown (el botón que se ve) */
.custom-dropdown-trigger {
  width: 100%;
  padding: 10px 48px 10px 14px;

  /* Typography */
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.5;

  /* Background */
  background-color: #ffffff;

  /* Border */
  border: 2px solid #e5e7eb;
  border-radius: 10px;

  /* Effects */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;

  /* Flexbox para alinear texto e icono */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  /* No seleccionable */
  user-select: none;
  -webkit-user-select: none;
}

/* Placeholder del dropdown */
.custom-dropdown-trigger.placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* Icono de flecha */
.custom-dropdown-trigger::after {
  content: '▼';
  color: #6366f1;
  font-size: 12px;
  transition: transform 0.3s ease, color 0.3s ease;
}

/* Hover state */
.custom-dropdown-trigger:hover {
  border-color: #c7d2fe;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

/* Focus/Open state */
.custom-dropdown-trigger.open,
.custom-dropdown-trigger:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Rotar flecha cuando está abierto */
.custom-dropdown-trigger.open::after {
  transform: rotate(180deg);
  color: #4f46e5;
}

/* Container del menú dropdown */
.custom-dropdown-menu {
  position: fixed;  /* Cambiado de absolute a fixed */
  /* top, left y width se calculan dinámicamente en JS */

  background: #ffffff;
  border: 2px solid #6366f1;
  border-radius: 12px;

  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04),
              0 0 0 1px rgba(99, 102, 241, 0.1);

  max-height: 320px;
  overflow-y: auto;

  /* Z-index muy alto para estar sobre todos los elementos */
  z-index: 99999;  /* Aumentado aún más */

  /* Animación de entrada */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado abierto del menú */
.custom-dropdown-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Scroll personalizado para el dropdown */
.custom-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 0 12px 12px 0;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Buscador dentro del dropdown */
.custom-dropdown-search {
  position: sticky;
  top: 0;
  padding: 12px;
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
  border-bottom: 1px solid #e5e7eb;
  z-index: 10;
}

.custom-dropdown-search input {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%239ca3af" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.custom-dropdown-search input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Opciones del dropdown */
.custom-dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s ease;

  display: flex;
  align-items: center;
  gap: 12px;

  font-size: 15px;
  font-weight: 500;
  color: #1f2937;

  border-left: 3px solid transparent;
  position: relative;
}

/* Emoji/icono de la opción */
.custom-dropdown-option .option-icon {
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Texto de la opción - flexible para dar espacio al botón eliminar */
.custom-dropdown-option .option-text {
  flex: 1;
}

/* Botón eliminar categoría personalizada */
.delete-custom-option {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.9);
  margin-left: auto;
}

.custom-dropdown-option:hover .delete-custom-option {
  opacity: 1;
  transform: scale(1);
}

.delete-custom-option:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: scale(1.05);
}

/* Hover en opción */
.custom-dropdown-option:hover {
  background: linear-gradient(to right, #eef2ff, #f9fafb);
  border-left-color: #6366f1;
}

.custom-dropdown-option:hover .option-icon {
  transform: scale(1.15);
}

/* Opción seleccionada */
.custom-dropdown-option.selected {
  background: linear-gradient(to right, #eef2ff, #e0e7ff);
  color: #4f46e5;
  font-weight: 600;
  border-left-color: #4f46e5;
}

/* Opción de "Agregar nueva" */
.custom-dropdown-option.add-new {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  color: #059669;
  font-weight: 600;
  border-top: 1px solid #d1fae5;
  position: sticky;
  bottom: 0;
}

.custom-dropdown-option.add-new:hover {
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  border-left-color: #059669;
}

.custom-dropdown-option.add-new .option-icon {
  color: #10b981;
  font-size: 20px;
}

/* Sin resultados */
.custom-dropdown-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.custom-dropdown-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Budget Impact Alert */
.budget-impact-alert {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
  background: linear-gradient(135deg, var(--color-cream-50) 0%, var(--color-cream-100) 100%);
  border: 2px solid var(--color-orange-400);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-24);
  animation: slideDown 0.3s ease;
}

.budget-impact-alert i {
  font-size: 1.5rem;
  color: var(--color-orange-500);
}

.budget-impact-alert span {
  color: var(--color-brown-600);
  font-weight: 600;
  font-size: 0.9375rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Expense Form Actions */
.expense-form-actions {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 2px solid var(--color-border);
}

.btn-expense-primary,
.btn-expense-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-16) var(--space-24);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
}

/* Efecto de brillo sutil en hover */
.btn-expense-primary::before,
.btn-expense-secondary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-expense-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-expense-secondary:hover::before {
  width: 300px;
  height: 300px;
  background: rgba(99, 102, 241, 0.08);
}

.btn-expense-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.25);
}

.btn-expense-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
}

.btn-expense-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-expense-primary i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-expense-primary:hover i {
  transform: scale(1.1) rotate(5deg);
}

.btn-expense-secondary {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
}

.btn-expense-secondary:hover {
  background: #f9fafb;
  color: var(--color-text-primary);
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-expense-secondary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-expense-secondary i {
  transition: transform 0.3s ease;
}

.btn-expense-secondary:hover i {
  transform: rotate(90deg);
}

/* Expense Form Stats */
.expense-form-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-16);
  margin-top: var(--space-24);
  padding: var(--space-20);
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: var(--radius-lg);
}

.form-stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-stat-item .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.form-stat-item .stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Responsive Premium Expense Form */
@media (max-width: 768px) {
  .expense-form-content {
    padding: var(--space-20);
  }

  .expense-amount-input {
    font-size: 2rem;
    padding-left: 50px;
  }

  .expense-currency {
    font-size: 1.5rem;
    left: var(--space-16);
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .expense-form-actions {
    flex-direction: column;
  }

  .expense-form-stats {
    grid-template-columns: 1fr;
  }

  .expense-tab-btn span {
    display: none;
  }

  .expense-tab-btn i {
    font-size: 1.25rem;
  }
}

/* ================================================
   PREMIUM SETTINGS / CONFIGURATION PANEL
   ================================================ */

/* Settings Layout - Desktop First Design */
.settings-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-32);
  min-height: 600px;
  margin-top: var(--space-24);
}

/* Settings Sidebar */
.settings-sidebar {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-20);
  border: 1px solid var(--color-border);
  height: fit-content;
  position: sticky;
  top: var(--space-24);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  width: 100%;
}

.settings-nav-item:hover {
  background: var(--color-surface-hover);
  transform: translateX(4px);
}

.settings-nav-item.active {
  background: var(--color-teal-300);
  color: var(--color-text);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.settings-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: #f8f9ff;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.settings-nav-item.active .settings-nav-icon {
  background: var(--color-white);
  color: var(--color-teal-600);
}

.settings-nav-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-nav-title {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  transition: color 0.3s ease;
}

.settings-nav-item.active .settings-nav-title {
  color: var(--color-slate-900);
}

.settings-nav-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
}

.settings-nav-item.active .settings-nav-subtitle {
  color: var(--color-slate-500);
}

.settings-nav-arrow {
  color: var(--color-text-tertiary);
  font-size: 14px;
  transition: all 0.3s ease;
  opacity: 0;
}

.settings-nav-item:hover .settings-nav-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.settings-nav-item.active .settings-nav-arrow {
  color: var(--color-slate-900);
  opacity: 1;
}

/* Settings Content Area */
.settings-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.settings-tab {
  display: none;
  animation: fadeIn 0.3s ease;
}

.settings-tab.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-section {
  padding: var(--space-32);
}

.settings-section-header {
  margin-bottom: var(--space-32);
  padding-bottom: var(--space-20);
  border-bottom: 1px solid var(--color-border);
}

.settings-section-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-8);
}

.settings-section-header p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
}

/* Settings Cards */
.settings-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-24);
  overflow: hidden;
  transition: all 0.3s ease;
}

.settings-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.settings-card-header {
  padding: var(--space-20) var(--space-24);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.settings-card-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.settings-card-body {
  padding: var(--space-24);
}

/* Theme Options */
.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-16);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-20);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.theme-option:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.theme-option.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-teal-600-rgb), 0.1));
  box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.2);
}

.theme-option.active::before {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.theme-preview {
  display: flex;
  gap: var(--space-8);
  padding: var(--space-12);
  border-radius: var(--radius-md);
  width: 100%;
  justify-content: center;
}

.theme-light {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.theme-dark {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

.theme-auto {
  background: linear-gradient(90deg, #f8fafc 50%, #1e293b 50%);
}

.theme-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
}

.theme-light .theme-circle:nth-child(1) { color: #0ea5e9; }
.theme-light .theme-circle:nth-child(2) { color: #14b8a6; }
.theme-light .theme-circle:nth-child(3) { color: #8b5cf6; }

.theme-dark .theme-circle:nth-child(1) { color: #38bdf8; }
.theme-dark .theme-circle:nth-child(2) { color: #2dd4bf; }
.theme-dark .theme-circle:nth-child(3) { color: #a78bfa; }

.theme-auto .theme-circle:nth-child(1) { color: #0ea5e9; }
.theme-auto .theme-circle:nth-child(2) { color: #14b8a6; }
.theme-auto .theme-circle:nth-child(3) { color: #8b5cf6; }

.theme-option span {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

/* Settings List Items */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.settings-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16);
  background: var(--color-surface-raised);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.settings-list-item:hover {
  background: var(--color-surface-hover);
}

.settings-list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 18px;
  flex-shrink: 0;
}

.settings-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-list-title {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
}

.settings-list-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Toggle Switch Premium */
.toggle-switch-premium {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  flex-shrink: 0;
}

.toggle-switch-premium input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider-premium {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 32px;
}

.toggle-slider-premium:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch-premium input:checked + .toggle-slider-premium {
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
}

.toggle-switch-premium input:checked + .toggle-slider-premium:before {
  transform: translateX(24px);
}

/* Profile Section */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  padding: var(--space-24);
}

.current-avatar {
  position: relative;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
  box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.3);
}

.avatar-edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.avatar-edit-badge:hover {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.profile-info h4 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.profile-email {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-12);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-teal-600-rgb), 0.1));
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  width: fit-content;
}

/* Stats Grid Premium */
.stats-grid-premium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-20);
}

.stat-item-premium {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-20);
  background: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.stat-item-premium:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.15);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-primary-alpha-10);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 20px;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* Form Actions Premium */
.form-actions-premium {
  display: flex;
  gap: var(--space-12);
  justify-content: flex-end;
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border);
}

/* ================================================
   RESPONSIVE DESIGN - CONFIGURATION PANEL
   ================================================ */

/* Tablet & Medium Screens (768px - 1024px) */
@media (max-width: 1024px) {
  .settings-layout {
    grid-template-columns: 280px 1fr;
    gap: var(--space-24);
  }

  .settings-section {
    padding: var(--space-24);
  }

  .stats-grid-premium {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-16);
  }
}

/* Mobile & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .settings-sidebar {
    position: static;
    padding: var(--space-16);
  }

  .settings-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .settings-nav-item {
    flex-direction: column;
    text-align: center;
    padding: var(--space-12);
    gap: var(--space-8);
  }

  .settings-nav-item:hover {
    transform: translateY(-2px);
  }

  .settings-nav-content {
    align-items: center;
  }

  .settings-nav-subtitle {
    display: none;
  }

  .settings-nav-arrow {
    display: none;
  }

  .settings-section {
    padding: var(--space-20);
  }

  .settings-section-header {
    margin-bottom: var(--space-24);
    padding-bottom: var(--space-16);
  }

  .settings-section-header h2 {
    font-size: var(--font-size-xl);
  }

  .settings-card-body {
    padding: var(--space-20);
  }

  .theme-options {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .theme-option {
    padding: var(--space-16);
  }

  .profile-avatar-section {
    flex-direction: column;
    text-align: center;
    padding: var(--space-20);
  }

  .profile-info {
    align-items: center;
  }

  .avatar-preview {
    width: 80px;
    height: 80px;
    font-size: 32px;
  }

  .stats-grid-premium {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .stat-item-premium {
    padding: var(--space-16);
  }

  .form-actions-premium {
    flex-direction: column-reverse;
  }

  .form-actions-premium .btn-premium {
    width: 100%;
    justify-content: center;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .settings-nav {
    grid-template-columns: 1fr;
  }

  .settings-nav-item {
    flex-direction: row;
    text-align: left;
    justify-content: flex-start;
  }

  .settings-nav-content {
    align-items: flex-start;
  }

  .settings-nav-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .settings-section {
    padding: var(--space-16);
  }

  .settings-card-header {
    padding: var(--space-16);
  }

  .settings-card-body {
    padding: var(--space-16);
  }

  .settings-list-item {
    padding: var(--space-12);
  }

  .settings-list-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .avatar-preview {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }

  .avatar-edit-badge {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* ================================================
   EMPTY STATES - ESTADOS VACÍOS ELEGANTES
   ================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-48) var(--space-24);
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--color-border);
  min-height: 300px;
  transition: all 0.3s ease;
}

.empty-state:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-hover);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-teal-600-rgb), 0.1));
  border-radius: 50%;
  margin-bottom: var(--space-24);
  position: relative;
}

.empty-state-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
  border-radius: 50%;
  opacity: 0.2;
  filter: blur(12px);
}

.empty-state-icon i {
  font-size: 36px;
  color: var(--color-primary);
  position: relative;
  z-index: 1;
}

.empty-state h3 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-12) 0;
}

.empty-state p {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 0 var(--space-24) 0;
  line-height: 1.6;
}

.empty-state .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-24);
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-600));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.empty-state .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.4);
}

/* Empty State Variants */
.empty-state-small {
  min-height: 200px;
  padding: var(--space-32) var(--space-20);
}

.empty-state-small .empty-state-icon {
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-16);
}

.empty-state-small .empty-state-icon i {
  font-size: 28px;
}

.empty-state-small h3 {
  font-size: var(--font-size-lg);
}

.empty-state-small p {
  font-size: var(--font-size-sm);
}

/* Responsive Empty States */
@media (max-width: 768px) {
  .empty-state {
    padding: var(--space-32) var(--space-20);
    min-height: 250px;
  }

  .empty-state-icon {
    width: 70px;
    height: 70px;
  }

  .empty-state-icon i {
    font-size: 32px;
  }

  .empty-state h3 {
    font-size: var(--font-size-lg);
  }

  .empty-state p {
    font-size: var(--font-size-sm);
  }
}

/* SOLUCIÓN: Forzar sidebar a estado correcto en desktop (min-width: 769px) */
@media (min-width: 769px) {
  .sidebar {
    transform: none !important;
    position: fixed !important;
    left: 0 !important;
  }

  .sidebar.open {
    transform: none !important;
  }

  .overlay {
    display: none !important;
  }

  .overlay.active {
    display: none !important;
  }
}

/* Estilos para Ingresos Adicionales */
.additional-incomes-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.additional-income-form {
  display: flex;
  gap: var(--space-12);
  align-items: center;
}

.btn-icon-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon-primary:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}

.additional-incomes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.additional-income-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-12);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.additional-income-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.additional-income-description {
  font-weight: 500;
  color: var(--color-text);
}

.additional-income-amount {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-success);
}

.additional-income-delete {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: var(--space-8);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.additional-income-delete:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.total-additional-income {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-12);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  border-radius: var(--radius-md);
  font-weight: 600;
  color: white;
  margin-top: var(--space-8);
}

.total-additional-income .amount {
  font-size: var(--font-size-xl);
}

/* ===================================
   MOBILE BOTTOM NAVIGATION FOR SETTINGS
   =================================== */

/* Desktop: Hide mobile navigation */
.settings-bottom-nav {
  display: none;
}

/* Mobile & Tablet: Show bottom navigation bar */
@media (max-width: 768px) {
  /* Hide desktop sidebar on mobile */
  .settings-sidebar {
    display: none;
  }

  /* Settings content takes full width on mobile */
  .settings-content {
    width: 100%;
    padding-bottom: 100px; /* Space for fixed bottom nav */
  }

  /* Bottom Navigation Container */
  .settings-bottom-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Perfect equal distribution */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--color-teal-500), var(--color-teal-600));
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    padding: 16px 0 20px; /* Increased height for comfort */
    gap: 0;
  }

  /* Individual Navigation Items */
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 4px;
    position: relative;
    gap: 4px;
  }

  .bottom-nav-item i {
    font-size: 20px;
    transition: all 0.3s ease;
  }

  .bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
  }

  /* Active state */
  .bottom-nav-item.active {
    color: var(--color-white);
  }

  .bottom-nav-item.active i {
    transform: scale(1.1);
  }

  /* Active indicator line */
  .bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--color-white);
    border-radius: 0 0 3px 3px;
  }

  /* Hover effect (for tablets with mouse) */
  .bottom-nav-item:hover:not(.active) {
    color: rgba(255, 255, 255, 0.9);
  }

  /* Active tap feedback */
  .bottom-nav-item:active {
    transform: scale(0.95);
  }
}

/* Extra small phones: Smaller text */
@media (max-width: 480px) {
  .bottom-nav-item span {
    font-size: 10px;
  }

  .bottom-nav-item i {
    font-size: 18px;
  }
}
/* === ESTILOS PARA INGRESOS EXTRAS === */
.btn-add-extra-income {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(var(--color-success-rgb, 46, 213, 115), 0.2);
}

.btn-add-extra-income:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-success-rgb, 46, 213, 115), 0.3);
}

.btn-add-extra-income i {
  font-size: 18px;
}

.extra-income-display {
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--color-info-light);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid var(--color-info);
}

.extra-income-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.extra-income-info span:first-child {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.extra-amount {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-info);
}

.btn-reset-extras {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-reset-extras:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-warning);
}

.total-income-display {
  margin-top: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 116, 97, 238), 0.2);
}

.total-income-display strong {
  font-size: var(--font-size-xs);
  font-weight: 500;
  opacity: 0.95;
}

.total-amount {
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: 1.2;
}

/* === ANIMACIONES PARA NOTIFICACIONES DE MENSAJES === */

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Scrollbar personalizado para notificaciones */
.message-notification div::-webkit-scrollbar {
  width: 6px;
}

.message-notification div::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.message-notification div::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.message-notification div::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .message-notification {
    bottom: 16px !important;
    right: 16px !important;
    left: 16px !important;
    max-width: none !important;
  }
}

/* ========================================
   COOKIE CONSENT BANNER & MODAL
   ======================================== */

/* Cookie Banner - Minimalista y elegante */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.cookie-banner__content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.cookie-banner__icon {
  font-size: 2rem;
  animation: cookieFloat 3s ease-in-out infinite;
}

@keyframes cookieFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(5deg); }
}

.cookie-banner__text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.cookie-banner__text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Botones de cookies */
.btn-cookie {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-cookie--settings {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-cookie--settings:hover {
  background: var(--color-secondary);
  color: var(--color-text);
  border-color: var(--color-primary);
}

.btn-cookie--reject {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn-cookie--reject:hover {
  background: #e5e7eb;
}

.btn-cookie--accept {
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-700));
  color: white;
  box-shadow: 0 2px 8px rgba(var(--color-teal-500-rgb), 0.3);
}

.btn-cookie--accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-teal-500-rgb), 0.4);
}

/* Cookie Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.cookie-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.cookie-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.cookie-modal__content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-modal__header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.cookie-modal__header h2 {
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
}

.cookie-modal__close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.cookie-modal__close:hover {
  background: var(--color-secondary);
  color: var(--color-text);
}

.cookie-modal__body {
  padding: 1.5rem 2rem;
}

/* Cookie Categories */
.cookie-category {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--color-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.cookie-category:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cookie-category__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.cookie-category__info h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--color-text);
}

.cookie-category__info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.cookie-category__details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.cookie-category__details small {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 28px;
}

.cookie-toggle__slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle__slider {
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-700));
}

.cookie-toggle input:checked + .cookie-toggle__slider:before {
  transform: translateX(24px);
}

.cookie-toggle--disabled .cookie-toggle__slider {
  cursor: not-allowed;
  opacity: 0.6;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-700));
}

/* Modal Footer */
.cookie-modal__footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
}

.cookie-modal__legal {
  padding: 0 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
}

/* Dark theme support */
[data-theme="dark"] .cookie-banner {
  background: rgba(17, 24, 39, 0.98);
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-cookie--settings {
  color: var(--color-text);
}

[data-theme="dark"] .btn-cookie--reject {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-banner__content {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }

  .cookie-banner__icon {
    display: none;
  }

  .cookie-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-cookie {
    width: 100%;
    justify-content: center;
  }

  .cookie-modal__content {
    width: 95%;
    margin: 1rem;
  }

  .cookie-modal__header,
  .cookie-modal__body,
  .cookie-modal__footer,
  .cookie-modal__legal {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .cookie-category__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-toggle {
    align-self: flex-end;
  }
}

/* ========================================
   LAYOUT MÓVIL FINAL - MÁXIMA PRIORIDAD
   ======================================== */
@media (max-width: 768px) {
  /* BANNER FIJO ARRIBA */
  .mobile-profile-banner {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    z-index: 1001 !important;
    margin-bottom: 0 !important;
    background: transparent !important;
    height: 140px !important; /* Solo la altura del banner */
    transform: none !important;
  }

  .mobile-banner-cover {
    height: 120px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-profile-info {
    position: absolute !important;
    top: 85px !important; /* 120px (altura banner) - 35px (mitad del avatar) = 85px */
    left: 50% !important;
    transform: translate(-50%, -50%) !important; /* Centrado perfecto */
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-avatar-container {
    width: 70px !important;
    height: 70px !important;
    margin: 0 auto !important; /* Centrar el avatar */
  }

  .mobile-avatar {
    width: 70px !important;
    height: 70px !important;
  }

  /* SIDEBAR (NAVBAR) AL PIE */
  .sidebar,
  .sidebar.open,
  .sidebar.sidebar-hidden,
  .sidebar.sidebar-visible {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    transform: translateX(0) !important;
    z-index: 1000 !important;
    background: var(--color-surface) !important;
    border-top: 1px solid var(--color-border) !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
  }

  /* Navegación horizontal */
  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: var(--space-8) 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .sidebar-nav .nav-item {
    flex-direction: column !important;
    padding: var(--space-8) var(--space-4) !important;
    min-width: 60px !important;
    font-size: 0.7rem !important;
    border-radius: 0 !important;
    background: transparent !important;
    border-left: none !important;
  }

  .sidebar-nav .nav-item i {
    font-size: 1.2rem !important;
    margin-bottom: 4px !important;
    margin-right: 0 !important;
  }

  .sidebar-nav .nav-item span {
    font-size: 0.65rem !important;
    white-space: nowrap !important;
  }

  .sidebar-nav .nav-item.active {
    background: transparent !important;
    color: var(--color-primary) !important;
  }

  /* Ocultar elementos del sidebar */
  .sidebar .nav-auth,
  .sidebar .sidebar-footer {
    display: none !important;
  }

  /* MAIN CONTENT */
  .main-content {
    margin-left: 0 !important;
    padding-bottom: 80px !important;
    padding-left: var(--space-20) !important;
    padding-right: var(--space-20) !important;
    width: 100% !important;
  }

  /* NAVBAR SUPERIOR OCULTO */
  .navbar {
    display: none !important;
  }

  /* Overlay no necesario */
  .overlay {
    display: none !important;
  }
}

/* ========================================
   LOADING SPINNER ELEGANTE
   ======================================== */
#loader-wrapper {
  /* Posición y tamaño */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;

  /* Centrado del spinner */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* Estilo y transición */
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  transition: opacity 0.5s ease;
  opacity: 1;
}

/* Clase para ocultar el loader con una transición suave */
#loader-wrapper.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;

  /* Borde "riel" gris claro */
  border: 5px solid rgba(0, 0, 0, 0.1);

  /* Borde de color que girará */
  border-top-color: var(--color-primary);

  /* Animación */
  animation: spin 1s linear infinite;
}

#loader-wrapper p {
  margin-top: 15px;
  font-weight: 500;
  color: #4a4a4a;
}

/* Animación de rotación */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modo oscuro */
body.dark-theme #loader-wrapper {
  background-color: rgba(18, 18, 18, 0.8);
}

body.dark-theme #loader-wrapper p {
  color: #e0e0e0;
}

body.dark-theme .spinner {
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
}


/* ========================================
   QUICK ACTIONS MENU - Modal FAB
   ======================================== */

.quick-action-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-action-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  width: 100%;
}

.quick-action-option:hover {
  border-color: #6366f1;
  background: linear-gradient(to right, #f9fafb, #ffffff);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.quick-action-primary {
  border-color: #ef4444;
  border-width: 3px;
}

.quick-action-primary:hover {
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 20px;
}

.quick-action-content {
  flex: 1;
}

.quick-action-content h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.quick-action-content p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #6b7280;
}

.quick-action-arrow {
  color: #9ca3af;
  font-size: 18px;
  transition: transform 0.3s ease;
}

.quick-action-option:hover .quick-action-arrow {
  transform: translateX(4px);
  color: #6366f1;
}

/* ========================================
   FAB MENU DESPLEGABLE - Botón +
   ======================================== */

.fab-quick-menu {
  position: fixed;
  bottom: 90px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-quick-menu.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.fab-menu-item:nth-child(1) { animation-delay: 0.05s; }
.fab-menu-item:nth-child(2) { animation-delay: 0.1s; }
.fab-menu-item:nth-child(3) { animation-delay: 0.15s; }
.fab-menu-item:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fab-menu-item:hover {
  transform: translateX(-8px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border-color: #6366f1;
}

.fab-menu-primary {
  border-color: #ef4444;
  border-width: 3px;
  font-weight: 600;
}

.fab-menu-primary:hover {
  border-color: #dc2626;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.fab-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  flex-shrink: 0;
}

.fab-menu-label {
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  padding-right: 4px;
}

.fab-menu-primary .fab-menu-label {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .fab-quick-menu {
    right: 16px;
    bottom: 80px;
  }
  
  .fab-menu-item {
    padding: 10px 14px;
  }
  
  .fab-menu-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .fab-menu-label {
    font-size: 14px;
  }
}

/* ========================================
   HISTORY SECTION STYLES
   ======================================== */

.history-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-16);
  padding: var(--space-4);
}

@media (max-width: 768px) {
  .history-filters {
    grid-template-columns: 1fr;
  }
}

.history-transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16);
  margin-bottom: var(--space-12);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.history-transaction-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-teal-400);
}

.history-transaction-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: var(--space-16);
}

.history-transaction-icon.gasto {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.history-transaction-icon.sueldo {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
}

.history-transaction-icon.entrada_extra {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-blue-500);
}

.history-transaction-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.history-transaction-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text);
  margin: 0;
}

.history-transaction-meta {
  display: flex;
  gap: var(--space-12);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.history-transaction-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.history-transaction-badge.gasto {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.history-transaction-badge.sueldo {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
}

.history-transaction-badge.entrada_extra {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-blue-500);
}

.history-transaction-amount {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.history-transaction-amount.positive {
  color: var(--color-success);
}

.history-transaction-amount.negative {
  color: var(--color-danger);
}

.history-empty-state {
  text-align: center;
  padding: var(--space-40);
  color: var(--color-text-secondary);
}

.history-empty-state i {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: var(--space-16);
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-teal-100);
  color: var(--color-teal-700);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
}


/* ========================================
   HISTORY SECTION - RESPONSIVE MOBILE
   ======================================== */

@media (max-width: 768px) {
  /* Filtros en columna en móvil */
  .history-filters {
    grid-template-columns: 1fr !important;
    gap: var(--space-12);
    padding: var(--space-12);
  }

  /* Items de transacción apilados en móvil */
  .history-transaction-item {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-12);
    gap: var(--space-12);
  }

  /* Icono más pequeño en móvil */
  .history-transaction-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-right: 0;
    margin-bottom: var(--space-8);
  }

  /* Info ocupa todo el ancho */
  .history-transaction-info {
    width: 100%;
  }

  /* Título más pequeño en móvil */
  .history-transaction-title {
    font-size: 14px;
    word-break: break-word;
  }

  /* Meta en columna si es necesario */
  .history-transaction-meta {
    flex-wrap: wrap;
    gap: var(--space-8);
    font-size: 12px;
  }

  /* Monto grande y destacado en móvil */
  .history-transaction-amount {
    font-size: 18px;
    width: 100%;
    text-align: right;
    margin-top: var(--space-8);
  }

  /* Badge más pequeño */
  .history-transaction-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Stats grid en columna en móvil */
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Empty state más compacto */
  .history-empty-state {
    padding: var(--space-24);
  }

  .history-empty-state i {
    font-size: 48px;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
  .history-transaction-item {
    padding: var(--space-10);
  }

  .history-transaction-title {
    font-size: 13px;
  }

  .history-transaction-meta {
    font-size: 11px;
  }

  .history-transaction-amount {
    font-size: 16px;
  }

  .history-filters {
    padding: var(--space-8);
    gap: var(--space-10);
  }

  /* Botones de filtros más pequeños */
  .history-filters .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* === FIX PARA DASHBOARD CARDS OVERFLOW === */
@media (max-width: 768px) {
  .premium-dashboard {
    overflow-x: hidden;
    max-width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
    max-width: 100%;
    overflow-x: hidden;
  }

  .chart-column,
  .cards-column {
    max-width: 100%;
    overflow-x: hidden;
  }

  .chart-container-premium {
    max-width: 100%;
    overflow-x: hidden;
    padding: var(--space-12);
  }

  .burger-chart-wrapper,
  .trend-chart-wrapper {
    max-width: 100%;
    overflow-x: hidden;
  }

  .burger-chart-wrapper canvas,
  .trend-chart-wrapper canvas {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
  }

  .card {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* === ESTILOS PARA ICONO DE IA === */
.ai-icon {
  margin-left: 8px;
  color: var(--color-primary);
  animation: sparkle-pulse 2s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

@keyframes sparkle-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Asegurar que sea visible en modo claro */
[data-theme="light"] .ai-icon,
body:not([data-theme="dark"]) .ai-icon {
  color: var(--color-primary);
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.3));
}

/* En modo oscuro un poco más brillante */
[data-theme="dark"] .ai-icon {
  color: #818cf8;
  filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.5));
}

/* === FILTROS DEL HISTORIAL COLAPSABLES === */
#historyFiltersContainer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
}

#historyFiltersContainer.show {
  max-height: 1000px;
  opacity: 1;
  display: grid !important;
}

#toggleHistoryFilters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

#toggleHistoryFilters:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

#toggleHistoryFilters i {
  transition: transform 0.3s ease;
}

#toggleHistoryFilters.active i {
  transform: rotate(180deg);
}

#tourOverlay {
  display: none !important;
}

/* ========================================
   TERMS ACCEPTANCE MODAL STYLES
   ======================================== */

.terms-modal {
  z-index: 10000 !important;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.8);
}

.terms-content {
  max-width: 650px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.terms-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.terms-icon {
  font-size: 60px;
  margin-bottom: 15px;
  animation: bounceIn 0.8s ease;
}

.terms-header h2 {
  margin: 0 0 10px 0;
  font-size: 1.8em;
  font-weight: 600;
}

.terms-subtitle {
  margin: 0;
  font-size: 1em;
  opacity: 0.95;
  font-weight: 400;
}

.terms-body {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.terms-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 20px;
}

.terms-scroll-area::-webkit-scrollbar {
  width: 8px;
}

.terms-scroll-area::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.terms-scroll-area::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.terms-scroll-area h3 {
  color: #667eea;
  font-size: 1.2em;
  margin: 20px 0 10px 0;
}

.terms-scroll-area h3:first-child {
  margin-top: 0;
}

.terms-scroll-area ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.terms-scroll-area li {
  padding: 8px 0 8px 30px;
  position: relative;
  line-height: 1.6;
  color: #555;
}

.terms-scroll-area li::before {
  content: attr(data-icon);
  position: absolute;
  left: 0;
  top: 8px;
}

.terms-scroll-area p {
  color: #666;
  line-height: 1.6;
  margin: 10px 0;
}

.terms-full-link {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 12px;
  text-align: center;
}

.terms-full-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.terms-full-link a:hover {
  text-decoration: underline;
}

.terms-checkbox-container {
  border-top: 2px solid #eee;
  padding-top: 20px;
}

.terms-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.terms-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-text {
  font-size: 0.95em;
  color: #333;
  line-height: 1.5;
}

.checkbox-text a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.checkbox-text a:hover {
  text-decoration: underline;
}

.terms-actions {
  display: flex;
  gap: 12px;
  padding: 20px 30px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.btn-accept {
  flex: 1;
  padding: 15px;
  font-size: 1.05em;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: #ccc;
  color: white;
  border: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-accept.enabled {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  opacity: 1;
}

.btn-accept.enabled:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-decline {
  padding: 15px 25px;
  font-size: 1em;
  border-radius: 12px;
  background: white;
  color: #666;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-decline:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.terms-footer {
  text-align: center;
  font-size: 0.85em;
  color: #999;
  margin: 0;
  padding: 0 30px 20px;
}

/* Animación de entrada */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .terms-content {
    width: 95%;
    max-height: 95vh;
  }

  .terms-header {
    padding: 20px;
  }

  .terms-icon {
    font-size: 45px;
  }

  .terms-header h2 {
    font-size: 1.4em;
  }

  .terms-body {
    padding: 20px;
  }

  .terms-actions {
    flex-direction: column;
    padding: 15px 20px;
  }

  .btn-decline {
    width: 100%;
  }
}