#fieldTreeCount {
  min-width: 0;
  color: #000;
}

#fieldTreeCount :is(label, span, strong, small, h2, th, td, button, select, option, p) {
  color: #000 !important;
}

.field-tree-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.field-tree-toolbar label {
  display: grid;
  gap: 5px;
  min-width: min(260px, 100%);
  font-size: 12px;
  font-weight: 750;
  color: #000;
}

.field-tree-toolbar select {
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 9px;
  background: var(--surface);
  color: #000;
  font: inherit;
}

.field-tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-tree-actions button {
  min-height: 39px;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 700;
}

.field-tree-data-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #b77a32;
  border-radius: 5px;
  background: #fff3df;
  color: #000;
  font-size: 13px;
}

.field-tree-data-warning button {
  flex: none;
  border: 1px solid #9c6427;
  border-radius: 5px;
  background: #fff;
  color: #000;
  padding: 5px 9px;
  cursor: pointer;
}

.field-tree-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: var(--surface);
  color: #111111;
  font-size: 13px;
}

.field-tree-stats strong {
  color: #111111;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.field-tree-stat-total { font-weight: 750; }
.field-tree-stat-present { border-bottom: 3px solid #258457; }
.field-tree-stat-replant { border-bottom: 3px solid #f1b52b; }
.field-tree-stat-absent { border-bottom: 3px solid #d64036; }

.field-tree-map {
  position: relative;
  width: 100%;
  height: clamp(440px, 63vh, 800px);
  border: 1px solid var(--line);
  background: #d4ddd8;
}

.field-tree-map-layers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  padding: 7px 9px;
  border: 1px solid #c7d8d1;
  border-radius: 6px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 10px #0004;
  font-size: 12px;
}

.field-tree-map-layers strong { padding-right: 2px; }
.field-tree-map-layers label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  cursor: pointer;
  font-weight: 700;
}

.field-tree-map-layers input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #14745d;
}

.field-tree-row-label {
  min-width: 38px;
  padding: 4px 8px;
  transform: translate(-50%, -50%);
  border: 1.5px solid #fff;
  border-radius: 6px;
  background: #0b5b50;
  color: #fff !important;
  box-shadow: 0 2px 7px #0008;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.field-tree-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: var(--surface);
  font-size: 12px;
}

.field-tree-legend > span:not(.field-tree-line-key) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-tree-dot {
  width: 11px;
  height: 11px;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #a4b1a9;
}

.field-tree-dot.present { background: #258457; }
.field-tree-dot.replant { background: #f1b52b; }
.field-tree-dot.absent { background: #d64036; }
.field-tree-line-key {
  width: 26px;
  height: 4px;
  background: #ffd54f;
  box-shadow: 0 0 0 2px #2b2b2b;
}

.field-tree-summary {
  margin-top: 20px;
  min-width: 0;
}

.field-tree-summary header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.field-tree-summary h2 {
  margin: 0;
  font-size: 18px;
  color: #000;
}

.field-tree-summary header span {
  color: #000;
  font-size: 12px;
}

.field-tree-table-wrap {
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.field-tree-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.field-tree-table-wrap th,
.field-tree-table-wrap td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.field-tree-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e7f3ee;
  font-weight: 750;
}

.field-tree-table-wrap th[class^="field-tree-heading-"] {
  align-items: center;
  gap: 7px;
}

.field-tree-table-wrap th[class^="field-tree-heading-"] i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #91a29a;
  vertical-align: -1px;
}

.field-tree-heading-present i { background: #258457; }
.field-tree-heading-replant i { background: #f1b52b; }
.field-tree-heading-absent i { background: #d64036; }
.field-tree-value-present { box-shadow: inset 4px 0 #258457; }
.field-tree-value-replant { box-shadow: inset 4px 0 #f1b52b; }
.field-tree-value-absent { box-shadow: inset 4px 0 #d64036; }

.field-tree-table-wrap tr.is-selected td { background: #f0f8f3; }
.field-tree-table-wrap tbody tr:hover td { background: #eaf4ef; }

.field-tree-table-wrap td button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.field-tree-table-wrap td button:hover { text-decoration: underline; }
.field-tree-empty { color: #000; }

.field-tree-loading,
.field-tree-error,
.field-tree-map-error {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  padding: 24px;
  text-align: center;
  background: var(--surface);
  color: #000;
}

.field-tree-map-error { min-height: 100%; }
.field-tree-error p { margin: 0; color: #000; }

.field-tree-map-note {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  border-radius: 5px;
  background: #fff;
  color: #000;
  box-shadow: 0 3px 12px #0003;
  font-size: 12px;
}

.field-tree-info {
  display: grid;
  gap: 4px;
  min-width: 170px;
  color: #000;
}

.field-tree-info small { color: #000; }

@media (max-width: 700px) {
  .field-tree-toolbar { align-items: stretch; flex-direction: column; }
  .field-tree-toolbar label { min-width: 0; }
  .field-tree-actions button { flex: 1; }
  .field-tree-map { height: clamp(420px, 61dvh, 680px); }
  .field-tree-summary header { align-items: start; flex-direction: column; }
  .field-tree-map-layers { gap: 7px; margin: 8px 0; }
  .field-tree-map-layers strong { font-size: 11px; }
}

.field-tree-pdf-button { border: 1px solid #155f43; background: #e2f1e9; color: #155f43; }
.field-tree-pdf-button:hover { background: #cae9da; }
.field-tree-actions button:disabled { cursor: progress; opacity: .65; }

/* Selección múltiple estilo escritorio; no cambia los estados originales de las plantas. */
#fieldTreeCount .field-tree-selection-button{display:inline-flex;align-items:center;gap:7px;background:#fff8c9!important;color:#181818!important;border:1px solid #ddbd26!important}
#fieldTreeCount .field-tree-selection-button.is-active{background:#ffe545!important;box-shadow:inset 0 0 0 2px #b99400}
#fieldTreeCount .field-tree-selected-actions{display:flex;gap:7px;align-items:center;background:#fff9d8;border:1px solid #e9c735;border-radius:7px;padding:3px 6px;color:#161616;font-size:12px;font-weight:700}
#fieldTreeCount .field-tree-selected-actions[hidden]{display:none!important}
#fieldTreeCount .field-tree-delete-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid #e5b9b9;border-radius:6px;background:#ffe7e7;color:#9b2020;cursor:pointer}
#fieldTreeCount .field-tree-delete-button:disabled{opacity:.45;cursor:wait}
#fieldTreeCount .field-tree-map{position:relative}
#fieldTreeCount .field-tree-select-surface{position:absolute;inset:0;z-index:3;display:none;cursor:crosshair;touch-action:none;background:transparent}
#fieldTreeCount .field-tree-select-surface.is-active{display:block}
#fieldTreeCount .field-tree-select-rectangle{position:absolute;box-sizing:border-box;border:2px solid #e9b600;background:rgba(255,233,0,.19);pointer-events:none}
#fieldTreeCount .field-tree-select-rectangle[hidden]{display:none!important}
