﻿:root {
  --red: #b3141b;
  --red-dark: #8c0f15;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --line: #d9dce1;
  --text: #1c1f24;
  --muted: #6b7280;
  --ok: #1b7f3b;
  --warn: #b45309;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
h1, h2, h3 { margin: 0 0 8px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--red-dark); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar { display: flex; align-items: center; justify-content: space-between; background: var(--red); color: #fff; padding: 8px 16px; height: 44px; }
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar .tag { font-weight: 400; font-size: 12px; opacity: .85; margin-left: 8px; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar .who { opacity: .85; }

.btn { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 6px; cursor: pointer; font: inherit; text-decoration: none; }
.btn:hover { background: #f0f1f3; }
.btn.primary { background: var(--red); border-color: var(--red-dark); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.danger { color: #a40000; border-color: #e3b4b4; }
.btn.big { width: 100%; padding: 10px; font-size: 15px; font-weight: 600; margin-bottom: 6px; }

input, select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
label { display: block; font-size: 12px; color: var(--muted); }
label input, label select { margin-top: 2px; color: var(--text); }

.alert { padding: 8px 12px; border-radius: 6px; margin: 8px 0; word-break: break-word; }
.alert.err { background: #fde8e8; color: #8a1c1c; border: 1px solid #f3b8b8; }
.alert.ok { background: #e6f4ea; color: #14532d; border: 1px solid #b7e0c3; }
.alert.warn { background: #fff4e0; color: #7a4a00; border: 1px solid #f1d49b; }

.badge { padding: 1px 6px; border-radius: 10px; font-size: 11px; }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fff4e0; color: var(--warn); }

/* Login / Setup */
body.auth { display: flex; align-items: center; justify-content: center; }
.auth-box { background: #fff; padding: 28px; border-radius: 10px; width: 360px; box-shadow: 0 6px 24px rgba(0,0,0,.12); border-top: 5px solid var(--red); }
.auth-box form { display: grid; gap: 12px; margin-top: 12px; }

/* App */
body.app { display: flex; flex-direction: column; height: 100vh; }
.layout { flex: 1; display: grid; grid-template-columns: 390px 1fr; min-height: 0; }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 14px 24px; }
.panel section { padding: 10px 0; border-bottom: 1px solid var(--line); }
.row { display: flex; gap: 8px; margin: 6px 0; align-items: center; }
.row.two > * { flex: 1; }
.row .full { width: 100%; }
#mapWrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }

ul.results { list-style: none; margin: 4px 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; max-height: 190px; overflow-y: auto; }
ul.results:empty { display: none; }
ul.results li { padding: 6px 8px; cursor: pointer; border-bottom: 1px solid #eee; }
ul.results li:last-child { border-bottom: 0; }
ul.results li:hover { background: #fdecec; }
ul.results small { color: var(--muted); }

.subinfo { font-size: 12px; margin-top: 6px; }
.subinfo table { width: 100%; border-collapse: collapse; }
.subinfo td { padding: 2px 4px; border-bottom: 1px solid #f0f0f0; }
.subinfo td:first-child { color: var(--muted); width: 45%; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { background: #f7f7f8; font-size: 12px; }
table.grid.compact th, table.grid.compact td { padding: 4px 6px; font-size: 12px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid #000; vertical-align: -2px; margin-right: 4px; }
.disclaimer { color: var(--muted); border-bottom: 0 !important; }

/* Admin */
main.admin { max-width: 1200px; margin: 16px auto; padding: 0 16px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs a { padding: 8px 14px; background: #e5e7eb; border-radius: 6px 6px 0 0; text-decoration: none; color: var(--text); }
.tabs a.active { background: #fff; font-weight: 600; border-bottom: 2px solid var(--red); }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; background: #fff; padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.inline-form label { min-width: 160px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; background: #fff; padding: 16px; border-radius: 8px; }
.form-grid .check { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.form-grid .check input { width: auto; margin: 0; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
form.mini { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
td.actions { white-space: nowrap; }

/* Leaflet-Details */
.wind-label { background: rgba(255,255,255,.9); border: 1px solid #333; border-radius: 4px; padding: 1px 5px; font-size: 11px; white-space: nowrap; }
.src-pin { width: 18px; height: 18px; border-radius: 50%; background: #000; border: 3px solid #fff; box-shadow: 0 0 0 2px #000; }
.leaflet-container { font: inherit; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 60vh; }
  .panel { max-height: 55vh; border-right: 0; border-bottom: 1px solid var(--line); }
  body.app { height: auto; }
}
@media print {
  .topbar, .panel { display: none !important; }
  .layout { display: block; }
  #mapWrap { position: static; height: 100vh; }
  #map { position: static; height: 100vh; }
}

.opacity-row { margin-top: 10px; }
.opacity-row input[type=range] { padding: 0; border: 0; margin-top: 4px; }

/* ===== Portal-Layout ===== */
.shell { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 230px; flex: none; background: #24272d; color: #e5e7eb; padding: 12px 0; overflow-y: auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; color: #d1d5db; text-decoration: none; border-left: 4px solid transparent; }
.sidebar a:hover { background: #31353c; color: #fff; }
.sidebar a.active { background: #3a1517; border-left-color: var(--red); color: #fff; font-weight: 600; }
.sidebar .ico { font-size: 18px; width: 24px; text-align: center; }
.content { flex: 1; min-width: 0; overflow-y: auto; }
.content.full { overflow: hidden; display: flex; }
.content.full .layout { flex: 1; min-width: 0; }
body.is-full .sidebar { width: 58px; }
body.is-full .sidebar a { padding: 11px 0; justify-content: center; }
body.is-full .sidebar .lbl { display: none; }

.page { max-width: 1100px; margin: 0 auto; padding: 22px 24px 48px; }
.page h1 { font-size: 24px; margin: 0 0 14px; }
.page h2 { font-size: 17px; margin: 22px 0 10px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.card.welcome { border-left: 4px solid var(--red); }
.news-card h3 { margin: 6px 0 4px; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--text); }
.news-card h3 a { color: inherit; text-decoration: none; }
.news-card h3 a:hover { color: var(--red); }
.news-card p { margin: 0; color: #374151; }
.news-card.pinned { border-left: 4px solid var(--red); background: #fffafa; }
.article h1 { margin-top: 10px; }
.article .body { font-size: 15px; line-height: 1.6; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-block; background: #eef0f3; border-radius: 10px; padding: 1px 9px; font-size: 12px; }
.chip.pin { background: #fde8e8; color: #8a1c1c; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--red); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.tile .ico { font-size: 28px; }
.tile.accent { background: var(--red); color: #fff; border-color: var(--red-dark); }
.tile.accent:hover { background: var(--red-dark); }
.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.filelist { list-style: none; padding: 0; margin: 0; }
.filelist li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.filters { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 200px; width: auto; }
.filters select { width: auto; }
.form-stack { display: grid; gap: 12px; }
.form-stack textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.form-stack .check, label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.form-stack .check input, label.check input { width: auto; margin: 0; }
.upload-box summary { cursor: pointer; margin-bottom: 8px; }
.pager { display: flex; gap: 6px; margin-top: 12px; }
table.files td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.perm-form { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.perm-form label { display: flex; align-items: center; gap: 6px; color: var(--text); }
.perm-form input { width: auto; margin: 0; }
.alert.warn { background: #fff4e0; color: #7a4a00; border: 1px solid #f1d49b; }
a { color: #9b1118; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; padding: 0; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .sidebar a { border-left: 0; border-bottom: 3px solid transparent; padding: 10px 14px; white-space: nowrap; }
  .sidebar a.active { border-bottom-color: var(--red); }
  body.is-full .sidebar { width: auto; }
  body.is-full .sidebar .lbl { display: inline; }
  .two-col { grid-template-columns: 1fr; }
  .content { overflow: visible; }
  body.app { height: auto; min-height: 100vh; }
}
@media print { .sidebar { display: none !important; } }

/* ===== Kalender ===== */
.cal-nav { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.cal-nav strong { min-width: 160px; text-align: center; font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-head { background: #f7f7f8; padding: 6px; text-align: center; font-weight: 600; font-size: 12px; }
.cal-day { background: #fff; min-height: 96px; padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day.other { background: #f6f6f7; color: var(--muted); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-num { font-size: 12px; font-weight: 600; }
.cal-ev { display: block; color: #fff; text-decoration: none; font-size: 11.5px; padding: 1px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev:hover { filter: brightness(.9); }
.ev-detail { margin-top: 14px; }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-picker label { cursor: pointer; }
.color-picker input { position: absolute; opacity: 0; width: 0; }
.color-picker span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.color-picker input:checked + span { box-shadow: 0 0 0 3px #000; }
.color-picker input:focus-visible + span { outline: 2px solid #1d6fd1; outline-offset: 3px; }
.form-stack .row.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

/* ===== Übungsauswertung ===== */
.page.wide { max-width: 1500px; }
.ex-wrap { overflow-x: auto; }
table.ex { border-collapse: collapse; background: #fff; font-size: 13px; width: 100%; }
table.ex th, table.ex td { border: 1px solid #333; padding: 3px 6px; text-align: center; }
table.ex .ex-title { background: #ea9999; font-size: 22px; padding: 6px; }
table.ex thead th { background: #93c47d; }
table.ex .ex-name { text-align: left; min-width: 170px; background: inherit; white-space: nowrap; }
table.ex tbody tr:nth-child(even) td { background: #e5e5e5; }
table.ex td.ex-cell input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
table.ex td.ex-cell input:disabled { cursor: default; }
table.ex td.ex-pct.good { background: #6aa84f !important; font-weight: 600; }
table.ex td.ex-pct.bad { background: #ea9999 !important; }
table.ex tbody tr:hover td { filter: brightness(.96); }
.role-matrix td.center, .role-matrix th:not(:first-child) { text-align: center; }
.role-matrix input { width: auto; }
@media (max-width: 860px) { .cal-day { min-height: 64px; } .cal-ev { font-size: 10px; } }

/* ===== Logo / Kopfzeile ===== */
.topbar { background: #fff; color: var(--text); border-bottom: 4px solid var(--red); height: 56px; }
.topbar a, .topbar .who { color: var(--text); }
.topbar .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 15px; }
.topbar .brand:hover { text-decoration: none; }
.topbar .tag { color: var(--muted); }
.logo-top { height: 40px; width: auto; display: block; }
.auth-box .logo { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto 12px; }
.sidebar .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
@media (max-width: 560px) { .topbar .brand span { display: none; } }

.auth-box h1, .auth-box > p { text-align: center; }

body.auth { background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.35)), url('login-bg.jpg') center / cover no-repeat fixed; }
.auth-box { box-shadow: 0 10px 40px rgba(0,0,0,.45); }

/* Kacheln immer nebeneinander */
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); overflow-x: auto; }
.tile { min-width: 0; }
[hidden] { display: none !important; }

/* Kacheln: immer eine Reihe, schrumpfen passend zur Seitenbreite (kein Schieber) */
.tiles { overflow: visible; gap: clamp(6px, 1vw, 12px); }
.tile { padding: clamp(8px, 1.2vw, 16px); overflow-wrap: anywhere; hyphens: auto; text-align: center; align-items: center; }
.tile strong { font-size: clamp(11px, 1.15vw, 15px); line-height: 1.2; }
.tile .small { font-size: clamp(9px, .85vw, 12px); line-height: 1.25; }
.tile .ico { font-size: clamp(20px, 2.4vw, 28px); }
@media (max-width: 560px) { .tile .small { display: none; } }

.logo-top.patch { height: 46px; }

/* ===== Profil / Avatar ===== */
.topbar .who { display: flex; align-items: center; gap: 8px; text-decoration: none; opacity: 1; }
.topbar .who:hover span:last-child { text-decoration: underline; }
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex: none; background: #e5e7eb; }
.avatar.small { width: 32px; height: 32px; font-size: 14px; }
.avatar.big { width: 140px; height: 140px; font-size: 56px; }
.avatar.initial { background: var(--red); color: #fff; font-weight: 700; }
.avatar-big { display: flex; justify-content: center; margin-bottom: 12px; }
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }

/* Verfasser mit Profilbild */
.avatar.tiny { width: 22px; height: 22px; font-size: 11px; }
.author { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; color: var(--text); font-weight: 600; }
.meta-line { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* Stichwort-Baukasten (Einsätze / Übungen) */
.kw-builder { border: 1px solid var(--line, #d6d9de); border-radius: 10px; padding: 12px 14px; background: rgba(127,127,127,.06); }
.kw-head { margin-bottom: 6px; }
.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; align-items: center; padding: 8px 10px; margin-bottom: 12px; background: #fff; border: 1px dashed #c7cbd1; border-radius: 8px; }
.kw-empty { color: #8a9099; font-size: .92em; }
.kw-chip { display: inline-flex; align-items: center; gap: 4px; background: #fde8e9; color: #8a1118; border: 1px solid #f3b9bc; border-radius: 999px; padding: 3px 6px 3px 12px; font-weight: 600; font-size: .95em; line-height: 1.3; }
.kw-chip.kw-main { background: #b3141b; border-color: #b3141b; color: #fff; }
.kw-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.12); color: inherit; cursor: pointer; font-size: 1em; line-height: 1; padding: 0; }
.kw-x:hover { background: rgba(0,0,0,.28); }
.kw-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.kw-pick label { font-size: .88em; }
.kw-pick select { width: 100%; }
.kw-pick select:disabled { opacity: .55; }
.kw-own { display: flex; gap: 8px; }
.kw-own input { flex: 1 1 auto; min-width: 0; }
.kw-own .btn { white-space: nowrap; }
@media (max-width: 640px) { .kw-pick { grid-template-columns: 1fr; } .kw-own { flex-wrap: wrap; } .kw-own .btn { width: 100%; } }

/* ===== Dunkelmodus (html[data-theme="dark"]; Umschalter oben rechts) ===== */
.theme-btn { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.theme-btn:hover { background: rgba(128,128,128,.18); }
.theme-float { position: fixed; top: 12px; right: 12px; z-index: 50; background: rgba(255,255,255,.85); }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121418; --panel: #1c1f24; --line: #343942; --text: #e6e8eb; --muted: #9aa1ab;
  --ok: #5fcf85; --warn: #f0a74a;
}
html[data-theme="dark"] .theme-float { background: rgba(28,31,36,.85); }
html[data-theme="dark"] a { color: #ff8a90; }
html[data-theme="dark"] .btn { background: #262a31; color: var(--text); }
html[data-theme="dark"] .btn:hover { background: #30353d; }
html[data-theme="dark"] .btn.primary { background: var(--red); color: #fff; }
html[data-theme="dark"] .btn.primary:hover { background: var(--red-dark); }
html[data-theme="dark"] .btn.danger { color: #ff8a8a; border-color: #6b3030; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] .form-stack textarea, html[data-theme="dark"] textarea { background: #14171b; color: var(--text); border-color: var(--line); }
html[data-theme="dark"] input:disabled { background: #1c1f24; color: var(--muted); }
html[data-theme="dark"] .alert.err { background: #3a1c1c; color: #ffb4b4; border-color: #6b3030; }
html[data-theme="dark"] .alert.ok { background: #1b3325; color: #a8e6bd; border-color: #2f5a3f; }
html[data-theme="dark"] .alert.warn { background: #3a2e17; color: #f3cd8b; border-color: #6b5426; }
html[data-theme="dark"] .badge.ok { background: #1b3325; }
html[data-theme="dark"] .badge.warn { background: #3a2e17; }
html[data-theme="dark"] .auth-box, html[data-theme="dark"] .card, html[data-theme="dark"] .tile, html[data-theme="dark"] .inline-form,
html[data-theme="dark"] .form-grid, html[data-theme="dark"] table.grid, html[data-theme="dark"] .cal-day { background: var(--panel); }
html[data-theme="dark"] .tile.accent { background: var(--red); }
html[data-theme="dark"] .auth-box { box-shadow: 0 10px 40px rgba(0,0,0,.7); }
html[data-theme="dark"] .news-card.pinned { background: #271b1c; }
html[data-theme="dark"] .news-card p { color: #c5cad1; }
html[data-theme="dark"] .chip { background: #2a2e35; color: var(--text); }
html[data-theme="dark"] .chip.pin { background: #4a2326; color: #ffb4b4; }
html[data-theme="dark"] table.grid th, html[data-theme="dark"] .cal-head { background: #23272d; }
html[data-theme="dark"] .subinfo td { border-bottom-color: #2a2e35; }
html[data-theme="dark"] ul.results li { border-bottom-color: #2a2e35; }
html[data-theme="dark"] ul.results li:hover { background: #2f2023; }
html[data-theme="dark"] .tabs a { background: #262a31; }
html[data-theme="dark"] .tabs a.active { background: var(--panel); }
html[data-theme="dark"] .cal-day.other { background: #17191d; }
html[data-theme="dark"] .color-picker span { border-color: var(--panel); }
html[data-theme="dark"] .color-picker input:checked + span { box-shadow: 0 0 0 3px #fff; }
html[data-theme="dark"] .avatar { background: #2a2e35; }
html[data-theme="dark"] .avatar.initial { background: var(--red); }
html[data-theme="dark"] .topbar { background: #1c1f24; color: var(--text); }
html[data-theme="dark"] .topbar a, html[data-theme="dark"] .topbar .who { color: var(--text); }
html[data-theme="dark"] .sidebar { background: #14161a; }
html[data-theme="dark"] .wind-label { background: rgba(28,31,36,.92); color: var(--text); }
/* Übungsauswertung */
html[data-theme="dark"] table.ex { background: var(--panel); color: var(--text); }
html[data-theme="dark"] table.ex th, html[data-theme="dark"] table.ex td { border-color: #555b66; }
html[data-theme="dark"] table.ex .ex-title { background: #7a3535; color: #fff; }
html[data-theme="dark"] table.ex thead th { background: #3c6330; color: #fff; }
html[data-theme="dark"] table.ex tbody tr:nth-child(even) td { background: #252930; }
html[data-theme="dark"] table.ex td.ex-pct.good { background: #3f7d2c !important; color: #fff; }
html[data-theme="dark"] table.ex td.ex-pct.bad { background: #7a3535 !important; color: #fff; }
html[data-theme="dark"] .panel { background: var(--panel); }
html[data-theme="dark"] .panel section { border-bottom-color: var(--line); }

/* Kacheln: alte auto-fit-Spaltenregel aufheben, alle Kacheln gleich breit in einer Reihe */
.tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* Logo: im Dunkelmodus die helle Schriftvariante, ohne weisses Feld */
.logo-dark { display: none !important; }
html[data-theme="dark"] .logo-light { display: none !important; }
html[data-theme="dark"] .logo-top.logo-dark { display: block !important; }
html[data-theme="dark"] .auth-box .logo.logo-dark { display: block !important; }

/* Dunkelmodus: Seitenleiste weiss */
html[data-theme="dark"] .sidebar a, html[data-theme="dark"] .sidebar a:hover, html[data-theme="dark"] .sidebar a.active { color: #fff; }

/* Dunkelmodus: Kacheln weiss */
html[data-theme="dark"] .tile, html[data-theme="dark"] .tile:hover, html[data-theme="dark"] .tile strong, html[data-theme="dark"] .tile .small { color: #fff; }

/* ===== Tablet / Handy ===== */
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 6px; width: 44px; height: 44px; font-size: 22px; line-height: 1; cursor: pointer; margin-right: 8px; flex: none; }
.nav-backdrop { display: none; }
.auth-box { width: min(360px, 92vw); }

@media (max-width: 1024px) {
  /* Seitenleiste wird zum ausklappbaren Menü */
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 6px 12px; }
  .topbar .brand { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .shell { flex-direction: row; }
  .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: 280px; max-width: 86vw; z-index: 60; padding: 8px 0;
             transform: translateX(-102%); transition: transform .2s ease; box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 55; }
  body.nav-open { overflow: hidden; }
  .sidebar nav { flex-direction: column; overflow: visible; }
  .sidebar a, body.is-full .sidebar a { border-left: 4px solid transparent; border-bottom: 0; padding: 15px 20px; white-space: normal; justify-content: flex-start; }
  .sidebar a.active { border-left-color: var(--red); border-bottom-color: transparent; }
  body.is-full .sidebar, body.is-full .sidebar .lbl { width: 280px; }
  body.is-full .sidebar .lbl { display: inline; width: auto; }
  .content { min-width: 0; }
  .page { padding: 16px 14px 40px; }
  /* Tabellen seitlich scrollbar statt die Seite zu sprengen */
  table.grid { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  main.admin { padding: 0 12px; }
  .tabs { flex-wrap: wrap; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* Touch-Bedienung: größere Ziele, kein Zoom beim Tippen in Felder (iOS) */
@media (pointer: coarse), (max-width: 1024px) {
  .btn { min-height: 44px; padding: 10px 16px; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { min-height: 44px; font-size: 16px; }
  .perm-form label, label.check { min-height: 32px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .tabs a { padding: 12px 18px; }
  .theme-btn { width: 44px; height: 44px; }
  .filelist li { padding: 10px 0; }
  table.ex td.ex-cell input { width: 26px; height: 26px; }
  .cal-ev { padding: 4px 6px; }
  .cal-nav .btn { min-width: 44px; }
  ul.results li { padding: 12px 10px; }
}

/* Ausbreitung auf Tablet: Bedienfeld schmaler, Karte nebendran; im Hochformat untereinander */
@media (min-width: 861px) and (max-width: 1024px) {
  .layout { grid-template-columns: 340px 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 70vh; }
  .panel { max-height: none; overflow: visible; }
  .content.full { display: block; overflow: visible; }
}

/* Telefon */
@media (max-width: 700px) {
  .topbar .who span:last-child { display: none; }
  .tiles { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; }
  .page h1 { font-size: 20px; }
  .cal-day { min-height: 56px; }
  .cal-ev { font-size: 0; padding: 0; height: 8px; border-radius: 4px; }  /* nur farbige Balken, Details per Klick */
  .page-head { flex-wrap: wrap; gap: 8px; }
}

/* Ausbreitung im Hochformat: Karte oben (bleibt beim Scrollen sichtbar), Bedienfeld darunter */
@media (max-width: 860px) {
  .layout { display: flex; flex-direction: column; }
  #mapWrap { order: -1; position: sticky; top: 0; z-index: 5; height: 46vh; min-height: 280px; flex: none; border-bottom: 3px solid var(--red); }
  .panel { flex: none; border-right: 0; }
}

/* Schwergas / Gelände */
.heavy-box { border: 1px solid var(--line); border-left: 4px solid #5b2a86; border-radius: 6px; padding: 8px 10px; margin: 10px 0; }
.heavy-box h3 { margin-bottom: 4px; }
.heavy-box .btn { width: 100%; margin: 6px 0; }
.panel .inc-banner { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 8px; padding: 16px 18px 16px 22px; margin: 6px 0 16px; display: flex; flex-direction: column; gap: 14px; }
.inc-banner .inc-label { font-size: 11px; letter-spacing: .04em; color: #6b7280; margin-bottom: 6px; }
.inc-banner .inc-title { font-size: 15px; font-weight: 700; line-height: 1.7; word-break: break-word; text-transform: none; letter-spacing: 0; }
.inc-banner .inc-nr { margin-right: 4px; }
.inc-banner .kw-chip { font-size: 12.5px; margin: 0 2px 2px 0; padding: 2px 10px; }
.inc-banner .inc-back { display: inline-block; margin-top: 6px; font-size: 13px; }
.inc-banner .inc-state { font-size: 12.5px; line-height: 1.5; padding: 10px 12px; background: rgba(127,127,127,.10); border-radius: 6px; }
.inc-banner .inc-form { display: flex; flex-direction: column; gap: 8px; }
.inc-banner .inc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.inc-banner .inc-form label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.inc-banner .inc-form label.check input { width: auto; margin-top: 3px; }
.inc-banner .inc-list summary { cursor: pointer; padding: 2px 0; }
html[data-theme="dark"] .inc-banner .inc-label { color: #9aa3ad; }
.calc-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 170px; overflow: auto; }
.calc-list li { padding: 10px 6px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; }
.calc-list li > span:last-child { display: flex; gap: 6px; }
.calc-list li.cur { background: rgba(179,20,27,.10); border-radius: 4px; }
.calc-list .btn { padding: 4px 12px; min-height: 0; width: auto; }
.user-new-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 16px 18px; align-items: end; padding: 20px 22px; }
.user-new-form label { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.user-new-form label .muted { font-weight: 400; }
.user-new-form input, .user-new-form select { margin: 0; }
.user-new-form .admin-pick { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.user-new-form .admin-toggle { flex-direction: row; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: transparent; }
.user-new-form .admin-toggle input { width: auto; flex: none; margin: 0; }
.user-new-form .admin-toggle:hover { border-color: var(--red); }
.user-new-form .admin-toggle:has(input:checked) { border-color: var(--red); background: rgba(179,20,27,.08); }
.user-new-form .user-new-actions { grid-column: 1 / -1; padding-top: 4px; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; }
.manual-row { margin-top: 8px; align-items: center; }
.manual-box { border: 1px solid var(--line); border-left: 4px solid #c27a00; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.manual-box h4 { margin: 0 0 4px; font-size: 14px; }
.manual-box .row.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.manual-preview { margin: 8px 0; padding: 6px 8px; background: rgba(127,127,127,.12); border-radius: 6px; }
.manual-flag { display: block; margin: 6px 0; }
.safe-box { border-left-color: #0b5fa5; }
.safe-box .row { margin: 6px 0; }
.safe-swatch { display: inline-block; width: 22px; height: 12px; border: 3px solid; border-radius: 2px; vertical-align: -2px; margin-right: 6px; }
.safe-swatch.danger { border-color: #b00020; border-style: dashed; background: rgba(255,59,48,.15); }
.safe-swatch.cordon { border-color: #0b5fa5; border-style: dashed; background: rgba(43,140,214,.12); }
.safe-label { background: rgba(255,255,255,.92); border: 2px solid; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.safe-label.danger { border-color: #b00020; color: #b00020; }
.safe-label.cordon { border-color: #0b5fa5; color: #0b5fa5; }
html[data-theme="dark"] .safe-label { background: rgba(28,31,36,.92); }

/* Erklärung der Ausbreitungsklassen */
.class-help { margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.class-help summary { cursor: pointer; font-weight: 600; }
.class-help table { margin: 6px 0; }
.class-help p { margin: 6px 0; }

/* Bilder bei Neuigkeiten */
.news-row { display: flex; gap: 14px; align-items: flex-start; }
.news-row .news-text { flex: 1 1 auto; min-width: 0; }
.news-thumb { position: relative; flex: none; display: block; width: 120px; height: 84px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #e5e7eb; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-thumb .count { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; }
.news-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 16px 0 4px; }
.news-gallery a { display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: #e5e7eb; }
.news-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.news-gallery a:hover img { transform: scale(1.04); }
.news-edit-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.news-edit-img { width: 130px; font-size: 12px; color: var(--text); }
.news-edit-img img { width: 130px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.news-edit-img span { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.news-edit-img input { width: auto; margin: 0; min-height: 0; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .lb-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 50%; width: 48px; height: 48px; font-size: 24px; cursor: pointer; }
.lightbox .lb-prev { left: 14px; } .lightbox .lb-next { right: 14px; }
.lightbox .lb-close { top: 14px; right: 14px; transform: none; }
.lightbox .lb-cap { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 13px; }
@media (max-width: 560px) { .news-thumb { width: 88px; height: 64px; } }
html[data-theme="dark"] .news-thumb, html[data-theme="dark"] .news-gallery a { background: #2a2e35; }

/* Terminabstimmung */
.rsvp-box { border: 1px solid var(--line); border-left: 4px solid #e07b00; border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.rsvp-box h3 { margin-bottom: 4px; }
.rsvp-form input { margin-bottom: 6px; }
.cal-ev.declined { opacity: .45; text-decoration: line-through; }

/* Zu-/Absage direkt auf der Startseite */
.home-rsvp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.home-rsvp .home-rsvp-state { flex: 1 1 100%; }
.home-rsvp input[name=note] { flex: 1 1 180px; min-width: 140px; width: auto; }
.home-rsvp .btn { white-space: nowrap; }

/* Einsätze */
.inc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; width: 38%; color: var(--muted); font-weight: 600; padding: 4px 8px 4px 0; vertical-align: top; font-size: 13px; }
table.kv td { padding: 4px 0; }
.gear-table tr.gear-back td, .gear-table tr.gear-used td { color: var(--muted); }
.gear-table tr.gear-out td:first-child { border-left: 4px solid #e07b00; }
.gear-add { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.gear-add .row { gap: 10px; flex-wrap: wrap; }
.gear-add .row > label { flex: 1 1 200px; }
@media print {
  .no-print, .toolbar, .filters, .topbar, .sidebar, .nav-backdrop, .theme-btn { display: none !important; }
  .page, .page.wide { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  body.app { height: auto; display: block; }
  .content { overflow: visible; }
  .gear-table { font-size: 11px; }
  .ex-wrap { overflow: visible; }
  table.grid { display: table !important; }
}

/* Geräte: Suche/Scan, Katalog im Admin-Bereich, Etiketten */
.scan-row { display: flex; gap: 8px; align-items: flex-end; margin: 6px 0; }
.scan-row label { flex: 1 1 auto; }
.scan-row .btn { flex: none; }
#camReader { max-width: 420px; margin: 8px 0; }
.gear-pick { background: #e6f4ea; border: 1px solid #b7e0c3; color: #14532d; border-radius: 6px; padding: 6px 10px; margin: 6px 0; }
html[data-theme="dark"] .gear-pick { background: #1b3325; border-color: #2f5a3f; color: #a8e6bd; }
.scan-line { border-top: 1px solid var(--line); padding: 8px 0; }
.scan-line:first-of-type { border-top: 0; }
.gear-admin td.barcode-cell svg { height: 36px; width: auto; max-width: 190px; background: #fff; }
.gear-admin td.qr-cell .qr svg { width: 44px; height: 44px; display: block; background: #fff; }
.gear-admin tr.inactive td { opacity: .55; }
.gear-codes { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.gear-codes .qr svg { width: 110px; height: 110px; background: #fff; display: block; }
.label-sheet { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.label { width: max-content; min-width: 150px; max-width: 290px; border: 1px dashed #888; border-radius: 4px; padding: 6px 8px; background: #fff; color: #000; break-inside: avoid; }
.label-codes { display: flex; gap: 8px; align-items: center; }
.label-codes .qr svg { width: 72px; height: 72px; display: block; }
.label-codes svg.barcode { height: 44px; width: auto; max-width: 170px; }
.label-id { font: 700 15px/1.2 monospace; margin-top: 2px; }
.label { position: relative; }
.label-badge { position: absolute; right: 6px; bottom: 6px; width: 46px; height: 46px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.label-name, .label-loc { padding-right: 52px; }
.qr.has-logo { position: relative; display: inline-block; }
.qr-logo { position: absolute; right: 3%; bottom: 3%; width: 30%; height: auto; background: #fff; border-radius: 50%; padding: 1px; box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.label-name { font-size: 12px; line-height: 1.25; }
.label-loc { font-size: 11px; color: #444; }
@media print {
  .tabs { display: none !important; }
  .label-sheet { gap: 3px; }
  .label { min-width: 0; max-width: 215px; padding: 3px 5px; border-color: #000; }
  .label-codes { gap: 4px; }
  .label-codes .qr svg { width: 56px; height: 56px; }
  .label-codes svg.barcode { height: 32px; max-width: 120px; }
  .label-id { font-size: 12px; margin-top: 1px; }
  .label-name { font-size: 10px; line-height: 1.2; padding-right: 36px; }
  .label-loc { font-size: 9px; line-height: 1.2; padding-right: 36px; }
  .label-badge { width: 32px; height: 32px; right: 4px; bottom: 4px; }
  .label { border-color: #000; }
}
html[data-theme="dark"] .kw-builder { border-color: #3a3f47; background: rgba(255,255,255,.03); }
html[data-theme="dark"] .kw-chips { background: #1b1e23; border-color: #444a53; }
html[data-theme="dark"] .kw-chip { background: #4a1d1d; border-color: #7a2a2d; color: #fecaca; }
html[data-theme="dark"] .kw-chip.kw-main { background: #c4252c; border-color: #c4252c; color: #fff; }


/* ===== Umfragen bei Neuigkeiten ===== */
.poll .poll-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.poll-vote .poll-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 4px 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.poll-vote .poll-opt:hover { border-color: var(--red); }
.poll-vote .poll-opt input { width: auto; flex: none; margin: 0; }
.poll-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; margin-top: 8px; }
.poll-bar { background: rgba(127,127,127,.2); border-radius: 6px; height: 14px; overflow: hidden; }
.poll-bar i { display: block; height: 100%; background: var(--red); border-radius: 6px; min-width: 0; }
.poll-num { white-space: nowrap; }
.poll-names { margin: 2px 0 0 4px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.poll-form legend { padding: 0 6px; }
@media (max-width: 640px) { .poll-row { grid-template-columns: 1fr; gap: 4px; } }

/* ===== Einsatz-Dokumente: Auswertebogen (Formular im Stil des Papierbogens) ===== */
.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 10px 0; }
.doc-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.doc-card .ico { font-size: 34px; }
.doc-card:hover { border-color: var(--red); }
.ab-status { font-size: 13px; color: #1a7f37; font-weight: 600; }
.ab-status.busy { color: #8a6d00; }
.ab-status.err { color: #b3141b; }
.ab-hist { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; font-size: 13px; }
.ab-hist li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.ab-scroll { overflow-x: auto; margin: 12px 0; padding-bottom: 6px; }
.ab-sheet { width: 1070px; margin: 0 auto; font: 12.5px/1.25 Arial, Helvetica, sans-serif; color: #000; }
.ab-sheet, .ab-sheet *, .ab-sheet *::before, .ab-sheet *::after { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Der Bogen bleibt auch im Dunkelmodus ein weißes Blatt */
.ab-sheet, .ab-sheet h2, .ab-sheet h3, .ab-sheet label, .ab-sheet span, .ab-sheet b, .ab-sheet p, .ab-sheet td, .ab-sheet th, .ab-sheet dt, .ab-sheet dd, .ab-sheet li, .ab-sheet small, .ab-sheet u { color: #000; }
.ab-sheet .ab-who { color: #fff; }
.ab-sheet label { background: transparent; }
.ab-sheet h2, .ab-sheet h3, .ab-sheet p, .ab-sheet dl, .ab-sheet ul { margin: 0; text-transform: none; letter-spacing: 0; font-family: Arial, Helvetica, sans-serif; }
.ab-sheet h3 { font-weight: 700; }
.ab-page { background: #fff; color: #000; border: 1px solid #c9cdd3; padding: 8px 10px 10px; margin-bottom: 20px; }
.ab-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.ab-head h2 { font-size: 22px; text-decoration: underline; padding-top: 6px; }
.ab-logo { height: 56px; width: auto; }
.ab-top { display: flex; gap: 26px; align-items: center; margin: 4px 0 6px 12px; }
.ab-plate { width: 130px; height: 84px; border: 5px solid #222; background: #f7a948; display: flex; flex-direction: column; flex: none; }
.ab-pl { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.ab-pl:first-child { border-bottom: 5px solid #222; }
.ab-plate .ab-f { width: 100%; justify-content: center; }
.ab-sheet .ab-plate .ab-line { border: 0 !important; width: 100%; text-align: center; font: 700 24px Arial, Helvetica, sans-serif !important; color: #000 !important; -webkit-text-fill-color: #000; background: transparent !important; letter-spacing: 1px; }
.ab-sheet .ab-plate .ab-line:focus { background: rgba(255,255,255,.45) !important; }
.ab-plate .ab-f > .ab-who { right: 1px; top: 1px; }
.ab-name { flex: 1; }
.ab-name .ab-row { margin: 6px 0; max-width: 760px; }
.ab-name .ab-row b { font-size: 18px; white-space: nowrap; }
.ab-row { display: flex; align-items: baseline; gap: 8px; }
.ab-cap { display: flex; justify-content: space-between; font-size: 16px; margin: 2px 4px 2px; }
.ab-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 2px solid #000; }
.ab-c { padding: 5px 8px 6px; }
.ab-c3 { padding-bottom: 0; }
.ab-c1 { grid-column: 1; grid-row: 1; border-right: 1.5px solid #000; }
.ab-c2 { grid-column: 2; grid-row: 1; border-right: 1.5px solid #000; border-bottom: 2px solid #000; }
.ab-c3 { grid-column: 3; grid-row: 1 / span 2; border-right: 1.5px solid #000; }
.ab-c4 { grid-column: 4; grid-row: 1; border-right: 1.5px solid #000; border-bottom: 2px solid #000; }
.ab-c4b { grid-column: 4; grid-row: 2; border-right: 1.5px solid #000; }
.ab-c5 { grid-column: 5; grid-row: 1 / span 2; }
.ab-c12 { grid-column: 1 / span 2; grid-row: 2; border-right: 1.5px solid #000; border-top: 0; }
.ab-c1 { border-bottom: 2px solid #000; }
.ab-sheet h3 { font-size: 14px; text-decoration: underline; margin: 2px 0 6px; }
.ab-sheet h3.ab-big { font-size: 18px; text-decoration: none; }
.ab-sub { margin: 4px 0 0; }
.ab-kv { display: flex; align-items: baseline; gap: 6px; margin: 2px 0; }
.ab-kv > span:first-child { white-space: nowrap; }
.ab-kv .ab-f { margin-left: auto; }
.ab-kv em { font-style: normal; min-width: 24px; }
.ab-f { display: inline-flex; align-items: flex-end; position: relative; min-width: 0; }
.ab-f.ab-grow { flex: 1; }
.ab-f.ab-grow .ab-line, .ab-f.ab-full .ab-line { width: 100%; }
.ab-f.ab-full { display: flex; width: 100%; }
.ab-f.ab-n .ab-line { width: 92px; }
.ab-f.ab-s .ab-line { width: 56px; }
.ab-f.ab-xs .ab-line { width: 52px; }
.ab-wi-r .ab-f.ab-n .ab-line { width: 66px; }
.ab-wi-r .ab-f.ab-s .ab-line { width: 40px; }
.ab-kv > span, .ab-kv > em { white-space: nowrap; }
.ab-sheet .ab-line { border: 0 !important; border-bottom: 1px solid #000 !important; border-radius: 0 !important; background: transparent !important; color: #0a2a7a !important; padding: 1px 2px !important; margin: 0; font: 600 13px Arial, Helvetica, sans-serif !important; min-width: 0; box-shadow: none !important; outline: 0; -webkit-text-fill-color: #0a2a7a; }
.ab-sheet .ab-line, .ab-sheet .ab-dia select { min-height: 0 !important; height: auto; line-height: 1.2; }
.ab-sheet .ab-dia select { height: 22px; }
.ab-sheet .ab-cb input { width: 14px !important; height: 14px !important; min-height: 0 !important; }
.ab-sheet .ab-line:focus { background: #fff8d6 !important; }
.ab-sheet .ab-line:disabled { opacity: 1; }
.ab-ruled { margin-top: 8px; }
.ab-who { display: none; background: #5b6b8c; color: #fff; font: 700 7px/1 Arial, sans-serif; border-radius: 5px; padding: 2px 3px; margin-left: 3px; white-space: nowrap; cursor: default; font-style: normal; align-self: flex-start; }
.ab-who.has { display: inline-block; }
.ab-f > .ab-who { position: absolute; right: -1px; top: -7px; margin: 0; z-index: 2; }
.ab-dia-wrap > .ab-who { position: absolute; left: -2px; top: 0; }
.ab-dia-wrap { position: relative; }
.ab-flash { animation: abflash 1.5s; }
@keyframes abflash { from { background: #b8e6c0 !important; } to { background: transparent; } }
.ab-cb { display: flex; align-items: flex-start; gap: 7px; margin: 2px 0; cursor: pointer; position: relative; }
.ab-cb input { position: absolute; opacity: 0; width: 14px; height: 14px; margin: 0; left: 0; top: 2px; cursor: pointer; }
.ab-box { flex: none; width: 13px; height: 13px; border: 1.6px solid #000; margin-top: 2px; background: #fff; position: relative; }
.ab-cb input:checked + .ab-box::after { content: "✕"; position: absolute; inset: -4px 0 0 0; text-align: center; font: 700 15px/16px Arial, sans-serif; color: #0a2a7a; }
.ab-cb input:focus-visible + .ab-box { outline: 2px solid #2563eb; outline-offset: 1px; }
.ab-cb .ab-t { line-height: 1.2; }
.ab-cb.ab-solo { margin: 3px 0 0; }
.ab-cb.ab-inline { display: inline-flex; margin: 0 8px 0 4px; }
.ab-cbrow { display: flex; gap: 22px; }
.ab-ind { display: block; padding-left: 8px; }
.ab-two { display: grid; grid-template-columns: 1.1fr .9fr; gap: 4px; }
.ab-box-row { border-top: 1.5px solid #000; margin: 6px -9px 0; padding: 6px 9px 4px; }
.ab-tk { border-bottom: 1.5px solid #000; margin: 0 -9px 4px; padding: 2px 9px 6px; }
.ab-hd { display: flex; justify-content: space-between; align-items: flex-start; }
.ab-dia-wrap { display: flex; flex-direction: column; align-items: center; margin-right: -2px; }
.ab-dia { position: relative; width: 50px; height: 46px; display: block; }
.ab-dia::before { content: ""; position: absolute; left: 8px; top: 4px; width: 34px; height: 34px; transform: rotate(45deg); border: 1.5px solid #000; background: var(--dc); }
.ab-dia-gelb { --dc: #ffed00; } .ab-dia-blau { --dc: #4285e8; } .ab-dia-rot { --dc: #f00; }
.ab-sheet .ab-dia select { position: absolute; left: 12px; top: 10px; width: 26px; height: 22px; margin: 0; padding: 0; z-index: 1; appearance: none; -webkit-appearance: none; background: transparent !important; border: 0 !important; text-align: center; text-align-last: center; font: 700 16px Arial, sans-serif !important; color: #000 !important; -webkit-text-fill-color: #000; opacity: 1; box-shadow: none !important; }
.ab-dia-cap { font-size: 11px; margin-top: -4px; }
.ab-radbox { display: flex; flex-direction: column; align-items: center; }
.ab-rads { display: flex; gap: 12px; margin-top: 4px; }
.ab-rad { width: 52px; height: 52px; }
.ab-wi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-wi-r { padding-top: 6px; }
.ab-notes { display: flex; justify-content: space-between; font-size: 10.5px; margin-top: 4px; padding: 0 4px; }
/* Rückseite */
.ab-p2grid { display: grid; grid-template-columns: 1.55fr 1.05fr 1.1fr; border: 2px solid #000; }
.ab-p2grid > .ab-c { padding: 8px 10px; }
.ab-left { border-right: 2px solid #000; }
.ab-mid { border-right: 2px solid #000; }
.ab-left .ab-row { margin: 8px 0; }
.ab-left .ab-row.ab-r2 { margin-top: 12px; }
.ab-left h3 { margin-top: 12px; font-size: 15px; }
.ab-src2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; }
.ab-tel { border-collapse: collapse; font-size: 11px; width: 100%; margin-bottom: 8px; }
.ab-tel td { padding: 2px 6px 2px 0; white-space: nowrap; }
.ab-tel tr.ab-gap td { padding-top: 12px; }
.ab-mid h3 { margin-top: 10px; font-size: 15px; }
.ab-mid p { margin: 8px 0; font-size: 13.5px; }
.ab-leg { list-style: none; padding: 0; }
.ab-leg li { display: flex; align-items: center; margin: 2px 0; font-size: 13.5px; }
.ab-mini { position: relative; width: 36px; height: 34px; display: inline-block; flex: none; margin-right: 14px; text-align: center; line-height: 34px; font-size: 13px; }
.ab-mini::before { content: ""; position: absolute; left: 7px; top: 7px; width: 20px; height: 20px; border: 1.5px solid #000; transform: rotate(45deg); }
.ab-ws { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; font-size: 13.5px; margin-top: 8px; }
.ab-vxa { font-size: 13.5px; }
.ab-vxa small { font-size: 11px; display: inline-block; vertical-align: middle; }
.ab-temp { border-collapse: collapse; margin-top: 4px; font-size: 14px; }
.ab-temp th { font-weight: 400; padding: 2px 10px; }
.ab-temp td { padding: 3px 14px; }
.ab-right h3 { font-size: 14px; margin-bottom: 4px; }
.ab-kl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13.5px; }
.ab-kl dt { white-space: nowrap; }
.ab-dgea { width: 100%; height: auto; display: block; margin-top: 4px; }
@media (max-width: 1100px) { .ab-sheet { margin: 0; } }
@media print {
  @page { size: A4 landscape; margin: 5mm; }
  .ab-scroll { overflow: visible; margin: 0; }
  .ab-sheet { width: 1070px; margin: 0 auto; zoom: var(--abzoom, .92); }
  .ab-page { border: 0; margin: 0; padding: 0; break-after: page; page-break-after: always; break-inside: avoid; }
  .ab-p2 { break-after: auto; page-break-after: auto; }
  .ab-who { display: none !important; }
  .ab-sheet .ab-line:focus { background: transparent !important; }
}
html[data-theme="dark"] .ab-page { border-color: #3a3f47; }
html[data-theme="dark"] .doc-card:hover { border-color: #ff8a90; }

/* Administration -> Module */
.module-list { display: grid; gap: 10px; }
.module-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: transparent; }
.module-row:hover { border-color: var(--red); }
.module-row input { width: 20px; height: 20px; flex: none; margin: 0; }
.module-row .ico { font-size: 24px; flex: none; width: 32px; text-align: center; }
.module-row .txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.module-row .txt small { font-size: 12.5px; }
.module-row .state { flex: none; font-size: 12px; font-weight: 700; color: #6b7280; }
.module-row.on { border-color: #b7e0c3; background: rgba(26,127,55,.06); }
.module-row.on .state { color: #1a7f37; }
html[data-theme="dark"] .module-row.on { border-color: #2f5a3f; background: rgba(60,180,100,.08); }
html[data-theme="dark"] .module-row.on .state { color: #7ee2a0; }
@media (max-width: 560px) { .module-row .state { display: none; } }

/* PDF per E-Mail (Ausbreitung) */
.mail-box { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.mail-box[hidden] { display: none; }

/* Dialog "PDF per E-Mail senden" (Einsatzbericht, Ausgabeliste) */
.gsa-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gsa-modal { background: var(--panel, #fff); color: inherit; border-radius: 10px; padding: 20px 22px; width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.gsa-modal h2 { margin: 0; font-size: 18px; }
.gsa-modal .row { display: flex; gap: 8px; }
html[data-theme="dark"] .gsa-modal { background: #1f2329; }

/* Strahlenausbreitung */
.panel .row.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.rad-mode { display: grid; gap: 8px; }
.rad-mode-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.rad-mode-opt:hover, .rad-mode-opt:has(input:checked) { border-color: var(--red); }
.rad-mode-opt:has(input:checked) { background: rgba(179,20,27,.07); }
.rad-mode-opt input { margin-top: 3px; width: auto; flex: none; }
.rad-mode-opt span { display: flex; flex-direction: column; gap: 2px; }
.rad-legend { background: rgba(255,255,255,.92); color: #111; padding: 8px 10px; border-radius: 6px; font: 12px/1.5 Arial, sans-serif; box-shadow: 0 1px 6px rgba(0,0,0,.3); max-width: 280px; }
.rad-legend .swatch { margin-right: 6px; }

/* AB-Gefahrgut 3D */
.c3d { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 440px; position: relative; }
.c3d:not(:has(.c3d-panel.open)) { grid-template-columns: 1fr 0; }
.c3d-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: #dfe6ee; }
html[data-theme="dark"] .c3d-stage { background: #14171c; }
.c3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: 0; }
.c3d-bar { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; pointer-events: none; }
.c3d-bar > * { pointer-events: auto; }
.c3d-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.c3d-group .btn { min-height: 0 !important; padding: 5px 9px; font-size: 13px; }
.c3d-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 4px 0 2px; }
.c3d-chips .chip { min-width: 38px; }
.c3d-chips .chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.c3d-search { position: relative; flex: 1 1 230px; max-width: 360px; }
.c3d-search input { width: 100%; background: var(--panel); box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.c3d-search .results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 50vh; overflow: auto; }
.c3d-tip { position: absolute; z-index: 15; max-width: 250px; background: rgba(20,22,26,.92); color: #fff; padding: 5px 9px; border-radius: 6px; font-size: 12.5px; pointer-events: none; }
.c3d-help { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: var(--muted); background: var(--panel); padding: 3px 9px; border-radius: 6px; opacity: .92; max-width: calc(100% - 20px); }
.c3d-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--muted); }
.c3d-load[hidden] { display: none; }
.c3d-panel { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; display: none; flex-direction: column; min-width: 0; }
.c3d-panel.open { display: flex; }
.c3d-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px 4px; }
.c3d-ph h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.c3d-pb { padding: 4px 14px 10px; }
.c3d-hb { padding: 4px 14px 16px; }
.c3d-hbbar { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.c3d-hbbar select { flex: 1; min-width: 0; }
.c3d-hbbar .btn { min-height: 0 !important; padding: 6px 12px; }
.c3d-hbimg { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.c3d-hbimg img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .c3d, .c3d:not(:has(.c3d-panel.open)) { display: block; }
  .c3d-stage { height: 56vh; min-height: 300px; position: sticky; top: 0; z-index: 5; border-bottom: 3px solid var(--red); }
  .c3d-panel { border-left: 0; max-height: none; overflow: visible; }
  .c3d-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; left: 6px; right: 6px; top: 6px; }
  .c3d-group { flex: none; flex-wrap: nowrap; }
  .c3d-lbl { display: none; }
  .c3d-search { flex: none; width: 210px; }
  .c3d-group .btn { padding: 6px 9px; white-space: nowrap; }
  .c3d-help { display: none; }
}
}

.c3d-grp { display: flex; flex-wrap: wrap; gap: 4px; }
.c3d-grp .btn { min-height: 0 !important; padding: 3px 8px; font-size: 12.5px; }
.c3d-grp .btn.on { background: var(--red); color: #fff; border-color: var(--red); }

/* Administration -> Reihenfolge */
.nav-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.nav-col h3 { margin: 0 0 8px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nav-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; transition: background .3s, border-color .3s; }
.nav-list li.moved { background: rgba(179,20,27,.1); border-color: var(--red); }
.nav-ico { font-size: 20px; width: 28px; text-align: center; flex: none; }
.nav-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.nav-show { flex: none; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.nav-show input { width: auto; margin: 0; }
.nav-move { flex: none; display: flex; gap: 4px; }
.nav-move .btn { min-height: 0 !important; padding: 4px 9px; }

/* ---------- Administration: überarbeitetes Erscheinungsbild ---------- */
main.admin { max-width: 1240px; margin: 20px auto 40px; padding: 0 20px; }
.admin-head { margin: 0 0 14px; }
.admin-head h1 { margin: 0; font-size: 26px; }
.admin-head p { margin: 2px 0 0; font-size: 14px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.admin-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 8px; background: transparent; border: 0; color: var(--text); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.admin-tabs a .ti { font-size: 16px; line-height: 1; }
.admin-tabs a:hover { background: rgba(179,20,27,.08); }
.admin-tabs a.active { background: var(--red); color: #fff; font-weight: 600; border: 0; box-shadow: 0 2px 6px rgba(179,20,27,.3); }
main.admin h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 26px 0 12px; }
main.admin h2::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: var(--red); flex: none; }
main.admin > .alert { margin-bottom: 16px; }
main.admin > p.muted { max-width: 860px; line-height: 1.5; }
main.admin .card, main.admin .form-stack.card { border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); padding: 18px 20px; }
main.admin table.grid { border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
main.admin table.grid th { background: rgba(0,0,0,.035); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; font-weight: 700; padding: 11px 12px; }
main.admin table.grid td { padding: 10px 12px; }
main.admin table.grid tbody tr:last-child td { border-bottom: 0; }
main.admin table.grid tbody tr:hover td { background: rgba(179,20,27,.035); }
main.admin table.grid .actions, main.admin table.grid td:last-child form { white-space: nowrap; }
main.admin table.grid .btn, main.admin .actions .btn { padding: 5px 11px; font-size: 13px; }
main.admin .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
main.admin input, main.admin select, main.admin textarea { border-radius: 8px; }
main.admin .btn.primary { box-shadow: 0 1px 3px rgba(179,20,27,.35); }
main.admin .badge { border-radius: 999px; padding: 2px 10px; }
.user-cell { gap: 10px; font-weight: 600; }
main.admin fieldset.card { border: 1px solid var(--line); }
main.admin fieldset.card legend { padding: 0 8px; }
html[data-theme="dark"] .admin-tabs { background: var(--panel); }
html[data-theme="dark"] .admin-tabs a:hover { background: rgba(255,255,255,.07); }
html[data-theme="dark"] main.admin table.grid th { background: rgba(255,255,255,.05); }
html[data-theme="dark"] main.admin table.grid tbody tr:hover td { background: rgba(255,255,255,.04); }
@media (max-width: 760px) {
  main.admin { padding: 0 12px; margin-top: 12px; }
  .admin-head h1 { font-size: 22px; }
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-tabs a { padding: 10px 14px; }
}

/* Kopfzeile: langer Zusatz nur auf breiten Bildschirmen */
@media (max-width: 900px) { .topbar .tag { display: none; } }

/* Reaktivitätsprüfung */
.react-search { position: relative; }
.react-search input { width: 100%; }
.react-search .results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 50vh; overflow: auto; }
.react-own { margin: 12px 0; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; }
.react-own summary { cursor: pointer; font-weight: 600; }
.react-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin: 6px 0; max-height: 280px; overflow: auto; }
.react-g { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 13px; }
.react-g input { width: auto; margin-top: 3px; flex: none; }
.react-g span { display: flex; flex-direction: column; }
.react-g:has(input:checked) { border-color: var(--red); background: rgba(179,20,27,.07); }
.react-chosen { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 12px; }
.rs-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.rs-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rs-spacer { flex: 1; }
.rs-head .btn { min-height: 0 !important; padding: 3px 9px; font-size: 12.5px; }
.rg-chip { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.06); margin: 0 2px 2px 0; }
.react-matrix th { white-space: nowrap; }
.react-matrix thead th span { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.react-matrix .rm-row { text-align: left; }
.rm-cell { text-align: center; font-size: 18px; cursor: pointer; min-width: 48px; }
.rm-cell.ok { background: rgba(26,127,55,.12); } .rm-cell.warn { background: rgba(240,150,0,.2); } .rm-cell.bad { background: rgba(224,49,49,.22); } .rm-cell.self { background: rgba(0,0,0,.05); cursor: default; }
.rp { border: 1px solid var(--line); border-left: 6px solid #1a7f37; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.rp.warn { border-left-color: #f08a00; } .rp.bad { border-left-color: #e03131; }
.rp.flash { box-shadow: 0 0 0 3px rgba(179,20,27,.35); }
.rp-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rp-lv { font-size: 13px; font-weight: 700; }
.rp-eff { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.eff { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(240,150,0,.2); }
.eff.e-E, .eff.e-F, .eff.e-GT { background: rgba(224,49,49,.2); } .eff.e-GF, .eff.e-P { background: rgba(240,120,0,.22); }
.rp-list { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; } .rp-list li { margin-bottom: 6px; }
.rp-tips { padding-left: 18px; } .rp-tips li { margin-bottom: 8px; }
html[data-theme="dark"] .rg-chip { background: rgba(255,255,255,.1); }

/* Reaktivität: Trefferliste deckend und über den anderen Inhalten */
.react-pick { position: relative; z-index: 5; overflow: visible; }
.react-search .results { background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 50; margin-top: 4px; padding: 0; list-style: none; }
.react-search .results li { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--panel, #fff); }
.react-search .results li:last-child { border-bottom: 0; }
.react-search .results li:hover { background: rgba(179,20,27,.08); }
.react-own, .react-chosen { position: relative; z-index: 1; }

/* ---- Offline-Erfassung ---- */
.off-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none; white-space: nowrap; margin-right: 6px; border: 1px solid transparent; }
.off-badge.ok { background: #e6f4ea; color: #1a7f37; border-color: #b7dfc3; }
.off-badge.busy { background: #fff4ce; color: #7a5a00; border-color: #f0dc8f; }
.off-badge.off { background: #e5e7eb; color: #374151; border-color: #cfd3da; }
.off-badge.warn { background: #fde8e8; color: #b3141b; border-color: #f2b8b8; }
:root[data-theme="dark"] .off-badge.ok { background: #12301c; color: #7ad397; border-color: #1f5a34; }
:root[data-theme="dark"] .off-badge.busy { background: #3a3000; color: #f1d46a; border-color: #6b5a00; }
:root[data-theme="dark"] .off-badge.off { background: #2a2f38; color: #cbd2dc; border-color: #3d4452; }
:root[data-theme="dark"] .off-badge.warn { background: #3d1518; color: #ff9a9f; border-color: #6b2a2f; }
@media (max-width: 560px) { .off-badge { padding: 4px 8px; font-size: .72rem; } }
.erf .erf-bar { gap: 8px; flex-wrap: wrap; }
.erf .erf-list { display: grid; gap: 8px; margin-top: 10px; }
.erf .erf-item { display: block; padding: 12px 14px; text-decoration: none; color: inherit; }
.erf a.erf-item:hover { border-color: var(--red, #b3141b); }
.erf .erf-form label { display: block; margin-bottom: 8px; }
.erf .erf-form input, .erf .erf-form select, .erf .erf-form textarea { width: 100%; box-sizing: border-box; }
.erf .erf-sub { position: relative; }
.erf .erf-sub .results { position: absolute; left: 0; right: 0; z-index: 20; background: var(--card, #fff); border: 1px solid var(--line, #d0d5dd); box-shadow: 0 6px 18px rgba(0,0,0,.18); list-style: none; margin: 0; padding: 0; }
.erf .erf-sub .results li { padding: 8px 10px; cursor: pointer; }
.erf .erf-sub .results li:hover { background: rgba(179,20,27,.08); }
.erf .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.erf .tabs a { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line, #d0d5dd); text-decoration: none; color: inherit; font-size: .9rem; }
.erf .tabs a.active { background: #b3141b; color: #fff; border-color: #b3141b; }
.erf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.erf-photos figure { margin: 0; }
.erf-photos img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; display: block; }
.erf .ab-scroll { overflow: auto; }
