/**
 * Auditor y Tijera de Suscripciones Fantasma - Estilos Corporativos
 * Compatible con temas claro y oscuro unificados de theme.js
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores base para tema oscuro (por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-hover: #192332;
  --bg-card-header: #172130;
  --bg-input: #0e1520;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Acentos de estado */
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-purple: #8b5cf6;
  --accent-purple-bg: rgba(139, 92, 246, 0.12);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Tema claro corporativo */
[data-theme="light"],
html.theme-light {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-header: #f8fafc;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #059669;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-emerald: #059669;
  --accent-emerald-bg: #ecfdf5;
  --accent-red: #dc2626;
  --accent-red-bg: #fef2f2;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;
  --accent-purple: #7c3aed;
  --accent-purple-bg: #f5f3ff;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Reset y estructura global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6,
.section-title,
.card-title,
.kpi-title {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
}

.mono,
.kpi-val,
.stat-price-val,
.price-tag,
.code-val {
  font-family: var(--font-mono);
}

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

.tool-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
}

@media (min-width: 1536px) {
  .tool-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

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

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

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

/* Hero y cabecera introductoria */
.hero-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 1.6rem;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.1rem;
  }
}

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

/* Cockpit de KPIs en vivo */
.kpi-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .kpi-dashboard {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.kpi-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

@media (min-width: 768px) {
  .kpi-val {
    font-size: 1.75rem;
  }
}

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

/* Modificadores de color de KPI */
.kpi-card.kpi-ghost {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, var(--bg-card-header) 0%, rgba(239, 68, 68, 0.06) 100%);
}

.kpi-card.kpi-ghost .kpi-val {
  color: var(--accent-red);
}

.kpi-card.kpi-savings {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, var(--bg-card-header) 0%, rgba(16, 185, 129, 0.06) 100%);
}

.kpi-card.kpi-savings .kpi-val {
  color: var(--accent-emerald);
}

/* Alerta de vampiros financieros */
.ghost-alert-banner {
  background: var(--accent-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ghost-alert-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ghost-alert-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.ghost-alert-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-red);
}

.ghost-alert-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-apply-scissors {
  background: var(--accent-red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn-apply-scissors:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Pestañas de navegación de herramientas */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 40px;
}

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

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

[data-theme="light"] .tab-btn.active {
  color: #ffffff;
}

/* Vistas de contenido por pestaña */
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-pane.active {
  display: flex;
}

/* Filtros y barra de acción */
.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .catalog-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-box-wrap {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 420px;
}

.search-input {
  width: 100%;
  min-height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem 0.5rem 2.4rem;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

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

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.category-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  color: var(--text-main);
  border-color: var(--text-dim);
}

.chip-btn.active {
  background: var(--text-main);
  color: var(--bg-page);
  border-color: var(--text-main);
  font-weight: 600;
}

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

.btn-secondary {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Parrilla de tarjetas de suscripción */
.subscriptions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .subscriptions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .subscriptions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tarjeta individual de suscripción */
.sub-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sub-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-sm);
}

.sub-card.is-active {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, var(--bg-card-header) 0%, rgba(16, 185, 129, 0.03) 100%);
}

.sub-card.is-active.is-ghost {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(180deg, var(--bg-card-header) 0%, rgba(239, 68, 68, 0.04) 100%);
}

/* Cabecera de la tarjeta */
.sub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sub-card-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.sub-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sub-brand-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Switch toggle */
.sub-toggle-wrap {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.sub-toggle-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sub-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.25s;
  border-radius: 24px;
}

.sub-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.25s;
  border-radius: 50%;
}

.sub-toggle-wrap input:checked + .sub-toggle-slider {
  background-color: var(--accent-emerald);
}

.sub-toggle-wrap input:checked + .sub-toggle-slider:before {
  transform: translateX(20px);
}

/* Selector de plan */
.sub-plan-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.select-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  min-height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.45rem 2.2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' 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;
}

.select-control:focus {
  border-color: var(--border-focus);
  outline: none;
}

/* Control de cuota editable personalizada */
.sub-price-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.price-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.sub-price-input {
  width: 100%;
  min-height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.45rem 3.5rem 0.45rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s ease;
}

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

.price-input-unit {
  position: absolute;
  right: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  pointer-events: none;
}

.btn-reset-price {
  background: transparent;
  border: none;
  color: var(--accent-emerald);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.btn-reset-price:hover {
  text-decoration: underline;
  background: var(--accent-emerald-bg);
}

.custom-badge-note {
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* Nota de aviso de precios de referencia */
.catalog-notice-box {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-emerald);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.catalog-notice-icon {
  flex-shrink: 0;
  color: var(--accent-emerald);
}

/* Control de horas al mes */
.sub-hours-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hours-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hours-val-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.quick-hours-pills {
  display: flex;
  gap: 0.25rem;
  justify-content: space-between;
}

.pill-hour {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  flex: 1 1 0%;
  text-align: center;
  transition: all 0.15s ease;
}

.pill-hour:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Resumen métrico de la tarjeta */
.sub-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: auto;
}

.sub-price-block {
  display: flex;
  flex-direction: column;
}

.sub-price-val {
  font-size: 1.05rem;
  font-weight: 800;
}

.sub-price-period {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.cost-per-hour-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.cost-per-hour-badge.excellent {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
}

.cost-per-hour-badge.moderate {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.cost-per-hour-badge.warning {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.cost-per-hour-badge.ghost {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

/* Botón de ayuda/cancelación rápida */
.btn-card-help {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

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

/* ========================================================
   VISTA 2: PLANIFICADOR DE ROTACIÓN MENSUAL INTELIGENTE
   ======================================================== */
.rotation-hero-box {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rotation-savings-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 768px) {
  .rotation-savings-card {
    grid-template-columns: 1fr 1fr;
  }
}

.comparison-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comparison-box.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.comparison-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.comparison-box.highlight .comparison-badge {
  color: var(--accent-emerald);
}

.comparison-val {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
}

.comparison-box.highlight .comparison-val {
  color: var(--accent-emerald);
}

.comparison-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Calendario mensual de 12 meses */
.months-calendar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .months-calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .months-calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.month-slot-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  transition: transform 0.15s ease;
}

.month-slot-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

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

.month-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.month-cost-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.month-service-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-height: 40px;
}

.month-service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.month-service-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-action-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ========================================================
   VISTA 3: SANGRÍA Y COSTE DE OPORTUNIDAD A 5 Y 10 AÑOS
   ======================================================== */
.bleed-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .bleed-hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.bleed-card {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bleed-card.bleed-passive {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(180deg, var(--bg-card-header) 0%, rgba(239, 68, 68, 0.04) 100%);
}

.bleed-card.bleed-invested {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(180deg, var(--bg-card-header) 0%, rgba(16, 185, 129, 0.04) 100%);
}

.bleed-horizon-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

.horizon-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.horizon-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.horizon-val {
  font-size: 1.35rem;
  font-weight: 800;
}

.bleed-passive .horizon-val {
  color: var(--accent-red);
}

.bleed-invested .horizon-val {
  color: var(--accent-emerald);
}

/* Checklist de corte / cancelación */
.cancellation-checklist-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
}

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

.checklist-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.checklist-table tr:hover td {
  background: var(--bg-card-hover);
}

.btn-table-action {
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 36px;
}

.btn-table-action:hover {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
}

/* Modales accesibles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  font-size: 1.2rem;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 4px;
}

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

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

.form-input {
  width: 100%;
  min-height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
}

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

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

.btn-primary {
  background: var(--accent-emerald);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary:hover {
  opacity: 0.92;
}

/* ========================================================
   SECCIÓN SEO Y ACORDEÓN CANÓNICO FAQ
   ======================================================== */
.seo-guide-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.seo-guide-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.seo-guide-title {
  font-size: 1.35rem;
}

.seo-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.seo-faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.seo-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

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

.seo-faq-icon {
  transition: transform 0.25s ease;
  color: var(--text-dim);
  flex-shrink: 0;
}

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

.seo-faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.seo-faq-answer p + p {
  margin-top: 0.75rem;
}

/* Modo de impresión A4 impecable */
@media print {
  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .related-tools-section,
  .fijate-footer,
  .tab-nav,
  .catalog-toolbar,
  .ghost-alert-banner,
  .btn-apply-scissors,
  .btn-secondary,
  .btn-card-help,
  .modal-overlay,
  .seo-guide-section {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

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

  .tool-with-sidebar {
    display: block !important;
  }

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

  .tab-pane {
    display: flex !important;
  }

  .sub-card {
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
}
