/* KeybitsHub – Oberfläche nach den Mockups in assets/ (Teams-Look). */

:root {
  --akzent: #5b5fc7;
  --akzent-hell: #e8e9f8;
  --text: #242424;
  --text-leise: #616161;
  --rand: #e1e1e1;
  --flaeche: #f5f5f5;
  --karte: #fff;
  --ok: #0f7b3d;
  --ok-flaeche: #e7f6ec;
  --warnung: #9a5b00;
  --warnung-flaeche: #fdf3e3;
  --kritisch: #b10e1c;
  --kritisch-flaeche: #fde9ea;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--flaeche);
}

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

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0; }

code { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

/* ---- Kopfzeile und Navigation ---- */

.kopf {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
}

.suche { flex: 1; display: flex; }
.suche input {
  width: 100%; max-width: 420px;
  padding: 9px 14px;
  border: 1px solid var(--rand);
  border-radius: 6px;
  background: var(--flaeche);
  font: inherit;
}
.suche input:focus { outline: 2px solid var(--akzent); outline-offset: -1px; background: #fff; }

.kopf__rechts { margin-left: auto; }

.avatar {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--akzent-hell);
  color: var(--akzent);
  font-size: 12px; font-weight: 600;
}
.avatar--klein { width: 28px; height: 28px; font-size: 11px; }

.konto summary { list-style: none; cursor: pointer; }
.konto summary::-webkit-details-marker { display: none; }
.konto { position: relative; }
.konto__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  min-width: 240px; padding: 14px;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  display: grid; gap: 6px;
}
.konto__name { font-weight: 600; }
.konto__mail { color: var(--text-leise); font-size: 12px; margin-bottom: 4px; }
.konto__rollen { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

.hauptnav {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 0 24px;
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
}
.hauptnav a {
  padding: 12px 10px;
  color: var(--text);
  border-bottom: 2px solid transparent;
}
.hauptnav a:hover { text-decoration: none; color: var(--akzent); }
.hauptnav a.aktiv { color: var(--akzent); font-weight: 600; border-bottom-color: var(--akzent); }

/* ---- Inhalt ---- */

.inhalt { max-width: 1280px; margin: 0 auto; padding: 24px; }

.datum { color: var(--text-leise); margin: 0 0 2px; }
.gruss { font-size: 28px; font-weight: 400; margin: 0 0 20px; }

.seitenkopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.unterzeile { color: var(--text-leise); margin: 2px 0 0; }
.leer { color: var(--text-leise); }
.platzhalter { color: var(--text-leise); font-style: italic; }

.knopf {
  display: inline-block;
  background: var(--akzent); color: #fff;
  border: 0; border-radius: 4px;
  padding: 9px 16px;
  font: inherit; cursor: pointer;
}
.knopf:hover { background: #4a4eb5; text-decoration: none; color: #fff; }

/* ---- Karten und Raster ---- */

.karte {
  background: var(--karte);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  margin-bottom: 20px;
}
.karte__kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.karte--schmal { max-width: 440px; margin: 0 auto; }
.karte--news { background: #eef0fc; box-shadow: none; }
.karte--warnung { background: var(--warnung-flaeche); box-shadow: none; }
.karte--kachel { display: block; color: inherit; margin: 0; }
.karte--kachel:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.16); }

.spalten { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 20px; }

.zentriert { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.zentriert .karte { width: 100%; }

/* ---- Schnellstart ---- */

.schnellstart { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 20px; }
.schnellstart__kachel {
  display: flex; align-items: center; gap: 12px;
  background: var(--karte); color: inherit;
  border-radius: var(--radius); padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.schnellstart__kachel:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.16); }
.schnellstart__kachel strong { display: block; }
.schnellstart__kachel small { color: var(--text-leise); }
.schnellstart__symbol {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 6px;
  background: var(--akzent-hell); color: var(--akzent);
}

/* ---- Tabellen und Listen ---- */

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  text-align: left; font-weight: 400; font-size: 12px;
  color: var(--text-leise);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--rand);
}
.tabelle td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rand); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle small, .liste small { display: block; color: var(--text-leise); font-size: 12px; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rand);
}
.liste li:last-child { border-bottom: 0; }
.liste--schlicht li { display: block; }
.liste .wert { color: var(--text-leise); text-align: right; white-space: nowrap; }

.person { display: flex; align-items: center; gap: 10px; }

.tag {
  display: inline-grid; place-items: center;
  width: 28px; height: 22px; margin-right: 8px;
  border-radius: 4px;
  background: var(--akzent-hell); color: var(--akzent);
  font-size: 11px; font-weight: 600;
}

/* ---- Abzeichen ---- */

.badge {
  display: inline-block;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.badge--neutral  { background: var(--flaeche); color: var(--text-leise); border: 1px solid var(--rand); }
.badge--ok       { background: var(--ok-flaeche); color: var(--ok); }
.badge--warnung  { background: var(--warnung-flaeche); color: var(--warnung); }
.badge--wartend  { background: var(--akzent-hell); color: var(--akzent); }
.badge--kritisch { background: var(--kritisch-flaeche); color: var(--kritisch); }
.badge--rolle    { background: var(--akzent); color: #fff; }

/* Mehrere Abzeichen nebeneinander (Mehrfachauswahl im CRM) */
span.abzeichen { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.etikett { display: inline-block; font-size: 12px; color: var(--akzent); font-weight: 600; margin-bottom: 6px; }
.etikett--warnung { color: var(--warnung); }

/* ---- Kundenakte ---- */

.brotkrumen { color: var(--text-leise); margin-bottom: 10px; font-size: 13px; }
.akte__kopf { padding-bottom: 0; }
.akte__kopf .seitenkopf { margin-bottom: 12px; }

.untertabs { display: flex; gap: 4px; flex-wrap: wrap; border-top: 1px solid var(--rand); margin: 0 -24px; padding: 0 24px; }
.untertabs a { padding: 12px 10px; color: var(--text); border-bottom: 2px solid transparent; }
.untertabs a:hover { text-decoration: none; color: var(--akzent); }
.untertabs a.aktiv { color: var(--akzent); font-weight: 600; border-bottom-color: var(--akzent); }

.system { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 12px 0; }
.system__block { border: 1px solid var(--rand); border-radius: 6px; padding: 14px; display: grid; gap: 4px; }
.system__block--eigen { background: var(--akzent-hell); border-color: transparent; }
.system__block small { color: var(--text-leise); font-size: 12px; }
.system__block span { color: var(--text-leise); font-size: 12px; }

/* ---- Anmeldung / Fehler ---- */

.fehler { color: var(--kritisch); }
.fehlerliste { color: var(--kritisch); margin: 12px 0; padding-left: 20px; }

/* ---- Schmale Fenster (Teams-Seitenbereich, Mobil) ---- */

@media (max-width: 900px) {
  .spalten { grid-template-columns: 1fr; }
  .kopf { flex-wrap: wrap; }
  .suche { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .suche input { max-width: none; }
  .inhalt { padding: 16px; }
}

/* Hinweis auf externe Ziele in Linklisten */
.extern { color: var(--text-leise); font-size: 13px; }

/* ---- Linkkacheln ---- */

.linkkacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }

.linkkachel {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-radius: 6px;
  color: var(--text);
  background: var(--karte);
}
.linkkachel:hover {
  text-decoration: none;
  border-color: var(--akzent);
  background: var(--akzent-hell);
}
.linkkachel strong { display: block; font-size: 14px; }
.linkkachel small { display: block; color: var(--text-leise); font-size: 12px; margin-top: 2px; }

.linkkachel--offen {
  border-style: dashed;
  color: var(--text-leise);
  cursor: default;
}
.linkkachel--offen:hover { border-color: var(--rand); background: var(--karte); }

/* Suchformular auf der Kontakte-Seite */
.suchformular { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.suchformular input[type="search"] {
  flex: 1; min-width: 200px;
  padding: 9px 14px;
  border: 1px solid var(--rand);
  border-radius: 6px;
  font: inherit;
}
.suchformular input[type="search"]:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }

.suchformular__filter { display: flex; align-items: center; gap: 6px; }
.suchformular__filter span { color: var(--text-leise); font-size: 12px; }
.suchformular select {
  padding: 9px 10px;
  border: 1px solid var(--rand);
  border-radius: 6px;
  background: var(--karte);
  font: inherit;
}
.suchformular select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }

/* ---- Felderliste der CRM-Detailansicht ---- */

.felder { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 0; margin: 0; }
.felder dt {
  color: var(--text-leise); font-size: 12px;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rand);
}
.felder dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--rand);
  overflow-wrap: anywhere;
}
.felder dt:last-of-type, .felder dd:last-of-type { border-bottom: 0; }

@media (max-width: 600px) {
  .felder { grid-template-columns: 1fr; }
  .felder dt { border-bottom: 0; padding-bottom: 0; }
}
