/*
 * Backoffice — Farbwelt nach Wunsch von Aleks (Fragebogen 29.07.2026):
 * schwarzer Hintergrund, weisse Schrift, farbige Icons in Grün / Orange /
 * Hellblau. Die drei Akzente sind gegen den dunklen Grund auf Kontrast und
 * Farbfehlsichtigkeit geprüft (alle Werte über den Schwellen).
 */

:root {
  color-scheme: dark;

  --plane: #0b0c0e;
  --surface: #16181c;
  --surface-2: #1e2126;
  --surface-3: #262a31;
  --linie: rgba(255, 255, 255, 0.10);
  --linie-stark: rgba(255, 255, 255, 0.18);

  --text: #ffffff;
  --text-2: #a8adb8;
  --text-3: #7c828e;

  /* geprüfte Akzente */
  --blau: #3987e5;
  --orange: #d95926;
  --gruen: #199e70;

  /* Status — fest, nie als Seriefarbe verwenden */
  --gut: #0ca30c;
  --warnung: #fab219;
  --ernst: #ec835a;
  --kritisch: #d03b3b;

  /* Diagrammfarben. Eigene Marken, damit ein Design die Diagramme umfärben
     kann, ohne die Status- und Akzentfarben mitzuziehen. */
  --serie-1: #3987e5;
  --serie-2: #d95926;
  --serie-3: #199e70;

  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;

  /* Träger hinter dem Logo. Standard ist keiner: das «Glo» im Logo hat eine
     helle Kontur und steht auf hellem wie dunklem Grund. Ein Design, das
     bewusst ein Schild will, setzt diese vier Marken — dann folgt der Träger
     dem Design, statt als weisser Kasten darin zu kleben. */
  --logo-flaeche: transparent;
  --logo-rand: transparent;
  --logo-radius: var(--radius);
  --logo-polster: 0px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--blau); }

/* Grundgrösse für alle eingebetteten Icons; Sonderfälle überschreiben unten.
   Diagramm-SVGs tragen role="img" und bleiben davon unberührt. */
svg[aria-hidden] { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

.mono { font-variant-numeric: tabular-nums; }
.leise { color: var(--text-2); }
.klein { font-size: 13px; }

/* ---------------------------------------------------------------- Anmeldung */
.anmeldung {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.anmeldung__karte {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--linie);
  border-radius: 16px;
  padding: 36px 32px;
  text-align: center;
}
.anmeldung__logo {
  width: 168px;
  margin-bottom: 28px;
  background: var(--logo-flaeche);
  border: 1px solid var(--logo-rand);
  border-radius: var(--logo-radius);
  padding: var(--logo-polster);
}
.anmeldung__feld {
  width: 100%;
  margin-top: 10px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}
.anmeldung__feld:focus { outline: 2px solid var(--blau); outline-offset: 1px; }
.anmeldung__hinweis {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ------------------------------------------------------------------- Gerüst */
.huelle { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }

.seitenleiste {
  background: var(--surface);
  border-right: 1px solid var(--linie);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
/* Das Logo führt zur Übersicht — dafür muss es ein Knopf sein, nicht nur ein Bild. */
.seitenleiste__heim {
  background: var(--logo-flaeche);
  border: 1px solid var(--logo-rand);
  border-radius: var(--logo-radius);
  padding: var(--logo-polster);
  margin-bottom: 18px;
  cursor: pointer;
  align-self: stretch;
  max-width: 100%;
  line-height: 0;
}
.seitenleiste__heim:hover { border-color: var(--linie-stark); }
.seitenleiste__heim:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
/* max-width, damit ein Design die Breite auf `auto` stellen darf, ohne dass
   das Bild in seiner Originalgrösse aus der Leiste läuft. */
.seitenleiste__logo { width: 128px; max-width: 100%; margin: 4px 8px; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav:hover { background: var(--surface-2); color: var(--text); }
.nav--aktiv { background: var(--surface-3); color: var(--text); border-color: var(--linie); }
.nav svg { width: 19px; height: 19px; flex: none; }
.nav__zahl {
  margin-left: auto;
  font-size: 12px;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 20px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.nav--aktiv .nav__zahl { background: rgba(255, 255, 255, 0.14); color: var(--text); }

.seitenleiste__fuss {
  margin-top: auto;
  padding: 12px 11px 4px;
  border-top: 1px solid var(--linie);
  font-size: 12.5px;
  color: var(--text-3);
}

.inhalt { padding: 24px 30px 96px; max-width: 1360px; } /* unten Platz für das Rückmelde-Fenster */

.kopf {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.kopf__titel { display: flex; flex-direction: column; gap: 3px; }

/* ------------------------------------------------------------------ Bausteine */
.karte {
  background: var(--surface);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 18px 20px;
}
.karte--hervor {
  border-color: var(--blau);
  box-shadow: 0 0 0 3px rgba(57, 135, 229, 0.18);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.karte__kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.raster { display: grid; gap: 16px; }
.raster--4 { grid-template-columns: repeat(4, 1fr); }
.raster--3 { grid-template-columns: repeat(3, 1fr); }
.raster--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) {
  .raster--4 { grid-template-columns: repeat(2, 1fr); }
  .raster--3, .raster--2 { grid-template-columns: 1fr; }
}

.kachel { display: flex; flex-direction: column; gap: 5px; }
.kachel--klickbar {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.kachel--klickbar:hover { background: var(--surface-2); border-color: var(--linie-stark); }
.kachel--klickbar:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.kachel__pfeil { margin-left: auto; color: var(--text-3); transition: color 0.12s, transform 0.12s; }
.kachel--klickbar:hover .kachel__pfeil { color: var(--text); transform: translateX(2px); }
.kachel__wert { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kachel__bez { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.kachel__bez svg { width: 15px; height: 15px; }

.knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--linie-stark);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.knopf:hover { background: var(--surface-3); }
.knopf svg { width: 16px; height: 16px; }
.knopf--haupt { background: var(--blau); border-color: var(--blau); color: #fff; }
.knopf--haupt:hover { background: #4d94e9; }
.knopf--klein { padding: 5px 10px; font-size: 13px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid var(--linie);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.chip:hover { border-color: var(--linie-stark); color: var(--text); }
.chip--aktiv { background: var(--surface-3); color: var(--text); border-color: var(--linie-stark); }

/* Status-Plakette: nie nur Farbe — immer Punkt + Wort */
.plakette {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}
.plakette::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.p-blau { color: var(--blau); }
.p-orange { color: var(--ernst); }
.p-gruen { color: var(--gut); }
.p-grau { color: var(--text-3); }
.p-warnung { color: var(--warnung); }
.p-kritisch { color: var(--kritisch); }

/* ------------------------------------------------------------------- Tabelle */
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--linie);
  white-space: nowrap;
}
.tabelle td { padding: 11px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle tbody tr:hover { background: var(--surface-2); }
.tabelle tbody tr:last-child td { border-bottom: none; }
.tabelle .r { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle--klickbar tbody tr { cursor: pointer; }
.tabelle__leer { padding: 28px 12px; color: var(--text-3); text-align: center; }

.zeile-warnung { background: rgba(250, 178, 25, 0.07); }
.zeile-warnung:hover { background: rgba(250, 178, 25, 0.12); }

/* --------------------------------------------------------------- Läuft-noch */
.laeuft {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gut);
  font-variant-numeric: tabular-nums;
}
.laeuft__punkt {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gut);
  animation: puls 2s ease-in-out infinite;
}
@keyframes puls { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .laeuft__punkt { animation: none; } }

/* ------------------------------------------------------------------ Diagramm */
.diagramm { width: 100%; overflow-x: auto; }
.diagramm svg { display: block; }
.achse { fill: var(--text-3); font-size: 11.5px; }
.gitter { stroke: #2c2f34; stroke-width: 1; }
.grundlinie { stroke: #383c43; stroke-width: 1; }
.balken { transition: opacity 0.12s; }
.balken:hover { opacity: 0.78; }
.wertlabel { fill: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }

.legende { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.legende__eintrag { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.legende__punkt { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.hinweisblase {
  position: fixed;
  z-index: 60;
  background: var(--surface-3);
  border: 1px solid var(--linie-stark);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.hinweisblase--an { opacity: 1; }

/* -------------------------------------------------------------------- Dialog */
.schleier {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}
.dialog {
  width: min(560px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--linie-stark);
  border-radius: 16px;
  padding: 24px 26px;
}
.dialog__kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.dialog__schliessen {
  background: none; border: none; color: var(--text-3);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.dialog__schliessen:hover { color: var(--text); }
.dialog__fuss { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.feld { display: block; margin-bottom: 14px; }
.feld__bez { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.feld input, .feld select, .feld textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--linie);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: 2px solid var(--blau); outline-offset: 1px; }

/* ----------------------------------------------------------------- Details */
.paar { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--linie); font-size: 14px; }
.paar:last-child { border-bottom: none; }
.paar__bez { color: var(--text-2); }

.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.foto {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.foto svg { width: 22px; height: 22px; }

.unterschrift {
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px 14px;
}

.fortschritt { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.fortschritt__wert { height: 100%; border-radius: 4px; background: var(--gruen); }

.meldung {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-3);
  border: 1px solid var(--linie-stark);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 70;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.meldung--an { opacity: 1; transform: translateX(-50%) translateY(0); }

.demo-band {
  background: rgba(57, 135, 229, 0.12);
  border: 1px solid rgba(57, 135, 229, 0.35);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.demo-band strong { color: var(--text); font-weight: 600; }

/* -------------------------------------------------------------- Designwahl */
.designs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

.design {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 12px 12px 15px;
  background: var(--surface);
  border: 1px solid var(--linie);
  border-radius: 14px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}
.design:hover { border-color: var(--linie-stark); transform: translateY(-2px); }
.design:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.design--aktiv { border-color: var(--blau); box-shadow: 0 0 0 2px rgba(57, 135, 229, 0.22); }

.design__name {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
}
.design__marke {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--gut);
}
.design__marke svg { width: 13px; height: 13px; }
.design__text { font-size: 13px; color: var(--text-2); line-height: 1.45; }

/* Kleines Abbild der Oberfläche. Alle Farben kommen als --v-* von aussen,
   damit dieselbe Kachel jedes Design zeigen kann. */
.vorschau {
  display: flex;
  height: 132px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--linie);
  background: var(--v-grund);
  font-family: var(--v-schrift);
  pointer-events: none;
}
.vorschau__leiste {
  width: 52px;
  flex: none;
  padding: 8px 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--v-flaeche);
  border-right: 1px solid var(--v-linie);
}
.vorschau__logo {
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--v-a1), var(--v-a2) 55%, var(--v-a3));
  margin-bottom: 4px;
}
.vorschau__nav { height: 7px; border-radius: 3px; background: var(--v-linie); }
.vorschau__nav--aktiv { background: var(--v-a1); }

.vorschau__inhalt { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vorschau__reihe { display: flex; gap: 8px; }
.vorschau__kachel {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: var(--v-radius);
  background: var(--v-flaeche);
  border: 1px solid var(--v-linie);
  color: var(--v-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
.vorschau__kachel--2 { color: var(--v-a2); }
.vorschau__karte {
  flex: 1;
  padding: 10px;
  border-radius: var(--v-radius);
  background: var(--v-flaeche);
  border: 1px solid var(--v-linie);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}
.vorschau__balken { height: 7px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  .design:hover { transform: none; }
}

/* ------------------------------------------------------- Rückmelde-Fenster */
.fb { position: fixed; right: 22px; bottom: 22px; z-index: 90; }

.fb__knopf {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--blau);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  margin-left: auto;
  transition: background 0.12s, transform 0.12s;
}
.fb__knopf:hover { background: #4d94e9; transform: translateY(-1px); }
.fb__knopf:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fb__knopf svg { width: 25px; height: 25px; }

.fb__punkt {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  background: var(--warnung);
  color: #1a1a19;
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
  padding: 0 5px;
  border: 2px solid var(--plane);
}

.fb__fenster {
  width: min(348px, calc(100vw - 44px));
  max-height: min(560px, 72dvh);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--linie-stark);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

.fb__kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--linie);
}
.fb__unterzeile { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.fb__schliessen {
  background: none; border: none; color: var(--text-3);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.fb__schliessen:hover { color: var(--text); }

.fb__verlauf {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb__leer { font-size: 13.5px; color: var(--text-2); line-height: 1.65; }

.fb__blase {
  align-self: flex-end;
  max-width: 92%;
  background: var(--surface-3);
  border: 1px solid var(--linie);
  border-radius: 12px 12px 4px 12px;
  padding: 9px 12px;
}
.fb__text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.fb__fuss { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.fb__ok { color: var(--gut); }
.fb__wartet { color: var(--text-2); }
.fb__fehler { color: var(--warnung); }
.fb__erneut {
  background: none; border: none; padding: 0 0 0 4px;
  color: var(--blau); font: inherit; font-size: 11.5px;
  cursor: pointer; text-decoration: underline;
}

.fb__eingabe {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid var(--linie);
}
.fb__eingabe textarea {
  flex: 1;
  resize: none;
  background: var(--surface-2);
  border: 1px solid var(--linie);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  max-height: 120px;
}
.fb__eingabe textarea:focus { outline: 2px solid var(--blau); outline-offset: 1px; }
.fb__senden {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 10px;
  border: none;
  background: var(--blau);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.fb__senden:hover { background: #4d94e9; }
.fb__senden svg { width: 19px; height: 19px; }

@media (max-width: 560px) {
  .fb { right: 14px; bottom: 14px; left: 14px; }
  .fb__fenster { width: 100%; }
}

@media (max-width: 860px) {
  .huelle { grid-template-columns: 1fr; }
  .seitenleiste {
    position: static; height: auto; flex-direction: row; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--linie); padding: 10px;
  }
  .seitenleiste__heim, .seitenleiste__fuss { display: none; }
  .nav { white-space: nowrap; width: auto; }
  .inhalt { padding: 18px 16px 50px; }
}
