/* RM Projekt-App - mobile-first, thumb-friendly */

:root {
  --gruen: #14532d;
  --gruen-hell: #16a34a;
  --gelb: #fef3c7;
  --gelb-text: #92400e;
  --rot: #b91c1c;
  --blau: #eff6ff;
  --blau-text: #1d4ed8;
  --grau-hg: #f4f4f5;
  --grau-rand: #d4d4d8;
  --text: #18181b;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--grau-hg);
  -webkit-tap-highlight-color: transparent;
}

/* Header */
.topbar {
  background: var(--gruen);
  color: #fff;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.marke { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.hauptnav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.hauptnav a, .nav-knopf {
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: none;
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.hauptnav a:active, .nav-knopf:active { background: rgba(255, 255, 255, 0.15); }

.inhalt { padding: 1rem; max-width: 900px; margin: 0 auto; }

h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }

.seitenkopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.seitenkopf h1 { margin: 0; }

/* Cards */
.karte {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.schmal { max-width: 420px; margin: 2rem auto; }

/* Forms - big touch targets */
label { display: block; font-weight: 600; margin: 0.75rem 0 0.3rem; font-size: 0.95rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.75rem;
  border: 1px solid var(--grau-rand);
  border-radius: 8px;
  background: #fff;
  min-height: 48px;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(22, 163, 74, 0.4); outline-offset: 1px; }

.feld-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.feld-mit-knopf { display: flex; gap: 0.5rem; }
.feld-mit-knopf input { flex: 1; }

/* Buttons */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.1rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--grau-rand);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  margin-top: 0.5rem;
}
.knopf:active { transform: scale(0.98); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }
.knopf.primaer { background: var(--gruen-hell); border-color: var(--gruen-hell); color: #fff; }
.knopf.gefahr { background: #fff; border-color: var(--rot); color: var(--rot); }
.knopf.breit { width: 100%; }
.knopf.klein { min-height: 40px; padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.inline-form { display: inline; }

/* Messages */
.meldung { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.95rem; }
.fehler-meldung { background: #fee2e2; color: var(--rot); }
.ok-meldung { background: #dcfce7; color: var(--gruen); }
.leer-hinweis { color: #71717a; text-align: center; padding: 1rem 0; }
.hinweis-klein { color: #71717a; font-size: 0.9rem; margin: 0.5rem 0 0; }

/* Chips */
.chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip-gruen { background: #dcfce7; color: var(--gruen); }
.chip-gelb { background: var(--gelb); color: var(--gelb-text); }
.chip-blau { background: var(--blau); color: var(--blau-text); }
.chip-grau { background: var(--grau-hg); color: #52525b; }
.chip-rot { background: #fee2e2; color: var(--rot); }

/* Project list */
.projekt-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.projekt-karte {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.projekt-karte:active { background: #fafafa; }
.projekt-kopf { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.projekt-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 0.4rem; color: #52525b; font-size: 0.9rem; align-items: center; }

/* Detail data list */
.daten-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0 0 0.5rem; }
.daten-liste dt { font-size: 0.8rem; color: #71717a; }
.daten-liste dd { margin: 0; font-weight: 600; }
.aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.ziel-profil-form { margin-top: 0.75rem; border-top: 1px solid var(--grau-hg); padding-top: 0.25rem; }

/* Tabs */
.tab-leiste { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
  flex: 1;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--grau-rand);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
}
.tab-aktiv { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.versteckt { display: none; }

/* Upload */
.upload-form { margin-bottom: 1rem; }
.upload-feld {
  display: block;
  border: 2px dashed var(--grau-rand);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  margin: 0;
}
.upload-feld input[type="file"] { width: 100%; font-size: 0.95rem; }
.upload-text { display: block; margin-top: 0.4rem; color: #71717a; font-size: 0.9rem; }

/* Jaspers category picker - big tappable radio chips */
.kategorie-raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.kategorie-wahl { position: relative; display: block; margin: 0; font-weight: 400; }
.kategorie-wahl input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.kategorie-wahl span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--grau-rand);
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
}
.kategorie-wahl input:checked + span { background: var(--gruen); border-color: var(--gruen); color: #fff; font-weight: 600; }
.kategorie-wahl input:focus-visible + span { outline: 3px solid rgba(22, 163, 74, 0.4); outline-offset: 1px; }

/* Gallery */
.galerie {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.galerie li { position: relative; }
.galerie img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: var(--grau-hg);
}

/* Consent gate */
.klausel-text p { line-height: 1.55; }
.checkbox-zeile {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
  margin: 1rem 0 0.5rem;
  cursor: pointer;
}
.checkbox-zeile input[type="checkbox"] { width: 1.5rem; height: 1.5rem; flex-shrink: 0; accent-color: var(--gruen-hell); }

/* Admin tables */
.tabelle-umbruch { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabelle th, .tabelle td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--grau-hg); vertical-align: top; }
.tabelle th { font-size: 0.8rem; color: #71717a; white-space: nowrap; }
.ua-zelle { max-width: 280px; overflow-wrap: anywhere; }

/* Team / users */
.benutzer-liste, .einladungs-liste { list-style: none; margin: 0; padding: 0; }
.benutzer-liste li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--grau-hg);
  flex-wrap: wrap;
}
.benutzer-liste li:last-child { border-bottom: none; }
.einladungs-liste li { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0; }
.link-feld { flex: 1; min-width: 180px; font-size: 0.85rem; color: #52525b; }

@media (min-width: 640px) {
  h1 { font-size: 1.7rem; }
  .inhalt { padding: 1.5rem; }
}
