/* ============================================================
   SISTEMA DE DISEÑO - CALCULADORA DE SUELDO NETO E IRPF
   ============================================================ */

:root {
  /* Tipografías */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema Oscuro (por defecto) */
  --bg-app: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-surface-subtle: #151d2e;
  --bg-hover: #222d42;
  --bg-input: #0e1422;

  --border-color: #243048;
  --border-focus: #3b82f6;
  --border-subtle: #1a2438;

  --text-primary: #f3f4f6;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0b0f19;

  /* Colores de acento e identidad */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.35);

  --accent-neto: #10b981;        /* Verde esmeralda para el dinero en mano */
  --accent-neto-bg: rgba(16, 185, 129, 0.12);
  --accent-irpf: #f59e0b;        /* Ámbar para IRPF Hacienda */
  --accent-irpf-bg: rgba(245, 158, 11, 0.12);
  --accent-ss: #6366f1;          /* Índigo para Seguridad Social */
  --accent-ss-bg: rgba(99, 102, 241, 0.12);
  --accent-empresa: #ec4899;     /* Rosa/Fucsia para coste de empresa */
  --accent-empresa-bg: rgba(236, 72, 153, 0.12);

  /* Sombras y radios */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px -5px var(--primary-glow);
}

/* Tema Claro */
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-subtle: #f8fafc;
  --bg-hover: #e2e8f0;
  --bg-input: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --border-subtle: #edf2f7;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  --primary-glow: rgba(37, 99, 235, 0.2);

  --accent-neto: #059669;
  --accent-neto-bg: rgba(5, 150, 105, 0.1);
  --accent-irpf: #d97706;
  --accent-irpf-bg: rgba(217, 119, 6, 0.1);
  --accent-ss: #4f46e5;
  --accent-ss-bg: rgba(79, 70, 229, 0.1);
  --accent-empresa: #db2777;
  --accent-empresa-bg: rgba(219, 39, 119, 0.1);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   RESETEO Y BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* ============================================================
   CABECERA PRINCIPAL
   ============================================================ */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-box {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

.badge-free {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-neto-bg);
  color: var(--accent-neto);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

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

/* Botones y controles de cabecera */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

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

.btn-icon {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
}

.form-select-header {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  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='%2394a3b8' 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 0.6rem center;
  transition: border-color 0.15s ease;
}

.form-select-header:focus {
  border-color: var(--border-focus);
}

/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */
.app-main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 1.75rem;
  align-items: start;
}

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

/* ============================================================
   COLUMNA IZQUIERDA: FORMULARIO DE PARÁMETROS
   ============================================================ */
.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn-reset {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

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

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label-helper {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

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

.input-currency-symbol {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  pointer-events: none;
}

.form-input-lg {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-input-lg:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
}

.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 2.2rem 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  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='%2394a3b8' 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 0.75rem center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.form-select:focus {
  border-color: var(--border-focus);
}

/* Sliders interactivos */
.range-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

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

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

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

.range-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Grupos segmentados (Pagas 12/14, Contrato) */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.segmented-control-3 {
  grid-template-columns: repeat(3, 1fr);
}

.segmented-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

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

.segmented-btn.is-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Acordeón de opciones avanzadas */
.accordion-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface-subtle);
}

.accordion-header {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.accordion-header:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.accordion-icon {
  transition: transform 0.2s ease;
}

.accordion-box.is-open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 1.1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  flex-direction: column;
  gap: 1rem;
}

.accordion-box.is-open .accordion-content {
  display: flex;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* ============================================================
   COLUMNA DERECHA: RESULTADOS Y VISUALIZACIÓN
   ============================================================ */
.results-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tarjetas KPI de Sueldo Neto */
.kpi-main-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.kpi-main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-neto), var(--primary));
}

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

.kpi-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-neto);
}

.kpi-pagas-indicator {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

.kpi-hero-numbers {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kpi-hero-val {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.kpi-hero-unit {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.kpi-sub-item {
  display: flex;
  flex-direction: column;
}

.kpi-sub-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-sub-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Grilla de Métricas Secundarias */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
}

.metric-card.card-neto { border-left: 4px solid var(--accent-neto); }
.metric-card.card-irpf { border-left: 4px solid var(--accent-irpf); }
.metric-card.card-ss   { border-left: 4px solid var(--accent-ss); }
.metric-card.card-empresa { border-left: 4px solid var(--accent-empresa); }

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

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.metric-tag.tag-neto { background: var(--accent-neto-bg); color: var(--accent-neto); }
.metric-tag.tag-irpf { background: var(--accent-irpf-bg); color: var(--accent-irpf); }
.metric-tag.tag-ss   { background: var(--accent-ss-bg); color: var(--accent-ss); }
.metric-tag.tag-empresa { background: var(--accent-empresa-bg); color: var(--accent-empresa); }

.metric-val {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   SECCIÓN DE GRÁFICO INTERACTIVO Y DESGLOSE
   ============================================================ */
.chart-breakdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chart-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 768px) {
  .chart-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.chart-donut-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-segment {
  fill: none;
  stroke-width: 28;
  transition: stroke-dasharray 0.6s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease;
  cursor: pointer;
}

.donut-segment:hover {
  opacity: 0.85;
}

.donut-center-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.donut-center-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Leyenda del gráfico */
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.legend-row:hover {
  background: var(--bg-hover);
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.legend-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.legend-right {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.legend-amount {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.legend-pct {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 3.2rem;
  text-align: right;
}

/* ============================================================
   PESTAÑAS DE DETALLE (Nómina mensual / 12 vs 14 / Subida / Coste)
   ============================================================ */
.tabs-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-subtle);
}

.tab-btn.is-active {
  color: var(--primary);
  background: var(--primary-light);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* Tablas estilizadas */
.data-table-wrapper {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--bg-surface);
}

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

.data-table th {
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .num-cell {
  text-align: right;
  font-family: var(--font-mono);
}

.data-table tr.highlight-row {
  background: var(--accent-neto-bg);
  font-weight: 700;
}

/* Simulador de Aumento */
.simulador-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.simulador-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

.simulador-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.simulador-neto-extra {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-neto);
}

.simulador-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   SECCIÓN SEO Y PREGUNTAS FRECUENTES (FAQ)
   ============================================================ */
.seo-section {
  max-width: 1400px;
  margin: 3rem auto 1.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.seo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.seo-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.seo-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.5rem 0;
}

.seo-card p, .seo-card li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.seo-card ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

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

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

.faq-question:hover {
  background: var(--bg-hover);
}

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

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

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

/* ============================================================
   PIE DE PÁGINA
   ============================================================ */
.app-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Vista de Impresión / Exportación PDF */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, .btn-reset, .tabs-nav, .range-slider-wrapper, .accordion-box, .seo-section, .app-footer, .modal-backdrop {
    display: none !important;
  }
  .calculator-grid {
    display: block !important;
  }
  .form-card, .results-column, .kpi-main-card, .metric-card, .chart-breakdown-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #ffffff !important;
    color: #000000 !important;
    break-inside: avoid;
    margin-bottom: 1.5rem;
  }
  .tab-panel {
    display: block !important;
  }
}
