:root {
  --grund: #f6f7f9;
  --flaeche: #ffffff;
  --rand: #dfe3e8;
  --text: #1c2430;
  --gedaempft: #6b7686;
  --akzent: #1f5fa8;
  --akzent-hell: #eaf1fa;
  --notfall: #b3261e;
  --hoch: #b4690e;
  --normal: #4a5568;
  --niedrig: #7d8794;
  --gruen: #1e7a45;
  --radius: 7px;
}

* { box-sizing: border-box; }

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

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

/* -- Kopfzeile ---------------------------------------------------------- */
header.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 26px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.marke { font-weight: 650; letter-spacing: -0.2px; white-space: nowrap; }
.marke span { color: var(--gedaempft); font-weight: 400; }
nav.haupt { display: flex; gap: 4px; flex: 1; }
nav.haupt a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text);
}
nav.haupt a:hover { background: var(--grund); text-decoration: none; }
nav.haupt a.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 550; }
.benutzer { color: var(--gedaempft); font-size: 14px; white-space: nowrap; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }

h1 { font-size: 21px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }

/* -- Karten ------------------------------------------------------------- */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.karte.schmal { padding: 14px 16px; }

/* -- Reiter ------------------------------------------------------------- */
.reiter { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.reiter a {
  padding: 7px 14px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  font-size: 14px;
}
.reiter a:hover { border-color: var(--akzent); text-decoration: none; }
.reiter a.aktiv { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.reiter .zahl { opacity: 0.7; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* -- Tabelle ------------------------------------------------------------ */
table.liste { width: 100%; border-collapse: collapse; }
table.liste th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gedaempft);
  font-weight: 600;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--rand);
}
table.liste td { padding: 11px 10px; border-bottom: 1px solid var(--rand); vertical-align: top; }
table.liste tr:last-child td { border-bottom: none; }
table.liste tr:hover td { background: #fafbfc; }
.nummer { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; color: var(--gedaempft); white-space: nowrap; }
.betreff { font-weight: 500; }
.klein { font-size: 13px; color: var(--gedaempft); }

/* -- Kennzeichen -------------------------------------------------------- */
.kennz {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.p-NOTFALL { background: #fdeceb; color: var(--notfall); }
.p-HOCH    { background: #fdf3e3; color: var(--hoch); }
.p-NORMAL  { background: #eef0f3; color: var(--normal); }
.p-NIEDRIG { background: #f2f4f6; color: var(--niedrig); }
.status { background: #eef0f3; color: var(--normal); }
.status.offen { background: var(--akzent-hell); color: var(--akzent); }
.status.fertig { background: #e7f4ec; color: var(--gruen); }

/* -- Formulare ---------------------------------------------------------- */
label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=search],
select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--akzent-hell);
  border-color: var(--akzent);
}
textarea { resize: vertical; min-height: 90px; }
.feld { margin-bottom: 14px; }
.zeile { display: flex; gap: 14px; flex-wrap: wrap; }
.zeile > .feld { flex: 1; min-width: 180px; }

button, .knopf {
  padding: 8px 16px;
  border: 1px solid var(--akzent);
  border-radius: var(--radius);
  background: var(--akzent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}
button:hover, .knopf:hover { filter: brightness(1.08); text-decoration: none; }
button.leise, .knopf.leise { background: var(--flaeche); color: var(--text); border-color: var(--rand); }
button.leise:hover { border-color: var(--akzent); filter: none; }

/* -- Vorgangsansicht ---------------------------------------------------- */
.spalten { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .spalten { grid-template-columns: 1fr; } }

dl.daten { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 14px; }
dl.daten dt { color: var(--gedaempft); }
dl.daten dd { margin: 0; }

.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { padding: 12px 0 12px 18px; border-left: 2px solid var(--rand); position: relative; }
.verlauf li::before {
  content: ""; position: absolute; left: -5px; top: 17px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--rand);
}
.verlauf li.ki::before { background: var(--akzent); }
.verlauf .wann { font-size: 12px; color: var(--gedaempft); }
.nachricht {
  background: var(--grund);
  border-radius: var(--radius);
  padding: 11px 13px;
  margin-top: 7px;
  white-space: pre-wrap;
  font-size: 14px;
}
.nachricht.notiz { background: #fffbea; }
.nachricht.ausgehend { background: var(--akzent-hell); }

/* -- Suche mit Vorschlaegen --------------------------------------------- */
.suchfeld { position: relative; }
.vorschlaege {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(20,30,45,0.13);
  max-height: 320px; overflow-y: auto; z-index: 20;
}
.vorschlaege:empty { display: none; }
.vorschlag { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--rand); }
.vorschlag:last-child { border-bottom: none; }
.vorschlag:hover, .vorschlag.aktiv { background: var(--akzent-hell); }
.vorschlag .name { font-weight: 550; }
.gewaehlt {
  background: var(--akzent-hell);
  border: 1px solid var(--akzent);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}

.hinweis { color: var(--gedaempft); padding: 26px; text-align: center; }
.fehler {
  background: #fdeceb; border: 1px solid #f3c2be; color: var(--notfall);
  padding: 10px 13px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px;
}

/* -- Anmeldeseite ------------------------------------------------------- */
.anmelden-huelle { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.anmelden-karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 11px; padding: 30px; width: 100%; max-width: 380px; }
