/* Verwaltung FV Unterfranken – schlicht, große Schrift, klare Knöpfe */

:root {
  --band: #29432f;
  --band-dunkel: #1a2f20;
  --moos: #4a6a2c;
  --text: #1b211c;
  --grau: #566055;
  --linie: #d4d9cd;
  --flaeche: #f3f5f0;
  --gelb: #f2c21b;
  --rot: #a3261b;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; background: var(--flaeche); color: var(--text); font: 1.0625rem/1.5 var(--schrift); }
a { color: var(--moos); }
a:hover { color: var(--band-dunkel); }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
code { background: #e8ece3; padding: 0 .25em; border-radius: 2px; font-size: .92em; }
pre { background: #fff; border: 1px solid var(--linie); padding: 12px; overflow-x: auto; }

/* Kopf */
.kopf { background: var(--band); color: #fff; }
.kopf .innen { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.kopf :focus-visible { outline-color: var(--gelb); }
.marke { color: #fff; text-decoration: none; padding: 14px 0; font-size: 1.0625rem; white-space: nowrap; }
.marke:hover { color: #fff; }
.kopf nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
.kopf nav a { display: block; color: #dfe8d9; text-decoration: none; padding: 14px 0 11px; border-bottom: 3px solid transparent; font-weight: 600; }
.kopf nav a:hover { color: #fff; }
.kopf nav a[aria-current] { color: #fff; border-bottom-color: var(--gelb); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: .9375rem; }
.kopf-rechts a { color: #dfe8d9; }
.kopf-rechts form { margin: 0; }
.kopf .textknopf { color: #dfe8d9; }

main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 80px; }
h1 { font-size: 1.75rem; margin: .2em 0 .6em; color: var(--band-dunkel); display: inline-block; margin-right: 12px; }
h2 { font-size: 1.25rem; margin: 1.4em 0 .5em; color: var(--band-dunkel); }
.klein { font-size: .875rem; color: var(--grau); }
.zurueck { margin: 0 0 .3em; font-size: .9375rem; }
.hilfe { display: block; font-size: .875rem; color: var(--grau); margin-bottom: .3em; }

/* Meldungen */
.meldung { padding: 12px 16px; border-left: 5px solid var(--moos); background: #fff; margin: 0 0 18px; font-weight: 600; }
.meldung.fehler { border-left-color: var(--rot); color: var(--rot); }

/* Knöpfe */
button, .knopf {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--band); border: 0; border-radius: 4px;
  padding: .6em 1.2em; text-decoration: none;
}
button:hover, .knopf:hover { background: var(--band-dunkel); color: #fff; }
button.zweit, .knopf.zweit { background: #fff; color: var(--band); border: 2px solid var(--band); padding: calc(.6em - 2px) calc(1.2em - 2px); }
button.zweit:hover, .knopf.zweit:hover { background: var(--flaeche); color: var(--band-dunkel); }
button.gefahr { background: var(--rot); }
.textknopf { background: none; border: 0; padding: 0; color: var(--moos); text-decoration: underline; font-weight: 400; font-size: inherit; }
.textknopf:hover { background: none; color: var(--band-dunkel); }
.gefahr a { color: var(--rot); }
form.inline { display: inline; margin-left: 8px; }
.aktionen { position: sticky; bottom: 0; background: #fff; padding: 14px 22px; margin: 24px -22px -20px; border-top: 1px solid var(--linie); z-index: 2; box-shadow: 0 -6px 12px -8px rgba(26, 47, 32, .25); }
.aktionen button { font-size: 1.0625rem; padding: .7em 1.6em; }

/* Formulare */
form.bearbeiten, .block { background: #fff; border: 1px solid var(--linie); padding: 20px 22px; margin-bottom: 22px; }
.block h2:first-child, form.bearbeiten h2:first-child { margin-top: 0; }
.block form.bearbeiten { border: 0; padding: 0; background: none; margin: 0; }
.block form.bearbeiten .aktionen { margin: 16px 0 0; padding: 12px 0; }
.feld { margin: 0 0 18px; }
.feld > label { display: block; font-weight: 700; margin-bottom: .25em; }
.feld input:not([type=checkbox]):not([type=file]), .feld select, .feld textarea,
.raster-tabelle input:not([type=checkbox]):not([type=file]), .raster-tabelle select, .raster-tabelle textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #8d978c; border-radius: 3px; padding: .5em .6em;
}
.feld input[type=date] { width: auto; }
.feld textarea { min-height: 6em; resize: vertical; line-height: 1.5; }
.feld.haken { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.feld.haken input { width: 1.25em; height: 1.25em; margin-top: .15em; }
.feld.haken label { font-weight: 600; }
.feld.haken .hilfe { flex-basis: 100%; }
fieldset { border: 1px solid var(--linie); padding: 14px 18px 4px; margin: 0 0 22px; }
fieldset.neu { border-style: dashed; background: #fbfcf9; }
legend { font-weight: 700; padding: 0 6px; color: var(--band-dunkel); }
.zwei { display: grid; gap: 0 20px; }
@media (min-width: 720px) { .zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
input.nr { max-width: 5em; }
details.erweitert, details.formathilfe { margin: 0 0 18px; }
details > summary { cursor: pointer; font-weight: 600; color: var(--moos); }
.formathilfe table { border-collapse: collapse; margin: 10px 0; font-size: .9375rem; }
.formathilfe td { border-bottom: 1px solid var(--linie); padding: 5px 16px 5px 0; vertical-align: top; }

/* Editor */
.editor { border: 1px solid #8d978c; border-radius: 3px; background: #fff; }
.editor textarea { border: 0 !important; border-radius: 0 !important; display: block; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-bottom: 1px solid var(--linie); background: var(--flaeche); }
.werkzeuge button { background: #fff; color: var(--text); border: 1px solid #aab3a8; padding: .3em .7em; font-size: .9375rem; font-weight: 600; }
.werkzeuge button:hover { background: #e8ece3; color: var(--text); }
.werkzeuge button[aria-pressed=true] { background: var(--band); color: #fff; border-color: var(--band); }
.werkzeuge .trenner { flex: 1; }
.vorschau-text { padding: 12px 18px; border-top: 1px dashed var(--linie); max-height: 32em; overflow: auto; }
.vorschau-text img { max-width: 100%; height: auto; }
.vorschau-text .lead { font-size: 1.125rem; }
.vorschau-text .quelle { font-size: .875rem; color: var(--grau); }
.vorschau-text .dateien { list-style: none; padding: 0; }
.vorschau-text .dateiinfo { color: var(--grau); font-size: .875rem; }

/* Tabellen */
.raster-tabelle { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
.raster-tabelle th { text-align: left; font-size: .875rem; color: var(--grau); padding: 4px 6px; font-weight: 600; }
.raster-tabelle td { padding: 4px 6px; vertical-align: top; border-top: 1px solid var(--linie); }
.raster-tabelle tr.neu td { background: #fbfcf9; }
.raster-tabelle tr.vorbei td { opacity: .6; }
.raster-tabelle textarea { min-height: 2.6em; }
.dateitabelle td:nth-child(3) { min-width: 18em; }
.dateitabelle input[type=file] { margin-top: 4px; font-size: .875rem; max-width: 100%; }
label.weg { white-space: nowrap; font-size: .875rem; color: var(--rot); }
.liste-tabelle { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--linie); }
.liste-tabelle th, .liste-tabelle td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--linie); }
.liste-tabelle th { font-size: .875rem; color: var(--grau); }
.status { font-size: .8125rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #e3ead9; color: var(--band-dunkel); }
.status.entwurf { background: var(--gelb); }
.status.verweis { background: #e8ece3; color: var(--grau); }
@media (max-width: 760px) {
  .raster-tabelle thead { display: none; }
  .raster-tabelle, .raster-tabelle tbody, .raster-tabelle tr, .raster-tabelle td { display: block; width: 100%; }
  .raster-tabelle tr { border-top: 2px solid var(--linie); padding: 6px 0; }
  .raster-tabelle td { border: 0; }
}

/* Übersicht */
.kacheln { display: grid; gap: 22px; }
@media (min-width: 960px) { .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kacheln section { background: #fff; border: 1px solid var(--linie); border-top: 4px solid var(--band); padding: 6px 20px 18px; }
ul.liste { padding-left: 1.1em; }
ul.liste li { margin-bottom: .4em; }

/* Anmelden */
.anmelden { max-width: 26rem; margin: 8vh auto 0; background: #fff; border: 1px solid var(--linie); border-top: 4px solid var(--band); padding: 10px 26px 22px; }

/* Bild-Auswahl */
.bildwahl { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.bildwahl > div { flex: 1 1 20em; }
img.mini { width: 160px; height: 120px; object-fit: cover; border: 1px solid var(--linie); }
.bildergalerie { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bildergalerie li { background: var(--flaeche); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.bildergalerie img { width: 100%; height: 110px; object-fit: cover; }
.bildergalerie .name { font-size: .875rem; word-break: break-all; }
.block details { border-top: 1px solid var(--linie); padding: 10px 0; }
.block details table { margin-top: 8px; }

/* Auswahl-Dialog */
dialog.wahl { border: 1px solid var(--linie); border-top: 4px solid var(--band); padding: 0; width: min(46rem, 94vw); max-height: 86vh; }
dialog.wahl::backdrop { background: rgba(26, 47, 32, .45); }
dialog.wahl .dialog-kopf { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: #fff; }
dialog.wahl .dialog-kopf h2 { margin: 0; }
dialog.wahl .dialog-inhalt { padding: 12px 16px; overflow: auto; max-height: 70vh; }
dialog.wahl input[type=search] { width: 100%; font: inherit; padding: .45em .6em; border: 1px solid #8d978c; border-radius: 3px; margin-bottom: 10px; }
dialog.wahl ul { list-style: none; padding: 0; margin: 0; }
dialog.wahl li button { width: 100%; text-align: left; background: #fff; color: var(--text); border: 1px solid var(--linie); margin-bottom: 6px; display: flex; gap: 12px; align-items: center; font-weight: 400; }
dialog.wahl li button:hover { background: var(--flaeche); }
dialog.wahl li img { width: 72px; height: 54px; object-fit: cover; flex: none; }
