/* ===============================
   FV Fangbuch – Summentabelle
   =============================== */

.fv-limit {
    position: relative;
    background: #eee;
    border-radius: 4px;
    height: 16px;
    overflow: hidden;
    font-size: 11px;
}

.fv-limit-bar {
    background: #4caf50;
    height: 100%;
}

.fv-limit-warning .fv-limit-bar {
    background: #e74c3c;
}

.fv-limit span {
    position: absolute;
    inset: 0;
    text-align: center;
    line-height: 16px;
    color: #000;
    font-weight: bold;
}
@media (max-width: 768px) {

    .fv-fangbuch-summen,
    .fv-fangbuch-table {
        font-size: 13px;
    }

    .fv-fangbuch-summen th:nth-child(3),
    .fv-fangbuch-summen td:nth-child(3),
    .fv-fangbuch-table th:nth-child(3),
    .fv-fangbuch-table td:nth-child(3) {
        display: none; /* Gewicht ausblenden */
    }

    .fv-sum-toggle {
	  display: inline-block;
	  cursor: pointer;
	  font-weight: 700;
	  padding: 0 6px;
	  border: 1px solid #ccc;
	  border-radius: 4px;
	  user-select: none;
	}
	
	#fv-sum-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
	}

	#fv-sum-list li {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 6px 10px;
		margin-bottom: 4px;
		background: #f7f7f7;
		border-radius: 4px;
	}

	#fv-sum-list .fv-remove {
		color: #b32d2e;
		text-decoration: none;
		font-weight: bold;
	}


}

/* ===============================
   FV Fangbuch – Alle Einzeleinträge
   =============================== */

/* Grundlayout */
#fv-column-picker,
#fv-fangbuch-filter {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

#fv-column-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px 14px;
}

/* Überschriften */
#fv-column-picker + h4,
#fv-fangbuch-filter h4,
h4 {
    margin: 18px 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* Checkboxen */
#fv-column-picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #374151;
}

#fv-column-picker input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* Filter & Sortierung */
#fv-fangbuch-filter {
    display: block; /* kein Grid mehr auf Form */
    background: transparent;
    border: none;
    padding: 0;
}

.fv-filter-box,
.fv-sort-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

#fv-fangbuch-filter select {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: #fff;
    transition: border-color .15s, box-shadow .15s;
}

#fv-fangbuch-filter select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

/* Tabelle */
.fv-fangbuch-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.fv-fangbuch-table thead th {
    background: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.fv-fangbuch-table tbody td {
    padding: 11px 14px;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f1f5f9;
}

.fv-fangbuch-table tbody tr:last-child td {
    border-bottom: none;
}

/* Hover */
.fv-fangbuch-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Leere Tabelle */
.fv-fangbuch-table td[colspan] {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}




/* Mobile */
@media (max-width: 768px) {

    #fv-column-picker {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .fv-fangbuch-table thead {
        display: none;
    }

    .fv-fangbuch-table,
    .fv-fangbuch-table tbody,
    .fv-fangbuch-table tr,
    .fv-fangbuch-table td {
        display: block;
        width: 100%;
    }

    .fv-fangbuch-table tr {
        border-bottom: 1px solid #e5e7eb;
        padding: 10px 0;
    }

    .fv-fangbuch-table td {
        padding: 6px 14px;
        display: flex;
        justify-content: space-between;
        font-size: 13px;
    }

    .fv-fangbuch-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
    }
}

/* ===============================
   FV Fangbuch – Eingabeform
   =============================== */


/* ====== Base ====== */
/* ==========================================================
 * Fangbuch Mobile UI (wie Screenshot)
 * Voraussetzung: Wrapper-Klasse .fv-fb-form-wrap existiert
 * ========================================================== */

/* Optional: leichtes Page-Background */
body .fv-fb-form-wrap {
  box-sizing: border-box;
}

/* Card */
.fv-fb-form-wrap {
  max-width: 620px;
  margin: 12px auto;
  padding: 18px 14px 16px;
  background: #175e9f;          /* beige */
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* Rote Status-Leiste (oben) */
.fv-fb-notice {
  margin: 0 0 14px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
  text-align: center;
  letter-spacing: .25em;
  text-transform: uppercase;
  line-height: 1.35;
}

.fv-fb-notice-warn {
  background: #e11b1b;          /* rot */
  color: #fff;
}

.fv-fb-notice-ok {
  background: #1e9b4b;          /* grün */
  color: #fff;
  letter-spacing: .08em;
  text-transform: none;
}

/* Headline */
.fv-fb-form-head {
  margin: 2px 0 12px;
  padding: 0;
  display: block;
}

.fv-fb-title {
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  letter-spacing: .04em;
  color: #2a2a2a;
}

.fv-fb-sub {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  opacity: .85;
}

/* Form Layout */
.fv-fb-form {
  display: grid;
  gap: 16px;
}

/* Labels */
.fv-fb-row label {
  display: block;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #2b2b2b;
}

/* Inputs/Selects/Textarea */
.fv-fb-row select,
.fv-fb-row input,
.fv-fb-row textarea {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 16px 16px;
  font-size: 18px;
  background: #fff;
  color: #222;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.fv-fb-row textarea {
  min-height: 110px;
  resize: vertical;
}

.fv-fb-row select:disabled,
.fv-fb-row input:disabled {
  opacity: .65;
}

/* Readonly Gewicht-Feld */
.fv-fb-weight-wrap input[readonly] {
  background: #f2f2f2;
}

/* Loader im Gewichtsfeld */
.fv-fb-weight-wrap {
  position: relative;
}

.fv-fb-loader {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.18);
  border-top-color: rgba(0,0,0,.55);
  transform: translateY(-50%);
  display: none;
  animation: fvspin 0.8s linear infinite;
}

.fv-fb-loader.on { display: inline-block; }

@keyframes fvspin { to { transform: translateY(-50%) rotate(360deg); } }

/* Helptext */
.fv-fb-help {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  opacity: .72;
}

/* Two-col -> on mobile single col (wie Screenshot) */
.fv-fb-row-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Actions */
.fv-fb-actions {
  margin-top: 4px;
  display: grid;
  gap: 10px;
}

.fv-btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 16px 16px;
  font-size: 18px;
  font-weight: 800;
  background: #111;
  color: #fff;
}

.fv-btn:disabled {
  opacity: .45;
}

/* Message */
.fv-fb-msg {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding-top: 2px;
}

.fv-fb-msg.ok { color: #0f6f2f; }
.fv-fb-msg.err { color: #9f1616; }
.fv-fb-msg.warn { color: #7a5a0f; }

/* ==========================================================
 * Mobile-specific tuning (iPhone-like)
 * ========================================================== */
/* ===============================
 * Fangbuch Formular – Mobile CSS
 * (Desktop CSS vorhanden)
 * =============================== */

@media (max-width: 768px) {

  .fv-fb-form-wrap{
    width:100%;
    max-width:100%;
    padding:14px;
    box-sizing:border-box;
  }

  /* Kopf */
  .fv-fb-form-head{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin-bottom:12px;
  }
  .fv-fb-title{
    font-size:18px;
    line-height:1.2;
    font-weight:700;
  }
  .fv-fb-sub{
    font-size:13px;
    opacity:.85;
  }

  /* Notices */
  .fv-fb-notice{
    padding:10px 12px;
    border-radius:10px;
    margin:10px 0 14px;
    font-size:13px;
    line-height:1.35;
  }

  /* Form Layout */
  .fv-fb-form{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .fv-fb-row{
    width:100%;
  }

  .fv-fb-row label{
    display:block;
    font-size:14px;
    font-weight:600;
    margin:0 0 6px;
  }

  .fv-fb-row select,
  .fv-fb-row input,
  .fv-fb-row textarea{
    width:90%;
    box-sizing:border-box;
    padding:12px 12px;
    font-size:16px;         /* verhindert iOS-Zoom */
    line-height:1.2;
    border-radius:12px;
  }

  .fv-fb-row textarea{
    min-height:92px;
    resize:vertical;
  }

  .fv-fb-help{
    margin-top:6px;
    font-size:12px;
    line-height:1.35;
    opacity:.85;
  }

  /* 2-Spalten-Zeile auf Mobile -> 1 Spalte */
  .fv-fb-row-2col{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
  }

  /* Gewicht Input + Loader */
  .fv-fb-weight-wrap{
    position:relative;
  }
  .fv-fb-weight-wrap input{
    padding-right:44px; /* Platz für Loader */
  }
  .fv-fb-loader{
    position:absolute;
    right:12px;
    top:50%;
    transform:translateY(-50%);
    width:18px;
    height:18px;
    pointer-events:none;
    display:none; /* per JS bei Loading einblenden */
  }

  /* Actions */
  .fv-fb-actions{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:4px;
  }

  .fv-fb-actions .fv-btn{
    width:100%;
    padding:14px 14px;
    font-size:16px;
    border-radius:14px;
  }

  #fv_fb_msg.fv-fb-msg{
    min-height:18px;
    font-size:13px;
    line-height:1.35;
  }
}

/* Sehr kleine Geräte */
@media (max-width: 360px){
  .fv-fb-form-wrap{ padding:12px; }
  .fv-fb-title{ font-size:17px; }
  .fv-fb-row label{ font-size:13px; }
}

/* assets/fv-fangbuch.css */

/* =========================
   Basis
   ========================= */
.fv-fangbuch-wrap {}

.fv-fangbuch-noscript {
  padding: 10px;
  border: 1px solid #ddd;
  margin: 10px 0;
}

.fv-fangbuch-title {
  margin: 10px 0;
}

/* =========================
   Year-Buttons
   Desktop: möglichst viele pro Reihe (mind. 5)
   ========================= */
.fv-fangbuch-yearbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fv-fangbuch-form {
  margin: 0;
  display: inline-block;
}

.fv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px !important;
  padding: 6px 10px;

  /* viele Buttons pro Zeile */
  flex: 0 1 72px;          /* klein genug für 5+ Buttons */
  min-width: 64px;
  max-width: 110px;

  white-space: nowrap;
  cursor: pointer;
}

.fv-btn-selected {
  background-color: #7fff00 !important;
}

.fv-btn-not-selected {}

/* =========================
   Tabelle + Scroll (WICHTIG)
   Fix gegen "responsive table" Theme-Overrides
   ========================= */
.fv-fangbuch-tablewrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Erzwinge Table-Layout, falls Theme table/tr/td auf block umstellt */
.fv-fangbuch-table {
  display: table !important;
  border-collapse: collapse;

  width: max-content !important;  /* darf breiter als Viewport sein => Scroll */
  min-width: 100% !important;     /* aber nie schmaler als Container */
  table-layout: auto !important;
}

.fv-fangbuch-table thead { display: table-header-group !important; }
.fv-fangbuch-table tbody { display: table-row-group !important; }
.fv-fangbuch-table tr    { display: table-row !important; }

.fv-fangbuch-table th,
.fv-fangbuch-table td {
  display: table-cell !important;
  padding: 6px 10px;
  border: 1px solid #e5e5e5;
  white-space: nowrap;
}

.fv-fangbuch-table tbody tr:nth-child(even) {
  background-color: #f2f2f2;
}

.fv-fangbuch-rowhead {
  font-weight: 600;
}

/* =========================
   Responsive Optimierung
   ========================= */
@media (max-width: 1024px) {
  .fv-btn {
    flex-basis: 64px;
    min-width: 58px;
    padding: 6px 8px;
  }
}

@media (max-width: 768px) {
  .fv-fangbuch-yearbar {
    gap: 6px;
  }

  .fv-btn {
    /* 3–4 Buttons pro Reihe, gut tappbar */
    flex: 1 1 calc(25% - 6px);
    min-width: 72px;
    max-width: none;

    padding: 10px 8px;
    font-size: 14px;
  }

  /* Sticky erste Spalte (hilft bei breiten Tabellen) */
  .fv-fangbuch-table th:first-child,
  .fv-fangbuch-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
  }

  .fv-fangbuch-table tbody tr:nth-child(even) .fv-fangbuch-rowhead {
    background: #f2f2f2;
  }

  .fv-fangbuch-table th,
  .fv-fangbuch-table td {
    padding: 8px 10px;
  }
}

@media (max-width: 420px) {
  .fv-btn {
    flex: 1 1 calc(33.33% - 6px);
    min-width: 84px;
    font-size: 14px;
  }
	/* Sticky erste Spalte (hilft bei breiten Tabellen) */
  .fv-fangbuch-table th:first-child,
  .fv-fangbuch-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
  }
}
