/* Portal olivier-family — bewusst schlicht, mobil zuerst. */

:root {
  --bg:        #0d141c;
  --bg-karte:  #151f2b;
  --bg-hoch:   #1d2a38;
  --rand:      #263444;
  --text:      #e6edf5;
  --text-leise:#93a4b8;
  --akzent:    #4a9eff;
  --gruen:     #2ea36b;
  --rot:       #e05260;
  --gelb:      #d9a441;
  --radius:    14px;
}

* , *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

h1 { font-size: clamp(1.5rem, 5vw, 2rem); margin: 0 0 .3rem; }
h2 { font-size: 1.15rem; margin: 0 0 .9rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }

/* ── Kopfzeile ─────────────────────────────────────────────── */
.kopf {
  display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: center; justify-content: space-between;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  padding-top: calc(.85rem + env(safe-area-inset-top));
  background: var(--bg-karte);
  border-bottom: 1px solid var(--rand);
}
.marke { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.marke span { color: var(--text-leise); font-weight: 400; }
.kopf nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.kopf nav a {
  color: var(--text-leise); text-decoration: none;
  padding: .4rem .7rem; border-radius: 8px; font-size: .92rem;
}
.kopf nav a:hover { background: var(--bg-hoch); color: var(--text); }
.kopf nav a.abmelden { color: var(--rot); }

.banner-pause {
  background: #3a2a10; color: #f5d99a;
  border-bottom: 1px solid #5c4418;
  padding: .7rem clamp(1rem, 4vw, 2rem); font-size: .93rem;
}

/* ── Grundgerüst ───────────────────────────────────────────── */
main { padding: clamp(1.1rem, 4vw, 2rem); max-width: 1100px; margin: 0 auto; }
main.mitte {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.karte {
  background: var(--bg-karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 4vw, 1.6rem);
  margin-bottom: 1.1rem;
}
.karte.schmal { width: 100%; max-width: 420px; }
.karte.mittig { text-align: center; }
.karte.warnung { border-color: #5c4418; background: #221a0e; }

.hinweis { color: var(--text-leise); font-size: .92rem; margin: .2rem 0 1rem; }
.fuss    { color: var(--text-leise); font-size: .85rem; margin: 1.1rem 0 0; }
.klein   { color: var(--text-leise); font-size: .82rem; }
.nowrap  { white-space: nowrap; }
.fehlercode { font-size: 3rem; font-weight: 700; color: var(--text-leise); margin: 0 0 .4rem; }

/* ── Formulare ─────────────────────────────────────────────── */
label { display: block; font-size: .88rem; color: var(--text-leise); margin: .9rem 0 .3rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: .7rem .8rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--rand); border-radius: 10px;
  font-size: 16px; /* unter 16px zoomt iOS beim Antippen */
}
input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent; }

button {
  margin-top: 1.1rem; padding: .72rem 1.2rem;
  background: var(--akzent); color: #051323;
  border: 0; border-radius: 10px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  min-height: 44px; /* Fingergröße */
}
button:hover { filter: brightness(1.08); }
button.rot   { background: var(--rot);   color: #fff; }
button.gruen { background: var(--gruen); color: #fff; }
button.klein-knopf {
  margin-top: 0; padding: .5rem .85rem; font-size: .88rem;
  background: var(--bg-hoch); color: var(--text); border: 1px solid var(--rand);
}
button.klein-knopf.rot-leise { color: var(--rot); }

.knopf-leise {
  display: inline-block; margin-top: .8rem;
  padding: .5rem .9rem; border: 1px solid var(--rand); border-radius: 10px;
  color: var(--text-leise); text-decoration: none; font-size: .9rem;
}
.knopf-leise:hover { background: var(--bg-hoch); color: var(--text); }

.reihe { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.reihe > div { flex: 1 1 220px; }
.reihe label { margin-top: 0; }
.reihe button { margin-top: 0; }

/* ── Meldungen ─────────────────────────────────────────────── */
.meldungen { margin-bottom: 1.1rem; width: 100%; max-width: 420px; }
main:not(.mitte) .meldungen { max-width: none; }
.meldung {
  margin: 0 0 .5rem; padding: .7rem .9rem;
  border-radius: 10px; font-size: .92rem;
  border: 1px solid var(--rand); background: var(--bg-karte);
}
.meldung.ok     { border-color: #1f5c3f; background: #10241a; color: #a8e6c4; }
.meldung.fehler { border-color: #6b2730; background: #261215; color: #f3b4bb; }

/* ── Kacheln ───────────────────────────────────────────────── */
.kacheln {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 1.3rem;
}
.kachel {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.3rem;
  background: var(--bg-karte); border: 1px solid var(--rand);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  transition: transform .12s ease, border-color .12s ease;
}
.kachel:hover { transform: translateY(-2px); border-color: var(--akzent); }
.kachel-icon  { font-size: 1.9rem; line-height: 1; }
.kachel-titel { font-weight: 650; font-size: 1.08rem; }
.kachel-text  { color: var(--text-leise); font-size: .9rem; }

/* ── Bereichsseiten ────────────────────────────────────────── */
.bereich-kopf {
  display: flex; flex-wrap: wrap; gap: .8rem;
  align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.1rem;
}
.dashboard {
  width: 100%; height: min(78dvh, 900px);
  border: 1px solid var(--rand); border-radius: var(--radius);
  background: #fff;
}

/* ── Verwaltung ────────────────────────────────────────────── */
.nutzer { border-top: 1px solid var(--rand); padding: 1rem 0; }
.nutzer:first-of-type { border-top: 0; padding-top: 0; }
.nutzer.inaktiv { opacity: .55; }
.nutzer-kopf { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.marke-admin, .marke-gesperrt, .marke-neu {
  font-size: .72rem; padding: .16rem .5rem; border-radius: 999px; font-weight: 600;
}
.marke-admin   { background: #14304d; color: #8fc6ff; }
.marke-gesperrt{ background: #3d1a1f; color: #f3b4bb; }
.marke-neu     { background: #3a2a10; color: #f5d99a; }

.rechte { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: .7rem 0; }
.haken {
  display: inline-flex; align-items: center; gap: .4rem;
  margin: 0; color: var(--text); font-size: .92rem;
  padding: .45rem .7rem; background: var(--bg); border: 1px solid var(--rand);
  border-radius: 999px; cursor: pointer;
}
.haken input { width: 18px; height: 18px; accent-color: var(--akzent); }

.nutzer-aktionen { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.nutzer-aktionen form { display: flex; gap: .4rem; align-items: center; }
.nutzer-aktionen input { width: auto; min-width: 190px; padding: .5rem .7rem; }

.tabelle-huelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 620px; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rand); }
th { color: var(--text-leise); font-weight: 600; font-size: .8rem; }

@media (max-width: 560px) {
  .nutzer-aktionen form { width: 100%; }
  .nutzer-aktionen input { flex: 1; min-width: 0; }
}

/* ── SPX-Ansicht ───────────────────────────────────────────── */
.plus  { color: var(--gruen); }
.minus { color: var(--rot); }
.ziel-farbe { color: var(--gruen); }
.stop-farbe { color: var(--rot); }

.zahlen {
  display: grid; gap: .8rem; margin-bottom: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.zahl {
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--bg-karte); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: .95rem 1.1rem;
}
.zahl-label  { font-size: .78rem; color: var(--text-leise); text-transform: uppercase;
               letter-spacing: .04em; }
.zahl-wert   { font-size: clamp(1.35rem, 4.5vw, 1.75rem); font-weight: 700;
               font-variant-numeric: tabular-nums; }
.zahl-zusatz { font-size: .78rem; color: var(--text-leise); }

.erklaerung {
  background: var(--bg-karte); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.3rem;
}
.erklaerung em { color: var(--text); font-style: normal; font-weight: 600; }

.pos {
  background: var(--bg-karte); border: 1px solid var(--rand);
  border-left: 4px solid var(--rand);
  border-radius: var(--radius); padding: 1.1rem; margin-bottom: .9rem;
}
.pos.ziel  { border-left-color: var(--gruen); }
.pos.stop  { border-left-color: var(--rot); }
.pos.minus { border-left-color: var(--gelb); }

.pos-kopf {
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: space-between; align-items: flex-start; margin-bottom: .9rem;
}
.pos-titel { display: block; font-weight: 650; font-size: 1.05rem; }
.pos-unter { display: block; font-size: .83rem; color: var(--text-leise); }
.pos-pnl   { text-align: right; }
.pos-pnl-wert { display: block; font-size: 1.3rem; font-weight: 700;
                font-variant-numeric: tabular-nums; }
.pos-pnl-pct  { display: block; font-size: .8rem; color: var(--text-leise); }

.pos-fahne {
  margin: 0 0 .9rem; padding: .5rem .8rem; border-radius: 9px;
  font-size: .88rem; font-weight: 600;
}
.pos-fahne.ziel { background: #10241a; color: #a8e6c4; }
.pos-fahne.stop { background: #261215; color: #f3b4bb; }

.kurse {
  display: grid; gap: .6rem; margin-bottom: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.kurse > div {
  background: var(--bg); border: 1px solid var(--rand);
  border-radius: 10px; padding: .6rem .75rem;
}
.kurse span { display: block; font-size: .75rem; color: var(--text-leise); }
.kurse b    { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.kurse .ziel-farbe b { color: var(--gruen); }
.kurse .stop-farbe b { color: var(--rot); }

.skala { margin: 1rem 0; }
.skala-bahn {
  position: relative; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gruen) 0%, #4a5b3f 28%,
                              var(--bg-hoch) 50%, #6b4038 78%, var(--rot) 100%);
}
.skala-jetzt {
  position: absolute; top: 50%; width: 16px; height: 16px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #fff; border: 3px solid var(--bg-karte);
  box-shadow: 0 0 0 1px var(--rand);
}
.skala-entry {
  position: absolute; top: 50%; width: 2px; height: 18px;
  transform: translate(-50%, -50%); background: var(--text-leise);
}
.skala-enden {
  display: flex; justify-content: space-between;
  font-size: .75rem; margin-top: .45rem;
}

.abstaende {
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.abstand {
  background: var(--bg); border: 1px solid var(--rand);
  border-left: 3px solid var(--rand);
  border-radius: 10px; padding: .65rem .8rem;
}
.abstand.ziel-rand { border-left-color: var(--gruen); }
.abstand.stop-rand { border-left-color: var(--rot); }
.abstand-label { display: block; font-size: .75rem; color: var(--text-leise); }
.abstand b     { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.abstand-pct   { display: block; font-size: .78rem; color: var(--text-leise); }

details.karte summary { cursor: pointer; color: var(--text-leise); font-size: .92rem; }
details.karte[open] summary { margin-bottom: .9rem; }

.kontrolle.gut     { border-color: #1f5c3f; background: #101d18; }
.kontrolle.gut h2  { color: #a8e6c4; }
.kontrolle.warnung h2 { color: #f5d99a; }
.befunde { margin: .2rem 0 .9rem; padding-left: 1.2rem; font-size: .93rem; }
.befunde li { margin-bottom: .35rem; }
