:root {
  color-scheme: dark;
  --bg: #0e1520; --sidebar: #101a28; --surface: #172231; --line: #2b3a4d;
  --text: #edf3fa; --muted: #a4b4c8; --blue: #70acff; --green: #70d7a5; --red: #ff939f;
  --amber: #ffca78; --purple: #c8a9ff;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--blue); } a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.dashboard { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--sidebar); border-right: 1px solid var(--line); display:flex; flex-direction:column; padding: 21px 12px; position: sticky; top: 0; height: 100vh; overflow-y:auto; }
.brand { display:flex; align-items:center; gap: 12px; font-size: 15px; font-weight: 720; line-height:1.3; min-height: 52px; padding: 0 8px; }
.brand small { color: var(--muted); font-weight: 500; }
.brand-icon { display:grid; place-items:center; background:#2463c4; border-radius:10px; height:38px; min-width:38px; font-size:26px; }
nav { display:grid; gap: 4px; margin: 22px 0; }
nav a { display:flex; gap: 11px; align-items:center; color: var(--text); text-decoration:none; padding:9px 10px; min-height:42px; border-radius:8px; font-size: 14px; white-space:nowrap; }
nav a:hover, nav a[aria-current] { background:#1b3354; }
.nav-icon { font-size:19px; line-height:1; text-align:center; width:19px; min-width:19px; }
.blue { color:var(--blue); } .green { color:var(--green); } .red { color:var(--red); }
.amber { color:var(--amber); } .purple { color:var(--purple); } .muted { color: var(--muted); }
.logout { margin-top:auto; } .logout button { width:100%; }
header { display:flex; align-items:center; gap:14px; height:61px; border-bottom:1px solid var(--line); padding:0 clamp(16px,3vw,36px); color:var(--muted); font-weight:650; }
main { padding: clamp(16px,3vw,36px); max-width:1450px; margin:auto; }
h1 { margin:0 0 20px; font-size:clamp(23px,3vw,32px); line-height:1.2; } h2 { font-size:17px; margin:0 0 12px; } p { margin:0 0 11px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:12px; margin-bottom:16px; padding:17px 19px; min-width:0; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:12px; margin-bottom:12px; }
.grid .card { margin:0; } .metric { font-size:clamp(17px,2vw,24px); font-weight:720; overflow-wrap:anywhere; }
.badge { display:inline-block; padding:1px 8px; border:1px solid currentColor; border-radius:14px; font-size: .79rem; white-space:nowrap; }
.notice { padding:10px 13px; border-radius:8px; background:#222f43; border-left:3px solid var(--blue); }
form { display:grid; gap:10px; } .row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.row form { display:inline-flex; } form.filters { display:flex; align-items:end; flex-wrap:wrap; }
label { display:grid; gap:4px; color:var(--muted); } label.check { display:flex; gap:8px; align-items:center; }
input,select,textarea,button { font:inherit; }
input:not([type=checkbox]),select,textarea,code.command { min-width:0; width:100%; background:#111c2a; color:var(--text); padding:8px 10px; border:1px solid #405069; border-radius:7px; }
textarea { resize:vertical; } code.command { display:block; white-space:pre-wrap; overflow-wrap:anywhere; }
a.button { display:inline-block; padding:7px 12px; border-radius:7px; color:#fff; text-decoration:none; border:1px solid transparent; }
button { cursor:pointer; padding:7px 12px; border:1px solid transparent; border-radius:7px; color:#fff; justify-self:start; }
.primary { background:#235fbd; } .secondary,.menu { background:#24354a; border-color:#41516a; } .danger { background:#793342; }
button:hover { filter:brightness(1.16); }
.preview { color:var(--muted); padding:8px 10px; border-radius:7px; background:#111c2a; overflow-wrap:anywhere; }
.table-wrap { overflow:auto; max-width:100%; }
table { width:100%; border-collapse:collapse; text-align:left; font-size:14px; }
th,td { padding:7px 9px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); } td { overflow-wrap:break-word; } th { white-space:nowrap; } details { margin-top:8px; } summary { cursor:pointer; color:var(--blue); }
.login main { max-width:490px; margin:8vh auto 0; }
.dashboard.collapsed { grid-template-columns:66px minmax(0,1fr); }
.collapsed aside { padding-inline:8px; }
.collapsed .brand { padding:0; justify-content:center; }
.collapsed .brand > span:last-child,.collapsed nav a > span:last-child,.collapsed .logout { display:none; }
.collapsed nav a { justify-content:center; }
@media (max-width: 720px) {
  .dashboard { display:block; }
  aside { position:fixed; z-index:2; height:100dvh; width:min(270px,85vw); box-shadow:0 0 30px #0008; }
  .dashboard.collapsed aside { display:none; }
  .card { padding:13px; }
  /* Tabellen werden auf schmalen Ansichten zu beschrifteten Karten, damit keine Spalte verborgen bleibt. */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display:block; width:100%; }
  .table-wrap thead { display:none; }
  .table-wrap tr { border:1px solid var(--line); border-radius:9px; padding:6px 8px; margin-bottom:9px; }
  .table-wrap td { display:grid; grid-template-columns:minmax(92px,38%) minmax(0,1fr); gap:8px; border:0; padding:4px 0; font-size:13px; }
  .table-wrap td::before { content:attr(data-label); color:var(--muted); }
  .table-wrap td { overflow-wrap:anywhere; }
  .table-wrap td > * { justify-self:start; }
}
