:root {
  --bg: #f5ede0;
  --surface: #fdf8f2;
  --border: #dfc9aa;
  --primary: #b07030;
  --primary-dk: #8a5520;
  --text: #2c1a08;
  --muted: #8a7060;
  --green: #3d7a48;
  --red: #c23b22;
  --amber: #b87010;
  --gray: #7a6a58;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(80,40,10,.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font: 15px/1.55 system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* ── Header ── */
header {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: .7rem 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.birthday-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  line-height: 1.4;
  text-align: center;
  padding-top: .3rem;
  border-top: 1px solid rgba(255,255,255,.2);
}
.bday-today { font-size: .88rem; color: #fff; font-weight: 600; }
.bday-today strong { font-weight: 700; }
.bday-soon  { font-size: .78rem; color: rgba(255,255,255,.78); }
header h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; margin: 0; }
.verein-subtitle { font-size: .72rem; opacity: .75; margin: .1rem 0 0; }
.sync-info { font-size: .72rem; opacity: .65; flex: 1; text-align: center; }
.role-sw { display: flex; align-items: center; gap: .5rem; }
.offene-auftraege-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 .65rem;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  transition: background .15s;
}
.offene-auftraege-badge:hover { background: rgba(255,255,255,.18); }
.offene-auftraege-badge .oab-icon { font-size: 1.35rem; line-height: 1; filter: grayscale(1) brightness(1.8); opacity: .55; }
.offene-auftraege-badge.hat-offene .oab-icon { filter: none; opacity: 1; }
.offene-auftraege-badge .oab-count { line-height: 1; }
.role-btn {
  padding: .3rem .85rem;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,.4);
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-size: .84rem;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.role-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.7); }
.role-btn.active { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; }

/* ── Layout ── */
.layout { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.layout > nav {
  width: 190px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  overflow-y: auto;
}
.nav-group {
  padding: .6rem 1.2rem .15rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-top: .4rem;
  border-top: 1px solid var(--border);
}
.nav-group:first-child { margin-top: 0; border-top: none; }
.layout > nav a {
  display: block;
  padding: .6rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.layout > nav a:hover { background: var(--bg); color: var(--primary); }
.layout > nav a.active { border-left-color: var(--primary); color: var(--primary); background: var(--bg); font-weight: 600; }
main { flex: 1; padding: 1.5rem; overflow-x: auto; overflow-y: auto; min-width: 0; }

/* ── Headings ── */
h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: .95rem; font-weight: 700; }

/* ── Cards ── */
.cards { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  flex: 1;
  min-width: 130px;
  box-shadow: var(--shadow);
}
.card .label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card .value { font-size: 1.65rem; font-weight: 700; margin-top: .15rem; }
.card.green .value { color: var(--green); }
.card.red   .value { color: var(--red);   }
.card.amber .value { color: var(--amber); }
.card.gray  .value { color: var(--gray);  }

/* ── Dashboard-Schnellaktionen: Kachel-Reihe (Mitgliedsbeitrag/Abrechnung/
   Direktbuchung) im selben visuellen Stil wie die Kennzahlen-Kacheln oben.
   <button> und <summary> teilen sich .quick-action-card, damit eine Aktion
   sofort einen Dialog öffnen (Button) oder ein Formular aufklappen kann
   (details/summary) und trotzdem identisch aussieht. Ein geöffnetes <details>
   bekommt flex-basis:100% und rutscht dadurch auf eine eigene Zeile, die
   übrigen Kacheln bleiben kompakt daneben/darüber stehen. ── */
.quick-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  box-shadow: var(--shadow);
  flex: 1 1 200px;
  min-width: 180px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: box-shadow .15s, transform .1s;
}
.quick-action-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.14); transform: translateY(-1px); }
.quick-action-icon  { font-size: 1.4rem; line-height: 1; }
.quick-action-title { font-weight: 700; color: var(--primary); font-size: .95rem; }
.quick-action-desc  { font-size: .78rem; color: var(--muted); }

.quick-action-details { flex: 1 1 200px; }
.quick-action-details[open] { flex: 1 1 100%; }
.quick-action-details summary.quick-action-card { list-style: none; }
.quick-action-details summary.quick-action-card::-webkit-details-marker { display: none; }
.quick-action-details summary.quick-action-card::marker { content: none; }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: .6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input,
.filter-bar select {
  padding: .38rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.filter-bar button {
  padding: .38rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .9rem;
}
.filter-bar button:hover { background: var(--primary-dk); }
.filter-bar a { font-size: .84rem; color: var(--muted); text-decoration: none; }
.filter-bar a:hover { color: var(--red); }

/* ── Table ── */
.tbl-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: .875rem;
}
thead { background: var(--bg); }
th {
  padding: .55rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
td { padding: .5rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdf3e5; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.pos { color: var(--green); }
td.neg { color: var(--red);   }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.green { background: #d0ebda; color: var(--green); }
.badge.red   { background: #fde5de; color: var(--red);   }
.badge.amber { background: #fdebd0; color: var(--amber); }
.badge.gray  { background: #ede3d5; color: var(--gray);  }
.badge.blue  { background: #f0ddc2; color: var(--primary); }

/* ── AG grid ── */
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.ag-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.ag-card h3 { color: var(--primary); margin-bottom: .3rem; }
.ag-card .count { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.ag-card ul { list-style: none; font-size: .82rem; }
.ag-card ul li { padding: .18rem 0; border-bottom: 1px solid var(--bg); }
.ag-card ul li:last-child { border-bottom: none; }

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0;
}
.tab-link {
  padding: .5rem 1.2rem;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Detail view ── */
.detail-breadcrumb { margin-bottom: .75rem; font-size: .85rem; }
.detail-breadcrumb a { color: var(--muted); text-decoration: none; }
.detail-breadcrumb a:hover { color: var(--primary); }
.detail-id { font-size: .75rem; font-weight: 400; color: var(--muted); margin-left: .5rem; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}
.detail-section h3 { color: var(--primary); margin-bottom: .6rem; font-size: .88rem; text-transform: uppercase; letter-spacing: .05em; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .875rem; }
dt { color: var(--muted); white-space: nowrap; padding: .15rem 0; }
dd { padding: .15rem 0; word-break: break-word; }
.notizen-text {
  font: inherit;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: .875rem;
  line-height: 1.6;
}

/* ── Clickable table rows ── */
tr[onclick] { cursor: pointer; }

/* ── Toggle ── */
.toggle-btn {
  padding: .3rem .85rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  font-size: .84rem;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.toggle-btn:hover { border-color: var(--primary); color: var(--primary); }
.toggle-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* ── Clickable cards ── */
a.card { text-decoration: none; color: inherit; transition: box-shadow .15s, transform .1s; }
a.card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.14); transform: translateY(-1px); }
a.card.selected { border-color: var(--primary); border-width: 2px; }

/* ── Admin placeholder ── */
.admin-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* ── Login page ── */
body.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; height: auto; overflow-y: auto; }
.login-wrap { width: 100%; max-width: 380px; padding: 1rem; margin: auto; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  box-shadow: 0 4px 20px rgba(80,40,10,.12);
}

/* ── Erstattungsantrag (antrag.php): auf Smartphone reicht die 380px-Karte
   von .login-wrap, auf Desktop bleibt sonst massig Platz ungenutzt, obwohl
   das Formular (Belege, Kontodaten) deutlich mehr Breite vertragen kann. ── */
.login-wrap-wide { max-width: 640px; }
.login-card-wide { width: 100%; }
@media (min-width: 860px) {
  .login-wrap-wide { max-width: 920px; }
  .beleg-grid { grid-template-columns: 1fr 1fr 2fr; }
  .beleg-grid .form-group.full { grid-column: auto; }
}
.login-title { font-size: 1.2rem; font-weight: 700; text-align: center; margin-bottom: .2rem; }
.login-subtitle { font-size: .82rem; color: var(--muted); text-align: center; margin-bottom: 1.5rem; }

/* ── Forms ── */
.form-group { margin-bottom: .85rem; min-width: 0; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: .4rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.form-group textarea { resize: vertical; min-height: 4.5rem; line-height: 1.5; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group input.invalid { border-color: var(--red); }
.form-group input.valid   { border-color: var(--green); }
.field-hint { font-size: .74rem; margin-top: .25rem; min-height: 1em; }
.field-hint.ok  { color: var(--green); }
.field-hint.bad { color: var(--red); }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; }

/* ── Segmented control (z. B. Auszahlung an) ── */
.segmented-control { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .5rem;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  transition: background .15s, color .15s;
}
.segmented-option + .segmented-option { border-left: 1px solid var(--border); }
.segmented-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented-option.active,
.segmented-option:has(input:checked) { background: var(--primary); color: #fff; }
.segmented-option:has(input:focus-visible) { outline: 2px solid var(--primary-dk); outline-offset: -2px; }

/* ── Checkbox-Zeile mit Fließtext ── */
.checkbox-label { display: flex; align-items: flex-start; gap: .55rem; font-size: .85rem; font-weight: 400; color: var(--text); cursor: pointer; }
.checkbox-label input { width: auto; margin-top: .2rem; flex-shrink: 0; }

/* ── Beleg-Zeilen (Erstattungsantrag) ── */
.beleg-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: .9rem 2.5rem .5rem 1rem;
  margin-bottom: .75rem;
}
.beleg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .7rem; }
.beleg-grid .form-group.full { grid-column: 1 / -1; }
.beleg-entfernen {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
}
.beleg-entfernen:hover { background: var(--red); color: #fff; border-color: var(--red); }
@media (max-width: 420px) {
  .beleg-grid { grid-template-columns: 1fr; }
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
}
.form-card h3 { margin-bottom: .9rem; color: var(--primary); font-size: .88rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Buttons ── */
.btn-primary {
  padding: .42rem 1.1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--primary-dk); }
.btn-primary.btn-full { display: block; width: 100%; }
.btn-primary:disabled, .btn-secondary:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.btn-primary:disabled:hover { background: var(--primary); }
.btn-secondary:disabled:hover { border-color: var(--border); color: var(--muted); }
.btn-secondary {
  padding: .42rem 1.1rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm {
  display: inline-block;
  padding: .18rem .6rem;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.btn-sm:hover { background: var(--primary); color: #fff; }
.btn-sm.danger  { border-color: var(--red);   color: var(--red);   }
.btn-sm.danger:hover  { background: var(--red);   color: #fff; }
.btn-sm.success { border-color: var(--green); color: var(--green); }
.btn-sm.success:hover { background: var(--green); color: #fff; }

/* ── Ladezustand beim Absenden (form_loading.js) ── */
body.is-busy, body.is-busy * { cursor: wait !important; }
button.is-loading, input[type=submit].is-loading {
  opacity: .65;
  pointer-events: none;
}
.btn-spinner {
  display: inline-block;
  width: .8em;
  height: .8em;
  margin-right: .4em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--primary); color: #fff; }
.icon-btn.danger { border-color: var(--red); color: var(--red); }
.icon-btn.danger:hover { background: var(--red); color: #fff; }

/* ── Haushaltsplan: Inline-Bearbeitung der Plan-Spalte ── */
.plan-inline-form { display: inline-flex; gap: .35rem; align-items: center; justify-content: flex-end; }
.plan-inline-form input[type="text"] { padding: .15rem .4rem; font-size: .85rem; }

/* ── Profile button (header) ── */
.profile-btn {
  background: transparent;
  border: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline dotted rgba(255,255,255,.5);
  text-underline-offset: 3px;
}
.profile-btn:hover { text-decoration-color: #fff; }

/* ── Profile flash bar ── */
.profile-flash {
  text-align: center;
  padding: .45rem 1rem;
  font-size: .875rem;
  font-weight: 500;
}
.profile-flash-success { background: #d0ebda; color: var(--green); }
.profile-flash-error   { background: #fde5de; color: var(--red);   }

/* ── Profile dialog ── */
.profile-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: min(380px, 92vw);
  background: var(--surface);
  color: var(--text);
}
.profile-dialog::backdrop { background: rgba(0,0,0,.35); }
.profile-dialog h3 { color: var(--primary); font-size: .88rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.profile-dialog-actions { display: flex; gap: .6rem; margin-top: 1.1rem; }
.form-hint { font-weight: 400; color: var(--muted); }

/* ── Copy buttons ── */
.copy-addr-btn, .copy-email-btn {
  display: inline-flex;
  align-items: center;
  padding: .1rem .25rem;
  margin-left: .4rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  transition: color .15s, border-color .15s, background .15s;
}
.copy-addr-btn:hover, .copy-email-btn:hover { color: var(--primary); border-color: var(--primary); }
.copy-addr-btn.copied, .copy-email-btn.copied { color: var(--green); border-color: var(--green); background: #d0ebda; }

/* ── Alerts ── */
.alert { padding: .6rem .9rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; }
.alert-success { background: #d0ebda; color: var(--green); border: 1px solid #a8d9b8; }
.alert-error   { background: #fde5de; color: var(--red);   border: 1px solid #f9c9c0; }
.alert-info    { background: #fef9e7; color: #7d6a00;      border: 1px solid #f0dc82; }
.alert-warning { background: #fdf0d5; color: #92400e;      border: 1px solid #f3ce8a; font-weight: 600; }

/* ── User info in header ── */
.user-info { font-size: .84rem; opacity: .9; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-role { font-size: .7rem; opacity: .7; }

/* ── Export-Leiste ── */
.export-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-bottom: .75rem;
    font-size: .83rem;
}
.export-bar .export-label { color: var(--muted); }
.export-bar .export-group { display: flex; align-items: center; gap: .3rem; }
.export-bar .export-sep   { color: var(--border); }
.export-bar .export-checkbox { display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.export-btn {
    display: inline-block;
    padding: .15rem .55rem;
    border: 1px solid var(--border, #ccc);
    border-radius: .25rem;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}
.export-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.export-btn.copied { background: var(--green); color: #fff; border-color: var(--green); }
button.export-btn { cursor: pointer; font: inherit; font-weight: 600; }

/* ── Jahr-Navigation ── */
.year-nav { display:flex; align-items:center; gap:.6rem; }
.year-label { font-size:1.25rem; font-weight:700; min-width:4rem; text-align:center; }
.year-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:2rem; height:2rem; border-radius:.3rem;
  border:1px solid var(--border); background:var(--surface);
  font-size:1rem; text-decoration:none; color:var(--text);
}
.year-btn:not(.disabled):hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.year-btn.disabled { opacity:.3; cursor:default; }
header .year-nav { flex:1; justify-content:center; }
header .year-label { color:#fff; }
header .year-btn { background:rgba(255,255,255,.15); color:#fff; border-color:rgba(255,255,255,.35); }
header .year-btn:not(.disabled):hover { background:#fff; color:var(--primary); border-color:#fff; }
header .year-btn.disabled { opacity:.25; }

/* ── Kontoumsätze ── */
.ku-wrap { display: flex; align-items: stretch; min-height: 60vh; }
.ku-left { width: 230px; flex-shrink: 0; border-right: 1px solid var(--border); }
.ku-list-header { background: var(--primary); color: #fff; padding: .4rem .75rem; font-weight: 600; font-size: .9rem; }
.ku-list { list-style: none; overflow-y: auto; max-height: 70vh; }
.ku-list li a { display: block; padding: .3rem .75rem; text-decoration: none; color: var(--text); font-size: .88rem; border-bottom: 1px solid var(--border); }
.ku-list li.active a { background: var(--primary); color: #fff; font-weight: 600; }
.ku-list li:not(.active) a:hover { background: var(--bg); }
.ku-right { flex: 1; padding: 1rem 1.25rem; min-width: 0; }
.ku-title { text-align: center; font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; }
.ku-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ku-table-box { border: 1px solid var(--border); overflow: auto; max-height: 60vh; }
.ku-table-box table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ku-table-box th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ku-trunc { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ku-date { white-space: nowrap; }
.ku-footer { display: flex; justify-content: space-between; margin-top: .75rem; gap: 1rem; }
.ku-footer-item { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.ku-footer-label { font-weight: 600; }
.ku-footer-val { border: 1px solid var(--border); background: var(--surface); padding: .25rem .6rem; min-width: 100px; text-align: right; font-family: monospace; font-size: .95rem; }

/* ── Misc ── */
.hint { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }
.empty { text-align: center; padding: 2.5rem; color: var(--muted); font-style: italic; }
.section-gap { margin-top: 2rem; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Beleg-Scan-Modal (Zuschnitt & Kontrastverbesserung fotografierter Belege) ── */
.scan-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(44,26,8,.6); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.scan-modal[hidden] { display: none; }
.scan-modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.scan-modal-content h4 { margin: 0 0 .75rem; font-size: 1rem; }
.scan-canvas-wrap { display: flex; justify-content: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; touch-action: none; }
.scan-canvas-inner { position: relative; display: inline-block; line-height: 0; }
.scan-canvas-wrap canvas { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.scan-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.scan-handle { position: absolute; width: 28px; height: 28px; margin-left: -14px; margin-top: -14px; border-radius: 50%; background: #f97316; border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(44,26,8,.4); cursor: grab; touch-action: none; pointer-events: auto; }
.scan-handle:active { cursor: grabbing; }
.scan-modal-status { margin: .75rem 0; font-size: .82rem; color: var(--muted); min-height: 1.1em; }
.scan-modal-warning { margin: 0 0 .75rem; padding: .5rem .65rem; background: rgba(184,112,16,.12); border: 1px solid var(--amber); border-radius: var(--radius); color: var(--amber); font-size: .82rem; }
.scan-modal-warning[hidden] { display: none; }
.scan-modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 600px) {
  .scan-modal-actions { flex-direction: column; }
  .scan-modal-actions button { width: 100%; }
}

/* ── Mail-Vorlagen-Editor: Platzhalter-Chips (Drag&Drop-Palette) ── */
.platzhalter-palette { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.platzhalter-chip {
  display: inline-flex;
  align-items: center;
  padding: .25rem .55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: monospace;
  font-size: .8rem;
  color: var(--primary-dk);
  cursor: grab;
  user-select: none;
}
.platzhalter-chip:hover { border-color: var(--primary); background: var(--surface); }
.platzhalter-chip:active { cursor: grabbing; }
textarea.platzhalter-dropzone { font-family: monospace; font-size: .85rem; }
.mailtemplate-variant { margin-bottom: .6rem; }
.mailtemplate-variant textarea { display: block; width: 100%; margin-bottom: .3rem; }

/* ── Kontoumsätze/Buchungen: klickbare Zeile -> Buchungsdetail-Dialog inkl. Beleg-Bildern ── */
tr.ku-row, tr.bu-row { cursor: pointer; }
.ku-detail-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: min(560px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
}
.ku-detail-dialog::backdrop { background: rgba(0,0,0,.35); }
.ku-detail-dialog h3 { color: var(--primary); font-size: .88rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.ku-detail-belege { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.ku-detail-belege img { display: block; max-width: 160px; max-height: 160px; border: 1px solid var(--border); border-radius: var(--radius); object-fit: cover; }

/* ── AG-Zusatzbeitrag-Dialog ── */
.zb-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: min(480px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
}
.zb-dialog::backdrop { background: rgba(0,0,0,.35); }
.zb-dialog h3 { color: var(--primary); font-size: .88rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.zb-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-bottom: 1rem; }
.zb-table th { text-align: left; padding: .5rem .6rem; background: var(--bg); border-bottom: 2px solid var(--border); font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .03em; }
.zb-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.zb-table tbody tr:last-child td { border-bottom: none; }
.zb-table tbody tr:hover { background: var(--bg); }
.zb-table td.num, .zb-table th.num { text-align: right; font-family: monospace; }
.zb-table td.zb-actions { text-align: right; white-space: nowrap; }
.zb-add-form { padding-top: .75rem; border-top: 1px solid var(--border); }

/* ── Beiträge-Tab (Mitglieder-Detail): Summenbox links, Buchungstabelle rechts ── */
.beitraege-layout { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.beitraege-summary { flex: 0 0 300px; }
.beitraege-tabelle { flex: 1 1 420px; min-width: 320px; }
tr.beitrag-row { cursor: pointer; }

/* ── Einnahme/Ausgabe-Hinweis bei der Soll-/Haben-Konto-Auswahl ──
   Barrierefreiheit: Farbe (Rot/Grün) ist nie das einzige Unterscheidungs-
   merkmal. Zusätzlich: Icon mit klar verschiedener geometrischer Form
   (Dreieck hoch/runter, Raute, Kreis) + ausgeschriebener Text + Rahmen. ── */
.konto-richtung-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  font-weight: 700;
  font-size: .85rem;
}
.konto-richtung-icon { font-size: 1rem; line-height: 1; }
.konto-richtung-einnahme  { background: rgba(61,122,72,.15);  color: var(--green); }
.konto-richtung-ausgabe   { background: rgba(194,59,34,.15);  color: var(--red); }
.konto-richtung-umbuchung { background: rgba(184,112,16,.15); color: var(--amber); }
.konto-richtung-sonstige  { background: var(--bg); color: var(--muted); }

/* ── Verwendungszweck-Vorschlag beim Verbuchen (Abrechnungen) ── */
.verwendungszweck-preview { display: flex; align-items: center; gap: .5rem; }
.verwendungszweck-preview code { flex: 1; padding: .45rem .6rem; word-break: break-word; }

/* ── Dashboard Detail/Liste-Umschalter (Abrechnungen/Freigaben) ── */
.dashboard-view-toggle { max-width: 280px; margin-bottom: 1rem; }
#abrListeTable th.sortable, #buListeTable th.sortable { cursor: pointer; user-select: none; }
#abrListeTable th.sortable:hover, #buListeTable th.sortable:hover { color: var(--primary); }
#abrListeTable th.sort-asc::after, #buListeTable th.sort-asc::after  { content: " ▲"; font-size: .7em; }
#abrListeTable th.sort-desc::after, #buListeTable th.sort-desc::after { content: " ▼"; font-size: .7em; }
#buListeTable td:first-child, #buListeTable th:first-child { white-space: nowrap; }
#abrListeTable tbody tr { cursor: pointer; }

/* ── Beleg-Datei-Vorschau (Thumbnail/PDF-Link unter dem Datei-Feld) ── */
.beleg-preview { display: block; margin-top: .4rem; }
.beleg-preview-image img { display: block; max-width: 160px; max-height: 160px; border: 1px solid var(--border); border-radius: var(--radius); object-fit: cover; }
.beleg-preview-pdf { display: inline-block; font-size: .82rem; color: var(--primary); text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem .6rem; background: var(--surface); }
.beleg-preview-pdf:hover { border-color: var(--primary); color: var(--primary-dk); }
code { font-size: .82rem; background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }

/* ── Abrechnungen: Detailansicht ── */
.abr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding-bottom: .8rem; margin-bottom: .9rem; border-bottom: 1px solid var(--border); }
.abr-title { margin: 0; font-size: 1.15rem; color: var(--text); }
.abr-sub { margin: .15rem 0 0; font-size: .85rem; color: var(--muted); }
.abr-head-sum { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.abr-betrag { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.abr-label { margin: 1rem 0 .4rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.abr-zweck { margin: 0 0 .4rem; }
.abr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; padding-top: .2rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.abr-iban { letter-spacing: .02em; }
.abr-copy { border: 1px solid var(--border); background: transparent; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: .8rem; line-height: 1; padding: .12rem .35rem; margin-left: .3rem; }
.abr-copy:hover { color: var(--primary); border-color: var(--primary); }
.abr-fehlt { color: var(--red); font-weight: 600; }
.abr-leer { color: var(--muted); font-style: italic; }
.abr-icon { vertical-align: -3px; margin-right: .2rem; }

.abr-papier { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1rem; flex-wrap: wrap; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: .7rem 1rem; margin: 1rem 0 .2rem; }
.abr-papier.ausstehend { background: #fdf1dc; border-color: #ecc98a; border-left-color: var(--amber); }
.abr-papier.erhalten { background: #e8f4ec; border-color: #b9dcc4; border-left-color: var(--green); }
.abr-papier-status { display: flex; flex-direction: column; gap: .1rem; }
.abr-papier-status .hint { margin: 0; }
.abr-papier-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.btn-sm.success.solid { background: var(--green); color: #fff; }
.btn-sm.success.solid:hover { background: #2f6039; border-color: #2f6039; }

.abr-positionen { width: 100%; border-collapse: collapse; }
.abr-positionen th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.abr-positionen th.num { text-align: right; }
.abr-positionen tbody tr:nth-child(even) { background: rgba(176,112,48,.05); }
.abr-positionen td { vertical-align: top; }
.abr-pos-sub { font-size: .8rem; color: var(--muted); }
.abr-positionen tfoot td { border-top: 2px solid var(--border); padding-top: .5rem; }
.abr-summe-label { text-align: right; font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; color: var(--muted); }

@media (max-width: 600px) {
  .abr-grid { grid-template-columns: 1fr; }
  .abr-head-sum { align-items: flex-start; }
  .abr-positionen thead { display: none; }
  .abr-positionen, .abr-positionen tbody, .abr-positionen tfoot,
  .abr-positionen tr, .abr-positionen td { display: block; }
  .abr-positionen tbody tr { border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem .7rem; margin-bottom: .6rem; }
  .abr-positionen td { display: flex; justify-content: space-between; gap: 1rem; text-align: right; padding: .2rem 0; border: 0; }
  .abr-positionen td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
  .abr-positionen td.num { text-align: right; }
  .abr-positionen tfoot tr { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem .7rem; border-top: 2px solid var(--border); }
  .abr-positionen tfoot td { border: 0; padding: 0; }
  .abr-positionen tfoot td:empty { display: none; }
}
