/* Uptime-Monitor — Oberfläche
 *
 * Leitgedanke: nur einfärben, was eine Entscheidung verlangt.
 *
 * Ein Melder, der jede gesunde Seite grün badget, erzeugt ein Feld aus Grün,
 * in dem das eine Rot untergeht. Deshalb bleibt der Normalfall hier
 * unauffällig — Farbe bekommt nur die Abweichung.
 */

:root {
  --grund:    #f6f7f9;
  --flaeche:  #ffffff;
  --rand:     #e4e7ec;
  --text:     #101828;
  --leise:    #667085;
  --sehrleise:#98a2b3;
  --stoerung: #b42318;
  --stoerung-flaeche: #fef3f2;
  --warnung:  #b54708;
  --warnung-flaeche:  #fffaeb;
  --gut:      #067647;
  --akzent:   #2563eb;
  --radius:   10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund:    #0f1115;
    --flaeche:  #171a21;
    --rand:     #262b36;
    --text:     #e7eaf0;
    --leise:    #98a2b3;
    --sehrleise:#6b7484;
    --stoerung: #f97066;
    --stoerung-flaeche: #2a1614;
    --warnung:  #fdb022;
    --warnung-flaeche:  #2a2113;
    --gut:      #47cd89;
    --akzent:   #6395f9;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Rahmen ------------------------------------------------------------ */
.kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}
.marke { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.kopf nav { display: flex; gap: 18px; }
.kopf nav a { color: var(--leise); text-decoration: none; font-size: 14px; }
.kopf nav a:hover { color: var(--text); }
.kopf nav a.an { color: var(--text); font-weight: 600; }
.kopf nav a.leise { color: var(--sehrleise); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

.fuss {
  max-width: 1080px; margin: 0 auto; padding: 0 20px 40px;
  font-size: 12px; color: var(--sehrleise);
}

/* ---- Gesamtlage -------------------------------------------------------- */
/* Ein Satz, der die Frage "läuft alles?" ohne Lesen der Tabelle beantwortet. */
.lage {
  padding: 18px 20px; margin-bottom: 22px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}
.lage h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.lage p  { margin: 5px 0 0; color: var(--leise); font-size: 14px; }
.lage.hat-stoerung { border-color: var(--stoerung); background: var(--stoerung-flaeche); }
.lage.hat-stoerung h1 { color: var(--stoerung); }
.lage.hat-warnung  { border-color: var(--warnung); background: var(--warnung-flaeche); }

/* ---- Abschnitte -------------------------------------------------------- */
h2 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--sehrleise);
  margin: 30px 0 10px;
}

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---- Störungsblock ----------------------------------------------------- */
.stoerung-zeile {
  display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rand);
}
.stoerung-zeile:last-child { border-bottom: 0; }
.stoerung-zeile .name { font-weight: 620; min-width: 190px; }
.stoerung-zeile .was  { color: var(--stoerung); font-weight: 600; font-size: 14px; }
.stoerung-zeile .wann { color: var(--leise); font-size: 13px; margin-left: auto; white-space: nowrap; }
.stoerung-zeile .grund {
  flex-basis: 100%; color: var(--leise); font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- Tabelle ----------------------------------------------------------- */
.tabelle-huelle { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--sehrleise);
  padding: 11px 14px;
  border-bottom: 1px solid var(--rand);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rand);
  vertical-align: baseline;
}
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.gruppe td {
  background: var(--grund);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--sehrleise);
  padding: 8px 14px;
}

td a { color: var(--text); text-decoration: none; font-weight: 560; }
td a:hover { color: var(--akzent); text-decoration: underline; }

.url { display: block; font-size: 12px; color: var(--sehrleise); margin-top: 1px; }

/* Der Normalfall bleibt bewusst farblos. */
.wert-still { color: var(--leise); }
.wert-schlecht { color: var(--stoerung); font-weight: 650; }
.wert-warn { color: var(--warnung); font-weight: 620; }
.wert-fehlt { color: var(--sehrleise); }

.pausiert { opacity: 0.55; }

/* ---- Marke für Abweichungen -------------------------------------------- */
/* Nur hierfür, nie für "alles gut". */
.mal {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.mal.rot  { color: var(--stoerung); background: var(--stoerung-flaeche); border-color: var(--stoerung); }
.mal.gelb { color: var(--warnung);  background: var(--warnung-flaeche);  border-color: var(--warnung); }

/* ---- Hinweise ---------------------------------------------------------- */
.hinweis {
  margin-top: 14px; padding: 12px 16px;
  border-left: 3px solid var(--warnung);
  background: var(--warnung-flaeche);
  border-radius: 0 6px 6px 0;
  font-size: 13px; color: var(--text);
}
.leer { padding: 26px 18px; color: var(--leise); text-align: center; }

/* ---- Login ------------------------------------------------------------- */
.login {
  max-width: 340px; margin: 70px auto;
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 26px;
}
.login h1 { margin: 0 0 18px; font-size: 17px; }
.login label { display: block; font-size: 13px; color: var(--leise); margin-bottom: 5px; }
.login input {
  width: 100%; padding: 9px 11px; margin-bottom: 15px;
  border: 1px solid var(--rand); border-radius: 7px;
  background: var(--grund); color: var(--text); font-size: 15px;
}
.login input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent; }
.login button {
  width: 100%; padding: 10px; border: 0; border-radius: 7px;
  background: var(--akzent); color: #fff; font-size: 15px; font-weight: 620; cursor: pointer;
}
.login button:hover { filter: brightness(1.08); }
.fehler {
  padding: 10px 12px; margin-bottom: 15px; border-radius: 7px;
  background: var(--stoerung-flaeche); color: var(--stoerung);
  border: 1px solid var(--stoerung); font-size: 13px;
}

/* ---- Detailseite ------------------------------------------------------- */
.kennzahlen { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.kennzahl {
  flex: 1 1 150px; padding: 14px 16px;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
}
.kennzahl .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sehrleise); }
.kennzahl .v { font-size: 21px; font-weight: 680; margin-top: 3px; font-variant-numeric: tabular-nums; }

.balken { display: flex; gap: 2px; align-items: flex-end; height: 46px; margin-top: 4px; }
.balken div { flex: 1; background: var(--gut); border-radius: 2px 2px 0 0; min-height: 3px; }
.balken div.schlecht { background: var(--stoerung); }
.balken div.leer { background: var(--rand); }

.zurueck { display: inline-block; margin-bottom: 14px; color: var(--leise); text-decoration: none; font-size: 14px; }
.zurueck:hover { color: var(--text); }
