/* OLWF Ausbildung – Gestaltung angelehnt an das Erscheinungsbild des THW (THW-Blau, Weiß) */
:root {
  --blau: #003399;
  --blau-dunkel: #00226b;
  --blau-hell: #e6ecf8;
  --blau-mittel: #c9d5ef;
  --grund: #f2f4f8;
  --karte: #ffffff;
  --text: #14213d;
  --text-2: #5a6478;
  --linie: #dde2ec;
  --gruen: #2e7d32;
  --gruen-hell: #e8f3e9;
  --gelb: #f5b800;
  --gelb-hell: #fff6d6;
  --rot: #c62828;
  --rot-hell: #fdeaea;
  --radius: 12px;
  --schatten: 0 1px 2px rgba(20, 33, 61, .06), 0 2px 8px rgba(20, 33, 61, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--grund); color: var(--text);
  font: 16px/1.45 "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blau); }

/* Kopfbereich */
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: var(--blau); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.kopf img { width: 40px; height: 40px; flex: none; }
.kopf .titel { font-weight: 700; font-size: 18px; letter-spacing: .2px; line-height: 1.15; }
.kopf .unter { font-size: 12.5px; opacity: .85; }
.kopf .rechts { margin-left: auto; display: flex; gap: 6px; }
.kopf button.icon { background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }

/* Navigation unten */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--linie);
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; max-width: 150px; text-align: center; text-decoration: none; color: var(--text-2);
  font-size: 11.5px; padding: 8px 2px 7px; position: relative;
}
.nav a .sym { display: block; font-size: 21px; line-height: 1.1; filter: grayscale(1); opacity: .7; }
.nav a.aktiv { color: var(--blau); font-weight: 600; }
.nav a.aktiv .sym { filter: none; opacity: 1; }
.badge {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--rot); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav .badge { position: absolute; top: 3px; left: 50%; margin-left: 6px; }

/* Karten & Listen */
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 14px 16px; margin-bottom: 12px; }
.karte h2, .karte h3 { margin: 0 0 8px; }
h1 { font-size: 21px; margin: 4px 0 12px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.monat { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--blau); margin: 18px 4px 8px; }
.leer { color: var(--text-2); text-align: center; padding: 24px 8px; }
.klein { font-size: 13px; color: var(--text-2); }
.fehler { background: var(--rot-hell); color: var(--rot); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.ok { background: var(--gruen-hell); color: var(--gruen); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.hinweis { background: var(--gelb-hell); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }

.termin {
  display: flex; gap: 12px; background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: inherit; border-left: 5px solid var(--blau);
}
.termin.art-termin { border-left-color: var(--gruen); }
.termin.art-feiertag { border-left-color: var(--gelb); background: var(--gelb-hell); }
.termin.art-hinweis { border-left-color: var(--gelb); }
.termin.abgesagt { opacity: .6; }
.termin.abgesagt .was { text-decoration: line-through; }
.termin.vergangen { opacity: .7; }
.termin.heute { outline: 2px solid var(--blau); }
.termin .tag { flex: none; width: 48px; text-align: center; }
.termin .tag .wt { font-size: 12px; color: var(--text-2); text-transform: uppercase; }
.termin .tag .nr { font-size: 22px; font-weight: 700; line-height: 1.1; }
.termin .inhalt { min-width: 0; flex: 1; }
.termin .zeile1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); }
.termin .was { font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.termin .themen { font-size: 13.5px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--blau-hell); color: var(--blau); }
.chip.gruen { background: var(--gruen-hell); color: var(--gruen); }
.chip.gelb { background: var(--gelb-hell); color: #7a5b00; }
.chip.rot { background: var(--rot-hell); color: var(--rot); }
.chip.grau { background: #eef0f4; color: var(--text-2); }

/* Filter */
.filter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter button {
  flex: none; border: 1px solid var(--blau-mittel); background: #fff; color: var(--blau);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer;
}
.filter button.an { background: var(--blau); color: #fff; border-color: var(--blau); }

/* Formulare */
label { display: block; font-size: 13.5px; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; border: 1px solid #c4cbd8; border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blau); outline-offset: 0; border-color: var(--blau); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 10px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--blau); }
.reihe { display: flex; gap: 10px; }
.reihe > * { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; cursor: pointer;
  background: var(--blau); color: #fff; text-decoration: none; min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn.zweit { background: var(--blau-hell); color: var(--blau); }
.btn.rot { background: var(--rot); }
.btn.gruen { background: var(--gruen); }
.btn.klein { padding: 6px 10px; min-height: 34px; font-size: 14px; }
.btn.voll { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 0 auto; }
.anmeldung .logo { text-align: center; margin: 18px 0 8px; }
.anmeldung .logo img { width: 104px; height: 104px; border-radius: 50%; background: #fff; box-shadow: var(--schatten); }
.anmeldung h1 { text-align: center; margin-bottom: 2px; color: var(--blau); }
.anmeldung .ov { text-align: center; color: var(--text-2); margin-bottom: 16px; }
.wechsel { text-align: center; margin-top: 14px; }
.wechsel button { background: none; border: 0; color: var(--blau); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Termin-Detail */
.detail-kopf { border-left: 5px solid var(--blau); }
.feld { margin: 6px 0; }
.feld .k { font-size: 12.5px; color: var(--text-2); }
.feld .v { white-space: pre-wrap; overflow-wrap: anywhere; }
.thema { border-top: 1px solid var(--linie); padding: 10px 0; }
.thema:first-child { border-top: 0; }
.thema .t { font-weight: 600; overflow-wrap: anywhere; }
.thema .m { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.thema details { margin-top: 6px; }
.thema summary { cursor: pointer; color: var(--blau); font-size: 13.5px; }
.thema .lang { white-space: pre-wrap; font-size: 14px; margin-top: 6px; overflow-wrap: anywhere; }
.thema .aktionen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Nachrichten */
.nachricht { border-left: 4px solid var(--blau-mittel); }
.nachricht.neu { border-left-color: var(--rot); }
.nachricht .kopfzeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.nachricht .betreff { font-weight: 700; margin-top: 3px; }
.nachricht .text { white-space: pre-wrap; margin-top: 3px; overflow-wrap: anywhere; }

/* Benutzer */
.nutzer { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--linie); padding: 10px 0; }
.nutzer:first-of-type { border-top: 0; }
.nutzer .n { flex: 1; min-width: 0; }
.nutzer .name { font-weight: 600; overflow-wrap: anywhere; }

/* Dialog */
.dialog-hg { position: fixed; inset: 0; background: rgba(10, 20, 45, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.dialog {
  background: #fff; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .dialog-hg { align-items: center; } .dialog { border-radius: 16px; } }

.toast {
  position: fixed; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.lade { text-align: center; color: var(--text-2); padding: 40px 0; }
.fuss { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 20px; }
