/* Sichtvoll Cockpit — Gestaltung
   Heller SaaS-Look: blaue Seitenleiste, weiße Karten, Pastell-Kacheln. */

:root {
  --blau-900: #12263f;
  --blau-800: #1b3a5c;
  --blau-700: #21507f;
  --blau-600: #2563a8;
  --blau-500: #3b82c4;
  --blau-100: #e3eefb;
  --blau-50:  #f2f7fd;

  --gruen-600: #1f7a4d;
  --gruen-100: #dcf3e6;
  --gelb-700: #8a6100;
  --gelb-100: #fdf0cf;
  --rot-600: #b3261e;
  --rot-100: #fbe2e0;
  --grau-600: #5b6673;
  --grau-100: #eceff3;

  --text: #1a2431;
  --text-leise: #63707f;
  --linie: #dde3ea;
  --flaeche: #f5f7fa;
  --karte: #ffffff;

  --radius: 12px;
  --schatten: 0 1px 2px rgba(18, 38, 63, .06), 0 4px 14px rgba(18, 38, 63, .05);
  --seitenleiste: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--flaeche);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--blau-600); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }

/* ---------------------------------------------------------------- Gerüst */

.huelle {
  display: flex;
  min-height: 100vh;
}

.seitenleiste {
  width: var(--seitenleiste);
  flex: 0 0 var(--seitenleiste);
  background: var(--blau-900);
  color: #cfdcea;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.marke {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.marke b { color: #fff; display: block; font-size: 1.05rem; letter-spacing: .01em; }
.marke span { font-size: .78rem; color: #8fa6bd; }

.menue { padding: 12px 10px; flex: 1; overflow-y: auto; }
.menue a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: #cfdcea;
  text-decoration: none;
  font-size: .92rem;
}
.menue a:hover { background: rgba(255,255,255,.07); color: #fff; }
.menue a.aktiv { background: var(--blau-600); color: #fff; font-weight: 600; }
.menue a svg { width: 17px; height: 17px; flex: 0 0 17px; }
.menue .zahl {
  margin-left: auto;
  background: rgba(255,255,255,.16);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: .72rem;
  font-weight: 600;
}
.menue a.aktiv .zahl { background: rgba(255,255,255,.28); }
.menue .gruppe {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6f88a3;
  padding: 14px 12px 5px;
}

.fuss {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .78rem;
  color: #8fa6bd;
}
.fuss a { color: #8fa6bd; }

.inhalt {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 60px;
  max-width: 1500px;
}

.kopf {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.kopf h1 { margin: 0; }
.kopf .datum { color: var(--text-leise); font-size: .88rem; margin-top: 2px; }
.kopf .rechts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------- Tab-Leiste oben */

.tableiste { display: none; }

/* ---------------------------------------------------------------- Karten */

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 18px;
  margin-bottom: 18px;
}
.karte > h2 { margin-top: 0; }
.karte.eng { padding: 0; overflow: hidden; }
.karte-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--linie);
}
.karte-kopf h2 { margin: 0; }
.karte-kopf .rechts { margin-left: auto; }

/* Kachelreihe */
.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kachel {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.kachel:hover { border-color: var(--blau-500); }
.kachel .wert { font-size: 1.75rem; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; }
.kachel .titel { font-size: .82rem; color: var(--text-leise); margin-top: 4px; }
.kachel .zusatz { font-size: .78rem; margin-top: 8px; }

.kachel.blau  { background: var(--blau-50);  border-color: #cfe1f6; }
.kachel.gruen { background: var(--gruen-100); border-color: #b9e3cc; }
.kachel.gelb  { background: var(--gelb-100); border-color: #f0dda6; }
.kachel.rot   { background: var(--rot-100);  border-color: #f2c6c2; }

/* ---------------------------------------------------------------- Pillen */

.pille {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.6;
}
.pille.blau  { background: var(--blau-100);  color: var(--blau-700); }
.pille.gruen { background: var(--gruen-100); color: var(--gruen-600); }
.pille.gelb  { background: var(--gelb-100);  color: var(--gelb-700); }
.pille.rot   { background: var(--rot-100);   color: var(--rot-600); }
.pille.grau  { background: var(--grau-100);  color: var(--grau-600); }

/* -------------------------------------------------------------- Tabellen */

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  text-align: left;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-leise);
  font-weight: 620;
  padding: 10px 14px;
  border-bottom: 1px solid var(--linie);
  background: #fafbfd;
  white-space: nowrap;
}
.tabelle td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--linie);
  vertical-align: middle;
}
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover { background: var(--blau-50); }
.tabelle .name { font-weight: 600; }
.tabelle .name a { color: inherit; text-decoration: none; }
.tabelle .name a:hover { color: var(--blau-600); }
.tabelle .leise { color: var(--text-leise); font-size: .86rem; }
.tabelle .rechtsb { text-align: right; white-space: nowrap; }
.rollbar { overflow-x: auto; }

/* --------------------------------------------------------------- Knöpfe */

.knopf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--linie);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
}
.knopf:hover { border-color: var(--blau-500); color: var(--blau-700); }
.knopf.haupt {
  background: var(--blau-600);
  border-color: var(--blau-600);
  color: #fff;
}
.knopf.haupt:hover { background: var(--blau-700); border-color: var(--blau-700); color: #fff; }
.knopf.gruen { background: var(--gruen-600); border-color: var(--gruen-600); color: #fff; }
.knopf.gruen:hover { filter: brightness(.93); color: #fff; }
.knopf.klein { padding: 5px 10px; font-size: .8rem; }
.knopf.still { background: transparent; border-color: transparent; color: var(--text-leise); }
.knopf.still:hover { background: var(--grau-100); }
.knopf.gefahr:hover { border-color: var(--rot-600); color: var(--rot-600); }

/* -------------------------------------------------------------- Formular */

.feld { margin-bottom: 14px; }
.feld label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.feld .hinweis { font-size: .78rem; color: var(--text-leise); margin-top: 4px; }

input[type=text], input[type=password], input[type=date], input[type=number],
input[type=email], input[type=tel], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--linie);
  border-radius: 9px;
  font: inherit;
  font-size: .92rem;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blau-500);
  outline-offset: -1px;
  border-color: var(--blau-500);
}
textarea { min-height: 90px; resize: vertical; }

.feldreihe {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 14px;
}

/* --------------------------------------------------------------- Meldung */

.meldung {
  background: var(--gruen-100);
  border: 1px solid #b9e3cc;
  color: var(--gruen-600);
  padding: 11px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: .9rem;
  font-weight: 550;
}
.warnung {
  background: var(--gelb-100);
  border: 1px solid #f0dda6;
  color: var(--gelb-700);
  padding: 11px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: .9rem;
}
.leer {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-leise);
  font-size: .92rem;
}

/* ------------------------------------------------------------ Fortschritt */

.balken {
  height: 6px;
  background: var(--grau-100);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}
.balken i { display: block; height: 100%; background: var(--blau-500); }

/* -------------------------------------------------------- Monatsdiagramm */
/* Eine Reihe, ein Wert je Monat. Farbe: geprüftes Blau auf weißem Grund. */

.diagramm {
  --saeule: #2a78d6;          /* Datenfarbe */
  --gitter: #e1e0d9;          /* Hilfslinien, bewusst zurückhaltend */
  --grundlinie: #c3c2b7;
  --achse-text: #898781;
  --stabhoehe: 132px;

  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 560px;
  padding-top: 6px;
  position: relative;
}

/* Durchgehende Hilfslinien hinter allen Säulen */
.diagramm::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;                       /* über der Monatsbeschriftung */
  height: var(--stabhoehe);
  pointer-events: none;
  background-image:
    linear-gradient(var(--gitter), var(--gitter)),
    linear-gradient(var(--gitter), var(--gitter)),
    linear-gradient(var(--gitter), var(--gitter)),
    linear-gradient(var(--grundlinie), var(--grundlinie));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 25%, 0 50%, 0 75%, 0 100%;
}

.diagramm .saeule {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: 6px 2px 4px;
}
.diagramm .saeule:hover { background: var(--blau-50); }

.diagramm .zahl {
  font-size: .72rem;
  font-weight: 620;
  color: var(--text-leise);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-height: 1em;
}

/* Der Stab: feste Höhe, Wert wächst von der Grundlinie nach oben */
.diagramm .stab {
  width: 100%;
  height: var(--stabhoehe);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.diagramm .stab i {
  display: block;
  width: 62%;
  max-width: 46px;
  background: var(--saeule);
  /* Nur oben gerundet — unten sitzt der Wert auf der Grundlinie auf */
  border-radius: 4px 4px 0 0;
  transition: height .18s ease;
}

.diagramm .beschriftung {
  font-size: .74rem;
  color: var(--achse-text);
  font-weight: 550;
}

.diagramm .saeule.jetzt .beschriftung { color: var(--text); font-weight: 700; }
.diagramm .saeule.gewaehlt { background: var(--blau-100); }
.diagramm .saeule.gewaehlt .zahl { color: var(--blau-700); }

@media (max-width: 780px) {
  .diagramm { min-width: 620px; --stabhoehe: 110px; }
}

/* ------------------------------------------------------------ Zeitleiste */

.zeitleiste { list-style: none; padding: 0; margin: 0; }
.zeitleiste li {
  padding: 10px 0 10px 20px;
  border-left: 2px solid var(--linie);
  position: relative;
  font-size: .89rem;
}
.zeitleiste li::before {
  content: '';
  position: absolute;
  left: -5px; top: 16px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blau-500);
}
.zeitleiste .wann { color: var(--text-leise); font-size: .8rem; }

/* --------------------------------------------------------------- Anmelden */

.anmelden-seite {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--blau-900), var(--blau-700));
  padding: 20px;
}
.anmelden-karte {
  background: #fff;
  border-radius: 16px;
  padding: 30px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.anmelden-karte h1 { font-size: 1.3rem; margin-bottom: 4px; }
.anmelden-karte p.leise { color: var(--text-leise); font-size: .87rem; margin-top: 0; margin-bottom: 20px; }
.anmelden-karte .knopf { width: 100%; justify-content: center; padding: 11px; }
.fehler {
  background: var(--rot-100);
  border: 1px solid #f2c6c2;
  color: var(--rot-600);
  padding: 10px 13px;
  border-radius: 9px;
  margin-bottom: 14px;
  font-size: .87rem;
}

/* ------------------------------------------------------------ Zwei Spalten */

.zweispaltig {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

/* ------------------------------------------------------------------ Handy */

@media (max-width: 900px) {
  .zweispaltig { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .huelle { display: block; }

  .seitenleiste { display: none; }

  /* Tab-Leiste OBEN, wie gewünscht */
  .tableiste {
    display: block;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--blau-900);
    box-shadow: 0 2px 10px rgba(18,38,63,.18);
  }
  .tableiste .oben {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 8px;
    color: #fff;
  }
  .tableiste .oben b { font-size: 1rem; }
  .tableiste .oben .abmelden {
    margin-left: auto;
    color: #8fa6bd;
    font-size: .8rem;
    text-decoration: none;
  }
  .tableiste nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0 10px 10px;
    scrollbar-width: none;
  }
  .tableiste nav::-webkit-scrollbar { display: none; }
  .tableiste nav a {
    flex: 0 0 auto;
    padding: 7px 13px;
    border-radius: 20px;
    color: #cfdcea;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 550;
    white-space: nowrap;
    background: rgba(255,255,255,.08);
  }
  .tableiste nav a.aktiv { background: #fff; color: var(--blau-800); font-weight: 650; }
  .tableiste nav a .zahl {
    background: rgba(0,0,0,.18);
    border-radius: 20px;
    padding: 0 6px;
    margin-left: 4px;
    font-size: .72rem;
  }
  .tableiste nav a.aktiv .zahl { background: var(--blau-100); color: var(--blau-700); }

  .inhalt { padding: 18px 14px 50px; }
  .kopf h1 { font-size: 1.25rem; }
  .kacheln { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .kachel { padding: 13px 14px; }
  .kachel .wert { font-size: 1.4rem; }
  .karte { padding: 15px; }

  /* Tabellen werden auf dem Handy zu Karten */
  .tabelle, .tabelle tbody, .tabelle tr, .tabelle td { display: block; width: 100%; }
  .tabelle thead { display: none; }
  .tabelle tr {
    border: 1px solid var(--linie);
    border-radius: 10px;
    margin: 0 0 10px;
    padding: 12px 14px;
    background: #fff;
  }
  .tabelle td {
    border: 0;
    padding: 3px 0;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }
  .tabelle td::before {
    content: attr(data-titel);
    flex: 0 0 92px;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-leise);
    font-weight: 600;
  }
  .tabelle td.rechtsb { text-align: left; }
  .tabelle td:empty { display: none; }

  /* Der Name ist die Überschrift der Karte, keine Beschriftung davor */
  .tabelle td.name {
    display: block;
    font-size: 1.02rem;
    font-weight: 650;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--linie);
  }
  .tabelle td.name::before { content: none; }
  .tabelle td.name .leise { margin-top: 2px; }

  /* Knopfzeile unten in der Karte */
  .tabelle td.rechtsb {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--linie);
    gap: 6px;
  }
  .tabelle td.rechtsb::before { content: none; }
  .tabelle td.rechtsb .knopf { flex: 1; justify-content: center; }
  .karte.eng { padding: 12px; border: 0; background: transparent; box-shadow: none; }
  .karte.eng .karte-kopf {
    padding: 0 0 10px;
    background: transparent;
  }
}

@media print {
  .seitenleiste, .tableiste, .knopf { display: none !important; }
  body { background: #fff; }
}
