/* Gemeinsame Gestaltung fuer Kunden- und Betreiberoberflaeche.
   Bewusst dicht und sachlich: das ist ein Arbeitswerkzeug, keine Marketingseite.
   Ein Akzent (Tinte), Rot und Gruen ausschliesslich dort, wo sie echten Zustand
   bedeuten, also erlaubt und blockiert. Ein Radius-System. Keine Karten in Karten. */

:root {
  --grund:        #fbfbfa;
  --flaeche:      #ffffff;
  --flaeche-2:    #f4f4f2;
  --linie:        #e2e1dd;
  --linie-stark:  #cfcdc7;
  --tinte:        #16161a;
  --tinte-2:      #55545c;
  --tinte-3:      #8b8a92;
  --akzent:       #1f4ed8;
  --akzent-weich: #eaefff;
  --ja:           #12694a;
  --ja-weich:     #e6f4ee;
  
  --nein:         #9a1c23;
  --nein-weich:   #fbeaea;
  --warn:         #8a5a00;
  --warn-weich:   #fdf3e0;
  --radius:       6px;
  --radius-gross: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --grund:        #131316;
    --flaeche:      #1a1a1e;
    --flaeche-2:    #222227;
    --linie:        #2e2e34;
    --linie-stark:  #43434b;
    --tinte:        #f2f2f0;
    --tinte-2:      #a9a8b0;
    --tinte-3:      #77767e;
    --akzent:       #7d9cff;
    --akzent-weich: #1b2440;
    --ja:           #63c39b;
    --ja-weich:     #14291f;
    --nein:         #eb8a8a;
    --nein-weich:   #2d1717;
    --warn:         #e0b76a;
    --warn-weich:   #2c2415;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tinte);
  background: var(--grund);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- Gerüst */

.kopf {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  height: 56px; padding: 0 20px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 650; letter-spacing: -0.02em; font-size: 15px; }
.marke span { color: var(--tinte-3); font-weight: 450; }
.kopf nav { display: flex; gap: 2px; margin-left: 8px; }
.kopf nav a {
  padding: 6px 11px; border-radius: var(--radius);
  color: var(--tinte-2); text-decoration: none; font-weight: 500;
}
.kopf nav a:hover { background: var(--flaeche-2); color: var(--tinte); }
.kopf nav a[aria-current="page"] { background: var(--akzent-weich); color: var(--akzent); }
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 12px;
                color: var(--tinte-3); font-size: 13px; }

.huelle { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }

.titel { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.titel h1 { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.unterzeile { color: var(--tinte-2); margin-bottom: 22px; max-width: 70ch; }

.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.abschnitt { margin-top: 34px; }
.abschnitt > h2 {
  font-size: 13px; font-weight: 650; letter-spacing: 0.02em;
  padding-bottom: 8px; margin-bottom: 14px;
  border-bottom: 1px solid var(--linie);
}

/* ---------------------------------------------------------------- Zahlen */

.zahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
          background: var(--linie); border: 1px solid var(--linie);
          border-radius: var(--radius-gross); overflow: hidden; }
.zahl { background: var(--flaeche); padding: 15px 16px; }
.zahl b { display: block; font-size: 25px; font-weight: 620; letter-spacing: -0.03em;
          font-variant-numeric: tabular-nums; }
.zahl span { color: var(--tinte-2); font-size: 12.5px; }
.zahl.gut b { color: var(--ja); }
.zahl.schlecht b { color: var(--nein); }
@media (max-width: 780px) { .zahlen { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- Tabelle */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-weight: 600; color: var(--tinte-2); font-size: 12px;
  padding: 0 12px 7px; border-bottom: 1px solid var(--linie-stark); white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: top;
           overflow-wrap: anywhere; }
/* Breite Tabellen scrollen in sich, statt die ganze Seite breiter zu machen.
   Eine Seite, die waagrecht wandert, weil eine Zelle zu lang ist, wirkt kaputt. */
.tabellenrahmen { overflow-x: auto; }
tbody tr:hover td { background: var(--flaeche-2); }
td.zahlenspalte, th.zahlenspalte { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.leise { color: var(--tinte-3); }

/* ---------------------------------------------------------------- Marken */

.marker {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
}
.marker.ja   { background: var(--ja-weich);   color: var(--ja); }
.marker.nein { background: var(--nein-weich); color: var(--nein); }
.marker.warn { background: var(--warn-weich); color: var(--warn); }
.marker.neutral { background: var(--flaeche-2); color: var(--tinte-2); }

/* ---------------------------------------------------------------- Knöpfe */

button, .knopf {
  font: inherit; font-weight: 550; cursor: pointer;
  padding: 7px 14px; border-radius: var(--radius);
  border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--tinte);
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;          /* eine umgebrochene Beschriftung sieht kaputt aus */
  transition: transform .06s ease, background .12s ease;
}
button:hover, .knopf:hover { background: var(--flaeche-2); }
button:active, .knopf:active { transform: translateY(1px); }
button.haupt, .knopf.haupt {
  background: var(--akzent); border-color: var(--akzent); color: #fff;
}
button.haupt:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, .knopf:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* ---------------------------------------------------------------- Hinweise */

.hinweis {
  display: flex; gap: 11px; padding: 13px 15px;
  border-radius: var(--radius-gross); border: 1px solid var(--linie);
  background: var(--flaeche); margin-bottom: 18px;
}
.hinweis.sperre { border-color: var(--nein); background: var(--nein-weich); }
.hinweis.achtung { border-color: var(--warn); background: var(--warn-weich); }
.hinweis b { display: block; margin-bottom: 2px; }
.hinweis p { color: var(--tinte-2); font-size: 13px; }
.hinweis .zeichen { font-weight: 700; font-size: 15px; line-height: 1.3; }

/* ---------------------------------------------------------------- Formular */

.feld { display: grid; gap: 5px; margin-bottom: 15px; }
.feld label { font-weight: 550; font-size: 13px; }
.feld .hilfe { color: var(--tinte-3); font-size: 12.5px; }
input[type=text], input[type=url], input[type=date], select, textarea {
  font: inherit; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--tinte);
  width: 100%;
}
input::placeholder { color: var(--tinte-3); }
.haken { display: flex; gap: 9px; align-items: flex-start; padding: 9px 0;
         border-bottom: 1px solid var(--linie); }
.haken:last-child { border-bottom: 0; }
.haken input { margin-top: 3px; flex-shrink: 0; }
.haken span { font-size: 13px; }
.haken .norm { color: var(--tinte-3); font-size: 12px; display: block; }

/* ---------------------------------------------------------------- Leerzustand */

.leerzustand { padding: 44px 20px; text-align: center; color: var(--tinte-2);
               border: 1px dashed var(--linie-stark); border-radius: var(--radius-gross); }
.leerzustand b { display: block; color: var(--tinte); margin-bottom: 5px; }

/* ---------------------------------------------------------------- Skelett */

.skelett { background: linear-gradient(90deg, var(--flaeche-2) 25%,
           var(--linie) 50%, var(--flaeche-2) 75%);
           background-size: 200% 100%; border-radius: var(--radius); height: 13px; }
@media (prefers-reduced-motion: no-preference) {
  .skelett { animation: schimmer 1.4s linear infinite; }
}
@keyframes schimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- Zwei Spalten */

.zweispaltig { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 900px) { .zweispaltig { grid-template-columns: 1fr; } }

.postfach { display: grid; grid-template-columns: 320px 1fr; gap: 0;
            border: 1px solid var(--linie); border-radius: var(--radius-gross);
            overflow: hidden; min-height: 460px; }
.postfach .liste { border-right: 1px solid var(--linie); background: var(--flaeche);
                   overflow-y: auto; max-height: 620px; }
.postfach .eintrag { padding: 12px 14px; border-bottom: 1px solid var(--linie);
                     cursor: pointer; }
.postfach .eintrag:hover { background: var(--flaeche-2); }
.postfach .eintrag[aria-selected="true"] { background: var(--akzent-weich); }
.postfach .eintrag b { display: block; font-size: 13px; }
.postfach .eintrag p { color: var(--tinte-2); font-size: 12.5px;
                       overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.postfach .inhalt { padding: 20px 22px; background: var(--flaeche); }
@media (max-width: 900px) { .postfach { grid-template-columns: 1fr; }
                            .postfach .liste { max-height: 280px; } }

.entwurf { border: 1px solid var(--linie); border-radius: var(--radius);
           padding: 14px; background: var(--flaeche-2); white-space: pre-wrap;
           font-size: 13.5px; margin-top: 12px; }
