:root {
  --bg: #0e1214; --side: #12181b; --surface: #171e21; --surface2: #1d262a; --text: #e8edef; --muted: #8f9ba1;
  --line: #27323a; --accent: #4cc2a3; --accent-text: #08201a; --accent-soft: rgba(76, 194, 163, .14);
  --ok: #5fcf95; --warn: #e3ac4a; --bad: #ff8a80; --idle: #8a959b; --radius: 12px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Inter, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }

/* Rahmen mit Menüband links */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 2px 8px 10px; flex-wrap: wrap; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px; }
.brand { font-weight: 700; font-size: 1.02rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 11px; color: var(--muted); padding: 9px 12px; border-radius: 9px; font-weight: 500; }
.side nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.side nav a.active { background: var(--accent-soft); color: var(--accent); }
.side nav .ico { width: 18px; text-align: center; opacity: .9; }
.nav-group { margin: 16px 12px 4px; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); opacity: .75; }
.side-foot { margin: 0; padding: 10px 8px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }

main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 70px; max-width: 1240px; width: 100%; }
main.solo { margin: 0 auto; max-width: 440px; }

h1 { font-size: 1.65rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 30px 0 12px; color: var(--text); }
.sub { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: .95rem; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid > .card { margin-bottom: 0; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.kpi .l { color: var(--muted); font-size: .82rem; }
.kpi.later { border-style: dashed; background: transparent; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.strong td { font-weight: 700; }
.table-wrap { overflow-x: auto; }

.chip { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .78rem; border: 1px solid currentColor; white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); } .chip.idle { color: var(--idle); }
.tag { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: .75rem; background: var(--surface2); color: var(--muted); }

.task { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .t { font-weight: 600; }
.task .n { color: var(--muted); font-size: .88rem; }
.task form { margin: 0; display: flex; gap: 6px; align-items: center; }
.task select { width: auto; padding: 5px 8px; font-size: .82rem; }
.empty { color: var(--muted); padding: 6px 0; }

label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
button, .btn { background: var(--accent); color: var(--accent-text); border: 0; padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
button.link { background: none; color: var(--muted); padding: 4px 0; font-weight: 400; } button.link:hover { color: var(--text); filter: none; }
button.small { padding: 5px 11px; font-size: .82rem; background: var(--surface2); color: var(--text); }
.flash { position: sticky; top: 10px; z-index: 20; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; }
.error { color: var(--bad); } .muted { color: var(--muted); } .good { color: var(--ok); } .badtxt { color: var(--bad); }
details summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.login { margin: 14vh auto 0; }

/* Schmale Bildschirme: Menüband wird zur Leiste oben */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .side-head { padding: 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; overflow: visible; flex-basis: 100%; order: 3; }
  .nav-group { display: none; }
  .side-foot { border: 0; padding: 0; margin-left: auto; gap: 10px; }
  th, td { padding: 8px 6px; font-size: .92rem; }
}

.split { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.split-form { border-left: 1px solid var(--line); padding-left: 22px; }
.split-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-form .form-grid .wide { grid-column: 1 / -1; }
textarea { resize: vertical; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } .split-form { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; } .split-form .form-grid { grid-template-columns: minmax(0, 1fr); } }
.card[id] { scroll-margin-top: 70px; }
