/* Variables y diseño base canónico de Fijate Tools */
:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores tema oscuro (por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2433;
  --bg-card-hover: #222f42;
  --border-color: #233144;
  --border-focus: #3b82f6;

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

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-border: rgba(16, 185, 129, 0.35);

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.35);

  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.12);
  --color-danger-border: rgba(239, 68, 68, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-secondary: #0891b2;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);

  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;

  --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 10px 24px rgba(0, 0, 0, 0.1);
}

/* Reset y caja general */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.option-title,
.saving-hero-tag {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.font-mono,
.input-control.font-mono,
.metric-value,
.saving-hero-amount,
.table-responsive td {
  font-family: var(--font-mono);
}

/* Enlaces y textos auxiliares */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* Layout principal */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tarjeta principal contenedora */
.card-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

@media (max-width: 640px) {
  .card-main {
    padding: 1.25rem 1rem;
    gap: 1.75rem;
    border-radius: var(--radius-md);
  }
}

/* Secciones internas */
.calc-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.section-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Banner de alerta de ventana temporal legal */
.window-alert-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.window-alert-card.status-active {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

.window-alert-card.status-warning {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}

.window-alert-card.status-expired {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.window-alert-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: currentColor;
}

.window-alert-content {
  flex: 1 1 auto;
  min-width: 0;
}

.window-alert-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 0.2rem;
}

.window-alert-desc {
  font-size: 0.88rem;
  color: var(--text-main);
  opacity: 0.95;
  line-height: 1.45;
}

.window-alert-badge {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
  .window-alert-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
  }
  .window-alert-badge {
    align-self: flex-start;
  }
}

/* Grilla de formularios y controles táctiles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem 1.25rem;
}

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

.col-span-2 {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

.btn-help-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-help-inline:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Wrapper flexbox para inputs numéricos con sufijo (regla obligatoria) */
.input-unit-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}

.input-unit-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-control {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 44px;
  padding: 0 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
}

.input-control[readonly] {
  color: var(--text-muted);
  cursor: default;
}

.input-unit {
  padding: 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  user-select: none;
}

/* Selector desplegable estilizado (regla canónica obligatoria) */
.select-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 44px;
  min-height: 44px;
  padding: 0 40px 0 0.85rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-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 14px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.select-control option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Fila de botones predefinidos (presets rápidos) */
.input-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.btn-preset {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}

.btn-preset:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

.btn-preset.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  font-weight: 700;
}

/* Barra de proporción Pre-2007 vs Post-2006 */
.ratio-bar-wrapper {
  margin: 0.4rem 0 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ratio-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-page);
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.ratio-bar-pre {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}

.ratio-bar-post {
  height: 100%;
  background: #3b82f6;
  transition: width 0.3s ease;
}

.ratio-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ratio-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-pre { background: #10b981; }
.dot-post { background: #3b82f6; }

/* Banner destacado de ahorro fiscal */
.saving-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.saving-hero-tag {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-success);
}

.saving-hero-amount {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  margin: 0.2rem 0;
}

.saving-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 500px;
}

.saving-hero-stats {
  display: flex;
  gap: 1rem;
}

.saving-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 140px;
}

.saving-stat-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.saving-stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.text-green { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-neutral { color: var(--accent-primary); }

@media (max-width: 640px) {
  .saving-hero-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1rem;
  }
  .saving-hero-amount {
    font-size: 1.9rem;
  }
  .saving-hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Grilla comparativa de 3 tarjetas */
.options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

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

.option-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.option-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.option-card-featured {
  background: var(--bg-card);
  border: 2px solid var(--color-success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.option-badge {
  align-self: flex-start;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.badge-warning {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-neutral {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.option-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.option-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1.15rem;
}

.option-metric-main {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.95rem;
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
}

.option-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border-color);
}

.row-label {
  color: var(--text-muted);
}

.row-val {
  font-weight: 600;
  color: var(--text-main);
}

.highlight-net {
  border-bottom: none;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  margin-top: 0.4rem;
}

.highlight-net-success {
  border-bottom: none;
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: var(--color-success);
  margin-top: 0.4rem;
}

.highlight-net-success .row-label {
  color: var(--text-main);
}

.highlight-net-success .row-val {
  color: var(--color-success);
  font-size: 1.05rem;
}

.option-verdict {
  margin-top: 1.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.45;
}

.verdict-negative {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--text-main);
}

.verdict-warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--text-main);
}

.verdict-success {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--text-main);
}

/* Visualizador de tramos de IRPF */
.tax-brackets-visualizer {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.brackets-track {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bracket-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bracket-header-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.bracket-name {
  font-weight: 600;
  color: var(--text-main);
}

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

.bracket-progress-outer {
  width: 100%;
  height: 22px;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  overflow: hidden;
  position: relative;
}

.segment-pension {
  height: 100%;
  background: #3b82f6;
  transition: width 0.4s ease;
}

.segment-plan {
  height: 100%;
  background: #10b981;
  transition: width 0.4s ease;
}

.segment-capital {
  height: 100%;
  background: #ef4444;
  transition: width 0.4s ease;
}

.brackets-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.color-pension { background: #3b82f6; }
.color-plan { background: #10b981; }
.color-capital { background: #ef4444; }

/* Tabla plurianual interactiva */
.cronogram-view-selector {
  display: flex;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.btn-tab-toggle {
  padding: 0.45rem 0.95rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tab-toggle.active {
  background: var(--accent-primary);
  color: #ffffff;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.data-table th {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

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

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

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.text-right {
  text-align: right;
}

/* Grilla de pasos prácticos */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

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

.step-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-heading);
}

.step-content {
  flex: 1 1 auto;
}

.step-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.step-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

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

.faq-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--border-focus);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 1.25rem 1.15rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.35rem;
  padding-top: 0.85rem;
}

/* Botones de acción inferiores */
.tool-bottom-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.btn-share,
.btn-report-tool {
  height: 44px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-share {
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid var(--accent-primary);
  flex: 1 1 auto;
}

.btn-share:hover {
  background: var(--accent-primary-hover);
}

.btn-report-tool {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-report-tool:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

@media (max-width: 640px) {
  .btn-share, .btn-report-tool {
    width: 100%;
  }
}

/* Modal nativo HTML/CSS/JS (sin window.alert) */
.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.custom-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.custom-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(15px);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.custom-modal-backdrop.is-open .custom-modal-dialog {
  transform: translateY(0);
}

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

.custom-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.btn-modal-close:hover {
  color: var(--text-main);
}

.custom-modal-body {
  padding: 1.35rem;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
}

.custom-modal-footer {
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-action {
  height: 40px;
  min-height: 40px;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-modal-action:hover {
  background: var(--accent-primary-hover);
}

/* Estilos de impresión oficial para informe financiero */
@media print {
  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .fijate-footer,
  .btn-print-report,
  .btn-help-inline,
  .input-presets-row,
  .tool-bottom-actions,
  .faq-section {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .tool-layout {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card-main {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .saving-hero-banner,
  .option-card,
  .step-card {
    border: 1px solid #cccccc !important;
    background: #f9f9f9 !important;
    color: #000000 !important;
    page-break-inside: avoid;
  }

  .table-responsive {
    border: 1px solid #000000 !important;
  }

  .data-table th,
  .data-table td {
    color: #000000 !important;
    border-bottom: 1px solid #cccccc !important;
  }
}
