/* FCP Fangmatrix — P3c, 31.08.2026
   Eigenstaendiger Baustein fuer die Fangstatistik auf
   /app/natur-gewaesser/#ng_fangstatistik. Rendert von
   public/js/fcp-fangmatrix.js. Theming ueber die --rd-* Tokens aus
   redesign.css / app-shell-redesign.css (hell/dunkel automatisch).
   Der Orange-Akzent (rgba(212,106,32,x)) ist wie in
   fcp-eventplaner-planung.css / fcp-termine-mitglied.css
   themeunabhängig konstant. */

.fmx-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fmx-empty {
  color: var(--rd-muted, #7a7c68);
  margin: 0;
}

/* ── KPI-Leiste ─────────────────────────────────────────────────── */
.fmx-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fmx-kpi {
  flex: 1 1 180px;
  min-width: 168px;
  background: var(--rd-surface);
  border: 1px solid var(--rd-line-strong, rgba(var(--tint-rgb), 0.20));
  border-radius: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fmx-kpi__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(212,106,32,0.12);
  color: #c05818;
  display: grid;
  place-items: center;
  flex: none;
}

.fmx-kpi__body { flex: 1; min-width: 0; }

.fmx-kpi__label {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rd-muted, #7a7c68);
  font-weight: 600;
}

.fmx-kpi__value {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.01em;
  margin-top: 2px;
  color: var(--rd-ink, #2a2d24);
}

.fmx-kpi__value--muted {
  color: var(--rd-muted, #7a7c68);
  font-size: 15px;
  font-weight: 600;
}

.fmx-kpi__of {
  font-size: 13px;
  font-weight: 500;
  color: var(--rd-muted, #7a7c68);
}

.fmx-kpi__note {
  font-size: 11px;
  color: var(--rd-muted, #7a7c68);
  margin-top: 2px;
}

/* ── Filterzeile ────────────────────────────────────────────────── */
.fmx-filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Standard 5 (Formularelemente-Atome, FCP_UI_STANDARDS.md): Kontrollhöhe
   44px Desktop statt einer eigenen kleineren Masshaltung, und ein
   Fokus-Zustand (goldener Rand + weicher Ring) wie jedes andere Eingabefeld
   im neuen Design — Owner-Begehung 05.09.2026 empfand die Suche sonst als
   uneinheitlich neben der KPI-Leiste darüber ("scheint doppelt zu sein"). */
.fmx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rd-line-strong, rgba(var(--tint-rgb), 0.32));
  border-radius: 10px;
  background: var(--rd-surface-hi, #fff);
  color: var(--rd-muted, #7a7c68);
  min-width: 220px;
  transition: border-color .12s, box-shadow .12s;
}

.fmx-search:focus-within {
  border-color: #d46a20;
  box-shadow: 0 0 0 2px rgba(212,106,32,0.16);
}

.fmx-search svg { flex: none; }

.fmx-search input {
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--rd-ink, #2a2d24);
  width: 100%;
}

/* Owner-Grundsatz 04.09.2026: Touch-Zweig, damit iOS beim Fokus nicht zoomt. */
@media (pointer: coarse), (max-width: 899px) {
  .fmx-search input {
    font-size: 16px;
  }
}

.fmx-toggle-note {
  font-size: 12.5px;
  color: var(--rd-muted, #7a7c68);
  margin-left: auto;
}

.fmx-toggle-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #c05818;
  cursor: pointer;
  text-decoration: none;
}

.fmx-toggle-link:hover { color: #bf5414; }

/* ── Heatmap (Desktop) ──────────────────────────────────────────── */
.fmx-heatmap-card {
  background: var(--rd-surface-hi, #fff);
  border: 1px solid var(--rd-line-strong, rgba(var(--tint-rgb), 0.22));
  border-radius: 12px;
  padding: 4px 18px 14px;
  box-sizing: border-box;
  overflow-x: auto;
}

.fmx-table {
  border-collapse: collapse;
  min-width: max-content;
  width: 100%;
}

.fmx-table th,
.fmx-table td {
  border: 1px solid var(--rd-line, rgba(var(--tint-rgb), 0.14));
  box-sizing: border-box;
}

.fmx-corner {
  border: none !important;
  min-width: 140px;
  max-width: 160px;
}

.fmx-col-head {
  vertical-align: bottom;
  padding: 8px 4px 6px;
  min-width: 78px;
  max-width: 78px;
  background: var(--rd-gold-softer, rgba(212,106,32,0.06));
  text-align: center;
  position: relative;
  height: 84px;
}

.fmx-col-head__label {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--rd-ink-2, #4a4e40);
  white-space: nowrap;
  margin: 0 auto;
}

.fmx-sum-head {
  min-width: 56px;
  max-width: 56px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rd-muted, #7a7c68);
  font-weight: 600;
  vertical-align: bottom;
  padding-bottom: 8px;
}

.fmx-row-head {
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  color: var(--rd-ink, #2a2d24);
  font-weight: 500;
  min-width: 140px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--rd-surface);
}

.fmx-cell {
  text-align: center;
  padding: 6px 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--rd-ink, #2a2d24);
  background: var(--rd-surface-hi, #fff);
}

.fmx-cell--zero { color: var(--rd-muted-soft, rgba(var(--tint-rgb), 0.45)); }

.fmx-cell--sum {
  font-weight: 650;
  background: var(--rd-line, rgba(var(--tint-rgb), 0.06));
}

.fmx-row-sum {
  text-align: center;
  font-weight: 650;
  font-size: 13px;
  background: var(--rd-line, rgba(var(--tint-rgb), 0.06));
  color: var(--rd-ink, #2a2d24);
}

.fmx-total-row th,
.fmx-total-row td {
  border-top: 1.5px solid var(--rd-line-strong, rgba(var(--tint-rgb), 0.35));
  font-weight: 650;
  font-size: 13px;
}

.fmx-total-row .fmx-grand {
  background: var(--rd-line-strong, rgba(var(--tint-rgb), 0.10));
  font-weight: 700;
}

.fmx-foot-label {
  padding: 4px 10px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rd-muted, #7a7c68);
  font-weight: 600;
  border: none !important;
  background: transparent;
}

.fmx-foot-value {
  text-align: center;
  font-size: 12px;
  color: var(--rd-muted, #7a7c68);
  border: none !important;
  background: transparent;
}

.fmx-foot-note {
  margin: 10px 2px 0;
  font-size: 11.5px;
  color: var(--rd-muted, #7a7c68);
}

/* ── Handy-Gewässer-Karten ─────────────────────────────────────── */
.fmx-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fmx-card {
  background: var(--rd-surface);
  border: 1px solid var(--rd-line-strong, rgba(var(--tint-rgb), 0.22));
  border-radius: 12px;
  overflow: hidden;
}

.fmx-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}

.fmx-card__body { flex: 1; min-width: 0; }

.fmx-card__name { font-size: 15px; font-weight: 650; color: var(--rd-ink, #2a2d24); }

.fmx-card__meta {
  font-size: 13px;
  color: var(--rd-muted, #7a7c68);
  margin-top: 2px;
}

.fmx-card__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.fmx-chip {
  font-size: 11.5px;
  color: var(--rd-ink-2, #4a4e40);
  background: var(--rd-line, rgba(var(--tint-rgb), 0.10));
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.fmx-card__chevron {
  flex: none;
  color: var(--rd-muted, #7a7c68);
  transition: transform .15s ease;
}

.fmx-card.is-open .fmx-card__chevron { transform: rotate(90deg); }

.fmx-card__detail {
  display: none;
  padding: 0 14px 12px 14px;
  border-top: 1px solid var(--rd-line, rgba(var(--tint-rgb), 0.16));
}

.fmx-card.is-open .fmx-card__detail { display: block; padding-top: 10px; }

.fmx-card__detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--rd-ink, #2a2d24);
}

.fmx-card__detail-row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ── Responsive Umschaltung ─────────────────────────────────────── */
.fmx-desktop-only { display: block; }
.fmx-mobile-only { display: none; }

@media (max-width: 899px) {
  .fmx-desktop-only { display: none; }
  .fmx-mobile-only { display: block; }
  .fmx-kpis { gap: 10px; }
  .fmx-kpi { flex: 1 1 45%; min-width: 0; }
}
