/* Shared consolidated stylesheet */

/* ── Google Fonts: Inter ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Site-wide footer ── */
.site-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
    border-top: 1px solid var(--border);
    background: #f0f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.site-footer a {
    color: #1976d2;
    text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

:root {
  /* Brand Colors - Unified Palette */
  --brand-primary: #004b87;      /* Navy blue - navigation, headers */
  --brand-primary-light: #0066a1;
  --brand-primary-dark: #003a6b;
  --brand-accent: #1fa463;       /* Green - positive values */
  --brand-accent-light: #c8f7e5;
  --brand-accent-dark: #16854f;
  --brand-secondary: #1976d2;    /* Blue - links, secondary actions */
  --brand-secondary-light: #42a5f5;
  
  /* Legacy mappings (for backward compatibility) */
  --primary: var(--brand-primary);
  --primary-light: var(--brand-primary-light);
  --accent: var(--brand-secondary);
  --accent-light: #e3f2fd;
  --success: var(--brand-accent);
  --danger: #d63939;
  --warning: #f59e0b;
  
  /* Neutrals - Improved Contrast */
  --background: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #f8fafd;        /* Tinted bg for sidebar/nested cards */
  --border: #e0e8f2;
  --border-subtle: #edf1f7;      /* For table rows, dividers */
  --text-primary: #1a202c;       /* Darker for better contrast */
  --text-secondary: #374151;     /* Improved readability */
  --text-tertiary: #6b7280;
  --text-caption: #9ca3af;       /* For timestamps, notes */
  
  /* Table */
  --table-header: #e8eef5;
  --table-row-alt: #f7fafd;
  --table-hover: #edf4fb;
  
  /* Typography & Spacing */
  --font-base: 1rem;
  --font-sm: 0.875rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  
  /* Spacing Scale (consistent 4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-7: 1.75rem;   /* 28px */
  --space-8: 2rem;      /* 32px */
  --space-9: 2.25rem;   /* 36px */
  --space-10: 2.5rem;   /* 40px */
  --space-11: 2.75rem;  /* 44px */
  --space-12: 3rem;     /* 48px */
  
  /* Section Spacing */
  --section-gap: var(--space-8);       /* Between major sections */
  --card-padding: var(--space-6);      /* Inside cards */
  --card-gap: var(--space-5);          /* Between cards */
  --content-gap: var(--space-4);       /* Between content items */
  
  /* Visual Effects */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  /* Unified shadows — all use brand navy rgba(0,75,135,…) */
  --shadow-sm:   0 1px 3px rgba(0,75,135,0.07);
  --shadow-md:   0 4px 12px rgba(0,75,135,0.10);
  --shadow-lg:   0 8px 28px rgba(0,75,135,0.14);
  --shadow-card: 0 4px 20px rgba(0,75,135,0.09), 0 1px 4px rgba(0,75,135,0.05);
  --shadow-hover:0 12px 40px rgba(0,75,135,0.16), 0 4px 10px rgba(0,75,135,0.08);
  --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 250ms cubic-bezier(0.4,0,0.2,1);
}
/* Base Styles */
html { box-sizing: border-box; height: 100%; scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: inherit; }
body { 
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(135deg, #f4f7fb 0%, #e8eef5 100%);
  color: var(--text-secondary); 
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif; 
  font-size: var(--font-base); line-height: 1.6; 
  -webkit-font-smoothing: antialiased; 
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { 
  font-family: inherit; font-weight: 600; color: var(--text-primary); 
  margin: 0; line-height: 1.3; letter-spacing: -0.02em;
}
/* Typography Scale - Consistent Hierarchy */
h1, .page-title { 
  font-size: 2rem;      /* 32px - Page titles */
  font-weight: 700; 
  letter-spacing: -0.03em;
}
h2, .section-title { 
  font-size: 1.5rem;    /* 24px - Section titles */
  font-weight: 600;
}
h3, .card-title { 
  font-size: 1.125rem;  /* 18px - Card titles */
  font-weight: 600;
}
h4, .subsection-title {
  font-size: 1rem;      /* 16px - Subsection titles */
  font-weight: 600;
}
h5 { font-size: 0.875rem; font-weight: 600; }
h6 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Responsive Typography */
@media (max-width: 720px) {
  h1, .page-title { font-size: 1.75rem; }
  h2, .section-title { font-size: 1.25rem; }
  h3, .card-title { font-size: 1rem; }
}
@media (max-width: 480px) {
  h1, .page-title { font-size: 1.5rem; }
  h2, .section-title { font-size: 1.125rem; }
}

p { margin: 0 0 var(--space-4) 0; line-height: 1.7; }
a { color: var(--brand-secondary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-secondary-light); text-decoration: underline; }
small, .small-text { font-size: var(--font-sm); color: var(--text-tertiary); }
.text-muted { color: var(--text-tertiary); }
.text-caption { font-size: 0.75rem; color: var(--text-caption); }

/* Typography Utilities */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-success { color: var(--brand-accent) !important; }
.text-danger { color: var(--danger) !important; }
.text-bold { font-weight: 600; }
.text-semibold { font-weight: 500; }
.text-normal { font-weight: 400; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.text-nowrap { white-space: nowrap; }

/* Number/Data Display */
.data-value {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.data-value-lg {
  font-size: 1.5rem;
  font-weight: 700;
}
.data-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Layout */
.page-wrap { 
  flex: 1;
  max-width: 1600px; 
  margin: 0 auto; 
  padding: var(--space-8) var(--space-6) var(--space-12); 
}
@media (max-width: 900px) { 
  .page-wrap { padding: var(--space-6) var(--space-4) var(--space-10); } 
}
@media (max-width: 720px) { 
  .page-wrap { padding: var(--space-5) var(--space-3) var(--space-8); } 
}
@media (max-width: 480px) { 
  .page-wrap { padding: var(--space-4) var(--space-2) var(--space-6); } 
}

/* Section Spacing */
.section-spacing { margin-bottom: var(--section-gap); }
.section-spacing:last-child { margin-bottom: 0; }

/* Cards & Containers */
.card, .section-card, .top-table-container, .fondos-compare-container, .indicator-card { 
  background: var(--surface); 
  border: 1.5px solid var(--border); 
  border-radius: var(--radius-xl); 
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  margin-bottom: var(--card-gap);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:last-child, .section-card:last-child { margin-bottom: 0; }
.card:hover, .section-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* Card hierarchy */
.card-primary {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card-secondary {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  transition: box-shadow var(--transition-base);
}
.card-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
  padding: var(--space-3) var(--space-4);
}

/* CTA Button */
.btn-cta {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.btn-cta:hover {
  background: var(--brand-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-cta:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Typography */
.heading-compact { font-size:1.25rem; font-weight:600; letter-spacing:-0.5px; margin:0 0 .9rem 0; color:#22314a; }
.text-center { text-align:center; }
.small-note { font-size:var(--font-sm); color:#666; }

/* Tables */
.table-base { width: 100%; border-collapse: collapse; border-spacing: 0; border: none; }
.table-base th { 
  background: transparent;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--brand-primary);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
}
.table-base td { padding: 0.75rem; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table-base tr:last-child td { border-bottom: none; }
.table-base tbody tr { transition: background var(--transition-fast); }
.table-base tbody tr:hover { background: var(--accent-light); transform: none; }

/* Buttons */
button, .btn { 
  font-family: inherit; font-size: var(--font-base); font-weight: 600; 
  padding: 0.5rem 1rem; border-radius: var(--radius-md); border: none;
  cursor: pointer; transition: all var(--transition-base);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--primary); color: #fff; box-shadow: var(--shadow-sm);
}
button:hover, .btn:hover { background: var(--primary-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Inputs */
input, select, textarea { 
  font-family: inherit; padding: 0.5rem 0.75rem; 
  border: 1px solid var(--border); border-radius: var(--radius-sm); 
  background: var(--surface); color: var(--text-secondary);
  transition: all var(--transition-fast);
}
input:hover, select:hover, textarea:hover { border-color: #d0d6de; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { background: var(--background); opacity: 0.6; cursor: not-allowed; }

/* Utility Classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Gap Utilities */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Margin Utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.my-6 { margin-top: var(--space-6); margin-bottom: var(--space-6); }

/* Padding Utilities */
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.no-wrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }

/* Status Colors */
.positive, .cell-positive { color: var(--success) !important; font-weight: 600; }
.negative, .cell-negative { color: var(--danger) !important; font-weight: 600; }

/* Badges */
.badge { 
  background: #e3f2fd; color: #1976d2; font-size: var(--font-sm); 
  font-weight: 600; padding: 0.25rem 0.5rem; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.pill-indicator { 
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.12em 0.5em; border-radius: var(--radius-full); font-weight: 600;
  font-size: var(--font-sm); min-width: 2.1em; box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.pill-indicator:hover { transform: scale(1.05); }
.pill-green { background: #c8f7e5; color: #1a4d1a; border: 1px solid #1a4d1a; }
.pill-red { background: #ffe0e0; color: #a12a2a; border: 1px solid #a12a2a; }

/* Animations & Micro-interactions */
@keyframes skeleton-loading { 
  0% { background-position: 200% 0; } 
  100% { background-position: -200% 0; } 
}
@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(10px); } 
  to { opacity: 1; transform: translateY(0); } 
}
@keyframes fadeInUp { 
  from { opacity: 0; transform: translateY(20px); } 
  to { opacity: 1; transform: translateY(0); } 
}
@keyframes fadeInScale { 
  from { opacity: 0; transform: scale(0.95); } 
  to { opacity: 1; transform: scale(1); } 
}
@keyframes pulse { 
  0%, 100% { opacity: 1; } 
  50% { opacity: 0.6; } 
}
@keyframes pulseGlow { 
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 164, 99, 0.4); } 
  50% { box-shadow: 0 0 0 8px rgba(31, 164, 99, 0); } 
}
@keyframes pulseGlowDanger { 
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 57, 57, 0.4); } 
  50% { box-shadow: 0 0 0 8px rgba(214, 57, 57, 0); } 
}
@keyframes highlightFlash { 
  0% { background-color: rgba(31, 164, 99, 0.3); } 
  100% { background-color: transparent; } 
}
@keyframes highlightFlashDanger { 
  0% { background-color: rgba(214, 57, 57, 0.3); } 
  100% { background-color: transparent; } 
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Skeleton Loaders */
.skeleton { 
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); 
  background-size: 200% 100%; 
  animation: skeleton-loading 1.5s infinite; 
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; }
.skeleton-card { height: 120px; }
.skeleton-row { height: 48px; margin-bottom: 8px; }

/* Fade Animations */
.fade-in { animation: fadeIn 0.4s ease-out; }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }
.fade-in-scale { animation: fadeInScale 0.3s ease-out; }

/* Staggered Animation for Lists */
.stagger-in > * { 
  opacity: 0; 
  animation: fadeInUp 0.4s ease-out forwards; 
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(n+7) { animation-delay: 0.35s; }

/* Pulse Effects for Real-time Data */
.pulse { animation: pulse 2s ease-in-out infinite; }
.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
.pulse-glow-danger { animation: pulseGlowDanger 2s ease-in-out infinite; }

/* Data Update Highlights */
.data-updated { animation: highlightFlash 1.5s ease-out; }
.data-updated-danger { animation: highlightFlashDanger 1.5s ease-out; }

/* Value Change Indicators */
.value-up { 
  color: var(--brand-accent) !important;
  animation: bounce 0.3s ease-out;
}
.value-down { 
  color: var(--danger) !important;
  animation: bounce 0.3s ease-out;
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

/* Shimmer Effect for Loading States */
.shimmer {
  background: linear-gradient(90deg, 
    var(--background) 0%, 
    #fff 50%, 
    var(--background) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Hover Micro-interactions */
.hover-lift { transition: transform var(--transition-base), box-shadow var(--transition-base); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.hover-grow { transition: transform var(--transition-fast); }
.hover-grow:hover { transform: scale(1.02); }

.hover-glow { transition: box-shadow var(--transition-base); }
.hover-glow:hover { box-shadow: 0 0 20px rgba(0, 75, 135, 0.15); }

/* Interactive Button States */
.btn-interactive {
  position: relative;
  overflow: hidden;
}
.btn-interactive::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}
.btn-interactive:active::after {
  width: 200px;
  height: 200px;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Scrollbars */
.scroll-x, .scroll-y { overflow: auto; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar, .scroll-y::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-x::-webkit-scrollbar-track, .scroll-y::-webkit-scrollbar-track { background: var(--background); border-radius: var(--radius-full); }
.scroll-x::-webkit-scrollbar-thumb, .scroll-y::-webkit-scrollbar-thumb { background: #d0d6de; border-radius: var(--radius-full); }
.scroll-x::-webkit-scrollbar-thumb:hover, .scroll-y::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* Utilities */
.hide-empty:empty { display: none; }
.hr-accent { border: none; border-top: 2px solid var(--border); margin: 0.75rem 0 1.5rem; }

/* ========================================
   DATA VISUALIZATION ENHANCEMENTS
   ======================================== */

/* Mini Sparkline Container */
.sparkline-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sparkline {
  display: inline-block;
  width: 60px;
  height: 20px;
  vertical-align: middle;
}
.sparkline-lg {
  width: 80px;
  height: 28px;
}
.sparkline svg {
  width: 100%;
  height: 100%;
}
.sparkline-up { color: var(--brand-accent); }
.sparkline-down { color: var(--danger); }
.sparkline-neutral { color: var(--text-tertiary); }

/* Fund Type Badges - Color Coded */
.fund-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.fund-badge-abierto {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.fund-badge-cerrado {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  color: #e65100;
  border: 1px solid #ffcc80;
}
.fund-badge-mixto {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1565c0;
  border: 1px solid #90caf9;
}
.fund-badge-renta-fija {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
  color: #c2185b;
  border: 1px solid #f48fb1;
}
.fund-badge-renta-variable {
  background: linear-gradient(135deg, #ede7f6 0%, #d1c4e9 100%);
  color: #5e35b1;
  border: 1px solid #b39ddb;
}
.fund-badge-desarrollo {
  background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
  color: #00695c;
  border: 1px solid #80cbc4;
}
.fund-badge-liquidez {
  background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
  color: #3949ab;
  border: 1px solid #9fa8da;
}

/* Currency Badges */
.currency-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
}
.currency-dop {
  background: #e8f5e9;
  color: #1b5e20;
}
.currency-usd {
  background: #e3f2fd;
  color: #0d47a1;
}

/* Trend Indicator Arrows */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.trend-up {
  color: var(--brand-accent);
}
.trend-up::before {
  content: '▲';
  font-size: 0.7em;
}
.trend-down {
  color: var(--danger);
}
.trend-down::before {
  content: '▼';
  font-size: 0.7em;
}
.trend-neutral {
  color: var(--text-tertiary);
}
.trend-neutral::before {
  content: '―';
  font-size: 0.8em;
}

/* Performance Bar (Mini Chart) */
.perf-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}
.perf-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.perf-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
}
.perf-bar-fill.positive {
  background: linear-gradient(90deg, var(--brand-accent-light), var(--brand-accent));
}
.perf-bar-fill.negative {
  background: linear-gradient(90deg, #ffcdd2, var(--danger));
}
.perf-bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* Comparison Indicator */
.comparison-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}
.comparison-better {
  background: var(--brand-accent-light);
  color: var(--brand-accent-dark);
}
.comparison-worse {
  background: #ffebee;
  color: var(--danger);
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
   
/* Dark Mode Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 1.2rem;
}
.theme-toggle:hover {
  background: var(--background);
  transform: rotate(15deg);
}
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

/* Dark Mode Variables */
[data-theme="dark"] {
  --background: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --table-header: #1e293b;
  --table-row-alt: #1e293b;
  --table-hover: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .card,
[data-theme="dark"] .section-card,
[data-theme="dark"] .top-table-container,
[data-theme="dark"] .fondos-compare-container {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .fund-badge-abierto {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #95d5b2;
  border-color: #40916c;
}

[data-theme="dark"] .fund-badge-cerrado {
  background: linear-gradient(135deg, #7c2d12 0%, #9a3412 100%);
  color: #fed7aa;
  border-color: #ea580c;
}

[data-theme="dark"] .currency-dop {
  background: #14532d;
  color: #86efac;
}

[data-theme="dark"] .currency-usd {
  background: #1e3a5f;
  color: #93c5fd;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
}

/* Auto Dark Mode disabled — light theme enforced site-wide */
