/* Klardis: schlichtes, mobilfreundliches Design ohne externe Dateien */
:root {
  --bg: #f4f6f7;
  --karte: #ffffff;
  --text: #17222a;
  --leise: #5b6b76;
  --linie: #dbe2e6;
  --akzent: #0f766e;
  --akzent-dunkel: #0b5a54;
  --akzent-hell: #d7f0ec;
  --ok: #15803d;
  --ok-hell: #dcfce7;
  --warn: #a16207;
  --warn-hell: #fef3c7;
  --fehler: #b91c1c;
  --fehler-hell: #fee2e2;
  --info: #1d4ed8;
  --info-hell: #dbeafe;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f171c;
    --karte: #17222a;
    --text: #e6edf1;
    --leise: #9fb0ba;
    --linie: #2a3a44;
    --akzent: #2dd4bf;
    --akzent-dunkel: #5eead4;
    --akzent-hell: #12403c;
    --ok: #4ade80;
    --ok-hell: #11331f;
    --warn: #fbbf24;
    --warn-hell: #3b2f0a;
    --fehler: #f87171;
    --fehler-hell: #3b1414;
    --info: #93c5fd;
    --info-hell: #14284d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--akzent); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
p { margin: 0 0 .8rem; }
.leise { color: var(--leise); }
.klein { font-size: .9rem; }
.warnung { color: var(--warn); font-weight: 600; }

/* Kopf und Menue */
.kopf {
  background: var(--karte); border-bottom: 1px solid var(--linie);
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
  position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: .3px; text-decoration: none; color: var(--akzent); }
.kopf nav { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .3rem; flex: 1; }
.kopf nav a, .kopf nav button {
  color: var(--text); text-decoration: none; padding: .45rem .7rem; border-radius: 8px;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.kopf nav a:hover, .kopf nav button:hover, .kopf nav a.aktiv { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.kopf form { margin: 0; margin-left: auto; }
@media (max-width: 640px) {
  .kopf { flex-wrap: wrap; }
  .kopf .logo { order: 1; }
  .kopf form { order: 2; }
  .kopf nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -.3rem; padding-bottom: .1rem; }
  .kopf nav a { white-space: nowrap; }
}

/* kleine Hilfsklassen (Inline-Styles sind per Sicherheitsrichtlinie nicht erlaubt) */
.ohne-rand-oben { margin-top: 0 !important; }
.rand-unten { margin: 0 0 1rem !important; }
.rand-oben-klein { margin-top: .7rem !important; }
.ohne-rand { margin: 0 !important; }

main { max-width: 980px; margin: 0 auto; padding: 1.1rem 1rem 3rem; }
.schmal { max-width: 440px; }

/* Karten, Raster */
.karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1rem; margin: 0 0 1rem;
}
.raster { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 1rem; }
.kachel {
  display: block; text-decoration: none; color: inherit; background: var(--karte);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.1rem;
}
.kachel:hover { border-color: var(--akzent); }
.kachel strong { display: block; font-size: 1.1rem; color: var(--akzent-dunkel); margin-bottom: .2rem; }

/* Formulare */
label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
input[type=text], input[type=password], input[type=number], input:not([type]) {
  width: 100%; padding: .7rem .8rem; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--linie); border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--akzent); outline-offset: 2px;
}
.haken { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; margin: .5rem 0; }
.haken input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; flex: none; }
.knopf {
  display: inline-block; padding: .7rem 1.1rem; font: inherit; font-weight: 600; text-decoration: none;
  background: var(--akzent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; min-height: 44px;
}
@media (prefers-color-scheme: dark) { .knopf { color: #06201d; } }
.knopf:hover { filter: brightness(.93); }
.knopf[disabled] { opacity: .5; cursor: default; }
.knopf.zweit { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.knopf.gefahr { background: var(--fehler); color: #fff; }
.knopf.klein { padding: .4rem .7rem; min-height: 36px; font-size: .9rem; }
.zeile { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .8rem; }

/* Meldungen */
.meldung { padding: .7rem .9rem; border-radius: 8px; margin: 0 0 1rem; border: 1px solid transparent; }
.meldung.ok { background: var(--ok-hell); color: var(--ok); border-color: var(--ok); }
.meldung.fehler { background: var(--fehler-hell); color: var(--fehler); border-color: var(--fehler); }

/* Status */
.pille { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.pille.gruen { background: var(--ok-hell); color: var(--ok); }
.pille.gelb { background: var(--warn-hell); color: var(--warn); }
.pille.rot { background: var(--fehler-hell); color: var(--fehler); }
.pille.blau { background: var(--info-hell); color: var(--info); }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: .8rem 0; }
.zahl { background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: .6rem .8rem; }
.zahl b { display: block; font-size: 1.5rem; line-height: 1.2; }
.zahl span { color: var(--leise); font-size: .9rem; }
pre.log {
  background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; padding: .7rem;
  overflow-x: auto; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-height: 320px; white-space: pre; margin: .5rem 0 0;
}
details summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }

/* Upload */
.ablage {
  border: 2px dashed var(--linie); border-radius: var(--radius); padding: 1.2rem; text-align: center;
  background: var(--bg); color: var(--leise);
}
.ablage.ueber { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent-dunkel); }
.ablage input[type=file] { display: none; }
.fotoliste { list-style: none; margin: .8rem 0; padding: 0; display: grid; gap: .4rem; }
.foto {
  display: grid; grid-template-columns: 2rem 56px 1fr auto; align-items: center; gap: .6rem;
  background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: .4rem .6rem;
}
.foto.ohnebild { grid-template-columns: 2rem 1fr auto; }
.foto img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--linie); }
.foto .nr { font-weight: 700; color: var(--leise); text-align: right; }
.foto .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.foto .name small { display: block; color: var(--leise); }
.foto.fertig { border-color: var(--ok); }
.foto.fehler { border-color: var(--fehler); }
.foto .aktionen { display: flex; gap: .25rem; }
.foto .aktionen button {
  min-width: 40px; min-height: 40px; border-radius: 8px; border: 1px solid var(--linie);
  background: var(--karte); color: var(--text); font: inherit; cursor: pointer;
}
.fortschritt { height: 10px; background: var(--linie); border-radius: 999px; overflow: hidden; margin: .6rem 0; }
.fortschritt div { height: 100%; width: 0; background: var(--akzent); transition: width .2s; }
.hinweisbox { background: var(--akzent-hell); color: var(--akzent-dunkel); border-radius: 10px; padding: .7rem .9rem; margin-bottom: .8rem; }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th, .tabelle td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { color: var(--leise); font-weight: 600; }
.scroll { overflow-x: auto; }
code.passwort {
  display: block; font: 600 1.3rem ui-monospace, Menlo, Consolas, monospace; background: var(--bg);
  border: 1px dashed var(--akzent); border-radius: 8px; padding: .8rem; text-align: center; letter-spacing: 1px;
  user-select: all; word-break: break-all;
}
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
[hidden] { display: none !important; }

@media (max-width: 520px) {
  h1 { font-size: 1.35rem; }
  .foto { grid-template-columns: 1.6rem 48px 1fr; }
  .foto.ohnebild { grid-template-columns: 1.6rem 1fr; }
  .foto .aktionen { grid-column: 1 / -1; justify-content: flex-end; }
  .foto img { width: 48px; height: 48px; }
}
