/* Gestaltung: ruhig, klar, abgerundet; Farben angelehnt an KSN (Blau, Hellblau, Weiß) */
:root {
  --bg: #eef4fb; --card: #ffffff; --ink: #0f1d2e; --muted: #5d7088; --line: #e1e9f2;
  --brand: #1565c0; --brand-ink: #ffffff; --brand-soft: #e3f0fd; --sky: #5fb4ee;
  --warn: #9a5b00; --warn-bg: #fff2d6; --bad: #c62828; --bad-bg: #fde8e8; --ok: #1b7a3d; --ok-bg: #e2f5e8;
  --bar: rgba(255, 255, 255, .78); --shadow: 0 1px 2px rgba(15, 40, 80, .06), 0 6px 20px rgba(15, 40, 80, .06);
  --radius: 20px; --radius-sm: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1220; --card: #131e30; --ink: #eaf1fa; --muted: #93a6bd; --line: #223250;
    --brand: #4da3ff; --brand-ink: #04152b; --brand-soft: #14304f; --sky: #7cc4f5;
    --warn: #f5c15a; --warn-bg: #3a2c0b; --bad: #ff8a8a; --bad-bg: #3d1a1d; --ok: #7ddb9c; --ok-bg: #12301f;
    --bar: rgba(19, 30, 48, .78); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
header#top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 12px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  position: sticky; top: 0; z-index: 5;
}
header#top strong { font-size: 22px; white-space: nowrap; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
#who { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; }
nav#tabs {
  position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: min(420px, calc(100% - 32px)); display: flex; gap: 4px; padding: 5px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-radius: 999px; box-shadow: var(--shadow); z-index: 5;
}
nav#tabs button {
  flex: 1; border: 0; background: none; color: var(--muted); padding: 10px 6px; font-size: 14px; font-weight: 500;
  min-height: 44px; border-radius: 999px;
}
nav#tabs button[aria-current="page"] { color: var(--ink); background: var(--brand-soft); font-weight: 700; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow); }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 10px; }
h2 .muted { font-weight: 500; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; }
.muted { color: var(--muted); font-size: 14px; }
.big { font-size: 48px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button, .btn {
  font: inherit; font-weight: 600; border-radius: 999px; border: 0; background: var(--bg); color: var(--ink);
  padding: 12px 20px; min-height: 48px; cursor: pointer; transition: transform .08s ease, opacity .15s;
}
button:active, .btn:active { transform: scale(.97); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
button.primary { background: var(--brand); color: var(--brand-ink); }
button.danger { background: var(--bad-bg); color: var(--bad); }
button.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
button.huge { width: 100%; min-height: 76px; font-size: 22px; border-radius: 26px; }
button:disabled { opacity: .45; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--bg); color: var(--ink); min-height: 46px;
}
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 12px 0 5px 4px; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--bg); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
#banner { margin: 0 16px; padding: 10px 16px; background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 14px; border-radius: var(--radius-sm); }
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; max-width: 90vw; z-index: 9; font-size: 15px; box-shadow: var(--shadow);
}
#toast.err { background: var(--bad); color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.off td { color: var(--muted); background: var(--bg); }
.list > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > div:last-child { border-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.kpis > div { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 6px; }
.kpis b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
img.qr { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: var(--radius-sm); }
.center { text-align: center; }
@media print {
  header#top, nav#tabs, #banner, #toast, .noprint { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { box-shadow: none; padding: 0; }
}
.mt { margin-top: 10px; }
