/* ============================================================
   Gruppen-Agenda – Stylesheet
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2933;
  --text-soft: #6b7785;
  --border: #e2e6eb;
  --accent: #2563eb;
  --accent-soft: #e8f0fe;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(31, 41, 51, 0.06), 0 1px 2px rgba(31, 41, 51, 0.04);

  /* Kategorie-Farben */
  --cat-organisatorisches: #94a3b8;
  --cat-inhaltlich: #8b5cf6;
  --cat-reflexion: #14b8a6;
  --cat-supervision: #ec4899;
  --cat-tool-idee: #f59e0b;
  --cat-tool-test: #fb923c;
  --cat-gruppenprozesse: #4caf72;
  --cat-technisches: #64748b;
  --cat-ankuendigung: #ef4444;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Layout ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.topbar nav a {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.topbar nav a:hover {
  background: var(--accent);
  color: #fff;
}

/* ---------- Sortierung ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.toolbar select {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--surface);
  cursor: pointer;
}

/* ---------- Legende ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Kategorie-Gruppen (bei Sortierung "Kategorie") ---------- */

.category-heading {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.category-heading:first-of-type {
  margin-top: 0;
}

/* ---------- Eintrags-Karten ---------- */

.entry {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--cat-color, var(--accent));
  padding: 16px 18px;
  margin-bottom: 14px;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
}

.entry-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--cat-color, var(--accent));
  white-space: nowrap;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 10px 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.entry-meta span strong {
  color: var(--text);
  font-weight: 700;
}

.entry-ziel {
  font-size: 0.95rem;
  margin: 8px 0 0;
}

.entry-ziel-label {
  font-weight: 800;
  color: var(--text-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}

.entry-description {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--text);
  white-space: pre-wrap;
}

.entry-description-toggle {
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

/* ---------- Priorisierung ---------- */

.entry-priority {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.priority-avg {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 700;
}

.priority-avg strong {
  color: var(--text);
  font-size: 1rem;
}

.priority-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-soft);
  white-space: nowrap;
}

.priority-picker {
  display: flex;
  align-items: flex-end;
  justify-self: end;
}

.priority-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 44px;
}

.priority-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
}

/* Größe der Buttons codiert die Wichtigkeit:
   Prio 1 (sehr hoch) = groß, Prio 5 (sehr niedrig) = klein */
.priority-btn {
  font-family: inherit;
  font-weight: 800;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.priority-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.priority-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.priority-btn[data-priority="1"] { width: 38px; height: 38px; font-size: 1.05rem; }
.priority-btn[data-priority="2"] { width: 34px; height: 34px; font-size: 0.98rem; }
.priority-btn[data-priority="3"] { width: 30px; height: 30px; font-size: 0.9rem; }
.priority-btn[data-priority="4"] { width: 27px; height: 27px; font-size: 0.82rem; }
.priority-btn[data-priority="5"] { width: 24px; height: 24px; font-size: 0.75rem; }

.priority-btn:active {
  transform: scale(0.92);
}

.priority-hint {
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 4px;
  text-align: right;
}

/* ---------- Leerer Zustand ---------- */

.empty-state {
  text-align: center;
  color: var(--text-soft);
  padding: 60px 20px;
  font-size: 1rem;
}

/* ---------- Formular (Eintragen) ---------- */

.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.field input[type="text"]:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.submit-btn:hover {
  background: #1d4ed8;
}

.submit-btn:disabled {
  background: var(--border);
  color: var(--text-soft);
  cursor: not-allowed;
}

.form-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  display: none;
}

.form-message.success {
  display: block;
  background: #e7f6ec;
  color: #1b7a3d;
}

.form-message.error {
  display: block;
  background: #fdeaea;
  color: #c0392b;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .entry-header {
    flex-direction: column;
  }

  .entry-priority {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .priority-section-label {
    text-align: left;
  }

  .priority-picker {
    justify-self: stretch;
    justify-content: space-between;
  }
}
