:root {
  --akzent: #0e7a72;
  --akzent-hell: #e6f3f1;
  --text: #16242a;
  --text-leise: #5b6b71;
  --hintergrund: #f5f7f7;
  --karte: #ffffff;
  --linie: #dde4e6;
  --gefahr: #b42318;
  --gefahr-hell: #fde8e6;
  --erfolg: #067647;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --akzent: #37b3a8;
    --akzent-hell: #17302e;
    --text: #e7eeef;
    --text-leise: #9db0b5;
    --hintergrund: #0e181b;
    --karte: #162428;
    --linie: #283a3f;
    --gefahr: #ff8a80;
    --gefahr-hell: #3a1d1b;
    --erfolg: #5fd39a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--hintergrund);
  color: var(--text);
  line-height: 1.45;
}
.sprung { position: absolute; left: -999px; }
.sprung:focus { left: 8px; top: 8px; background: var(--karte); padding: 6px 10px; z-index: 10; }

.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

.seitenleiste {
  background: var(--karte);
  border-right: 1px solid var(--linie);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.marke { font-size: 24px; font-weight: 700; padding: 0 8px; }
.marke span { color: var(--akzent); }
.seitenleiste nav { display: grid; gap: 4px; }
.seitenleiste nav a,
.robo-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.seitenleiste nav a:hover,
.robo-link:hover { background: var(--akzent-hell); }
.seitenleiste nav a[aria-current="page"] { background: var(--akzent-hell); color: var(--akzent); font-weight: 700; }
.nebenbei { margin-top: auto; border-top: 1px solid var(--linie); padding-top: 12px; }
.robo-link { color: var(--text-leise); font-size: 14px; }
.kontostatus { font-size: 12px; color: var(--text-leise); padding: 0 12px; }

.inhalt { padding: 24px 28px; max-width: 1080px; width: 100%; }
.kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h1 { margin: 0; font-size: 26px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.monat-wahl { display: flex; align-items: center; gap: 8px; }
.monat-wahl strong { min-width: 150px; text-align: center; }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.karte-zahl { font-size: 24px; font-weight: 700; }
.leise { color: var(--text-leise); font-size: 14px; }
.negativ { color: var(--gefahr); }
.positiv { color: var(--erfolg); }

.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .seitenleiste { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .seitenleiste nav { display: flex; flex-wrap: wrap; }
  .nebenbei, .kontostatus { display: none; }
  .zwei { grid-template-columns: 1fr; }
}

button, .knopf {
  font: inherit;
  border: 1px solid var(--linie);
  background: var(--karte);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}
button.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
button.gefahr { color: var(--gefahr); }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

form.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--text-leise); }
input, select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--karte);
  color: var(--text);
  min-width: 0;
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--linie); }
th { font-size: 13px; color: var(--text-leise); font-weight: 600; }
td.betrag, th.betrag { text-align: right; white-space: nowrap; }
td.aktion { text-align: right; }

.leer { color: var(--text-leise); padding: 12px 0; }
.meldung { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--akzent-hell); }
.meldung.fehler { background: var(--gefahr-hell); color: var(--gefahr); }
.balken { height: 8px; border-radius: 4px; background: var(--linie); overflow: hidden; margin-top: 6px; }
.balken > span { display: block; height: 100%; background: var(--akzent); }
.hinweis { font-size: 14px; color: var(--text-leise); margin-top: 8px; }
.kategorie-zeile { margin-bottom: 10px; }
.kategorie-kopf { display: flex; justify-content: space-between; }
