/* ==========================================================================
   Fijate Tools - Calculadora de compostaje y relación carbono-nitrógeno (C:N)
   Estilos corporativos y responsive móvil de alto rendimiento
   ========================================================================== */

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

  /* Paleta cromática tema claro */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-card: #e2e8f0;
  --border-focus: #16a34a;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  /* Acentos temáticos de compostaje */
  --green-bio: #16a34a;
  --green-bio-hover: #15803d;
  --green-bio-bg: rgba(22, 163, 74, 0.10);
  --green-bio-border: rgba(22, 163, 74, 0.25);

  --brown-earth: #b45309;
  --brown-earth-hover: #92400e;
  --brown-earth-bg: rgba(180, 83, 9, 0.10);
  --brown-earth-border: rgba(180, 83, 9, 0.25);

  --amber-warn: #d97706;
  --amber-warn-bg: rgba(217, 119, 6, 0.10);
  --amber-warn-border: rgba(217, 119, 6, 0.25);

  --blue-cool: #2563eb;
  --blue-cool-bg: rgba(37, 99, 235, 0.10);
  --blue-cool-border: rgba(37, 99, 235, 0.25);

  --red-alert: #dc2626;
  --red-alert-bg: rgba(220, 38, 38, 0.10);
  --red-alert-border: rgba(220, 38, 38, 0.25);

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

/* Modo oscuro */
body.dark-mode {
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2433;
  --border-card: #223044;
  --border-focus: #22c55e;

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

  --green-bio: #22c55e;
  --green-bio-hover: #16a34a;
  --green-bio-bg: rgba(34, 197, 94, 0.14);
  --green-bio-border: rgba(34, 197, 94, 0.35);

  --brown-earth: #f59e0b;
  --brown-earth-hover: #d97706;
  --brown-earth-bg: rgba(245, 158, 11, 0.14);
  --brown-earth-border: rgba(245, 158, 11, 0.35);

  --amber-warn: #fbbf24;
  --amber-warn-bg: rgba(251, 191, 36, 0.14);
  --amber-warn-border: rgba(251, 191, 36, 0.35);

  --blue-cool: #60a5fa;
  --blue-cool-bg: rgba(96, 165, 250, 0.14);
  --blue-cool-border: rgba(96, 165, 250, 0.35);

  --red-alert: #f87171;
  --red-alert-bg: rgba(248, 113, 113, 0.14);
  --red-alert-border: rgba(248, 113, 113, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Estructura general de página
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

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

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

.mono,
.badge-mono,
.stat-number,
.formula-code {
  font-family: var(--font-mono);
}

/* ==========================================================================
   Barra de suite agraria profesional
   ========================================================================== */
.suite-nav-strip {
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-card);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.suite-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.suite-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--text-dim);
}

.suite-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.suite-link-item {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.825rem;
  transition: all 0.15s ease;
}

.suite-link-item:hover {
  color: var(--green-bio);
  background: var(--green-bio-bg);
}

.suite-link-item.active {
  color: var(--green-bio);
  background: var(--green-bio-bg);
  font-weight: 600;
  border: 1px solid var(--green-bio-border);
}

/* ==========================================================================
   Layout principal con sidebar
   ========================================================================== */
.tool-layout {
  flex: 1 0 auto;
  max-width: 1200px;
  width: 100%;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
}

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

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

.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

@media (max-width: 768px) {
  .card-main {
    padding: 1rem;
  }
}

/* ==========================================================================
   Hero Header
   ========================================================================== */
.hero-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1.25rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: var(--green-bio-bg);
  color: var(--green-bio);
  border: 1px solid var(--green-bio-border);
  margin-bottom: 0.6rem;
}

.hero-title {
  font-size: 1.65rem;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 820px;
}

/* ==========================================================================
   Barra de presets rápidos y selector de unidad
   ========================================================================== */
.controls-top-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

.presets-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.chip-btn:hover {
  background: var(--green-bio-bg);
  border-color: var(--green-bio-border);
  color: var(--green-bio);
}

.chip-btn.btn-clear {
  color: var(--text-dim);
  border-style: dashed;
}

.chip-btn.btn-clear:hover {
  background: var(--red-alert-bg);
  border-color: var(--red-alert-border);
  color: var(--red-alert);
}

/* Selector de unidad global (Segmented Control) */
.unit-segmented-control {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  max-width: 100%;
  width: 100%;
}

@media (min-width: 640px) {
  .unit-segmented-control {
    width: auto;
  }
}

.unit-btn {
  flex: 1 1 0%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.unit-btn.active {
  background: var(--green-bio);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Cuadrícula de la calculadora (Dos columnas principales: Formulario y Diagnóstico)
   ========================================================================== */
.calc-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

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

/* ==========================================================================
   Bloques de materiales (Verdes y Marrones)
   ========================================================================== */
.materials-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.category-block {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.category-block.block-green {
  border-top: 4px solid var(--green-bio);
}

.category-block.block-brown {
  border-top: 4px solid var(--brown-earth);
}

.category-header {
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-card-subtle);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.badge-tag {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

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

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

.materials-list {
  display: flex;
  flex-direction: column;
  divide-y: 1px solid var(--border-card);
}

.material-card {
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  transition: background 0.15s ease;
  min-width: 0;
  max-width: 100%;
}

.material-card:not(:last-child) {
  border-bottom: 1px solid var(--border-card);
}

.material-card:hover {
  background: var(--bg-card-subtle);
}

.material-info {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mat-icon {
  font-size: 1.45rem;
  line-height: 1;
  flex-shrink: 0;
}

.mat-texts {
  min-width: 0;
  flex: 1 1 0%;
}

.mat-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.mat-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.meta-pill {
  font-family: var(--font-mono);
  background: var(--bg-card-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-card);
}

/* Controles de cantidad táctiles (+ / input / -) */
.mat-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-stepper {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-stepper:hover {
  background: var(--green-bio-bg);
  border-color: var(--green-bio-border);
  color: var(--green-bio);
}

.btn-stepper:active {
  transform: scale(0.95);
}

.input-qty {
  width: 58px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  padding: 0 0.25rem;
  transition: border-color 0.15s ease;
}

.input-qty:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--green-bio-bg);
}

@media (max-width: 480px) {
  .material-card {
    padding: 0.65rem 0.75rem;
    flex-wrap: wrap;
  }

  .material-info {
    width: 100%;
    margin-bottom: 0.35rem;
  }

  .mat-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .btn-stepper {
    width: 42px;
    height: 40px;
    min-width: 42px;
  }

  .input-qty {
    flex: 1 1 0%;
    height: 40px;
    max-width: 100px;
  }
}

/* ==========================================================================
   Panel de Diagnóstico, Resultados y Recomendación (Sticky en desktop)
   ========================================================================== */
.results-panel-wrapper {
  position: sticky;
  top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

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

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

.diagnostic-title {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Indicador visual de C:N con velocímetro / barra graduada */
.cn-gauge-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cn-gauge-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cn-val-display {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.cn-val-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.cn-val-unit {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 600;
}

.cn-status-badge {
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  text-align: right;
}

/* Barra graduada de 3 zonas */
.cn-track-wrapper {
  position: relative;
  width: 100%;
  padding-top: 14px;
}

.cn-track {
  height: 12px;
  width: 100%;
  border-radius: 9999px;
  background: linear-gradient(
    to right,
    #f59e0b 0%,
    #f59e0b 33%,
    #10b981 33%,
    #10b981 66%,
    #3b82f6 66%,
    #3b82f6 100%
  );
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.cn-needle-indicator {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.cn-needle-pin {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--text-main);
}

.cn-needle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-main);
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  margin-top: 1px;
}

.cn-zones-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.725rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.zone-label-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.zone-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-n { background: #f59e0b; }
.dot-opt { background: #10b981; }
.dot-c { background: #3b82f6; }

/* Barra de Humedad Estimada */
.moisture-bar-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.moisture-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.moisture-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.moisture-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
}

.moisture-progress-track {
  height: 8px;
  width: 100%;
  background: var(--border-card);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.moisture-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.moisture-feedback {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ==========================================================================
   Tarjeta de Recomendación Directa (Llamada a la acción agronómica)
   ========================================================================== */
.recommendation-card {
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.rec-falta_carbono {
  background: var(--amber-warn-bg);
  border-color: var(--amber-warn-border);
}

.rec-falta_nitrogeno {
  background: var(--blue-cool-bg);
  border-color: var(--blue-cool-border);
}

.rec-optimo {
  background: var(--green-bio-bg);
  border-color: var(--green-bio-border);
}

.rec-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rec-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.rec-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.rec-body-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.rec-action-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--green-bio);
}

.rec-corrector-selector {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.corrector-label {
  font-size: 0.775rem;
  color: var(--text-dim);
  font-weight: 600;
}

.select-corrector {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0 40px 0 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

body.dark-mode .select-corrector option {
  background-color: #1a2433;
  color: #f1f5f9;
}

.btn-apply-correction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: none;
  background: var(--green-bio);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 0.25rem;
}

.btn-apply-correction:hover {
  background: var(--green-bio-hover);
}

/* ==========================================================================
   Cuadrícula de Métricas Globales de la Pila
   ========================================================================== */
.pile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.metric-cell {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.metric-lbl {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.15rem;
}

/* ==========================================================================
   Pestañas de Navegación Secundaria (Calculadora / Calendario de Volteos / Guía)
   ========================================================================== */
.section-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-card);
  margin: 2.5rem 0 1.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-nav-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 44px;
}

.tab-nav-btn:hover {
  color: var(--green-bio);
}

.tab-nav-btn.active {
  color: var(--green-bio);
  border-bottom-color: var(--green-bio);
}

.tab-pane {
  display: none;
}

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

/* ==========================================================================
   Sección Calendario de Volteos y Fases Térmicas
   ========================================================================== */
.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.calendar-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.date-picker-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-picker-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-date {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0 0.75rem;
}

.input-date:focus {
  outline: none;
  border-color: var(--border-focus);
}

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

.btn-copy-plan:hover {
  background: var(--green-bio-bg);
  color: var(--green-bio);
  border-color: var(--green-bio-border);
}

/* Timeline vertical de hitos de volteo */
.timeline-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

.timeline-vertical::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 15px;
  bottom: 25px;
  width: 2px;
  background: var(--border-card);
}

.timeline-step {
  position: relative;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s ease;
}

.timeline-step:hover {
  transform: translateX(4px);
  border-color: var(--green-bio-border);
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 1.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-bio);
  border: 2px solid var(--bg-card);
  transform: translateX(-40%);
}

.step-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.step-day-badge {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  font-weight: 700;
  background: var(--green-bio-bg);
  color: var(--green-bio);
  border: 1px solid var(--green-bio-border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.step-date-str {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

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

.step-temp-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   Sección Guía y Diagnóstico de Problemas (Troubleshooting)
   ========================================================================== */
.troubleshooting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

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

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow-sm);
}

.problem-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.problem-icon {
  font-size: 1.4rem;
}

.problem-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.problem-solution {
  background: var(--bg-card-subtle);
  border-left: 3px solid var(--green-bio);
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  font-size: 0.825rem;
  color: var(--text-main);
}

/* ==========================================================================
   Sección SEO y Documentación
   ========================================================================== */
.seo-section {
  margin-top: 3rem;
  border-top: 1px solid var(--border-card);
  padding-top: 2rem;
}

.seo-title {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.seo-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

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

.seo-table th,
.seo-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-card);
}

.seo-table th {
  background: var(--bg-card-subtle);
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

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

.formula-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--green-bio);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.formula-box p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

/* ==========================================================================
   Modales accesibles (Sin alerts)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-box {
  transform: translateY(0);
}

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

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

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

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

.modal-body {
  padding: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

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

.btn-modal-ok {
  background: var(--green-bio);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

/* Toast feedback temporal */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: var(--text-main);
  color: var(--bg-card);
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
