/* Admin-Oberfläche. Baut auf site.css auf (Farben, Schriften, Knöpfe, Felder).
   Eigene Farben gibt es nur für die vier Produkte und die Ampel des Checks. */

:root {
  --modell: #B6F04A;
  --heizlast: #FF9F6B;
  --bedarfsausweis: #6CB6FF;
  --verbrauchsausweis: #C9A0FF;
  --gruen: #4ADE80;
  --gelb: #FFB454;
  --rot: #FF7B72;
}

.admin-breite { max-width: 1720px; }
#inhalt { display: flex; flex-direction: column; gap: 24px; padding-top: 32px; padding-bottom: 80px; }
h1.titel { font-family: var(--kopfschrift); font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
.kopfzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.leer { padding: 40px 24px; border: 1px dashed var(--linie-stark); border-radius: 12px; color: var(--gedaempft); text-align: center; }
.meldung { padding: 12px 16px; border: 1px solid var(--warnung); border-radius: 8px; color: var(--warnung); font-size: 15px; }
.meldung--gut { border-color: var(--gruen); color: var(--gruen); }
.gedaempft { color: var(--gedaempft); }
.klein { font-size: 13px; }

/* Reiter */
.reiter { display: flex; flex-wrap: wrap; gap: 4px; }
.reiter button { min-height: 40px; padding: 0 14px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--text-2); font-size: 15px; font-weight: 500; cursor: pointer; }
.reiter button:hover { color: var(--text); }
.reiter button[aria-current="page"] { background: var(--flaeche); border-color: var(--linie-stark); color: var(--text); }
.reiter .zahl { margin-left: 6px; padding: 1px 7px; background: var(--linie); border-radius: 999px; font-family: var(--mono); font-size: 12px; }
.reiter button[aria-current="page"] .zahl { background: var(--akzent); color: var(--grund); }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 20px; padding: 32px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; }
.anmeldung .feld { flex: none; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); }
table.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
.liste th { padding: 12px 14px; text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--gedaempft); border-bottom: 1px solid var(--linie); white-space: nowrap; }
.liste td { padding: 14px; vertical-align: top; border-bottom: 1px solid var(--linie); }
.liste tr:last-child td { border-bottom: 0; }
.liste tbody tr.klickbar { cursor: pointer; }
.liste tbody tr.klickbar:hover { background: var(--flaeche-aktiv); }
.liste .nummer { font-family: var(--mono); font-size: 12px; color: var(--gedaempft); }
.liste strong { font-weight: 600; }
.liste a { color: var(--text-2); }
.zelle { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.liste .knopf { white-space: nowrap; }
.zelle--marken { flex-direction: row; flex-wrap: wrap; gap: 6px; }

/* Marken: Produkt, Express, Zusatz, Check */
.marke { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--linie-stark); border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.marke::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.marke--modell { color: var(--modell); border-color: var(--modell); }
.marke--heizlast { color: var(--heizlast); border-color: var(--heizlast); }
.marke--bedarfsausweis { color: var(--bedarfsausweis); border-color: var(--bedarfsausweis); }
.marke--verbrauchsausweis { color: var(--verbrauchsausweis); border-color: var(--verbrauchsausweis); }
.marke--express { color: var(--grund); background: var(--rot); border-color: var(--rot); }
.marke--express::before { display: none; }
.marke--zusatz { color: var(--text); background: var(--linie); }
.marke--zusatz::before { display: none; }
.marke--grau { color: var(--gedaempft); }
.marke--gelb { color: var(--gelb); border-color: var(--gelb); }
.marke--gruen { color: var(--gruen); border-color: var(--gruen); }
.marke--rot { color: var(--rot); border-color: var(--rot); }

/* Angaben aus dem Formular */
.angaben { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 13px; }
.angaben div { display: flex; gap: 6px; }
.angaben dt { flex: 0 0 auto; color: var(--gedaempft); }
.angaben dt::after { content: ':'; }
.angaben dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-2); }
.angaben--gross { gap: 8px; font-size: 15px; }
.angaben--gross dt { flex-basis: 220px; }

/* Vorschau der Unterlagen */
.vorschau { display: flex; flex-wrap: wrap; gap: 8px; }
.kachel-datei { position: relative; width: 64px; height: 64px; padding: 0; overflow: hidden; background: var(--grund); border: 1px solid var(--linie-stark); border-radius: 8px; color: var(--text-2); font-family: var(--mono); font-size: 11px; cursor: pointer; }
.kachel-datei:hover { border-color: var(--akzent); }
.kachel-datei img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vorschau--gross .kachel-datei { width: 132px; height: 132px; font-size: 13px; }
.vorschau--gross figure { display: flex; flex-direction: column; gap: 6px; width: 132px; margin: 0; }
.vorschau--gross figcaption { font-size: 12px; color: var(--gedaempft); overflow-wrap: anywhere; }

/* Dialoge */
.dialog { width: min(1080px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; background: var(--grund); border: 1px solid var(--linie-stark); border-radius: 14px; color: var(--text); }
.dialog::backdrop { background: rgba(4, 6, 9, 0.72); }
.dialog--gross { width: min(1400px, calc(100vw - 24px)); height: calc(100vh - 24px); }
.dialog--schmal { width: min(640px, calc(100vw - 24px)); }
.dialog-kopf { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; background: var(--grund); border-bottom: 1px solid var(--linie); }
.dialog-kopf h2 { font-family: var(--kopfschrift); font-size: 22px; font-weight: 700; }
.dialog-inhalt { display: flex; flex-direction: column; gap: 24px; padding: 24px; }
.dialog--gross .dialog-inhalt { height: calc(100% - 78px); padding: 0; }
.dialog--gross iframe, .dialog--gross img { width: 100%; height: 100%; border: 0; object-fit: contain; background: #fff; }
.abschnitt { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; }
.abschnitt > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--akzent); }
.abschnitt ul.punkte { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--text-2); }
.abschnitt ul.punkte li { display: flex; align-items: flex-start; gap: 10px; }
.abschnitt ul.punkte li::before { content: ''; flex: 0 0 auto; width: 6px; height: 6px; margin-top: 9px; background: var(--akzent); border-radius: 1px; }
.abschnitt ul.punkte--fehlt li::before { background: var(--rot); }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.spalten { display: flex; flex-wrap: wrap; gap: 24px; }
.spalten > * { flex: 1 1 340px; min-width: 0; }

/* Knöpfe, kleiner als auf der Website */
.knopf--klein { min-height: 36px; padding: 0 14px; font-size: 14px; }
.knopf--gefahr { background: transparent; border: 1px solid var(--rot); color: var(--rot); }
.knopf--gefahr:hover { color: var(--rot); filter: none; background: rgba(255, 123, 114, 0.08); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

/* Formulare */
.feld textarea, .feld select { width: 100%; padding: 12px 14px; background: var(--grund); border: 1.5px solid var(--linie-stark); border-radius: 8px; color: var(--text); font: inherit; font-size: 16px; }
.feld textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.feld select { min-height: 52px; }
.feld textarea:focus-visible, .feld select:focus-visible { outline-offset: 0; border-color: var(--akzent); }
.feld input[type="date"] { color-scheme: dark; }
.feld--schmal { flex: 0 1 180px; }
/* Felder untereinander behalten ihre Höhe, nebeneinander (in .felder) teilen sie sich die Zeile. */
.dialog .feld { flex: 0 0 auto; }
.dialog .felder > .feld { flex: 1 1 200px; }
.dialog .felder > .feld--schmal { flex: 0 1 180px; }
.positionen { display: flex; flex-direction: column; gap: 8px; }
.position { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.position .feld { gap: 4px; font-size: 12px; }
.position .feld input { min-height: 44px; font-size: 15px; }
.position .feld--text { flex: 4 1 260px; }
.position .feld--zahl { flex: 0 1 110px; }
.position .betrag { flex: 0 0 110px; min-height: 44px; display: flex; align-items: center; justify-content: flex-end; font-family: var(--mono); font-size: 15px; }
.position button { min-width: 44px; min-height: 44px; background: transparent; border: 1px solid var(--linie-stark); border-radius: 8px; color: var(--gedaempft); cursor: pointer; }
.position button:hover { color: var(--rot); border-color: var(--rot); }
.summe { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0 0; border-top: 1px solid var(--linie-stark); font-size: 18px; font-weight: 600; }
.summe span:last-child { font-family: var(--mono); }
.mailtext { width: 100%; min-height: 300px; padding: 14px; background: var(--grund); border: 1px solid var(--linie-stark); border-radius: 8px; color: var(--text-2); font-family: var(--mono); font-size: 13px; line-height: 1.55; resize: vertical; }

@media (max-width: 980px) {
  table.liste thead { display: none; }
  table.liste, table.liste tbody, table.liste tr, table.liste td { display: block; width: 100%; }
  table.liste tr { padding: 10px 0; border-bottom: 1px solid var(--linie); }
  table.liste tr:last-child { border-bottom: 0; }
  .liste td { padding: 6px 14px; border-bottom: 0; }
  .liste td[data-titel]::before { content: attr(data-titel); display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11px; color: var(--gedaempft); }
  .angaben--gross dt { flex-basis: 130px; }
}
