/* ==========================================================================
   Fijate Tools - Calculadora de Rendimiento de Aceituna y Maquila de Almazara
   Hojas de estilo premium: sistema de diseño, responsive y temas claro/oscuro
   ========================================================================== */

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

  /* Paleta cromática Olivar & Almazara (Tema Claro) */
  --olive-950: #142308;
  --olive-900: #1e3a0f;
  --olive-800: #2d5516;
  --olive-700: #3f7320;
  --olive-600: #54962d;
  --olive-500: #6ea33e;
  --olive-400: #8ec259;
  --olive-100: #ecf7dc;
  --olive-50:  #f6fbe9;

  --gold-oil-900: #713f12;
  --gold-oil-600: #ca8a04;
  --gold-oil-500: #eab308;
  --gold-oil-400: #facc15;
  --gold-oil-100: #fef9c3;
  --gold-oil-50:  #fefce8;

  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-850: #151f33;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  /* Variables Semánticas del Tema Claro */
  --bg-app: #f4f6f0;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8faf5;
  --bg-input: #ffffff;
  --border-card: #e2e8db;
  --border-input: #cbd5c1;
  --border-input-focus: #54962d;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #475569;
  --text-title: #142308;

  --accent-olive: #3f7320;
  --accent-gold: #ca8a04;
  --accent-gold-bg: #fef9c3;
  --accent-gold-text: #854d0e;

  --badge-green-bg: #ecf7dc;
  --badge-green-text: #2d5516;
  --badge-blue-bg: #e0f2fe;
  --badge-blue-text: #0369a1;
  --badge-amber-bg: #fef3c7;
  --badge-amber-text: #92400e;

  --card-shadow: 0 4px 16px -2px rgba(30, 58, 15, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 10px 25px -4px rgba(30, 58, 15, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Tema Oscuro */
[data-theme="dark"] {
  --bg-app: #0b110a;
  --bg-card: #131c12;
  --bg-card-subtle: #192518;
  --bg-input: #1a2718;
  --border-card: #273824;
  --border-input: #384e34;
  --border-input-focus: #8ec259;

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-subtle: #cbd5e1;
  --text-title: #f1f7ea;

  --accent-olive: #8ec259;
  --accent-gold: #facc15;
  --accent-gold-bg: rgba(250, 204, 21, 0.15);
  --accent-gold-text: #fef08a;

  --badge-green-bg: rgba(142, 194, 89, 0.18);
  --badge-green-text: #bbf7d0;
  --badge-blue-bg: rgba(56, 189, 248, 0.18);
  --badge-blue-text: #bae6fd;
  --badge-amber-bg: rgba(251, 191, 36, 0.18);
  --badge-amber-text: #fef08a;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* Resets y tipografías */
*, *::before, *::after {
  box-sizing: border-box;
}

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

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.card-header-title {
  font-family: var(--font-heading);
  color: var(--text-title);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.mono,
.val-number,
.stat-main-val,
.stat-sub-val,
code {
  font-family: var(--font-mono);
}

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

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

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

/* Banner de Cabecera y Presentación de la Herramienta */
.tool-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-intro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.intro-badge-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: var(--badge-green-bg);
  color: var(--badge-green-text);
}

.badge-tag.tag-amber {
  background: var(--badge-amber-bg);
  color: var(--badge-amber-text);
}

.badge-tag.tag-blue {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-text);
}

.tool-intro-desc {
  font-size: 0.95rem;
  color: var(--text-subtle);
  margin: 0;
}

/* Rejilla Principal de Trabajo */
.calc-grid-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 992px) {
  .calc-grid-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tarjetas Principales */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-width: 0;
  max-width: 100%;
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--badge-green-bg);
  color: var(--olive-700);
}

[data-theme="dark"] .card-icon-box {
  color: var(--olive-400);
}

.card-header-title {
  font-size: 1.15rem;
}

/* Selector Rápido de Kilos de Cosecha */
.quick-kilos-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-kilos-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.quick-kilos-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .quick-kilos-pills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.btn-pill-kilos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.35rem;
  border: 1px solid var(--border-card);
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}

.btn-pill-kilos:hover {
  border-color: var(--olive-600);
  background: var(--badge-green-bg);
  color: var(--olive-900);
}

[data-theme="dark"] .btn-pill-kilos:hover {
  color: #fff;
}

.btn-pill-kilos.is-active {
  background: var(--olive-700);
  border-color: var(--olive-700);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(63, 115, 32, 0.3);
}

/* Campos de Formulario y Filas */
.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

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

.field-hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.input-flex-wrapper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 42px;
  width: 100%;
}

.input-flex-wrapper:focus-within {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px rgba(84, 150, 45, 0.18);
}

.input-flex-wrapper input[type="number"],
.input-flex-wrapper input[type="text"] {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--bg-card-subtle);
  border-left: 1px solid var(--border-card);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Filas dobles de formulario */
.form-row-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (max-width: 580px) {
  .form-row-dual {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Desplegables Select Canónicos */
.custom-select-box {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.custom-select-box select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0.5rem 2.5rem 0.5rem 0.85rem;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-select-box select:focus {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px rgba(84, 150, 45, 0.18);
}

.custom-select-box select option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

.custom-select-arrow {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

/* Selector de Modalidad de Maquila (Radio Buttons en Tarjeta) */
.maquila-mode-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

@media (max-width: 580px) {
  .maquila-mode-selector {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mode-radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem;
  border: 1.5px solid var(--border-card);
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-radio-card:hover {
  border-color: var(--olive-500);
}

.mode-radio-card.is-selected {
  border-color: var(--olive-600);
  background: var(--badge-green-bg);
}

.mode-radio-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-title);
}

.mode-radio-header input[type="radio"] {
  accent-color: var(--olive-600);
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.mode-radio-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Tarjeta de Variedad de Aceituna Activa */
.variety-info-box {
  background: var(--bg-card-subtle);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.variety-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--olive-700);
}

[data-theme="dark"] .variety-info-header {
  color: var(--olive-400);
}

.variety-info-text {
  color: var(--text-subtle);
  margin: 0;
}

/* ==========================================================================
   Columna Derecha: Tarjetas de Resultados y Resumen Industrial
   ========================================================================== */

.results-column-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* Tarjeta Hero de Extracción */
.hero-extraction-card {
  background: linear-gradient(135deg, var(--olive-950) 0%, var(--olive-900) 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(20, 35, 8, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.hero-extraction-card::after {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.25) 0%, rgba(234, 179, 8, 0) 70%);
  pointer-events: none;
}

.hero-stat-primary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.hero-stat-main-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hero-stat-val {
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-oil-400);
}

.hero-stat-unit {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.hero-stats-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-substat-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-substat-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.hero-substat-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

/* Gráfico / Barra Visual de Distribución de la Aceituna */
.breakdown-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.breakdown-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-title);
}

.breakdown-progress-track {
  width: 100%;
  height: 22px;
  background: var(--slate-200);
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
}

[data-theme="dark"] .breakdown-progress-track {
  background: var(--slate-800);
}

.bar-segment-oil {
  background: linear-gradient(90deg, #ca8a04, #eab308);
  height: 100%;
  transition: width 0.3s ease;
}

.bar-segment-pomace {
  background: #3f7320;
  height: 100%;
  transition: width 0.3s ease;
}

.bar-segment-water {
  background: #64748b;
  height: 100%;
  transition: width 0.3s ease;
}

.breakdown-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-oil { background: var(--gold-oil-500); }
.dot-pomace { background: var(--olive-700); }
.dot-water { background: var(--slate-500); }

/* ==========================================================================
   Sección del Simulador Comparativo (Opción A vs Opción B)
   ========================================================================== */

.comparison-dual-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  width: 100%;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.option-box {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: all 0.2s ease;
}

.option-box-a {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
}

.option-box-b {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-card);
}

.option-box.is-winner {
  border-color: var(--olive-600);
  box-shadow: 0 4px 16px rgba(84, 150, 45, 0.15);
}

.winner-badge {
  position: absolute;
  top: -12px;
  right: 14px;
  background: var(--olive-700);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.option-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.option-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 0;
}

.option-lines-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.86rem;
}

.option-line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-subtle);
  border-bottom: 1px dashed var(--border-card);
  padding-bottom: 0.35rem;
}

.option-line-item:last-child {
  border-bottom: none;
}

.option-line-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.option-highlight-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.option-highlight-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-title);
}

/* Banner de Veredicto y Balance Diferencial */
.verdict-banner {
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.verdict-banner.beneficio-a {
  background: var(--badge-green-bg);
  border: 1px solid rgba(84, 150, 45, 0.35);
  color: var(--olive-950);
}

[data-theme="dark"] .verdict-banner.beneficio-a {
  color: #f1f7ea;
}

.verdict-banner.beneficio-b {
  background: var(--badge-blue-bg);
  border: 1px solid rgba(3, 105, 161, 0.35);
  color: #082f49;
}

[data-theme="dark"] .verdict-banner.beneficio-b {
  color: #e0f2fe;
}

.verdict-banner.neutro {
  background: var(--badge-amber-bg);
  border: 1px solid rgba(146, 64, 14, 0.35);
  color: #451a03;
}

[data-theme="dark"] .verdict-banner.neutro {
  color: #fef3c7;
}

.verdict-icon {
  flex-shrink: 0;
}

/* Cajas de Fórmulas Semánticas (.formula-box) sin LaTeX crudo */
.formula-box {
  background: var(--bg-card-subtle);
  border-left: 3px solid var(--olive-600);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
  margin: 0.5rem 0;
  overflow-x: auto;
}

/* Botonera de Acciones (Informe de Maquila, Compartir, Limpiar) */
.actions-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--olive-700);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(63, 115, 32, 0.25);
}

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

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.15rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover {
  border-color: var(--olive-600);
  background: var(--bg-card-subtle);
}

/* Modales Accesibles Propios (Cero window.alert) */
.fijate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fijate-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fijate-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.3);
  transform: scale(0.96);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.fijate-modal-overlay.is-open .fijate-modal-card {
  transform: scale(1);
}

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

.fijate-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 0;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.fijate-modal-footer {
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
}

/* Documento de Liquidación Imprimible (@media print) */
.printable-report-sheet {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
  }

  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .fijate-footer,
  .actions-toolbar,
  .quick-kilos-container,
  .btn-modal-close,
  .fijate-modal-footer,
  .no-print {
    display: none !important;
  }

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

  .printable-report-sheet {
    display: block !important;
    width: 100% !important;
    padding: 15mm !important;
    font-family: var(--font-main) !important;
    color: #0f172a !important;
  }

  .print-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.88rem;
  }

  .print-table th {
    background: #f1f5f9;
    font-weight: 700;
  }
}
