/* Layout: dunkelblauer Kopf mit Lichterkette, schmale Inhaltsspalte mit Karten, feste Menüleiste unten.
   Schriften liegen auf dem eigenen Server (keine Verbindung zu Google). Lizenz: SIL Open Font License. */
@font-face { font-family: "Alfa Slab One"; src: url("fonts/alfa-slab-one-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --navy: #1f2a4a;
  --navy-soft: #2b375c;
  --bg: #eef1f6;
  --surface: #ffffff;
  --ink: #1a2340;
  --text: #2a3350;
  --muted: #5d6880;
  --line: #dde2eb;
  --line-strong: #c9d0dc;
  --red: #c0392b;
  --red-strong: #a32f23;
  --on-dark: #ffffff;
  --on-dark-muted: #c6cddc;
  --amber: #c98a0b;
  --green: #2e8b4e;
  --ok: #24724a;   --ok-bg: #e3f3ea;
  --warn: #8a5a00; --warn-bg: #fdf1d8;
  --info: #234b82; --info-bg: #e5edf9;
  --err: #b0302a;  --err-bg: #fbe7e5;
  --radius: 16px;
  --radius-sm: 12px;
  --col: 940px;
  --tabbar: 64px;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.5 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
body.has-tabs { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
a { color: var(--red); }
a:hover { color: var(--red-strong); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.7rem, 4.5vw, 2.2rem); letter-spacing: -.005em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.right { text-align: right; }
.opt { color: var(--muted); font-weight: 400; font-size: .88rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap {
  width: 100%; max-width: calc(var(--col) + 32px); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ── Kopf ─────────────────────────────────────────── */
.top { background: var(--navy); color: var(--on-dark); padding-top: env(safe-area-inset-top, 0px); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 22px 12px; }
.brand { color: var(--on-dark); text-decoration: none; display: grid; gap: 2px; min-width: 0; }
.brand:hover { color: var(--on-dark); }
.brand strong { font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 3.6vw, 1.95rem); line-height: 1.1; letter-spacing: .005em; }
.brand strong span { display: block; }
.brand small { color: var(--on-dark-muted); font-size: .92rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.who { display: inline-flex; align-items: center; border: 1.5px solid rgb(255 255 255 / .5); border-radius: 999px; color: var(--on-dark); font-size: 1.05rem; white-space: nowrap; }
.who a, .who button { color: inherit; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 9px 4px; }
.who a { padding-left: 20px; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
.who button { padding-right: 20px; }
.who form { display: contents; }
.who .dot { opacity: .8; padding: 0 2px; }
.who a:hover, .who button:hover { text-decoration: underline; color: inherit; }

/* Lichterkette */
.lights {
  height: 20px; background-color: var(--navy);
  background-image: radial-gradient(circle, var(--red) 0 5px, transparent 5.5px);
  background-size: 24.5px 20px; background-position: 6px 50%; background-repeat: repeat-x;
}

/* ── Inhalt ───────────────────────────────────────── */
.main { flex: 1; padding-block: 30px 40px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.page-head > div { display: grid; gap: 4px; min-width: 0; }
.back { display: inline-block; text-decoration: none; font-size: .95rem; font-weight: 600; margin-bottom: 2px; }
.section-title { margin: 6px 0 -6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.panel > h2 { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 22px; }
.empty { color: var(--muted); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }

/* Meldungen */
.flash { padding: 14px 16px; border-radius: var(--radius-sm); font-weight: 500; overflow-wrap: anywhere; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--info-bg); color: var(--info); }
.notice { display: block; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); text-decoration: none; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.notice:hover { color: var(--warn); filter: brightness(.98); }

/* Formulare */
label { font-weight: 600; font-size: .95rem; color: var(--ink); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px; width: 100%; min-width: 0;
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--red); margin: 0; flex: none; }
input[type="file"] { padding: 9px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack label:not(:first-of-type):not(.check) { margin-top: 10px; }
.stack .btn { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field small { color: var(--muted); }
.check, .field.check label { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.field.check { justify-content: end; padding-bottom: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions form { display: contents; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline select { width: auto; padding: 8px 10px; }
.form-panel summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 10px; }
.form-panel summary::-webkit-details-marker { display: none; }
.form-panel summary::before { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: var(--on-dark); font-weight: 700; }
.form-panel[open] summary::before { content: "−"; }
.form-panel[open] summary { margin-bottom: 14px; }
.form-panel > p { margin-bottom: 10px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 1.05rem; text-decoration: none; cursor: pointer;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); white-space: nowrap;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--on-dark); font-weight: 600; }
.btn.primary:hover { background: var(--red-strong); border-color: var(--red-strong); color: var(--on-dark); }
.btn.big { font-size: 1.25rem; padding: 13px 28px; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn.small { padding: 7px 13px; font-size: .92rem; }
.install { font: inherit; font-weight: 600; color: var(--red); background: none; border: 1.5px solid currentColor; border-radius: 999px; padding: 8px 16px; cursor: pointer; }

/* Anmelden */
.bare .main { justify-content: center; }
.auth { width: 100%; max-width: 440px; margin: 3vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; display: flex; flex-direction: column; gap: 14px; }
.auth .lead { color: var(--muted); }
.auth .btn.primary { width: 100%; }
.auth > .btn { align-self: start; }

/* ── Termine ──────────────────────────────────────── */
.event { display: flex; gap: 24px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.event.past { opacity: .7; }
.tile {
  flex: none; width: 96px; text-align: center; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.tile-m { display: block; background: var(--red); color: var(--on-dark); font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 6px 0 5px; }
.tile-d { display: block; font-family: var(--display); color: var(--ink); font-size: 2.15rem; padding-top: 8px; }
.tile-w { display: block; font-size: .95rem; color: var(--muted); padding: 6px 0 10px; }
.event-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.event-main h3 { font-size: 1.3rem; font-weight: 600; }
.event-meta { color: var(--muted); font-size: 1.1rem; overflow-wrap: anywhere; }
.event-desc { white-space: pre-line; }
.event-by { color: var(--muted); font-size: 1rem; }
.event-side { flex: none; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.event-side form { display: contents; }
.pills { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.pill { display: inline-block; font-size: .98rem; font-weight: 500; padding: 3px 13px; border-radius: 999px; border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); line-height: 1.5; }
.pill.dashed { border-style: dashed; }
.kind-navy { border-color: var(--navy); color: var(--ink); }
.kind-green { border-color: var(--green); color: var(--green); }
.kind-amber { border-color: var(--amber); color: var(--amber); }
.kind-red { border-color: var(--red); color: var(--red); }
.kind-grey { border-color: var(--line-strong); color: var(--muted); }
.pill-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

@media (max-width: 600px) {
  .event { gap: 14px; padding: 16px; flex-wrap: wrap; }
  .tile { width: 72px; }
  .tile-m { font-size: .82rem; }
  .tile-d { font-size: 1.7rem; padding-top: 6px; }
  .tile-w { font-size: .82rem; padding-bottom: 8px; }
  .event-main { flex-basis: calc(100% - 90px); }
  .event-main h3 { font-size: 1.12rem; }
  .event-meta { font-size: 1rem; }
  .event-side { flex-direction: row; width: 100%; justify-content: flex-end; }
  .pill { font-size: .88rem; padding: 2px 10px; }
}

/* ── Dokumente ────────────────────────────────────── */
.docs { list-style: none; margin: 0; padding: 4px 24px; }
.doc { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc:first-child { border-top: 0; }
.doc-ext { flex: none; width: 46px; height: 56px; border-radius: 4px 14px 4px 4px; display: grid; place-items: end center; padding-bottom: 7px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.ext-pdf { background: var(--err-bg); color: var(--err); border-color: transparent; }
.ext-doc, .ext-docx, .ext-odt { background: var(--info-bg); color: var(--info); border-color: transparent; }
.ext-xls, .ext-xlsx, .ext-ods { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.doc-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-title { font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.doc-title:hover { color: var(--red); text-decoration: underline; }
.doc-meta { color: var(--muted); font-size: .95rem; }
.tag { font-weight: 600; color: var(--ink); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-actions form { display: contents; }
.filter { display: flex; gap: 8px; }
.filter input { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 5px 14px; font-size: .98rem; font-weight: 500; }
.chip span { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--navy); color: var(--ink); }
.chip[aria-current="true"] { background: var(--navy); color: var(--on-dark); border-color: var(--navy); }
.chip[aria-current="true"] span { color: inherit; opacity: .75; }

/* ── Vorstand / Mitglieder ────────────────────────── */
.people { list-style: none; margin: 0; padding: 0; }
.pending { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-bg) 55%, var(--surface)); }
.person { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person-main { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { opacity: .6; }
.role, .status { display: inline-block; font-size: .88rem; font-weight: 600; padding: 2px 11px; border-radius: 999px; border: 1.5px solid transparent; }
.role-admin { background: var(--navy); color: var(--on-dark); }
.role-vorstand { border-color: var(--navy); color: var(--ink); }
.role-mitglied { border-color: var(--line-strong); color: var(--muted); }
.status-active { color: var(--ok); }
.status-blocked { color: var(--err); }
.status-pending { color: var(--warn); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--red); color: var(--on-dark); font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; vertical-align: 2px; }
.creds dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 20px; }
.creds dt { color: var(--muted); }
.creds dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pw { font: 700 1.25rem/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--bg); padding: 4px 10px; border-radius: 6px; letter-spacing: .06em; user-select: all; }

/* ── Menüleiste unten ─────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .wrap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tabbar a {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 4px;
  height: var(--tabbar); color: var(--muted); text-decoration: none; font-size: 1.12rem; font-weight: 500;
}
.tabbar a::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 4px; background: transparent; }
.tabbar a:hover { color: var(--ink); }
.tabbar a[aria-current="page"] { color: var(--red); }
.tabbar a[aria-current="page"]::before { background: var(--red); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .top-inner { padding-block: 16px 8px; }
  .brand small { font-size: .78rem; }
  .who { font-size: .92rem; }
  .who a { padding-left: 14px; max-width: 9ch; }
  .who button { padding-right: 14px; }
  .main { padding-block: 22px 32px; }
  .panel { padding: 16px; }
  .docs { padding: 2px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .btn.big { font-size: 1.08rem; padding: 11px 20px; }
  .tabbar a { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
