/* Vereinskontor – Oberfläche. Keine externen Schriften (DSGVO), Systemschrift. */
:root {
  --brand: #2f6fed;
  --brand-ink: #fff;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --ink: #1b2130;
  --ink-2: #4a5263;
  --muted: #7b8394;
  --ok: #1f9d55;
  --ok-bg: #e5f6ec;
  --warn: #b7791f;
  --warn-bg: #fdf3e1;
  --danger: #d64545;
  --danger-bg: #fdecec;
  --info: #2f6fed;
  --info-bg: #e8f0fe;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --sidebar: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --surface: #171b23; --surface-2: #1d222c; --line: #2a303c; --line-strong: #3a4250;
    --ink: #e8ebf1; --ink-2: #b8bfcc; --muted: #8a92a3;
    --ok-bg: #12301f; --warn-bg: #33270f; --danger-bg: #3a1717; --info-bg: #142444;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1218; --surface: #171b23; --surface-2: #1d222c; --line: #2a303c; --line-strong: #3a4250;
  --ink: #e8ebf1; --ink-2: #b8bfcc; --muted: #8a92a3;
  --ok-bg: #12301f; --warn-bg: #33270f; --danger-bg: #3a1717; --info-bg: #142444;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt0 { margin-top: 0; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Grundgerüst */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 13px; letter-spacing: .5px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 14px; position: relative; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 600; }
.count { margin-left: auto; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 5px; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; align-items: center; gap: 6px; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 6px; border-radius: var(--radius-sm); min-width: 0; }
.me:hover { background: var(--surface-2); text-decoration: none; }
.me b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.me small { color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 18%, var(--surface)); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 22px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; flex-wrap: wrap; }
.topbar-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.topbar h1 { font-size: 1.45rem; margin: 0; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.back { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--ink-2); }
.back:hover { background: var(--surface); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 14px 28px 48px; max-width: 1320px; width: 100%; }
.icon-btn.menu-btn { display: none; }
.backdrop { display: none; }
.tabbar { display: none; }

/* ---------- Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12.5px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn .i { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
form.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td.actions { display: table-cell; text-align: right; white-space: nowrap; }
td.actions > * { margin-left: 4px; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-weight: 600; }
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-select .hint { width: 100%; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { --c: var(--muted); display: inline-flex; height: 28px; align-items: center; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line-strong); cursor: pointer; font-size: 13px; }
.chip-check input:checked + span { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); color: var(--ink); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--surface-2); }
.table a.rowlink { color: var(--ink); font-weight: 600; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 20px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 20px; }
.pos { color: var(--ok); } .neg { color: var(--danger); }

/* ---------- Formulare */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--danger); }
.hint { color: var(--muted); font-size: 12.5px; }
input, select, textarea { font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px; width: 100%; min-height: 38px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus, .rte-area:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
input[type="color"] { padding: 3px; height: 38px; }
input[type="file"] { padding: 6px; }
.field-check { justify-content: flex-end; }
.field-check label { display: flex; gap: 9px; align-items: center; font-weight: 500; color: var(--ink); cursor: pointer; }
.input-affix { display: flex; align-items: stretch; }
.input-affix input { border-top-right-radius: 0; border-bottom-right-radius: 0; text-align: right; }
.input-affix span { display: grid; place-items: center; padding: 0 11px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--muted); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0 0 16px; }
legend { font-weight: 650; padding: 0 6px; font-size: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 150px; }
.filters input[type="search"] { min-width: 220px; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-list label { display: flex; gap: 9px; align-items: center; cursor: pointer; }

.rte { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.rte-bar { display: flex; gap: 2px; padding: 5px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rte-bar button { min-width: 30px; height: 28px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: 14px; }
.rte-bar button:hover { background: var(--surface-2); color: var(--ink); }
.rte-area { min-height: 180px; padding: 12px 14px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.prose img, .rte-area img { max-width: 100%; height: auto; border-radius: 8px; }
.prose { line-height: 1.65; }
.prose h3 { margin-top: 1em; }

/* ---------- Meldungen, Reiter, Leere Zustände */
.flash { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-info { background: var(--info-bg); color: var(--info); }
.note { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3, .empty h2 { color: var(--ink); margin-top: 10px; }
.empty-ico { width: 40px; height: 40px; stroke-width: 1.4; opacity: .6; }
.pager { display: flex; gap: 4px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); padding: 0 8px; }
.pager .cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* ---------- Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); }
.list .meta { color: var(--muted); font-size: 13px; }
.date-badge { width: 48px; flex: none; text-align: center; border-radius: 9px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.date-badge b { display: block; font-size: 18px; line-height: 1.6; }
.date-badge span { display: block; font-size: 10.5px; text-transform: uppercase; background: var(--brand); color: var(--brand-ink); font-weight: 700; letter-spacing: .04em; }

/* ---------- Diagramme */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 180px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; text-align: right; }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: var(--brand); }

/* ---------- Kalender */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-head { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.cal-day.other { background: var(--surface-2); color: var(--muted); }
.cal-day.today .cal-num { background: var(--brand); color: var(--brand-ink); }
.cal-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 600; margin-bottom: 3px; }
.cal-ev { display: block; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--ink); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* ---------- Chat */
.chat { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - 150px); min-height: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.chat-list a:hover { background: var(--surface-2); text-decoration: none; }
.chat-list a.active { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.msg { max-width: min(560px, 82%); padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.msg.mine a { color: inherit; text-decoration: underline; }
.msg .who { font-size: 12px; font-weight: 700; margin-bottom: 2px; color: var(--brand); }
.msg .when { font-size: 11px; opacity: .65; margin-top: 2px; text-align: right; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { min-height: 40px; max-height: 140px; resize: none; }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface); padding: 2px 10px; border-radius: 10px; border: 1px solid var(--line); margin: 8px 0; }

/* ---------- Anmeldung / öffentliche Seiten */
.bare { min-height: 100vh; display: block; background: var(--bg); }
.bare .main { min-height: 100vh; align-items: center; justify-content: flex-start; padding: 6vh 16px; }
.bare .content { max-width: 460px; padding: 0; }
.bare.wide .content { max-width: 760px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand img { width: 44px; height: 44px; object-fit: contain; }
.auth-brand .brand-mark { width: 44px; height: 44px; font-size: 16px; }

/* ---------- Dialog */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 14, 22, .45); }
dialog .dlg-body { padding: 22px; }
dialog .dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ---------- Mobil */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 14, 22, .4); z-index: 30; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px 4px; position: sticky; top: 0; background: var(--bg); z-index: 20; }
  .topbar h1 { font-size: 1.2rem; }
  .content { padding: 10px 16px 96px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .card { padding: 16px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 25; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; color: var(--muted); background: none; border: 0; font: inherit; font-size: 11px; position: relative; cursor: pointer; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .count { position: absolute; top: 3px; left: 54%; margin: 0; font-size: 10px; min-width: 16px; height: 16px; }
  .tabbar .i { width: 22px; height: 22px; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .chat.has-channel .chat-list { display: none; }
  .chat:not(.has-channel) .chat-main { display: none; }
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-ev { font-size: 10px; padding: 1px 3px; }
  .hide-sm { display: none !important; }
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; }
  .table.stack-sm td.num { justify-content: space-between; }
}

/* ---------- Druck */
@media print {
  .sidebar, .topbar-actions, .tabbar, .menu-btn, .filters, .form-actions, .no-print, .pager, .tabs { display: none !important; }
  body, .main, .content { background: #fff; padding: 0; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .app { display: block; }
}

/* ---------- Glocke */
.bell { position: relative; order: 99; }
.bell .count { position: absolute; top: 1px; right: 0; margin: 0; font-size: 10px; min-width: 16px; height: 16px; }
.bell .count[hidden] { display: none; }

/* Grid-Kinder dürfen schrumpfen (verhindert seitliches Scrollen auf dem Handy) */
.grid > *, .form-grid > *, .stats > * { min-width: 0; }
.card { max-width: 100%; }
@media (max-width: 860px) {
  .content [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .content > * { max-width: 100%; }
}

/* ---------- Passwort-Auge */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: var(--surface-2); outline: none; }
input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }

/* ---------- Hell/Dunkel-Umschalter */
.theme-toggle { order: 98; }
.theme-float { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 30; }

/* ---------- Einrichtungs-Checkliste */
.setup-card h2 { display: flex; align-items: center; gap: 8px; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.setup-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; min-height: 58px; }
.setup-list a:hover { border-color: var(--brand); }
.setup-list small { display: block; color: var(--muted); font-size: 12.5px; }
.setup-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.setup-list .done .setup-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.setup-list .done .setup-check .i { width: 14px; height: 14px; stroke-width: 3; }
.setup-list .done b { color: var(--muted); text-decoration: line-through; }

/* ---------- Vereinskontor-Bildmarke */
.brand-logo { flex: none; display: block; border-radius: 9px; }
.vk-credit { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; text-decoration: none; }
.vk-credit svg { border-radius: 4px; }
.vk-wordmark { font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.vk-wordmark span { color: var(--brand); }
