:root {
    --bg: #0F1115; --surface: #171A21; --surface2: #1F232C; --border: #2E3441;
    --text: #E6E8EC; --muted: #A3ABBA; --accent: #4C8DFF;
    --ok: #3FB97A; --warn: #E3A93B; --error: #E05D5D; --lead: #53C556;
    --s1: #338CED; --s2: #E76624; --s3: #00A888; --s4: #D28E05; --s5: #E24D8B;
    --grid: #262B35; --baseline: #474D5A;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 2px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 16px; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.logo { background: var(--s1); color: #fff; border-radius: 7px; width: 30px; height: 30px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.side a:not(.brand) { color: var(--muted); padding: 8px 12px; border-radius: 6px; font-weight: 600; }
.side a:not(.brand):hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.side a.active { background: var(--surface2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; color: var(--muted); font-size: 11.5px; padding: 8px; }
.content { padding: 22px 28px 40px; min-width: 0; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
form.filters { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
form.filters label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
select, input[type=search], input[type=text], input[type=password] {
    background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
    height: 34px; padding: 0 10px; font: inherit; max-width: 340px;
}
select:hover, input:hover { border-color: var(--accent); }
select:focus, input:focus { outline: none; border-color: var(--accent); }
/* Vom Browser automatisch ausgefüllte Felder (Passwort-Manager) sonst hell */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface2) inset; -webkit-text-fill-color: var(--text); caret-color: var(--text);
    transition: background-color 9999s;
}
button { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; height: 34px; padding: 0 14px; font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12.5px; }
.lead { color: var(--lead); } .behind { color: var(--error); }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid2 > * { min-width: 0; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .side-foot { display: none; } }
.section { margin-bottom: 12px; }
.hint { background: var(--surface); border: 1px dashed var(--border); border-radius: 8px; padding: 18px; color: var(--muted); }
.notice { background: #2A231A; border: 1px solid var(--warn); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); white-space: nowrap; }
th a { color: var(--muted); }
th.num { text-align: right; }
td { padding: 6px 10px; border-bottom: 1px solid #22262F; }
tr:hover td { background: var(--surface2); }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--surface2); color: var(--muted); }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.error { color: var(--error); }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tick { fill: var(--muted); font-size: 12px; }
.chart .bar:hover { opacity: .8; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart .value { fill: var(--text); font-size: 11.5px; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card.login { width: 100%; max-width: 380px; padding: 24px; }
.card.login .brand { padding: 0 0 18px; }
form.stack, .card.login form { display: flex; flex-direction: column; gap: 12px; }
form.stack label, .card.login label, form.inline label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12.5px; }
input[type=password], input[type=text] { width: 100%; max-width: none; }
.form-error { color: var(--error); }
.form-ok { color: var(--ok); }
.user-box { margin-top: 12px; padding: 10px 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.user-box form { margin-top: 6px; }
.user-box button { height: 28px; padding: 0 10px; font-size: 12.5px; }
form.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
form.inline label { min-width: 160px; }
.secret { font-family: Consolas, monospace; font-size: 15px; background: var(--bg); border: 1px solid var(--warn); border-radius: 6px; padding: 8px 12px; display: inline-block; user-select: all; margin: 6px 0; }
td form { display: inline; }
td button { height: 26px; padding: 0 8px; font-size: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.checks label { display: flex; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 12.5px; }
.chip:hover { color: var(--text); } .chip.active { border-color: var(--accent); color: var(--text); }
tr.own td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
