/**
 * Estilos canónicos para Previsión de tesorería a 13 semanas (Rolling Cash Flow Forecast)
 * Fijate Tools - Estándar corporativo
 */

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

  /* Colores temáticos corporativos - Modo claro */
  --cf-bg: #f8fafc;
  --cf-surface: #ffffff;
  --cf-surface-alt: #f1f5f9;
  --cf-border: #e2e8f0;
  --cf-border-subtle: #cbd5e1;
  --cf-text-main: #0f172a;
  --cf-text-muted: #64748b;
  --cf-text-light: #94a3b8;

  --cf-primary: #0284c7;
  --cf-primary-hover: #0369a1;
  --cf-primary-bg: #e0f2fe;

  --cf-green: #059669;
  --cf-green-bg: #ecfdf5;
  --cf-green-border: #a7f3d0;

  --cf-red: #e11d48;
  --cf-red-bg: #fff1f2;
  --cf-red-border: #fecdd3;

  --cf-amber: #d97706;
  --cf-amber-bg: #fffbeb;
  --cf-amber-border: #fde68a;

  --cf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --cf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --cf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --cf-radius: 12px;
  --cf-radius-sm: 8px;
}

[data-theme="dark"] {
  --cf-bg: #0b0f17;
  --cf-surface: #131b2a;
  --cf-surface-alt: #1a2538;
  --cf-border: #233148;
  --cf-border-subtle: #334460;
  --cf-text-main: #f8fafc;
  --cf-text-muted: #94a3b8;
  --cf-text-light: #64748b;

  --cf-primary: #38bdf8;
  --cf-primary-hover: #0ea5e9;
  --cf-primary-bg: rgba(56, 189, 248, 0.15);

  --cf-green: #10b981;
  --cf-green-bg: rgba(16, 185, 129, 0.14);
  --cf-green-border: rgba(16, 185, 129, 0.35);

  --cf-red: #f43f5e;
  --cf-red-bg: rgba(244, 63, 94, 0.14);
  --cf-red-border: rgba(244, 63, 94, 0.35);

  --cf-amber: #f59e0b;
  --cf-amber-bg: rgba(245, 158, 11, 0.14);
  --cf-amber-border: rgba(245, 158, 11, 0.35);

  --cf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --cf-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  --cf-shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--cf-bg);
  color: var(--cf-text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.brand-title, .card-title, .section-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin-top: 0;
}

button, input, select, textarea {
  font-family: inherit;
}

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

/* Clases utilitarias de color */
.text-green { color: var(--cf-green) !important; }
.text-red { color: var(--cf-red) !important; }
.text-amber { color: var(--cf-amber) !important; }
.text-muted { color: var(--cf-text-muted) !important; }

/* ========================================================
   Layout canónico de la herramienta y contención lateral
   ======================================================== */
.tool-layout {
  max-width: 1320px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

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

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* ========================================================
   Tarjetas principales de la interfaz
   ======================================================== */
.cf-card {
  background: var(--cf-surface);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--cf-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-card:hover {
  border-color: var(--cf-border-subtle);
}

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

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--cf-text-muted);
  margin-top: 0.2rem;
}

/* ========================================================
   Barra superior de ajustes rápidos y controles
   ======================================================== */
.settings-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: flex-end;
}

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

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cf-text-muted);
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  background-color: var(--cf-surface-alt);
  color: var(--cf-text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--cf-primary);
  box-shadow: 0 0 0 3px var(--cf-primary-bg);
}

select.form-control {
  cursor: pointer;
  padding-right: 2rem;
}

/* Barra de escenarios de estrés */
.scenario-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--cf-surface-alt);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  margin-top: 1.25rem;
}

.scenario-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cf-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.scenario-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-scenario {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--cf-border);
  border-radius: 6px;
  background: var(--cf-surface);
  color: var(--cf-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-scenario:hover {
  border-color: var(--cf-primary);
  color: var(--cf-primary);
}

.btn-scenario.active {
  background: var(--cf-primary);
  color: #ffffff;
  border-color: var(--cf-primary);
}

.actions-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--cf-border);
  border-radius: 6px;
  background: var(--cf-surface);
  color: var(--cf-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--cf-surface-alt);
  border-color: var(--cf-border-subtle);
}

.btn-action.btn-primary {
  background: var(--cf-primary);
  color: #ffffff;
  border-color: var(--cf-primary);
}

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

/* ========================================================
   Panel KPI de Tesorería Crítica
   ======================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--cf-border-subtle);
}

.kpi-card.kpi-safe {
  border-left: 4px solid var(--cf-green);
  background: linear-gradient(to right, var(--cf-green-bg), var(--cf-surface));
}

.kpi-card.kpi-warning {
  border-left: 4px solid var(--cf-amber);
  background: linear-gradient(to right, var(--cf-amber-bg), var(--cf-surface));
}

.kpi-card.kpi-danger {
  border-left: 4px solid var(--cf-red);
  background: linear-gradient(to right, var(--cf-red-bg), var(--cf-surface));
  animation: pulse-danger 3s infinite;
}

@keyframes pulse-danger {
  0%, 100% { border-color: var(--cf-red-border); }
  50% { border-color: var(--cf-red); }
}

.kpi-card.kpi-danger-border {
  border-color: var(--cf-red);
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.kpi-icon {
  font-size: 1.3rem;
}

.kpi-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--cf-text-muted);
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.kpi-subtext, .kpi-desc {
  font-size: 0.8rem;
  color: var(--cf-text-muted);
  line-height: 1.35;
}

/* ========================================================
   Gráfico interactivo Canvas
   ======================================================== */
.chart-container-box {
  position: relative;
  width: 100%;
  border-radius: var(--cf-radius-sm);
  background: var(--cf-surface);
  overflow: hidden;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

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

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-swatch.swatch-line {
  background: var(--cf-primary);
  height: 3px;
  border-radius: 2px;
  width: 16px;
}

.legend-swatch.swatch-inflow { background: var(--cf-green); }
.legend-swatch.swatch-outflow { background: var(--cf-red); }
.legend-swatch.swatch-cushion {
  background: repeating-linear-gradient(to right, var(--cf-amber), var(--cf-amber) 3px, transparent 3px, transparent 6px);
  height: 3px;
  width: 16px;
}

/* Tooltip dinámico del gráfico */
.cashflow-chart-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  min-width: 260px;
  max-width: 320px;
  padding: 0.85rem 1rem;
  background: var(--cf-surface);
  color: var(--cf-text-main);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  box-shadow: var(--cf-shadow-lg);
  font-size: 0.82rem;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.tip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--cf-border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}

.tip-dates {
  color: var(--cf-text-muted);
  font-size: 0.75rem;
}

.tip-milestone {
  background: var(--cf-amber-bg);
  color: var(--cf-amber);
  border: 1px solid var(--cf-amber-border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.tip-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

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

.tip-divider {
  border-top: 1px dashed var(--cf-border);
  padding-top: 0.35rem;
  margin-top: 0.2rem;
}

.tip-highlight {
  padding-top: 0.35rem;
  border-top: 1px solid var(--cf-border);
  margin-top: 0.3rem;
}

.tip-footer {
  margin-top: 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--cf-border);
}

.tip-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
}

.tip-badge.ok { background: var(--cf-green-bg); color: var(--cf-green); }
.tip-badge.warning { background: var(--cf-amber-bg); color: var(--cf-amber); }
.tip-badge.danger { background: var(--cf-red-bg); color: var(--cf-red); }

/* ========================================================
   Matriz interactiva de 13 semanas (Hoja de cálculo)
   ======================================================== */
.cashflow-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  background: var(--cf-surface);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.cashflow-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.cashflow-matrix-table th,
.cashflow-matrix-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--cf-border);
  border-right: 1px solid var(--cf-border);
  text-align: right;
  white-space: nowrap;
}

.cashflow-matrix-table th:last-child,
.cashflow-matrix-table td:last-child {
  border-right: none;
}

/* Columna fija izquierda (Conceptos) */
.col-sticky {
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--cf-surface);
  text-align: left !important;
  width: 250px;
  min-width: 220px;
  max-width: 280px;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.cashflow-matrix-table thead th.col-sticky {
  z-index: 30;
  background: var(--cf-surface-alt);
}

/* Cabeceras de semanas */
.cashflow-matrix-table thead th {
  background: var(--cf-surface-alt);
  font-family: var(--font-heading);
  text-align: center;
  vertical-align: top;
  min-width: 105px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.week-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.week-dates {
  font-size: 0.72rem;
  color: var(--cf-text-muted);
  font-weight: 500;
}

.cell-tag {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  margin-top: 0.3rem;
  line-height: 1.2;
}

.tag-fiscal {
  background: var(--cf-amber-bg);
  color: var(--cf-amber);
  border: 1px solid var(--cf-amber-border);
}

.tag-payroll {
  background: var(--cf-primary-bg);
  color: var(--cf-primary);
  border: 1px solid var(--cf-primary);
}

/* Celdas de conceptos y acciones */
.concept-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.concept-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concept-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.row-item:hover .concept-actions {
  opacity: 1;
}

.btn-row-repeat,
.btn-row-del {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--cf-border);
  background: var(--cf-surface-alt);
  color: var(--cf-text-muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-row-repeat:hover {
  background: var(--cf-primary);
  color: #ffffff;
  border-color: var(--cf-primary);
}

.btn-row-del:hover {
  background: var(--cf-red);
  color: #ffffff;
  border-color: var(--cf-red);
}

/* Inputs numéricos de celdas */
.cell-input {
  width: 100%;
  min-width: 82px;
  height: 32px;
  padding: 0.25rem 0.4rem;
  font-size: 0.88rem;
  text-align: right;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--cf-text-main);
  transition: all 0.15s ease;
  appearance: textfield;
  -moz-appearance: textfield;
}

.cell-input::-webkit-outer-spin-button,
.cell-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cell-input:hover {
  border-color: var(--cf-border);
  background: var(--cf-surface-alt);
}

.cell-input:focus {
  outline: none;
  border-color: var(--cf-primary);
  background: var(--cf-surface);
  box-shadow: 0 0 0 2px var(--cf-primary-bg);
}

/* Encabezados de sección (Cobros / Pagos) */
.row-section-header td {
  background: var(--cf-surface-alt) !important;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
}

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

.btn-table-action {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--cf-border);
  border-radius: 4px;
  background: var(--cf-surface);
  color: var(--cf-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Filas de totales y subtotales */
.row-subtotal td {
  background: var(--cf-surface-alt);
  font-weight: 700;
}

.row-highlight td {
  background: var(--cf-surface-alt);
  font-weight: 700;
  border-top: 1px solid var(--cf-border);
}

.row-grand-total td {
  background: var(--cf-surface-alt);
  border-top: 2px solid var(--cf-primary);
  border-bottom: 2px solid var(--cf-primary);
  font-weight: 800;
  font-size: 0.92rem;
}

.row-credit-line td {
  font-size: 0.8rem;
  background: var(--cf-surface);
}

/* Semáforos de celda de saldo final */
.ending-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.status-micro-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  line-height: 1;
}

.status-safe {
  background: var(--cf-green-bg) !important;
  color: var(--cf-green);
}

.status-warning {
  background: var(--cf-amber-bg) !important;
  color: var(--cf-amber);
}
.status-warning .status-micro-badge {
  background: var(--cf-amber);
  color: #ffffff;
}

.status-danger {
  background: var(--cf-red-bg) !important;
  color: var(--cf-red);
}
.status-danger .status-micro-badge {
  background: var(--cf-red);
  color: #ffffff;
}

.val-danger { color: var(--cf-red); font-weight: 700; }
.val-warning { color: var(--cf-amber); font-weight: 700; }

/* ========================================================
   Modales accesibles (Sin window.alert)
   ======================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--cf-surface);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius);
  box-shadow: var(--cf-shadow-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

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

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

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.92rem;
  color: var(--cf-text-main);
}

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

/* ========================================================
   Guía didáctica y acordeón FAQ de SEO
   ======================================================== */
.guide-section {
  margin-top: 2.5rem;
}

.guide-prose {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--cf-text-main);
}

.guide-prose p {
  margin-bottom: 1.1rem;
}

.guide-prose h3 {
  font-size: 1.25rem;
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
}

.guide-prose ul {
  padding-left: 1.4rem;
  margin-bottom: 1.2rem;
}

.guide-prose li {
  margin-bottom: 0.45rem;
}

.guide-box {
  background: var(--cf-surface-alt);
  border-left: 4px solid var(--cf-primary);
  border-radius: 0 var(--cf-radius-sm) var(--cf-radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.guide-box strong {
  color: var(--cf-primary);
}

/* Acordeón FAQ */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.faq-item {
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  background: var(--cf-surface);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.15rem;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--cf-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.faq-question:hover {
  background-color: var(--cf-surface-alt);
}

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

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

.faq-answer {
  padding: 0 1.15rem 1rem 1.15rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--cf-text-muted);
}

/* ========================================================
   Responsive y adaptabilidad móvil
   ======================================================== */
@media (max-width: 768px) {
  .tool-layout {
    margin-top: 0.75rem;
    padding: 0 0.65rem;
  }

  .cf-card {
    padding: 1.1rem;
  }

  .settings-bar {
    grid-template-columns: 1fr;
  }

  .scenario-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .scenario-btn-group,
  .actions-btn-group {
    width: 100%;
  }

  .btn-scenario,
  .btn-action {
    flex: 1;
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .col-sticky {
    width: 180px;
    min-width: 160px;
  }
}

/* ========================================================
   Estilos específicos de impresión (A4 horizontal)
   ======================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .fijate-footer,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .scenario-bar,
  .btn-table-action,
  .concept-actions,
  .guide-section,
  .modal-overlay {
    display: none !important;
  }

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

  .cf-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 1.5rem !important;
  }

  .cashflow-table-wrapper {
    overflow: visible !important;
    border: 1px solid #cccccc !important;
  }

  .cashflow-matrix-table th,
  .cashflow-matrix-table td {
    padding: 4px 6px !important;
    font-size: 8pt !important;
  }

  .cell-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 8pt !important;
  }
}
