:root {
  --bg: #f4f6f8;
  --karte: #ffffff;
  --rand: #e2e6ea;
  --text: #1f2933;
  --grau: #6b7683;
  --akzent: #2563eb;
  --gruen: #157347;
  --rot: #b02a37;
  --gelb: #b7791f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header .titel { font-weight: 600; }
header nav a { margin-left: 1.2rem; font-size: 0.95rem; }
main { max-width: 900px; margin: 1.5rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
}
.karte + .karte { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rand); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--grau); }
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 999px;
}
.badge.offen { background: #fdecea; color: var(--rot); }
.badge.ok { background: #e6f4ea; color: var(--gruen); }
.badge.neutral { background: #eef1f4; color: var(--grau); }
.badge.warn { background: #fdf3e0; color: var(--gelb); }
form.inline { display: inline; }
input, button, select {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rand);
  border-radius: 7px;
  background: #fff;
}
button, .btn {
  background: var(--akzent); color: #fff; border: none; cursor: pointer;
  font-weight: 500; padding: 0.5rem 1rem; border-radius: 7px;
}
button.sekundaer { background: #eef1f4; color: var(--text); }
button:hover { opacity: 0.92; }
.feld { margin-bottom: 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.feld label { font-size: 0.85rem; color: var(--grau); }
.hinweis { color: var(--grau); font-size: 0.9rem; }
.zentriert { max-width: 400px; margin: 4rem auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.leer { color: var(--grau); font-style: italic; padding: 1rem 0; }
.chat { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.chat-zeile { display: flex; }
.chat-zeile.eigen { justify-content: flex-end; }
.chat-blase {
  max-width: 75%; padding: 0.5rem 0.8rem; border-radius: 12px;
  background: #eef1f4;
}
.chat-zeile.eigen .chat-blase { background: #dbe8ff; }
.chat-meta { font-size: 0.72rem; color: var(--grau); margin-bottom: 0.15rem; }
.chat-text { white-space: pre-wrap; }
.chat-form { display: flex; gap: 0.5rem; align-items: flex-end; }
.chat-form textarea {
  flex: 1; font: inherit; padding: 0.5rem 0.7rem; border: 1px solid var(--rand);
  border-radius: 7px; resize: vertical; min-height: 2.6rem;
}

/* Vorschaubilder in der Belegliste. Nicht-Bilder bekommen stattdessen eine
   Typ-Kachel, damit die Zeilen gleich hoch bleiben. */
.vorschau {
  width: 56px; height: 56px; object-fit: cover; display: block;
  border-radius: 7px; border: 1px solid var(--rand); background: #f6f8fa;
}
.dateityp {
  width: 56px; height: 56px; display: flex; align-items: center;
  justify-content: center; border-radius: 7px; border: 1px solid var(--rand);
  background: #f6f8fa; color: var(--grau); font-size: 0.7rem;
  font-weight: 600; letter-spacing: 0.03em;
}

/* Bearbeiten/Löschen an Team-Nachrichten — dezent, damit sie den Text nicht
   überlagern, aber im Chat erreichbar. */
.chat-aktionen { margin-top: 0.3rem; display: flex; gap: 0.7rem; }
.chat-aktionen a {
  font-size: 0.72rem; color: var(--grau); text-decoration: none;
  border-bottom: 1px dotted var(--grau); cursor: pointer;
}
.chat-aktionen a:hover { color: var(--text); }

/* Titel ändern — eingeklappt, damit die Seite ruhig bleibt. */
.titel-bearbeiten { margin: -0.5rem 0 1.2rem; }
.titel-bearbeiten summary {
  cursor: pointer; font-size: 0.8rem; color: var(--grau);
  list-style: none; display: inline-block;
  border-bottom: 1px dotted var(--grau);
}
.titel-bearbeiten summary::-webkit-details-marker { display: none; }
.titel-bearbeiten form { margin-top: 0.6rem; max-width: 480px; }
