/* ==========================================================================
   Ahl al-Bayt Verwaltung – Design System (hell & dunkel)
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --bg-2: #eceee9;
  --surface: #ffffff;
  --surface-2: #f8f9f6;
  --surface-hover: #f1f3ee;
  --border: #e1e4dc;
  --border-strong: #cfd4c8;
  --text: #18201a;
  --text-2: #4b564d;
  --text-3: #7a857c;
  --accent: #157a3a;
  --accent-hover: #106530;
  --accent-soft: #e5f3e8;
  --accent-text: #0f5f2c;
  --on-accent: #ffffff;
  --danger: #c0352b;
  --danger-soft: #fbe9e7;
  --danger-text: #9d2a21;
  --warn: #b26a00;
  --warn-soft: #fdf1dc;
  --warn-text: #8a5200;
  --info: #2563a8;
  --info-soft: #e7eef9;
  --info-text: #1d4f87;
  --gold: #a87a12;
  --gold-soft: #f8efd7;
  --shadow-sm: 0 1px 2px rgba(20, 30, 22, .06);
  --shadow: 0 1px 2px rgba(20, 30, 22, .05), 0 4px 16px rgba(20, 30, 22, .06);
  --shadow-lg: 0 10px 40px rgba(20, 30, 22, .16);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --sidebar: #fbfcfa;
  --focus: 0 0 0 3px rgba(21, 122, 58, .25);
  --chart-in: #1f7a44;
  --chart-out: #d9a03f;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1310;
    --bg-2: #131a15;
    --surface: #151c17;
    --surface-2: #19211b;
    --surface-hover: #1e2820;
    --border: #253028;
    --border-strong: #334036;
    --text: #e6ece7;
    --text-2: #a9b5ac;
    --text-3: #76837a;
    --accent: #3cbf6a;
    --accent-hover: #52cc7c;
    --accent-soft: rgba(60, 191, 106, .13);
    --accent-text: #6fd894;
    --on-accent: #06200f;
    --danger: #f06d62;
    --danger-soft: rgba(240, 109, 98, .13);
    --danger-text: #ff9a91;
    --warn: #e2a33a;
    --warn-soft: rgba(226, 163, 58, .14);
    --warn-text: #f3c26e;
    --info: #6aa7ec;
    --info-soft: rgba(106, 167, 236, .14);
    --info-text: #9cc6f5;
    --gold: #d9ad4a;
    --gold-soft: rgba(217, 173, 74, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .5);
    --sidebar: #111713;
    --focus: 0 0 0 3px rgba(60, 191, 106, .3);
    --chart-in: #1b7d43;
    --chart-out: #c2862f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1310;
  --bg-2: #131a15;
  --surface: #151c17;
  --surface-2: #19211b;
  --surface-hover: #1e2820;
  --border: #253028;
  --border-strong: #334036;
  --text: #e6ece7;
  --text-2: #a9b5ac;
  --text-3: #76837a;
  --accent: #3cbf6a;
  --accent-hover: #52cc7c;
  --accent-soft: rgba(60, 191, 106, .13);
  --accent-text: #6fd894;
  --on-accent: #06200f;
  --danger: #f06d62;
  --danger-soft: rgba(240, 109, 98, .13);
  --danger-text: #ff9a91;
  --warn: #e2a33a;
  --warn-soft: rgba(226, 163, 58, .14);
  --warn-text: #f3c26e;
  --info: #6aa7ec;
  --info-soft: rgba(106, 167, 236, .14);
  --info-text: #9cc6f5;
  --gold: #d9ad4a;
  --gold-soft: rgba(217, 173, 74, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .5);
  --sidebar: #111713;
  --focus: 0 0 0 3px rgba(60, 191, 106, .3);
  --chart-in: #1b7d43;
  --chart-out: #c2862f;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 .75em; }
small, .small { font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
svg.i-sm { width: 15px; height: 15px; }
svg.i-lg { width: 22px; height: 22px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- App-Gerüst ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform .22s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; }
.brand img { width: 46px; height: auto; }
.brand-name { font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 520; font-size: 14px;
  text-decoration: none;
}
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a .badge { margin-left: auto; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; display: grid; gap: 10px; }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.userbox .who { min-width: 0; flex: 1; }
.userbox .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .who span { font-size: 11.5px; color: var(--text-3); }

.theme-switch { display: flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.theme-switch button { flex: 1; border: 0; background: transparent; color: var(--text-3); padding: 5px 0; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.theme-switch button:hover { color: var(--text); }
.theme-switch-lg button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 0; font: inherit; font-size: 13.5px; font-weight: 560; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.main { flex: 1; margin-left: 252px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 26px 32px 60px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; margin-bottom: 8px; }
.backlink:hover { color: var(--text); text-decoration: none; }

.scrim { display: none; }

/* ---------- Karten / Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 svg { color: var(--text-3); }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stack { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }

/* ---------- Kennzahlen ---------- */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 520; }
.kpi-label .dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); color: var(--text-2); }
.kpi-label .dot.green { background: var(--accent-soft); color: var(--accent-text); }
.kpi-label .dot.red { background: var(--danger-soft); color: var(--danger-text); }
.kpi-label .dot.blue { background: var(--info-soft); color: var(--info-text); }
.kpi-label .dot.amber { background: var(--warn-soft); color: var(--warn-text); }
.kpi-value { font-size: 25px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi-value .cur { font-size: 13px; font-weight: 560; color: var(--text-3); margin-right: 4px; letter-spacing: 0; }
.kpi-note { font-size: 12.5px; color: var(--text-3); }
a.kpi { color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--border-strong); }

.hero-cash { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); }
.hero-cash .main-val { padding: 24px; border-right: 1px solid var(--border); background: linear-gradient(160deg, var(--accent-soft), transparent 70%); border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.hero-cash .big { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.hero-cash .parts { display: grid; grid-template-columns: repeat(3, 1fr); }
.hero-cash .part { padding: 24px 20px; border-right: 1px solid var(--border); }
.hero-cash .part:last-child { border-right: 0; }
.hero-cash .part .v { font-size: 18px; font-weight: 640; font-variant-numeric: tabular-nums; margin-top: 6px; }

.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- Buttons ---------- */
.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(--border-strong);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 560;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn-soft:hover { background: var(--accent-soft); filter: brightness(.97); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-danger:hover { color: var(--danger-text); background: var(--danger-soft); }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Formulare ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 14px; }
.cq { container-type: inline-size; }
@container (max-width: 560px) {
  .form-grid > [class*="c-"] { grid-column: span 12; }
  .form-grid > .c-2, .form-grid > .c-3 { grid-column: span 6; }
}
.c-12 { grid-column: span 12; } .c-5 { grid-column: span 5; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; } .c-2 { grid-column: span 2; } .c-9 { grid-column: span 9; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 580; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a857c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-money { text-align: right; font-variant-numeric: tabular-nums; }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }
.input-wrap .input { padding-left: 42px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .input { padding-left: 36px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button, .seg label { padding: 5px 12px; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 540; text-decoration: none; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg a:hover, .seg label:hover { color: var(--text); text-decoration: none; }
.seg a.on, .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg label { padding: 0; }
.seg label span { padding: 5px 12px; border-radius: 6px; display: inline-block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .count { font-size: 11.5px; color: var(--text-3); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 580; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { padding: 11px 14px; border-top: 1px solid var(--border-strong); font-weight: 640; background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: 2px; }
.table a.rowlink { color: var(--text); font-weight: 580; }
.table .sub { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.table.compact td, .table.compact th { padding: 8px 12px; }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--radius-lg); }
.empty { text-align: center; padding: 42px 20px; color: var(--text-3); }
.empty svg { width: 34px; height: 34px; margin-bottom: 8px; opacity: .6; }

/* ---------- Status-Pillen ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 580; white-space: nowrap; background: var(--bg-2); color: var(--text-2); line-height: 1.6; }
.pill svg { width: 13px; height: 13px; }
.pill-green { background: var(--accent-soft); color: var(--accent-text); }
.pill-red { background: var(--danger-soft); color: var(--danger-text); }
.pill-amber { background: var(--warn-soft); color: var(--warn-text); }
.pill-blue { background: var(--info-soft); color: var(--info-text); }
.pill-gold { background: var(--gold-soft); color: var(--gold); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 650; display: inline-grid; place-items: center; }
.badge.amber { background: var(--warn); }

/* ---------- Hinweise ---------- */
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); border: 1px solid transparent; font-size: 13.5px; }
.alert svg { margin-top: 1px; }
.alert-success { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info-text); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn-text); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; padding: 0; }

/* ---------- Dialoge ---------- */
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal.narrow { width: min(420px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 16, 12, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.danger-note { display: flex; gap: 10px; color: var(--text-2); font-size: 13.5px; margin-bottom: 14px; }
.danger-note svg { color: var(--danger); flex: none; margin-top: 2px; }

/* ---------- Beitrags-Matrix ---------- */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: 100%; }
.matrix th, .matrix td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.matrix th { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.matrix .name { text-align: left; padding: 6px 12px; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; max-width: 240px; }
.matrix th.name { z-index: 3; background: var(--surface-2); }
.matrix tbody tr:hover td { background: var(--surface-hover); }
.matrix tbody tr:hover td.name { background: var(--surface-hover); }
.cell { vertical-align: middle; display: inline-grid; place-items: center; width: 34px; height: 26px; border-radius: 6px; font-size: 11px; font-weight: 600; border: 0; font-family: inherit; cursor: default; }
button.cell { cursor: pointer; }
.cell.paid { background: var(--accent); color: var(--on-accent); }
.cell.partial { background: var(--warn-soft); color: var(--warn-text); box-shadow: inset 0 0 0 1.5px var(--warn); }
.cell.open { background: var(--danger-soft); color: var(--danger-text); }
.cell.future { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.cell.none { background: transparent; color: var(--text-3); opacity: .55; }
button.cell:hover { filter: brightness(.95); box-shadow: 0 0 0 2px var(--focus); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 18px; height: 14px; }
.month-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.month-strip .m { text-align: center; }
.month-strip .m .cell { width: 100%; height: 34px; display: grid; }
.month-strip .m small { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .bar-in { fill: var(--chart-in); }
.chart .bar-out { fill: var(--chart-out); }
.chart .bar-in:hover, .chart .bar-out:hover { opacity: .85; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .meta { font-size: 12px; color: var(--text-3); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; }

/* ---------- Belege ---------- */
.items-table .input { height: 36px; }
.receipts { display: flex; gap: 10px; flex-wrap: wrap; }
.receipt { position: relative; width: 110px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.receipt a { display: block; height: 90px; }
.receipt img { width: 100%; height: 90px; object-fit: cover; display: block; }
.receipt .pdf { height: 90px; display: grid; place-items: center; color: var(--text-3); font-size: 12px; font-weight: 600; }
.receipt .cap { font-size: 11px; padding: 4px 6px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-2); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 6px; }
.dropzone input { display: none; }
.dropzone .files { margin-top: 8px; font-size: 12.5px; color: var(--accent-text); font-weight: 560; }

/* ---------- Öffentliche Seiten / Login ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.public-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1080px; width: 100%; margin: 0 auto; }
.public-head .brand { padding: 0; }
.public-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 48px; }
.public-foot { text-align: center; padding: 18px; font-size: 12.5px; color: var(--text-3); }
.auth-card { width: min(400px, 100%); padding: 32px 28px; margin-top: 4vh; }
.auth-card .logo { display: block; width: 120px; margin: 0 auto 18px; }
.hero-pub { text-align: center; max-width: 640px; margin: 6vh auto 28px; }
.hero-pub img { width: 180px; margin-bottom: 18px; }
.hero-pub h1 { font-size: 30px; margin-bottom: 10px; }
.join-card { width: min(720px, 100%); }
.amount-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.amount-pick label { cursor: pointer; }
.amount-pick input { position: absolute; opacity: 0; }
.amount-pick span { display: inline-block; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 580; font-variant-numeric: tabular-nums; }
.amount-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.amount-pick input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) { .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .hero-cash { grid-template-columns: 1fr; }
  .hero-cash .main-val { border-right: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; }
  .topbar img { width: 34px; }
  .topbar b { font-size: 14px; }
  .content { padding: 18px 16px 48px; }
  .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: 1fr; }
  .g-2 { grid-template-columns: 1fr; }
  .c-8, .c-7, .c-6, .c-5, .c-4, .c-3, .c-9 { grid-column: span 12; }
  .c-2 { grid-column: span 6; }
  .hero-cash .parts { grid-template-columns: 1fr; }
  .hero-cash .part { border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 20px; }
  .hero-cash .part:last-child { border-bottom: 0; }
  .month-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) {
  .g-4, .g-5 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 22px; }
  h1 { font-size: 20px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .hero-pub h1 { font-size: 24px; }
  .table th, .table td { padding: 9px 10px; }
  .hide-xs { display: none !important; }
}

@media print {
  .sidebar, .topbar, .page-head .actions, .no-print { display: none !important; }
  .main { margin: 0; }
}

/* Marke & Avatar */
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }
.brand-sub { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.avatar { overflow: hidden; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; }
.badge.blue { background: var(--info); }

/* ---------- Mail ---------- */
.mail-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-folders { position: sticky; top: 16px; padding: 12px; }
.mail-folders-head { margin-bottom: 8px; }
.mail-folder-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; font-weight: 520; text-decoration: none; }
.mail-folder-list a:hover { background: var(--surface-hover); color: var(--text); }
.mail-folder-list a.active { background: var(--accent-soft); color: var(--accent-text); }
.mail-folder-list .count { margin-left: auto; font-size: 11.5px; background: var(--info-soft); color: var(--info-text); padding: 0 7px; border-radius: 99px; }
.mail-toolbar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mail-toolbar .check input { margin: 0 6px 0 4px; }
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-list li { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.mail-list li:hover { background: var(--surface-hover); }
.mail-list li input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.mail-list li a { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 0; color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.mail-list li.unread a { color: var(--text); font-weight: 650; }
.mail-list li.unread { box-shadow: inset 3px 0 0 var(--accent); }
.mail-from, .mail-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; font-weight: 500; }
.mail-read-head { padding: 20px; border-bottom: 1px solid var(--border); }
.mail-images-note { padding: 8px 20px; background: var(--info-soft); color: var(--info-text); }
.mail-frame { width: 100%; min-height: 360px; border: 0; display: block; background: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.mail-field { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; }
.mail-field label { font-size: 13px; color: var(--text-2); font-weight: 560; }
@media (max-width: 900px) {
  .mail-layout { grid-template-columns: 1fr; }
  .mail-folders { position: static; }
  .mail-folder-list { display: flex; overflow-x: auto; gap: 4px; }
  .mail-folder-list a { white-space: nowrap; }
  .mail-list li a { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; }
  .mail-from { grid-column: 1; } .mail-meta { grid-column: 2; grid-row: 1; } .mail-subj { grid-column: 1 / -1; font-size: 13px; }
}
.profile-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.code-input { font-size: 24px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; height: 52px; }

/* Programm (Verwaltung) */
.event-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 16px; }
.event-admin { display: flex; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; color: inherit; text-decoration: none; background: var(--surface); transition: border-color .15s; }
.event-admin:hover { border-color: var(--border-strong); text-decoration: none; }
.event-thumb { width: 88px; height: 66px; border-radius: 7px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; color: var(--text-3); flex: none; }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; }
.event-body { min-width: 0; }
.banner-preview { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); display: grid; place-items: center; color: var(--text-3); text-align: center; font-size: 12.5px; }
.banner-preview img { width: 100%; height: 100%; object-fit: cover; }
.msg-unread { border-left: 3px solid var(--accent); }
.settings-nav a { font-size: 12.5px; }
section[id] { scroll-margin-top: 16px; }
.date-chip { width: 44px; flex: none; text-align: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); padding: 4px 0; line-height: 1.1; }
.date-chip b { display: block; font-size: 16px; }
.date-chip span { font-size: 10.5px; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
