:root {
  --coral: #f8485e;
  --coral-dunkel: #e02e45;
  --tinte: #1a1320;
  --grau: #8a8595;
  --bg: #fbf7f5;
  --karte: #ffffff;
  --rand: #efe7e3;
  --gelb: #ffd84d;
  --gelb-text: #6b4e00;
  --verlauf: linear-gradient(90deg, #f8485e 0%, #f86a86 35%, #b07bd6 70%, #6aa3e0 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  background: var(--bg);
  color: var(--tinte);
  -webkit-font-smoothing: antialiased;
}

/* --- Kopf ----------------------------------------------------------------- */

.kopf {
  background: var(--coral);
  position: relative;
}

.kopf::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 6px;
  background: var(--verlauf);
}

.kopf-inhalt {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.marke {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.marke .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.marke .logo-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--coral);
}

.handle {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}

.kopf-rechts {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.abmelden {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  white-space: nowrap;
}
.abmelden:hover {
  background: rgba(255, 255, 255, 0.18);
}

.periode-badge {
  background: #fff;
  color: var(--coral);
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}
.periode-badge:hover {
  background: #fff4f5;
}

/* --- Leiste --------------------------------------------------------------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.leiste {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.leiste h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.zusammenfassung {
  margin: 0.2rem 0 0;
  color: var(--grau);
  font-size: 0.95rem;
}

.leiste-aktionen {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

a.sekundaer {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* --- Buttons -------------------------------------------------------------- */

button {
  font-family: inherit;
  cursor: pointer;
}

.primaer {
  background: var(--coral);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(248, 72, 94, 0.3);
  transition: transform 0.08s ease, background 0.15s ease;
}
.primaer:hover {
  background: var(--coral-dunkel);
}
.primaer:active {
  transform: translateY(1px);
}

.sekundaer {
  background: #f1ecea;
  color: var(--tinte);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
}
.sekundaer:hover {
  background: #e6dfdc;
}

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

.raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

.gruppe {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 16px;
  padding: 1.3rem 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.gruppe:hover {
  box-shadow: 0 12px 30px rgba(26, 19, 32, 0.1);
  transform: translateY(-2px);
  border-color: #e7d9d3;
}
.gruppe.ist-geaendert {
  border-color: var(--gelb);
  box-shadow: 0 0 0 1px var(--gelb) inset;
}

.gruppe-kopf {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.gruppe-titel {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--coral);
  line-height: 1.05;
  letter-spacing: -0.3px;
  flex: 1;
  text-transform: uppercase;
}

.badge-version {
  flex-shrink: 0;
  background: #f4eef1;
  color: var(--grau);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.3rem;
}

.badge-aenderung {
  display: inline-block;
  background: var(--gelb);
  color: var(--gelb-text);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 0.22rem 0.55rem;
  border-radius: 5px;
  margin-bottom: 0.7rem;
  width: fit-content;
}

.zeile {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}
.zeile .etikett {
  color: var(--grau);
}
.zeile .wert {
  font-weight: 600;
}

.mitglieder {
  margin: 0.2rem 0 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chip {
  background: #f6f1ef;
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
}
.keine-mitglieder {
  color: var(--grau);
  font-size: 0.88rem;
  font-style: italic;
}

.fuss {
  margin-top: auto;
  padding-top: 0.9rem;
}

.gruppe-aktionen {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rand);
  padding-top: 0.8rem;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--rand);
  color: var(--tinte);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}
.icon-btn:hover {
  background: #faf5f3;
  border-color: #e0d4ce;
}
.icon-btn.gefahr {
  color: var(--coral-dunkel);
}
.icon-btn.gefahr:hover {
  background: #fff1f3;
  border-color: #f6c3cb;
}

details.historie {
  margin-top: 0.7rem;
}
details.historie summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--grau);
  font-weight: 600;
  list-style: none;
}
details.historie summary::-webkit-details-marker {
  display: none;
}
details.historie summary::before {
  content: "▸ ";
}
details.historie[open] summary::before {
  content: "▾ ";
}
.historie-eintrag {
  font-size: 0.8rem;
  color: var(--grau);
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--rand);
}

.hinweis {
  color: var(--grau);
  font-style: italic;
  text-align: center;
  padding: 3rem 0;
}

/* --- Dialog --------------------------------------------------------------- */

.dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  width: min(460px, 92vw);
  box-shadow: 0 24px 60px rgba(26, 19, 32, 0.28);
}
.dialog::backdrop {
  background: rgba(26, 19, 32, 0.45);
  backdrop-filter: blur(2px);
}
.dialog form {
  padding: 1.5rem 1.6rem 1.6rem;
}
.dialog-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.dialog-kopf h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}
.schliessen {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--grau);
  padding: 0 0.2rem;
}
.schliessen:hover {
  color: var(--tinte);
}

.dialog label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.label-hinweis {
  color: var(--grau);
  font-weight: 400;
}
.dialog input[type="text"],
.dialog textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--rand);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
  background: #fcfafa;
}
.dialog input:focus,
.dialog textarea:focus {
  outline: none;
  border-color: var(--coral);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(248, 72, 94, 0.13);
}
.dialog textarea {
  resize: vertical;
}

.version-hinweis {
  background: #fff8e1;
  border: 1px solid #ffe9a3;
  color: var(--gelb-text);
  font-size: 0.83rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  margin: 0 0 1.1rem;
}

.dialog-aktionen {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* --- Versionsverwaltung --------------------------------------------------- */

.dialog-kopf-pad {
  padding: 1.5rem 1.6rem 0;
}

.versionen-liste {
  padding: 1rem 1.6rem 1.6rem;
  display: grid;
  gap: 0.7rem;
}

.version-zeile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.version-zeile.aktuell {
  border-color: var(--coral);
  background: #fff5f6;
}

.version-info {
  flex: 1;
  min-width: 0;
}

.version-titel {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version-titel .pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
}

.version-meta {
  color: var(--grau);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.version-leer {
  color: var(--grau);
  font-style: italic;
  font-size: 0.88rem;
}

@media (max-width: 520px) {
  .leiste h1 {
    font-size: 1.7rem;
  }
  .gruppe-titel {
    font-size: 1.3rem;
  }
}
