:root {
  --owr-blue: #0057A6;
  --owr-light: #E6F1FA;
  --owr-red: #D81E05;
  --owr-white: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: linear-gradient(180deg, var(--owr-light), #fff 40%);
  min-height: 100dvh;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
}

/* === kompakter Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--owr-white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.brand img {
  width: 36px;
  height: 36px;
  display: block;
}
.brand .title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}
.brand .subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: -4px;
}

/* Kompakte Variante (nach Login) */
.brand.compact img {
  width: 24px;
  height: 24px;
}
.brand.compact .title {
  font-size: 0.9rem;
}
.brand.compact .subtitle {
  font-size: 0.7rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 8px;
}

.nav-links a {
  text-decoration: none;
  color: var(--owr-blue);
  padding: 6px 10px;
  font-size: 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-links a:hover {
  background: var(--owr-light);
  border-color: var(--owr-blue);
}

/* Mobile Menü-Button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px 10px;
  margin-right: 8px;
}
.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  height: 2px;
  width: 20px;
  background: var(--owr-blue);
  margin: 4px 0;
}

/* === Cards & Layout === */
.card {
  background: var(--owr-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-top: 12px;
}

form { display: grid; gap: 12px; }
label { font-weight: 600; }

input, button {
  font: inherit;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
}
input:focus {
  outline: 2px solid var(--owr-blue);
  border-color: var(--owr-blue);
}

button, .btn {
  cursor: pointer;
  border: none;
  color: #fff;
  background: var(--owr-blue);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 12px rgba(0,87,166,.25);
  transition: transform 0.05s ease, box-shadow 0.2s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); }

button.secondary { background: var(--owr-red); }
.btn.ghost {
  background: transparent;
  color: var(--owr-blue);
  border: 1px solid var(--owr-blue);
}

/* === Hero Startseite (ausgeloggt) === */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70dvh;
  text-align: center;
  gap: 18px;
}
.hero .logo {
  width: 120px;
  height: auto;
  opacity: 0.95;
}
.hero .cta {
  width: 240px;
  max-width: 80vw;
}

/* === Sonstiges === */
.muted { color: var(--muted); }

.flash {
  border-left: 4px solid var(--owr-blue);
  background: #f8fbff;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 12px 0;
}

.site-footer {
  color: var(--muted);
  padding: 16px;
  text-align: center;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--owr-light);
  color: var(--owr-blue);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--owr-blue);
}

/* === Responsive === */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 0 16px 12px;
  }
  .brand .title { font-size: 0.95rem; }
}

/* Termine-Liste */
.list-terms {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 12px;
}

.term {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--owr-white);
}

.term-date {
  font-weight: 700;
  color: var(--owr-blue);
  white-space: nowrap;
}

.term-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.term-desc {
  margin: 4px 0 0;
  color: var(--muted);
}

.term-place {
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
  opacity: .8;
}

/* Mobile: alles untereinander */
@media (max-width: 720px) {
  .term {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .term-place {
    margin-top: 6px;
  }
}

select {
  font: inherit;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--owr-white);
  width: 100%;
}

select:focus {
  outline: 2px solid var(--owr-blue);
  border-color: var(--owr-blue);
}

@media (max-width: 600px) {
  .card h2 + .btn {
    width: 100%;
    text-align: center;
  }
}

.inline-form { display: inline; margin: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--owr-white);
  color: #c1121f;            /* dezent rot getönt */
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.icon-btn:hover {
  background: #fff5f5;
  transform: translateY(-1px);
}
.icon-btn:active {
  transform: translateY(0);
}

.inline-form { display: inline; margin: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--owr-white);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  color: var(--text);
}
.icon-btn:hover { transform: translateY(-1px); }

.icon-btn.edit { color: var(--owr-blue); }
.icon-btn.edit:hover { background: #f0f6ff; }

.icon-btn.delete { color: #c1121f; }
.icon-btn.delete:hover { background: #fff5f5; }

/* --- Kompakte Terminliste auf der Startseite --- */
.mini-terms-card { padding-top: 14px; }
.mini-terms-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.mini-terms-title { font-size: 1.05rem; margin: 0; }
.mini-terms-link {
  font-size: .9rem; text-decoration: none; color: var(--owr-blue);
  border: 1px solid var(--owr-blue); padding: 6px 10px; border-radius: 999px;
}
.mini-terms-link:hover { background: var(--owr-light); }

.mini-terms {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 6px;
}
.mini-term {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--owr-white);
}
.mini-term-main {
  min-width: 0; /* für Text-ellipsis */
  display: flex; gap: 6px; align-items: baseline; white-space: nowrap; overflow: hidden;
}
.mini-term-date { font-weight: 700; color: var(--owr-blue); }
.mini-term-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-term-place { color: var(--muted); white-space: nowrap; }
.mini-term-sep { color: var(--muted); }

/* Mobile: Ort unter die Hauptzeile */
@media (max-width: 640px) {
  .mini-term { grid-template-columns: 1fr; }
  .mini-term-place { margin-left: 0; }
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--owr-light);
  color: var(--owr-blue);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--owr-blue);
}
.badge.small { font-size: 0.75rem; padding: 2px 6px; }
.badge.yes { background: #eaf6ea; color: #1f7a1f; border-color: #1f7a1f; }

/* Icon-Buttons (Edit, Delete, RSVP) */
.inline-form { display: inline; margin: 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 36px; padding: 6px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--owr-white); color: var(--text);
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .05s ease, box-shadow .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.icon-btn:hover { transform: translateY(-1px); }

.icon-btn.edit   { color: var(--owr-blue); }
.icon-btn.edit:hover   { background: #f0f6ff; }

.icon-btn.delete { color: #c1121f; }
.icon-btn.delete:hover { background: #fff5f5; }

.icon-btn.yes    { color: #1f7a1f; }
.icon-btn.yes:hover    { background: #edf7ed; border-color: #1f7a1f; }

.icon-btn.neutral { color: #6b7280; }
.icon-btn.neutral:hover { background: #f3f4f6; }

/* Neutrale Badge-Variante (optional) */
.badge.neutral {
  background: #f3f4f6;
  color: #334155;
  border-color: #cbd5e1;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 8px 0 4px;
}
.chk {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--owr-white);
}
.chk input { width: 18px; height: 18px; }

.badge.neutral {
  background: #f3f4f6;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.term-title .badge { margin-left: 6px; font-size: .75rem; padding: 2px 6px; }

/* Modal (Teilnehmerliste) */
.modal { position: fixed; inset: 0; display: none; }
.modal.open { display: block; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
}
.modal-dialog {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: #fff; border-radius: 14px;
  width: min(680px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border: 1px solid var(--border);
  max-height: 80vh; overflow: auto;
}
.modal-head {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:12px 14px; border-bottom:1px solid var(--border);
}
.modal-body { padding: 14px; }

.mini-books-card { padding-top: 14px; }
.mini-term-date { font-weight: 700; color: var(--owr-blue); }
.badge.neutral { background: #f3f4f6; color: #334155; border: 1px solid #cbd5e1; }
.badge.small { font-size: 0.75rem; padding: 2px 6px; }
.badge.yes { background: #eaf6ea; color: #1f7a1f; border-color: #1f7a1f; }
/* --- Mini Buchungen --- */
.bookings-mini { display: grid; gap: 8px; }
.mini-booking {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}
.mini-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}
.mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-thumb.ph {
  font-size: 0.7rem;
  color: #999;
  text-align: center;
  line-height: 1.1;
}
.mini-booking-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mini-line1 { font-weight: 600; font-size: 0.9rem; }
.mini-line2 { font-size: 0.85rem; }
.mini-line3 { font-size: 0.85rem; color: #333; }
.mini-term-date { color: var(--owr-blue, #004c97); }
.badge.yes.small { background: #eaf6ea; color: #1f7a1f; border: 1px solid #1f7a1f; font-size: 0.7rem; padding: 2px 6px; border-radius: 6px; }
@media (max-width: 640px) {
  .mini-booking { flex-direction: row; align-items: center; }
  .mini-booking-info { font-size: 0.9rem; }
  .mini-thumb { width: 56px; height: 56px; }
}

