:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3a4f;
  --text: #e8edf5;
  --muted: #8b9bb4;
  --accent: #e63946;
  --accent-hover: #ff4d5a;
  --ok: #2ecc71;
  --warn: #f39c12;
  --radius: 10px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

.hidden { display: none !important; }

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.logo {
  display: block;
  width: 64px;
  height: auto;
  margin: 0 auto 0.75rem;
}

.app-header .brand {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.app-header .brand img {
  display: block;
  height: 18px;
  width: auto;
  max-height: 18px;
  object-fit: contain;
  margin: 0;
  flex-shrink: 0;
}

.logo-inline {
  display: block;
  height: 18px;
  width: auto;
  max-height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-sm {
  width: 36px;
  margin: 0;
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.login-card p.sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
}

textarea { min-height: 80px; resize: vertical; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover, .btn:hover { background: var(--accent-hover); }
button.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--border); }
button.block { width: 100%; }

.error-msg {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid var(--accent);
  color: #ffb4bc;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* App banner – eine Zeile */
.app-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  min-height: 3rem;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 1;
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.app-banner .brand {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.app-banner .brand img,
.app-banner .logo-inline {
  display: block;
  height: 18px;
  width: auto;
  max-height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.banner-datetime {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  white-space: nowrap;
  padding-right: 1rem;
  margin-right: 0.25rem;
  border-right: 1px solid var(--border);
}

.banner-user-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.banner-user-block #logout-btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
}

.banner-time {
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
}

.banner-date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.app-banner .user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.app-banner .user-info #logout-btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
}

nav.tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  overflow-x: auto;
}

nav.tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 6px;
}

nav.tabs button.tab-einsatz.active,
nav.tabs button.tab-einsatz,
nav.tabs button.tab-notruf.active,
nav.tabs button.tab-notruf {
  background: #c62828;
  color: #fff;
  border-color: rgba(255,255,255,0.12);
  font-weight: 700;
}

nav.tabs button.tab-einsatz:hover,
nav.tabs button.tab-notruf:hover {
  background: #d32f2f;
}

nav.tabs button.tab-bma.active {
  background: #e65100;
  color: #fff;
  border-color: rgba(255,255,255,0.12);
  font-weight: 700;
}

nav.tabs button.tab-bma:hover {
  background: rgba(230, 81, 0, 0.3);
}

nav.tabs button.tab-bma.tab-bma-alarm {
  animation: tab-bma-blink 0.9s ease-in-out infinite;
  background: #ff6f00;
  color: #fff;
  border-color: #ffeb3b;
  box-shadow: 0 0 12px rgba(255, 235, 59, 0.55);
}

@keyframes tab-bma-blink {
  0%, 100% { background: #ff6f00; color: #fff; }
  50% { background: #ffeb3b; color: #3e2723; }
}

nav.tabs button.tab-berichte.active {
  background: #3d5a40;
  border-color: #5a8a5e;
  color: #e8f5e9;
}

nav.tabs button.tab-berichte:hover {
  background: rgba(61, 90, 64, 0.45);
  color: #c8e6c9;
}

nav.tabs button.tab-archiv.active {
  background: #37474f;
  border-color: #546e7a;
  color: #eceff1;
}

nav.tabs button.tab-archiv:hover {
  background: rgba(55, 71, 79, 0.55);
  color: #cfd8dc;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface2);
}

.btn-link:hover { color: var(--text); background: var(--border); }

.notruf-collapse-btn {
  flex: 0 0 22px;
  width: 22px;
  min-width: 22px;
  border: none;
  border-right: 1px solid #2a3f5c;
  background: #1e2f47;
  color: #9fb0c8;
  cursor: pointer;
  padding: 0;
  font-size: 0.65rem;
  z-index: 2;
}

.notruf-collapse-btn:hover {
  background: #2a3f5c;
  color: #fff;
}

.split-main.notruf-collapsed .notruf-column {
  flex: 0 0 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}

.split-main.notruf-collapsed .notruf-collapse-btn {
  border-left: 1px solid #2a3f5c;
}

.workspace-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.workspace-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.workspace-panel.hidden {
  display: none !important;
}

/* Legacy header alias */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-header .user-info { color: var(--muted); font-size: 0.85rem; }

main.app-main {
  padding: 0;
  max-width: none;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
}

.split-main.berichte-tab-active .notruf-column,
.split-main.berichte-tab-active .notruf-collapse-btn,
.split-main.archiv-tab-active .notruf-column,
.split-main.archiv-tab-active .notruf-collapse-btn {
  display: none !important;
}

.split-main.berichte-tab-active .einsatz-column,
.split-main.archiv-tab-active .einsatz-column {
  flex: 1 1 100%;
  max-width: 100%;
}

.split-main.berichte-tab-active #berichte-module-host:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 100%;
}

.split-main.archiv-tab-active #archiv-module-host:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 100%;
}

.split-main.berichte-tab-active #archiv-module-host,
.split-main.archiv-tab-active #berichte-module-host {
  display: none !important;
}

.notruf-column.hidden {
  display: none !important;
}

.notruf-collapse-btn.hidden {
  display: none !important;
}

.notruf-column {
  flex: 0 0 16.666%;
  max-width: 16.666%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #2a3f5c;
  background: #17263a;
}

.notruf-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.notruf-panel.hidden { display: none !important; }

.split-main.disposition-active .notruf-column {
  flex: 0 0 44%;
  max-width: 44%;
  opacity: 1;
  pointer-events: auto;
  overflow: hidden;
}

.split-main.disposition-active .einsatz-column {
  flex: 1;
  min-width: 0;
}

.split-main.nachalarm-active .notruf-column,
.split-main.notruf-side-active .notruf-column {
  flex: 0 0 52%;
  max-width: 52%;
  opacity: 1;
  pointer-events: auto;
  overflow: hidden;
}

.split-main.nachalarm-active .einsatz-column,
.split-main.notruf-side-active .einsatz-column {
  flex: 1;
  min-width: 280px;
  max-width: 48%;
}

.notruf-side-host,
.nachalarm-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notruf-side-host.hidden,
.nachalarm-host.hidden { display: none !important; }

.notruf-side-view,
.nachalarm-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notruf-side-head h3,
.nachalarm-head h3 {
  margin: 0;
  color: #f0f4fa;
  font-size: 1.05rem;
}

.notruf-side-text,
.nachalarm-text {
  width: 100%;
  min-height: 88px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3f5c;
  background: #0f1923;
  color: #e8eef5;
  resize: vertical;
  font-family: inherit;
}

.notruf-side-actions,
.nachalarm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.alarmstufe-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alarmstufe-level-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alarmstufe-level-label {
  font-size: 0.78rem;
  color: #8fa8c8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.alarmstufe-level-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid #2a3f5c;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.35rem;
}

.alarmstufe-rule-select {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid #2a3f5c;
  background: #0f1923;
  color: #e8eef5;
  font-weight: 700;
  padding: 8px 10px;
}

.alarmstufe-arrow {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #e8eef5;
  font-size: 1.1rem;
}

.alarmstufe-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 160px;
}

.alarmstufe-pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #c5d4e8;
  max-height: 180px;
  overflow-y: auto;
}

.alarmstufe-card { min-height: 0; }

.einsatz-topbar .ev-alarm-action {
  opacity: 1;
  cursor: pointer;
}

.einsatz-topbar .ev-alarm-action:disabled {
  opacity: 1;
  cursor: pointer;
}

.nachalarm-head .module-hint { margin: 4px 0 0; }

.nachalarm-linked {
  margin: 0;
  color: #90caf9;
  font-weight: 600;
}

.nachalarm-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nachalarm-search-row input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3f5c;
  background: #0f1923;
  color: #e8eef5;
}

.nachalarm-units {
  flex: 1;
  min-height: 180px;
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid #2a3f5c;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  padding: 6px 4px;
}

.nachalarm-group-header {
  padding: 6px 10px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8fa8c8;
}

.nachalarm-unit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #e8eef5;
  font-size: 0.9rem;
}

.nachalarm-unit-row:hover { background: rgba(255, 255, 255, 0.05); }

.nachalarm-unit-row input { flex-shrink: 0; }

.na-unit-label { flex: 1; min-width: 0; font-weight: 600; }

.na-unit-id {
  font-size: 0.78rem;
  color: #8fa8c8;
  font-family: ui-monospace, monospace;
}

.nachalarm-label {
  font-size: 0.85rem;
  color: #b0bec5;
  margin: 0;
}

.nachalarm-text {
  width: 100%;
  min-height: 88px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3f5c;
  background: #0f1923;
  color: #e8eef5;
  resize: vertical;
  font-family: inherit;
}

.notruf-side-toggle-row {
  margin-top: 0.5rem;
}

.nachalarm-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

.nachalarm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nachalarm-actions-spacer { flex: 1; min-width: 8px; }

#na-status.na-warn { color: #ffb74d; }

.disposition-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.disposition-host.hidden { display: none !important; }

.disposition-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.disposition-head h3 {
  margin: 0;
  color: #f0f4fa;
  font-size: 1.05rem;
}

.disposition-head .module-hint { margin: 4px 0 0; }

.disposition-data-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disp-data-row {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 8px 12px;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.disp-data-row:last-child { border-bottom: none; padding-bottom: 0; }

.disp-data-row dt {
  margin: 0;
  color: #8fa3bd;
  font-weight: 600;
}

.disp-data-row dd {
  margin: 0;
  color: #f0f4fa;
  font-weight: 700;
  word-break: break-word;
}

.disp-unit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  padding: 2px;
}

.disp-unit-btn,
.disp-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #3a5275;
  background: #243652;
  color: #dce4f0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.disp-unit-btn:hover,
.disp-toggle-btn:hover {
  background: #2d4a6e;
  border-color: #4a6a9a;
}

.disp-unit-btn.active,
.disp-toggle-btn.active {
  background: #2e7d32;
  border-color: #1b5e20;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(129, 199, 132, 0.35);
}

.disp-toggle-btn {
  min-width: 120px;
  flex-shrink: 0;
}

.empty-hint {
  width: 100%;
  margin: 0;
  font-style: italic;
}

.disposition-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.disposition-empfehlung {
  margin: 0;
  padding: 8px 10px;
  background: rgba(255, 111, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.35);
  border-radius: 8px;
  color: #ffcc80;
  font-size: 0.85rem;
  font-weight: 700;
}

.disposition-units-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
  min-height: 180px;
}

.disposition-units-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Einsatz kompakt während Disposition */
.einsatz-compact .einsatz-center-col {
  display: none;
}

.einsatz-compact .einsatz-body {
  grid-template-columns: 1fr;
}

.einsatz-compact .einsatz-side-col {
  max-width: none;
}

.einsatz-view.preview-mode .einsatz-list-card,
.einsatz-view.preview-mode .einsatz-msgs-card {
  opacity: 0.55;
}

.preview-hint {
  font-style: italic;
  color: #8fa3bd !important;
}

@media (max-width: 1100px) {
  .split-main.disposition-active .notruf-column {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .disposition-units-row { grid-template-columns: 1fr; }
  .disp-data-row { grid-template-columns: 1fr; }
}

.notruf-column-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
}

.einsatz-column {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #17263a;
  transition: background 0.25s ease;
}

/* Kein aktiver Einsatz – gesamte Seite weißlich / zurückgesetzt */
.einsatz-column.einsatz-idle-mode {
  background: #dfe3ea;
}

.einsatz-idle-mode .einsatz-view {
  color: #8f98a3;
}

.einsatz-idle-mode .einsatz-card {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.72);
}

.einsatz-idle-mode .einsatz-card-title,
.einsatz-idle-mode .einsatz-card-title-row .einsatz-card-title {
  color: #9aa3ad;
}

.einsatz-idle-mode .einsatz-info-grid input,
.einsatz-idle-mode .einsatz-info-grid select {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(190, 198, 208, 0.75);
  color: #98a2ae;
}

.einsatz-idle-mode .einsatz-list li {
  border-bottom-color: rgba(180, 190, 200, 0.4);
  color: #9aa3ad;
}

.einsatz-idle-mode .einsatz-list li.empty {
  color: #b0b8c2;
  font-style: italic;
}

.einsatz-idle-mode .module-hint {
  color: #a8b0ba;
}

.einsatz-idle-mode .einsatz-topbar .ev-alarm-action,
.einsatz-idle-mode .einsatz-topbar #ev-beenden-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.einsatz-idle-mode .einsatz-topbar {
  justify-content: center;
}

.ev-no-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #6e7884;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.einsatz-idle-mode .einsatz-msg-list {
  min-height: 80px;
}

.einsatz-idle-mode .einsatz-state-badge {
  opacity: 0.5;
}

.notruf-column .notruf-card {
  flex: 1;
  min-height: 0;
  margin: 0;
}

.notruf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notruf-card-head .icon-btn {
  background: #243652;
  border-color: #3a5275;
  color: #dce4f0;
  flex-shrink: 0;
}

.notruf-form-host {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.notruf-column .notruf-actions {
  flex-shrink: 0;
  padding: 10px;
  border-top: 1px solid #2a3f5c;
  background: #17263a;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.module-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.vehicle-grid {
  display: grid;
  gap: 0.75rem;
}

.vehicle-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.vehicle-card .meta { font-size: 0.85rem; color: var(--muted); }
.vehicle-card .status-badge {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--border);
}

.status-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.status-picker button {
  min-width: 2.2rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
}

.status-picker button.selected {
  background: var(--accent);
  border-color: var(--accent);
}

.einsatz-list { list-style: none; padding: 0; margin: 0; }
.einsatz-list li {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.einsatz-list li:hover { background: var(--surface2); }
.einsatz-list li:last-child { border-bottom: none; }

.protokoll-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-height: 320px;
  overflow-y: auto;
}

.protokoll-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.protokoll-list .time {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .creator-split { grid-template-columns: 1fr; }
}

/* ── Notruf (einheitlich mit Einsatz-Panel) ── */
.notruf-panel { position: relative; }

.notruf-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
  min-height: 2rem;
}

.icon-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 1rem;
  line-height: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}

.icon-btn:hover { background: var(--border); }

.admin-only.hidden { display: none !important; }

.notruf-form-box,
.notruf-form-host .notruf-form-inner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.notruf-column .notruf-form-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: #f0f4fa;
}

.notruf-column .notruf-subtitle {
  margin: 0 0 0.75rem;
  color: #8fa3bd;
  font-size: 0.82rem;
}

.notruf-column .notruf-page-card {
  background: #152238;
  border: 1px solid #2a3f5c;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.notruf-column .notruf-page-badge {
  background: rgba(198, 40, 40, 0.2);
  border-color: rgba(198, 40, 40, 0.45);
  color: #ffcdd2;
}

.notruf-column .notruf-page-title { color: #f0f4fa; font-size: 0.92rem; }
.notruf-column .notruf-page-sub,
.notruf-column .notruf-page-hint { color: #8fa3bd; font-size: 0.78rem; }

.notruf-column .notruf-field-row label {
  color: #9fb0c8;
  font-size: 0.82rem;
  font-weight: 600;
}

.notruf-column .notruf-field-row input,
.notruf-column .notruf-field-row select,
.notruf-column .notruf-field-row textarea {
  background: #0f1a2b;
  border: 1px solid #2a3f5c;
  color: #e8ecf2;
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.notruf-column .notruf-field-row {
  margin-bottom: 0.65rem;
}

.notruf-column .notruf-radio-group { display: flex; flex-direction: column; gap: 0.3rem; }

.notruf-column .notruf-page-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.notruf-column .notruf-page-nav button {
  background: #243652;
  border-color: #3a5275;
  color: #dce4f0;
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
}

.notruf-actions { margin-top: 0; }

.alarm-btn {
  background: #c62828 !important;
  font-size: 1.1rem;
  font-weight: 900;
  min-height: 3rem;
}

.alarm-btn:hover { background: #d32f2f !important; }

/* Modal / Creator */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.creator-modal-panel {
  width: min(1720px, 98vw);
  height: 96vh;
  max-height: 96vh;
}

#creator-modal.modal {
  padding: 0.5rem;
  align-items: stretch;
}

#creator-modal .modal-body {
  padding: 1rem;
  min-height: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { margin: 0; font-size: 1rem; }

.modal-body {
  overflow: auto;
  padding: 0.75rem;
  flex: 1;
}

.creator-split {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(480px, 1.35fr);
  gap: 1.25rem;
  min-height: 0;
  height: 100%;
}

.creator-config {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.creator-config .creator-section:last-of-type {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.creator-config #cr-fields {
  flex: 1;
  min-height: 280px;
}

.creator-preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.creator-preview .notruf-form-box {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.creator-config label {
  display: block;
  margin-bottom: 0.65rem;
}

.creator-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.creator-row select { flex: 1; min-width: 120px; margin-bottom: 0; }

.creator-section { margin: 0.75rem 0; }

.creator-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.creator-section select {
  width: 100%;
  margin-bottom: 0;
}

.creator-preview h4 { margin: 0 0 0.25rem; }

.creator-submodal {
  z-index: 1100;
}

.creator-submodal-panel {
  width: min(520px, 94vw);
  max-height: 88vh;
}

.creator-field-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.creator-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.9rem;
}

.creator-form-row input,
.creator-form-row select,
.creator-form-row textarea {
  width: 100%;
  margin-bottom: 0;
}

.creator-check-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.creator-check-row input[type="checkbox"] {
  width: auto;
}

.creator-form-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.creator-form-section {
  margin: 0;
  font-size: 0.95rem;
}

.creator-form-hint {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
}

.creator-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.creator-field-list option {
  padding: 4px 0;
  white-space: normal;
}

.creator-dblclick-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
}

.creator-section .hidden { display: none !important; }

/* ── Einsatz-Ansicht (Desktop-Nähe) ── */
.einsatz-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 8px 10px;
  overflow: hidden;
  color: #e8ecf2;
  box-sizing: border-box;
}

.einsatz-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.einsatz-topbar-spacer { flex: 1; }

.einsatz-body {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.einsatz-center-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.einsatz-side-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.einsatz-list-card {
  flex: 0 0 34%;
  min-height: 0;
  max-height: 40%;
}

.einsatz-center-col .einsatz-msgs-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.einsatz-side-col .einsatz-card {
  flex-shrink: 0;
  min-height: 0;
}

.einsatz-side-col .einsatz-card:nth-child(2) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.einsatz-list-compact {
  max-height: 140px;
  min-height: 60px;
}

.btn-danger {
  background: #c62828 !important;
  border-color: #b71c1c !important;
  color: #fff !important;
  font-weight: 800;
}

.btn-danger:hover:not(:disabled) { background: #d32f2f !important; }

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.einsatz-upper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 180px;
}

.einsatz-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 280px;
}

.einsatz-lower-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.einsatz-card {
  background: #1e2f47;
  border: 1px solid #2a3f5c;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.einsatz-msgs-card { min-height: 0; }

.einsatz-card-title {
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: #f0f4fa;
  flex-shrink: 0;
}

.einsatz-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.einsatz-center-col .einsatz-list {
  max-height: none;
}

.einsatz-list li {
  padding: 8px 10px;
  border-bottom: 1px solid #2a3f5c;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
}

.einsatz-list li:hover { background: rgba(255,255,255,0.04); }

.einsatz-list-item {
  position: relative;
  border-left: 4px solid transparent;
  padding-right: 72px;
}

.einsatz-list-item.einsatz-aktiv {
  border-left-color: #2e7d32;
}

.einsatz-list-item.einsatz-beendet {
  border-left-color: #c62828;
}

.einsatz-state-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1.3;
}

.einsatz-list-item.einsatz-aktiv .einsatz-state-badge {
  background: #2e7d32;
  color: #fff;
}

.einsatz-list-item.einsatz-beendet .einsatz-state-badge {
  background: #c62828;
  color: #fff;
}

.einsatz-list li.selected {
  border-left-width: 4px;
}

.einsatz-list-item.einsatz-aktiv.selected {
  background: rgba(46, 125, 50, 0.22);
  border-left-color: #43a047;
}

.einsatz-list-item.einsatz-beendet.selected {
  background: rgba(198, 40, 40, 0.25);
  border-left-color: #c62828;
}

.einsatz-list li:not(.einsatz-list-item).selected {
  background: rgba(198, 40, 40, 0.25);
  border-left: 3px solid #c62828;
}

.einsatz-list li.empty,
.einsatz-msg-list li.empty {
  cursor: default;
  color: #8fa3bd;
  font-style: italic;
}

.einsatz-list li span { color: #b8c5d8; }
.einsatz-list li small { color: #8fa3bd; font-size: 0.78rem; }

.einsatz-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.88rem;
}

.einsatz-info-grid label { color: #9fb0c8; }
.einsatz-info-grid label.full { grid-column: 1 / -1; margin-top: 4px; }
.einsatz-info-grid .full { grid-column: 1 / -1; }

.einsatz-info-grid input,
.einsatz-info-grid select,
.einsatz-view textarea {
  width: 100%;
  box-sizing: border-box;
  background: #152238;
  border: 1px solid #2a3f5c;
  color: #e8ecf2;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.einsatz-view textarea { resize: vertical; min-height: 72px; }

.einsatz-msg-actions {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.einsatz-msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 100px;
}

.einsatz-msg-list li {
  padding: 8px 0;
  border-bottom: 1px solid #2a3f5c;
  font-size: 0.88rem;
  line-height: 1.35;
}

.einsatz-msg-list .msg-time {
  color: #8fa3bd;
  font-size: 0.78rem;
  margin-right: 6px;
}

.einsatz-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.einsatz-card-title-row .einsatz-card-title { margin-bottom: 0; }

.ev-meldung-panel,
.ev-kategorie-panel {
  width: min(640px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.ev-streich-panel {
  width: min(360px, 92vw);
}

.ev-streich-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #c5d4e8;
}

.ev-streich-panel .ev-berichte-actions {
  padding: 10px 14px;
}

.ev-streich-panel .modal-body {
  padding: 12px 16px;
}

.ev-streich-panel .modal-header h3 {
  font-size: 0.95rem;
}

.app-dialog-panel {
  max-width: 480px;
}

.app-dialog-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #dce4f0;
}

.app-dialog-body p {
  margin: 0 0 10px;
}

.app-dialog-body p:last-child {
  margin-bottom: 0;
}

.app-dialog-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
}

.app-dialog-list li {
  margin-bottom: 4px;
}

.ev-meldung-direction {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.ev-meldung-party {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 7px;
  min-height: 48px;
}

.ev-meldung-swap {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  align-self: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.ev-meldung-target {
  flex: 1;
  min-height: 48px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  color: #f0f4fa;
  padding: 8px;
}

.ev-kategorie-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ev-kategorie-row select {
  flex: 1;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f0f4fa;
  padding: 8px 10px;
}

#ev-meldung-text {
  width: 100%;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f0f4fa;
  padding: 8px 10px;
  font-family: inherit;
  resize: vertical;
}

.ev-kategorie-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.ev-kategorie-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-left: 4px solid #546e7a;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  cursor: pointer;
}

.ev-kategorie-item.selected {
  outline: 1px solid rgba(144, 202, 249, 0.8);
}

.ev-kat-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}

.ev-kategorie-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.einsatz-list-compact li.ev-unit-clickable {
  cursor: pointer;
}

.einsatz-list-compact li.ev-unit-clickable:hover {
  background: rgba(255, 255, 255, 0.06);
}

.einsatz-msg-list .msg-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.einsatz-msg-list .msg-kat-stripe {
  width: 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

.einsatz-msg-list .msg-content { flex: 1; min-width: 0; }

.einsatz-msg-list .msg-route {
  font-size: 0.82rem;
  color: #9fb0c8;
  margin-bottom: 2px;
}

.einsatz-msg-list .msg-body { color: #dce4f0; }

.einsatz-msg-list li.msg-streichbar {
  cursor: pointer;
}

.einsatz-msg-list li.msg-streichbar:hover {
  background: rgba(255, 255, 255, 0.06);
}

.einsatz-msg-list li.msg-gestrichen {
  text-decoration: line-through;
  opacity: 0.55;
  color: #8fa3bd;
}

.einsatz-view.einsatz-beendet-locked .ev-active-only,
.einsatz-view.einsatz-beendet-locked .ev-active-only-hint {
  display: none !important;
}

.einsatz-view.einsatz-beendet-locked .einsatz-list-compact li {
  pointer-events: none;
  opacity: 0.7;
}

.einsatz-view.einsatz-beendet-locked #ev-beenden-btn {
  display: none;
}

.einsatz-view.einsatz-beendet-locked select.ev-active-only {
  pointer-events: none;
  opacity: 0.65;
}

.einsatz-view.einsatz-beendet-locked .einsatz-msg-list li {
  pointer-events: none;
  cursor: default;
}

.einsatz-view.einsatz-aktiv-mode .einsatz-msg-list {
  pointer-events: auto;
}

.ev-berichte-panel {
  width: min(720px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.ev-berichte-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.ev-bericht-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: #c5d4e8;
  margin-top: 8px;
}

.ev-berichte-body textarea {
  width: 100%;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f0f4fa;
  padding: 8px 10px;
  font-family: inherit;
  resize: vertical;
}

.ev-berichte-body textarea:read-only {
  opacity: 0.72;
}

.ev-berichte-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


.einsatz-view button.secondary {
  background: #243652;
  border-color: #3a5275;
  color: #dce4f0;
}

.einsatz-view button:not(.secondary) {
  background: #2d5a8a;
  border-color: #3d6fa3;
}

.einsatz-side-col .module-hint {
  color: #8fa3bd;
  font-size: 0.78rem;
  margin: 4px 0 0;
}

@media (max-width: 1100px) {
  .einsatz-body { grid-template-columns: 1fr; }
  .einsatz-side-col { overflow-y: visible; }
}

@media (max-width: 900px) {
  .split-main { flex-direction: column; }
  .notruf-column {
    flex: 0 0 auto;
    max-width: none;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #2a3f5c;
  }
}

@media (max-width: 720px) {
  .banner-datetime { flex-direction: column; align-items: flex-end; gap: 0.15rem; border-right: none; padding-right: 0; margin-right: 0; }
  .banner-user-block { padding-left: 0.75rem; border-left: 1px solid var(--border); }
  .banner-time { font-size: 1.15rem; }
  .banner-date { font-size: 0.75rem; }
  .banner-user-block span:first-child { display: none; }
}

/* ── BMA Tab (Mitte: BMA Schiff bei Alarm | MyMobs volle Fläche) ── */
.bma-tab-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.bma-tab-layout.bma-has-alarm {
  grid-template-columns: minmax(300px, 380px) 1fr;
}

.bma-tab-center {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2a3f5c;
  background: #17263a;
  padding: 10px;
  box-sizing: border-box;
}

.bma-tab-center.hidden {
  display: none !important;
}

.bma-alarm-panel-host {
  min-height: 0;
  overflow-y: auto;
  flex: 1;
}

.bma-mymobs-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #0f1a2b;
}

.bma-mymobs-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #2a3f5c;
  flex-shrink: 0;
  background: #17263a;
}

.bma-mymobs-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bma-mymobs-label {
  font-weight: 800;
  color: #e8ecf2;
  margin-right: auto;
}

.bma-mymobs-open {
  color: #90caf9;
  font-size: 0.85rem;
  text-decoration: none;
}

.bma-mymobs-open:hover { text-decoration: underline; }

.bma-mymobs-auth-hint {
  font-size: 0.78rem;
  color: #90caf9;
}

.bma-mymobs-forget {
  font-size: 0.78rem !important;
  padding: 4px 8px !important;
}

.bma-mymobs-frame-wrap iframe {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  background: #fff;
}

.bma-panel {
  overflow-y: auto;
  min-height: 0;
  height: 100%;
}

.bma-alert-banner {
  background: #c62828;
  color: #fff;
  text-align: center;
  font-weight: 900;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  animation: bma-pulse 1.2s ease-in-out infinite;
}

@keyframes bma-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.bma-mymobs-info {
  color: #b8c5d8;
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.bma-countdown {
  font-size: 3.2rem;
  font-weight: 1000;
  text-align: center;
  color: #ffdf5d;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 12px;
}

.bma-btn-start {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  font-size: 1.05rem;
  font-weight: 900;
  background: #243652;
  border: 1px solid #3a5275;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}

.bma-btn-start.running {
  background: #2e7d32 !important;
  border-color: #1b5e20 !important;
  cursor: default;
}

.bma-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.bma-fields label { color: #9fb0c8; }
.bma-fields label.full { grid-column: 1 / -1; margin-top: 4px; }
.bma-fields .full { grid-column: 1 / -1; }

.bma-fields input,
.bma-fields textarea {
  background: #152238;
  border: 1px solid #2a3f5c;
  color: #e8ecf2;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

.bma-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bma-actions-spacer { flex: 1; }

@media (max-width: 1100px) {
  .bma-tab-layout.bma-has-alarm { grid-template-columns: 1fr; }
  .bma-tab-center { max-height: 42vh; border-right: none; border-bottom: 1px solid #2a3f5c; }
}

/* Legacy overlay (nicht mehr genutzt) */
.bma-overlay {
  display: none !important;
}

body.bma-active .app-main {
  filter: none;
}

.bma-module-view {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#bma-module-host.workspace-panel {
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .bma-tab-layout { grid-template-columns: 1fr; }
}

/* Verwaltung */
.verwaltung-main { padding: 12px; }
.verwaltung-wrap { border-radius: 0; }

.verwaltung-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-width: 520px;
}

.verwaltung-form label {
  color: #9fb0c8;
  font-size: 0.88rem;
  margin-top: 8px;
}

.verwaltung-form label.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.verwaltung-form input[type="text"],
.verwaltung-form input[type="email"],
.verwaltung-form input[type="url"],
.verwaltung-form input[type="number"] {
  background: #152238;
  border: 1px solid #2a3f5c;
  color: #e8ecf2;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.verwaltung-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .bma-overlay-inner { grid-template-columns: 1fr; height: auto; max-height: calc(100vh - 70px); overflow-y: auto; }
}

/* ── Footer Fahrzeugleiste ── */
.vehicle-footer {
  flex-shrink: 0;
  background: #001b3f;
  border-top: 1px solid rgba(120, 165, 225, 0.22);
  z-index: 50;
}

.vehicle-footer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: rgba(8, 30, 58, 0.95);
  color: #b8c5d8;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
}

.vehicle-footer-toggle:hover {
  background: rgba(16, 45, 82, 0.98);
  color: #fff;
}

.vehicle-footer-count { color: #8fa3bd; font-weight: 600; }
.vehicle-footer-chevron { margin-left: auto; font-size: 0.7rem; }

.vehicle-footer.collapsed .vehicle-footer-body { display: none; }

.vehicle-footer-body {
  padding: 4px 10px 6px;
  max-height: 72px;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.vehicle-footer-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
  align-items: stretch;
}

.vehicle-footer-edit {
  flex-shrink: 0;
  align-self: center;
  width: 36px;
  height: 36px;
  background: #243652;
  border-color: #3a5275;
  color: #dce4f0;
}

.vehicle-footer-tooltip {
  position: fixed;
  z-index: 1050;
  max-width: 260px;
  background: #1e2f47;
  border: 1px solid #4a6a9a;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #e8ecf2;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  pointer-events: none;
}

.vehicle-footer-tooltip.hidden { display: none !important; }

.vehicle-footer-empty {
  margin: 0;
  color: #8fa3bd;
  font-size: 0.85rem;
  font-style: italic;
}

.vehicle-footer-card {
  flex: 0 0 auto;
  min-width: 130px;
  max-width: 170px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 48px 6px 12px;
  position: relative;
  background: rgba(8, 30, 58, 0.76);
  border: 1px solid rgba(120, 165, 225, 0.28);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.vehicle-footer-card:hover {
  background: rgba(16, 45, 82, 0.86);
  border-color: rgba(255, 255, 255, 0.45);
}

.vehicle-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.vehicle-card-name {
  font-weight: 850;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-card-ruf {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-card-badge {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 34px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-weight: 950;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.vehicle-card-badge.status-0,
.vehicle-footer-card.status-0 .vehicle-card-badge { background: rgba(255,255,255,0.10); color: #fff; }
.vehicle-card-badge.status-1 { background: rgba(255,140,0,0.70); color: #fff; border-color: rgba(255,175,70,0.95); }
.vehicle-card-badge.status-2 { background: rgba(255,255,255,0.14); color: #fff; }
.vehicle-card-badge.status-3 { background: rgba(0,220,120,0.80); color: #fff; border-color: rgba(70,255,165,0.95); }
.vehicle-card-badge.status-3.blink-off { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.26); }
.vehicle-card-badge.status-4 { background: rgba(0,200,110,0.75); color: #fff; border-color: rgba(60,230,145,0.92); }
.vehicle-card-badge.status-5 { background: rgba(255,220,0,0.90); color: #000; border-color: rgba(255,235,70,0.98); }
.vehicle-card-badge.status-6 { background: rgba(255,60,60,0.78); color: #fff; border-color: rgba(255,95,95,0.95); }

.vehicle-status-menu {
  position: fixed;
  z-index: 1200;
  background: #1e2f47;
  border: 1px solid #2a3f5c;
  border-radius: 10px;
  padding: 6px;
  min-width: 200px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vehicle-status-opt {
  border: 1px solid #2a3f5c;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: #152238;
}

.vehicle-status-opt:hover { filter: brightness(1.15); }
.vehicle-status-opt.status-1 { background: rgba(255,140,0,0.35); }
.vehicle-status-opt.status-2 { background: rgba(255,255,255,0.08); }
.vehicle-status-opt.status-3 { background: rgba(0,220,120,0.25); }
.vehicle-status-opt.status-4 { background: rgba(0,200,110,0.25); }
.vehicle-status-opt.status-5 { background: rgba(255,220,0,0.35); color: #111; }
.vehicle-status-opt.status-6 { background: rgba(255,60,60,0.35); }

.verwaltung-fahrzeug-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.verwaltung-fahrzeug-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #2a3f5c;
  font-size: 0.88rem;
  color: #dce4f0;
}

.verwaltung-fz-actions { display: flex; gap: 6px; flex-shrink: 0; }
.verwaltung-fz-actions button { font-size: 0.78rem; padding: 4px 8px; }

.verwaltung-fahrzeuge-card { margin-top: 16px; }
.verwaltung-form-inline { max-width: 480px; }

/* Sprechwunsch Toast */
.sprechwunsch-toast {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 1100;
  width: min(320px, calc(100vw - 32px));
  background: linear-gradient(180deg, #fff8c4 0%, #ffe082 100%);
  border: 2px solid #f9a825;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  color: #3e2723;
}

.sprechwunsch-toast.hidden { display: none !important; }

.sprechwunsch-toast .sw-title {
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 8px;
}

.sprechwunsch-toast .sw-body {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.sprechwunsch-toast .sw-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sprechwunsch-toast .sw-actions button {
  flex: 1;
  min-width: 120px;
  font-weight: 800;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}

.sprechwunsch-toast .sw-btn-goto {
  background: #2e7d32;
  border: 1px solid #1b5e20;
  color: #fff;
}

.sprechwunsch-toast .sw-btn-goto:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sprechwunsch-toast .sw-btn-ack {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #f9a825;
  color: #3e2723;
}

/* BMA Alarm Toast */
.bma-alarm-toast {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 1150;
  width: min(340px, calc(100vw - 32px));
  background: linear-gradient(180deg, #ffe0b2 0%, #ff9800 100%);
  border: 3px solid #e65100;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  color: #3e2723;
  animation: bma-toast-pulse 1s ease-in-out infinite;
}

@keyframes bma-toast-pulse {
  0%, 100% { box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 10px 36px rgba(230, 81, 0, 0.75); }
}

.bma-alarm-toast.hidden { display: none !important; }

.bma-alarm-toast .bat-title {
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: #bf360c;
}

.bma-alarm-toast .bat-body {
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.bma-alarm-toast .bat-body em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-weight: 800;
  color: #bf360c;
}

.bma-alarm-toast .bat-actions button {
  width: 100%;
  font-weight: 900;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  background: #c62828;
  border: 1px solid #8e0000;
  color: #fff;
}

.bma-alarm-toast .bat-actions button:hover {
  background: #d32f2f;
}

.fz-order-cell { white-space: nowrap; }
.fz-order-cell .icon-btn { padding: 2px 6px; }

.fz-editor-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 45vh;
  overflow-y: auto;
}

.fz-editor-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.fz-editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fz-editor-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.fz-editor-fields input {
  font: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}

.fz-editor-add {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.fz-editor-add h4 { margin: 0 0 8px; font-size: 0.95rem; }

.verwaltung-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow: auto;
}

.verwaltung-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.verwaltung-nav button {
  background: #243652;
  border: 1px solid #3a5275;
  color: #dce4f0;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
}

.verwaltung-nav button.active {
  background: #2d5a8a;
  border-color: #4a8fd4;
}

.verwaltung-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a3f5c;
}

.verwaltung-subnav button {
  background: #1a2838;
  border: 1px solid #334d6e;
  color: #c8d4e4;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
}

.verwaltung-subnav button.active {
  background: #2a527d;
  border-color: #4a8fd4;
  color: #fff;
}

.alarm-sub-panel { margin-top: 4px; }

.mc-kind-nav { border-bottom: none; padding-bottom: 0; }

.mc-field-cell { min-width: 220px; }

.mc-field-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 8px 2px 0;
  font-size: 0.8rem;
  white-space: nowrap;
}

.verwaltung-details {
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px solid #2a3f5c;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.verwaltung-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #dce4f0;
}

.users-toolbar {
  align-items: stretch;
}

.users-search {
  flex: 1;
  min-width: 220px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #2a3f5c;
  background: #0f1923;
  color: #e8eef5;
  font: inherit;
}

.user-row-inactive td {
  opacity: 0.55;
}

.users-fn-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pw-flag {
  font-size: 0.85rem;
}

.rights-modal-panel {
  max-width: 720px;
  max-height: 90vh;
  overflow: auto;
}

.rights-group {
  margin-bottom: 14px;
}

.rights-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 8px;
}

/* Nutzer-Funktionen: Gruppen + Toggle-Buttons */
.fn-picker-host,
.fn-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fn-section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #8fa3bd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.fn-groups-row,
.fn-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fn-group-btn {
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #3a5275;
  background: #243652;
  color: #dce4f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fn-group-btn:hover {
  border-color: #5a8a5e;
  background: #2a4035;
}

.fn-group-btn.active {
  background: #3d5a40;
  border-color: #6abf69;
  color: #e8f5e9;
  box-shadow: 0 0 0 1px rgba(106, 191, 105, 0.35);
}

.fn-toggle-btn {
  padding: 8px 14px;
  font-size: 0.88rem;
  border-radius: 20px;
  border: 1px solid #3a5275;
  background: #1a2d45;
  color: #b0bec5;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fn-toggle-btn:hover {
  border-color: #546e7a;
  color: #eceff1;
}

.fn-toggle-btn.active {
  background: #2e5a8a;
  border-color: #4a90d9;
  color: #fff;
  font-weight: 600;
}

button.secondary.danger {
  border-color: #8b3a3a;
  color: #ffb4b4;
}

.verwaltung-section { flex: 1; min-height: 0; overflow: auto; }

.verwaltung-user-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.verwaltung-user-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #2a3f5c;
  font-size: 0.88rem;
}

.aao-rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.verwaltung-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.verwaltung-subsection {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #2a3f5c;
}

.verwaltung-table-wrap {
  overflow-x: auto;
  border: 1px solid #2a3f5c;
  border-radius: 10px;
}

.verwaltung-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.verwaltung-table th,
.verwaltung-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #2a3f5c;
  vertical-align: middle;
}

.verwaltung-table th {
  background: rgba(8, 20, 36, 0.85);
  color: #9fb0c8;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.verwaltung-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.verwaltung-table .empty-cell {
  color: #8fa3bd;
  font-style: italic;
  text-align: center;
}

.verwaltung-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.icon-btn.danger {
  color: #ff8a80;
  border-color: rgba(198, 40, 40, 0.45);
}

.icon-btn.danger:hover {
  background: rgba(198, 40, 40, 0.2);
}

.verwaltung-modal-panel {
  width: min(560px, 96vw);
}

.verwaltung-form select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #2a3f5c;
  background: #152238;
  color: #e8ecf2;
  width: 100%;
  box-sizing: border-box;
}

.kuerzel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.kuerzel-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.kuerzel-row input {
  flex: 1;
  font: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #2a3f5c;
  background: #152238;
  color: #e8ecf2;
}

#rule-modal-fz-grid {
  min-height: auto;
  margin-bottom: 10px;
}

/* Berichte-Tab */
.berichte-view-tab {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 16px 20px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #152238;
}

.berichte-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #e8edf5;
}

.berichte-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.bv-action-btn {
  font-size: 1rem;
  padding: 10px 20px;
  min-height: 42px;
}

.berichte-body-wide {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.berichte-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.berichte-list-section {
  background: #1a2d45;
  border: 1px solid #2a4060;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.berichte-list-archiv {
  flex: 0 1 40%;
  max-height: 42%;
}

.berichte-section-head {
  font-size: 1.05rem;
  font-weight: 600;
  color: #dce4f0;
  margin-bottom: 4px;
}

.berichte-section-hint {
  font-size: 0.82rem;
  color: #8fa3bd;
  margin: 0 0 10px;
}

.berichte-einsatz-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.berichte-einsatz-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 2px 10px;
  padding: 14px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #243652;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.berichte-einsatz-item:hover {
  border-color: #3a5275;
}

.berichte-einsatz-item.selected {
  border-color: #5a8a5e;
  background: #2a4035;
}

.berichte-einsatz-item.archiv {
  opacity: 0.92;
}

.berichte-einsatz-item .einsatz-state-badge {
  grid-row: 1 / 4;
  align-self: start;
  font-size: 0.72rem;
  padding: 4px 8px;
}

.berichte-item-num {
  font-size: 1.05rem;
}

.berichte-item-kw {
  font-size: 0.95rem;
  color: #c5d0de;
}

.berichte-item-meta {
  font-size: 0.82rem;
  color: #8fa3bd;
}

.berichte-detail-col {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.berichte-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: #8fa3bd;
  font-size: 1.1rem;
}

.berichte-hero {
  background: linear-gradient(135deg, #1e3350 0%, #243652 100%);
  border: 1px solid #2a4060;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 20px;
}

.berichte-status-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.berichte-status-pill.offen {
  background: #3d5a40;
  color: #c8e6c9;
}

.berichte-status-pill.archiv {
  background: #37474f;
  color: #cfd8dc;
}

.berichte-hero-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.berichte-hero-ort {
  margin: 0 0 20px;
  font-size: 1.1rem;
  color: #b0bec5;
}

.berichte-hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px 20px;
}

.berichte-hero-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.berichte-hero-meta span {
  font-size: 0.8rem;
  color: #8fa3bd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.berichte-hero-meta strong {
  font-size: 1.05rem;
  font-weight: 600;
}

.berichte-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.berichte-panel {
  background: #1a2d45;
  border: 1px solid #2a4060;
  border-radius: 12px;
  padding: 20px 22px;
}

.berichte-panel-full {
  grid-column: 1 / -1;
}

.berichte-panel-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #dce4f0;
  border-bottom: 1px solid #2a4060;
  padding-bottom: 10px;
}

.berichte-panel-msgs .bv-msg-list {
  max-height: 420px;
}

.berichte-textarea {
  width: 100%;
  min-height: 180px;
  font-size: 1rem;
  line-height: 1.5;
  padding: 12px 14px;
  resize: vertical;
}

.berichte-textarea:read-only {
  opacity: 0.75;
}

.berichte-dienst-block {
  margin-bottom: 18px;
}

.berichte-dienst-block .ev-bericht-label {
  font-size: 1rem;
  margin-bottom: 8px;
}

.bv-msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.bv-msg-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-bottom: 1px solid #2a4060;
  font-size: 0.95rem;
}

.bv-msg-item .msg-time {
  grid-row: 1 / 3;
  font-weight: 600;
  color: #90caf9;
}

.bv-msg-text {
  line-height: 1.45;
}

.bv-msg-route,
.bv-msg-user {
  font-size: 0.82rem;
  color: #8fa3bd;
}

.bv-msg-item.msg-gestrichen {
  opacity: 0.55;
  text-decoration: line-through;
}

.bv-trupp-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.bv-trupp-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin-bottom: 10px;
  background: #243652;
  border-radius: 10px;
  font-size: 0.95rem;
}

.bv-trupp-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bv-trupp-info small {
  color: #8fa3bd;
}

.bv-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  margin-bottom: 10px;
}

.bv-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.bv-member-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.bv-einsatz-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bv-einsatz-row input[type="time"] {
  font-size: 1rem;
  padding: 8px;
}

.bv-min-label {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 52px;
}

.bv-trupp-panel {
  max-width: 620px;
  width: 95vw;
}

@media (max-width: 1100px) {
  .berichte-body-wide {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .berichte-sidebar {
    max-height: 320px;
  }

  .berichte-panels {
    grid-template-columns: 1fr;
  }
}

.archiv-search {
  min-width: 280px;
  max-width: 420px;
  padding: 10px 14px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #3a5275;
  background: #1a2d45;
  color: #e8edf5;
}

.berichte-readonly-text {
  background: #243652;
  border: 1px solid #2a4060;
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 100px;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 1rem;
}

.bv-upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.bv-upload-input {
  flex: 1;
  min-width: 200px;
  font-size: 0.95rem;
}

.bv-upload-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bv-upload-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: #243652;
  border-radius: 10px;
  align-items: center;
}

.bv-upload-name {
  font-size: 1rem;
  font-weight: 600;
  grid-column: 1;
}

.bv-upload-meta {
  font-size: 0.82rem;
  color: #8fa3bd;
  grid-column: 1;
}

.bv-upload-item .verwaltung-row-actions {
  grid-column: 2;
  grid-row: 1 / 3;
}

.upload-preview-panel {
  max-width: 920px;
  width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.upload-preview-body {
  flex: 1;
  min-height: 360px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1b2a;
}

.upload-preview-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.upload-preview-pdf {
  width: 100%;
  min-height: 65vh;
  border: none;
  background: #fff;
}

.va-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.va-log-toolbar input[type="search"] {
  flex: 1 1 180px;
  min-width: 140px;
}

.va-table-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.va-cell-wrap {
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
  font-size: 0.85rem;
}

/* Verwaltung Archiv */
.va-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.va-stat-card {
  background: #1a2d45;
  border: 1px solid #2a4060;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.va-stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e8f0fa;
}

.va-stat-label {
  font-size: 0.78rem;
  color: #8fa3bd;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.va-subnav {
  margin-bottom: 12px;
}

.va-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.va-filter-panel input[type="search"] {
  flex: 1 1 180px;
  min-width: 140px;
}

.va-typ-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.va-typ-login { background: rgba(21, 101, 192, 0.25); color: #90caf9; }
.va-typ-aenderung { background: rgba(230, 81, 0, 0.22); color: #ffcc80; }
.va-typ-durchfuehrung { background: rgba(46, 125, 50, 0.22); color: #a5d6a7; }
.va-typ-alarm { background: rgba(198, 40, 40, 0.22); color: #ef9a9a; }

/* Berichte Statistik */
.bv-statistik-section {
  flex: 0 0 auto;
  max-height: 42%;
}

.bv-statistik-summary {
  overflow-y: auto;
  max-height: 220px;
}

.bv-stat-total {
  font-size: 0.88rem;
  font-weight: 600;
  color: #c5d0de;
  margin-bottom: 10px;
}

.bv-stat-kat {
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid var(--kat-color, #546e7a);
}

.bv-stat-kat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #dce4f0;
  margin-bottom: 4px;
}

.bv-stat-kat-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.bv-stat-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: #8fa3bd;
}

.bv-stat-sub li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.bv-stat-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.bv-stat-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bv-stat-einstufungen {
  margin: 0;
  font-size: 0.95rem;
  color: #c5d0de;
}

.bv-einstufung-kat {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.bv-einstufung-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.bv-einstufung-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}

.bv-einstufung-opt input {
  margin-top: 3px;
}

/* Berichte Atemschutzstatistik */
.bv-atemschutz-stats-section {
  flex: 0 0 auto;
  max-height: 38%;
}

.bv-atemschutz-stats {
  overflow-y: auto;
  max-height: 200px;
}

.bv-as-total {
  font-size: 0.82rem;
  font-weight: 600;
  color: #c5d0de;
  margin-bottom: 8px;
}

.bv-as-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.bv-as-table th,
.bv-as-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #2a4060;
}

.bv-as-table th {
  color: #8fa3bd;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.bv-as-table td:nth-child(2),
.bv-as-table td:nth-child(3),
.bv-as-table th:nth-child(2),
.bv-as-table th:nth-child(3) {
  text-align: right;
  width: 2.5rem;
}

.bv-atemschutz-summary {
  margin-bottom: 12px;
}

.bv-as-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bv-as-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.bv-as-ja {
  background: rgba(46, 125, 50, 0.35);
  color: #a5d6a7;
}

.bv-as-nein {
  background: rgba(84, 110, 122, 0.35);
  color: #b0bec5;
}

.bv-as-meta {
  font-size: 0.85rem;
  color: #8fa3bd;
}

.bv-as-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.bv-as-detail-table th,
.bv-as-detail-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #2a4060;
  vertical-align: top;
}

.bv-as-detail-table th {
  color: #8fa3bd;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

.bv-as-trupp-table td:last-child {
  font-size: 0.8rem;
  color: #8fa3bd;
}
