/* Kassenpower – Oberfläche. Farben als Tokens, hell/dunkel automatisch. */
:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --card-2: #faf8f5;
  --ink: #1d1a17;
  --ink-2: #4a443e;
  --muted: #6b645c;
  --line: #e8e3dc;
  --line-2: #d9d2c8;
  --accent: #a3500f;
  --accent-ink: #ffffff;
  --accent-soft: #f9e9dc;
  --pos: #1f7a46;
  --pos-soft: #e3f2e8;
  --neg: #b4321f;
  --neg-soft: #fbe6e2;
  --warn: #865600;
  --warn-soft: #fbf0d9;
  --info-soft: #eef1f6;
  --ok-ink: #ffffff;
  --danger-ink: #ffffff;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 4px 16px rgba(40, 30, 20, .05);
  --radius: 14px;
  --nav-w: 232px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161412;
    --card: #201d1a;
    --card-2: #1b1916;
    --ink: #f2ede6;
    --ink-2: #cfc7bd;
    --muted: #9c948a;
    --line: #322d28;
    --line-2: #423b34;
    --accent: #f0904a;
    --accent-ink: #1a0f0a;
    --accent-soft: #3a2618;
    --pos: #5cc98a;
    --pos-soft: #1b3326;
    --neg: #f07a66;
    --neg-soft: #3b201b;
    --warn: #e8b04a;
    --warn-soft: #3a2f17;
    --info-soft: #24272d;
    --ok-ink: #0c2416;
    --danger-ink: #2a0d08;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num, .amt, .big, .kpi b, .kv b, .matrix td.num { font-variant-numeric: tabular-nums; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Grundgerüst ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 12px; border-right: 1px solid var(--line); background: var(--card-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.brand .logo svg { width: 26px; height: 26px; }
.brand b { display: block; font-size: 16px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--line); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav-foot { margin-top: auto; padding: 10px 12px; color: var(--muted); font-size: 13px; }

.main { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + var(--safe-t)) 28px 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.top h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yearsel { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 4px 0 10px; color: var(--muted); }
.yearsel select { border: 0; background: transparent; padding: 7px 4px; font-weight: 600; color: var(--ink); outline: none; }
.view { padding: 8px 28px 48px; max-width: 1120px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; z-index: 20; inset: auto 0 0 0; height: auto; top: auto;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + var(--safe-b));
    border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .brand, .nav-foot { display: none; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; border-radius: 10px; text-align: center; }
  .nav a svg.i { width: 22px; height: 22px; }
  .nav a.on { background: transparent; }
  .top { padding: calc(10px + var(--safe-t)) 16px 10px; }
  .view { padding: 4px 16px calc(96px + var(--safe-b)); gap: 14px; }
  h1 { font-size: 20px; }
}

/* ---------- Bausteine ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gridfit { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; gap: 14px; } }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :last-child { grid-column: 1 / -1; } }
.link { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.sub { margin: 16px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: var(--pos); border-color: var(--pos); color: var(--ok-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line); }
.btn.danger { background: var(--neg); border-color: var(--neg); color: var(--danger-ink); }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--neg); }
.btn.danger-ghost:hover { background: var(--neg-soft); }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: 13px; border-radius: 9px; }
.btn.sm svg.i { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--line); color: var(--ink); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.badge.ok { background: var(--pos-soft); color: var(--pos); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--neg-soft); color: var(--neg); }
.badge.open { background: var(--info-soft); color: var(--ink-2); }
.badge.muted { background: var(--line); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em; background: hsl(var(--h, 20) 40% 32%); }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h, 20) 35% 32%); } }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field-l { font-size: 13px; color: var(--muted); font-weight: 500; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; padding: 10px 12px; min-height: 42px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); outline: none;
  font-size: 16px; /* iOS zoomt sonst */
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=search] { -webkit-appearance: none; appearance: none; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }

.seg { display: inline-flex; padding: 3px; background: var(--line); border-radius: 11px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button, .seg label { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button.on, .seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.seg.full { display: flex; }
.seg.full > * { flex: 1; text-align: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--accent); border-color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .grow { flex: 1; }
.toolbar input[type=search] { max-width: 260px; }
.toolbar select { width: auto; max-width: 220px; }
@media (max-width: 820px) { .toolbar input[type=search] { max-width: none; flex: 1 1 100%; order: 5; } }

.searchrow { display: flex; gap: 8px; margin-bottom: 12px; }
.searchrow input { flex: 1; min-width: 0; }
.fcount { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.filters { margin-bottom: 12px; }
@media (max-width: 820px) { .toolbar.actions .btn { flex: 1; } }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kpi span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-size: 18px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.kv span { color: var(--muted); }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero .label { color: var(--muted); font-weight: 500; font-size: 14px; }
.hero .big { display: block; font-size: 40px; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; font-weight: 700; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-list { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.acc-list b { color: var(--ink); font-weight: 600; }
@media (max-width: 520px) { .hero .big { font-size: 34px; } .hero-actions { width: 100%; } .hero-actions .btn { flex: 1; } }

.progress { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; background: var(--pos); }
.progress i.part { background: var(--warn); }

.fee-progress { display: flex; align-items: center; gap: 18px; }
.fee-progress > div:last-child { flex: 1; }
.ring {
  --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--pos) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
}
.ring span { width: 74px; height: 74px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; }
.ring small { font-size: 13px; color: var(--muted); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--card-2); font-weight: 500; font-size: 13px; cursor: pointer; }
.pchip:hover { border-color: var(--muted); }
.pchip.bad { border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }
.pchip.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.good { color: var(--pos); font-weight: 600; margin: 8px 0 0; }
.warn-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 500; }
.warn-line .link { color: inherit; text-decoration: underline; }
.info { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); font-size: 14px; }

/* Monatsdiagramm */
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 120px; margin-top: 16px; }
.months .m { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.months .bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.months .bars i { display: block; width: 42%; max-width: 10px; border-radius: 3px 3px 0 0; min-height: 0; }
.months .bars i.in { background: var(--pos); }
.months .bars i.out { background: var(--neg); opacity: .85; }
.months small { font-size: 10px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Listen */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.elist { display: flex; flex-direction: column; }
.erow {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 10px 6px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer;
}
.elist > .erow:first-child, .mgroup + .erow { border-top: 0; }
.erow:hover { background: var(--card-2); }
.edate { display: flex; flex-direction: column; line-height: 1.15; }
.edate b { font-size: 14px; }
.edate small { font-size: 11px; color: var(--muted); }
.emain { min-width: 0; display: flex; flex-direction: column; }
.etext { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.emeta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emeta svg.i { width: 13px; height: 13px; vertical-align: -2px; }
.eamt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.eamt .amt { font-weight: 650; white-space: nowrap; }
.eamt .amt.tr { color: var(--ink-2); }
.eamt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mgroup { display: flex; justify-content: space-between; gap: 10px; padding: 14px 6px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.mgroup span:last-child { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

.frow, .mrow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.frow-main, .mrow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 4px 2px; text-align: left; cursor: pointer; text-decoration: none; color: inherit; border-radius: 10px; }
.frow-main:hover, .mrow-main:hover { background: var(--card-2); }
.fname { min-width: 0; display: flex; flex-direction: column; }
.fname b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname small { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.paid-info { color: var(--pos); font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.rightcol { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }

/* Matrix */
.matrix-wrap { overflow-x: auto; margin: 0 -6px; }
.matrix { border-collapse: collapse; width: 100%; font-size: 14px; }
.matrix th, .matrix td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; }
.matrix thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.matrix tfoot td { font-weight: 600; font-size: 13px; color: var(--ink-2); border-bottom: 0; }
.matrix td.num { text-align: right; }
@media (max-width: 520px) {
  .matrix th, .matrix td { padding: 7px 4px; }
  .matrix td:first-child { white-space: normal; max-width: 112px; line-height: 1.25; }
  .matrix small { display: block; margin-left: 0; }
}
.matrix a { text-decoration: none; font-weight: 500; }
.matrix small { color: var(--muted); margin-left: 6px; }
.cell { width: 34px; height: 30px; border-radius: 8px; border: 0; cursor: pointer; display: inline-grid; place-items: center; font-weight: 700; }
.cell.ok { background: var(--pos-soft); color: var(--pos); }
.cell.bad, .cell.open { background: var(--neg-soft); color: var(--neg); }
.cell.warn { background: var(--warn-soft); color: var(--warn); }
.cell.muted { background: transparent; color: var(--muted); }
.cell svg.i { width: 16px; height: 16px; }

/* Belege */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--card-2); display: grid; place-items: center; text-decoration: none; font-size: 11px; color: var(--muted); text-align: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .del { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.files { display: flex; flex-direction: column; gap: 8px; }

/* Dialog */
dialog.dlg {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog.dlg.wide { width: min(760px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(20, 14, 10, .45); backdrop-filter: blur(2px); }
dialog.dlg form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
dialog.dlg header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--line); }
dialog.dlg header h2 { font-size: 17px; }
.dlg-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-body > * { flex-shrink: 0; }
.dlg-err { margin: 0 20px 4px; padding: 10px 12px; border-radius: 10px; background: var(--neg-soft); color: var(--neg); font-weight: 500; font-size: 14px; }
dialog.dlg footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex-wrap: wrap; }
dialog.dlg footer .grow { flex: 1; }
@media (max-width: 600px) {
  dialog.dlg, dialog.dlg.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  dialog.dlg form { max-height: 92dvh; }
  dialog.dlg footer .btn { flex: 1; }
  dialog.dlg footer .grow { display: none; }
}
.ch-head { display: flex; align-items: center; gap: 12px; }
.ch-head > div { flex: 1; min-width: 0; }
.ch-head b { font-size: 17px; }
.plist .prow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
fieldset.pay { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
fieldset.pay legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
details.more { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
details.more[open] summary { margin-bottom: 12px; }
details.more .grid2 { margin-bottom: 10px; }
.remind { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 100;
  transform: translate(-50%, 140%); opacity: 0; transition: transform .25s, opacity .25s;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  padding: 10px 10px 10px 16px; border-radius: 12px; background: #1f1b18; color: #fff; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.err { background: #8f2a17; }
#toast .btn { background: transparent; color: #ffb58f; border-color: transparent; min-height: 32px; }
@media (max-width: 820px) { #toast { bottom: calc(84px + var(--safe-b)); } }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth .brand { padding: 0 0 6px; display: flex !important; }
.auth h1 { font-size: 20px; }

/* Einstellungen */
.set-list .srow { display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
.set-list .srow > div { flex: 1; min-width: 0; }
.set-list .srow small { display: block; color: var(--muted); font-size: 13px; }
.dl-list { display: flex; flex-direction: column; }
.dl-list a { display: flex; align-items: center; gap: 10px; padding: 11px 2px; text-decoration: none; border-top: 1px solid var(--line); }
.dl-list a:first-child { border-top: 0; }
.dl-list a span { flex: 1; }
.loglist .lrow { display: grid; grid-template-columns: 130px 90px 1fr; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); font-size: 13.5px; }
.loglist .lrow small { color: var(--muted); }
@media (max-width: 600px) { .loglist .lrow { grid-template-columns: 1fr; gap: 2px; } }

/* Mitglied */
.member-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.member-head .who { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.member-head .who .who-name { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0; }
.contact { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.contact a { text-decoration: none; color: var(--accent); }

/* Kassenbericht (Druck) */
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; max-width: 860px; }
.report h1 { font-size: 24px; margin-bottom: 4px; }
.report h2 { font-size: 15px; margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.report table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.report th, .report td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.report th { font-size: 12px; color: var(--muted); font-weight: 600; }
.report td.num, .report th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report tr.sum td { font-weight: 700; border-top: 2px solid var(--ink-2); border-bottom: 0; }
.report .sign { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; margin-top: 56px; }
.report .sign div { border-top: 1px solid var(--ink); padding-top: 6px; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .report { padding: 18px; } .report .sign { grid-template-columns: 1fr; } }
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --card: #fff; --ink: #000; --line: #ccc; --muted: #555; }
  body { background: #fff; font-size: 11pt; }
  .nav, .top, .no-print, #toast { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; box-shadow: none; max-width: none; }
  .report tr { break-inside: avoid; }
}

/* iPhone: Kennzahlen als Zeilen statt Kacheln (kein Umbruch „2 + 1“) */
@media (max-width: 520px) {
  .kpis { display: flex; flex-direction: column; gap: 0; padding: 2px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
  .kpi { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border: 0; border-radius: 0; background: none; }
  .kpi + .kpi { border-top: 1px solid var(--line); }
  .kpi span { font-size: 14px; }
  .kpi b { font-size: 16px; margin: 0; }
}

/* Touch: Tippflächen mindestens 44 px, ohne das Layout zu verschieben */
@media (pointer: coarse) {
  .link, .back { padding: 12px 6px; margin: -12px -6px; }
  .icon-btn { width: 44px; height: 44px; }
  .matrix td:first-child a { display: inline-block; min-width: 28px; padding: 13px 0; margin: -13px 0; }
  .cell { width: 36px; height: 34px; }
  .btn.sm { min-height: 40px; }
  .pchip { min-height: 40px; }
}

/* Rollen: Bedienelemente ohne Recht ausblenden (der Server prüft zusätzlich) */
body.no-kw [data-act="new-entry"], body.no-kw [data-act="new-member"], body.no-kw [data-act="edit-member"],
body.no-kw [data-act="new-charge"], body.no-kw [data-act="add-fee"], body.no-kw [data-act="fee-year"],
body.no-kw [data-act="fee-missing"], body.no-kw [data-act="reconcile"], body.no-kw .kw-only { display: none !important; }
body.no-pay [data-act="quickpay"] { display: none !important; }
.ro-fs { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.ro-fs:disabled input, .ro-fs:disabled select, .ro-fs:disabled textarea { opacity: 1; color: var(--ink); background: var(--card-2); }

/* Hinweisleisten (Testphase, abgelaufen, E-Mail bestätigen) */
#banner { padding: 0 28px; max-width: 1120px; }
#banner:empty { display: none; }
.banner { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.banner span { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--neg-soft); color: var(--neg); }
.banner.info { background: var(--info-soft); color: var(--ink-2); }
@media (max-width: 820px) { #banner { padding: 0 16px; } }

/* Vereinswechsel in der Navigation */
.vsel { padding: 0 10px 12px; }
.vsel select { min-height: 38px; font-size: 14px; padding: 6px 10px; }
@media (max-width: 820px) { .vsel { display: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.set-list .srow select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; }

/* Rechtliches */
.legal-links { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.legal-links a { color: var(--muted); }
body.legal-page { background: var(--bg); }
.legal { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; line-height: 1.6; }
.legal h1 { font-size: 26px; margin-bottom: 16px; }
.legal h2 { font-size: 18px; margin: 24px 0 8px; }
.legal-draft { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.ro-fs .files .row-btns { display: none; }
.ro-fs .seg label:has(input:checked) { opacity: 1; }
body.no-pay label:has(#payacc) { display: none !important; }

/* --- Abendkasse: Koppeln (App) und Vereins-Tablet (/kiosk) --- */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.paircode { font: 700 32px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; margin: 8px 0 2px; color: var(--accent); }
.kiosk { max-width: 1100px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 16px calc(24px + var(--safe-b)); }
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.k-head .brand { display: flex !important; padding: 0; }
.k-head .brand b { display: block; font-size: 22px; }
.k-head .brand small { color: var(--muted); font-size: 15px; }
.k-head .logo { width: 44px; height: 44px; }
.k-count { display: flex; align-items: baseline; gap: 8px; }
.k-count b { font-size: 40px; line-height: 1; color: var(--pos); }
.k-count span { color: var(--muted); font-size: 17px; }
.k-intro { font-size: 17px; color: var(--ink-2); margin: 6px 0 12px; }
.k-search input { width: 100%; font-size: 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; margin-top: 14px; }
.k-tile { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent; }
.k-tile:active { transform: scale(.98); }
.k-tile > span:last-child { min-width: 0; }
.k-name { display: block; font-size: 19px; font-weight: 650; overflow-wrap: break-word; hyphens: auto; }
.k-sub { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.k-sub svg.i { width: 16px; height: 16px; }
.k-tile.paid { background: var(--pos-soft); border-color: var(--pos); }
.k-tile.paid .k-sub { color: var(--pos); font-weight: 600; }
.k-guest { flex-direction: column; justify-content: center; align-items: center; border-style: dashed; color: var(--accent); box-shadow: none; }
.k-guest .k-name { font-size: 19px; }
.k-h2 { margin: 22px 0 0; font-size: 17px; color: var(--muted); }
.k-start { text-align: center; padding: 48px 20px; margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.k-start h1 { font-size: 26px; margin: 0; }
.btn.k-big { font-size: 19px; min-height: 56px; padding: 12px 26px; border-radius: 14px; }
.btn.k-big svg.i { width: 22px; height: 22px; }
.k-code input { font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-align: center; text-transform: uppercase; padding: 12px; }
.k-dlg { width: min(460px, calc(100vw - 32px)); }
.k-dlg h2 { font-size: 24px; margin: 0; }
.k-dlg p { font-size: 18px; margin: 0; }
.k-dlg .field input { font-size: 20px; padding: 12px; }
.k-dlg footer { display: flex; gap: 10px; padding: 12px 20px 18px; }
.k-dlg footer .btn { flex: 1; justify-content: center; }
.k-foot { margin-top: 28px; text-align: center; color: var(--muted); font-size: 13px; }
