/* ==========================================================================
   UF HOY - HIGH-END SAAS COCKPIT DESIGN SYSTEM (v2.0)
   Inspirado en la estética original de UTM Hoy combinada con diseño SaaS moderno
   (Linear / Stripe / Vercel / Bloomberg FinTech)
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Paleta Modo Claro */
  --bg-app: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #10b981;
  --text-primary: #090d16;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-primary: #059669;
  --accent-primary-hover: #047857;
  --accent-primary-glow: rgba(16, 185, 129, 0.2);
  --accent-cyan: #0284c7;
  --accent-red: #dc2626;
  --accent-red-glow: rgba(220, 38, 38, 0.15);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --chart-stroke: #059669;
  --chart-fill-start: rgba(5, 150, 105, 0.25);
  --chart-fill-end: rgba(5, 150, 105, 0.0);
}

html.dark {
  /* Paleta Modo Oscuro - Pure Obsidian Cyber SaaS */
  --bg-app: #030712;
  --bg-surface: #080d1a;
  --bg-surface-elevated: #0f172a;
  --bg-card: rgba(10, 16, 28, 0.88);
  --bg-card-subtle: rgba(15, 23, 42, 0.65);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #10b981;
  --accent-primary-hover: #34d399;
  --accent-primary-glow: rgba(16, 185, 129, 0.35);
  --accent-cyan: #38bdf8;
  --accent-red: #f43f5e;
  --accent-red-glow: rgba(244, 63, 94, 0.25);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.6);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.8);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);
  
  --chart-stroke: #10b981;
  --chart-fill-start: rgba(16, 185, 129, 0.3);
  --chart-fill-end: rgba(16, 185, 129, 0.0);
}

/* Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* ==========================================================================
   UNIVERSO CÓSMICO: STARFIELDS Y SHOOTING STARS
   ========================================================================== */
.starfield {
  display: none;
}

html.dark .starfield,
body.dark .starfield {
  display: block;
  position: fixed;
  width: 800%;
  height: 800%;
  top: -350%;
  left: -350%;
  pointer-events: none;
  background-repeat: repeat;
  transform-origin: 150% 150%;
  animation: rotate-galaxy linear infinite;
  z-index: 0;
}

#starfield1 {
  background-image: url('data:image/svg+xml,<svg width="1000" height="1000" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="stars1" patternUnits="userSpaceOnUse" width="1000" height="1000"><circle fill="rgba(255,255,255,0.45)" cx="100" cy="100" r="1"></circle><circle fill="rgba(255,255,255,0.45)" cx="500" cy="300" r="1"></circle><circle fill="rgba(255,255,255,0.45)" cx="900" cy="600" r="1"></circle><circle fill="rgba(255,255,255,0.45)" cx="300" cy="800" r="1"></circle><circle fill="rgba(56,189,248,0.4)" cx="700" cy="200" r="1.2"></circle></pattern></defs><rect width="100%" height="100%" fill="url(%23stars1)"/></svg>');
  animation-duration: 3600s;
}

#starfield2 {
  background-image: url('data:image/svg+xml,<svg width="800" height="800" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="stars2" patternUnits="userSpaceOnUse" width="800" height="800"><circle fill="rgba(255,255,255,0.65)" cx="200" cy="400" r="1.2"></circle><circle fill="rgba(255,255,255,0.65)" cx="600" cy="700" r="1.2"></circle><circle fill="rgba(255,255,255,0.65)" cx="400" cy="100" r="1.2"></circle><circle fill="rgba(16,185,129,0.5)" cx="150" cy="650" r="1.4"></circle></pattern></defs><rect width="100%" height="100%" fill="url(%23stars2)"/></svg>');
  animation-duration: 3000s;
}

#starfield3 {
  background-image: url('data:image/svg+xml,<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="stars3" patternUnits="userSpaceOnUse" width="500" height="500"><circle fill="rgba(255,255,255,0.85)" cx="50" cy="250" r="1.5"></circle><circle fill="rgba(255,255,255,0.85)" cx="350" cy="450" r="1.5"></circle><circle fill="rgba(255,255,255,0.9)" cx="220" cy="80" r="1.6"></circle></pattern></defs><rect width="100%" height="100%" fill="url(%23stars3)"/></svg>');
  animation-duration: 2400s;
}

@keyframes rotate-galaxy {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.shooting-star-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  overflow: hidden;
}

.shooting-star {
  position: absolute;
  top: 50%;
  left: 0;
  width: 260px;
  height: 1.5px;
  background: linear-gradient(to right, rgba(52, 211, 153, 0.95), rgba(16, 185, 129, 0.5), rgba(255, 255, 255, 0));
  border-radius: var(--radius-full);
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.9));
  animation-fill-mode: forwards;
}

@keyframes shoot-star-fly {
  0% { transform: translateX(-260px) scaleX(0.1); }
  12% { transform: translateX(0) scaleX(1); }
  100% { transform: translateX(130vw) scaleX(1); }
}

/* ==========================================================================
   PRELOADER CON LÍNEA RESPIRATORIA
   ========================================================================== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader.preloader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-progress-line {
  width: 160px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

.preloader-progress-line__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: var(--radius-full);
  animation: preloader-breath 1.8s ease-in-out infinite;
}

@keyframes preloader-breath {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   HEADER / SAAS NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-default);
}

html:not(.dark) .site-header {
  background: rgba(255, 255, 255, 0.9);
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-logo {
  border-radius: 6px;
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #10b981;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.header-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.08);
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.main-layout {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==========================================================================
   SAAS WORKSPACE SWITCHER (SEGMENTED CONTROL TABS)
   ========================================================================== */
.saas-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(8, 13, 26, 0.7);
  border: 1px solid var(--border-default);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html:not(.dark) .saas-nav-bar {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.saas-nav-bar::-webkit-scrollbar {
  display: none;
}

.saas-tab-btn {
  flex: 1;
  min-width: max-content;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.saas-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.saas-tab-btn.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

html:not(.dark) .saas-tab-btn.active {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

/* ==========================================================================
   CENTRAL COCKPIT CARD (EL CORAZÓN SAAS)
   ========================================================================== */
.cockpit-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.cockpit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.5), transparent);
}

/* --- Hero Top Bar --- */
.hero-stage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.hero-title-unit {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.hero-prefix {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-title-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-date-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hero-calendar-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.hero-calendar-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.hidden-date-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* --- Gran Valor Principal --- */
.hero-figures-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hero-main-number-group {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.hero-value {
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-shadow: 0 0 35px rgba(16, 185, 129, 0.2);
}

.hero-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-icon-action {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-icon-action:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-primary-glow);
  transform: translateY(-1px);
}

/* Indicadores de Variación */
.hero-badges-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.variation-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.variation-pill.is-up {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.variation-pill.is-down {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #f43f5e;
}

.projection-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.projection-tag strong {
  color: #38bdf8;
}

/* ==========================================================================
   TIMELINE HORIZONTAL SLIDER
   ========================================================================== */
.timeline-module {
  margin: 1rem 0 2rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 32px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.timeline-nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.timeline-track {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.25rem 0;
}

.timeline-track::-webkit-scrollbar {
  display: none;
}

.timeline-pill {
  flex: 1;
  min-width: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeline-pill:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.timeline-pill.selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.timeline-pill-month {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.timeline-pill.selected .timeline-pill-month {
  color: #10b981;
}

.timeline-pill-value {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

/* ==========================================================================
   CONVERSOR DUAL SAAS
   ========================================================================== */
.converter-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.presets-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.preset-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.08);
}

.preset-chip.active {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border-color: #10b981;
}

/* Grid de Inputs Dual */
.converter-inputs-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.fx-input-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.fx-input-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

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

.fx-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fx-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.fx-copy-btn:hover {
  color: var(--accent-primary);
}

.fx-input-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.fx-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.fx-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.fx-currency-tag {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.swap-action-wrap {
  display: flex;
  justify-content: center;
}

.swap-icon-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.swap-icon-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-primary-glow);
  transform: rotate(180deg);
}

.conversion-natural-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.25rem 0;
}

.conversion-natural-summary strong {
  color: var(--text-primary);
}

/* ==========================================================================
   GRÁFICO NATIVO EN CANVAS
   ========================================================================== */
.chart-card-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

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

.chart-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-range-controls {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-surface-elevated);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}

.chart-range-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-range-btn:hover {
  color: var(--text-primary);
}

.chart-range-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

.chart-canvas-box {
  width: 100%;
  height: 240px;
  position: relative;
}

#miniChart {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   PANELES DE HERRAMIENTAS (SAAS WORKSPACES)
   ========================================================================== */
.saas-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

.panel-header-block {
  margin-bottom: 1.5rem;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- Multas de Tránsito --- */
.fines-grid-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fine-card-option {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.fine-card-option:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.fine-card-option.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.fine-badge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.fine-cat-name {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.fine-cat-utm {
  font-size: 0.8rem;
  font-weight: 700;
  color: #10b981;
}

.fine-examples {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.discount-hero-card {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.discount-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.discount-tag-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.discount-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: #10b981;
  font-variant-numeric: tabular-nums;
}

/* --- Tramos de Impuesto SII --- */
.tax-table-container {
  overflow-x: auto;
  margin-top: 1.5rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.tax-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.tax-table th {
  background: var(--bg-surface-elevated);
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-default);
}

.tax-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tax-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.tax-table tr.active-bracket td {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-weight: 700;
}

/* --- Explorador Anual Grid --- */
.explorer-year-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.year-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.year-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.year-display {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.annual-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.month-cell-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.month-cell-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.month-cell-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: capitalize;
}

.month-cell-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   DOCUMENTACIÓN & GUÍA SEO (SAAS DOCS STYLE)
   ========================================================================== */
.docs-section {
  border-top: 1px solid var(--border-default);
  padding-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.docs-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.docs-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.docs-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.docs-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.docs-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Accordion FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-chevron {
  transition: transform 0.2s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-default);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-figures-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-badges-group {
    align-items: flex-start;
  }
  .converter-inputs-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .swap-action-wrap {
    margin: 0.25rem 0;
  }
  .swap-icon-btn {
    transform: rotate(90deg);
  }
  .swap-icon-btn:hover {
    transform: rotate(270deg);
  }
  .cockpit-card {
    padding: 1.25rem;
  }
  .hero-value {
    font-size: 2.5rem;
  }
}

/* Global Button & Input Reset */
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Timeline Chip Components */
.timeline-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.timeline-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}
.timeline-chip.is-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}
.timeline-chip.is-today .chip-date small {
  color: #10b981;
  font-weight: 600;
}
html:not(.dark) .timeline-chip {
  background: #ffffff;
  border-color: var(--border-default);
  color: var(--text-secondary);
}
html:not(.dark) .timeline-chip.is-active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
}
