/* =====================================================================
   Design-System
   Standard-Farben und -Schriften
   (Dunkelblau #1E225A, Orange #F0871A, Creme #FFF5EA, Sora + Outfit).
   Bewusst ohne Build-Schritt: Diese Datei wird direkt ausgeliefert.
   ===================================================================== */

@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('../fonts/sora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('../fonts/sora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #1E225A;
  --navy-2: #2A2F73;
  --navy-3: #3A4090;
  --navy-soft: #E8E9F3;
  --orange: #F0871A;
  --orange-deep: #D9740A;
  --orange-soft: #FEF3E7;
  --orange-text: #A85F12; /* Orange für Schrift: Kontrast ≥ 4,5:1 auf Weiß und Creme */
  --cream: #FFF5EA;
  --ink: #1B1B24;
  --ink-2: #4B4A57;
  --muted: #6E6C79;
  --line: #E6E1DA;
  --line-2: #F3F0EC;
  --bg: #F7F5F2;
  --card: #FFFFFF;
  --green: #1F9D55;
  --green-soft: #E6F6EC;
  --red: #D23A3A;
  --red-soft: #FDECEC;
  --yellow: #946500;
  --yellow-soft: #FFF4DB;
  --blue: #2D6CDF;
  --blue-soft: #E8F0FD;
  --violet: #7C4DDB;
  --violet-soft: #F1EBFD;
  --pink: #D63F8C;
  --pink-soft: #FCEAF3;
  --teal: #11998E;
  --teal-soft: #E2F5F3;
  --gray-soft: #EFEEEC;

  --radius: 6px;      /* Karten, Fenster, Menüs */
  --radius-sm: 4px;   /* Buttons, Felder, Reiter, Symbolflächen */
  --radius-xs: 3px;   /* Badges, Pillen, Etiketten */
  --shadow: 0 1px 0 rgba(30, 34, 90, .04);
  --shadow-lg: 0 10px 30px -10px rgba(30, 34, 90, .30);
  --font-display: 'Sora', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
  --sidebar-w: 224px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 1.45;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--orange-deep); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.4rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 600; }
h3 { font-size: .93rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ── App-Shell ──────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
  padding: 12px 10px; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 10px; color: #fff; }
.sidebar-brand img { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; }
.sidebar-brand strong { display: block; font-family: var(--font-display); font-size: .86rem; line-height: 1.2; white-space: nowrap; }
.sidebar-brand span { display: block; font-size: .78rem; color: rgba(255,255,255,.6); }
.sidebar-brand:hover { color: #fff; }

.ctx { position: relative; margin: 2px 0 12px; }
.ctx-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-sm);
  color: #fff; font: inherit; text-align: left; cursor: pointer;
}
.ctx-btn:hover { background: rgba(255,255,255,.12); }
.ctx-btn .ctx-label { flex: 1; min-width: 0; }
.ctx-btn small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); }
.ctx-btn b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow-y: auto;
}
.ctx-menu button {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 9px; border: 0; background: none;
  border-radius: var(--radius-sm); font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.ctx-menu button:hover { background: var(--bg); }
.ctx-menu button.is-active { background: var(--orange-soft); }
.ctx-menu .indent { padding-left: 26px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.62); padding: 10px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.82); font-weight: 500; position: relative;
}
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.is-active { background: rgba(255,255,255,.12); color: #fff; }
.nav a.is-active::before {
  content: ''; position: absolute; left: -10px; top: 5px; bottom: 5px; width: 3px; border-radius: 0 2px 2px 0; background: var(--orange);
}
.nav .sub { padding-left: 37px; font-size: .92rem; padding-top: 4px; padding-bottom: 4px; }
.nav .badge { margin-left: auto; }
/* Aufklappbare Gruppen (Finanzen, Einstellungen): öffnen beim Drüberfahren, bleiben offen, wenn ein Unterpunkt aktiv ist */
.nav-group-head { position: relative; }
.nav-group-head a { padding-right: 38px; }
.nav a.is-parent { color: #fff; }
.nav-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: var(--radius-sm);
  background: none; color: rgba(255,255,255,.5); display: grid; place-items: center; cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-toggle svg { transition: transform .2s ease; }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease .3s; }
/* Rand links, damit der orange Balken aktiver Unterpunkte nicht abgeschnitten wird */
.nav-sub > div { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 2px; margin-left: -10px; padding-left: 10px; }
.nav-group.is-open .nav-sub, .nav-group:focus-within .nav-sub { grid-template-rows: 1fr; transition-delay: 0s; }
.nav-group.is-open .nav-toggle svg { transform: rotate(180deg); }
.nav-group.is-open > .nav-group-head .badge { display: none; }
@media (hover: hover) {
  .nav-group:hover .nav-sub { grid-template-rows: 1fr; transition-delay: .06s; }
  .nav-group:hover .nav-toggle svg { transform: rotate(180deg); }
  .nav-group:hover > .nav-group-head .badge { display: none; }
}
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); color: #fff; }
.user-chip:hover { background: rgba(255,255,255,.07); color: #fff; }
.user-chip .avatar { background: var(--orange); color: #fff; }
.user-chip small { display: block; color: rgba(255,255,255,.55); font-size: .78rem; }
.sidebar-foot form button {
  background: none; border: 0; color: rgba(255,255,255,.75); font: inherit; font-size: .85rem; cursor: pointer; padding: 6px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-foot form button:hover { color: #fff; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.content { max-width: 1520px; margin: 0 auto; padding: 18px 24px 48px; }
.topbar { display: none; }
.backdrop { display: none; }

@media (max-width: 960px) {
  .app { flex-direction: column; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; background: var(--navy); color: #fff;
  }
  .topbar img { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(20,22,60,.45); z-index: 35; }
  .content { padding: 14px 12px 40px; }
}

/* ── Seitenkopf ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--navy);
  font: inherit; font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: #d9d4cc; background: #fcfbf9; color: var(--navy); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn-accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-deep); border-color: var(--orange-deep); color: #fff; }
.btn-danger { color: var(--red); border-color: #f3c9c9; background: #fff; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); border-color: #efb3b3; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(30,34,90,.05); border-color: transparent; }
.btn-sm { padding: 3px 8px; font-size: .86rem; border-radius: var(--radius-sm); }
.btn-icon { padding: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); cursor: pointer; }
.link-btn:hover { color: var(--orange-deep); }

/* ── Karten & Layout ────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 14px; }
.card-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.split-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sticky { position: sticky; top: 14px; }
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sticky { position: static; }
}
@media (max-width: 760px) {
  .split-even, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  /* Kurze Kennzahlen (Betrag + eine Zeile) bleiben auf dem Handy zweispaltig */
  .grid-4.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid-4.is-compact .stat { padding: 10px 12px; }
}

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.xs { font-size: .78rem; }
.strong { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-orange { color: var(--orange-text); } .text-yellow { color: var(--yellow); } .text-blue { color: var(--blue); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }

/* ── Kennzahlen ─────────────────────────────────────────────────────── */
.stat { padding: 11px 14px; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--navy); margin-top: 2px; line-height: 1.15; }
.stat-hint { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.stat-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-deep); }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.navy { background: var(--navy-soft); color: var(--navy); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }

.panel-section { padding: 10px 14px; border-top: 1px solid var(--line); }
.panel-section:first-child { border-top: 0; }
.panel-numbers { display: grid; grid-template-columns: 1fr 1fr; text-align: center; gap: 8px; }
.panel-numbers .stat-value { font-size: 1.2rem; }

.bar { display: flex; height: 6px; border-radius: 2px; overflow: hidden; background: var(--line-2); }
.bar > span { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: .87rem; color: var(--ink-2); }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.bg-navy { background: var(--navy); } .bg-orange { background: var(--orange); } .bg-green { background: var(--green); }
.bg-red { background: var(--red); } .bg-blue { background: var(--blue); } .bg-violet { background: var(--violet); }
.bg-teal { background: var(--teal); } .bg-pink { background: var(--pink); } .bg-gray { background: #c9c6c0; } .bg-yellow { background: #E9A91B; }

.progress { height: 6px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 2px; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; width: fit-content; max-width: 100%; padding: 3px; border: 1px solid transparent; margin-bottom: 10px; background: rgba(30,34,90,.05); border-radius: var(--radius-sm); }
.tabs.mb-0, .toolbar .tabs { margin-bottom: 0; } /* sonst sitzt die Leiste neben dem Suchfeld zu hoch */
/* gleiche Höhe wie Eingabefelder (.input: 1px Rand + 6px Innenabstand) */
.tabs a, .tabs button {
  font: inherit; border: 0; background: none; cursor: pointer;
  padding: 3px 12px; border-radius: calc(var(--radius-sm) - 2px); color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s;
}
.tabs a:hover, .tabs button:hover { color: var(--navy); }
.tabs a.is-active, .tabs button.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(30,34,90,.12); }
.tab-count { font-size: .75rem; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--bg); color: var(--muted); line-height: 1.6; }
.tab-count.green { background: var(--green-soft); color: var(--green); }
.tab-count.orange { background: var(--orange-soft); color: var(--orange-text); }
/* Spalten einer hochgeladenen Liste zuordnen (lange Überschriften auf zwei Zeilen kürzen) */
.map-head { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
.map-table td { vertical-align: middle; }
.map-table .select { min-width: 0; }

/* ── Listen ─────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { position: relative; flex: 1 1 200px; min-width: 150px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px !important; background: var(--bg) !important; border-color: transparent !important; }
.search input:focus { background: #fff !important; border-color: var(--navy-3) !important; }

.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-top: 1px solid var(--line-2);
  color: var(--ink); position: relative;
}
.list-row:first-child { border-top: 0; }
a.list-row:hover, .list-row.is-link:hover { background: #fbfaf8; color: var(--ink); }
.list-row .name { font-weight: 500; line-height: 1.3; }
.list-row .meta { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.list-row .end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.list-row .check { display: flex; }

.accordion > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-family: var(--font-display); font-weight: 600; color: var(--navy); }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary .chev { transition: transform .15s; width: 18px; height: 18px; }
.accordion[open] > summary .chev { transform: rotate(90deg); }
.accordion[open] > summary { border-bottom: 1px solid var(--line); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 6px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfbf9;
}
.table td { padding: 6px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf9; }
.table .right { text-align: right; }
/* Beträge und Zahlen nicht umbrechen (sonst steht das „€“ allein in der nächsten Zeile) */
.table td.right, .table th.right { white-space: nowrap; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: #fcfbf9; }
.table a.cell-link { color: var(--ink); font-weight: 500; }
.table a.cell-link:hover { color: var(--orange-deep); }

/* ── Badges, Avatare ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: var(--radius-xs);
  font-size: .75rem; font-weight: 600; line-height: 1.55; white-space: nowrap; background: var(--gray-soft); color: var(--ink-2);
}
.badge svg { width: 12px; height: 12px; }
.badge-orange { background: var(--orange-soft); color: var(--orange-text); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-pink { background: var(--pink-soft); color: var(--pink); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-navy { background: var(--navy-soft); color: var(--navy); }
.badge-gray { background: var(--gray-soft); color: var(--ink-2); }
.badge-solid { background: var(--orange); color: #fff; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.status svg { width: 15px; height: 15px; }

.avatar {
  width: 28px; height: 28px; border-radius: var(--radius-sm); flex-shrink: 0; display: grid; place-items: center;
  font-size: .72rem; font-weight: 600; background: var(--navy-soft); color: var(--navy); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar-sm { width: 22px; height: 22px; font-size: .62rem; }
.avatar-lg { width: 44px; height: 44px; font-size: .95rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar.org { border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.avatar.org img { padding: 3px; }

/* ── Definitionslisten (Detailansichten) ────────────────────────────── */
.props { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.props dt { color: var(--muted); font-size: .92rem; }
.props dd { margin: 0; }
.props dd .muted { font-size: .88rem; }
@media (max-width: 560px) { .props { grid-template-columns: minmax(0, 1fr); gap: 2px; } .props dd { margin-bottom: 10px; } }

/* ── Timeline ───────────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 16px; top: 34px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .ti { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 2px solid var(--line); display: grid; place-items: center; color: var(--navy); background: #fff; flex-shrink: 0; }
.timeline .ti svg { width: 16px; height: 16px; }

/* Gesprächsverlauf (Rückmeldung) */
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread li { max-width: 85%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.thread li.is-own { justify-self: end; background: var(--navy-soft); border-color: transparent; }
.thread li.is-event { max-width: none; justify-self: center; background: none; border: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.thread .meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.thread .text { white-space: pre-line; overflow-wrap: anywhere; }
.feedback-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-photo { position: relative; display: block; width: 88px; height: 88px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.feedback-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feedback-photo-remove { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(20,22,60,.75); color: #fff; cursor: pointer; }
@media (max-width: 640px) { .thread li { max-width: 100%; } }

/* ── Formulare ──────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .82rem; color: var(--muted); }
.field .error, .error { font-size: .84rem; color: var(--red); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, .select {
  width: 100%; padding: 6px 9px; border: 1px solid #DEDAD3; border-radius: var(--radius-sm); background: #fff;
  font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 72px; resize: vertical; }
textarea[data-autogrow] { min-height: 12em; overflow-y: hidden; line-height: 1.55; }
/* Datums-/Zeitfelder: iOS-Safari gibt ihnen eine eigene Mindestbreite und -höhe – sie liefen auf dem Handy über den Rand */
input[type=date], input[type=time], input[type=datetime-local], input[type=month] {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; min-height: 2.75em; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
.field, .form-grid > * { min-width: 0; }
/* iOS zoomt beim Antippen in Felder unter 16px hinein */
@media (max-width: 640px) { .input, .select, .field input, .field select, .field textarea { font-size: 16px; } }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus {
  outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(58,64,144,.12);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.select, .field select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237C7A87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select-sm { padding: 3px 28px 3px 8px; font-size: .86rem; border-radius: var(--radius-sm); width: auto; }
.input-group { display: flex; align-items: stretch; }
.input-group .input, .input-group input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid #DEDAD3; border-left: 0; border-radius: 0 10px 10px 0; background: var(--bg); color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: .93rem; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
.fieldset legend { padding: 0 6px; font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: .95rem; }
.section-title { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: .95rem; margin: 0 0 8px; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 34px; height: 19px; border-radius: 3px; background: #D9D5CE; position: relative; transition: background .15s; flex-shrink: 0; }
.toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 2px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track::after { transform: translateX(15px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--orange); outline-offset: 2px; }

.perm-list { display: flex; flex-direction: column; gap: 2px; }
.perm-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); }
.perm-item:hover { background: var(--bg); }
.perm-item .grow b { display: block; font-weight: 600; }
.perm-item .grow span { font-size: .85rem; color: var(--muted); }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card > span {
  display: flex; flex-direction: column; gap: 1px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; height: 100%;
}
.choice-card span b { font-weight: 600; color: var(--navy); }
.choice-card span small { color: var(--muted); }
.choice-card input:checked + span { border-color: var(--navy); background: var(--navy-soft); }
.choice-card input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ── Meldungen ──────────────────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: .93rem; }
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-soft); color: #13663A; }
.alert-error { background: var(--red-soft); color: #9B2323; }
.alert-info { background: var(--navy-soft); color: var(--navy); }
.alert-warning { background: var(--orange-soft); color: #8A4A07; }
.view-as-bar { position: sticky; top: 8px; z-index: 30; align-items: center; flex-wrap: wrap; border: 1px solid var(--orange); box-shadow: var(--shadow-lg); }
.alert .grow > :last-child { margin-bottom: 0; }
/* Löschfristen auf der Übersicht (partials/retention-notices) */
.retention-list { margin: 0; padding-left: 18px; max-height: 180px; overflow-y: auto; overflow-wrap: anywhere; }
.retention-list li + li { margin-top: 2px; }

/* Einstellungen: Reiter und Übersicht */
.settings-tabs { margin-bottom: 8px; }
.settings-subtabs { margin-bottom: 14px; background: transparent; padding: 0; }
.settings-subtabs a { font-size: .85rem; }
.settings-search { max-width: 420px; margin-bottom: 14px; }
.settings-search input { background: #fff !important; border-color: var(--line) !important; }
.settings-section + .settings-section { margin-top: 16px; }
.settings-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.settings-item:nth-child(odd) { border-right: 1px solid var(--line); }
.settings-item:hover { background: var(--bg); }
.settings-item .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.settings-item .badge { flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
    .settings-list { grid-template-columns: minmax(0, 1fr); }
    .settings-item:nth-child(odd) { border-right: 0; }
    .settings-item { flex-wrap: wrap; row-gap: 6px; }
    .settings-item .grow { flex-basis: calc(100% - 30px); }
    .settings-item .badge { order: 3; max-width: 100%; }
}
.toast-area { position: fixed; right: 14px; bottom: 14px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast-area .alert { box-shadow: var(--shadow-lg); margin: 0; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .empty-icon { width: 42px; height: 42px; margin: 0 auto 8px; border-radius: var(--radius); display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-deep); }
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty h3 { margin-bottom: 4px; }

/* ── Dropdown & Modal ───────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 200px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 9px; border: 0; background: none; border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg); color: var(--ink); }
.dropdown-menu svg { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu .danger svg { color: var(--red); }

.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(20,22,60,.5); }
.modal { width: 100%; max-width: 480px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 1100px; }
.modal-xl .modal-head, .modal-xl .modal-foot { position: sticky; z-index: 2; background: #fff; }
.modal-xl .modal-head { top: 0; }
.modal-xl .modal-foot { bottom: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 14px 16px; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Bulk-Leiste ────────────────────────────────────────────────────── */
.bulkbar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 7px 12px; box-shadow: var(--shadow-lg);
}
.bulkbar .btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,.2); }
.bulkbar .bulk-menu { bottom: calc(100% + 6px); top: auto; min-width: 240px; max-height: 60vh; overflow-y: auto; color: var(--ink); }
.bulkbar .bulk-menu .btn { background: #fff; border-color: #f3c9c9; color: var(--red); }
.bulkbar .bulk-menu .btn:hover { background: var(--red-soft); }
@media (max-width: 640px) {
  .bulkbar .dropdown { position: static; }
  .bulkbar .bulk-menu { left: 0; right: 0; }
}
.bulkbar .dropdown-menu .btn-primary { background: var(--orange); border-color: var(--orange); }
.bulkbar .dropdown-menu .btn-primary:hover { background: var(--orange-deep); }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 3px; justify-content: center; padding: 10px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.pagination a:hover { background: var(--bg); }
.pagination .is-active { background: var(--navy); color: #fff; }
.pagination .is-disabled { color: #c9c6c0; }

/* ── Karten-Kacheln (Sammlungen, Konten, Gliederungen) ──────────────── */
.tile { display: block; padding: 12px 14px; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.tile:hover { border-color: #cfc9c0; color: var(--ink); box-shadow: 0 4px 12px -6px rgba(30,34,90,.25); }
.tile.is-selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.tile-add { display: grid; place-items: center; min-height: 90px; font: inherit; cursor: pointer; border: 1.5px dashed #d9d4cc; background: transparent; box-shadow: none; color: var(--muted); }
.tile-add:hover { border-color: var(--navy); color: var(--navy); }
.tile-add svg { width: 22px; height: 22px; }
.amount { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.in { color: var(--green); }
.amount.out { color: var(--ink); }
.flow { width: 26px; height: 26px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; }
.flow svg { width: 15px; height: 15px; }
.flow.in { background: var(--green-soft); color: var(--green); }
.flow.out { background: var(--red-soft); color: var(--red); }

/* ── Dashboard ──────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 12px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3A4090 0%, var(--navy) 55%, #161945 100%);
}
.hero h1 { color: #fff; font-size: 1.3rem; }
.hero p { color: rgba(255,255,255,.75); margin: 2px 0 0; }
.hero::after {
  content: ''; position: absolute; right: -40px; top: -90px; width: 200px; height: 200px; border-radius: 0; transform: rotate(45deg);
  background: var(--orange); opacity: .16;
}
.hero .hero-logo { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 60px; height: 60px; border-radius: 50%; background: #fff; padding: 4px; z-index: 1; }
@media (max-width: 640px) {
  .hero { padding: 14px; }
  .hero .hero-logo { display: none !important; } /* !important: .verband-mark setzt display mit !important */
  h1, .hero h1 { font-size: 1.35rem; }
  .page-actions { width: 100%; }
  .page-actions > .btn-primary { order: -1; } /* Hauptaktion zuerst */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { white-space: nowrap; flex-shrink: 0; }
  .list-row { padding: 8px 12px; flex-wrap: wrap; }
  /* Mindestbreite für Name und Metazeile: Reicht der Platz nicht, rutscht der rechte Teil in eine eigene Zeile */
  .list-row > .grow { flex: 1 1 160px; }
  .list-row .end { margin-left: auto; flex-wrap: wrap; flex-shrink: 1; min-width: 0; }
  .badge { white-space: normal; }
  .org-tree ul { padding-left: 10px; margin-left: 14px; }
  .org-tree .list-row .end { margin-left: 0; }
  .stat-value { font-size: 1.25rem; }
}

.org-tree { list-style: none; margin: 0; padding: 0; }
.org-tree ul { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); margin-left: 24px; }

/* ── Auth & öffentliche Seiten ──────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(90% 90% at 0% 100%, rgba(240,135,26,.35) 0%, rgba(240,135,26,0) 60%), linear-gradient(160deg, #2A2F73 0%, var(--navy) 50%, #14173F 100%);
}
.auth-art h2 { color: #fff; font-size: 2.1rem; line-height: 1.15; max-width: 440px; font-weight: 700; }
.auth-art p { color: rgba(255,255,255,.75); max-width: 440px; font-size: 1.05rem; }
.auth-art .big-logo { width: 150px; height: 150px; border-radius: 50%; background: #fff; padding: 6px; box-shadow: 0 20px 60px -10px rgba(0,0,0,.4); }
.auth-art .rays { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.auth-mobile-logo { display: none; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-mobile-logo { display: block; width: 76px; height: 76px; margin-bottom: 18px; }
}

/* ── Öffentliche Seiten: gemeinsame Gestaltung („Formularblatt“ auf Briefkopf) ──────────────
   Standardwerte: Navy, Orange, Creme, Sora/Outfit, 6-px-Ecken. Bewusst schlicht:
   keine Verläufe, keine Schatten-Wolken, keine Symbol-Kreise – Linien, Typografie und Nummern gliedern. */
.public { min-height: 100vh; background: var(--cream); --p-line: #E9E1D4; --p-field: #D8D2C7; --p-r: 6px; }
.p-head { background: var(--navy) center / cover no-repeat; color: #fff; padding: 26px 0 92px; }
.p-head__inner { max-width: 760px; margin: 0 auto; padding: 0 16px; } /* gleiche Spalte wie .public-body */
.p-head__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; min-width: 0; }
.p-head__logo { height: 46px; width: 46px; border-radius: 50%; background: #fff; padding: 3px; object-fit: contain; flex-shrink: 0; }
.p-head__logo.is-org { width: auto; max-width: 130px; border-radius: var(--p-r); padding: 4px 8px; }
.p-head__org { margin-left: 4px; font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-head__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 4.4vw, 2.6rem); line-height: 1.12; letter-spacing: -.01em; color: #fff; margin: 0; }
.p-head__sub { margin: 12px 0 0; color: rgba(255, 255, 255, .78); font-size: 1.02rem; }
.public-body { max-width: 760px; margin: -60px auto 0; padding: 0 16px 56px; }
.public-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; }

/* ── Installer ──────────────────────────────────────────────────────── */
.req { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.req li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.req svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* ── Diagramme & Druck ──────────────────────────────────────────────── */
.chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 180px; padding-top: 10px; }
.chart .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bars span { width: 42%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .m { font-size: .72rem; color: var(--muted); }
.hbar { height: 6px; border-radius: 2px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.hbar span { display: block; height: 100%; border-radius: 2px; }

@media print {
  .sidebar, .topbar, .page-actions, .toast-area, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  .split, .split-even { grid-template-columns: 1fr 1fr; }
}

/* ── Nachweise ──────────────────────────────────────────────────────── */
.cert-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cert-card { position: relative; overflow: hidden; padding-bottom: 14px; }
.cert-card .cert-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; display: flex; background: var(--line-2); }
.cert-card .cert-bar span { height: 100%; }
/* Nachweis erfassen: Bearbeiten eines bestehenden Vermerks deutlich vom neuen unterscheiden */
.card.mode-edit { border: 2px solid var(--orange); }
.card.mode-edit > .card-head { background: var(--orange-soft); }
.mode-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mode-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--orange); color: #fff; }
.mode-icon.mode-new { background: var(--navy); }
.list-row.is-current { background: var(--orange-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; }
.status-pill svg { width: 16px; height: 16px; }
.letter { background: #fff; max-width: 800px; margin: 0 auto 24px; padding: 56px 64px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14.5px; line-height: 1.6; }
.letter .letterhead { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--orange); padding-bottom: 14px; margin-bottom: 36px; }
.letter .letterhead img { width: 64px; height: 64px; object-fit: contain; }
.letter .sender-line { font-size: 10.5px; color: var(--muted); border-bottom: 1px solid var(--line); display: inline-block; margin-bottom: 6px; }
.letter .address { min-height: 110px; margin-bottom: 30px; }
.letter .body { white-space: pre-line; }
.letter .signature { margin-top: 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.letter .signature div { border-top: 1px solid var(--ink); padding-top: 4px; font-size: 12px; color: var(--muted); }
@media print {
  .letter { border: 0; border-radius: 0; margin: 0; padding: 0 0 0 0; max-width: none; page-break-after: always; }
  .letter:last-child { page-break-after: auto; }
  @page { margin: 22mm 20mm; }
}

/* ── Auswertungen ───────────────────────────────────────────────────── */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.report-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.report-card:hover { border-color: #d9d4cc; color: var(--ink); box-shadow: 0 8px 24px -14px rgba(30,34,90,.25); }
.report-card strong { font-family: var(--font-display); color: var(--navy); font-size: 1.02rem; }
.report-card.is-selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.report-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-deep); margin-bottom: 6px; }
.report-icon svg { width: 16px; height: 16px; }
.report-check { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--navy); color: #fff; display: grid; place-items: center; }
.report-check svg { width: 15px; height: 15px; }
.report-filters { display: flex; flex-direction: column; gap: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--radius-xs); cursor: pointer; font-weight: 500; color: var(--ink-2); background: #fff; }
.pill span:hover { border-color: #d9d4cc; }
.pill input:checked + span { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }
.pill input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

.table tr.row-head td { font-weight: 600; color: var(--navy); background: transparent; }
.table tr.row-sub td { font-weight: 600; }
.table tr.row-indent td:first-child { padding-left: 32px; }

/* ── Events ─────────────────────────────────────────────────────────── */
.event-card { position: relative; }
.event-card .stretched { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.event-link { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); min-width: 0; }
.event-link .link-btn { flex: 1; min-width: 0; text-align: left; color: var(--muted); }
.hover-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.list-row:hover .hover-actions, .list-row:focus-within .hover-actions { opacity: 1; }
@media (hover: none) { .hover-actions { opacity: 1; } }

/* ── Formular-Baukasten ─────────────────────────────────────────────── */
.fb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .fb-layout { grid-template-columns: minmax(0, 1fr); } .fb-palette { position: static !important; max-height: none !important; } }
.fb-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fb-banner { position: relative; height: 150px; background: linear-gradient(135deg, var(--navy) 0%, #3A4090 60%, var(--orange) 140%); background-size: cover; background-position: center; }
.fb-banner-btn { position: absolute; top: 14px; right: 14px; }
.fb-logo { position: absolute; left: 36px; bottom: -42px; }
.fb-logo .avatar { border: 4px solid #fff; background: #fff; }
.fb-body { padding: 52px 24px 24px; }
.fb-org { font-size: .78rem; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.fb-title { width: 100%; border: 1px dashed transparent; border-radius: var(--radius-sm); font: 700 1.7rem var(--font-display); color: var(--ink); padding: 2px 6px; margin-left: -6px; background: transparent; }
.fb-title:hover, .fb-title:focus { border-color: var(--line); outline: none; background: #fcfbf9; }
.fb-desc { width: 100%; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; color: var(--ink-2); margin: 8px 0 18px; resize: vertical; background: transparent; }
.fb-blocks { display: flex; flex-direction: column; gap: 4px; }
.fb-block { position: relative; padding: 9px 12px 9px 32px; border: 1px dashed transparent; border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.fb-block:hover { border-color: #d9d4cc; }
.fb-block.is-selected { border-color: var(--navy-3); background: #fbfbfe; cursor: default; }
.fb-block.is-fixed { cursor: default; }
.fb-handle { position: absolute; left: 6px; top: 14px; width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); cursor: grab; border-radius: 6px; opacity: 0; transform: rotate(90deg); }
.fb-block:hover .fb-handle, .fb-page .fb-handle { opacity: 1; }
.fb-handle:hover { background: var(--bg); }
.fb-tools { position: absolute; top: 6px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; z-index: 2; background: #fff; border-radius: var(--radius-sm); }
.fb-block:hover .fb-tools, .fb-block.is-selected .fb-tools { opacity: 1; }
/* Touch: Werkzeuge erscheinen nach dem Antippen des Blocks als eigene Zeile über der Beschriftung (verdecken nichts),
   bei nicht ausgewählten Blöcken sind sie unsichtbar und nicht antippbar */
@media (hover: none) {
  .fb-block:not(.is-selected) .fb-tools { visibility: hidden; }
  .fb-block.is-selected .fb-tools { position: static; justify-content: flex-end; margin: -4px -4px 4px; }
  .fb-handle { opacity: 1; }
}
@media (max-width: 640px) {
  .fb-body { padding: 52px 12px 18px; }
  .fb-block { padding-right: 8px; }
  .fb-title { font-size: 1.3rem; }
}
.fb-field .field label, .fb-field > .field > label { pointer-events: none; }
.fb-field input[disabled], .fb-field select[disabled], .fb-field textarea[disabled] { background: #fff; cursor: pointer; pointer-events: none; }
.fb-field .req-star { color: var(--red); margin-left: 2px; }
.fb-heading { font-size: 1.2rem; margin: 6px 0 0; }
.fb-upload { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); }
.fb-upload svg { width: 18px; height: 18px; }
.fb-edit { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--bg); display: flex; flex-direction: column; gap: 12px; cursor: default; }
.fb-drop { height: 4px; border-radius: 4px; background: var(--orange); margin: 2px 0; box-shadow: 0 0 0 3px var(--orange-soft); }
.fb-dropzone { margin-top: 8px; padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.fb-dropzone.is-active { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-deep); }
.fb-dropzone svg { width: 18px; height: 18px; }
.fb-page { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 8px 14px 34px; margin: 10px 0; border-top: 1.5px dashed #cfc9c0; color: var(--muted); }
.fb-page.is-selected { background: var(--bg); border-radius: var(--radius-sm); }
.fb-page-label { flex: 1; cursor: pointer; text-align: center; }
.fb-finish { margin-top: 28px; padding-top: 22px; border-top: 1.5px dashed #cfc9c0; display: flex; flex-direction: column; gap: 14px; }
.fb-palette { position: sticky; top: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 28px); }
.fb-palette-scroll { overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px 10px; }
.fb-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fb-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: .88rem; color: var(--ink); cursor: grab; box-shadow: var(--shadow); text-align: center; }
.fb-item:hover { border-color: var(--navy-3); color: var(--navy); }
.fb-item svg { width: 20px; height: 20px; color: var(--navy); }
.fb-item.is-used { opacity: .45; cursor: not-allowed; box-shadow: none; background: var(--bg); }
.fb-palette-foot { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 14px; }
.settings-nav button { display: flex; gap: 9px; align-items: flex-start; text-align: left; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; color: var(--ink); cursor: pointer; }
.settings-nav button svg { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); flex-shrink: 0; }
.settings-nav button small { display: block; color: var(--muted); font-size: .8rem; }
.settings-nav button:hover { background: rgba(30,34,90,.05); }
.settings-nav button.is-active { background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); }
.settings-nav button.is-active svg { color: var(--orange-deep); }
@media (max-width: 860px) { .settings-layout { grid-template-columns: minmax(0, 1fr); } .settings-nav { position: static; flex-direction: row; overflow-x: auto; } .settings-nav small { display: none !important; } }
details.fieldset > summary::-webkit-details-marker { display: none; }
.fb-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-steps span { flex: 1; min-width: 120px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: .85rem; font-weight: 600; border-bottom: 3px solid var(--line); }
.fb-steps span.is-done { color: var(--navy); border-bottom-color: var(--orange); }
.req-star { color: var(--red); margin-left: 2px; }
.fb-palette .search { flex: none; }

/* ── Öffentliche Formulare: fehlende Pflichtfelder ─────────────────── */
/* !important nötig: die Basis-Regel .field input:not(...) kommt auf Spezifität (0,4,1) */
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--red) !important; background: var(--red-soft) !important; }
.field.has-invalid > label { color: var(--red); }

/* ── Kasse: Kostenstelle & Kategorie (booking-lines) ────────────────── */
.booking-lines { display: flex; flex-direction: column; gap: 8px; }
.bl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.bl-row:has(.bl-amount) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px; }
.bl-cc, .bl-cat { position: relative; min-width: 0; }
.bl-select, .bl-combo {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.bl-select > :first-child { flex: 1; min-width: 0; }
.bl-select svg, .bl-combo svg { color: var(--muted); flex-shrink: 0; }
.bl-select:focus-visible, .bl-combo:focus-within { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.bl-combo { padding: 0 10px 0 0; cursor: text; }
.bl-combo input { border: 0; box-shadow: none; background: transparent; min-height: 30px; }
.bl-combo input:focus { box-shadow: none; }
.bl-combo.is-disabled { background: var(--bg); cursor: not-allowed; }
.bl-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; max-height: min(65vh, 460px); overflow-y: auto; min-width: 240px;
}
.bl-menu > input { margin-bottom: 4px; }
.bl-menu button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px; border: 0; background: none; border-radius: var(--radius-sm); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.bl-menu button:hover { background: var(--bg); }
.bl-menu button svg { width: 15px; height: 15px; color: var(--muted); }
.bl-amount { display: flex; gap: 4px; align-items: center; }
@media (max-width: 640px) {
  .bl-row, .bl-row:has(.bl-amount) { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
}
.sphere-seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.sphere-seg button { display: grid; place-items: center; height: 30px; border: 0; border-left: 1px solid var(--line); background: #fff; color: #b3b0aa; cursor: pointer; }
.sphere-seg button:first-child { border-left: 0; }
.sphere-seg button.is-active { color: var(--orange); background: var(--orange-soft); }
.sphere-seg button svg { width: 20px; height: 20px; }

/* ── Segment-Umschalter (Ausgabebeleg / Einnahmebeleg) ─────────────── */
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg2 label { position: relative; }
.seg2 input { position: absolute; opacity: 0; }
.seg2 span { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg2 input:checked + span { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }
.seg2 input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ── Beleg-Dialog („Beleg prüfen“) ─────────────────────────────────── */
/* Kein overflow:hidden – sonst würde das Kostenstellen-/Kategorien-Menü (.bl-menu)
   am Kartenrand abgeschnitten. Die abgerundeten Ecken übernimmt .rd-preview selbst. */
.receipt-dialog { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.receipt-dialog .rd-preview { background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 520px; border-right: 1px solid var(--line); border-radius: 5px 0 0 5px; }
.receipt-dialog .rd-preview img { width: 100%; height: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow); background: #fff; }
.receipt-dialog .rd-preview iframe { width: 100%; flex: 1; min-height: 560px; border: 0; border-radius: var(--radius-sm); background: #fff; }
.receipt-dialog .rd-form { display: flex; flex-direction: column; }
.receipt-dialog .rd-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.receipt-dialog .rd-head { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.receipt-dialog .rd-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--ink); width: 100%; }
.action-card:hover, .action-card.is-active { border-color: var(--navy); }
.action-card .ac-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; }
.action-card .ac-icon svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .receipt-dialog { grid-template-columns: minmax(0, 1fr); }
  .receipt-dialog .rd-preview { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 5px 5px 0 0; }
  .receipt-dialog .rd-preview iframe { min-height: 420px; }
}

/* ── Zahlung zuordnen ──────────────────────────────────────────────── */
.pay-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; flex-wrap: wrap; }
.pay-head .amount { font-size: 1.15rem; }
.tray { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.tray-plus { width: 76px; height: 96px; border: 1.5px dashed #c9c5bd; border-radius: var(--radius-sm); background: #fff; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.tray-plus:hover { border-color: var(--navy); color: var(--navy); }
.tray-item { width: 150px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.tray-item .thumb { height: 60px; }
.tray-item .rm { position: absolute; top: 4px; right: 4px; }
.tray-item input { padding: 5px 8px; font-size: .88rem; text-align: right; }
.tray-special { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.thumb { width: 44px; height: 54px; border-radius: 6px; border: 1px solid var(--line); background: #fff center / cover no-repeat; display: grid; place-items: center; color: var(--muted); flex-shrink: 0; overflow: hidden; }
.thumb svg { width: 18px; height: 18px; }
.cand-row { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-top: 1px solid var(--line-2); }
.cand-row.is-picked { background: var(--green-soft); }
.cand-row .grow { min-width: 0; }
.menu-sub { position: relative; }
.menu-sub > .dropdown-menu { left: 100%; right: auto; top: -6px; }
@media (max-width: 640px) {
  .cand-row { flex-wrap: wrap; padding: 10px 14px; }
  .menu-sub > .dropdown-menu { left: 12px; top: 100%; }
}
.assign-status { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 500; white-space: nowrap; }
.assign-status svg { width: 15px; height: 15px; }
.assign-status.unassigned { color: var(--muted); }
.assign-status.partial { color: var(--yellow); }
.assign-status.auto, .assign-status.manual { color: var(--green); }
.assign-status.special { color: var(--blue); }

/* ── Dropzone ──────────────────────────────────────────────────────── */
.dropzone { border: 2px dashed #cfcac2; border-radius: var(--radius); padding: 22px 16px; text-align: center; background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.is-over, .dropzone:hover { border-color: var(--navy); background: var(--navy-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--navy); }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; width: 176px; height: 176px; flex-shrink: 0; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.pin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 1.1rem; letter-spacing: .12em; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.dropdown-menu label.menu-item:hover { background: var(--bg); }
.bl-combo input, .bl-combo input:focus { border: 0 !important; box-shadow: none !important; background: transparent !important; }
.tray-item { width: 190px; }
@media (max-width: 640px) {
  .cand-row { gap: 8px 12px; }
  .cand-row > .grow { flex: 1 1 calc(100% - 64px); }
  .cand-row > .amount { margin-left: auto; }
  .tray-item { width: calc(50% - 50px); min-width: 150px; }
}

/* ── Lastschrift-Einzug: Schritte ──────────────────────────────────── */
.debit-step { display: flex; gap: 12px; padding: 11px 14px; align-items: flex-start; }
.debit-step h2 { font-size: 1rem; margin: 2px 0 6px; }
.debit-num { width: 26px; height: 26px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.debit-num svg { width: 17px; height: 17px; }
.debit-step.is-done .debit-num { background: var(--green-soft); color: var(--green); }
.row-link { cursor: pointer; }
.row-link:hover td { background: #FBFAF8; }

/* ── Rechnungen ────────────────────────────────────────────────────── */
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.invoice-preview { position: relative; overflow: hidden; aspect-ratio: 210 / 297; }
.invoice-preview iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.invoice-open { position: absolute; right: 12px; bottom: 12px; }
.inv-items td { vertical-align: top; }
.inv-items .input { padding: 7px 9px; }
.inv-items .right { text-align: right; }
.letterhead-thumb { aspect-ratio: 210 / 297; max-width: 220px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff center / cover no-repeat; box-shadow: var(--shadow); }
@media (max-width: 960px) { .invoice-layout { grid-template-columns: minmax(0, 1fr); } .invoice-preview { aspect-ratio: auto; height: 70vh; } }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.req-star { color: var(--red); }
.tabs a svg, .tabs button svg { width: 16px; height: 16px; flex-shrink: 0; }
.tabs button { white-space: nowrap; }

/* ── Handkassen ────────────────────────────────────────────────────── */
.cash-link { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: inherit; }
.cash-link:hover { background: var(--bg); color: inherit; }
.cash-link .name { font-weight: 600; }
.cash-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.cash-sum > .is-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.count-grid label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); }
.count-grid .input { padding: 6px 8px; }
.tn-row { position: relative; }
/* Aktionen liegen beim Überfahren über der Zeile, statt Platz zu belegen (sonst wird der Name zu schmal) */
.tn-row .hover-actions { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: #fff; padding: 4px 0 4px 10px; box-shadow: -12px 0 12px #fff; pointer-events: none; }
.tn-row:hover .hover-actions, .tn-row:focus-within .hover-actions { pointer-events: auto; }
/* Touch und Handy: Aktionen der Teilnehmenden-Zeile nicht über den Text legen, sondern in die Zeile setzen */
@media (hover: none), (max-width: 640px) {
  .tn-row .hover-actions { position: static; transform: none; box-shadow: none; padding: 0; background: none; pointer-events: auto; opacity: 1; margin-left: auto; }
}
@media (max-width: 640px) {
  /* Name und Metazeile voll, darunter Beitragsstatus und Aktionen, eingerückt auf Höhe des Namens */
  .tn-row > .grow { flex-basis: calc(100% - 40px); }
  .tn-row > .status { min-width: 0 !important; margin-left: 34px; }
  .tn-row .hover-actions { flex: 1 1 100%; padding-left: 34px; }
}

/* Formulare zur Datenerfassung: Feld abfragen – nicht / freiwillig / Pflicht */
.field-mode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.field-mode-row:last-of-type { border-bottom: 0; }
.field-mode-row > div:first-child { flex: 1 1 220px; min-width: 0; }
.mode-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; flex-shrink: 0; }
.mode-seg label { position: relative; cursor: pointer; }
.mode-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-seg span { display: block; padding: 6px 11px; font-size: .8rem; color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; }
.mode-seg label:first-child span { border-left: 0; }
.mode-seg input:checked + span { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.mode-seg input[value="required"]:checked + span { background: var(--orange-soft); color: var(--orange-deep); }
.mode-seg input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: -2px; }

/* ── Erstattungsformular (öffentlich) ──────────────────────────────── */
.claim-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.claim-types label { position: relative; }
.claim-types input { position: absolute; opacity: 0; }
.claim-types span { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; color: var(--ink-2); }
.claim-types span svg { width: 22px; height: 22px; color: var(--orange); margin-bottom: 4px; }
.claim-types strong { color: var(--navy); font-family: var(--font-display); }
.claim-types small { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.claim-types input:checked + span { border-color: var(--navy); background: var(--navy-soft); box-shadow: inset 0 0 0 1px var(--navy); }
.claim-types input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (max-width: 560px) { .claim-types { grid-template-columns: minmax(0, 1fr); } }
.claim-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 14px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.claim-row-sum { text-align: right; font-weight: 600; color: var(--navy); font-size: .9rem; }
.claim-file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px dashed #c9c5bd; border-radius: var(--radius-sm); background: #fff; cursor: pointer; color: var(--muted); font-size: .9rem; min-width: 0; }
.claim-file:hover { border-color: var(--navy); color: var(--navy); }
.claim-file.is-set { border-style: solid; border-color: var(--green); color: var(--ink); }
.claim-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--orange); color: #fff; font-weight: 600; }
.claim-total strong { font-family: var(--font-display); font-size: 1.25rem; }
/* Unterschriftsfeld (alle öffentlichen Formulare): gestrichelter Rahmen, Unterschriftslinie, transparentes PNG */
.sig-pad { position: relative; border: 1.5px dashed #CFC8BC; border-radius: 6px; overflow: hidden;
  background: #fff linear-gradient(to bottom, transparent 138px, #DDD6CA 138px, #DDD6CA 139px, transparent 139px); }
.sig-pad.is-error { border-color: var(--red); border-style: solid; }
.sig-pad canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sig-pad .sig-hint { position: absolute; left: 16px; right: 16px; top: 146px; color: #A8A298; pointer-events: none; font-size: .85rem; }
.sig-pad .sig-clear { position: absolute; top: 8px; right: 8px; }

/* ── IBAN-Hinweis (public/js/inputs.js) ────────────────────────────── */
.iban-hint { display: block; margin-top: 4px; color: var(--muted); min-height: 0; }
.iban-hint:empty { display: none; }
.iban-hint.is-ok { color: var(--green); }
.iban-hint.is-ok::before { content: '✓ '; }
.iban-hint.is-bad { color: var(--red); }
input.is-invalid { border-color: var(--red); }

/* ── Handkasse: Kategorie je Eintrag direkt ändern ─────────────────── */
.entry-cat select { font: inherit; font-size: .78rem; font-weight: 600; color: var(--navy); background: var(--navy-soft); border: 0; border-radius: var(--radius-xs); padding: 3px 26px 3px 10px; cursor: pointer; max-width: 260px;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231E225A' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.entry-cat.is-missing select { color: var(--orange-text); background-color: var(--orange-soft); }
.entry-cat select:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

/* ── eFZ-Einstellungen: Baukasten und Vorschau ─────────────────────── */
.efz-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface, #fff); }
.efz-block .efz-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.efz-block .efz-block-head .grow { font-weight: 600; font-size: .85rem; color: var(--navy); }
.efz-preview { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
.efz-template-list { display: flex; flex-direction: column; }
.efz-template-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.efz-template-item:first-child { border-top: 0; }
.efz-template-item:hover, .efz-template-item:focus-visible { background: var(--bg); }
.efz-template-item b { display: block; }
.efz-template-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--navy-soft); color: var(--navy); }
@media (max-width: 480px) { .efz-template-item .btn { display: none; } }
.efz-preview iframe { width: 100%; height: min(80vh, 900px); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
/* Mail-Vorschau und Platzhalter-Übersicht (Nachweise → E-Mail-Vorlagen, Mail-Knöpfe) */
.mail-preview { white-space: pre-line; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: .92rem; max-height: 340px; overflow: auto; overflow-wrap: anywhere; }
.ph-list { display: flex; flex-direction: column; gap: 4px; }
.ph-item { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; width: 100%; text-align: left; padding: 7px 8px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; font: inherit; color: inherit; }
.ph-item:hover, .ph-item:focus-visible { background: var(--bg); }
.ph-item code { flex-shrink: 0; font-size: .8rem; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--navy-soft); color: var(--navy); white-space: nowrap; }
.ph-label { font-size: .84rem; line-height: 1.35; min-width: 0; }
.ph-example { display: block; font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.efz-signature-img { max-height: 70px; max-width: 240px; background: repeating-conic-gradient(#f1efeb 0% 25%, #fff 0% 50%) 50% / 14px 14px; border-radius: var(--radius-sm); padding: 6px; border: 1px solid var(--line); }


/* ── Öffentliche Formulare: Blatt, Abschnitte, Felder ───────────────────────────────────────── */
.public .card { border: 1px solid var(--p-line); border-radius: 10px; box-shadow: 0 1px 2px rgba(30, 34, 90, .05); }
.public .card-body { padding: 34px 38px; counter-reset: p-sec; }
.public .card-foot { padding: 22px 38px 30px; border-top: 1px solid var(--p-line); align-items: center; }
.public .card-body.stack { gap: 28px; }
@media (max-width: 600px) { .public .card-body { padding: 24px 20px; } .public .card-foot { padding: 18px 20px 24px; } }
.public h2 { font-family: var(--font-display); color: var(--navy); }

/* Abschnitte: Linie + Nummer statt Kasten */
.public .fieldset { border: 0; border-radius: 0; padding: 0; margin: 0; min-width: 0; }
.public .fieldset > legend { padding: 0; margin-bottom: 10px; font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--navy); }
.public .fieldset.p-section { border-top: 1px solid var(--p-line); padding-top: 26px; }
.public .fieldset.p-section > legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; font-size: 1.12rem; }
.public .fieldset.p-section > legend + * { clear: both; }
.public .fieldset.p-section > legend::before { counter-increment: p-sec; content: counter(p-sec, decimal-leading-zero);
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--orange); }
.public .p-subbox { border: 1px solid var(--p-line); border-radius: 8px; padding: 18px 20px; background: #FCFAF6; }

/* Felder – wie auf der Website */
.public .field > label, .public .label { font-family: var(--font-display); font-weight: 600; font-size: .88rem; color: var(--navy); }
.public .input, .public .select, .public .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .public .field select, .public .field textarea {
  border: 1.5px solid var(--p-field); border-radius: var(--p-r); padding: 11px 13px; font-size: 1rem; background-color: #fff; box-shadow: none; }
.public .input:focus, .public .select:focus, .public .field input:focus, .public .field select:focus, .public .field textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 135, 26, .16); }
.public .has-error input, .public .has-error select, .public .has-error textarea { border-color: var(--red); }
.public .input-group .addon { border: 1.5px solid var(--p-field); border-left: 0; border-radius: 0 var(--p-r) var(--p-r) 0; }
.public .check input, .public input[type=radio] { accent-color: var(--orange); }
.public .check { align-items: flex-start; line-height: 1.5; }
.public .check input { margin-top: 2px; flex-shrink: 0; }

/* Knöpfe */
.public .btn { border-radius: var(--p-r); }
.public .card-foot .btn-accent, .public .btn-accent.btn-block { font-family: var(--font-display); font-weight: 600; padding: 13px 26px; font-size: 1rem; }

/* Hinweise, Einwilligungen, Summen, Texte */
.public .alert { border-radius: var(--p-r); }
.public .p-consent { padding: 16px 18px; border-left: 3px solid var(--orange); background: var(--cream); border-radius: 0 var(--p-r) var(--p-r) 0; }
.public .p-consent .check { font-size: .98rem; color: var(--ink); }
.public .p-note { padding: 22px 24px; border: 1px solid var(--p-line); border-radius: 8px; background: #FCFAF6; font-size: .93rem; }
.public .p-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 16px 0 0; border-top: 2px solid var(--navy); }
.public .p-total strong, .public .p-total .amount { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--navy); }
.public .p-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--p-field); border-radius: var(--p-r); cursor: pointer; background: #fff; }
.public .p-choice + .p-choice { margin-top: 8px; }
.public .p-choice:has(input:checked) { border-color: var(--orange); background: #FFFBF6; }
.public .p-choice input { margin-top: 3px; flex-shrink: 0; }
.p-prose { line-height: 1.65; }
.p-prose h2 { font-size: 1.12rem; margin: 22px 0 8px; }
.p-prose h3 { font-family: var(--font-display); font-size: .98rem; color: var(--navy); margin: 18px 0 6px; }
.p-prose > :first-child { margin-top: 0; }
.p-prose p { margin: 0 0 10px; }
.p-prose ul { margin: 6px 0 12px; padding-left: 20px; }
.p-prose a { color: var(--orange-deep); }
.public .fb-steps span { border-radius: 0; background: none; border-bottom-width: 2px; padding: 8px 2px; }

/* Abschluss-Seiten */
.p-done { padding: 38px 38px 34px; }
.p-done__kicker { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.p-done__kicker.is-wait { color: var(--orange-text); }
.p-done h2 { font-size: 1.45rem; margin: 0 0 10px; }
.p-done p { color: var(--ink-2); max-width: 520px; }
.p-done__actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) { .p-done { padding: 26px 20px; } }
/* Auswahl-Kacheln (Erstattungsart, Auszahlung) im gleichen Stil wie .p-choice */
.public .claim-types span, .public .seg2 span { border: 1.5px solid var(--p-field); border-radius: var(--p-r); background: #fff; box-shadow: none; }
.public .claim-types input:checked + span, .public .seg2 input:checked + span { border-color: var(--orange); background: #FFFBF6; box-shadow: none; color: var(--navy); }
.public .claim-row { border: 1px solid var(--p-line); border-radius: 8px; background: #FCFAF6; }
.public .claim-file { border-radius: var(--p-r); }
.public .req-star { color: inherit; margin-left: 2px; } /* Pflicht-Sternchen wie in den anderen Formularen */
.public .field > label.check { font-family: var(--font-body); font-weight: 400; font-size: .95rem; color: var(--ink); } /* Einwilligungen sind Text, keine Feldbeschriftung */

/* ── Gefahrenzone (Gliederung löschen) ─────────────────────────────── */
.danger-zone { border-color: #f3c9c9; }

/* ── Rechte: Einsehen / Bearbeiten ─────────────────────────────────── */
.perm-leveled { flex-wrap: wrap; }
.perm-leveled .mode-seg { flex-shrink: 0; }
.perm-sub { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.perm-sub .check { font-weight: 400; }
.ro-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ── Hilfe-Knopf („Diese Seite erklärt“) und Erklärseiten ─────────────── */
/* Desktop: unten rechts in der Seitenleiste neben „Abmelden“, Handy: rechts in der Kopfleiste – so verdeckt er nie Inhalt */
.help-fab {
  position: fixed; left: calc(var(--sidebar-w) - 46px); bottom: 10px; z-index: 60;
  display: inline-flex; align-items: center; gap: 0; height: 36px; padding: 0 4px; border-radius: var(--radius);
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); text-decoration: none;
  transition: gap .2s, padding .2s, background .2s;
}
.help-fab-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--orange); color: #fff; font: 700 1.1rem var(--font-display);
}
.help-fab-label { max-width: 0; overflow: hidden; white-space: nowrap; font-weight: 600; font-size: .9rem; transition: max-width .25s; }
.help-fab:hover, .help-fab:focus-visible { color: #fff; gap: 8px; padding-right: 16px; background: var(--navy-2); }
.help-fab:hover, .help-fab:focus-visible { box-shadow: 0 0 0 1px rgba(255,255,255,.15), var(--shadow-lg); }
.help-fab:hover .help-fab-label, .help-fab:focus-visible .help-fab-label { max-width: 200px; }
@media (max-width: 960px) {
  /* Unter der geöffneten Seitenleiste (z-index 40) und dem Hintergrund (35), über der Kopfleiste (30) */
  .help-fab { left: auto; right: 12px; top: 10px; bottom: auto; z-index: 31; box-shadow: none; }
  .topbar { padding-right: 60px; }
}

.help { max-width: 980px; }
.help h2 { margin: 0 0 8px; }
.help p, .help li { line-height: 1.6; }
.help .help-lead { font-size: 1.1rem; color: var(--ink-2); max-width: 720px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.help-toc a { padding: 3px 9px; border-radius: var(--radius-xs); background: var(--card); border: 1px solid var(--line); font-size: .9rem; color: var(--ink); }
.help-toc a:hover { border-color: var(--orange); }
.help-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.help-step-num { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--navy); color: #fff; font: 700 1.05rem var(--font-display); }
.help-tip { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--cream); border: 1px solid #f6dcbc; font-size: .95rem; }
.help-tip.is-warn { background: var(--yellow-soft); border-color: #f5d9a8; }
.help-tip svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--orange-deep); }
.help-tip > div { flex: 1; min-width: 0; }

/* Screenshot mit nummerierten Markierungen und Pfeilen */
.help-shot { position: relative; margin: 14px 0 6px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--bg); }
.help-shot img { display: block; width: 100%; height: auto; }
.help-shot svg.help-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.help-shot .help-arrows line { stroke: var(--orange); stroke-width: 3; vector-effect: non-scaling-stroke; }
.help-shot .help-arrows polygon { fill: var(--orange); }
.help-shot .help-arrows rect { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.help-shot > .help-pin { pointer-events: none; }
.help-pin {
  position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--orange); color: #fff; font: 700 .9rem var(--font-display);
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(30, 34, 90, .35);
}
.help-legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.help-legend li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.help-legend .help-pin { position: static; transform: none; width: 26px; height: 26px; font-size: .85rem; }
.help-legal { border: 1px solid #c9cde8; border-left: 4px solid var(--navy); border-radius: var(--radius-sm); background: var(--navy-soft); padding: 12px 14px; }
.help-legal-head { display: flex; align-items: center; gap: 8px; color: var(--navy); margin-bottom: 6px; }
.help-legal-body { font-size: .95rem; }
.help-legal-body > :first-child { margin-top: 0; }
.help-legal-body > :last-child { margin-bottom: 0; }
.help-legal-body ul { margin: 6px 0; padding-left: 20px; }
.help-legal-note { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.help-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-index a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); text-decoration: none; }
.help-index a:hover { border-color: var(--orange); }
.help-index a strong { display: block; margin-bottom: 4px; color: var(--navy); }
.help-pot { display: flex; height: 54px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.help-pot > span { display: flex; align-items: center; justify-content: center; padding: 0 6px; color: #fff; font-size: .8rem; font-weight: 600; text-align: center; line-height: 1.2; min-width: 0; }
@media (max-width: 760px) { .help-pin { width: 22px; height: 22px; font-size: .75rem; } .help-pot > span { font-size: .68rem; } }

/* ── Zuschüsse ──────────────────────────────────────────────────────── */
.grant-card { scroll-margin-top: 16px; }
.grant-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.grant-people { display: flex; flex-wrap: wrap; gap: 4px; }
.grant-people span { font-size: .8rem; padding: 2px 7px; border-radius: 3px; background: var(--navy-soft); color: var(--navy); }
.grant-people span.out { background: var(--orange-soft); color: var(--orange-text); }
.grant-people span.lead { background: var(--green-soft); color: var(--green); }
.grant-people span.off { background: var(--line-2); color: var(--muted); }

/* Nur lokal: Hinweis auf den Mail-Fänger (Mailpit) */
.catcher-pill {
  position: fixed; right: 14px; bottom: 14px; z-index: 60; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius); background: var(--orange); color: #fff; font-size: .8rem; font-weight: 600;
  box-shadow: var(--shadow-lg); text-decoration: none;
}
.catcher-pill:hover { color: #fff; filter: brightness(1.05); }

/* Kostenstellen einer Kategorie auswählen (mehrere) */
.cc-pick > summary { cursor: pointer; list-style: none; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-pick > summary::-webkit-details-marker { display: none; }
.cc-pick[open] > summary { border-color: var(--navy); }

/* ── Haushaltsplan ──────────────────────────────────────────────────── */
.budget-table thead th, .budget-table td.num { white-space: nowrap; }
.budget-table .cc-row td { background: #fcfbf9; font-weight: 600; cursor: pointer; border-top: 1px solid var(--line); }
.budget-table .cc-row:hover td { background: var(--bg); }
.budget-table .cc-chevron { transition: transform .15s; color: var(--muted); flex-shrink: 0; }
.budget-table .cc-row.is-open .cc-chevron { transform: rotate(90deg); }
.budget-table .cat-row td:first-child { padding-left: 34px; }
.budget-edit td { vertical-align: middle; }
.budget-edit .input-group { max-width: 150px; margin-left: auto; }
.budget-edit .input-group .input { text-align: right; }
@media (max-width: 640px) { .budget-table .cat-row td:first-child { padding-left: 14px; } }

/* ── Verbandslogo ohne hochgeladenes Bild ───────────────────────────── */
.verband-mark { display: inline-grid !important; place-items: center; border-radius: 50%; background: var(--navy) !important; color: #fff; font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; aspect-ratio: 1; flex-shrink: 0; line-height: 1; padding: 0 !important; font-size: 40%; }
.sidebar-brand .verband-mark, .topbar .verband-mark { width: 34px; height: 34px; font-size: .8rem; background: #fff !important; color: var(--navy); }
.auth-art .verband-mark { font-size: 3rem; background: #fff !important; color: var(--navy); }
.auth-mobile-logo.verband-mark { font-size: 1.6rem; }
.hero .verband-mark { font-size: 1.2rem; background: #fff !important; color: var(--navy); }
.p-head__logo.verband-mark { font-size: 1rem; background: #fff !important; color: var(--navy); }
.feature-list { display: grid; gap: 6px; }
.nav-lock { opacity: .6; margin-left: 2px; }

/* Merch: Artikel im öffentlichen Bestellformular und Artikel-Baukasten */
.merch-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; display: flex; flex-direction: column; gap: 8px; }
.merch-pick { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.merch-pick .field { margin: 0; gap: 2px; min-width: 0; }
.merch-pick .select { min-width: 110px; }
.merch-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.merch-table th, .merch-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.merch-table td.num, .merch-table th.num { text-align: right; white-space: nowrap; }
.merch-thumb { position: relative; width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; }
.merch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.merch-thumb .x { position: absolute; right: 3px; top: 3px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 2px; display: inline-flex; color: var(--red, #B71C1C); }
.merch-thumb.is-removed img { opacity: .3; filter: grayscale(1); }
.merch-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.merch-photos button { padding: 0; border: 0; background: none; flex: 0 0 auto; scroll-snap-align: start; cursor: zoom-in; }
.merch-photos img { height: 140px; width: auto; max-width: 220px; object-fit: cover; border-radius: var(--radius-sm); display: block; border: 1px solid var(--line); }
.merch-lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(15,16,40,.88); display: flex; align-items: center; justify-content: center; padding: 16px; }
.merch-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }

/* Auswahlmöglichkeiten als Liste (<x-option-list>) */
.option-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.option-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.option-row .input { flex: 1; min-width: 0; }
.option-dot { width: 14px; height: 14px; border: 2px solid var(--muted); opacity: .45; border-radius: 50%; flex-shrink: 0; }
.option-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0 4px 22px; color: var(--navy); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.option-add:hover { text-decoration: underline; }
.merch-option { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ── Tabellen als Karten auf dem Handy (<table class="table table-cards">) ──
   Unter 640 px wird jede Zeile ein Block: erste Spalte als Titel, die übrigen als „Überschrift … Wert“.
   Die Überschriften schreibt public/js/tables.js aus dem <thead> in data-label. */
@media (max-width: 640px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tfoot, .table-cards tr { display: block; width: 100%; }
  .table-cards tr { padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards tfoot tr { border-top: 1px solid var(--line); background: #fcfbf9; }
  .table-cards td { display: block; padding: 2px 0; border: 0; text-align: right; background: none !important; overflow-wrap: anywhere; }
  .table-cards td::after { content: ''; display: table; clear: both; }
  .table-cards td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: .82rem; text-align: left; }
  .table-cards td:first-child { text-align: left; padding-bottom: 4px; }
  .table-cards td:first-child::before { content: none; }
  .table-cards td.right, .table-cards td.nowrap { white-space: normal; }
  .table-cards td:empty { display: none; }
}

/* ── Speichern-Leiste: auf dem Handy fest am unteren Rand, damit lange Formulare ohne Scrollen gespeichert werden ── */
@media (max-width: 760px) {
  .save-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,.97); border: 0; border-top: 1px solid var(--line); border-radius: 0;
    box-shadow: 0 -6px 18px -12px rgba(30,34,90,.35);
  }
  .save-bar.card-body, .save-bar.stack { flex-direction: row; }
  .save-bar .btn { flex: 1 1 auto; padding-top: 9px; padding-bottom: 9px; }
  .save-bar .btn-block { width: auto; }
  .save-bar .btn-ghost { flex: 0 0 auto; }
  .content:has(.save-bar) { padding-bottom: 96px; }
}

/* ── Kasse: Buchungszeile auf dem Handy (Name und Betrag in einer Zeile, Status darunter) ── */
@media (max-width: 640px) {
  .tx-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; column-gap: 10px; row-gap: 2px; align-items: start; }
  .tx-row > .check { grid-column: 1; grid-row: 1 / span 3; padding-top: 2px !important; }
  .tx-row > .flow { display: none; }
  .tx-row > .grow { grid-column: 2; grid-row: 1 / span 2; }
  .tx-row > .end { display: contents; }
  .tx-row .tx-amount { grid-column: 3; grid-row: 1; justify-self: end; }
  .tx-row .tx-date { grid-column: 3; grid-row: 2; justify-self: end; }
  .tx-row .tx-status { grid-column: 2 / 4; grid-row: 3; flex-wrap: wrap; gap: 4px 10px !important; margin-top: 4px; }
}

/* ── E-Rechnung (ausgelesene XRechnung/ZUGFeRD am Beleg) ───────────── */
.e-invoice { background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.e-invoice .table td, .e-invoice .table th { padding: 5px 6px; }
.e-invoice-parties { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.e-invoice-sums { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; justify-self: end; margin-left: auto; font-variant-numeric: tabular-nums; text-align: right; }
.e-invoice-sums > :nth-child(odd) { text-align: left; }
@media (max-width: 480px) { .e-invoice-parties { grid-template-columns: minmax(0, 1fr); } }
.e-invoice-note { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.e-invoice-note > summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; }
.e-invoice-note > summary::-webkit-details-marker { display: none; }
.e-invoice-note .e-invoice { margin: 0 8px 8px; }

/* ── Mitgliederliste: Zeilen mit festen Spalten (Person · Gliederung/Ort · Gruppen/Labels · Stand) ── */
/* Die Spalten gehören der Liste, die Zeilen übernehmen sie (subgrid): so stehen sie in jeder Zeile an derselben Stelle */
.member-list { display: grid; grid-template-columns: auto auto minmax(170px, 1.5fr) minmax(110px, 1fr) minmax(0, 1.5fr) auto; column-gap: 12px; padding: 0 14px; }
.member-row {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid;
  margin: 0 -14px; padding: 9px 14px; cursor: pointer; transition: background .12s;
}
.member-row .check { padding: 0 4px; }
.member-row .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: .78rem; }
.member-main, .member-place { min-width: 0; }
.member-row .name { display: block; font-weight: 600; color: var(--ink); }
.member-row:hover .name { color: var(--navy); }
.member-place { font-size: .88rem; color: var(--ink-2); line-height: 1.3; }
.member-place-inline { display: none; }
.member-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.member-row .end { margin-left: 0; justify-self: end; gap: 6px; }
.member-row .badge { line-height: 1.7; padding: 0 7px; border-radius: 999px; }
.member-go { display: flex; color: var(--line); transition: transform .12s, color .12s; }
.member-row:hover .member-go { color: var(--muted); transform: translateX(2px); }
.member-row:has(input:checked) { background: var(--orange-soft); }
.badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
@media (max-width: 1360px) {
  .member-list { grid-template-columns: auto auto minmax(150px, 1.4fr) minmax(0, 1.2fr) auto; }
  .member-place { display: none; }
  .member-place-inline { display: inline; }
}
@media (max-width: 640px) {
  .member-list { display: block; padding: 0; }
  .member-row { display: flex; margin: 0; }
  .member-main { flex: 1 1 160px; }
  .member-tags { display: contents; }
  .member-row .end { margin-left: auto; }
  .member-go { display: none; }
}

/* Inhalt wird im Hintergrund neu geladen (public/js/live.js) */
.content.is-loading { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* U18-Erklärungen: Datei auf eine Zeile ziehen */
.u18-row { transition: background .15s, box-shadow .15s; }
.u18-row.is-drop { background: var(--orange-soft); box-shadow: inset 0 0 0 2px var(--orange); }
