:root {
  --pitch: #0e5a40; --pitch-d: #093b2a; --pitch-l: #e3f1ea; --pitch-m: #1a7a58;
  --chalk: #f1f4f0; --surface: #fff; --ink: #10201a; --muted: #5a6b63; --line: #dbe3dd; --line-2: #eaf0eb;
  --card-y: #f2b705; --warn-bg: #fff6d6; --warn: #8a6500; --err: #c9362f; --err-bg: #fde8e6; --ok: #17794d; --ok-bg: #dcf3e7; --info: #2459b8; --info-bg: #e4edfb;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 32, 26, .06), 0 4px 14px rgba(16, 32, 26, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--chalk); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; } h2 { font-size: 17px; font-weight: 700; } h3 { font-size: 14px; font-weight: 700; }
a { color: var(--pitch); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: var(--mono); font-size: 13px; } .right { text-align: right; } .pre { white-space: pre-wrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--pitch-m) 55%, white); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--pitch-d); color: #d7e9df; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #c9e0d4; font-weight: 600; transition: background-color .12s ease, color .12s ease; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav a[aria-current=page] { background: #fff; color: var(--pitch-d); }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 10px 6px; }
.side .who { margin-top: auto; padding: 12px 10px 4px; font-size: 13px; color: #a9c7b8; border-top: 1px solid rgba(255, 255, 255, .12); }
.side .who b { color: #fff; display: block; font-size: 14px; }
.side .who button { background: none; border: 0; color: #a9c7b8; cursor: pointer; padding: 6px 0; display: inline-flex; gap: 6px; align-items: center; font: inherit; }
.side .who button:hover { color: #fff; }
.main { min-width: 0; }
.topbar { display: none; }
.banner { background: var(--card-y); color: #3a2c00; padding: 8px 20px; font-size: 13px; font-weight: 600; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner button { background: #3a2c00; color: #fff; border: 0; border-radius: 6px; padding: 3px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.banner.live { background: var(--err); color: #fff; }
.view { padding: 26px 28px 60px; max-width: 1240px; animation: enter .2s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card-b > .actions, .card-b > div > .actions { margin-top: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: block; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 650; font-size: 14px; padding: 9px 15px; min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .1s ease-out, background-color .12s ease, border-color .12s ease, box-shadow .12s ease; text-decoration: none; }
.btn:hover { border-color: #b9c6bd; background: #fafcfa; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--pitch); border-color: var(--pitch); color: #fff; } .btn.primary:hover { background: var(--pitch-m); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; } .btn.danger:hover { background: #b02d27; }
.btn.ghost { background: transparent; } .btn.sm { padding: 5px 10px; min-height: 30px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--muted); display: inline-flex; } .icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
.card-b { padding: 12px 18px 18px; }
.card + .card, .stack > * + * { margin-top: 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: repeat(12, 1fr); align-items: start; }
.cols > * { margin: 0 !important; min-width: 0; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.kpi { padding: 14px 16px; } .kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; } .kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; } .kpi .s { font-size: 12.5px; color: var(--muted); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; } .dl dt { color: var(--muted); font-size: 13px; padding-top: 1px; } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Hero: nächster Anstoß */
.hero { position: relative; overflow: hidden; color: #fff; border-radius: 16px; padding: 24px 26px; background: linear-gradient(135deg, var(--pitch-d), var(--pitch) 70%); box-shadow: var(--shadow); min-height: 190px; display: flex; flex-direction: column; justify-content: center; }
.hero svg.pitch { position: absolute; right: -30px; top: 50%; transform: translateY(-50%); height: 230%; opacity: .16; pointer-events: none; }
.hero .eyebrow { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: #9fd1b9; font-weight: 700; }
.hero .big { font-size: 56px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; margin: 6px 0 4px; }
.hero .big small { font-size: 20px; font-weight: 700; letter-spacing: 0; color: #b9dccb; margin-left: 6px; }
.hero .line { color: #d6eee1; position: relative; } .hero .line b { color: #fff; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-err { background: var(--err-bg); color: var(--err); } .b-info { background: var(--info-bg); color: var(--info); } .b-mute { background: #eceff0; color: #4d5a60; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--line-2); font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* Tabellen */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafcfa; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th.right, td.right { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7faf8; }
.card > .tablewrap th:first-child, .card > .tablewrap td:first-child { padding-left: 18px; } .card > .tablewrap th:last-child, .card > .tablewrap td:last-child { padding-right: 18px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.toolbar .grow { flex: 1; min-width: 180px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }

/* Formulare */
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 12px; min-height: 40px; border: 1px solid #c5d0c8; border-radius: 10px; background: #fff; transition: border-color .12s ease, box-shadow .12s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pitch-m); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pitch-m) 22%, transparent); }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--pitch); padding: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; } .field > label { font-size: 13px; font-weight: 650; } .field small { color: var(--muted); font-size: 12.5px; }
.field.check { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; } .field.check small { flex-basis: 100%; margin-left: 26px; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; }
.form-error { color: var(--err); margin: 10px 0 0; font-weight: 600; min-height: 1em; }
.search { position: relative; } .search .icon { position: absolute; left: 11px; top: 11px; color: var(--muted); } .search input { padding-left: 36px; }

/* Dialog */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(8, 24, 17, .35); color: var(--ink); animation: pop .16s var(--ease); }
dialog.modal.wide { width: min(780px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(8, 24, 17, .5); animation: fade .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } } @keyframes fade { from { opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 4px 22px; position: sticky; top: 0; background: #fff; }
.modal-body { padding: 10px 22px 18px; } .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; }

/* Toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-weight: 600; font-size: 14px; animation: toast-in .22s var(--ease); border-left: 4px solid #7ab8a0; }
.toast.t-ok { border-left-color: #3ecb86; } .toast.t-err { border-left-color: #ff6b63; } .toast.t-warn { border-left-color: var(--card-y); }
.toast.out { opacity: 0; transform: translateX(14px); transition: opacity .18s ease, transform .18s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* Diagramm & Listen */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 190px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: var(--pitch-l); min-height: 3px; height: var(--h); transition: height .5s var(--ease), background-color .15s; } .bar.cur i { background: var(--pitch); } .bar:hover i { background: var(--pitch-m); }
.bar span { font-size: 11.5px; color: var(--muted); } .bar b { font-size: 11.5px; color: var(--ink); opacity: 0; transition: opacity .15s; } .bar:hover b, .bar.cur b { opacity: 1; }
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .list li:last-child { border: 0; }
.feed li { align-items: flex-start; font-size: 14px; } .feed li > div { flex: 1; min-width: 0; } .feed time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pitch-m); flex: none; margin-top: 6px; } .dot.err { background: var(--err); } .dot.warn { background: var(--card-y); }
.problem { display: flex; gap: 10px; align-items: flex-start; } .yc { width: 12px; height: 17px; background: var(--card-y); border-radius: 2px; flex: none; margin-top: 3px; transform: rotate(8deg); } .yc.red { background: var(--err); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; } .tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; } .tabs button[aria-selected=true] { color: var(--pitch); border-bottom-color: var(--pitch); }
.totals { margin-left: auto; width: min(320px, 100%); } .totals div { display: flex; justify-content: space-between; padding: 4px 0; } .totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 17px; }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: #5c4400; margin-bottom: 14px; font-size: 14px; } .alert.err { background: var(--err-bg); color: #7a1d19; } .alert.info { background: var(--info-bg); color: #1c428a; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* Login / Portal */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #d3ebdf, transparent), var(--chalk); }
.auth .card { width: min(420px, 100%); padding: 28px; position: relative; overflow: hidden; } .auth h1 { margin: 12px 0 4px; } .auth form { display: grid; gap: 14px; margin-top: 18px; }
.portal { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; } .portal header { display: flex; align-items: center; gap: 12px; margin: 8px 0 22px; } .portal header .brand { color: var(--pitch-d); padding: 0; }
.mandate-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-102%); transition: transform .22s var(--ease); height: 100%; } .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(8, 24, 17, .45); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--pitch-d); color: #fff; position: sticky; top: 0; z-index: 40; font-weight: 800; } .topbar .icon-btn { color: #fff; }
  .view { padding: 18px 14px 60px; } h1 { font-size: 22px; }
  .cols > * { grid-column: span 12 !important; } .hero .big { font-size: 44px; } .form-grid { grid-template-columns: 1fr; } .span-1, .span-2 { grid-column: span 1; }
  .btn { min-height: 44px; } .btn.sm { min-height: 36px; }
  .stackable thead { display: none; } .stackable tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); } .stackable td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 3px 0; text-align: right; } .stackable td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media print { .side, .topbar, .banner, .actions, .toasts { display: none !important; } .shell { display: block; } .view { padding: 0; } }
