/* COMBENION Admin
   Farben nach dem Logo-Paket in Versalien (Version 1.0, Oktober 2026): Petrol #1F5560, Pflaume #3A2340, Koralle #E2674A,
   Creme #FAF5EE. Kombinationen laut Guide: Creme auf Petrol (Seitenleiste), Pflaume und Petrol auf Creme (Inhalt).
   Kontraste (WCAG AA): Text auf Creme 13:1, Petrol auf Weiß 8,3:1, Creme auf Petrol 7,7:1, leiser Text auf Weiß 5,8:1.
   Abstände im 4/8-px-Raster (--a1 bis --a7). Schrift Plus Jakarta Sans, selbst gehostet (SIL Open Font License 1.1). */

@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Marke */
  --petrol: #1F5560; --petrol-tief: #173F48; --pflaume: #3A2340; --koralle: #E2674A; --creme: #FAF5EE;
  /* Flächen und Linien */
  --weiss: #FFFFFF; --flaeche: #F5EEE4; --schwebe: #FCF9F4; --linie: #E7DED2; --linie-stark: #9A909E;
  --petrol-hell: #E4EEEF;
  /* Text */
  --text: #2E2833; --text-leise: #6B6270; --ueberschrift: var(--pflaume);
  /* Zustände, dezent: Schrift auf Fläche jeweils über 5:1 */
  --gut: #1E5A3C; --gut-flaeche: #E3F0E8;
  --warn: #7A4A0E; --warn-flaeche: #FBEEDC;
  --schlecht: #9C3A24; --schlecht-flaeche: #FBE9E3; --koralle-tief: #B3432A;
  --leise-flaeche: #EFEAE4;
  /* Raster */
  --a1: 4px; --a2: 8px; --a3: 12px; --a4: 16px; --a5: 24px; --a6: 32px; --a7: 48px;
  --rund-klein: 6px; --rund: 8px; --rund-gross: 12px;
  --leiste: 232px; --hoehe: 40px; --hoehe-klein: 32px;

  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text); background: var(--creme);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--creme); font-feature-settings: 'tnum' 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--petrol); text-underline-offset: 2px; }
a:hover { color: var(--petrol-tief); }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
small { font-size: 13px; color: var(--text-leise); }
p { margin: 0 0 var(--a4); }

/* ---------------------------------------------------------------- Typografie */
h1, h2, h3 { color: var(--ueberschrift); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 32px; font-weight: 700; }
h2 { font-size: 18px; line-height: 24px; font-weight: 650; margin: var(--a7) 0 var(--a3); }
.seitenkopf + h2, .meldung + h2, .warnhinweis + h2 { margin-top: 0; }
.leer { color: var(--text-leise); }
.inhalt .leer-tabelle { max-width: none; margin: 0; padding: var(--a3) var(--a4); border: 1px solid var(--linie); border-radius: var(--rund); }

/* ---------------------------------------------------------------- Rahmen: Seitenleiste und Inhalt */
body.admin { display: grid; grid-template-columns: var(--leiste) minmax(0, 1fr); min-height: 100vh; }
.leiste { background: var(--petrol); color: var(--creme); }
.leiste-innen { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--a6) var(--a4) var(--a5); }
/* Schutzzone: mindestens die Höhe des E (bei 160 px Breite etwa 15 px) rundum frei */
.leiste-logo { display: block; align-self: flex-start; padding: var(--a2) var(--a3) var(--a2); margin-bottom: var(--a6); border-radius: var(--rund-klein); }
.leiste-logo:focus-visible, .leiste a:focus-visible, .leiste-knopf:focus-visible { outline-color: var(--creme); }
.leiste-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--a1); }
.leiste-nav a {
  display: flex; align-items: center; min-height: var(--hoehe); padding: 0 var(--a3);
  border-radius: var(--rund-klein); color: var(--creme); text-decoration: none; font-weight: 500; opacity: .86;
}
.leiste-nav a:hover { background: var(--petrol-tief); color: var(--creme); opacity: 1; }
.leiste-nav a[aria-current="page"] { background: var(--petrol-tief); opacity: 1; font-weight: 650; box-shadow: inset 3px 0 0 var(--koralle); }
.leiste-person { margin: auto 0 0; padding: var(--a4) var(--a3) 0; border-top: 1px solid rgba(250, 245, 238, .18); display: grid; gap: var(--a3); }
.leiste-name { font-size: 13px; line-height: 18px; opacity: .86; overflow-wrap: anywhere; }
.knopf.leiste-knopf { justify-self: start; background: transparent; color: var(--creme); border-color: rgba(250, 245, 238, .55); height: var(--hoehe-klein); padding: 0 var(--a3); font-size: 13px; }
.knopf.leiste-knopf:hover { background: var(--petrol-tief); border-color: var(--creme); }

.inhalt { padding: var(--a6) var(--a6) var(--a7); min-width: 0; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--a4);
  padding-bottom: var(--a5); margin-bottom: var(--a5); border-bottom: 1px solid var(--linie); }
.aktionen { display: flex; flex-wrap: wrap; gap: var(--a2); }
.pfad { font-size: 13px; line-height: 18px; margin-bottom: var(--a1); }
.pfad a { color: var(--text-leise); text-decoration: none; font-weight: 600; }
.pfad a::after { content: ' /'; color: var(--linie-stark); }
.pfad a:hover { color: var(--petrol); text-decoration: underline; }
.inhalt > p { max-width: 75ch; }
.inhalt > p.meldung, .inhalt > p.warnhinweis { max-width: none; }
.springen { position: absolute; left: var(--a4); top: -100px; z-index: 10; padding: var(--a2) var(--a3); background: var(--weiss); color: var(--petrol); border-radius: var(--rund-klein); }
.springen:focus { top: var(--a4); }

/* ---------------------------------------------------------------- Meldungen */
.meldung, .warnhinweis {
  margin: 0 0 var(--a5); padding: var(--a3) var(--a4); border-radius: var(--rund-klein);
  background: var(--petrol-hell); color: var(--petrol-tief); box-shadow: inset 3px 0 0 var(--petrol); font-weight: 500;
}
.meldung.fehler, .warnhinweis { background: var(--schlecht-flaeche); color: var(--schlecht); box-shadow: inset 3px 0 0 var(--koralle); }

/* ---------------------------------------------------------------- Flächen */
.feld { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund); padding: var(--a5); }
.feld + .feld, .feld + .tabelle, .tabelle + .zeile, .feld + .leer-tabelle { margin-top: var(--a4); }
.feld > :last-child { margin-bottom: 0; }
.trenner { border: 0; border-top: 1px solid var(--linie); margin: var(--a5) calc(-1 * var(--a5)); }
.feld.gefahr { border-color: #EBC4B8; }
.abstand-oben { margin-top: var(--a4); }

/* Start: Zähler, gleiche Spalten in allen Reihen */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--a4); }
.zahl {
  display: flex; flex-direction: column; gap: var(--a1); min-height: 104px; padding: var(--a4) var(--a5);
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund);
  color: var(--text-leise); text-decoration: none; font-size: 14px; line-height: 20px;
}
.zahl b { font-size: 30px; line-height: 36px; font-weight: 700; color: var(--ueberschrift); }
.zahl:hover { border-color: var(--petrol); color: var(--text); }
.zahl.warnung { box-shadow: inset 3px 0 0 var(--koralle); }
.zahl.warnung b { color: var(--koralle-tief); }

/* ---------------------------------------------------------------- Tabellen */
.tabelle { overflow-x: auto; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th, td { text-align: left; padding: var(--a3) var(--a4); vertical-align: middle; }
th { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-leise); background: var(--flaeche); white-space: nowrap; border-bottom: 1px solid var(--linie); }
td { border-top: 1px solid var(--linie); }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover td { background: var(--schwebe); }
td:first-child, td time { white-space: nowrap; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
td small { display: block; overflow-wrap: anywhere; }
td details summary { cursor: pointer; color: var(--petrol); font-weight: 600; }
td details p { margin: var(--a2) 0 0; max-width: 60ch; white-space: normal; }
td .zeile { flex-wrap: nowrap; }

/* Plaketten für Status: Fläche hell, Schrift dunkel; Höhe 20 px wie die Textzeile */
.plakette {
  display: inline-block; padding: 0 var(--a2); border-radius: 999px; font-size: 12.5px; line-height: 20px; font-weight: 600;
  white-space: nowrap; background: var(--petrol-hell); color: var(--petrol-tief);
}
.plakette.neu { background: var(--petrol); color: var(--creme); }
.plakette.gut { background: var(--gut-flaeche); color: var(--gut); }
.plakette.warn { background: var(--warn-flaeche); color: var(--warn); }
.plakette.schlecht { background: var(--schlecht-flaeche); color: var(--schlecht); }
.plakette.leise { background: var(--leise-flaeche); color: var(--text-leise); }

/* Angaben: Bezeichnung über dem Wert, Spalten ab 240 px (gleiches Raster wie .formular) */
.felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--a4) var(--a5); margin: 0; }
.felder dt { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-leise); margin-bottom: 2px; }
.felder dd { margin: 0; overflow-wrap: break-word; white-space: pre-wrap; color: var(--text); }

/* ---------------------------------------------------------------- Formulare und Knöpfe */
.filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--a3) var(--a4); margin-bottom: var(--a4); }
.filter label { flex: 1 1 160px; max-width: 240px; }
.filter label.suche { flex: 2 1 240px; max-width: 360px; }
.filter .knopf { flex: none; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-leise); }
input, select, textarea {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--text); width: 100%;
  height: var(--hoehe); padding: 0 var(--a3); border: 1px solid var(--linie-stark); border-radius: var(--rund-klein); background: var(--weiss);
}
input:hover, select:hover, textarea:hover { border-color: var(--text-leise); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--petrol); outline-offset: 0; border-color: var(--petrol); }
textarea { height: auto; min-height: 96px; padding: 10px var(--a3); line-height: 22px; resize: vertical; }
input[type="hidden"] { display: none; }
.formular { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--a4) var(--a5); }
.formular > .voll, .formular > .felder, .formular > p, .formular > .trenner { grid-column: 1 / -1; }
.formular > p { margin: 0; max-width: 75ch; color: var(--text); }
.zeile { display: flex; flex-wrap: wrap; gap: var(--a2) var(--a3); align-items: center; }
.zeile form { margin: 0; }
.zeile .rechts { margin-left: auto; }
.zeile label { flex-direction: row; align-items: center; gap: var(--a3); }
.zeile select { width: auto; min-width: 200px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: var(--a2); grid-column: 1 / -1; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--a2); height: var(--hoehe); padding: 0 var(--a4);
  font: inherit; font-size: 14px; font-weight: 650; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
  border: 1px solid var(--petrol); border-radius: var(--rund-klein); background: var(--petrol); color: var(--creme);
}
.knopf:hover { background: var(--petrol-tief); border-color: var(--petrol-tief); color: var(--creme); }
.knopf.leise { background: var(--weiss); color: var(--petrol); border-color: var(--linie-stark); }
.knopf.leise:hover { background: var(--petrol-hell); border-color: var(--petrol); color: var(--petrol-tief); }
.knopf.gefahr { background: var(--weiss); color: var(--koralle-tief); border-color: var(--koralle); }
.knopf.gefahr:hover { background: var(--schlecht-flaeche); color: var(--schlecht); }
.knopf.klein { height: var(--hoehe-klein); padding: 0 var(--a3); font-size: 13px; }

.blaettern { display: flex; align-items: center; justify-content: flex-end; gap: var(--a3); margin-top: var(--a4); font-size: 14px; color: var(--text-leise); }

/* Nachweis */
pre { margin: 0; white-space: pre-wrap; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund); padding: var(--a4); font-size: 13px; line-height: 20px; }
iframe.vorschau { display: block; width: 100%; height: 720px; border: 1px solid var(--linie); border-radius: var(--rund); background: var(--weiss); }

/* ---------------------------------------------------------------- Ohne Sitzung: Anmelden und Fehler */
body.einfach { min-height: 100vh; display: grid; place-items: center; padding: var(--a5) var(--a4); }
.karte-einfach {
  width: 100%; max-width: 440px; padding: var(--a7) var(--a6) var(--a6); text-align: center;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund-gross);
}
.karte-einfach img { margin: 0 auto var(--a6); }
.karte-einfach h1 { font-size: 22px; line-height: 28px; margin-bottom: var(--a3); }
.karte-einfach p:not(.warnhinweis):not(.meldung) { color: var(--text-leise); }
.karte-einfach .knopf { width: 100%; margin-top: var(--a2); }
.karte-einfach .warnhinweis { text-align: left; }
.karte-einfach > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- Schmal: Kopfleiste statt Seitenleiste */
@media (max-width: 900px) {
  body.admin { display: block; }
  .leiste-innen {
    position: static; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center;
    gap: var(--a3) var(--a4); padding: var(--a3) var(--a4) var(--a4);
  }
  .leiste-logo { margin: 0; padding: var(--a3) var(--a2) var(--a3) 0; }
  .leiste-logo img { width: 128px; height: auto; }
  .leiste-person { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; }
  .leiste-name { display: none; }
  .leiste-nav { grid-column: 1 / -1; }
  .leiste-nav ul { grid-template-columns: repeat(3, 1fr); }
  .leiste-nav a { justify-content: center; min-height: 36px; padding: 0 var(--a2); font-size: 14px; }
  .leiste-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--koralle); }
  .inhalt { padding: var(--a5) var(--a4) var(--a6); }
}

@media (max-width: 640px) {
  h1 { font-size: 22px; line-height: 28px; }
  h2 { margin-top: var(--a6); }
  .seitenkopf { padding-bottom: var(--a4); margin-bottom: var(--a4); }
  .feld { padding: var(--a4); }
  .trenner { margin: var(--a4) calc(-1 * var(--a4)); }
  .filter label { flex: 1 1 140px; max-width: none; }
  .filter label.suche { flex: 1 1 100%; }
  .filter .knopf { flex: 1 1 auto; }
  .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a3); }
  .zahl { min-height: 0; padding: var(--a3) var(--a4); }
  .zahl b { font-size: 26px; line-height: 32px; }
  .zeile select { min-width: 0; flex: 1; }
  .zeile .rechts { margin-left: 0; }

  /* Tabellen untereinander: jede Zeile ein Block, jede Zelle mit Spaltenbezeichnung */
  .tabelle { overflow: visible; }
  .tabelle table, .tabelle tbody, .tabelle tr, .tabelle td { display: block; }
  .tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tabelle tr { padding: var(--a3) var(--a4); border-top: 1px solid var(--linie); }
  .tabelle tbody tr:first-child { border-top: 0; }
  .tabelle td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--a3); padding: var(--a1) 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .tabelle td::before { content: attr(data-label); font-size: 13px; font-weight: 600; color: var(--text-leise); }
  .tabelle td > * { min-width: 0; }
  .tabelle td .plakette { justify-self: start; }
  td .zeile { flex-wrap: wrap; }
  tbody tr:hover td { background: none; }

  .karte-einfach { padding: var(--a6) var(--a5) var(--a5); }
  .karte-einfach img { width: 168px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
