:root {
  --grund: #f5f4f0;
  --flaeche: #ffffff;
  --tinte: #1c2230;
  --tinte-2: #5b6474;
  --tinte-3: #8b93a1;
  --linie: #e6e3dc;
  --linie-2: #f0eee8;
  --akzent: #d4a94a;
  --gut: #2f8f5b;
  --schlecht: #c0483f;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(28, 34, 48, 0.05), 0 4px 16px rgba(28, 34, 48, 0.04);
  --schrift: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #12151c;
    --flaeche: #1a1e27;
    --tinte: #eceef2;
    --tinte-2: #aab1bd;
    --tinte-3: #7d8594;
    --linie: #2a303c;
    --linie-2: #222732;
    --schatten: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 15px/1.5 var(--schrift);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* --- Marke --- */
.marke { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; letter-spacing: 0.02em; }
.marke-punkt {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--tinte);
  position: relative; flex: none;
}
.marke-punkt::after {
  content: ""; position: absolute; left: 7px; top: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--akzent);
}
.marke-zusatz { font-weight: 400; color: var(--tinte-2); }

/* --- Anmeldung --- */
.anmelde-flaeche { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.anmelde-karte {
  width: 100%; max-width: 420px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 32px 28px;
}
.anmelde-karte h1 { font-size: 28px; line-height: 1.15; margin: 18px 0 10px; letter-spacing: -0.01em; }
.leise { color: var(--tinte-2); }
.hinweis { background: #fbf1df; color: #6a4b0e; border-radius: 8px; padding: 10px 12px; }
.erfolg { background: #e6f4ec; color: #1f5c3b; border-radius: 8px; padding: 10px 12px; }
@media (prefers-color-scheme: dark) {
  .hinweis { background: #3a2f17; color: #f2d79c; }
  .erfolg { background: #17321f; color: #a9e2bf; }
}
.anmelde-form { display: grid; gap: 10px; margin-top: 18px; }
.anmelde-form label { font-size: 13px; font-weight: 600; color: var(--tinte-2); }
.anmelde-form input {
  font: inherit; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--linie); background: var(--grund); color: var(--tinte);
}
.anmelde-form input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.anmelde-form button {
  padding: 12px 16px; border: 0; border-radius: 10px;
  background: var(--tinte); color: var(--flaeche); font-weight: 700;
}

/* --- Kopf --- */
.kopf {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--grund) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}
.kopf-innen {
  max-width: 1240px; margin: 0 auto; padding: 12px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
}
.zeitraum { display: flex; gap: 4px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 3px; }
.zeitraum a {
  text-decoration: none; padding: 6px 12px; border-radius: 7px; font-size: 14px; color: var(--tinte-2); white-space: nowrap;
}
.zeitraum a[aria-current] { background: var(--tinte); color: var(--flaeche); font-weight: 600; }
.kopf-aktionen { display: flex; gap: 6px; margin-left: auto; }
.kopf-aktionen form { margin: 0; }
.leise-knopf {
  background: none; border: 1px solid var(--linie); border-radius: 8px; padding: 6px 12px;
  color: var(--tinte-2); font-size: 14px;
}
.leise-knopf:hover { color: var(--tinte); border-color: var(--tinte-3); }

/* --- Inhalt --- */
.inhalt { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; }
.lade { color: var(--tinte-2); }
.abschnitt { margin-top: 32px; }
.abschnitt-titel { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.abschnitt-titel h2 { font-size: 17px; margin: 0; }
.abschnitt-titel p { margin: 0; color: var(--tinte-3); font-size: 13px; }
.stand { color: var(--tinte-3); font-size: 13px; margin: 0 0 16px; }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 18px 20px;
}

/* Gesamtkacheln */
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kachel-titel { font-size: 13px; color: var(--tinte-2); margin: 0 0 8px; }
.kachel-titel.mit-abstand { margin-top: 20px; }
.kacheln .kachel-titel { margin-bottom: 0; }
.kachel-zahl { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 2px; line-height: 1.1; }
.kachel-fuss { font-size: 13px; color: var(--tinte-3); margin: 0; }
.delta { font-weight: 600; }
.delta.rauf { color: var(--gut); }
.delta.runter { color: var(--schlecht); }

/* Projektkarten */
.projekte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .projekte { grid-template-columns: 1fr; } }
.projekt { border-top: 4px solid var(--farbe, var(--akzent)); }
.projekt-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.projekt-kopf h3 { margin: 0; font-size: 17px; }
.projekt-kopf a { font-size: 13px; color: var(--tinte-3); text-decoration: none; }
.projekt-kopf a:hover { color: var(--tinte); }
.werte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin: 16px 0 12px; }
.wert-titel { font-size: 12px; color: var(--tinte-2); margin: 0; }
.wert-zahl { font-size: 22px; font-weight: 700; margin: 2px 0 0; line-height: 1.15; }
.wert-zahl small { font-size: 12px; font-weight: 600; margin-left: 6px; }
.sparkline { width: 100%; height: 44px; display: block; }
.projekt-hinweis { font-size: 12px; color: var(--tinte-3); margin: 8px 0 0; }
.fehler-liste { font-size: 12px; color: var(--schlecht); margin: 8px 0 0; padding-left: 16px; }

/* Diagramme */
.diagramm { width: 100%; height: auto; display: block; overflow: visible; }
.diagramm text { fill: var(--tinte-3); font-size: 11px; font-family: var(--schrift); }
.diagramm .gitter { stroke: var(--linie-2); }
.diagramm .achse { stroke: var(--linie); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: 13px; color: var(--tinte-2); list-style: none; padding: 0; }
.legende li { display: flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; background: var(--farbe); display: inline-block; }
.tooltip {
  position: fixed; pointer-events: none; z-index: 20;
  background: var(--tinte); color: var(--flaeche); border-radius: 8px; padding: 8px 10px; font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); white-space: nowrap;
}
.tooltip[hidden] { display: none; }
.zwei { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 1000px) { .zwei { grid-template-columns: 1fr; } }

/* Details je Projekt */
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.reiter button {
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--tinte-2);
  border-radius: 999px; padding: 6px 14px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.reiter button i { width: 9px; height: 9px; border-radius: 50%; background: var(--farbe); display: inline-block; }
.reiter button[aria-selected="true"] { border-color: var(--tinte); color: var(--tinte); font-weight: 600; }
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .details { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .details { grid-template-columns: 1fr; } }
.details h4 { margin: 0 0 10px; font-size: 14px; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 5px 8px; font-size: 13.5px; border-radius: 6px; overflow: hidden; }
.liste li .balken { position: absolute; inset: 0 auto 0 0; background: var(--farbe); opacity: 0.12; border-radius: 6px; }
.liste li span { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.liste li b { position: relative; font-weight: 600; flex: none; }
.leer { color: var(--tinte-3); font-size: 13px; margin: 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabelle th { text-align: left; font-weight: 600; color: var(--tinte-2); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--linie); }
.tabelle td { padding: 5px 6px; border-bottom: 1px solid var(--linie-2); }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; }
.tabelle td:first-child { max-width: 0; width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breit { grid-column: span 2; }
@media (max-width: 640px) { .breit { grid-column: auto; } }
.verbinden { background: var(--linie-2); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--tinte-2); margin: 0; }

.fuss { max-width: 1240px; margin: 0 auto; padding: 0 16px 32px; color: var(--tinte-3); font-size: 12px; }
