:root {
  --bg: #0b111c;
  --surface: #131c2b;
  --surface-2: #192438;
  --surface-3: #21304a;
  --border: #283854;
  --text: #e6eef8;
  --muted: #93a4bc;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #ef4444;
  --accent-hover: #dc2626;
  --ok: #22c55e;
  --warn: #f59e0b;
  --info: #38bdf8;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11px;
}

.error-text {
  color: #f87171;
  margin: 6px 0;
  font-size: 12px;
}

/* Login */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #18253d, #090e17);
  z-index: 9999;
}

.login-card {
  width: 360px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--info);
  margin-bottom: 10px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-card label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.6px;
  font-size: 14px;
  margin-right: 6px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.nav-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-tab.active {
  background: var(--primary);
  color: #fff;
}

.speed-controls {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.btn-chip {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.btn-chip.active {
  background: var(--primary);
  color: #fff;
}

.toggle-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}

.clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  padding: 4px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Map pick banner */
.map-pick-banner {
  background: #1d4ed8;
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

/* Main Content */
.main-content {
  flex: 1;
  min-height: 0;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 14px;
}

.tab-panel.active {
  display: block;
}

#tab-live.tab-panel.active {
  padding: 0;
  overflow: hidden;
}

/* Live 3-pane layout */
.live-layout {
  display: grid;
  grid-template-columns: 310px 1fr 440px;
  height: 100%;
  min-height: 0;
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.pane-right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.pane-center {
  position: relative;
  border-right: none;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.pane-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pane-header-sub {
  border-top: 1px solid var(--border);
}

.scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.radio-list {
  max-height: 38%;
  flex: 0 0 38%;
}

.map-container {
  width: 100%;
  height: 100%;
  background: #0a101a;
}

.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 500;
  background: rgba(11, 17, 28, 0.88);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot-lst { background: #a855f7; }
.dot-fw { background: #ef4444; }
.dot-rd { background: #f97316; }
.dot-pol { background: #3b82f6; }
.dot-thw { background: #06b6d4; }
.dot-inc { background: #eab308; }
.dot-sr { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }

/* Subtabs */
.subtab-bar {
  display: flex;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.subtab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.subtab-btn.active {
  color: var(--text);
  border-bottom-color: var(--primary);
  background: var(--surface);
}

.right-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

/* Cards & Badges */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}

.card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text);
}

.badge-ok { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge-warn { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }
.badge-err { background: rgba(239, 68, 68, 0.22); color: #f87171; }
.badge-info { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-purple { background: rgba(168, 85, 247, 0.22); color: #c084fc; }

.fms-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 11px;
  font-family: ui-monospace, monospace;
}
.fms-1 { background: #14532d; color: #86efac; }
.fms-2 { background: #166534; color: #bbf7d0; }
.fms-3 { background: #92400e; color: #fde68a; }
.fms-4 { background: #1e3a8a; color: #bfdbfe; }
.fms-6 { background: #374151; color: #9ca3af; }

/* Progress bar */
.progress-wrap {
  height: 7px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.3s ease;
}

/* Radio logs */
.radio-item {
  padding: 6px 8px;
  border-left: 3px solid var(--border);
  background: var(--surface-2);
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}
.radio-item.sev-ff_report { border-left-color: #38bdf8; }
.radio-item.sev-warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.radio-item.sev-alert { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.radio-item.attention { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5); }

/* Buttons & Inputs */
.btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  background: var(--surface-3);
}
.btn:hover { opacity: 0.92; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.btn-ok { background: #16a34a; }
.btn-warn { background: #d97706; }
.btn-danger { background: #dc2626; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-xs { padding: 2px 6px; font-size: 10px; }
.btn-full { width: 100%; }

input, select, textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

input[type="checkbox"] {
  width: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Editor Layouts */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-header h2 {
  margin: 0;
  font-size: 18px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  width: 720px;
  max-width: 96vw;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-dialog.modal-wide {
  width: 1020px;
  max-width: 96vw;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { margin: 0; font-size: 15px; }

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.sub-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 340px;
}
.toast.err { border-left-color: var(--accent); }
.toast.ok { border-left-color: var(--ok); }

/* Leaflet custom markers */
.station-marker, .vehicle-marker, .incident-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
  font-size: 10px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  white-space: nowrap;
}

.vehicle-marker.sonderrechte {
  animation: pulse-blue 1s infinite alternate;
}

@keyframes pulse-blue {
  from { box-shadow: 0 0 4px 2px rgba(56, 189, 248, 0.9); }
  to { box-shadow: 0 0 14px 5px rgba(59, 130, 246, 1); }
}

.station-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  align-items: start;
}

.station-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.station-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.section-card-header h3 {
  margin: 0;
  font-size: 14px;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.station-card-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.station-card-tile:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.station-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.station-hero-title {
  margin: 6px 0 4px;
  font-size: 20px;
}

.station-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.station-subtab-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.station-subtab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.springer-matrix-wrap {
  overflow-x: auto;
}

.springer-matrix th, .springer-matrix td {
  text-align: center;
  vertical-align: middle;
}

.springer-matrix th:first-child, .springer-matrix td:first-child {
  text-align: left;
}

.springer-cell {
  min-width: 112px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
}

.springer-cell.state-req {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #4ade80;
}

.springer-cell.state-opt {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.leaflet-tooltip.station-tooltip {
  background: rgba(11, 17, 28, 0.95);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.leaflet-tooltip.station-tooltip::before {
  border-top-color: rgba(11, 17, 28, 0.95);
}

.st-tt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Clear Dispatch & Ersatzgestellung Layout */
.disp-inc-head {
  padding: 10px 11px;
  margin-bottom: 10px;
}

.disp-metrics {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.disp-metric-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  align-items: center;
}

.disp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.disp-missing-bar {
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.35;
}

.disp-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 12px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.disp-unit-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 9px;
  margin-bottom: 7px;
}

.disp-unit-group.has-rep {
  border-left: 3px solid #a855f7;
}

.disp-unit-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.disp-unit-left {
  flex: 1;
  min-width: 0;
}

.disp-unit-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.disp-unit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.disp-st-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.disp-st-wait {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.disp-st-route {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.disp-st-scene {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.disp-unit-rep {
  margin-top: 8px;
  margin-left: 8px;
  padding: 7px 8px;
  border-left: 3px solid #a855f7;
  border-radius: 0 6px 6px 0;
  background: rgba(168, 85, 247, 0.09);
}

.disp-rep-label {
  font-size: 11px;
  font-weight: 700;
  color: #d8b4fe;
  margin-bottom: 4px;
}

.disp-rep-hint {
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
}

.disp-rep-hint.ready {
  color: #fbbf24;
  font-weight: 600;
}

.disp-aao-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disp-aao-recommended {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.disp-aao-rec-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  min-width: 0;
}

.disp-aao-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.disp-aao-picker {
  display: flex;
  align-items: center;
  gap: 5px;
}

.disp-aao-select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-size: 12px;
}

.disp-preview-box {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.7);
  border-radius: 6px;
  padding: 8px 9px;
}

.disp-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.disp-preview-row {
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.disp-preview-row:first-of-type {
  border-top: none;
  margin-top: 2px;
}

.disp-preview-rep {
  margin-top: 5px;
  margin-left: 10px;
  padding: 5px 8px;
  border-left: 3px solid #a855f7;
  background: rgba(168, 85, 247, 0.09);
  border-radius: 0 5px 5px 0;
}

.man-cand-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.man-cand-row.unavailable {
  opacity: 0.55;
  cursor: default;
}

.man-cand-divider {
  margin: 10px 0 4px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 4px;
}

.disp-details-note {
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--bg);
  border-left: 3px solid var(--primary);
  font-size: 11px;
  color: var(--text);
  white-space: pre-wrap;
}

/* 2-Column Central Disposition Modal */
.dm-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  align-items: start;
}

.dm-col-left,
.dm-col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dm-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 11px;
}

.dm-inc-summary {
  border-left: 3px solid var(--primary);
}

.dm-esc-note {
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 11px;
}

.dm-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.dm-addr-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px;
}

.dm-addr-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.dm-eq-picker {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dm-eq-picker select {
  flex: 1;
  min-width: 0;
}

.dm-eq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.dm-eq-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 600;
}

.dm-chip-del {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
}

.dm-right-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.dm-right-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
}

.dm-empty-box {
  padding: 18px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dm-orders-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 2px;
}

.dm-order-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 9px;
}

.dm-order-group.has-rep {
  border-left: 3px solid #a855f7;
}

.dm-order-row,
.dm-order-rep-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.dm-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dm-order-rep {
  margin-top: 7px;
  margin-left: 8px;
  padding: 6px 8px;
  border-left: 3px solid #a855f7;
  border-radius: 0 6px 6px 0;
  background: rgba(168, 85, 247, 0.09);
}

.dm-swap-box {
  margin-top: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  gap: 6px;
  align-items: center;
}

.dm-swap-box select {
  flex: 1;
  min-width: 0;
}

.dm-add-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.dm-add-bar select {
  flex: 1;
  min-width: 0;
}

.dm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Vehicle service schedule editor & badges */
.sched-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.sched-days {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sched-day-btn {
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.sched-day-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sched-times {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sched-times input[type="time"] {
  width: auto;
  padding: 4px 6px;
  font-size: 11px;
}

.sched-tag {
  margin-top: 2px;
  font-size: 10px;
  color: #93c5fd;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

/* Alarmansicht Modal */
.av-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.av-hero-left {
  flex: 1;
  min-width: 240px;
}

.av-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.av-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.av-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
}

.av-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.av-stat-val {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

.av-stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.av-req-box {
  margin-top: 10px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.av-radio-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Structured Callsign Box */
.callsign-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}

.callsign-preview {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
  margin-top: 2px;
}

.callsign-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .dm-layout {
    grid-template-columns: 1fr;
  }
  .av-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .station-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .live-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 260px 360px 1fr;
    overflow-y: auto;
  }
  #tab-live.tab-panel.active {
    overflow-y: auto;
  }
}

/* Listen-Übersicht: Suche, Filter-Pills & Fahrzeug-Karten */
.list-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.list-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.list-search {
  width: 100%;
  padding: 7px 30px 7px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.list-search:focus {
  outline: none;
  border-color: var(--primary);
}
.list-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
}
.list-search-clear:hover {
  color: var(--text);
  background: var(--surface-2);
}

.filter-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.filter-pill:hover {
  color: var(--text);
  border-color: var(--primary);
}
.filter-pill.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--primary);
  color: var(--text);
}

.list-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
}

.veh-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 10px;
}
@media (max-width: 520px) {
  .veh-card-grid {
    grid-template-columns: 1fr;
  }
}

.veh-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s ease;
}
.veh-card:hover {
  border-color: var(--primary);
}
.veh-card-blocked {
  border-left-color: var(--warn);
}

.veh-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.veh-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.veh-card-callsign {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
}
.veh-card-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}

.veh-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.veh-card-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.veh-card-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
}

.veh-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-req {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.35);
}
.chip-opt {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.5);
}
.chip-eq {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}
.chip-more {
  cursor: pointer;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}
.chip-more:hover {
  background: rgba(59, 130, 246, 0.24);
}
.veh-eq-extra {
  display: contents;
}

/* LHF-M Banner, AAO-ODER-Alternativen & Karten-Vergleichspanel */
.dm-lhfm-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 11px;
  margin-top: 8px;
  border-radius: var(--radius);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.aao-alt-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aao-alt-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.coverage-legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  width: 280px;
  max-width: calc(100% - 20px);
  background: rgba(19, 28, 43, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cov-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.cov-leg-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cov-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.cov-pick-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}
.cov-pick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.cov-pick-row:hover {
  border-color: var(--primary);
}
.cov-pick-row.selected {
  background: rgba(59, 130, 246, 0.14);
  border-color: var(--primary);
}
.cov-pick-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cov-pick-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cov-pick-turnout {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.cov-pick-tinput {
  width: 64px;
  padding: 3px 6px;
}

/* Krankenhäuser, IVENA, 112-Notrufe & Status 5 */
.dot-hosp {
  background: #14b8a6;
}

.hospital-marker {
  background: #0f766e;
  color: #f0fdfa;
  border: 1.5px solid #5eead4;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.hosp-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.subtab-pills {
  display: flex;
  gap: 6px;
}

.hosp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.hosp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.hosp-bed-bar {
  height: 7px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid var(--border);
}

.hosp-bed-fill {
  height: 100%;
  transition: width 0.25s ease;
}
.bar-ok { background: #22c55e; }
.bar-warn { background: #eab308; }
.bar-err { background: #ef4444; }

.hosp-dept-list {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hosp-dept-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.hosp-dept-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hosp-dept-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hosp-dept-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ampel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.ampel-ok { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.7); }
.ampel-warn { background: #eab308; box-shadow: 0 0 6px rgba(234, 179, 8, 0.7); }
.ampel-err { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.75); }
.text-err { color: #f87171; font-weight: 600; }

.hosp-modal-dept-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.hosp-assign-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.hosp-assign-row.ok {
  border-color: rgba(34, 197, 94, 0.45);
}

.call-card-incoming {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(127, 29, 29, 0.2);
}

@keyframes pulse-call {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.incident-marker.incoming-call {
  background: #dc2626;
  color: #fff;
  font-weight: 800;
  animation: pulse-call 1.5s infinite;
}

.dm-caller-box {
  background: rgba(127, 29, 29, 0.24);
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: var(--radius);
  padding: 9px 11px;
}

.dm-select-highlight {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.s5-banner {
  background: rgba(180, 83, 9, 0.24);
  border: 1px solid rgba(245, 158, 11, 0.65);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Eigene Grafiken für Wachen & Fahrzeugtypen */
.icon-picker-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.icon-picker-preview {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.icon-picker-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.type-icon-thumb,
.station-icon-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  padding: 2px;
  flex-shrink: 0;
}

.unit-icon-mini {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.station-icon-marker,
.vehicle-icon-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
  cursor: pointer;
}

.station-icon-marker img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.75));
}

.station-icon-label {
  margin-top: 1px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.vehicle-icon-marker img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.vehicle-icon-marker.sonderrechte img {
  filter: drop-shadow(0 0 6px #38bdf8) drop-shadow(0 0 10px rgba(56, 189, 248, 0.9));
}

.vehicle-icon-label {
  margin-top: 1px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

.tr-clickable {
  cursor: pointer;
}
.tr-clickable:hover td {
  background: rgba(56, 189, 248, 0.08);
}

.tr-veh-assign-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.tr-veh-assign-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.tr-veh-assign-row.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}

/* Blaulicht-Wechselbild auf Karte & Vorschau */
@keyframes blaulicht-toggle {
  0%, 49.9% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

.vehicle-icon-stack {
  position: relative;
  width: 30px;
  height: 30px;
}

.vehicle-icon-stack img {
  position: absolute;
  inset: 0;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

.vehicle-icon-marker.has-dual-sr .veh-img-on {
  animation: blaulicht-toggle 0.66s steps(1, end) infinite;
}

.blink-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.7);
}

.blink-preview-stage {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: #0a101a;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.blink-preview-stage img {
  position: absolute;
  inset: 4px;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.blink-preview-stage .veh-img-on {
  animation: blaulicht-toggle 0.66s steps(1, end) infinite;
}

.veh-card-icon {
  height: 36px;
  max-width: 68px;
  object-fit: contain;
  flex-shrink: 0;
}

.veh-card-icon-stack {
  position: relative;
  width: 44px;
  height: 36px;
  flex-shrink: 0;
}

.veh-card-icon-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.veh-card-icon-stack.has-dual-sr .veh-img-on {
  animation: blaulicht-toggle 0.66s steps(1, end) infinite;
}

/* RTW-Auslastungs-Panel & RTW-X */
.rtw-status-panel {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
}

.rtw-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.rtw-visual-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.rtw-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: #0b111c;
  border: 1px solid var(--border);
  overflow: hidden;
}

.rtw-bar-fill {
  height: 100%;
  transition: width 0.25s ease;
}
.rtw-ok { background: #22c55e; }
.rtw-warn { background: #eab308; }
.rtw-err { background: #ef4444; }

.rtw-sparkline {
  width: 96px;
  height: 22px;
  background: #0b111c;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}

.rtw-metrics-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.rtw-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11px;
}

.rtw-detail-table th,
.rtw-detail-table td {
  padding: 3px 4px;
  text-align: left;
  border-top: 1px solid var(--border);
}

.text-ok { color: #4ade80; font-weight: 700; }
.text-warn { color: #fbbf24; font-weight: 700; }

.veh-turnout-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.veh-turnout-input {
  width: 72px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  text-align: right;
}

.dm-tpl-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dm-tpl-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-tpl-row select {
  flex: 1;
}

.pane-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.pane-collapse-btn:hover {
  color: #38bdf8;
}

.collapsible-subhead {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 4px;
  padding: 4px 6px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.collapsible-subhead:hover {
  border-color: #38bdf8;
  color: var(--text);
}

/* --- Multi-Monitor Popout Mode --- */
body.popout-mode .nav-tabs,
body.popout-mode #toggle-auto-incidents,
body.popout-mode #btn-random-incident,
body.popout-mode #btn-logout,
body.popout-mode .popout-btn {
  display: none !important;
}

body.popout-mode .live-layout {
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
}

body.popout-mode .pane {
  border-left: none;
  border-right: none;
}

body.popout-map .pane-left,
body.popout-map .pane-right {
  display: none !important;
}

body.popout-incidents .pane-center,
body.popout-incidents .pane-right,
body.popout-incidents #radio-header,
body.popout-incidents #radio-list {
  display: none !important;
}

body.popout-radio .pane-center,
body.popout-radio .pane-right,
body.popout-radio #rtw-status-panel,
body.popout-radio #incidents-header,
body.popout-radio #incident-list {
  display: none !important;
}

body.popout-radio .radio-list {
  max-height: none !important;
  flex: 1 1 auto !important;
}

body.popout-dispatch .pane-left,
body.popout-dispatch .pane-center,
body.popout-fleet .pane-left,
body.popout-fleet .pane-center {
  display: none !important;
}

body.popout-dispatch .subtab-bar,
body.popout-fleet .subtab-bar {
  display: none !important;
}
