/* Bausteine aus public/js/views/bausteine/. Knoepfe haben immer eine Flaeche. */

/* Knopf */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--abstand-2);
  min-height: var(--touch);
  padding: 0 var(--abstand-5);
  border: 0;
  border-radius: var(--radius-knopf);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  justify-self: start; /* in Grid-Layouts nicht auf volle Breite ziehen */
  cursor: pointer;
  transition: background-color .15s ease;
}

.knopf--haupt { background: var(--akzent); color: #fff; }
.knopf--haupt:hover { background: var(--akzent-dunkel); }
.knopf--neben { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.knopf--neben:hover { background: var(--akzent-hell-hover); }
.knopf--gefahr { background: var(--schlecht-hell); color: var(--text-schlecht); }
.knopf--gefahr:hover { background: var(--schlecht-hell-hover); }

.knopf:disabled {
  opacity: .55;
  cursor: default;
}

/* Icon-Knopf: runde getoente Flaeche, Touch-Ziel 44 px */
.icon-knopf {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--neutral-hell);
  color: var(--text);
  cursor: pointer;
}

.icon-knopf:hover { background: var(--neutral-mittel); }
.icon-knopf--haupt { background: var(--akzent); color: #fff; }
.icon-knopf--haupt:hover { background: var(--akzent-dunkel); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--abstand-1);
  padding: 2px var(--abstand-2);
  border-radius: var(--radius-knopf);
  font-size: var(--groesse-klein);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge--neutral { background: var(--neutral-hell); color: var(--text-leise); }
.badge--akzent { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.badge--gut { background: var(--gut-hell); color: var(--text-gut); }
.badge--schlecht { background: var(--schlecht-hell); color: var(--text-schlecht); }
.badge--warnung { background: var(--warnung-hell); color: var(--text-warnung); }

.zahl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-knopf);
  background: var(--akzent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* Karte */
.karte {
  padding: var(--abstand-5);
  border: 1px solid var(--rand);
  border-radius: var(--radius-karte);
  background: var(--flaeche);
  box-shadow: var(--schatten);
  min-width: 0;
}

.karte__kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--abstand-3);
  margin-bottom: var(--abstand-4);
}

.karte__titel { font-size: var(--groesse-gross); }

/* Kachel */
.kachel {
  display: grid;
  gap: var(--abstand-2);
  padding: var(--abstand-5);
  border: 1px solid var(--rand);
  border-radius: var(--radius-karte);
  background: var(--flaeche);
  box-shadow: var(--schatten);
  color: inherit;
  text-decoration: none;
}

.kachel--link:hover { border-color: var(--akzent-hell-hover); }
.kachel__kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--abstand-2); }
.kachel__titel { color: var(--text-leise); font-weight: 500; }
.kachel__icon {
  display: inline-flex;
  padding: 6px;
  border-radius: 10px;
  background: var(--akzent-hell);
  color: var(--akzent);
}
.kachel__zeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-3); }
.kachel__wert { font-size: var(--groesse-zahl); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kachel__vergleich { color: var(--text-leise); font-size: var(--groesse-klein); }
.kachel__hinweis { color: var(--text-warnung); font-size: var(--groesse-klein); font-weight: 500; }

/* Leerer Zustand */
.leer-zustand {
  display: grid;
  justify-items: center;
  gap: var(--abstand-2);
  padding: var(--abstand-6) var(--abstand-4);
  color: var(--text-leise);
  text-align: center;
}

.leer-zustand__icon { color: var(--akzent); }
.leer-zustand__titel { color: var(--text); font-weight: 600; }
.leer-zustand__aktion { margin-top: var(--abstand-2); }

/* Fehler- und Ladezeile */
.fehlerzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--abstand-3);
  padding: var(--abstand-3) var(--abstand-4);
  border-radius: var(--radius-feld);
  background: var(--schlecht-hell);
  color: var(--text-schlecht);
}

.fehlerzeile__icon { flex: none; }
.fehlerzeile__text { flex: 1 1 200px; }

.ladezeile {
  display: flex;
  align-items: center;
  gap: var(--abstand-2);
  padding: var(--abstand-3) 0;
  color: var(--text-leise);
}

.ladezeile__punkt {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--akzent);
  animation: pulsieren 1s ease-in-out infinite alternate;
}

@keyframes pulsieren { from { opacity: .25; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ladezeile__punkt { animation: none; }
}

/* Aufgabenzeile mit Checkbox */
.aufgaben-liste { display: grid; padding: 0; list-style: none; }

.aufgabe-zeile {
  display: flex;
  align-items: flex-start;
  gap: var(--abstand-1);
  border-bottom: 1px solid var(--rand);
}

.aufgabe-zeile:last-child { border-bottom: 0; }
.aufgabe-zeile--ausstehend { opacity: .6; }

.aufgabe-zeile__check {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  cursor: pointer;
}

.aufgabe-zeile__check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--akzent);
  cursor: pointer;
}

.aufgabe-zeile__inhalt {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  min-height: var(--touch);
  padding: 10px var(--abstand-2) 10px 0;
  text-align: left;
}

.aufgabe-zeile__inhalt--knopf {
  border: 0;
  border-radius: var(--radius-feld);
  background: transparent;
  cursor: pointer;
}

.aufgabe-zeile__inhalt--knopf:hover { background: var(--hintergrund); }
.aufgabe-zeile__titel { display: flex; align-items: center; gap: 6px; font-weight: 500; overflow-wrap: anywhere; }
.aufgabe-zeile__bug { flex: none; color: var(--schlecht); }
.aufgabe-zeile--erledigt .aufgabe-zeile__titel { color: var(--text-leise); }
.aufgabe-zeile__titeltext { min-width: 0; }
.aufgabe-zeile--erledigt .aufgabe-zeile__titeltext { text-decoration: line-through; }
.aufgabe-zeile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-leise); font-size: var(--groesse-klein); }
.aufgabe-zeile__projekt { font-weight: 600; color: var(--text); }

/* Chip: Umschalter mit Flaeche (getoent, eingeschaltet gefuellt), z. B. Zustandsfilter und Zustandswahl */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--abstand-2);
  min-height: var(--touch);
  padding: 0 var(--abstand-4);
  border: 0;
  border-radius: var(--radius-knopf);
  background: var(--neutral-hell);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover { background: var(--neutral-mittel); }
.chip--aktiv { background: var(--akzent); color: #fff; }
.chip--aktiv:hover { background: var(--akzent-dunkel); }

/* Projekt-Icon (views/bausteine/projekt-icon.js): Emoji, Bild oder Anfangsbuchstabe auf getoenter Flaeche */
.projekt-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--neutral-hell);
  font-size: 18px;
  line-height: 1;
  object-fit: cover;
}

.projekt-icon--buchstabe { background: var(--akzent-hell); color: var(--akzent-dunkel); font-size: 15px; font-weight: 700; }
.projekt-icon--klein { width: 24px; height: 24px; border-radius: 7px; font-size: 14px; }
.projekt-icon--klein.projekt-icon--buchstabe { font-size: 13px; }
.projekt-icon--gross { width: 56px; height: 56px; border-radius: 16px; font-size: 32px; }
.projekt-icon--gross.projekt-icon--buchstabe { font-size: 24px; }

/* Konflikt: inzwischen auf einem anderen Geraet geaendert (views/bausteine/konfliktHinweis.js) */
.konflikt-hinweis { display: grid; gap: var(--abstand-3); padding: var(--abstand-3) var(--abstand-4); border-radius: var(--radius-feld); background: var(--warnung-hell); color: var(--text); }
.konflikt-hinweis__text { display: flex; align-items: flex-start; gap: var(--abstand-2); font-weight: 600; }
.konflikt-hinweis__text .icon { flex: none; margin-top: 2px; color: var(--text-warnung); }
.konflikt-hinweis__frage { flex: 1 1 100%; }
.konflikt-hinweis__knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-2); }

/* Kennung („A-17“, „N-5“): grau vor dem Titel; als Knopf zum Kopieren im Kopf von Dialog und Notiz */
.kennung { margin-right: .45em; color: var(--text-leise); font-family: var(--schrift-mono); font-size: var(--groesse-klein); font-weight: 500; white-space: nowrap; }
.aufgabe-zeile__titel .kennung { margin-right: 0; }
.kennung-knopf { gap: var(--abstand-1); padding: 0 var(--abstand-3); font-family: var(--schrift-mono); font-size: var(--groesse-klein); }
.kennung-knopf--kopiert, .kennung-knopf--kopiert:hover { background: var(--gut-hell); color: var(--text-gut); }
.dialog__kopf .kennung-knopf { margin-right: auto; }
/* „An Claude“ steht direkt neben der Kennung; der Abstand nach rechts wandert dann zu ihm */
.dialog__kopf .kennung-knopf:has(+ .claude-knopf) { margin-right: 0; }
.dialog__kopf .claude-knopf { margin-right: auto; padding: 0 var(--abstand-3); font-size: var(--groesse-klein); }
