:root {
  --bg: #f3f4f1;
  --panel: #ffffff;
  --text: #1d2321;
  --muted: #66706c;
  --line: #d9ddd8;
  --accent: #b3261e;      /* rot (Sanität) */
  --accent2: #1f4e79;     /* blau (Führung) */
  --ok: #2e7d32;
  --warn: #c77700;
  --bad: #b3261e;
  --sk1: #d32f2f; --sk2: #f2b600; --sk3: #388e3c;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
a { color: var(--accent2); }

.kopf { display: flex; align-items: center; gap: 24px; background: #1d2321; color: #fff; padding: 0 16px; height: 48px; position: sticky; top: 0; z-index: 10; }
.marke { font-weight: 700; white-space: nowrap; }
.marke span { font-weight: 400; color: #aab3ae; margin-left: 6px; font-size: 12px; }
nav { display: flex; gap: 2px; overflow-x: auto; }
nav a { color: #cfd6d2; text-decoration: none; padding: 14px 12px; white-space: nowrap; border-bottom: 3px solid transparent; }
nav a.aktiv { color: #fff; border-bottom-color: var(--accent); }
.uhr { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; letter-spacing: 1px; }
.uhr small { font-size: 12px; color: #aab3ae; font-weight: 400; letter-spacing: 0; margin-left: 8px; }

main { padding: 16px; max-width: 1800px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 0 0 10px; text-transform: none; }
h3 { font-size: 14px; margin: 14px 0 6px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 14px; }
.raster { display: grid; gap: 14px; }
.r3 { grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.3fr) minmax(320px, 1fr); }
.r2 { grid-template-columns: minmax(360px, 1fr) minmax(360px, 1.2fr); }
@media (max-width: 1100px) { .r3, .r2 { grid-template-columns: 1fr; } }

.leiste { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.leiste .abstand { flex: 1; }
.btn { border: 1px solid var(--line); background: #fff; padding: 5px 10px; border-radius: 4px; cursor: pointer; color: var(--text); }
.btn:hover { background: #eef0ed; }
.btn.prim { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn.prim:hover { background: #163a5b; }
.btn.rot { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.klein { padding: 2px 7px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.f input, label.f select, label.f textarea { color: var(--text); }
input, select, textarea { border: 1px solid #c4c9c4; border-radius: 4px; padding: 5px 7px; background: #fff; }
textarea { resize: vertical; }
.formraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.formraster .breit { grid-column: 1 / -1; }
.chk { display: inline-flex; gap: 5px; align-items: center; }

.muted { color: var(--muted); }
.klein { font-size: 12px; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 11px; background: #e7eae6; color: #3b4440; white-space: nowrap; }
.tag.ok { background: #dcefdc; color: var(--ok); }
.tag.warn { background: #fdecc8; color: #8a5300; }
.tag.bad { background: #f8d7d5; color: var(--bad); }
.tag.blau { background: #dde8f3; color: var(--accent2); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { max-height: 520px; overflow: auto; }

/* FMS-Status */
.fms { display: inline-block; min-width: 22px; text-align: center; border-radius: 3px; font-weight: 700; color: #fff; padding: 1px 4px; }
.fms1 { background: #43a047; } .fms2 { background: #2e7d32; } .fms3 { background: #f9a825; color: #222; }
.fms4 { background: #ef6c00; } .fms6 { background: #757575; } .fms7 { background: #1565c0; } .fms8 { background: #6a1b9a; }

/* Sichtungskategorien */
.sk { display: inline-block; min-width: 34px; text-align: center; border-radius: 3px; font-weight: 700; padding: 1px 4px; font-variant-numeric: tabular-nums; }
.sk1 { background: var(--sk1); color: #fff; } .sk2 { background: var(--sk2); color: #222; } .sk3 { background: var(--sk3); color: #fff; }

.es-karte { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 4px; padding: 8px 10px; margin-bottom: 10px; }
.es-karte.inaktiv { border-left-color: #bbb; opacity: .7; }
.es-karte .kopfzeile { display: flex; justify-content: space-between; gap: 8px; }
.kennz { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px 12px; margin: 6px 0; font-size: 12px; }
.kennz b { font-variant-numeric: tabular-nums; }
.balken { height: 6px; background: #e7eae6; border-radius: 3px; overflow: hidden; margin-top: 2px; }
.balken > div { height: 100%; background: var(--ok); }
.balken.bad > div { background: var(--bad); }

.msg { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; margin-bottom: 8px; background: #fff; }
.msg.ein { border-left: 4px solid var(--accent2); background: #f6f9fc; }
.msg.aus { border-left: 4px solid #8d9690; }
.msg.faellig { border-left-color: var(--warn); background: #fff8ec; }
.msg.freigabe { border-left-color: #8e24aa; background: #faf3fc; }
.msg.neu { border-left-color: var(--accent); background: #fff1f0; box-shadow: 0 0 0 2px #f4b4ae; }
.msg .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg .text { margin: 4px 0; white-space: pre-wrap; }
.msg .hinweis { font-size: 12px; color: #8a5300; }
.msg .erkannt { font-size: 12px; color: var(--accent2); }

.fortschritt { font-size: 34px; font-weight: 700; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kachel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.kachel .wert { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kachel .lbl { font-size: 12px; color: var(--muted); }

.editor-liste .karte { border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 8px; background: #fbfcfb; }
.editor-liste .karte .leiste { margin-bottom: 6px; }
.editor-tabelle input, .editor-tabelle select { width: 100%; min-width: 60px; padding: 3px 5px; }
.editor-tabelle td { padding: 2px 3px; }
.editor-tabelle input[type=number] { min-width: 55px; }

#toast { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 50; }
#toast div { background: #1d2321; color: #fff; padding: 8px 14px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
#toast div.err { background: var(--bad); }

.ausgangslage { white-space: pre-wrap; background: #fffbe6; border: 1px solid #efe1a6; padding: 8px 10px; border-radius: 4px; }
.leer { color: var(--muted); padding: 10px 0; }

@media print {
  .kopf, .btn, .noprint { display: none !important; }
  main { padding: 0; }
  .panel { border: none; padding: 0; }
}

/* Kopfzeile: angemeldet als */
.wer { font-size: 12px; color: #cfd6d2; white-space: nowrap; }
.wer a { color: #fff; margin-left: 6px; }

/* Lageanzeige (Beamer im Stabsraum) */
body.vollbild { background: #0f1412; }
body.vollbild .kopf { display: none; }
body.vollbild main { max-width: none; padding: 0; }
.anz { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5vh; color: #f1f4f2; padding: 3vh 4vw; font-variant-numeric: tabular-nums; }
.anz-kopf { position: absolute; top: 2vh; left: 3vw; right: 3vw; font-size: 2.2vh; color: #aab3ae; }
.anz-uebung { background: var(--accent); color: #fff; font-weight: 700; padding: 0.3vh 1vw; border-radius: 4px; letter-spacing: 2px; margin-right: 1vw; }
.anz-uhr { font-size: 24vh; font-weight: 700; line-height: 1; letter-spacing: 0.5vw; }
.anz-datum { font-size: 5vh; color: #cfd6d2; }
.anz-warn { font-size: 3.4vh; background: #b3261e; color: #fff; padding: 1vh 2vw; border-radius: 6px; max-width: 85vw; text-align: center; font-weight: 600; }
.anz-wetter { display: flex; align-items: center; gap: 4vw; margin-top: 2vh; font-size: 3vh; }
.anz-temp { font-size: 12vh; font-weight: 700; }
.anz-temp span { font-size: 5vh; color: #aab3ae; margin-left: 0.5vw; }
.anz-wbeschr { font-size: 4vh; font-weight: 600; margin-bottom: 1vh; }
.anz-wdet .lbl { color: #8d9690; display: inline-block; min-width: 13vw; }
.anz-fuss { position: absolute; bottom: 2vh; left: 3vw; right: 3vw; display: flex; font-size: 2.2vh; color: #8d9690; }
.anz-fuss a { color: #8d9690; }
.anz-fuss .abstand { flex: 1; }
