/* WebScout CRM – Oberflaeche */
:root {
  --bg: #f5f6f8;
  --karte: #ffffff;
  --rand: #e4e7ec;
  --text: #1a1d26;
  --text-leise: #6b7280;
  --akzent: #2563eb;
  --akzent-hell: #eff4ff;
  --gruen: #16a34a;
  --gelb: #d97706;
  --rot: #dc2626;
  --lila: #7c3aed;
  --sidebar: #141822;
  --sidebar-text: #9aa3b2;
  --schatten: 0 1px 2px rgba(16,24,40,.05), 0 4px 12px rgba(16,24,40,.04);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- Grundgeruest */
.huelle { display: flex; min-height: 100vh; }

.seitenleiste {
  width: 232px; flex-shrink: 0; background: var(--sidebar);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.marke {
  padding: 22px 20px 18px; color: #fff; font-size: 17px; font-weight: 650;
  letter-spacing: -.2px; display: flex; align-items: center; gap: 10px;
}
.marke .punkt {
  width: 9px; height: 9px; border-radius: 50%; background: var(--akzent);
  box-shadow: 0 0 0 4px rgba(37,99,235,.22);
}
.navi { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.navi a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 8px; color: var(--sidebar-text); font-weight: 500;
  text-decoration: none; transition: background .12s, color .12s;
}
.navi a:hover { background: rgba(255,255,255,.06); color: #e8ecf3; text-decoration: none; }
.navi a.an { background: var(--akzent); color: #fff; }
.navi a .zahl {
  margin-left: auto; font-size: 11.5px; background: rgba(255,255,255,.12);
  padding: 1px 7px; border-radius: 20px;
}
.navi a.an .zahl { background: rgba(255,255,255,.25); }
.navi .trenner { height: 1px; background: rgba(255,255,255,.08); margin: 10px 12px; }
.sidebar-fuss {
  margin-top: auto; padding: 16px 20px; color: #5b6373; font-size: 11.5px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.inhalt { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1560px; }
.kopf { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.kopf h1 { margin: 0; font-size: 23px; font-weight: 650; letter-spacing: -.4px; }
.kopf .unter { color: var(--text-leise); margin-top: 3px; }
.kopf .rechts { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* ------------------------------------------------------------- Bausteine */
.karte {
  background: var(--karte); border: 1px solid var(--rand);
  border-radius: var(--radius); box-shadow: var(--schatten);
}
.karte-kopf {
  padding: 15px 18px; border-bottom: 1px solid var(--rand);
  display: flex; align-items: center; gap: 10px;
}
.karte-kopf h2 { margin: 0; font-size: 14.5px; font-weight: 620; }
.karte-kopf .rechts { margin-left: auto; }
.karte-leib { padding: 18px; }
.gitter { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
                             .g3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 820px)  { .g4, .g3, .g2 { grid-template-columns: 1fr; }
                             .seitenleiste { display: none; } .inhalt { padding: 18px; } }

/* Kennzahlen */
.kennzahl { padding: 17px 18px; }
.kennzahl .titel {
  color: var(--text-leise); font-size: 12px; font-weight: 550;
  text-transform: uppercase; letter-spacing: .4px;
}
.kennzahl .wert { font-size: 27px; font-weight: 680; margin-top: 7px; letter-spacing: -.7px; }
.kennzahl .fuss { color: var(--text-leise); font-size: 12.5px; margin-top: 3px; }
.kennzahl.gut .wert { color: var(--gruen); }
.kennzahl.warn .wert { color: var(--gelb); }
.kennzahl.schlecht .wert { color: var(--rot); }

/* Knoepfe */
.knopf {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--rand); background: #fff;
  color: var(--text); font-size: 13.5px; font-weight: 550; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: all .12s;
}
.knopf:hover { background: #f8f9fb; text-decoration: none; border-color: #cfd4dd; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: #1d4ed8; border-color: #1d4ed8; }
.knopf.gefahr { color: var(--rot); border-color: #f3c9c9; }
.knopf.gefahr:hover { background: #fef2f2; }
.knopf.klein { padding: 5px 10px; font-size: 12.5px; }

/* Formulare */
label { display: block; font-size: 12.5px; font-weight: 560; margin-bottom: 5px;
        color: #3d4351; }
input[type=text], input[type=date], input[type=number], input[type=email],
select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--rand); border-radius: 8px;
  font-family: inherit; font-size: 13.5px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.feld { margin-bottom: 13px; }
.feldreihe { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.hinweis { color: var(--text-leise); font-size: 12px; margin-top: 4px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-leise); font-weight: 600; padding: 10px 12px;
  border-bottom: 1px solid var(--rand); white-space: nowrap; background: #fafbfc;
}
td { padding: 11px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
tbody tr:hover { background: #fafbfe; }
tbody tr:last-child td { border-bottom: none; }
.tabelle-huelle { overflow-x: auto; }

/* Aktionsspalte bleibt am rechten Rand stehen, auch wenn die Tabelle quer
   scrollt. Die Fundstückliste ist rund 450 px breiter als das Fenster —
   ohne das läge der Ausblenden-Knopf außerhalb des Sichtfelds und wäre nur
   nach Querscrollen erreichbar. Der Hintergrund muss deckend sein, sonst
   scheint der durchlaufende Inhalt hindurch; die Hover-Farbe wird
   mitgezogen, damit die Zeile nicht zweifarbig wird. */
th.spalte-fest, td.spalte-fest {
  position: sticky; right: 0; background: var(--karte);
  box-shadow: -7px 0 9px -9px rgba(16,24,40,.35);
  white-space: nowrap;   /* sonst bricht „Seite ↗" in zwei Zeilen um */
}
th.spalte-fest { background: #fafbfc; }
tbody tr:hover td.spalte-fest { background: #fafbfe; }

/* Etiketten */
.etikett {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 20px; font-size: 12px; font-weight: 560; white-space: nowrap;
}
.etikett .punkt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etikett.grau  { background: #f1f3f6; color: #4b5563; }
.etikett.blau  { background: #eff4ff; color: #1d4ed8; }
.etikett.gruen { background: #ecfdf3; color: #067647; }
.etikett.gelb  { background: #fffaeb; color: #b54708; }
.etikett.rot   { background: #fef3f2; color: #b42318; }
.etikett.lila  { background: #f5f3ff; color: #6927da; }

.score {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; padding: 3px 8px; border-radius: 7px; font-weight: 650;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.score.hoch { background: #fef3f2; color: #b42318; }
.score.mittel { background: #fffaeb; color: #b54708; }
.score.tief { background: #f1f3f6; color: #4b5563; }

.sterne { color: #d1d5db; letter-spacing: 1px; white-space: nowrap; }
.sterne span { cursor: pointer; transition: color .12s, transform .12s; display: inline-block; }
.sterne span:hover { color: #fbbf24; transform: scale(1.18); }
.sterne .an { color: #f59e0b; }
.sterne.gross { font-size: 25px; letter-spacing: 3px; line-height: 1.3; }
.sterne .sterne-loeschen {
  font-size: .58em; color: var(--text-leise); margin-left: 7px; vertical-align: middle;
}
.sterne .sterne-loeschen:hover { color: var(--rot); transform: none; }

/* Knoepfe an einem Verlaufseintrag erst beim Darueberfahren zeigen */
.eintrag-knoepfe { opacity: 0; transition: opacity .12s; }
.achse-punkt:hover .eintrag-knoepfe { opacity: 1; }

/* Diagramme */
.balken-zeile { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.balken-zeile .name { width: 128px; flex-shrink: 0; font-size: 12.5px; color: #3d4351; }
.balken-spur { flex: 1; height: 9px; background: #f0f2f5; border-radius: 6px; overflow: hidden; }
.balken-fuell { height: 100%; border-radius: 6px; transition: width .5s ease; }
.balken-zeile .wert {
  width: 42px; text-align: right; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Wiedervorlage-Zeilen */
.wv { display: flex; align-items: center; gap: 12px; padding: 10px 0;
      border-bottom: 1px solid #f0f2f5; }
.wv:last-child { border-bottom: none; }
.wv .datum { font-size: 12px; font-weight: 600; width: 74px; flex-shrink: 0; }
.wv .firma { font-weight: 550; }
.wv .notiz { color: var(--text-leise); font-size: 12.5px; }
.wv .rechts { margin-left: auto; display: flex; gap: 6px; }

/* Zeitachse */
.achse { position: relative; padding-left: 24px; }
.achse::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--rand);
}
.achse-punkt { position: relative; padding-bottom: 18px; }
.achse-punkt::before {
  content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--akzent);
}
.achse-punkt .zeit { font-size: 12px; color: var(--text-leise); }
.achse-punkt .was { font-weight: 560; margin-top: 1px; }
.achse-punkt .text { color: #4b5563; font-size: 13px; margin-top: 3px;
                     white-space: pre-wrap; }

/* Reiter */
.reiter { display: flex; gap: 3px; border-bottom: 1px solid var(--rand); margin-bottom: 18px; }
.reiter a {
  padding: 9px 15px; color: var(--text-leise); font-weight: 550; font-size: 13.5px;
  border-bottom: 2px solid transparent; text-decoration: none; margin-bottom: -1px;
}
.reiter a:hover { color: var(--text); text-decoration: none; }
.reiter a.an { color: var(--akzent); border-bottom-color: var(--akzent); }

.leer { text-align: center; padding: 36px 20px; color: var(--text-leise); }
.leer .gross { font-size: 30px; margin-bottom: 8px; opacity: .45; }

.werkzeugleiste {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px;
}
.werkzeugleiste input[type=text], .werkzeugleiste select { width: auto; min-width: 150px; }

.meldung {
  padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; font-weight: 520;
  background: #ecfdf3; color: #067647; border: 1px solid #abefc6;
}

.mini { font-size: 12.5px; color: var(--text-leise); }
.zahlen { font-variant-numeric: tabular-nums; }
.trenner-h { height: 1px; background: var(--rand); margin: 16px 0; }
.stapel { display: flex; flex-direction: column; gap: 14px; }
.reihe { display: flex; gap: 10px; align-items: center; }
