﻿/*
  Pflegeseiten für News und Sponsoren (10.11.2026) - ListNews.aspx, EditNews.aspx,
  ListSponsoren.aspx. Farben wie Site.css (#550000, #9D0500, #DD3A36).

  Die MasterPage sperrt den Bildlauf des body (overflow-y: hidden) und legt Kopf
  und Menü fest; der Inhalt scrollt deshalb in .pflege selbst.
*/

.pflege {
    --rot: #9D0500;
    --dunkelrot: #550000;
    --hellrot: #DD3A36;
    --linie: #e3e7ec;
    --grau: #5b6470;
    --flaeche: #f7fafc;
    box-sizing: border-box;
    height: calc(100vh - 104px);
    overflow-y: auto;
    padding: 0 16px 60px 4px;
    font-size: 15px;
    line-height: 1.45;
    color: #1b1f24;
}
.pflege *, .pflege *::before, .pflege *::after { box-sizing: border-box; }

.pflege h1 { font-size: 24px; margin: 0; color: var(--rot); flex: 1; }
.pflege-zwischentitel { font-size: 19px; margin: 28px 0 8px; color: var(--rot); }

.pflege-kopf {
    position: sticky; top: 0; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    padding: 12px 0; margin-bottom: 12px;
    background: #f3f5f8; border-bottom: 2px solid var(--hellrot);
}

.pflege-knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 38px; padding: 6px 16px;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    color: #fff; background: var(--rot);
    border: 1px solid var(--rot); border-radius: 8px;
}
.pflege-knopf:hover { background: var(--dunkelrot); color: #fff; }
.pflege-knopf.zweit { color: var(--rot); background: #fff; border-color: #c9ced6; }
.pflege-knopf.zweit:hover { background: #fbe9e8; color: var(--rot); }
.pflege-knopf.gefahr { color: #a40000; background: #fff; border-color: #e6b3b3; }
.pflege-knopf.gefahr:hover { background: #a40000; color: #fff; }
.pflege-knopf.klein { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.pflege-knopf:disabled { opacity: .45; cursor: default; }
.pflege-knopf:focus-visible, .pflege input:focus-visible, .pflege textarea:focus-visible, .pflege select:focus-visible {
    outline: 3px solid var(--hellrot); outline-offset: 2px;
}

.pflege-status { font-weight: 600; }
.pflege-status.ok { color: #1d7a36; }
.pflege-status.warn { color: #9a6200; }
.pflege-status.fehler, .pflege-fehler { color: #b00000; }
.pflege-hinweis { color: var(--grau); font-size: 14px; }
.pflege code { background: var(--flaeche); padding: 1px 4px; border-radius: 4px; }

.pflege input[type=text], .pflege input[type=search], .pflege input[type=date],
.pflege input[type=number], .pflege input[type=email], .pflege input[type=password],
.pflege input[type=datetime-local], .pflege textarea, .pflege select {
    width: 100%; padding: 8px 10px; font: inherit;
    border: 1px solid #c9ced6; border-radius: 8px; background: #fff;
}
.pflege textarea { resize: vertical; min-height: 80px; }

.pflege-raster { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .pflege-raster { grid-template-columns: 1fr; } }

.pflege-karte {
    background: #fff; border: 1px solid var(--linie); border-radius: 12px;
    padding: 16px; box-shadow: 0 2px 8px rgba(16, 24, 40, .05);
}
.pflege-feld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; }
.pflege-feld.kurz { max-width: 140px; }
.pflege fieldset.pflege-feld { border: 1px solid var(--linie); border-radius: 8px; padding: 8px 12px; }
.pflege fieldset.pflege-feld label, .pflege-schalter { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.pflege-zeile { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 8px 0; }
.pflege-zeile.rechts { justify-content: flex-end; }

.pflege-titelbild, .pflege-logo {
    display: flex; align-items: center; justify-content: center;
    min-height: 140px; background: var(--flaeche); border: 1px dashed #c9ced6; border-radius: 8px; padding: 8px;
}
.pflege-titelbild img { max-width: 100%; max-height: 220px; border-radius: 6px; }
.pflege-logo img { max-height: 120px; max-width: 100%; }

/* Abschnitte */
.pflege-block {
    background: #fff; border: 1px solid var(--linie); border-left: 4px solid var(--hellrot);
    border-radius: 10px; padding: 10px 14px 14px; margin-bottom: 12px;
}
.pflege-block.typ-ueberschrift { border-left-color: var(--dunkelrot); }
.pflege-block.typ-bilder { border-left-color: #4a7bd0; }
.pflege-block.typ-liste { border-left-color: #2f8f5b; }
.pflege-block-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pflege-block-knoepfe { display: flex; gap: 6px; }
.pflege-block-knoepfe .pflege-knopf { min-width: 38px; padding: 4px 8px; }
.pflege-block > .pflege-knopf.klein { margin-top: 6px; }
.pflege-block.typ-ueberschrift .pflege-text { font-weight: 700; font-size: 17px; }

.pflege-bilder-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 8px; }
.pflege-bild { margin: 0; background: var(--flaeche); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.pflege-bild img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #ddd; }
.pflege-bild input { font-size: 13px !important; padding: 5px 8px !important; }
.pflege-bild-knoepfe { display: flex; gap: 6px; justify-content: center; }

.pflege-hinzufuegen {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 14px; border: 2px dashed #c9ced6; border-radius: 10px; background: var(--flaeche);
}

/* Listen */
.pflege-filter { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.pflege-filter input[type=search] { max-width: 340px; }
.pflege-tabelle { width: 100%; border-collapse: collapse; background: #fff; }
.pflege-tabelle th, .pflege-tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
.pflege-tabelle th { background: #fbe9e8; color: var(--rot); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.pflege-tabelle tbody tr:hover td { background: var(--flaeche); }
.pflege-tabelle td a { color: var(--rot); font-weight: 600; }
.pflege-tabelle .rechts { text-align: right; }
.pflege-tabelle .rechts > * { margin-left: 6px; }
.pflege .nowrap { white-space: nowrap; }
.pflege-logo-zelle { width: 120px; }

/* Sponsoren: eine Tabelle je Kategorie, aber überall dieselben Spalten. */
.pflege-tabelle.feste-spalten { table-layout: fixed; }
.pflege-tabelle col.sp-logo { width: 130px; }
.pflege-tabelle col.sp-sortierung { width: 140px; }
.pflege-tabelle col.sp-anzeige { width: 200px; }
.pflege-tabelle col.sp-aktionen { width: 200px; }
.pflege-tabelle.feste-spalten td { overflow-wrap: anywhere; }
.pflege-logo-zelle img { max-height: 50px; max-width: 110px; }

.pflege-marke {
    display: inline-block; padding: 2px 10px; margin-right: 4px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
}
.pflege-marke.ok { background: #e3f4e8; color: #1d7a36; }
.pflege-marke.entwurf { background: #eef1f4; color: var(--grau); }

/* Dialog */
.pflege-dialog {
    width: min(560px, 94vw); border: 0; border-radius: 14px; padding: 20px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.pflege-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.pflege-dialog h2 { margin: 0 0 14px; color: var(--rot); font-size: 20px; }

/* Telefon: Die Seite scrollt als Ganzes (Site.css gibt den body dort frei); der
   eigene Bildlaufbereich wäre sonst ein schmaler Kasten unter Kopf und Menüleiste. */
@media (max-width: 820px), (pointer: coarse) and (max-height: 500px) {
    .pflege { height: auto; overflow: visible; padding: 0 0 40px; }
    /* Nicht sticky: Der Inhaltsbereich des Rahmens hat overflow: hidden und wäre
       damit der Bezug - der Kopf rutschte um "top" nach unten über die Felder. */
    .pflege-kopf { position: static; }
    .pflege h1 { font-size: 20px; flex-basis: 100%; order: -1; }
    /* Listen als Karten: eine Zeile je Eintrag, Knöpfe darunter. */
    .pflege-tabelle thead { display: none; }
    .pflege-tabelle, .pflege-tabelle tbody { display: block; }
    .pflege-tabelle tr { display: block; padding: 10px 4px; border-bottom: 1px solid var(--linie); }
    .pflege-tabelle td { display: inline-block; border: 0; padding: 2px 6px; vertical-align: middle; }
    .pflege-tabelle td:nth-child(2) { display: block; }
    .pflege-tabelle td.rechts { display: flex; gap: 6px; justify-content: flex-start; padding-top: 8px; }
    .pflege-tabelle .rechts > * { margin-left: 0; }
    .pflege-tabelle .pflege-knopf.klein { min-height: 40px; padding: 6px 14px; }
    .pflege-block-knoepfe .pflege-knopf { min-width: 44px; min-height: 44px; }
}

/* ---------------------------------------------------------------- 11.11.2026
   Anmeldeseiten, Spiele, Vereine und Benutzer im selben Rahmen wie News und
   Sponsoren - native <dialog> statt jQuery UI. */

.pflege-karte.anmeldung { max-width: 460px; }
.pflege-karte.anmeldung p:empty { display: none; }
.pflege input[readonly] { background: var(--flaeche); color: var(--grau); }

/* Dialoge mit eigener Breite; Kopf mit Titel und Schließen-Knopf. */
.pflege-dialog.mittel { width: min(720px, 96vw); }
.pflege-dialog.breit { width: min(1100px, 96vw); }
.pflege-dialog.schmal { width: min(360px, 94vw); }
.pflege-dialog-kopf { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.pflege-dialog-kopf h2 { flex: 1; margin: 0; }
.pflege-dialog-zu {
    width: 32px; height: 32px; border: 1px solid #c9ced6; border-radius: 50%;
    background: #fff; color: var(--rot); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.pflege-dialog-zu:hover { background: #fbe9e8; }
.pflege-dialog .pflege-fehler:empty { display: none; }

/* Filterzeile der Spiele: Suche füllt den Platz, Jahr schmal, Mannschaft mittel. */
.pflege-filter .filter-suche { flex: 1 1 260px; }
.pflege-filter .filter-suche input { max-width: none; }
.pflege-filter .filter-jahr { flex: 0 0 110px; }
.pflege-filter .filter-mannschaft { flex: 0 1 240px; }
.pflege-filter label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 600; color: var(--grau); }

/* Benutzerliste */
.pflege-marken { display: flex; flex-wrap: wrap; gap: 4px; }
.pflege-marke.admin { background: var(--rot); color: #fff; }
.pflege-marke.aus { background: #e9edf1; color: var(--grau); }
.pflege-marke.offen { background: #fff3d6; color: #8a5a00; }
.pflege-haken { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; font-weight: 400; }
.pflege-haken label { display: flex; align-items: center; gap: 6px; }
.pflege-haken .ausgeblendet { color: var(--grau); font-style: italic; }


/* ---------------------------------------------------------------- 11.11.2026
   Rückmeldung, eigene Rückfragen und Handy (Durchsicht der Bedienbarkeit). */

/* Rückmeldung am unteren Rand (pflege.js, Pflege.status): #status im Seitenkopf
   ist am Handy nicht zu sehen, sobald man in der Liste weiter unten ist. */
.pflege-toast {
    position: fixed; left: 50%; bottom: 16px; z-index: 1000;
    max-width: min(560px, calc(100vw - 24px)); padding: 10px 16px;
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    border-radius: 10px; background: #1b1f24; color: #fff; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transition: opacity .2s, transform .2s;
}
.pflege-toast.sichtbar { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.pflege-toast.ok { background: #1d7a36; }
.pflege-toast.fehler { background: #b00000; }

/* Rückfrage statt confirm()/prompt() */
.pflege-frage-text { margin: 0 0 14px; font-size: 16px; line-height: 1.45; }
.pflege-frage-feld {
    display: block; width: 100%; margin: 0 0 8px; padding: 10px 12px;
    font: inherit; font-size: 16px; border: 1px solid #c9ced6; border-radius: 8px;
}
.pflege-frage-feld[hidden] { display: none; }
.pflege-frage .pflege-zeile { margin-bottom: 0; }

/* Knopfleiste der Dialoge bleibt am unteren Rand sichtbar: Im Dialog „Bericht und
   Bilder“ lag „Speichern“ am Handy 360 px unter dem sichtbaren Bereich. */
.pflege-dialog > .pflege-zeile.rechts:last-child {
    position: sticky; bottom: -20px; z-index: 2;
    margin: 12px -22px -20px; padding: 12px 22px;
    background: #fff; border-top: 1px solid var(--linie);
}

@media (max-width: 820px), (pointer: coarse) and (max-height: 500px) {
    /* iOS vergrößert die Seite beim Antippen jedes Felds unter 16 px Schrift. */
    .pflege input, .pflege select, .pflege textarea,
    .pflege-dialog input, .pflege-dialog select, .pflege-dialog textarea { font-size: 16px !important; }

    /* Tippflächen mindestens 44 px */
    .pflege-knopf { min-height: 44px; }
    .pflege-dialog-zu { width: 44px; height: 44px; }
    .pflege input[type=checkbox], .pflege input[type=radio] { width: 22px; height: 22px; flex: none; }
    .pflege fieldset.pflege-feld label, .pflege-schalter, .pflege-haken label { min-height: 40px; }

    /* Dialoge nutzen die volle Höhe; dvh berücksichtigt die eingeblendete Tastatur. */
    .pflege-dialog { padding: 16px 14px; max-height: calc(100dvh - 16px); width: calc(100vw - 16px) !important; }
    .pflege-dialog > .pflege-zeile.rechts:last-child { bottom: -16px; margin: 12px -14px -16px; padding: 10px 14px; }
    .pflege-dialog > .pflege-zeile.rechts:last-child .pflege-knopf { flex: 1 1 0; }

    /* Lange Mailadressen in der Benutzerliste umbrechen statt abschneiden. */
    .pflege-tabelle td { overflow-wrap: anywhere; }
    .pflege-bild input { font-size: 16px !important; }
}
