/* Fenología · Mes completo sin desplazamiento horizontal.
   Las columnas de fecha son flexibles: 28, 29, 30 o 31 entran en el ancho visible.
   Mantener independiente de estilos legacy y de la vista anual. */
#phenologyMonitoring .phenology-calendar-panel.phenology-month-fitted {
  --phenology-fit-potrero: 90px;
  --phenology-fit-block: 48px;
  min-width: 0 !important;
  max-width: 100% !important;
}
#phenologyMonitoring .phenology-month-fitted > .phenology-table-scroll {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-x: none;
}
#phenologyMonitoring .phenology-calendar-table.is-month {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-spacing: 0 !important;
  font-variant-numeric: tabular-nums;
}
#phenologyMonitoring .phenology-calendar-table.is-month col.phenology-fit-potrero-col {
  width: var(--phenology-fit-potrero) !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month col.phenology-fit-block-col {
  width: var(--phenology-fit-block) !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month col.phenology-fit-day-col {
  width: auto !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month
:is(.phenology-potrero-corner,.phenology-potrero-row-label) {
  left: 0 !important;
  width: var(--phenology-fit-potrero) !important;
  min-width: 0 !important;
  max-width: var(--phenology-fit-potrero) !important;
  padding: 4px 3px !important;
  overflow-wrap: anywhere;
}
#phenologyMonitoring .phenology-calendar-table.is-month
:is(.phenology-block-corner,.phenology-block-row-label) {
  left: var(--phenology-fit-potrero) !important;
  width: var(--phenology-fit-block) !important;
  min-width: 0 !important;
  max-width: var(--phenology-fit-block) !important;
  padding: 3px 2px !important;
  overflow-wrap: anywhere;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-day-head,
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-day-head.phenology-day-active-col,
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-day-head.phenology-day-empty-col {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 27px !important;
  padding: 2px 0 !important;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-day-head strong {
  display: block;
  font-size: clamp(6px, .8vw, 10px) !important;
  letter-spacing: -0.035em;
  font-weight: 850;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.15 !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month
:is(.phenology-calendar-cell,.phenology-gantt-cell,.phenology-gantt-empty) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden;
  padding: 1px !important;
  box-sizing: border-box;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-calendar-records {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 27px;
  box-sizing: border-box;
  padding: 3px 4px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-left-width: 2px !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event strong,
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event small {
  display: block !important;
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  line-height: 1.08 !important;
  -webkit-line-clamp: unset !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event strong {
  font-size: .63rem !important;
}
#phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event small {
  font-size: .52rem !important;
}
@media(max-width:980px){
  #phenologyMonitoring .phenology-month-fitted {
    --phenology-fit-potrero: 68px;
    --phenology-fit-block: 39px;
  }
}
@media(max-width:560px){
  #phenologyMonitoring .phenology-month-fitted {
    --phenology-fit-potrero: 48px;
    --phenology-fit-block: 30px;
  }
  #phenologyMonitoring .phenology-calendar-table.is-month
  :is(.phenology-potrero-row-label,.phenology-block-row-label) {
    font-size: .51rem !important;
    line-height: 1.05 !important;
  }
  #phenologyMonitoring .phenology-calendar-table.is-month .phenology-day-head {
    height: 24px !important;
  }
  #phenologyMonitoring .phenology-calendar-table.is-month .phenology-day-head strong {
    font-size: 6px !important;
  }
  #phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event {
    min-height: 21px !important;
    padding: 2px 1px !important;
    border-left-width: 1px !important;
  }
  #phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event strong {
    font-size: .53rem !important;
  }
  #phenologyMonitoring .phenology-calendar-table.is-month .phenology-gantt-event small {
    font-size: .44rem !important;
  }
}
@media(max-width:360px){
  #phenologyMonitoring .phenology-month-fitted {
    --phenology-fit-potrero: 41px;
    --phenology-fit-block: 25px;
  }
}

/* Filtro de fechas del mapa fenológico: compacto y adaptado a terreno. */
#phenologyMonitoring .phenology-toolbar-filters .phenology-date-filter { min-width: 130px; }
#phenologyMonitoring .phenology-toolbar-filters .phenology-date-filter input {
  width: 148px;
  min-width: 0;
  height: 38px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid #bcd4c8;
  border-radius: 6px;
  background: #fff;
  color: #18352b;
  font: inherit;
  font-size: .82rem;
}
#phenologyMonitoring .phenology-toolbar-filters .phenology-date-clear {
  min-height: 38px;
  padding: 0 10px;
}
#phenologyMonitoring .phenology-toolbar-filters .phenology-date-error {
  flex-basis: 100%;
  color: #9d2b2b;
  font-size: .78rem;
  font-weight: 700;
}
@media (max-width: 680px) {
  #phenologyMonitoring .phenology-toolbar-filters .phenology-date-filter { flex: 1 1 145px; }
  #phenologyMonitoring .phenology-toolbar-filters .phenology-date-filter input { width: 100%; }
}


/* Gantt de Fenología resumida: una fila por potrero, 4–6 semanas o 12 meses. */
#phenologyMonitoring .phenology-summary-gantt {
  width: 100%;
  min-width: 0 !important;
  max-width: 100% !important;
}
#phenologyMonitoring .phenology-summary-gantt > .phenology-table-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-y: auto;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-spacing: 0;
}
#phenologyMonitoring .phenology-summary-gantt col.phenology-summary-potrero-col {
  width: 125px;
}
#phenologyMonitoring .phenology-summary-gantt col.phenology-summary-period-col {
  width: auto;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-potrero-corner,
#phenologyMonitoring .phenology-summary-gantt .phenology-potrero-row-label {
  width: 125px !important;
  min-width: 0 !important;
  max-width: 125px !important;
  left: 0 !important;
  padding: 6px !important;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-week-head,
#phenologyMonitoring .phenology-summary-gantt .phenology-month-head,
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-cell {
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  box-sizing: border-box;
  text-align: center;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-week-head,
#phenologyMonitoring .phenology-summary-gantt .phenology-month-head {
  padding: 6px 2px !important;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-week-head strong,
#phenologyMonitoring .phenology-summary-gantt .phenology-month-head strong {
  display: block;
  font-size: clamp(.59rem, .85vw, .8rem);
  line-height: 1.15;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-week-head small {
  display: block;
  font-size: clamp(.48rem, .7vw, .66rem);
  line-height: 1.15;
  opacity: .84;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-gantt-cell {
  padding: 2px !important;
  overflow: hidden;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-records {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event {
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  padding: 5px !important;
  border-left-width: 3px !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px !important;
  text-align: center;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event strong,
#phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event small {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.16 !important;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event strong {
  font-size: clamp(.57rem, .8vw, .78rem) !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event small {
  font-size: clamp(.49rem, .68vw, .66rem) !important;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-summary-note {
  margin: 9px 8px 5px;
  font-size: .74rem;
  color: #456055;
  line-height: 1.4;
}
@media (max-width: 720px) {
  #phenologyMonitoring .phenology-summary-gantt col.phenology-summary-potrero-col {
    width: 80px;
  }
  #phenologyMonitoring .phenology-summary-gantt .phenology-potrero-corner,
  #phenologyMonitoring .phenology-summary-gantt .phenology-potrero-row-label {
    width: 80px !important;
    max-width: 80px !important;
    font-size: .68rem;
    padding: 3px !important;
  }
  #phenologyMonitoring .phenology-summary-gantt .phenology-month-head {
    padding: 3px 0 !important;
  }
  #phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event {
    padding: 3px 1px !important;
    min-height: 28px;
  }
  #phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event strong {
    font-size: .55rem !important;
  }
  #phenologyMonitoring .phenology-summary-gantt .phenology-gantt-event small {
    display: none !important;
  }
  #phenologyMonitoring .phenology-summary-gantt .phenology-week-head small {
    font-size: .54rem;
  }
}

/* Superar también el min-width !important de la antigua vista anual. */
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-table.is-year .phenology-month-head {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-table.is-year .phenology-gantt-event {
  display: flex !important;
}

/* En pantallas pequeñas, doce meses muestran el icono y color de la etapa;
   el nombre completo permanece accesible al tocar la celda. */
@media (max-width: 720px) {
  #phenologyMonitoring .phenology-summary-monthly .phenology-gantt-event strong {
    font-size: 0 !important;
    line-height: 1 !important;
  }
  #phenologyMonitoring .phenology-summary-monthly .phenology-stage-glyph {
    font-size: 1rem !important;
    margin: 0 !important;
  }
}

/* Las celdas anuales heredaban 118px mínimos (incluidos los colspan).
   Anularlos explícitamente para que las doce columnas no se desborden. */
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-table.is-year .phenology-calendar-cell,
#phenologyMonitoring .phenology-summary-gantt .phenology-calendar-table.is-week .phenology-calendar-cell {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 38px;
  box-sizing: border-box;
}
