/* ============================================================
   TERMINAL FINTECH & ESPECTÁCULO DE NÚMEROS MACROECONÓMICOS
   Termómetro Económico de España • Banco de España & Eurostat
   ============================================================ */

:root {
  --primary: #ff8507;
  --primary-hover: #e07400;
  --primary-glow: rgba(255, 133, 7, 0.35);
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.3);
  --amber: #f59e0b;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);

  --bg-body: #080c14;
  --bg-card: #0f172a;
  --bg-card-alt: #131d35;
  --bg-card-hover: #17233f;
  --bg-input: #131d35;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.18);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 24px rgba(255, 133, 7, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(255, 133, 7, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: var(--font-mono);
}

.main-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ============================================================
   1. TICKER TAPE FINANCIERO SUPERIOR EN DIRECTO
   ============================================================ */
.financial-ticker-bar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

.ticker-inner {
  display: flex;
  align-items: center;
  max-width: 100%;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 133, 7, 0.15);
  color: #ff8507;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 133, 7, 0.3);
  flex-shrink: 0;
}

.live-dot-pulse {
  width: 7px;
  height: 7px;
  background-color: #ff8507;
  border-radius: 50%;
  animation: pulse-ticker 1.5s infinite;
}

@keyframes pulse-ticker {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #ff8507; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.ticker-viewport {
  overflow: hidden;
  width: 100%;
  white-space: nowrap;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  gap: 1.5rem;
  padding: 0.45rem 1rem;
  animation: ticker-slide 45s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ticker-item strong {
  color: var(--text-main);
  font-weight: 600;
}

.t-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.t-speed {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #f87171;
  font-weight: 700;
}

.t-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-card-alt);
  color: var(--text-dim);
}

.t-badge.t-boe { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.t-badge.t-bce { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.t-badge.t-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.t-badge.t-curr { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.t-badge.t-legal { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* ============================================================
   2. HERO & CABECERA
   ============================================================ */
.tool-hero {
  margin-bottom: 2rem;
}

.hero-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-main-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 860px;
  line-height: 1.6;
}

/* ============================================================
   3. GRAN TERMINAL FINTECH: RELOJ DE DEUDA Y ODÓMETRO
   ============================================================ */
.fintech-terminal-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(239, 68, 68, 0.1);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.fintech-terminal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444, #ff8507, #f59e0b);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.terminal-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.live-stream-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.live-core-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px #ef4444;
  animation: pulse-ring 1.5s infinite;
}

.terminal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.terminal-source-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.odometer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 820px) {
  .odometer-grid {
    grid-template-columns: 1fr;
  }
}

.odometer-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.odometer-box:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

.main-debt-box {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06) 0%, var(--bg-card) 100%);
}

.citizen-debt-box {
  border-color: rgba(255, 133, 7, 0.35);
  background: linear-gradient(180deg, rgba(255, 133, 7, 0.06) 0%, var(--bg-card) 100%);
}

.odo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.odo-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.odo-rate-badge {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.rate-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.rate-warning {
  background: rgba(255, 133, 7, 0.2);
  color: #ff8507;
  border: 1px solid rgba(255, 133, 7, 0.3);
}

.odo-value-display {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.1);
}

.citizen-debt-box .odo-value-display {
  color: #f87171;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.odo-sub-stats {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.odo-sub-stats strong {
  color: var(--text-main);
}

/* Tira de velocidad */
.debt-velocity-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 950px) {
  .debt-velocity-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .debt-velocity-strip {
    grid-template-columns: 1fr;
  }
}

.velocity-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.velocity-item.highlight-session {
  background: rgba(255, 133, 7, 0.1);
  border-color: rgba(255, 133, 7, 0.35);
}

.v-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

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

.v-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.v-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-warning { color: #ff8507 !important; }
.text-danger { color: #f87171 !important; }
.text-success { color: #34d399 !important; }

/* Cinta de intereses */
.debt-interest-ribbon {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.interest-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.debt-interest-ribbon strong {
  color: var(--text-main);
}

/* ============================================================
   4. TACÓMETROS Y MEDIDORES RADIALES / TERMÓMETROS
   ============================================================ */
.gauges-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .gauges-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.gauge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.gauge-title-box {
  display: flex;
  flex-direction: column;
}

.gauge-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  width: fit-content;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  margin-bottom: 0.25rem;
}

.gauge-header h4 {
  font-size: 1rem;
  font-weight: 800;
}

.gauge-live-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
}

.gauge-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}

.gauge-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  overflow: visible;
}

.gauge-footer-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.g-stat strong {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* Termómetro líquido vertical */
.thermo-gauge-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.thermometer-bar-container {
  padding: 1.25rem 0;
  display: flex;
  justify-content: center;
}

.thermo-track {
  width: 100%;
  height: 28px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: visible;
  padding: 3px;
}

.thermo-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  border-radius: var(--radius-full);
  position: relative;
  transition: width 1s ease-in-out;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.thermo-mark-line {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: #ffffff;
  z-index: 10;
}

.thermo-mark-line.mark-60 {
  left: 37.5%; /* 60% en escala 0-160% */
}

.mark-label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 800;
  color: #34d399;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.thermo-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ============================================================
   5. CALCULADORA DE IMPACTO FAMILIAR
   ============================================================ */
.family-impact-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.family-impact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.badge-pill-cyan {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
  margin-bottom: 0.4rem;
}

.impact-title-group h3 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.impact-title-group p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 720px;
}

.family-members-selector {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-family-pill {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-family-pill:hover, .btn-family-pill.active {
  background: #06b6d4;
  color: #fff;
  border-color: #06b6d4;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

.family-results-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 850px) {
  .family-results-hud {
    grid-template-columns: 1fr;
  }
}

.family-hud-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.family-hud-box.highlight-orange {
  border-color: rgba(255, 133, 7, 0.4);
  background: rgba(255, 133, 7, 0.05);
}

.f-hud-lbl {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.f-hud-val {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.family-hud-box.highlight-orange .f-hud-val {
  color: #ff8507;
}

.f-hud-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   6. COMPARADOR DE EUROSTAT Y UNIÓN EUROPEA
   ============================================================ */
.europe-debt-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.eurostat-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  margin-bottom: 0.4rem;
}

.section-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.section-sub-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 820px;
}

/* Pestañas de Navegación Eurostat */
.eurostat-tabs-container {
  margin: 1rem 0 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
}

.eurostat-nav-tabs {
  display: flex;
  gap: 0.45rem;
  min-width: max-content;
}

.btn-eurostat-tab {
  min-height: 42px;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-eurostat-tab .tab-icon {
  font-size: 1rem;
}

.btn-eurostat-tab:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.btn-eurostat-tab.active {
  background: linear-gradient(135deg, rgba(255, 133, 7, 0.22) 0%, rgba(255, 133, 7, 0.06) 100%);
  color: #ff8507;
  border-color: #ff8507;
  box-shadow: 0 0 16px rgba(255, 133, 7, 0.25);
}

/* Tarjeta Hero de Eurostat */
.eurostat-hero-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, var(--bg-card-alt) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .eurostat-hero-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .eurostat-hero-card {
    grid-template-columns: 1fr;
  }
}

.eurostat-hero-item {
  display: flex;
  flex-direction: column;
  padding: 0.4rem;
}

.eurostat-hero-item.highlight-rank {
  border-left: 3px solid #ff8507;
  padding-left: 0.85rem;
}

.euro-hero-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.euro-hero-val {
  font-size: 1.55rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.2;
}

.euro-hero-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Toolbar de Métricas */
.eurostat-metric-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.95rem;
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.metric-toolbar-left {
  font-size: 0.85rem;
  color: var(--text-main);
}
.metric-toolbar-left strong {
  color: var(--primary);
}

.metric-toggle-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-metric-toggle {
  min-height: 38px;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-metric-toggle:hover, .btn-metric-toggle.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.europe-chart-card {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-notes-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1rem;
  flex-wrap: wrap;
}

.note-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.dot-spain { background-color: #ff8507; }
.dot-limit { background-color: #ef4444; }
.dot-europe { background-color: #3b82f6; }

.badge-maastricht {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-maastricht.badge-ok {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-maastricht.badge-warn {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-maastricht.badge-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Widget 1 a 1 */
.vs-comparator-card {
  background: linear-gradient(135deg, rgba(255, 133, 7, 0.08), rgba(255, 133, 7, 0.02));
  border: 1px solid rgba(255, 133, 7, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.vs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.vs-title-area {
  display: flex;
  flex-direction: column;
}

.vs-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ff8507;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.vs-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
}

.vs-selector-box {
  min-width: 220px;
}

.vs-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .vs-cards-grid {
    grid-template-columns: 1fr;
  }
}

.vs-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  text-align: center;
}

.vs-item-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.vs-item-val {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--text-main);
  line-height: 1.2;
}

.vs-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Tabla europea */
.europe-table-card {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.table-date-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rates-table th,
.rates-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.rates-table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--bg-card);
}

.row-highlight {
  background-color: rgba(255, 133, 7, 0.12) !important;
  font-weight: 700;
}

.pill-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.status-ok { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-warn { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-danger { background-color: rgba(239, 68, 68, 0.15); color: #f87171; }

/* ============================================================
   7. MATRIZ BENTO-GRID DE INDICADORES MACROECONÓMICOS
   ============================================================ */
.macro-matrix-section {
  margin-bottom: 2rem;
}

.section-header-simple {
  margin-bottom: 1.25rem;
}

.section-header-simple h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.section-header-simple p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 950px) {
  .indicators-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .indicators-grid {
    grid-template-columns: 1fr;
  }
}

.indicator-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.indicator-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
}

.ind-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.ind-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ind-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-color);
}

.badge-blue { color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.badge-amber { color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.badge-purple { color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }
.badge-green { color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.badge-cyan { color: #22d3ee; border-color: rgba(6, 182, 212, 0.3); }

.ind-val {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.ind-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.ind-impact {
  font-size: 0.76rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  line-height: 1.35;
}

.impact-variable { background-color: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.impact-monetary { background-color: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.impact-market { background-color: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.impact-legal { background-color: rgba(16, 185, 129, 0.1); color: #34d399; }
.impact-currency { background-color: rgba(6, 182, 212, 0.1); color: #22d3ee; }

/* ============================================================
   8. GRÁFICO HISTÓRICO
   ============================================================ */
.chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.chart-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-series-pills {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill-legend-euribor { color: #3b82f6; }
.pill-legend-bce { color: #f59e0b; }

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 280px;
}

/* ============================================================
   9. MODALES Y FORMULARIOS
   ============================================================ */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.app-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}

.app-modal.is-active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 1.35rem;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.92rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card-alt);
}

.btn-modal-secondary {
  min-height: 40px;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-primary {
  min-height: 40px;
  padding: 0.5rem 1.35rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.input-control {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.select-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

/* Estilos de Metadatos y Rigor Estadístico */
.badge-calculated-equiv {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  cursor: help;
}

.period-pill-inline {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  margin-left: 0.35rem;
}

.methodology-note-banner {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-left: 3px solid #3b82f6;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.methodology-note-banner strong {
  color: #93c5fd;
}

.smi-triplet-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

@media (max-width: 640px) {
  .smi-triplet-box {
    grid-template-columns: 1fr;
  }
}

.smi-triplet-item {
  display: flex;
  flex-direction: column;
}

.smi-triplet-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.smi-triplet-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.15rem 0;
}

.smi-triplet-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .financial-ticker-bar, .app-header, .tools-ad-banner-section, .tool-ad-sidebar, .app-modal .modal-footer, .app-modal .btn-close-modal {
    display: none !important;
  }
  .fintech-terminal-card, .europe-debt-section, .family-impact-card, .indicator-card, .chart-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
