/*
 * Nuechternes Grundgeruest. Das Feindesign liefert Manuel spaeter ueber
 * Claude Design — hier steht nur die Struktur aus PRODUKT.md:
 * links feste Navigation, rechts Arbeitsbereich ueber die volle Breite.
 */

:root {
  --grund: #ffffff;
  --flaeche: #f6f7f9;
  --rand: #e2e5ea;
  --text: #1c1f24;
  --leise: #6b7280;
  --akzent: #2f6f4f;
  --warnung: #a4562a;
  --fehler: #a32d2d;
  --navigation: #1c2128;
  --navigation-text: #d7dbe0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #14171b;
    --flaeche: #1b1f24;
    --rand: #2c323a;
    --text: #e6e8eb;
    --leise: #98a1ad;
    --akzent: #6cbb92;
    --warnung: #d69a6a;
    --fehler: #e08585;
    --navigation: #0f1216;
    --navigation-text: #c6ccd4;
  }
}

* { box-sizing: border-box; }

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

.rahmen { display: flex; min-height: 100vh; }

/* Linke feste Navigation */
.navigation {
  width: 220px;
  flex: 0 0 220px;
  background: var(--navigation);
  color: var(--navigation-text);
  padding: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.marke {
  font-size: 17px;
  font-weight: 650;
  padding: 0 22px 20px;
  letter-spacing: -0.01em;
}
.marke span { opacity: 0.55; font-weight: 400; }

.navigation a,
.navigation .platzhalter {
  padding: 9px 22px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.navigation a:hover { background: rgba(255, 255, 255, 0.06); }
.navigation a.aktiv { background: rgba(255, 255, 255, 0.1); font-weight: 600; }
.navigation .platzhalter { opacity: 0.35; cursor: default; }

.navigation .fussnote {
  margin-top: auto;
  padding: 18px 22px 0;
  font-size: 12px;
  opacity: 0.45;
  line-height: 1.5;
}

/* Rechter Arbeitsbereich, volle Restbreite */
.arbeitsbereich {
  flex: 1;
  min-width: 0;
  padding: 28px 34px 48px;
}

.kopf h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.hinweis { color: var(--leise); margin: 0 0 22px; font-size: 14px; }
.hinweis.warnung { color: var(--warnung); }

/* Kacheln je Kunde */
.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kachel, .kasten {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 18px 20px;
}
.kachel h2, .kasten h2 { margin: 0 0 2px; font-size: 16px; }
.kachel .domain { margin: 0 0 14px; color: var(--leise); font-size: 13px; }

.zahlen { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 12px; }
.zahlen div { margin: 0; }
.zahlen dt { font-size: 11px; text-transform: uppercase;
             letter-spacing: 0.05em; color: var(--leise); }
.zahlen dd { margin: 2px 0 0; font-size: 20px; font-weight: 620;
             font-variant-numeric: tabular-nums; }

.zeitraum { font-size: 13px; color: var(--leise); margin: 0 0 12px; }
.zeitraum.warnung { color: var(--warnung); }

button {
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border: 1px solid var(--rand);
  border-radius: 7px;
  background: var(--grund);
  color: var(--text);
  cursor: pointer;
}
button:hover { border-color: var(--akzent); color: var(--akzent); }
button[aria-busy="true"] { opacity: 0.5; cursor: progress; }

.nachladung { margin-top: 12px; }
.nachladung:empty { margin-top: 0; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rand); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
     color: var(--leise); font-weight: 600; }
td.rechts, th.rechts { text-align: right; font-variant-numeric: tabular-nums; }
.leise { color: var(--leise); font-size: 12px; }
table.schmal th, table.schmal td { padding: 5px 8px; }

.status-fertig { color: var(--akzent); }
.status-teilweise { color: var(--warnung); }
.status-fehler { color: var(--fehler); }

/* Kennzeichnungen */
.marker {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
  border: 1px solid var(--rand);
  color: var(--leise);
  vertical-align: middle;
}
.marker.ziel { border-color: var(--akzent); color: var(--akzent); }
.marker.fest { border-color: var(--akzent); color: var(--akzent); }
.marker.unsicher { border-color: var(--warnung); color: var(--warnung);
                   font-weight: 700; cursor: help; }

.kasten.leer pre {
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 7px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
}

.fuss { margin-top: 26px; font-size: 12px; color: var(--leise); }

/* ---------------------------------------------------------------
   Stufe 3: Anmeldung und Dashboard
   --------------------------------------------------------------- */

body.mittig {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--flaeche);
}

.anmeldung {
  width: 330px;
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.marke.gross { padding: 0 0 20px; font-size: 21px; color: var(--text); }
.anmeldung label { font-size: 12px; color: var(--leise); margin-top: 10px; }
.anmeldung input {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--rand);
  border-radius: 7px;
  background: var(--flaeche);
  color: var(--text);
}
.anmeldung input:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
.anmeldung button { margin-top: 18px; padding: 10px; font-weight: 600; }

.meldung { font-size: 13px; margin: 0 0 4px; padding: 9px 11px; border-radius: 7px; }
.meldung.fehler { background: rgba(163, 45, 45, 0.12); color: var(--fehler); }

.navigation .gruppe {
  padding: 16px 22px 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.4;
}
.navigation .wer {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 6px;
  word-break: break-all;
}
button.schlicht {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  opacity: 0.6;
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
}
button.schlicht:hover { opacity: 1; color: inherit; }

.kasten.weit { margin-bottom: 16px; }
.kasten h3 { margin: 0 0 8px; font-size: 13px; }
.zweispaltig {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.besser { color: var(--akzent); }
.schlechter { color: var(--fehler); }
.warnung { color: var(--warnung); }

/* Balken im GSC-Überblick — ohne Diagramm-Bibliothek, nur Breite. */
th.balkenspalte, td.balkenspalte { width: 22%; padding-left: 14px; }
.balken {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: var(--akzent);
  opacity: 0.55;
  min-width: 2px;
}

a.seite { text-decoration: none; opacity: 0.4; font-size: 11px; margin-left: 3px; }
a.seite:hover { opacity: 1; }

.kachel h2 a { color: inherit; text-decoration: none; }
.kachel h2 a:hover { color: var(--akzent); }

.fussnote-block {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rand);
  font-size: 12px;
  color: var(--leise);
  line-height: 1.6;
}

/* ---------------------------------------------------------------
   Erklaerungen

   Der native title-Tooltip taugt hier nicht: er erscheint erst nach
   etwa einer Sekunde, verschwindet von allein wieder und ist per
   Tastatur gar nicht erreichbar. Was man stattdessen sieht, ist der
   Mauszeiger mit Fragezeichen — und der erklaert nichts.
   --------------------------------------------------------------- */

.hilfe {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted currentColor;
  display: inline-block;
}
.hilfe:focus { outline: 2px solid var(--akzent); outline-offset: 2px; }

.hilfezeichen {
  font-size: 9px;
  vertical-align: super;
  margin-left: 2px;
  opacity: 0.55;
}

.hilfetext {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  z-index: 40;
  width: max-content;
  max-width: 280px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--navigation);
  color: var(--navigation-text);
  border: 1px solid var(--rand);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  white-space: normal;
  /* Sofort da und sofort weg — kein Warten, kein Nachzittern. */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.08s;
}
.hilfe:hover .hilfetext,
.hilfe:focus .hilfetext { visibility: visible; opacity: 1; }

/* In rechtsbuendigen Spalten nach links ausrichten, sonst haengt der
   Kasten ueber den Tabellenrand hinaus. */
th.rechts .hilfetext, td.rechts .hilfetext { left: auto; right: 0; }

/* Tabellen duerfen den Erklaerungskasten nicht abschneiden. */
.kasten, table, thead, tbody, tr, th, td { overflow: visible; }

.marker.hilfe { border-bottom: none; }

.nachgeschlagen { display: block; font-size: 10px; margin-top: 1px; }

/* Legende */
.legende dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 18px;
  margin: 0;
  align-items: baseline;
}
.legende dl > div { display: contents; }
.legende dt { margin: 0; }
.legende dd { margin: 0; font-size: 13px; color: var(--leise); line-height: 1.6; }
.legende .kurven {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rand);
}
.legende .kurven p { font-size: 13px; color: var(--leise); margin: 0 0 14px; }
.legende .kurven dt { color: var(--text); font-size: 13px; }

.marker.leise { border-color: var(--rand); }

/* Knöpfe in Tabellenzeilen */
button.klein { font-size: 11px; padding: 3px 8px; white-space: nowrap; }
button.knopf {
  border: 1px solid var(--akzent);
  border-radius: 6px;
  background: none;
  color: var(--akzent);
  cursor: pointer;
  font: inherit;
}
button.knopf:hover { background: var(--akzent); color: var(--grund); }
button.knopf.klein { font-size: 11px; padding: 3px 9px; }
td form { margin: 0; }

.hinweis.warnung {
  color: var(--warnung);
  border-left: 2px solid var(--warnung);
  padding-left: 10px;
}

/* Kleine Herkunftszeile unter einer Spaltenüberschrift.
   Die Überschrift sagt, WAS in der Spalte steht, diese Zeile WOHER. */
.quelle {
  display: block;
  font-size: 9px;
  font-weight: 400;
  opacity: 0.5;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-top: 1px;
}

/* Klassen der SERP-Treffer */
.marker.anbieter   { border-color: var(--fehler);   color: var(--fehler); }
.marker.marktplatz { border-color: var(--warnung);  color: var(--warnung); }
.marker.portal     { border-color: var(--leise);    color: var(--leise); }
.marker.redaktion  { border-color: var(--rand);     color: var(--leise); }

/* Sortierbare Spalten */
table.sortierbar th { cursor: pointer; user-select: none; }
table.sortierbar th:hover { color: var(--text); }
table.sortierbar th.sortiert { color: var(--akzent); }
table.sortierbar th.sortiert::after { content: " ↓"; font-size: 9px; }
table.sortierbar th[data-richtung="auf"].sortiert::after { content: " ↑"; }

/* Keyword als Schaltfläche, sieht aber aus wie Text */
button.aufklappen {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px dotted var(--rand);
}
button.aufklappen:hover { color: var(--akzent); border-bottom-color: var(--akzent); }

/* Aufgeklappte Entwicklung */
tr.verlaufzeile > td { padding: 0; border-bottom: none; }
tr.verlaufzeile > td:empty { display: none; }
.verlauf {
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 9px;
  padding: 16px 18px;
  margin: 4px 0 14px;
}
.verlauf-kopf { margin-bottom: 14px; display: flex; gap: 9px;
                align-items: baseline; flex-wrap: wrap; }
.verlauf h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase;
              letter-spacing: 0.05em; color: var(--leise); }
.verlauf tr.eigene { background: rgba(47, 111, 79, 0.1); font-weight: 600; }

/* Zwei Daten untereinander in der Herkunft-Spalte */
.datumszeile { display: block; font-size: 10px; line-height: 1.5; margin-top: 3px; }
