.form-panel [hidden] { display: none !important; }
.machine-picker { border:1px solid #bfcbbd; border-radius:7px; background:white; }
.machine-picker summary { padding:10px; cursor:pointer; }
.machine-picker summary:focus-visible { outline:2px solid var(--green); }
.machine-options { max-height:230px; overflow-y:auto; padding:10px; border-top:1px solid #dedfd2; }
.machine-options label { display:flex; gap:10px; align-items:center; padding:6px; cursor:pointer; }
.machinery-heading { grid-column:1 / -1; margin-top:6px; padding-top:18px; border-top:1px solid var(--line); }
.machinery-heading h2 { margin:0 0 4px; font-size:20px; }
.machinery-heading p { margin:0 0 6px; color:var(--muted); }
#field-automotive_machine, #field-implement { grid-column:1 / -1; border:1px solid var(--line); border-radius:10px; background:#f8faf3; padding:16px; }
.treatment-heading { grid-column:1 / -1; margin-top:6px; padding-top:18px; border-top:1px solid var(--line); }
.treatment-heading h2 { margin:0 0 4px; font-size:20px; }
.treatment-heading p { margin:0 0 6px; color:var(--muted); }
#field-treatment_types { grid-column:1 / -1; border:1px solid var(--line); border-radius:10px; background:#f8faf3; padding:16px; }
#field-treatment_types ul { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 14px; }
#field-treatment_application_hectares { grid-column:1 / -1; border:1px solid var(--line); border-radius:10px; background:#f8faf3; padding:16px; }
.treatment-planting-area { margin:10px 0 0; color:var(--muted); }
.treatment-planting-area strong { color:var(--ink); }
.treatment-dose-field { display:none !important; }
.treatment-product-picker { grid-column:1 / -1; border:1px solid var(--line); border-radius:10px; background:#fffef8; padding:16px; }
.treatment-product-picker .section-head { margin-bottom:12px; }
.treatment-product-picker .section-head h3,.treatment-product-picker .section-head p { margin:0 0 4px; }
.treatment-product-picker .section-head p { color:var(--muted); }
.treatment-product-row { display:grid; grid-template-columns:minmax(180px,.9fr) minmax(280px,1.5fr) minmax(170px,.7fr) auto; gap:12px; align-items:end; padding:14px 0; border-top:1px solid var(--line); }
.treatment-product-row:first-child { border-top:0; padding-top:0; }
.treatment-product-row .form-field { margin:0; }
.treatment-product-row select,.treatment-product-row input { width:100%; }
.treatment-dose-control { display:flex; align-items:center; gap:8px; }
.treatment-dose-control span { color:var(--muted); white-space:nowrap; }
.treatment-product-remove { margin-bottom:1px; }
@media(max-width:850px){#field-treatment_types ul{grid-template-columns:1fr}.treatment-product-row{grid-template-columns:1fr;align-items:stretch}.treatment-product-remove{justify-self:start}.treatment-product-picker .section-head{align-items:flex-start;flex-direction:column}}
.form-auxiliary { margin-top:22px; padding-top:14px; border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
.form-auxiliary p { margin:4px 0; }
.form-auxiliary output { color:var(--ink); font-weight:600; }
.work-resources {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.work-resource-add-action {
  justify-content: flex-end;
  margin-top: 14px;
}

.occupied-resources {
  margin: 14px 0 18px;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf3;
}

.occupied-resources > summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.occupied-resources > summary span { color: var(--muted); font-size: 13px; }
.occupied-resources[open] > summary { border-bottom: 1px solid var(--line); }
.occupied-resource-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding: 14px; }
.occupied-resource-groups h3 { margin: 0 0 8px; color: var(--green); }
.occupied-resource-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.occupied-resource-row:first-of-type { border-top: 0; }
.occupied-resource-row span { display: grid; min-width: 0; }
.occupied-resource-row small { color: var(--muted); }
.occupied-resource-row a { flex: 0 0 auto; font-size: 13px; }

.harvest-day-accordion { display: grid; gap: 9px; margin-top: 18px; }
.harvest-day-card {
  overflow: clip;
  border: 1px solid var(--line);
  border-left: 5px solid var(--harvest-day-color);
  border-radius: 10px;
  background: #fffef8;
  scroll-margin-top: 12px;
}
.harvest-day-card > summary {
  position: relative;
  display: grid;
  grid-template-columns: 135px 170px 58px 100px 78px 118px 100px 90px;
  gap: 10px;
  justify-content: start;
  align-items: center;
  padding: 12px 44px 12px 13px;
  cursor: pointer;
  list-style: none;
  background: #f7f8f2;
}
.harvest-day-card > summary::-webkit-details-marker { display: none; }
.harvest-day-card > summary:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.harvest-day-date,.harvest-day-stat { display: grid; gap: 1px; min-width: 0; }
.harvest-day-date small,.harvest-day-stat small { color: var(--muted); font-size: 12px; font-weight: 400; }
.harvest-day-stat strong { overflow-wrap: normal; word-break: normal; font-size: 14px; font-weight: 600; }
.harvest-day-planting strong { white-space: normal; overflow-wrap: anywhere; }
.harvest-day-toggle { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); }
.harvest-day-toggle::before { content: "+"; color: var(--green); font-size: 22px; line-height: 1; }
.harvest-day-card[open] .harvest-day-toggle::before { content: "−"; }
.harvest-day-card[open] > summary { border-bottom: 1px solid var(--line); background: #eef3e8; }
.harvest-day-content { padding: 18px; }
.harvest-day-content-head { align-items: flex-start; margin-bottom: 14px; }
.harvest-day-content-head h3 { margin: 0 0 4px; }
.harvest-day-content-head p { margin: 0; color: var(--muted); }
.harvest-day-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
}
.harvest-day-details > div { min-width: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.harvest-day-details dd { overflow-wrap: break-word; }
.harvest-day-section { margin-top: 20px; }
.harvest-day-section > h4,.harvest-day-section-body > h4,.harvest-day-timeline h4 { margin: 0 0 10px; color: var(--green); }
.harvest-day-timelines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.harvest-day-timeline { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf3; }
.harvest-day-timeline ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.harvest-day-timeline li { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.harvest-day-timeline li:first-child { padding-top: 0; border-top: 0; }
.harvest-day-timeline li span { color: var(--muted); text-align: right; }
.harvest-day-actions { align-items: flex-end; flex-wrap: wrap; }
.order-wide-actions { margin: 12px 0 18px; align-items: center; flex-wrap: wrap; }
.harvest-day-action { margin: 0; }
.harvest-day-interrupt { display: flex; flex: 1 1 430px; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.harvest-day-interrupt label { display: grid; flex: 1 1 220px; gap: 6px; font-size: 14px; font-weight: 600; }
.harvest-day-interrupt input { width: 100%; min-width: 0; padding: 10px; border: 1px solid #bfcbbd; border-radius: 7px; background: white; color: var(--ink); }
.harvest-day-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #f3f5ed; color: var(--muted); }
.harvest-day-details-title { display: none; }
.harvest-day-secondary { margin-top: 0; }
.harvest-day-mobile-collapsible > summary { display: none; }
.harvest-day-mobile-collapsible > .harvest-day-section-body { display: block; }

.work-resource-row {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffef8;
}

.work-resource-row h3 { margin: 0 0 12px; }

.work-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.work-resource-empty { display: none; }

.repeatable-machine-field {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf3;
}

.repeatable-machine-enhanced > select[multiple] { display: none; }

.repeatable-machine-list { display: grid; gap: 9px; }

.repeatable-machine-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.repeatable-machine-row select { width: 100%; }

.repeatable-machine-add { align-self: flex-start; margin-top: 9px; }

@media (min-width: 851px) and (max-width: 1050px) {
  .harvest-day-card > summary {
    grid-template-columns: 125px 150px 55px 90px 72px 105px 90px 80px;
    gap: 7px;
  }
}

@media (max-width: 850px) {
  .work-resources .section-head { align-items: flex-start; flex-direction: column; }
  .work-resource-grid { grid-template-columns: 1fr; }
  .repeatable-machine-row { grid-template-columns: 1fr; }
  .repeatable-machine-row .button { justify-self: start; }
  .work-resource-add-action { justify-content: stretch; }
  .work-resource-add-action .button { width: 100%; }
  .occupied-resources > summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .occupied-resource-groups { grid-template-columns: 1fr; }
  .occupied-resource-row { align-items: flex-start; flex-direction: column; }
  #jornadas-recoleccion { padding: 12px 8px; }
  #jornadas-recoleccion > .section-head { padding: 0 3px; }
  .harvest-day-accordion { gap: 11px; margin-top: 14px; }
  .harvest-day-card { border-radius: 12px; }
  .harvest-day-card > summary {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    padding: 13px 10px 11px;
  }
  .harvest-day-date,.harvest-day-planting { grid-column: 1 / -1; }
  .harvest-day-date { gap: 5px; padding-right: 34px; }
  .harvest-day-date strong { font-size: 18px; line-height: 1.2; }
  .harvest-day-date .harvest-day-status {
    justify-self: start;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e7ede1;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
  }
  .harvest-day-stat {
    min-height: 55px;
    align-content: center;
    padding: 8px 9px;
    border: 1px solid #e1e5da;
    border-radius: 8px;
    background: #fffef8;
  }
  .harvest-day-stat strong { line-height: 1.25; }
  .harvest-day-planting { min-height: auto; padding: 8px 9px; }
  .harvest-day-toggle { top: 15px; right: 13px; transform: none; }
  .harvest-day-content {
    display: flex;
    flex-direction: column;
    padding: 12px 9px 14px;
  }
  .harvest-day-content-head { order: 1; align-items: stretch; flex-direction: column; gap: 9px; margin-bottom: 13px; }
  .harvest-day-content-head h3 { font-size: 18px; }
  .harvest-day-content-head p { font-size: 13px; line-height: 1.4; }
  .harvest-day-content-head .button { width: 100%; white-space: normal; }
  .harvest-day-details-title { display: block; order: 2; margin: 0 0 7px; color: var(--green); font-size: 15px; }
  .harvest-day-details-primary { order: 3; }
  .harvest-day-details {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }
  .harvest-day-details > div {
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf3;
  }
  .harvest-day-details .harvest-detail-wide { grid-column: 1 / -1; }
  .harvest-day-details dt { color: var(--muted); font-size: 11px; line-height: 1.25; }
  .harvest-day-details dd { margin: 4px 0 0; font-size: 14px; font-weight: 700; line-height: 1.3; }
  .harvest-day-secondary { order: 6; }
  .harvest-day-section { margin-top: 0; }
  .harvest-day-mobile-collapsible {
    margin-top: 12px;
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
  }
  .harvest-day-mobile-collapsible > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
    color: var(--green);
    font-weight: 700;
  }
  .harvest-day-mobile-collapsible > summary::-webkit-details-marker { display: none; }
  .harvest-day-mobile-collapsible > summary small { color: var(--muted); font-size: 11px; font-weight: 400; text-align: right; }
  .harvest-day-mobile-collapsible > summary::after { content: "+"; flex: 0 0 auto; font-size: 20px; line-height: 1; }
  .harvest-day-mobile-collapsible[open] > summary { border-bottom: 1px solid var(--line); background: #f3f6ee; }
  .harvest-day-mobile-collapsible[open] > summary::after { content: "−"; }
  .harvest-day-secondary .harvest-day-details { padding: 9px; }
  .harvest-day-section-body { padding: 10px; }
  .harvest-day-section-body > h4 { display: none; }
  .harvest-day-timelines { order: 7; grid-template-columns: 1fr; margin-top: 12px; }
  .harvest-day-timeline li { align-items: flex-start; flex-direction: column; gap: 2px; }
  .harvest-day-timeline li span { text-align: left; }
  .harvest-day-actions { order: 4; display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; margin-top: 14px; }
  .harvest-day-actions > .button,.harvest-day-actions > form,.harvest-day-actions button { width: 100%; }
  .harvest-day-actions .button { min-height: 46px; white-space: normal; }
  .harvest-day-interrupt { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; align-items: stretch; }
  .harvest-day-interrupt label { width: 100%; }
  .harvest-day-note { order: 5; margin-top: 9px; }
  .harvest-day-resources { order: 8; }
  .harvest-day-deliveries { order: 9; }
  .harvest-day-resources table.mobile-cards tr,
  table.harvest-delivery-cards tr {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    padding: 10px;
  }
  .harvest-day-resources table.mobile-cards td,
  table.harvest-delivery-cards td {
    display: block;
    min-width: 0;
    padding: 7px;
    border: 0;
    border-radius: 7px;
    background: #f8faf3;
    overflow-wrap: anywhere;
  }
  .harvest-day-resources table.mobile-cards td::before,
  table.harvest-delivery-cards td::before {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
  }
  .harvest-day-resources table.mobile-cards td:nth-child(1),
  .harvest-day-resources table.mobile-cards td:nth-child(2),
  table.harvest-delivery-cards td:nth-child(1),
  table.harvest-delivery-cards td:nth-child(8) { grid-column: 1 / -1; }
  .harvest-day-resources table.mobile-cards .empty-row { display: block; }
  .harvest-day-resources table.mobile-cards .empty-row td { background: transparent; }
}

.execution-resource-card { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 0; border-top:1px solid var(--line); }
.execution-resource-card h3,.execution-resource-card p { margin:3px 0; }
.resource-allocation-group { margin-top:20px; padding:14px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.resource-allocation-group>h3 { margin:0 0 4px; color:var(--green); }
.resource-allocation-group>p { margin:0 0 10px; color:var(--muted); }
.resource-actions { margin-top:0; flex-wrap:wrap; justify-content:flex-end; }
@media(max-width:850px){.execution-resource-card{align-items:stretch;flex-direction:column}.resource-actions{justify-content:flex-start}}
