:root {
  --bg: #f8f8f6; --surface: #ffffff; --line: #d9d9d3; --text: #1f1f1d; --muted: #6e6e66;
  --field: #fbfbf9; --accent: #4b1df2; --accent-soft: #eceafd; --accent-line: #b9b0f7; --accent-text: #ffffff; --green: #3dbb3d; --yellow: #b7860b; --red: #b3372f;
  --band-open: #d6ecfd; --red-bg: #fbeceb; --green-bg: #dcf7d6; --yellow-bg: #fbf3dc; --focus: #2b6cb0;
  --side: #f3f3f1; --side-text: #1f1f1d; --side-muted: #55554f; --side-hover: #e8e8e4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131a24; --surface: #1b2431; --line: #2f3b4d; --text: #e6ebf2; --muted: #98a4b8;
    --field: #222c3b;
    --accent: #a797ff; --accent-soft: #2a2550; --accent-line: #51479a; --accent-text: #0b1626; --green: #6fbf8a; --yellow: #e0b84a; --red: #ef8a82;
    --band-open: #1d3550; --red-bg: #3a2220; --green-bg: #1e2f25; --yellow-bg: #35301c; --focus: #8ab4f8;
    --side: #171d27; --side-text: #e6ebf2; --side-muted: #98a4b8; --side-hover: #222b3a;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Lato", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 0 10px 12px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); }
.side[hidden] { display: none; }
.sidehead { display: flex; align-items: center; gap: 8px; background: var(--surface); margin: 0 -10px 12px; padding: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--text); flex: 1; min-width: 0; }
.brand span:last-child { border: 1px solid var(--line); padding: 6px 8px; font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: grid; place-items: center; width: 34px; height: 32px; border-radius: 4px; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.gear { color: var(--text); display: grid; place-items: center; padding: 6px; border-radius: 4px; }
.gear.active, .gear:hover { background: var(--accent-soft); color: var(--accent); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side nav { display: grid; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; align-content: start; }
.navgroup { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--side-muted); padding: 18px 10px 4px; }
.side nav a { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 7px 8px; font-size: 14.5px; border-radius: 4px; color: var(--side-text); border: 1px solid transparent; }
.side nav a span:nth-of-type(1) { flex: 1; }
.side nav a:hover { background: var(--side-hover); }
.side nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; border-color: var(--accent-line); }
.pill { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11.5px; font-weight: 600; padding: 0 7px; }
.spacer { flex: 1; }
.side .link { color: var(--side-muted); text-align: left; padding: 8px 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 9px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.headrow { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.headrow h1 { margin: 0; flex: 1; }
.linklist { display: grid; gap: 14px; }
.linklist a, .linklist button { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 16px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-family: inherit; }
.linklist a::before, .linklist button::before { content: "→"; color: var(--text); font-weight: 400; margin-right: 14px; }
.overview { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; margin-top: 24px; }
.overview h2 { color: var(--muted); font-weight: 400; font-size: 15px; margin-bottom: 14px; }
.bigline { font-size: 21px; margin-bottom: 12px; } .bigline b { margin-right: 10px; }
.progress { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 20px; }
.progress i { display: block; height: 100%; background: var(--yellow); }
.progress.done i { background: var(--green); }
.counts { display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center; font-size: 16px; }
.counts b { font-variant-numeric: tabular-nums; }
main { padding: 22px 30px; max-width: 1700px; width: 100%; }
h1 { font-size: 40px; font-weight: 400; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; }
.sub { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
button, .btn { font: inherit; padding: 7px 14px; border-radius: 2px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 9px 18px; }
button.danger { color: var(--red); }
button.link { border: 0; background: none; color: var(--muted); padding: 4px; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 2px; padding: 6px 9px; width: 100%; }
kbd { font: 11.5px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-left: 6px; opacity: .8; }

.strip { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.strip b { color: var(--text); }
.stacks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) {
  .stacks, .split { grid-template-columns: 1fr !important; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 12px; }
  .side nav { display: flex; flex-wrap: wrap; } .navgroup { display: none; } .brand { padding: 4px 8px; }
  main { padding: 16px; }
}
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(20, 30, 50, .06); border-radius: 3px; overflow: hidden; }
.card > header.blue h2 { color: var(--accent); font-weight: 500; font-size: 16px; }
.card > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > header .count { color: var(--muted); font-weight: 400; }
.card > header select { width: auto; max-width: 220px; }
.group { padding: 7px 16px; font-size: 12.5px; font-weight: 600; color: var(--red); background: var(--red-bg); border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 14px; padding: 0 0 0 16px; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; align-items: stretch; }
.row:first-of-type { border-top: 0; }
.row > span { padding: 11px 0; align-self: center; }
.row:hover { background: var(--field); }
.row.selected { box-shadow: inset 3px 0 0 var(--accent); background: var(--field); }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .meta { color: var(--muted); font-size: 12.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.row .num { font-size: 15.5px; }
.row .band { padding: 0; align-self: stretch; display: grid; place-items: center; background: var(--band-open); }
.row .band::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); }
.row .band.ready { background: var(--green-bg); }
.row .band.ready::after { content: "✓"; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.row .band.stop { background: var(--red-bg); }
.row .band.stop::after { content: "!"; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.drop { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.drop label { display: grid; place-items: center; gap: 4px; padding: 18px; border: 1px dashed var(--muted); background: var(--surface); color: var(--muted); cursor: pointer; text-align: center; }
.drop label:hover, .drop label.over { border-color: var(--accent); color: var(--accent); }
.drop label strong { font-size: 16px; font-weight: 500; }
.drop label small u { color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.empty { padding: 26px 14px; color: var(--muted); text-align: center; }
.badge { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); gap: 20px; align-items: start; }
.viewer { position: sticky; top: 16px; height: calc(100vh - 40px); display: flex; flex-direction: column; }
.viewer iframe, .viewer img, .viewer pre { flex: 1; width: 100%; border: 0; margin: 0; background: var(--surface); min-height: 0; }
.viewer img { object-fit: contain; }
.viewer pre { overflow: auto; padding: 14px; font: 12.5px/1.5 ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; }
.panel { padding: 14px; display: grid; gap: 14px; }
.banner { padding: 10px 12px; border-radius: 2px; font-size: 14px; }
.banner.red { background: var(--red-bg); color: var(--red); }
.banner.green { background: var(--green-bg); color: var(--green); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fields label { display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.fields label input, .fields label select { text-transform: none; letter-spacing: 0; font-size: 15px; padding: 9px 11px; }
.fields label.wide { grid-column: 1 / -1; }
.fields .problem input, .fields .problem select { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-bg); }
.fields .problem > span::after { content: " – bitte prüfen"; color: var(--red); text-transform: none; letter-spacing: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.check input { width: auto; }
.why { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; font-size: 13.5px; }
.why .step { display: grid; grid-template-columns: 92px 16px 1fr; gap: 8px; }
.why .topic { color: var(--muted); font-size: 12.5px; }
.ok { color: var(--green); } .bad { color: var(--red); }
.pager { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pager .where { color: var(--muted); font-size: 13.5px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 14px 16px; }
a.tile { text-decoration: none; display: block; }
.tile .label { font-size: 12.5px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .hint { font-size: 13px; color: var(--muted); }
.light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.light.green { background: var(--green); } .light.yellow { background: var(--yellow); } .light.red { background: var(--red); }
.tile ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--red); }
.tile .state { font-weight: 600; }
.month { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.month strong { min-width: 130px; text-align: center; }

.login { max-width: 420px; margin: 12vh auto; }
.login form { display: grid; gap: 12px; padding: 18px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 2px; max-width: 90vw; z-index: 20; }
#toast.error { background: var(--red); color: #fff; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 220px; }
.list th { padding: 9px 14px; background: var(--bg); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.list td { padding: 9px 14px; }
.list tbody tr:hover { background: var(--bg); }
.list tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.status.good { background: var(--green-bg); color: var(--green); border-color: transparent; }
.status.warn { background: var(--yellow-bg); color: var(--yellow); border-color: transparent; }
.status.bad { background: var(--red-bg); color: var(--red); border-color: transparent; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.formcard { margin-top: 20px; }
.cols .formcard { margin-top: 0; }
.fields.single { grid-template-columns: 1fr; padding: 18px; }
.fields label.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.fields label.check input { width: auto; }
button.small, .btn.small { padding: 3px 10px; font-size: 13px; }
.btn { text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.lines th, .lines td { padding: 4px 6px 4px 0; border: 0; }
.section-title { margin: 28px 0 10px; font-size: 16px; }
.statement tr.section td { font-weight: 600; background: var(--bg); }
.statement tr.total td { border-top: 2px solid var(--line); }
.secret { display: grid; gap: 6px; margin-bottom: 16px; }
.secret code { font: 13px ui-monospace, monospace; word-break: break-all; background: var(--surface); padding: 8px 10px; user-select: all; }
.tile-row { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: start; }
.tile-row .value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.report { margin-bottom: 20px; }
.report > header { gap: 12px; }
.report .why { border-top: 0; padding-top: 0; }

.drop.one { grid-template-columns: 1fr; }
.progress i.w50 { width: 95%; } .progress i.w100 { width: 100%; }
.backlink { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; }

@font-face { font-family: "Lato"; font-weight: 300; font-display: swap; src: url("fonts/lato-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); }

/* Zahlungen: dichte Liste mit Buchungszeilen */
.paybar { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 4px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.paybar select { width: auto; border: 0; background: transparent; color: var(--accent); padding: 2px 2px; font-size: 13.5px; margin-right: 14px; }
.paybar input[type=search] { width: 215px; padding: 4px 10px; font-size: 13px; background: var(--surface); margin-right: 8px; }
.paybar label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.paybar label input { width: auto; margin: 0; }
.paybar a { color: var(--accent); font-size: 12.5px; margin-left: 10px; }
.iconbtn { border: 0; background: none; padding: 4px; color: var(--accent); display: inline-grid; place-items: center; cursor: pointer; }
.iconbtn .ico { width: 18px; height: 18px; }
#payments { background: var(--surface); }
.pay { display: grid; grid-template-columns: 300px 506px minmax(0, 1fr) 58px; column-gap: 0; align-items: start; border-bottom: 1px solid var(--line); padding-left: 26px; font-size: 13px; }
.pay > div { padding: 16px 0; }
.pay .who strong { font-size: 13.5px; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; }
.pmeta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pbody { display: grid; grid-template-columns: 115px 22px 258px 111px; align-items: center; row-gap: 0; }
.pamount { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; height: 40px; display: grid; align-content: center; padding-right: 6px; }
.pbox { border: 1px solid #c9c9c4; background: var(--surface); height: 40px; padding: 0 10px; font-size: 12px; line-height: 1.3; display: grid; align-content: center; min-width: 0; }
.pbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbox .ptext { color: var(--muted); }
.pbox.ptax { margin-left: 6px; }
.pbox.psub { text-align: right; font-variant-numeric: tabular-nums; }
.pdoc { font-size: 12px; display: flex; align-items: center; gap: 3px; padding: 6px 0 12px 8px; }
.pdoc .ico { width: 13px; height: 13px; stroke-width: 1.8; }
.pnote { color: var(--muted); font-size: 12.5px; grid-column: 3 / 5; }
.pconn { position: relative; align-self: stretch; min-height: 8px; }
.pconn.one::after { content: ""; position: absolute; left: 6px; right: 0; top: 50%; border-top: 1px solid #c9c9c4; }
.pconn.top::before { content: ""; position: absolute; left: 4px; width: 7px; top: 50%; border-top: 1px solid #c9c9c4; }
.pconn.top::after, .pconn.through::after { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; border-left: 1px solid #c9c9c4; }
.pconn.top::after { top: 50%; }
.pconn.mid::before { content: ""; position: absolute; left: 11px; right: 0; top: 50%; border-top: 1px solid #c9c9c4; }
.pconn.mid::after { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; border-left: 1px solid #c9c9c4; }
.pconn.mid.last::after { bottom: 50%; }
.pact { display: flex; gap: 12px; justify-content: flex-end; align-items: center; padding-right: 14px !important; align-self: center; }
.pact .assign { color: var(--accent); font-weight: 700; font-size: 12.5px; text-decoration: none; }
.pay .band { align-self: stretch; padding: 0; display: grid; place-items: center; background: var(--band-open); }
.pay .band::after { content: ""; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 700; }
.pay .band.ready { background: #dff8d8; } .pay .band.ready::after { content: "✓"; background: #55d13b; }
.pay .band.stop { background: var(--red-bg); } .pay .band.stop::after { content: "!"; background: var(--red); }
.pay .band.off { background: var(--bg); } .pay .band.off::after { content: "–"; background: #b5b5ae; }
@media (max-width: 1250px) { .pay { grid-template-columns: 200px 506px minmax(0, 1fr) 58px; } }
.pbox.ptax { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 38px; }

.pedit { height: 40px; font-size: 12px; padding: 0 8px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: 0; }
select.pedit + select.pedit { margin-left: 6px; width: calc(100% - 6px); }
.pbody.editing input.pedit { grid-column: 3 / 5; margin-top: 6px; }
.pbuttons { grid-column: 3 / 5; display: flex; gap: 8px; align-items: center; padding-top: 8px; }
.textbtn { background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.qrcard { display: flex; gap: 24px; align-items: center; padding: 18px; margin-bottom: 18px; }
.qrcard img { background: #fff; flex: none; }
.qrcard .value { font-size: 26px; font-weight: 700; }

table.kz td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.kz tr.clickable { cursor: pointer; }
table.kz tr.clickable:hover { background: var(--field); }
table.kz tr.sources td { background: var(--field); padding: 6px 12px 10px; }
table.inner td { font-size: 12.5px; padding: 3px 8px 3px 0; border: 0; }
.picklist { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
