/* Acumulado integrado únicamente en Evolución por producto. */
.fertilizer-month-panel-header > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.fertilizer-month-panel-header .fertilizer-evolution-hint {
  display: block;
  color: #466657;
  font-size: 0.64rem;
  line-height: 1.35;
  font-weight: 650;
}
.fertilizer-month-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}
.fertilizer-month-matrix-row.is-latest-cumulative > td,
.fertilizer-month-matrix-row.is-latest-cumulative > .fertilizer-month-product-cell {
  background: #edf8f1;
  border-top: 2px solid #5aab82;
  border-bottom-color: #b2d3c2;
}
.fertilizer-month-matrix-row.is-latest-cumulative .fertilizer-month-axis {
  background: #def0e5;
}
.fertilizer-month-matrix-row.is-latest-cumulative .fertilizer-month-axis-heading small {
  color: #176447;
  font-weight: 850;
  text-transform: uppercase;
}
.fertilizer-month-matrix-row.is-latest-cumulative .fertilizer-month-product-cell b {
  font-weight: 900;
}
@media (max-width: 720px) {
  .fertilizer-month-controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .fertilizer-month-controls .fertilizer-month-metric { width: 100%; }
}

/* Meses históricos absorbidos en el acumulado del mes vigente. */
.fertilizer-month-matrix-row.is-archived-cumulative > td {
  background: #f4f6f5;
}
.fertilizer-month-matrix-row.is-archived-cumulative .fertilizer-month-axis-heading small,
.fertilizer-month-matrix-row.is-archived-cumulative .fertilizer-month-completion small {
  color: #687a71;
}

/* Nueva comparación vertical. No suma cantidades de productos con unidades distintas. */
.fertilizer-evolution-panel-heading { gap: 16px; }
.fertilizer-evolution-hint { display:block; color:#50665b; font-size:.78rem; line-height:1.5; }
.fertilizer-evolution-overview { display:flex; gap:12px; align-items:center; flex-wrap:wrap; padding:12px 17px; background:#f0f7f2; color:#204b37; border-bottom:1px solid #d5e5db; font-size:.83rem; }
.fertilizer-evolution-overview strong { font-size:1.01rem; }
.fertilizer-evolution-overview span { border-left:1px solid #c2d8cb; padding-left:12px; }
.fertilizer-evolution-table-wrap { width:100%; overflow-x:auto; }
.fertilizer-evolution-table { width:100%; border-collapse:collapse; color:#14392b; font-size:.83rem; table-layout:auto; }
.fertilizer-evolution-table th { text-align:left; white-space:nowrap; padding:14px 13px; background:#e3eee8; color:#294d3a; border-bottom:1px solid #cee1d4; font-size:.75rem; }
.fertilizer-evolution-table td { padding:14px 13px; border-bottom:1px solid #e4eae7; vertical-align:middle; }
.fertilizer-evolution-product-row:nth-of-type(4n+3) td { background:#fafcfb; }
.fertilizer-evolution-product-row.is-expanded td { background:#f0f8f3; }
.fertilizer-evolution-expand { display:flex; align-items:center; gap:8px; padding:0; background:none; border:0; color:#134832; cursor:pointer; text-align:left; font:inherit; font-weight:800; }
.fertilizer-evolution-expand span { display:grid; place-items:center; flex:0 0 23px; height:23px; border-radius:50%; border:1px solid #70ac8c; background:white; color:#1b6c4b; font-size:1.05rem; }
.fertilizer-evolution-expand:hover strong { text-decoration:underline; }
.fertilizer-evolution-subtext { display:block; margin-top:4px; color:#6a7971; font-size:.74rem; line-height:1.4; }
.fertilizer-evolution-num { white-space:nowrap; font-weight:800; font-variant-numeric:tabular-nums; }
.fertilizer-evolution-num.is-actual { color:#08744e; }
.fertilizer-evolution-num small { font-weight:500; color:#62736a; }
.fertilizer-evolution-table td .is-excess { color:#a43c28; }
.fertilizer-evolution-table td .is-pending { color:#a0661b; }
.fertilizer-evolution-progress { min-width:90px; max-width:140px; display:grid; gap:6px; font-weight:800; font-variant-numeric:tabular-nums; }
.fertilizer-evolution-progress.is-over { color:#a43c28; }
.fertilizer-evolution-progress.is-complete { color:#07734e; }
.fertilizer-evolution-progress-track { height:6px; width:100%; border-radius:8px; overflow:hidden; background:#dae9e0; }
.fertilizer-evolution-progress-track i { display:block; height:100%; background:#3a9770; border-radius:8px; }
.fertilizer-evolution-progress.is-over i { background:#bb5b3c; }
.fertilizer-evolution-no-program { font-size:.76rem; color:#775e3d; }
.fertilizer-evolution-units { white-space:nowrap; font-variant-numeric:tabular-nums; }
.fertilizer-evolution-units span { display:block; line-height:1.7; }
.fertilizer-evolution-units span b { font-weight:650; color:#526b5c; font-size:.73rem; }
.fertilizer-evolution-units small { font-size:.72rem; color:#6c8172; }
.fertilizer-evolution-paddock-detail > td { padding:16px !important; background:#f4faf6; }
.fertilizer-evolution-detail-head { display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px; padding:0 0 12px; color:#1a4a35; }
.fertilizer-evolution-detail-head span { font-size:.76rem; color:#677b70; }
.fertilizer-evolution-paddock-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,325px),1fr)); gap:10px; }
.fertilizer-evolution-paddock { background:#fff; border:1px solid #d6e7dd; border-radius:10px; padding:13px 15px; min-width:0; }
.fertilizer-evolution-paddock-title { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#19543a; }
.fertilizer-evolution-paddock-title small { color:#677a70; }
.fertilizer-evolution-paddock p { font-size:.74rem; margin:8px 0; line-height:1.45; color:#556c60; overflow-wrap:anywhere; }
.fertilizer-evolution-paddock p span { margin:0 5px; }
.fertilizer-evolution-paddock-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.fertilizer-evolution-paddock-stats > div { display:grid; gap:3px; padding:9px 7px; background:#f2f7f4; border-radius:6px; min-width:0; }
.fertilizer-evolution-paddock-stats span { font-size:.7rem; color:#5a7666; }
.fertilizer-evolution-paddock-stats b,.fertilizer-evolution-paddock-stats strong { font-size:.8rem; overflow-wrap:anywhere; }
.fertilizer-evolution-paddock-footer { display:flex; justify-content:space-between; gap:12px; align-items:center; padding-top:11px; font-size:.75rem; color:#435f50; }
.fertilizer-evolution-history { padding:18px 0; }
.fertilizer-evolution-history-heading { margin-bottom:10px; }
.fertilizer-evolution-history-heading h3 { margin:0 0 4px; color:#1d4735; }
.fertilizer-evolution-history-heading span { font-size:.8rem; color:#61736a; }
.fertilizer-evolution-month-list { display:grid; gap:8px; }
.fertilizer-evolution-month { border:1px solid #dbe9e0; border-radius:9px; background:white; overflow:hidden; }
.fertilizer-evolution-month.is-latest-cumulative { border-color:#83b69b; background:#f4fbf6; }
.fertilizer-evolution-month header { display:flex; justify-content:space-between; gap:10px; align-items:center; padding:12px 15px; }
.fertilizer-evolution-month header > div:first-child { display:grid; gap:2px; }
.fertilizer-evolution-month header strong { color:#24523d; }
.fertilizer-evolution-month header small { color:#6b7c72; }
.fertilizer-evolution-month-actions { display:flex; align-items:center; gap:12px; }
.fertilizer-evolution-month-actions span { font-size:.75rem; color:#668074; }
.fertilizer-evolution-month-actions button { background:#e8f4ed; border:1px solid #bddbcb; border-radius:6px; padding:6px 10px; color:#146241; cursor:pointer; font-size:.8rem; font-weight:750; }
.fertilizer-evolution-days { border-top:1px solid #e0ece3; padding:8px 14px 12px; display:grid; gap:6px; }
.fertilizer-evolution-day { border:1px solid #e0e9e3; background:white; border-radius:7px; overflow:hidden; }
.fertilizer-evolution-day > button { width:100%; display:flex; justify-content:space-between; align-items:center; gap:8px; border:0; background:transparent; padding:11px 13px; cursor:pointer; color:#234d38; text-align:left; font-size:.79rem; }
.fertilizer-evolution-day > button span { font-size:.73rem; color:#648071; }
.fertilizer-evolution-day-products { padding:7px 12px; background:#f8fbf9; border-top:1px solid #e1ede5; }
.fertilizer-evolution-day-products > div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; padding:8px 3px; border-bottom:1px solid #e8efe9; }
.fertilizer-evolution-day-products > div:last-child { border:0; }
.fertilizer-evolution-day-products b { font-size:.78rem; }
.fertilizer-evolution-day-products span { font-weight:800; font-size:.78rem; }
.fertilizer-evolution-day-products small { grid-column:1/-1; color:#647d6d; }
.fertilizer-evolution-no-days { padding:15px; color:#64796c; font-size:.8rem; }
@media(max-width:850px) {
  .fertilizer-evolution-table thead { display:none; }
  .fertilizer-evolution-table, .fertilizer-evolution-table tbody, .fertilizer-evolution-table tr, .fertilizer-evolution-table td { display:block; width:100%; }
  .fertilizer-evolution-product-row { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); padding:11px; border-bottom:1px solid #d9e6dd; gap:8px; }
  .fertilizer-evolution-product-row td { display:grid; gap:3px; background:none !important; padding:5px 8px; border:0; }
  .fertilizer-evolution-product-row td:first-child { grid-column:1/-1; }
  .fertilizer-evolution-product-row td:before { content:attr(data-label); color:#607b69; font-size:.72rem; font-weight:700; }
  .fertilizer-evolution-product-row td:first-child:before { display:none; }
  .fertilizer-evolution-paddock-detail td { padding:12px !important; }
  .fertilizer-evolution-paddock-footer { flex-wrap:wrap; }
  .fertilizer-evolution-month-actions span { display:none; }
}
@media(max-width:470px) {
  .fertilizer-evolution-paddock-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fertilizer-evolution-month header { align-items:flex-start; }
  .fertilizer-evolution-day > button { flex-wrap:wrap; }
}

/* Desglose verificable del acumulado por mes y producto. */
.fertilizer-evolution-monthly-detail { margin:0 0 14px; display:grid; gap:8px; color:#22513b; }
.fertilizer-evolution-monthly-detail > strong { font-size:.84rem; }
.fertilizer-evolution-monthly-detail > small { color:#657d6d; font-size:.74rem; line-height:1.4; }
.fertilizer-evolution-monthly-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:8px; }
.fertilizer-evolution-monthly-item { background:#fff; border:1px solid #d6e7dd; border-radius:8px; padding:9px 11px; display:grid; gap:5px; font-size:.76rem; }
.fertilizer-evolution-monthly-item b { text-transform:capitalize; font-size:.81rem; }
.fertilizer-evolution-monthly-item > span { display:flex; justify-content:space-between; gap:9px; color:#60766a; }
.fertilizer-evolution-monthly-item > span strong { color:#1f5139; white-space:nowrap; }


/* Matriz de análisis: Potrero > Mes > Producto > aplicado/programa y pares de nutrientes.
   Columnas fijas sólo en escritorio; en móviles prima el desplazamiento horizontal. */
#fertilizerAnalysis .fert-nutrient-panel { overflow:hidden; min-width:0; padding:0; }
#fertilizerAnalysis .fert-nutrient-toolbar {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 14px; background:#eef6f0; border-bottom:1px solid #d8e7dc;
}
#fertilizerAnalysis .fert-nutrient-toolbar > div { display:grid; gap:2px; min-width:0; }
#fertilizerAnalysis .fert-nutrient-toolbar h3 { margin:0; font-size:.99rem; color:#1a4930; }
#fertilizerAnalysis .fert-nutrient-toolbar small { font-size:.73rem; color:#607367; }
#fertilizerAnalysis .fert-nutrient-toolbar label { display:flex; align-items:center; gap:8px; font-size:.75rem; font-weight:750; color:#385d48; white-space:nowrap; }
#fertilizerAnalysis .fert-nutrient-toolbar select { padding:6px 9px; border:1px solid #aacbb7; border-radius:6px; background:white; font:inherit; color:#1a4930; }
#fertilizerAnalysis .fert-nutrient-note { margin:0; padding:7px 14px; color:#63766b; font-size:.72rem; line-height:1.45; }
#fertilizerAnalysis .fert-nutrient-scroller {
  width:100%; max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain;
  scrollbar-width:thin; border-top:1px solid #e0eae4;
}
#fertilizerAnalysis .fert-nutrient-scroller:focus-visible { outline:2px solid #468c62; outline-offset:-2px; }
#fertilizerAnalysis .fert-nutrient-table {
  width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; table-layout:auto;
  font-size:.77rem; font-variant-numeric:tabular-nums; color:#214030;
}
#fertilizerAnalysis .fert-nutrient-table th,
#fertilizerAnalysis .fert-nutrient-table td {
  padding:7px 10px; border-right:1px solid #e1eae4; border-bottom:1px solid #e5ede8;
  line-height:1.3; white-space:nowrap; text-align:right; background:#fff;
}
#fertilizerAnalysis .fert-nutrient-table thead th {
  font-weight:800; background:#dceae1; color:#284c36; text-align:center; font-size:.74rem;
  border-bottom:1px solid #a8cbb4;
}
#fertilizerAnalysis .fert-nutrient-table thead tr:nth-child(2) th { padding:4px 8px; background:#f0f5f1; color:#526d5a; font-size:.69rem; }
#fertilizerAnalysis .fert-nutrient-table thead .fert-nutrient-head { border-left:2px solid #b4d0c1; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-real { background:#f1faf4; }
#fertilizerAnalysis .fert-nutrient-table thead .fert-nutrient-real { background:#deefe3 !important; color:#1d7146; }
#fertilizerAnalysis .fert-nutrient-table tbody tr:nth-child(even) td,
#fertilizerAnalysis .fert-nutrient-table tbody tr:nth-child(even) th { background:#f8faf8; }
#fertilizerAnalysis .fert-nutrient-table tbody tr:nth-child(even) .fert-nutrient-real { background:#eaf5ed; }
#fertilizerAnalysis .fert-nutrient-table tbody tr:hover td,
#fertilizerAnalysis .fert-nutrient-table tbody tr:hover th { background:#e7f3e9 !important; }
#fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(1) { text-align:left; min-width:86px; font-weight:800; color:#1f5e3b; }
#fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(2) { text-align:left; min-width:94px; }
#fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(3) { text-align:left; min-width:174px; font-weight:750; white-space:normal; max-width:240px; }
#fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(4),
#fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(5) { min-width:100px; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-number { min-width:65px; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-quantity-real strong { color:#137648; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-quantity-real.is-excess strong { color:#a94d2a; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-number small { color:#6b7b70; font-weight:500; font-size:.69rem; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-unknown { color:#ad6720; font-weight:800; }
#fertilizerAnalysis .fert-nutrient-table .fert-nutrient-empty { text-align:center; padding:22px; color:#6e8172; }
@media(min-width:800px) {
  #fertilizerAnalysis .fert-nutrient-table thead tr:first-child > th:nth-child(1),
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(1) { position:sticky; left:0; z-index:3; }
  #fertilizerAnalysis .fert-nutrient-table thead tr:first-child > th:nth-child(2),
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(2) { position:sticky; left:100px; z-index:3; }
  #fertilizerAnalysis .fert-nutrient-table thead tr:first-child > th:nth-child(3),
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(3) { position:sticky; left:210px; z-index:3; box-shadow:2px 0 4px #0b2c2017; }
  #fertilizerAnalysis .fert-nutrient-table thead tr:first-child > th:nth-child(-n+3) { z-index:5; }
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(1) { min-width:100px; width:100px; max-width:100px; }
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(2) { min-width:110px; width:110px; max-width:110px; }
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(3) { min-width:210px; width:210px; max-width:210px; }
}
@media(max-width:799px) {
  #fertilizerAnalysis .fert-nutrient-toolbar { flex-wrap:wrap; }
  #fertilizerAnalysis .fert-nutrient-toolbar label { width:100%; justify-content:space-between; }
  #fertilizerAnalysis .fert-nutrient-table { font-size:.74rem; }
  #fertilizerAnalysis .fert-nutrient-table tbody tr > :nth-child(1) { position:sticky; left:0; z-index:2; min-width:88px; }
}


/* v9 — Matriz para presentaciones: bandas Productos/Unidades, cada producto
   ocupa Real + Prog con su color; el potrero aparece una vez por grupo. */
#fertilizerAnalysis .fert-pivot-panel { min-width:0; }
#fertilizerAnalysis .fert-pivot-scroller { max-height:min(72vh, 920px); overflow:auto; }
#fertilizerAnalysis .fert-pivot-table {
  border-spacing:0; width:max-content; min-width:100%; border-collapse:separate;
  table-layout:auto; font-size:.78rem;
}
#fertilizerAnalysis .fert-pivot-table th,
#fertilizerAnalysis .fert-pivot-table td { border-right:1px solid #dde8e1; border-bottom:1px solid #e1e9e4; }
#fertilizerAnalysis .fert-pivot-table thead th { text-align:center; white-space:normal; line-height:1.25; }
#fertilizerAnalysis .fert-pivot-table thead tr.fert-pivot-group-head th {
  height:35px; padding:8px 12px; color:#fff; border-color:#cbdcd1; font-size:.83rem;
  letter-spacing:.025em; font-weight:850;
}
#fertilizerAnalysis .fert-pivot-products-band { background:#24744f!important; }
#fertilizerAnalysis .fert-pivot-nutrients-band { background:#315e76!important; border-left:3px solid #9ebdc8!important; }
#fertilizerAnalysis .fert-pivot-fixed-potrero,
#fertilizerAnalysis .fert-pivot-fixed-month { background:#1e5840!important; }
#fertilizerAnalysis .fert-pivot-fixed-potrero { min-width:108px; width:108px; }
#fertilizerAnalysis .fert-pivot-fixed-month { min-width:105px; width:105px; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-product-head {
  min-width:140px; max-width:220px; padding:8px 8px;
  background:var(--pivot-real)!important; color:var(--pivot-accent)!important;
  border-right:3px solid var(--pivot-separator)!important; border-bottom:1px solid var(--pivot-separator)!important;
  text-align:center!important; font-size:.78rem; font-weight:850;
}
#fertilizerAnalysis .fert-pivot-product-head span { display:block; text-align:center; overflow-wrap:anywhere; }
#fertilizerAnalysis .fert-pivot-product-head small { display:block; font-size:.68rem; color:#536d60; font-weight:600; padding-top:3px; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-nutrient-head {
  min-width:140px; padding:8px 7px; background:#e2eff4!important; color:#24556b!important;
  border-right:3px solid #a6becb!important; text-align:center!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-subhead,
#fertilizerAnalysis .fert-pivot-table .fert-pivot-nutrient-sub {
  min-width:70px; padding:6px 8px; font-size:.7rem; text-align:center!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-subhead.fert-pivot-real {
  background:var(--pivot-real)!important; color:var(--pivot-accent)!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-subhead.fert-pivot-prog {
  background:var(--pivot-prog)!important; color:#4f5f57!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-nutrient-sub { background:#eef5f8!important; color:#496a7b!important; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-nutrient-real { background:#e9f2f6!important; color:#226584; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-nutrient-prog { background:#f7fafb!important; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-pair-end { border-right:3px solid var(--pivot-separator, #a6becb)!important; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-value {
  min-width:70px; width:auto; max-width:none; padding:8px 9px; font-weight:720;
  white-space:nowrap!important; text-align:right!important;
  position:static!important; left:auto!important; box-shadow:none!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-value.fert-pivot-real {
  background:var(--pivot-real)!important; color:var(--pivot-accent);
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-value.fert-pivot-prog {
  background:var(--pivot-prog)!important; color:#384b42;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-value abbr { border-bottom:0; text-decoration:none; color:#a16727; font-weight:800; }
#fertilizerAnalysis .fert-pivot-table tbody tr.fert-pivot-row:hover .fert-pivot-value {
  filter:brightness(.96);
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-potrero {
  position:sticky!important; left:0!important; z-index:5; width:108px!important;
  min-width:108px!important; max-width:108px!important;
  padding:12px 10px; vertical-align:middle; text-align:center!important;
  border-right:3px solid #719e87!important; border-bottom:3px solid #83a995!important;
  color:#174e35!important; font-size:.88rem; font-weight:900; letter-spacing:.015em;
  background:#d2ebdc!important; white-space:normal!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-potrero-1 { background:#c7e2d6!important; }
#fertilizerAnalysis .fert-pivot-potrero span { display:block; max-width:100%; overflow-wrap:anywhere; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-month {
  position:sticky!important; left:108px!important; z-index:4;
  min-width:105px!important; width:105px!important; max-width:105px!important;
  padding:8px 10px; text-align:center!important; font-weight:750; vertical-align:middle;
  background:#f2f7f3!important; color:#355947; box-shadow:2px 0 3px #20432d11;
  white-space:normal!important;
}
#fertilizerAnalysis .fert-pivot-table .fert-pivot-row.is-first > * { border-top:2px solid #9fbdad!important; }
#fertilizerAnalysis .fert-pivot-table .fert-pivot-row.is-last > * { border-bottom:3px solid #9fbdad!important; }
#fertilizerAnalysis .fert-pivot-table thead th { position:sticky; z-index:7; }
#fertilizerAnalysis .fert-pivot-table thead tr:first-child th { top:0; }
#fertilizerAnalysis .fert-pivot-table thead tr:nth-child(2) th { top:35px; }
#fertilizerAnalysis .fert-pivot-table thead tr:nth-child(3) th { top:79px; }
#fertilizerAnalysis .fert-pivot-table thead .fert-pivot-fixed-potrero { left:0; z-index:10; }
#fertilizerAnalysis .fert-pivot-table thead .fert-pivot-fixed-month { left:108px; z-index:10; box-shadow:2px 0 4px #20432d20; }
/* Una paleta tenue y consistente por producto: el mismo tono agrupa Real y Prog. */
#fertilizerAnalysis .fert-pivot-tone-0 { --pivot-real:#d9eee1; --pivot-prog:#eff8f2; --pivot-accent:#236646; --pivot-separator:#91b6a0; }
#fertilizerAnalysis .fert-pivot-tone-1 { --pivot-real:#dcebf8; --pivot-prog:#f0f7fc; --pivot-accent:#2c5c8c; --pivot-separator:#99b9d5; }
#fertilizerAnalysis .fert-pivot-tone-2 { --pivot-real:#f8e8d9; --pivot-prog:#fdf5ec; --pivot-accent:#945a2c; --pivot-separator:#d7b28f; }
#fertilizerAnalysis .fert-pivot-tone-3 { --pivot-real:#eee2f6; --pivot-prog:#f8f1fc; --pivot-accent:#75518c; --pivot-separator:#c0a7d2; }
#fertilizerAnalysis .fert-pivot-tone-4 { --pivot-real:#e7edcf; --pivot-prog:#f6f8e7; --pivot-accent:#626e2f; --pivot-separator:#b6c391; }
#fertilizerAnalysis .fert-pivot-tone-5 { --pivot-real:#f4dfe9; --pivot-prog:#fcf2f7; --pivot-accent:#92516e; --pivot-separator:#cfa9bb; }
#fertilizerAnalysis .fert-pivot-tone-6 { --pivot-real:#d8eeec; --pivot-prog:#eef9f7; --pivot-accent:#276d69; --pivot-separator:#94c2bd; }
#fertilizerAnalysis .fert-pivot-tone-7 { --pivot-real:#e6e6fa; --pivot-prog:#f4f4fc; --pivot-accent:#4c5b8a; --pivot-separator:#abb0d5; }
#fertilizerAnalysis .fert-pivot-empty { padding:35px 16px; text-align:center; color:#668272; }
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-scroller { max-height:70vh; }
  #fertilizerAnalysis .fert-pivot-table .fert-pivot-potrero { min-width:84px!important; width:84px!important; max-width:84px!important; font-size:.77rem; }
  #fertilizerAnalysis .fert-pivot-table .fert-pivot-month { left:84px!important; min-width:83px!important; width:83px!important; max-width:83px!important; }
  #fertilizerAnalysis .fert-pivot-table thead .fert-pivot-fixed-potrero { min-width:84px; width:84px; }
  #fertilizerAnalysis .fert-pivot-table thead .fert-pivot-fixed-month { left:84px; min-width:83px; width:83px; }
  #fertilizerAnalysis .fert-pivot-table .fert-pivot-value { min-width:62px; padding:7px 6px; }
  #fertilizerAnalysis .fert-pivot-table .fert-pivot-product-head,
  #fertilizerAnalysis .fert-pivot-table .fert-pivot-nutrient-head { min-width:124px; }
}


/* v10 — Análisis compacto: único filtro de especie, ancho por contenido y
   encabezados Productos / Real / Prog. inmóviles al recorrer verticalmente. */
#fertilizerAnalysis .fert-pivot-compact { margin-top:0!important; padding:0!important; }
#fertilizerAnalysis .fert-pivot-controls {
  display:flex; justify-content:flex-end; align-items:center; padding:3px 6px;
  min-height:30px; background:#fff; border-bottom:1px solid #dbe8dd;
}
#fertilizerAnalysis .fert-pivot-controls select {
  width:auto; max-width:min(100%,190px); min-height:26px;
  padding:3px 22px 3px 8px; border-radius:5px; border:1px solid #bfd4c4;
  background:#f6faf7; color:#225c40; font-size:.72rem; font-weight:700; line-height:1.2; font-family:inherit; cursor:pointer;
}
#fertilizerAnalysis .fert-pivot-scroller {
  width:100%; max-width:100%; max-height:min(81vh,1150px)!important;
  overflow-x:auto!important; overflow-y:auto!important;
  scrollbar-width:thin;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table {
  width:max-content!important; min-width:0!important;
  max-width:none!important; table-layout:auto!important; border-collapse:separate!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table th,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table td {
  box-sizing:border-box;
  text-align:center!important; vertical-align:middle!important;
  width:auto!important; min-width:0!important; max-width:none!important;
  padding:6px 9px!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-nutrient-head {
  width:auto!important; min-width:0!important; max-width:none!important;
  text-align:center!important; padding:6px 11px!important;
  white-space:nowrap!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head span,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head small {
  white-space:nowrap!important; text-align:center!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-subhead,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-nutrient-sub,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-value {
  width:auto!important; min-width:0!important; max-width:none!important;
  padding:6px 9px!important;
  text-align:center!important; white-space:nowrap!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-potrero {
  width:auto!important; min-width:0!important; max-width:none!important;
  padding:8px 10px!important; text-align:center!important; vertical-align:middle!important;
  position:sticky!important; left:0!important; z-index:5!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-month {
  width:auto!important; min-width:0!important; max-width:none!important;
  padding:6px 9px!important; text-align:center!important; vertical-align:middle!important;
  position:sticky!important;
  left:var(--fert-pivot-paddock-width,90px)!important; z-index:4!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-fixed-potrero {
  width:auto!important; min-width:0!important; max-width:none!important;
  left:0!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-fixed-month {
  width:auto!important; min-width:0!important; max-width:none!important;
  left:var(--fert-pivot-paddock-width,90px)!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:nth-child(2) th {
  top:var(--fert-pivot-head-one,35px)!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:nth-child(3) th {
  top:var(--fert-pivot-head-two,79px)!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-group-head th {
  top:0!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-species-row th {
  background:#d5e7dc!important; color:#285f43!important;
  font-size:.76rem; font-weight:850; text-transform:uppercase;
  letter-spacing:.06em; border-top:3px solid #739987!important;
  border-bottom:2px solid #9dbca8!important; padding:6px 10px!important;
  text-align:center!important; position:static!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-row.is-first > *,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-row.is-last > * {
  border-top-color:#91b7a0!important;
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table th,
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table td { padding:5px 6px!important; }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-month {
    left:var(--fert-pivot-paddock-width,90px)!important;
  }
}


/* v11 — rango, vista acumulada y tres filas superiores congeladas. */
#fertilizerAnalysis .fertilizer-analysis-shell {
  gap:0!important;
  min-height:calc(100dvh - 70px);
  align-content:start;
}
#fertilizerAnalysis .fert-pivot-compact {
  display:flex!important;
  flex-direction:column;
  min-height:calc(100dvh - 76px);
  overflow:visible!important;
}
#fertilizerAnalysis .fert-pivot-controls {
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  flex-wrap:wrap;
  gap:5px 10px;
  min-height:34px;
  padding:3px 7px!important;
  background:#fff;
  flex:0 0 auto;
}
#fertilizerAnalysis .fert-pivot-controls label {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:4px;
  white-space:nowrap;
  color:#365c49;
  font-size:.69rem;
  font-weight:800;
}
#fertilizerAnalysis .fert-pivot-controls :is(select,input[type="date"]) {
  box-sizing:border-box;
  height:26px!important;
  min-height:26px!important;
  max-width:190px;
  width:auto;
  border:1px solid #bed3c6;
  border-radius:5px;
  background:#f7faf8;
  color:#23553c;
  font-family:inherit; font-size:.71rem; font-weight:700; line-height:1.2;
  padding:3px 6px!important;
  box-shadow:none;
}
#fertilizerAnalysis .fert-pivot-controls input[type="date"] {
  width:120px;
  min-width:120px;
  max-width:130px;
  font-family:inherit;
}
#fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-mode] { max-width:150px; }
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-scroller {
  position:relative;
  display:block;
  flex:1 1 auto;
  height:calc(100dvh - 118px);
  max-height:none!important;
  min-height:240px;
  overscroll-behavior:contain;
  overflow:auto!important;
  border:1px solid #b8cfbd;
  background:#fff;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table {
  border-collapse:separate!important;
  border-spacing:0!important;
}
/* Cabeceras fijas: cada fila hereda su altura efectiva del cálculo de JS. */
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead th {
  position:sticky!important;
  background-clip:padding-box;
  z-index:20!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:first-child > th {
  top:0!important;
  z-index:23!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:nth-child(2) > th {
  top:var(--fert-pivot-head-one,35px)!important;
  z-index:21!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:nth-child(3) > th {
  top:var(--fert-pivot-head-two,79px)!important;
  z-index:20!important;
  box-shadow:0 3px 4px #173b2920;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead :is(.fert-pivot-fixed-potrero,.fert-pivot-fixed-month) {
  z-index:30!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-fixed-potrero {
  left:0!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-fixed-month {
  left:var(--fert-pivot-paddock-width,90px)!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead .fert-pivot-group-head {
  box-shadow:0 3px 5px #0d382720;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-row.is-current-month > :is(td,th.fert-pivot-month) {
  border-bottom:3px solid #e4a12f!important;
  box-shadow:inset 0 -2px 0 #e4a12f;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-row.is-current-month > .fert-pivot-month {
  color:#975d0a!important;
  font-weight:900!important;
  text-decoration:underline;
  text-decoration-color:#e4a12f;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-row.is-current-month > :is(td,th):hover {
  filter:brightness(.97);
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-controls { justify-content:flex-start!important; gap:4px 8px; }
  #fertilizerAnalysis .fert-pivot-controls label { font-size:.65rem; }
  #fertilizerAnalysis .fert-pivot-controls :is(select,input[type="date"]) { height:28px!important; }
  #fertilizerAnalysis .fert-pivot-controls input[type="date"] { width:117px; min-width:117px; }
  #fertilizerAnalysis .fert-pivot-compact { min-height:calc(100dvh - 68px); }
}


/* v12 — productos hasta dos líneas, sin unidad visible; déficit sólo en acumulado. */
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head {
  min-width:96px!important;
  max-width:166px!important;
  width:auto!important;
  white-space:normal!important;
  padding:5px 7px!important;
  overflow-wrap:anywhere!important;
  hyphens:auto;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head span {
  display:-webkit-box!important;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  max-width:154px;
  margin-inline:auto;
  overflow:hidden;
  overflow-wrap:anywhere!important;
  white-space:normal!important;
  text-align:center!important;
  line-height:1.18;
  font-size:.75rem;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head small {
  display:none!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-missing {
  background:#fff5e9!important;
  color:#905814!important;
  font-weight:800!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-subhead.fert-pivot-missing {
  background:#fce8d1!important;
  color:#824a10!important;
  font-size:.66rem!important;
  padding-inline:6px!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table td.fert-pivot-missing {
  border-right-color:#d6bca0!important;
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head {
    min-width:90px!important;
    max-width:148px!important;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head span {
    max-width:138px;
  }
}


/* v13 — encabezado continuo fijo y faltantes en rojo.
   Fijar THEAD completo evita que los desplazamientos y alturas dinámicas
   de los 3 niveles (Productos, producto, Real/Prog./Faltante) los separen. */
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-scroller {
  isolation:isolate;
  overscroll-behavior-y:contain;
  overflow:auto!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead {
  position:sticky!important;
  top:0!important;
  z-index:35!important;
  background:#e9f3ec;
  box-shadow:0 4px 6px rgba(19,49,33,.20);
}
/* El thead se mueve como un solo bloque; las celdas no deben aplicar
   un segundo sticky vertical sobre las otras dos filas. */
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:first-child > th,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:nth-child(2) > th,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:nth-child(3) > th {
  position:static!important;
  top:auto!important;
  z-index:auto!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:first-child > th.fert-pivot-fixed-potrero {
  position:sticky!important;
  top:auto!important;
  left:0!important;
  z-index:45!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead tr:first-child > th.fert-pivot-fixed-month {
  position:sticky!important;
  top:auto!important;
  left:var(--fert-pivot-paddock-width,90px)!important;
  z-index:44!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table tbody tr.is-species-start > * {
  border-top:3px solid #86a998!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-missing {
  background:#fff0f0!important;
  color:#b42332!important;
  font-weight:850!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-subhead.fert-pivot-missing,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-nutrient-sub.fert-pivot-missing {
  background:#fbdadd!important;
  color:#a31e2f!important;
  font-weight:850!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-missing abbr {
  color:#a31e2f!important;
}


/* v14 — matriz de alta densidad, con valores absolutos o por hectárea. */
#fertilizerAnalysis .fert-pivot-controls {
  gap:3px 7px!important;
  min-height:29px!important;
  padding:2px 5px!important;
}
#fertilizerAnalysis .fert-pivot-controls label {
  gap:3px!important;
  font-size:.65rem!important;
}
#fertilizerAnalysis .fert-pivot-controls :is(select,input[type="date"]) {
  height:24px!important;
  min-height:24px!important;
  font-size:.68rem!important;
  padding:2px 5px!important;
}
#fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-unit-mode] {
  min-width:76px;
  max-width:91px;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table {
  font-size:.70rem!important;
  line-height:1.12!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table th,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table td {
  padding:4px 5px!important;
  line-height:1.12!important;
  letter-spacing:0!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head {
  min-width:76px!important;
  max-width:125px!important;
  padding:4px 5px!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head span {
  max-width:116px!important;
  font-size:.69rem!important;
  line-height:1.12!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-nutrient-head {
  min-width:0!important;
  padding:4px 5px!important;
  font-size:.69rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table :is(
  .fert-pivot-subhead,.fert-pivot-nutrient-sub
) {
  min-width:0!important;
  padding:3px 4px!important;
  font-size:.63rem!important;
  line-height:1.1!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-value {
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  padding:4px 5px!important;
  white-space:nowrap!important;
  font-size:.70rem!important;
  font-variant-numeric:tabular-nums;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-potrero {
  padding:6px!important;
  font-size:.73rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-month {
  padding:4px 5px!important;
  font-size:.68rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-group-head > th {
  height:auto!important;
  padding:5px 6px!important;
  font-size:.73rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-pair-end {
  border-right-width:2px!important;
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table th,
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table td {
    padding:4px!important;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head {
    min-width:72px!important;
    max-width:118px!important;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-product-head span {
    max-width:110px!important;
  }
}


/* El filtro GEM fue reemplazado por Variedad; conservar estilos de bloque para informes históricos. */
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-fixed-block {
  position:sticky!important;
  left:var(--fert-pivot-paddock-width,90px)!important;
  z-index:44!important;
  background:#205a46!important;
  color:#fff!important;
  text-align:center!important;
  font-weight:850!important;
  padding:4px 6px!important;
  white-space:nowrap!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-block {
  position:sticky!important;
  left:var(--fert-pivot-paddock-width,90px)!important;
  z-index:5!important;
  background:#e5eef8!important;
  color:#23548a!important;
  font-size:.71rem!important;
  font-weight:850!important;
  text-align:center!important;
  vertical-align:middle!important;
  padding:5px!important;
  border-right:2px solid #88abc8!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table:has(.fert-pivot-fixed-block) .fert-pivot-month,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table:has(.fert-pivot-fixed-block) .fert-pivot-fixed-month {
  left:var(--fert-pivot-month-left,170px)!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-table thead .fert-pivot-fixed-block {
  z-index:44!important;
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-table .fert-pivot-block { font-size:.67rem!important; }
}

/* v18 — selector compacto de columnas: Productos o Unidades. */
#fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:3px;
  padding:3px;
  border:1px solid #b9cfbf;
  border-radius:7px;
  background:#edf4ef;
}
#fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:88px;
  height:28px;
  margin:0;
  padding:3px 12px!important;
  border:1px solid transparent;
  border-radius:5px;
  background:transparent;
  color:#25372d;
  font:inherit;
  font-size:.73rem;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  cursor:pointer;
  transition:background .12s ease;
}
#fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view button.is-active {
  border-color:#1c6a48;
  background:#1c6a48;
  color:#fff;
}
#fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view button:not(.is-active):hover {
  background:#d8eadf;
}
#fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view button:focus-visible {
  outline:2px solid #2563eb;
  outline-offset:2px;
}
@media(max-width:760px){
  #fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view {width:100%;}
  #fertilizerAnalysis .fert-pivot-controls .fert-pivot-column-view button {flex:1;min-height:30px;}
}

/* v19 — Productos: todas las columnas visibles sin desplazamiento horizontal.
   Potrero/Mes permanecen fijos y cada pareja Real/Prog comparte el espacio. */
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-scroller.fert-pivot-fit-products {
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table {
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  table-layout:fixed!important;
  border-collapse:separate!important;
}
#fertilizerAnalysis .fert-pivot-fit-products .fert-pivot-table col.fert-fit-potrero {width:66px;}
#fertilizerAnalysis .fert-pivot-fit-products .fert-pivot-table col.fert-fit-month {width:76px;}
#fertilizerAnalysis .fert-pivot-fit-products .fert-pivot-table col.fert-fit-block {width:39px;}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table :is(th,td) {
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:none!important;
  width:auto!important;
  padding:3px 1px!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table :is(
  .fert-pivot-product-head,.fert-pivot-subhead,.fert-pivot-value
) {
  min-width:0!important;
  max-width:none!important;
  width:auto!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-product-head {
  padding:3px 2px!important;
  font-size:clamp(.54rem,.7vw,.72rem)!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  hyphens:auto;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-product-head span {
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow:visible!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  -webkit-line-clamp:unset!important;
  line-clamp:unset!important;
  font-size:inherit!important;
  line-height:1.13!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-value {
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  font-size:clamp(.52rem,.72vw,.69rem)!important;
  line-height:1.12!important;
  font-variant-numeric:tabular-nums!important;
  padding:3px 1px!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-subhead {
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  font-size:clamp(.51rem,.66vw,.64rem)!important;
  padding:3px 0!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-potrero {
  left:0!important;
  padding:4px 2px!important;
  white-space:normal!important;
  font-size:.7rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-fixed-potrero {
  left:0!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-month,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-fixed-month {
  left:var(--fert-pivot-month-left,66px)!important;
  padding:4px 1px!important;
  font-size:.66rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-block,
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-fixed-block {
  left:var(--fert-pivot-paddock-width,66px)!important;
  padding:4px 1px!important;
  font-size:.65rem!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-group-head > th {
  padding:4px 1px!important;
}
#fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table .fert-pivot-pair-end {
  border-right-width:1px!important;
}
/* En pantallas estrechas la información se apila por producto en cada mes.
   Evita tanto columnas microscópicas como cualquier scroll horizontal. */
@media(max-width:1000px){
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table,
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table tbody {
    display:block!important;
    width:100%!important;
  }
  #fertilizerAnalysis .fert-pivot-fit-products .fert-pivot-table :is(colgroup,thead) {display:none!important;}
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table tbody tr.fert-pivot-row {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:3px;
    margin:5px 0 9px;
    padding:6px;
    border:1px solid #c8ddd0;
    border-radius:7px;
    background:#fff!important;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products[data-cumulative="true"] .fert-pivot-table tbody tr.fert-pivot-row {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table tbody tr.fert-pivot-row::before {
    content:attr(data-potrero) " · " attr(data-month) " " attr(data-block);
    display:block;
    grid-column:1/-1;
    padding:4px 6px;
    background:#e4f1e9;
    border-radius:4px;
    color:#163d29;
    font-size:.8rem;
    font-weight:850;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table tbody :is(.fert-pivot-potrero,.fert-pivot-block,.fert-pivot-month) {
    display:none!important;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table tbody td.fert-pivot-value {
    display:block!important;
    min-width:0!important;
    width:100%!important;
    padding:6px!important;
    border:1px solid #d6e5db!important;
    border-radius:4px;
    text-align:left!important;
    font-size:.87rem!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table td.fert-pivot-value::before {
    content:attr(data-measure);
    display:block;
    margin-bottom:3px;
    color:#283b31;
    font-size:.68rem;
    font-weight:850;
  }
  #fertilizerAnalysis .fert-pivot-compact .fert-pivot-fit-products .fert-pivot-table td.fert-pivot-real::before {
    content:attr(data-product) " · Real";
  }
}

/* v20 — Variedad depende de Especie y comparte la fila compacta de filtros. */
#fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-variety] {
  width:auto!important;
  min-width:90px;
  max-width:150px!important;
  text-overflow:ellipsis;
  color:#182b20!important;
  background:#f7faf8!important;
  border:1px solid #bed3c6!important;
}
#fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-variety]:focus-visible {
  outline:2px solid #22734d!important;
  outline-offset:1px;
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-variety] {
    max-width:136px!important;
  }
}

/* v21 — temporada julio-junio, selector compacto junto a especie y variedad. */
#fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-season] {
  min-width:104px!important;
  max-width:118px!important;
  padding-right:15px!important;
  color:#182b20!important;
  background:#f7faf8!important;
  border:1px solid #bed3c6!important;
  font-variant-numeric:tabular-nums;
}
#fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-season]:focus-visible {
  outline:2px solid #22734d!important;
  outline-offset:1px;
}
@media(max-width:760px) {
  #fertilizerAnalysis .fert-pivot-controls [data-fert-pivot-season] {
    min-width:103px!important;
    max-width:115px!important;
  }
}
