:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2330; --muted: #6b7280; --line: #e5e7eb;
  --primary: #1f3a5f; --primary-text: #ffffff; --accent: #e8a33d;
  --ok-bg: #e7f6ec; --ok: #1d7a3e; --err-bg: #fdecec; --err: #b42318; --warn-bg: #fff4e0; --warn: #9a5b00;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.topbar { background: var(--primary); color: var(--primary-text); padding: .75rem 1rem; }
.topbar .inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; opacity: .9; } .topbar a:hover { opacity: 1; }
.topbar .brand { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; }
.topbar .brand img { height: 40px; width: auto; display: block; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.topbar button { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; padding: .3rem .7rem; border-radius: 8px; cursor: pointer; }

main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
main.narrow { max-width: 680px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card.header-image { padding: 0; overflow: hidden; }
.card.header-image img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.card.header-image .body { padding: 1.25rem; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

label { display: block; font-weight: 600; margin: .75rem 0 .25rem; font-size: .95rem; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid #cfd4dc; border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-top: 1rem; }
.check input { margin-top: .3rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { main > div[style*='grid-template-columns: 2fr 1fr'] { grid-template-columns: 1fr !important; } }
.hp { position: absolute; left: -9999px; }

.btn { display: inline-block; background: var(--primary); color: #fff; border: 0; padding: .65rem 1.1rem; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; font-weight: 500; }
.btn.ok { background: var(--ok); } .btn.danger { background: var(--err); } .btn.warn { background: var(--accent); color: #222; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions form { margin: 0; display: inline; }

.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.reserved { background: var(--warn-bg); color: var(--warn); }
.pill.paid { background: var(--ok-bg); color: var(--ok); }
.pill.cancelled, .pill.expired { background: #eee; color: #666; }
.pill.free { background: var(--ok-bg); color: var(--ok); font-size: 1rem; }
.pill.full { background: var(--err-bg); color: var(--err); font-size: 1rem; }
.pill.soon { background: var(--warn-bg); color: var(--warn); }
.pill.few { background: var(--warn-bg); color: var(--warn); font-size: 1rem; }
.event-list .pill.soon, .kv .pill.soon { font-size: 1rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .n { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbfc; }
td .sub { color: var(--muted); font-size: .82rem; }
td.nowrap, th.nowrap { white-space: nowrap; }

.filterbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filterbar input[type=text], .filterbar select { width: auto; }
details summary { cursor: pointer; font-weight: 600; }
.event-list .item { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.event-list .item + .item { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.remind-inline { margin-top: .5rem; }
.remind-inline summary { list-style: none; display: inline-block; }
.remind-inline summary::-webkit-details-marker { display: none; }
.remind-inline[open] summary { margin-bottom: .6rem; }
.remind-inline form { background: var(--warn-bg); border-radius: 10px; padding: .75rem; max-width: 460px; }
.remind-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.remind-row input { flex: 1; min-width: 180px; margin: 0; }
.event-list img.thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: #f1f3f5; padding: .05em .35em; border-radius: 4px; }
pre { background: #f1f3f5; padding: .75rem; border-radius: 8px; overflow-x: auto; font-size: .85rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

/* Website-Seiten */
.rich h2 { margin-top: 1.2em; } .rich h3 { margin-top: 1em; } .rich ul { padding-left: 1.3em; } .rich p:last-child { margin-bottom: 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.team-card { text-align: center; margin: 0; }
.team-card img { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; }
.team-card .avatar { width: 140px; height: 140px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 3rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.team-card .rich { text-align: left; }
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.sponsor-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; min-height: 110px; margin: 0; padding: 1rem; text-decoration: none; color: var(--text); text-align: center; transition: box-shadow .15s, transform .15s; }
a.sponsor-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.sponsor-card img { max-width: 100%; max-height: 64px; object-fit: contain; }
.sponsor-card span { font-weight: 600; text-align: center; }
.sponsor-card .rich { text-align: left; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-top: 1rem; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.social { display: flex; justify-content: center; gap: 1rem; margin-bottom: .9rem; }
.social a { color: var(--primary); opacity: .85; display: inline-flex; padding: .3rem; border-radius: 50%; }
.social a:hover { opacity: 1; background: rgba(0,0,0,.05); }
