*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

/* Nav */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #1a1d2e;
  border-bottom: 1px solid #2d3748;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #7c83ff;
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav-links a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-links a:hover { color: #e2e8f0; }
.nutzer-badge {
  background: #7c83ff22;
  color: #7c83ff;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Main */
main { padding: 2rem 1.5rem; max-width: 1100px; margin: 0 auto; }

/* Center-Box (Login, Nutzer-Wahl) */
.center-box {
  max-width: 400px;
  margin: 5rem auto;
  background: #1a1d2e;
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid #2d3748;
  text-align: center;
}
.center-box h1, .center-box h2 { margin-bottom: 0.5rem; }
.subtitle { color: #718096; margin-bottom: 1.5rem; }
.fehler { color: #fc8181; margin-bottom: 1rem; font-size: 0.9rem; }
.info { color: #68d391; margin-bottom: 1rem; }

/* Forms */
input[type="text"], input[type="password"], select {
  background: #0f1117;
  border: 1px solid #2d3748;
  color: #e2e8f0;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
  margin-bottom: 0.75rem;
}
input:focus, select:focus { outline: 2px solid #7c83ff; border-color: transparent; }

button {
  background: #7c83ff;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}
button:hover { background: #6670e8; }

/* Nutzer-Buttons */
.nutzer-buttons { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.nutzer-btn { width: 100%; padding: 1rem; font-size: 1.1rem; background: #1e2235; border: 2px solid #2d3748; }
.nutzer-btn.aktiv { border-color: #7c83ff; background: #7c83ff22; }
.nutzer-btn:hover { border-color: #7c83ff; }

/* Board */
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.neuer-vorgang-form { display: flex; gap: 0.5rem; flex: 1; max-width: 500px; }
.neuer-vorgang-form input { margin-bottom: 0; }

.vorgaenge-liste { display: flex; flex-direction: column; gap: 1rem; }

.vorgang-karte {
  background: #1a1d2e;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border-left: 4px solid #2d3748;
}
.vorgang-karte.status-neu { border-left-color: #90cdf4; }
.vorgang-karte.status-in-arbeit { border-left-color: #f6e05e; }
.vorgang-karte.status-wartet-auf-freigabe { border-left-color: #f6ad55; }
.vorgang-karte.status-fertig { border-left-color: #68d391; }
.vorgang-karte.status-archiviert { border-left-color: #4a5568; opacity: 0.6; }

.vorgang-kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.vorgang-titel { font-weight: 600; font-size: 1rem; }
.status-badge {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #2d3748;
  white-space: nowrap;
}
.vorgang-meta { font-size: 0.85rem; color: #718096; margin-bottom: 0.75rem; }
.zugewiesen { color: #68d391; }
.frei { color: #4a5568; }

.vorgang-aktionen {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form { display: flex; gap: 0.4rem; align-items: center; }
.inline-form select { width: auto; margin-bottom: 0; font-size: 0.85rem; padding: 0.4rem 0.6rem; }
.inline-form button { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.btn-uebernehmen { background: #2d6a4f; }
.btn-uebernehmen:hover { background: #1b4332; }
.btn-freigeben { background: #744210; }
.btn-freigeben:hover { background: #5c330d; }

/* Logbuch */
.logbuch-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.logbuch-tabelle { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.logbuch-tabelle th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: #1a1d2e;
  border-bottom: 2px solid #2d3748;
  color: #a0aec0;
}
.logbuch-tabelle td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #1e2235;
}
.logbuch-tabelle tr:hover td { background: #1a1d2e; }
.zeit { color: #718096; font-size: 0.82rem; white-space: nowrap; }
.nutzer { font-weight: 600; color: #7c83ff; }

/* Links */
.link-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #1e2235;
  color: #a0aec0;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
}
.link-btn:hover { background: #2d3748; color: #e2e8f0; }
.link-small { color: #718096; text-decoration: none; font-size: 0.82rem; }
.link-small:hover { color: #a0aec0; }

.leer-hinweis { color: #4a5568; text-align: center; padding: 3rem; font-size: 1.1rem; }

/* Suchbegriffe */
.sb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.sb-header-actions { display: flex; gap: 0.5rem; }

.inline-card {
  background: #1a1d2e;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.inline-card h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.sb-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.sb-form input[type="text"] { flex: 1; min-width: 200px; margin-bottom: 0; }
.sb-form select { margin-bottom: 0; width: auto; }

.cluster-block {
  background: #1a1d2e;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.cluster-kopf {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.cluster-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #a78bfa;
}
.cluster-name.ohne { color: #718096; font-style: italic; }

.begriffe-liste { display: flex; flex-direction: column; gap: 0.35rem; }
.begriff-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}
.begriff-zeile:hover { background: #0f1117; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  flex: 1;
}
.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #7c83ff;
  cursor: pointer;
  flex-shrink: 0;
}
.begriff-text { font-size: 0.9rem; }
.begriff-aktionen { display: flex; gap: 0.4rem; flex-shrink: 0; }

.btn-tiny {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  background: #2d3748;
  color: #a0aec0;
  border: none;
  cursor: pointer;
}
.btn-tiny:hover { background: #3d4a5c; color: #e2e8f0; }
.btn-delete { background: #4a1c1c !important; color: #fc8181 !important; }
.btn-delete:hover { background: #6b2323 !important; }
.btn-secondary { background: #1e2235; color: #a0aec0; border: 1px solid #2d3748; }
.btn-secondary:hover { background: #2d3748; color: #e2e8f0; }

.inline-del { display: inline; }

.leer-cluster { color: #4a5568; font-size: 0.85rem; font-style: italic; padding: 0.25rem 0.5rem; }

.recherche-leiste {
  margin-top: 1.5rem;
  background: #1a1d2e;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.freitext-gruppe { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 260px; }
.freitext-gruppe label { font-size: 0.85rem; color: #a0aec0; }
.freitext-gruppe input { margin-bottom: 0; }
.btn-recherche {
  background: #a78bfa;
  color: #1a1d2e;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  white-space: nowrap;
}
.btn-recherche:hover { background: #8b6fe8; }

.recherche-ergebnis {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid #4a5568;
  background: #1a1d2e;
}
.ergebnis-ok { border-color: #68d391; }
.ergebnis-leer { border-color: #fc8181; }
.ergebnis-liste {
  list-style: none;
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ergebnis-liste li {
  background: #2d3748;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #e2e8f0;
}

/* Bearbeiten-Modal */
.edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.edit-modal.hidden { display: none; }
.edit-modal-inner {
  background: #1a1d2e;
  border: 1px solid #2d3748;
  border-radius: 12px;
  padding: 2rem;
  min-width: 340px;
  max-width: 500px;
  width: 90%;
}
.edit-modal-inner h3 { margin-bottom: 1rem; }
.modal-buttons { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.hidden { display: none !important; }

/* Vorgang-Detail / Quellen */
.vorgang-titel-link { color: #e2e8f0; text-decoration: none; }
.vorgang-titel-link:hover { color: #7c83ff; text-decoration: underline; }
.abschnitt-titel { margin: 1.75rem 0 0.75rem; font-size: 1.05rem; color: #a0aec0; }

.status-recherche-läuft { border-left-color: #f6ad55; }
.status-quellen-da { border-left-color: #4fd1c5; }

.quellen-liste { display: flex; flex-direction: column; gap: 0.75rem; }
.quelle-karte {
  background: #1a1d2e;
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.quelle-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.quelle-titel { color: #90cdf4; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.quelle-titel:hover { text-decoration: underline; }
.quelle-url { color: #4a5568; font-size: 0.78rem; margin-top: 0.2rem; word-break: break-all; }
.scrape-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #2d3748;
  white-space: nowrap;
  flex-shrink: 0;
}
.scrape-neu { background: #22543d; color: #9ae6b4; }
.scrape-geaendert { background: #744210; color: #fbd38d; }
.scrape-unveraendert { background: #2d3748; color: #a0aec0; }
.quelle-text { margin-top: 0.6rem; }
.quelle-text summary { cursor: pointer; font-size: 0.82rem; color: #718096; }
.quelle-text pre {
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  color: #cbd5e0;
  background: #0f1117;
  padding: 0.75rem;
  border-radius: 6px;
  max-height: 400px;
  overflow-y: auto;
}
