.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flight-battery-picker {
    position: relative;
}

.flight-battery-picker > #flight-battery {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flight-battery-identity[hidden] {
    display: none;
}

.flight-battery-identity {
    --flight-battery-accent: #2f81f7;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--flight-battery-accent) 42%, var(--border));
    border-left: 5px solid var(--flight-battery-accent);
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--flight-battery-accent) 12%, transparent), var(--flight-battery-flaeche, rgba(18, 33, 67, 0.52)));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.flight-battery-identity__label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flight-battery-identity__main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flight-battery-identity__number {
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 8px;
    background: var(--flight-battery-accent);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.flight-battery-identity__details {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.flight-battery-identity__details strong {
    color: var(--text);
    font-size: 1rem;
}

.flight-battery-identity__details span,
.flight-battery-identity__hint {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.flight-battery-identity__level {
    color: var(--flight-battery-accent);
    font-size: 1.35rem;
}

.flight-battery-identity__hint {
    margin: 10px 0 0;
    line-height: 1.35;
}

.flight-battery-identity__change {
    display: inline-flex;
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px solid var(--flight-battery-accent);
    border-radius: 8px;
    background: transparent;
    color: var(--flight-battery-accent);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.flight-battery-identity__change:hover,
.flight-battery-identity__change:focus-visible {
    background: color-mix(in srgb, var(--flight-battery-accent) 16%, transparent);
    outline: 2px solid color-mix(in srgb, var(--flight-battery-accent) 55%, transparent);
    outline-offset: 2px;
}

/* BBO Drohnen-Manager – Dark Theme */

:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0f3460;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0b0;
    --accent: #007AFF;
    --accent-hover: #0062cc;
    --green: #34c759;
    --yellow: #ffcc00;
    --red: #ff3b30;
    --orange: #ff9500;
    --bbo-rot: #b51615;
    --bbo-grau: #575757;
    --border: #2a2a4a;
    --shadow: rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;

    /* Akku-Kennfarben. Standen bis v1.0.5 fest im JavaScript und waren dadurch
       von keinem Thema überschreibbar. Werte unverändert — die dunklen Themen
       sehen exakt aus wie bisher; nur die hellen Themen dunkeln sie ab, damit
       die weiße Schrift auf der Kennung „AKKU n" lesbar bleibt. */
    --akku-1: #2f81f7;
    --akku-2: #8b5cf6;
    --akku-3: #16a34a;
    --akku-4: #f59e0b;

    /* Fläche hinter der Akku-Karte (zweite Farbe des Verlaufs) */
    --flight-battery-flaeche: rgba(18, 33, 67, 0.52);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* === Header === */

.app-header {
    background: var(--bg-secondary);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    max-height: 36px;
    max-width: 100px;
    object-fit: contain;
    filter: brightness(1.1);
}

.app-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.dji-device-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.dji-device-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
}

.dji-device-status.is-online { color: #4ade80; border-color: #22c55e; }
.dji-device-status.is-online .dji-device-status-dot { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.dji-device-status.is-offline { color: #f87171; border-color: #ef4444; }
.dji-device-status.is-offline .dji-device-status-dot { background: #ef4444; }

/* Gestörte OpenAPI: Der Gerätestatus stammt dann allein aus MQTT. Das ist
   keine Fehlfarbe — die Zeiten stimmen ja —, aber es muss sichtbar sein: Ein
   abgelehnter Organization Key darf nicht nur im Tooltip stehen. Der gelbe
   Rand gilt für die ganze Anzeige und gewinnt deshalb gegen die Statusfarbe. */
.dji-device-status.has-warning { border-color: #f59e0b; color: #fbbf24; }
.dji-device-status.has-warning .dji-device-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.dji-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}

.dji-live-badge-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.dji-live-badge.is-online { color: #4ade80; border-color: #22c55e; }
.dji-live-badge.is-online .dji-live-badge-dot { background: #4ade80; box-shadow: 0 0 7px #4ade80; }
.dji-live-badge.is-offline { color: #f87171; border-color: #ef4444; }
.dji-live-badge.is-offline .dji-live-badge-dot { background: #ef4444; }

.battery-card.is-current-dji-battery {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgb(34 197 94 / 28%), 0 0 18px rgb(74 222 128 / 12%);
}

.battery-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.battery-section-heading .battery-section-title,
.dock-info-header .dji-live-badge { margin-top: 0; }

.battery-section-help {
    margin: -4px 0 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.battery-identity-note,
.battery-event-evidence {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.battery-event-evidence { color: #93c5fd; }

.battery-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin: -2px 0 12px;
    padding: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.battery-detail-item {
    min-width: 0;
    padding: 7px 10px 8px;
    text-align: center;
}

.battery-detail-item + .battery-detail-item {
    border-left: 1px solid rgba(148, 163, 184, 0.12);
}

.battery-detail-item small,
.battery-detail-item strong,
.battery-detail-item em {
    display: block;
}

.battery-detail-item small {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.battery-detail-item strong {
    overflow-wrap: anywhere;
    color: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.3;
}

.battery-detail-item em {
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 9px;
    font-style: normal;
    line-height: 1.25;
}

.drone-switcher-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.drone-switcher {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    min-width: 200px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.header-icon:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.admin-shield {
    color: var(--yellow);
}

.admin-shield:hover {
    color: var(--yellow);
    border-color: var(--yellow);
}

.user-menu {
    position: relative;
}

.user-btn {
    border: none;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    min-width: 180px;
    z-index: 150;
    box-shadow: 0 8px 24px var(--shadow);
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.user-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    font-weight: 600;
    font-size: 16px;
    color: var(--accent);
}

.user-dropdown-avatar-upload {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--accent);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    transition: background 0.2s;
}

.user-dropdown-avatar-upload:hover {
    background: var(--accent-hover);
}

.user-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-dropdown-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:hover {
    color: var(--text-primary);
}

.dropdown-item#btn-logout {
    color: var(--red);
}

/* === Battery Serial Number === */

.battery-sn {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* === Device View === */

.device-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.device-tab {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s;
}

.device-tab.active {
    color: var(--accent);
    border-color: var(--accent);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .device-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 380px) {
    .device-grid {
        grid-template-columns: 1fr;
    }
}

.device-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.device-card-header h3 {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
}

.device-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 10px;
    flex-shrink: 0;
}

.device-type-icon svg {
    width: 32px;
    height: 32px;
}

.device-model, .device-status {
    font-size: 13px;
    font-weight: 500;
}

.device-detail {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.device-detail span {
    color: var(--text-primary);
    font-weight: 500;
}

.device-notes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-style: italic;
}

.rc-battery {
    font-size: 18px;
    font-weight: 700;
}

.btn-rc-charge {
    margin-top: 10px;
    width: 100%;
}

/* === Navigation === */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s;
    border-radius: var(--radius-sm);
}

.nav-icon-svg {
    width: 24px;
    height: 24px;
}

.nav-icon {
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item:active {
    background: rgba(0, 122, 255, 0.1);
}

/* === Views === */

.view {
    display: none;
    padding: 24px 16px 16px;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* === Battery Sections (Dashboard) === */

.battery-sections {
    display: flex;
    flex-direction: column;
}

.battery-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.battery-section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* === Battery Grid (Dashboard) === */

.battery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 380px) {
    .battery-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .battery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === Battery Card === */

.battery-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 180px;
    overflow: visible;
}

.battery-card:active {
    transform: scale(0.98);
}

.battery-card.critical {
    border-color: var(--red);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.15);
    animation: pulseCritical 2s infinite;
}

@keyframes pulseCritical {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 59, 48, 0.15); }
    50% { box-shadow: 0 0 25px rgba(255, 59, 48, 0.35); }
}

.battery-card.warning {
    border-color: var(--yellow);
}

.battery-card.good {
    border-color: rgba(52, 199, 89, 0.3);
}

.battery-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.badge-drone {
    background: rgba(0, 122, 255, 0.2);
    color: var(--accent);
}

.badge-remote {
    background: rgba(255, 149, 0, 0.2);
    color: var(--orange);
}

.badge-dock {
    background: rgba(0, 200, 150, 0.2);
    color: var(--green, #34c759);
}

.battery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.battery-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.battery-header.is-centered-battery {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 12px;
}

.battery-header.is-centered-battery .battery-header-content {
    min-width: 0;
    text-align: center;
}

.battery-header-spacer {
    width: 32px;
}

@media (max-width: 720px) {
    .battery-detail-grid {
        grid-template-columns: 1fr;
    }

    .battery-detail-item + .battery-detail-item {
        border-top: 1px solid rgba(148, 163, 184, 0.12);
        border-left: 0;
    }
}

.battery-cycles {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Battery Gauge */

.battery-gauge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.battery-icon-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
}

.battery-body {
    flex: 1;
    height: 28px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.battery-fill {
    height: 100%;
    min-width: 6px;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Batterie-Füllstand Farbklassen mit Gradient + Glow */
.battery-fill.high {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.battery-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.battery-fill.low {
    background: linear-gradient(90deg, #f97316, #fb923c);
    box-shadow: 0 0 12px rgba(251, 146, 60, 0.4);
}

.battery-fill.critical {
    background: linear-gradient(90deg, #ef4444, #f87171);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.5);
    animation: battery-pulse 1.2s infinite;
}

.battery-fill.critical-fast {
    background: linear-gradient(90deg, #ef4444, #f87171);
    box-shadow: 0 0 16px rgba(248, 113, 113, 0.6);
    animation: battery-pulse 0.6s infinite;
}

@keyframes battery-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.battery-tip {
    width: 4px;
    height: 12px;
    background: var(--border);
    border-radius: 0 3px 3px 0;
    margin-left: 2px;
}

.battery-percent {
    font-size: 22px;
    font-weight: 700;
    min-width: 55px;
    text-align: right;
}

/* Battery Status */

.battery-status {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 8px;
}

/* Badge: aktueller Stand ist geschätzt (Lagerentladung, kein Flug) */
.battery-estimate-badge {
    font-size: 10.5px;
    padding: 4px 8px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm, 6px);
    text-align: center;
    color: var(--accent, #4a90d9);
    background: rgba(74, 144, 217, 0.12);
    border: 1px dashed var(--accent, #4a90d9);
    cursor: help;
}

.battery-status.critical {
    background: rgba(255, 59, 48, 0.15);
    color: var(--red);
    font-weight: 600;
}

.battery-status.warning {
    background: rgba(255, 204, 0, 0.1);
    color: var(--yellow);
}

.battery-status.good {
    background: rgba(52, 199, 89, 0.1);
    color: var(--green);
}

.battery-last-flight {
    margin-bottom: 10px;
}

.battery-last-flight small {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: block;
}

.battery-actions {
    display: flex;
    gap: 8px;
}

/* === Buttons === */

.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex: 1;
    text-align: center;
}

.btn:active {
    transform: scale(0.96);
}

.btn-charge {
    background: rgba(52, 199, 89, 0.15);
    color: var(--green);
}

.btn-charge:hover {
    background: rgba(52, 199, 89, 0.25);
}

.btn-fly {
    background: rgba(0, 122, 255, 0.15);
    color: var(--accent);
}

.btn-fly:hover {
    background: rgba(0, 122, 255, 0.25);
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 14px;
    font-size: 14px;
    border-radius: var(--radius);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 12px;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-outline:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.quick-date-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.sort-bar label {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.sort-bar .form-control {
    flex: 1;
    padding: 8px;
    font-size: 13px;
}

.flight-duration {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.btn-danger {
    background: var(--red);
    color: white;
    padding: 14px;
    font-size: 14px;
    border-radius: var(--radius);
}

.btn-danger:hover {
    background: #e0342a;
}

.btn-export {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px;
    font-size: 14px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-export:hover {
    background: var(--bg-input);
}

/* === Forms === */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--accent);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Location */

.location-group {
    position: relative;
}

.location-status {
    font-size: 11px;
    margin-top: 4px;
    padding: 4px 0;
}

.location-status.loading {
    color: var(--accent);
}

.location-status.success {
    color: var(--green);
}

.location-status.error {
    color: var(--red);
}

/* New Pilot Input */

#new-pilot-group {
    display: none;
    margin-top: 8px;
}

/* === Pilot Management View === */

.pilot-add-form {
    margin-bottom: 20px;
}

.pilot-input-row {
    display: flex;
    gap: 8px;
}

.pilot-input-row .form-control {
    flex: 1;
}

.btn-add-pilot {
    flex: 0 0 auto;
    width: 50px;
    padding: 12px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pilot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pilot-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .pilot-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 380px) {
    .pilot-card-grid {
        grid-template-columns: 1fr;
    }
}

.pilot-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.pilot-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pilot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pilot-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pilot-card-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.pilot-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--text-secondary);
}

.pilot-card-licenses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pilot-license-badge {
    background: #28a745;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.pilot-expiry-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.pilot-expiry-expired {
    background: #dc3545;
    color: #fff;
}

.pilot-expiry-warning {
    background: #ffc107;
    color: #000;
}

.pilot-status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.pilot-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.pilot-card-activity {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.pilot-drones {
    font-size: 12px;
    color: var(--secondary);
}

/* Legacy Pilot-Klassen (Abwärtskompatibilität) */
.pilot-entry {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pilot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pilot-name {
    font-size: 15px;
    font-weight: 500;
}

.pilot-flights {
    font-size: 12px;
    color: var(--text-secondary);
}

.pilot-delete {
    background: none;
    border: none;
    color: var(--red);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.pilot-delete:hover {
    opacity: 1;
}

/* === Flight List === */

.flight-entry {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.flight-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.flight-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.flight-battery {
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.flight-pilot {
    font-size: 13px;
    color: var(--text-secondary);
}

.flight-levels {
    font-size: 14px;
    font-weight: 600;
}

.flight-usage {
    font-size: 13px;
    color: var(--red);
    font-weight: 600;
}

.flight-location, .flight-notes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.flight-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-klein {
    padding: 4px 10px;
    font-size: 12px;
    width: auto;
}

.flight-dji-hinweis {
    font-size: 12px;
    color: var(--yellow);
    margin: -8px 0 12px;
}

.dashboard-hinweis {
    border-left: 3px solid var(--yellow);
    background: rgba(255, 204, 0, 0.08);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.dashboard-hinweis__warnung {
    margin-top: 6px;
    color: var(--red);
    font-size: 12px;
}

.flight-delete-btn {
    background: rgba(255, 59, 48, 0.1);
    border: none;
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.flight-delete-btn:hover {
    background: rgba(255, 59, 48, 0.2);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* === Filter Bar === */

.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.filter-bar .form-row {
    margin-bottom: 10px;
}

.filter-bar .form-row:last-child {
    margin-bottom: 0;
}

.filter-bar .form-control {
    font-size: 13px;
    padding: 8px 10px;
}

.filter-bar label {
    font-size: 11px;
}

.checkbox-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 120px;
    overflow-y: auto;
}

.checkbox-filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    padding: 2px 4px;
}

.checkbox-filter-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
}

.checkbox-filter-group .empty-hint {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* === Dialog / Modal === */

.dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}

.dialog-overlay.active {
    display: flex;
}

.dialog-content {
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.dialog-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* === Warning Banner === */

.warning-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    animation: slideDown 0.3s ease;
}

.warning-banner.active {
    display: block;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.warning-content {
    background: var(--red);
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    animation: flashWarning 1s infinite;
}

@keyframes flashWarning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.warning-icon {
    font-size: 20px;
}

.warning-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}

/* === Toast Notifications === */

.toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 250;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    border: 1px solid var(--border);
    pointer-events: auto;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-color: var(--green); }
.toast-error { border-color: var(--red); }
.toast-warning { border-color: var(--yellow); }

/* === Export View === */

.export-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.export-buttons .btn-export {
    flex: 1;
}

/* === Scrollbar === */

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* === Login Page === */

.login-body {
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.login-logo {
    text-align: center;
    margin-bottom: 8px;
}

.login-logo-img {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    filter: brightness(1.1);
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    border: 1px solid var(--border);
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-align: center;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 300;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.login-error {
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}

.login-btn {
    margin-top: 8px;
}

.login-success {
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}

.login-links {
    text-align: center;
    margin-top: 16px;
}

.first-run-notice {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 12px;
    background: rgba(255, 193, 7, 0.08);
    color: var(--text);
}

.first-run-notice[hidden] {
    display: none;
}

.first-run-notice strong,
.first-run-notice p {
    display: block;
    margin: 0 0 12px;
}

.first-run-notice .login-btn {
    margin-top: 4px;
    white-space: normal;
}

.setup-authority-confirmation {
    padding: 14px;
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 10px;
    background: rgba(76, 175, 80, 0.08);
}

.setup-authority-confirmation .checkbox-label {
    align-items: flex-start;
    line-height: 1.45;
}

.setup-login-link {
    margin-top: 16px;
}

.forgot-link {
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--text-primary);
}

.login-footer {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 300;
    opacity: 0.6;
}

/* === Admin Panel === */

.admin-badge {
    background: var(--yellow);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
}

.admin-nav {
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav-item {
    flex: 0 0 auto;
    padding: 6px 14px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.admin-nav-item.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.1);
}

.admin-section {
    display: none;
    padding: 16px 16px 16px;
    animation: fadeIn 0.3s ease;
}

.admin-section .view-title {
    margin-top: 4px;
    margin-bottom: 16px;
}

.admin-section.active {
    display: block;
}

.admin-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .admin-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 380px) {
    .admin-card-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.admin-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.admin-card-header h3 {
    margin-bottom: 0;
}

.admin-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon-danger:hover {
    background: rgba(255, 59, 48, 0.15);
}

/* Dashboard Tiles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dashboard-tile {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 16px;
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    user-select: none;
}

.dashboard-tile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-tile.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.dashboard-tile.drag-over {
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.08);
}

.dashboard-tile-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dashboard-tile-count {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
}

.dashboard-tile-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* Logo Preview */
.logo-preview-box {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--border);
    text-align: center;
}

.logo-preview-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-preview-img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
    filter: brightness(1.1);
}

.logo-preview-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Admin Table */
.admin-table {
    overflow-x: auto;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
    color: var(--text-primary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.action-cell {
    white-space: nowrap;
}

.role-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.role-admin {
    background: rgba(255, 204, 0, 0.15);
    color: var(--yellow);
}

.role-user {
    background: rgba(0, 122, 255, 0.15);
    color: var(--accent);
}

.status-active {
    color: var(--green);
    font-size: 12px;
    font-weight: 500;
}

.status-inactive {
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
}

.status-warning {
    color: var(--yellow);
    font-size: 12px;
    font-weight: 500;
}

/* Battery Row in Admin */
.battery-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

.battery-row:last-child {
    border-bottom: none;
}

.battery-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.battery-row-info strong {
    font-size: 14px;
}

/* Admin Dialog (wider for forms) */
.admin-dialog-content {
    max-height: 85vh;
    overflow-y: auto;
}

/* === Neue Dialoge (Features 1-3) === */

.dialog-wide {
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

.inline-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.inline-form-row .form-control {
    flex: 1;
    min-width: 0;
}

.inline-form-row .btn-small {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-add-device {
    width: 100%;
    margin-bottom: 16px;
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover {
    background: #cc2f26;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.device-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.device-card-actions .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 12px;
}

.device-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-edit-device, .btn-edit-mobilfunk {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.btn-edit-device:hover, .btn-edit-mobilfunk:hover {
    color: var(--accent);
}

.existing-battery {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 10px;
}

.form-control-static {
    display: inline-block;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-primary);
    min-width: 80px;
}

.dock-notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .dock-notes-grid {
        grid-template-columns: 1fr;
    }
}

.dock-info-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.dock-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dock-info-header h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.notes-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.notes-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.notes-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.notes-textarea:focus {
    border-color: var(--accent);
}

.notes-save-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    transition: color 0.3s;
}

.notes-save-hint.saved {
    color: var(--green);
}

.empty-hint {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-drone {
    background: rgba(0, 122, 255, 0.2);
    color: var(--accent);
}

.badge-remote {
    background: rgba(255, 149, 0, 0.2);
    color: var(--orange);
}

.badge-dock {
    background: rgba(0, 200, 150, 0.2);
    color: var(--green, #34c759);
}

/* === Akku-Verwaltung (kompaktes Grid) === */

.battery-mgmt-section {
    margin-bottom: 24px;
}

.battery-mgmt-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.battery-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 10px;
}

.battery-mgmt-group {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border: 1px solid var(--border);
}

.battery-mgmt-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.battery-mgmt-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) auto auto;
    grid-template-areas:
        "name level actions"
        "cycles cycles actions";
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.4);
    font-size: 12px;
}

.battery-mgmt-row:last-child {
    border-bottom: none;
}

.battery-mgmt-ident {
    grid-area: name;
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.battery-mgmt-name {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.battery-mgmt-sn {
    color: var(--text-secondary);
    font-size: 10px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
}

@media (min-width: 1024px) {
    .battery-mgmt-sn {
        display: inline;
    }
}

.battery-mgmt-level {
    grid-area: level;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.battery-mgmt-cycles {
    grid-area: cycles;
    color: var(--text-secondary);
    font-size: 10px;
    text-align: left;
    white-space: normal;
    min-width: 0;
}

.battery-mgmt-actions {
    grid-area: actions;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    justify-self: end;
}

.battery-mgmt-actions .btn-icon {
    font-size: 14px;
    padding: 2px 4px;
}

.btn-assign {
    background: rgba(0, 122, 255, 0.12);
    color: var(--accent);
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-assign:hover {
    background: rgba(0, 122, 255, 0.22);
}

/* === Piloten-Detail Overlay === */

.pilot-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 300;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pilot-detail-overlay.active {
    display: block;
}

.pilot-detail-content {
    background: var(--bg-secondary);
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    position: relative;
}

.pilot-detail-close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.pilot-detail-close:hover {
    background: rgba(255,255,255,0.2);
}

.pilot-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-right: 40px;
}

.pilot-detail-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.pilot-detail-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.pilot-detail-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    font-weight: 600;
    font-size: 32px;
    color: var(--accent);
}

.pilot-detail-avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--accent);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.pilot-detail-avatar-upload:hover {
    background: var(--accent-hover);
}

.pilot-detail-info h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.pilot-detail-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.pilot-detail-section {
    margin-bottom: 20px;
}

.pilot-detail-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pilot-detail-licenses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pilot-detail-drones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pilot-drone-badge {
    background: rgba(0, 122, 255, 0.12);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.pilot-detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.pilot-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
}

.pilot-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}

.pilot-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pilot-detail-most-flown {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.pilot-detail-most-flown strong {
    color: var(--text-primary);
}

/* Zertifikate Timeline */
.pilot-detail-certs {
    display: flex;
    gap: 0;
    position: relative;
    padding: 10px 0;
}

.pilot-detail-certs::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--border);
}

.pilot-cert-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.pilot-cert-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    margin: 0 auto 8px;
    position: relative;
    z-index: 1;
}

.pilot-cert-expired .pilot-cert-dot {
    background: var(--red);
}

.pilot-cert-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pilot-cert-date {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.pilot-cert-expired .pilot-cert-label,
.pilot-cert-expired .pilot-cert-date {
    color: var(--red);
}

/* Flughistorie Tabelle */
.pilot-detail-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pilot-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pilot-detail-table th {
    text-align: left;
    padding: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.pilot-detail-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
    color: var(--text-primary);
}

.pilot-detail-table tr:last-child td {
    border-bottom: none;
}

.pilot-detail-empty {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

/* === Motion Graphics Animationen (v1.1.0) === */

/* Batterie-Prozent animierter Counter */
.battery-percent[data-animated] {
    animation: counter-up 0.4s ease-out;
}

@keyframes counter-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard-Tile Counter-Animation */
.dashboard-tile-count[data-animated] {
    animation: counter-up 0.5s ease-out;
}

/* Battery-Card Stagger-Animation */
.battery-card {
    animation: card-appear 0.4s ease-out forwards;
}

.battery-card:nth-child(1) { animation-delay: 0.05s; }
.battery-card:nth-child(2) { animation-delay: 0.10s; }
.battery-card:nth-child(3) { animation-delay: 0.15s; }
.battery-card:nth-child(4) { animation-delay: 0.20s; }
.battery-card:nth-child(5) { animation-delay: 0.25s; }
.battery-card:nth-child(6) { animation-delay: 0.30s; }

@keyframes card-appear {
    from { transform: translateY(12px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}

/* Stat-Card farbige Akzentlinie */
.dashboard-tile {
    border-top: 3px solid transparent;
    transition: background 0.2s, transform 0.15s, opacity 0.2s, border-color 0.3s;
}

.dashboard-tile:nth-child(1) { border-top-color: #38BDF8; }
.dashboard-tile:nth-child(2) { border-top-color: #4ADE80; }
.dashboard-tile:nth-child(3) { border-top-color: #FB923C; }
.dashboard-tile:nth-child(4) { border-top-color: #F87171; }
.dashboard-tile:nth-child(5) { border-top-color: #A78BFA; }
.dashboard-tile:nth-child(6) { border-top-color: #38BDF8; }

/* Akku-Icon Warnsymbol für kritisch niedrige Akkus */
.battery-warning-icon {
    display: inline-block;
    animation: battery-pulse 0.6s infinite;
    font-size: 14px;
    margin-left: 4px;
    vertical-align: middle;
}

.battery-warn-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.battery-warn-badge.critical {
    background: #ff3b30;
    color: #fff;
    animation: battery-pulse 1s infinite;
}
.battery-warn-badge.warning {
    background: #fbbf24;
    color: #000;
}

/* === Profil / Mein Bereich === */

.profile-section {
    margin-bottom: 24px;
}

.profile-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #e94560;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.profile-avatar-area {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    border: 2px solid var(--accent);
}

/* Theme-Umschalter Kacheln */
.theme-switcher {
    display: flex;
    gap: 12px;
}

.theme-tile {
    flex: 1;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-tile:hover {
    border-color: var(--accent);
}

.theme-tile.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0, 122, 255, 0.3);
}

.theme-tile-preview {
    height: 64px;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-preview-classic {
    background: #0d0d1a;
}

.theme-preview-classic .theme-preview-header {
    height: 8px;
    background: #1a1a2e;
    border-radius: 2px;
    border-bottom: 1px solid #2a2a4a;
}

.theme-preview-classic .theme-preview-card {
    height: 14px;
    background: #16213e;
    border-radius: 3px;
}

.theme-preview-classic .theme-preview-card.short {
    width: 60%;
}

.theme-preview-dark-tech {
    background: radial-gradient(ellipse at 50% 0%, #0a1628, #050810);
}

.theme-preview-dark-tech .theme-preview-header {
    height: 8px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 2px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.theme-preview-dark-tech .theme-preview-card {
    height: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    backdrop-filter: blur(4px);
}

.theme-preview-dark-tech .theme-preview-card.short {
    width: 60%;
}

/* Vorschau „Hell": weiße Karten auf hellgrauem Grund, dezente Kanten */
.theme-preview-hell {
    background: #f4f6f9;
}

.theme-preview-hell .theme-preview-header {
    height: 8px;
    background: #ffffff;
    border-radius: 2px;
    border-bottom: 1px solid #d5dae4;
}

.theme-preview-hell .theme-preview-card {
    height: 14px;
    background: #ffffff;
    border: 1px solid #d5dae4;
    border-radius: 3px;
}

.theme-preview-hell .theme-preview-card.short {
    width: 60%;
}

/* Vorschau „Sonnenlicht": reines Weiß, kräftige schwarze Kanten.
   Die Vorschau zeigt bewusst den harten Kontrast — man soll auf einen Blick
   sehen, dass dieses Thema anders gemeint ist als das freundliche helle. */
.theme-preview-sonnenlicht {
    background: #ffffff;
}

.theme-preview-sonnenlicht .theme-preview-header {
    height: 8px;
    background: #ffffff;
    border-radius: 2px;
    border-bottom: 2px solid #1a1a1a;
}

.theme-preview-sonnenlicht .theme-preview-card {
    height: 14px;
    background: #ffffff;
    border: 2px solid #1a1a1a;
    border-radius: 3px;
}

.theme-preview-sonnenlicht .theme-preview-card.short {
    width: 60%;
}

.theme-tile-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.theme-tile.active .theme-tile-label {
    color: var(--accent);
}

/* Update-Timeline */
.update-timeline {
    position: relative;
    padding-left: 24px;
}

.update-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-entry {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
}

.timeline-dot.status-success { background: #4ade80; }
.timeline-dot.status-failed { background: #f87171; }
.timeline-dot.status-rolled { background: #fbbf24; }

.timeline-content {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.timeline-version {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.version-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.version-badge-current {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.version-badge-old {
    background: rgba(160, 160, 176, 0.2);
    color: #a0a0b0;
}

.timeline-status {
    font-size: 14px;
}

.timeline-status.status-success { color: #4ade80; }
.timeline-status.status-failed { color: #f87171; }
.timeline-status.status-rolled { color: #fbbf24; }

.timeline-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.timeline-changelog {
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
    white-space: pre-line;
}

/* About-Sektion */
.about-credits {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.about-tools {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.about-tagline {
    font-size: 13px;
    color: #e94560;
    font-style: italic;
    margin-bottom: 16px;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.about-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.about-row span:first-child {
    color: var(--text-secondary);
}

.about-row span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* === Entladekurve-Chart === */

.dialog-content-wide {
    max-width: 500px;
}

.discharge-chart-section {
    margin: 12px 0 8px;
}

.discharge-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* Ladepunkt-Statuszeile über dem Entlade-Chart */
.discharge-chargepoint-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm, 8px);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.discharge-chargepoint-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.discharge-chargepoint-label {
    font-size: 12px;
    color: var(--text-secondary, #a0a0b0);
}
.discharge-chargepoint-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary, #fff);
}
.discharge-mode-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}
.discharge-mode-badge.mode-rtf { background: #3b82f6; color: #fff; }
.discharge-mode-badge.mode-standard { background: var(--green, #2ecc71); color: #0d2818; }
.discharge-mode-badge.mode-custom { background: var(--yellow, #f1c40f); color: #1a1a2e; }
.discharge-mode-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11px;
}
.discharge-mode-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary, #888);
    opacity: 0.55;
}
.discharge-mode-legend .legend-item.active {
    opacity: 1;
    color: var(--text-primary, #fff);
    font-weight: 700;
}
.discharge-mode-legend .legend-dot {
    width: 9px; height: 9px; border-radius: 50%;
}
.discharge-mode-legend .dot-standard { background: var(--green, #2ecc71); }
.discharge-mode-legend .dot-rtf { background: #3b82f6; }

@media (max-width: 520px) {
    .discharge-chargepoint-bar { flex-direction: column; align-items: flex-start; }
    .discharge-chargepoint-value { font-size: 18px; }
}

.discharge-chart-info {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.discharge-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.discharge-info-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discharge-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.discharge-chart-container {
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    margin-bottom: 10px;
}

.discharge-chart-container canvas {
    width: 100%;
    height: 200px;
    display: block;
}

.discharge-slider-section {
    margin: 10px 0;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.discharge-slider-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}

.discharge-slider-label span {
    color: #38bdf8;
    font-weight: 600;
}

.discharge-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.discharge-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.discharge-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.discharge-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Batterie-Karten klickbar für Detail-Ansicht */
.battery-card.clickable {
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.battery-card.clickable:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

/* Pilot-Badge in Admin-Benutzertabelle */
.pilot-badge-yes {
    background: rgba(52, 199, 89, 0.15);
    color: var(--green);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* === PWA standalone styling === */

@media (display-mode: standalone) {
    .app-header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

/* === Akku-Design-Auswahl === */
.battery-style-switcher {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.battery-style-tile {
    flex: 1;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(255,255,255,0.03);
}
.battery-style-tile:hover {
    border-color: rgba(0, 212, 255, 0.4);
}
.battery-style-tile.active {
    border-color: #00D4FF;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.25);
}
.battery-style-preview {
    height: 18px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
    background: rgba(0,0,0,0.3);
    padding: 3px;
}
.battery-style-bar {
    height: 100%;
    width: 65%;
    border-radius: 3px;
}
.premium-bar {
    background: linear-gradient(90deg, #CC0000, #FF8C00, #00D4FF);
    box-shadow: 0 0 6px rgba(0,212,255,0.5);
}
.classic-bar {
    background: linear-gradient(90deg, #22C55E, #4ade80);
}
.battery-style-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
}
.battery-style-tile small {
    font-size: 10px;
    opacity: 0.55;
}

/* ============================================================
   Version-Anzeige — Badges, Bottom-Nav-Eintrag, Historie-Modal
   und Easter-Egg Zufalls-Spruch (siehe server/utils/versionInfo.js)
   ============================================================ */

/* Basis-Badge: erscheint überall dort wo die Versionsnummer klickbar sichtbar sein soll */
.version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-secondary, #aab);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.01em;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.version-badge:hover,
.version-badge:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text, #fff);
    border-color: var(--accent, rgba(99, 179, 237, 0.4));
    outline: none;
}
.version-badge:empty { display: none; }

/* Varianten: Position-spezifische Feinjustierung */
.version-badge-inline { margin-left: 6px; font-size: 10px; opacity: 0.75; }
.version-badge-header { margin-right: 4px; }
.version-badge-login { margin-left: 8px; font-size: 10px; }
.version-badge-dropdown { font-size: 10px; opacity: 0.7; }

/* Header-Quote: italic-Spruch rechts im Header-Actions-Bereich.
   Als Pill-Box mit Border — kräftig genug um auf den ersten Blick aufzufallen.
   Auf Mobile versteckt, damit der Header nicht kollabiert. */
.header-quote {
    max-width: 280px;
    padding: 4px 12px;
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
    color: var(--text, #e6ebf2);
    background: rgba(99, 179, 237, 0.12);
    border: 1px solid rgba(99, 179, 237, 0.35);
    border-radius: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-quote:empty { display: none; }
@media (max-width: 900px) {
    .header-quote { display: none; }
}

/* User-Dropdown Footer — Version + Zitat am unteren Ende des Profil-Menüs */
.dropdown-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px 8px;
    font-size: 10px;
    color: var(--text-secondary, #7788aa);
}
.dropdown-footer .random-quote-slot {
    font-style: italic;
    font-weight: 500;
    color: var(--text, #e6ebf2);
    background: rgba(99, 179, 237, 0.1);
    border: 1px solid rgba(99, 179, 237, 0.25);
    border-radius: 10px;
    padding: 6px 10px;
    line-height: 1.35;
}
.dropdown-footer .random-quote-slot:empty { display: none; }

/* Login-Footer: Main-Zeile mit Version + darunter italic-Zitat */
.login-footer-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.login-footer-quote {
    margin-top: 10px;
    padding: 8px 14px;
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
    color: var(--text, #e6ebf2);
    background: rgba(99, 179, 237, 0.1);
    border: 1px solid rgba(99, 179, 237, 0.28);
    border-radius: 14px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
}
.login-footer-quote:empty { display: none; }

/* Basis random-quote-slot fallback (für Kontexte ohne spezifische Styles) */
.random-quote-slot:empty { display: none; }

/* ====== Historie-Modal ====== */
.version-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.version-modal.open { display: flex; }
.version-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.version-modal-card {
    position: relative;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary, #1a1f2e);
    color: var(--text, #fff);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.version-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.version-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.version-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #889);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}
.version-modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text, #fff); }
.version-modal-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 12px;
    color: var(--text-secondary, #889);
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.05));
    flex-wrap: wrap;
}
.version-modal-meta strong {
    color: var(--text, #fff);
    font-size: 14px;
    font-weight: 700;
}
.version-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px 8px;
}
.version-entry {
    padding: 14px 0;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.05));
}
.version-entry:last-child { border-bottom: none; }
.version-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.version-entry-number {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent, #63b3ed);
}
.version-entry-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent, #63b3ed);
    color: #fff;
}
.version-entry-date {
    font-size: 11px;
    color: var(--text-secondary, #889);
    margin-left: auto;
}
.version-entry-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text, #fff);
}
.version-entry-changes {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary, #aab);
}
.version-entry-changes li { margin-bottom: 3px; }
.version-entry.current { background: rgba(99, 179, 237, 0.04); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }

.version-modal-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    text-align: center;
}
.version-modal-quote {
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    color: var(--text, #e6ebf2);
    background: rgba(99, 179, 237, 0.1);
    border: 1px solid rgba(99, 179, 237, 0.28);
    border-radius: 12px;
    padding: 6px 14px;
}

@media (max-width: 500px) {
    .version-modal-card { max-height: 92vh; }
    .version-modal-header h2 { font-size: 16px; }
    .version-entry-number { font-size: 14px; }
}

/* === Dokument-Upload Felder === */

.upload-field {
    position: relative;
}

.upload-field.upload-loading::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 12px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border, #2a2a4a);
    border-top-color: var(--accent, #007AFF);
    border-radius: 50%;
    animation: upload-spin 0.7s linear infinite;
}

@keyframes upload-spin {
    to { transform: rotate(360deg); }
}

.upload-field.upload-loading input[type="file"],
.upload-field.upload-loading button {
    opacity: 0.5;
    pointer-events: none;
}

/* === OCR-Retry-Dialog === */

.ocr-retry-dialog {
    max-width: 420px;
    text-align: center;
}

.ocr-retry-dialog .dialog-title {
    color: var(--orange, #ff9500);
}

.ocr-retry-dialog .dialog-actions {
    justify-content: center;
}

/* === Akku-Entladung: Discharge-Slider mit Farbverlauf, Tages-Strichen und Chip-Skala === */

/* Laufbahn: Farbverlauf grün (kurz = schonend) -> rot (lang = Zellstress).
   Die Tages-Striche sind Teil des Track-Hintergrunds (repeating-gradient),
   damit der Daumen darüber gleitet. 9 Intervalle bei 10 Stufen. */
.discharge-slider-wrap {
    position: relative;
    margin: 8px 0 2px;
}

.discharge-range {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 30px;
    border-radius: 15px;
    border: 1px solid var(--border, rgba(128, 128, 128, 0.35));
    background-image:
        repeating-linear-gradient(90deg,
            rgba(0, 0, 0, 0.3) 0 2px,
            transparent 2px 11.111%),
        linear-gradient(90deg,
            var(--green, #2ecc71) 0%,
            var(--green, #2ecc71) 22%,
            var(--yellow, #f1c40f) 50%,
            var(--orange, #ff9500) 78%,
            var(--red, #e74c3c) 100%);
    outline: none;
    cursor: pointer;
    margin: 0;
}

.discharge-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-card, #fff);
    border: 4px solid var(--accent, #4a90d9);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    cursor: grab;
    transition: transform 0.1s ease;
}

.discharge-range::-webkit-slider-thumb:hover {
    transform: scale(1.12);
}

.discharge-range::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.discharge-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-card, #fff);
    border: 4px solid var(--accent, #4a90d9);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    cursor: grab;
}

/* Zahlen liegen IM Slider: Overlay über der Laufbahn, klickbar.
   pointer-events nur auf den Zahlen selbst, damit Ziehen daneben normal funktioniert. */
.range-scale-inner {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 13px;
    pointer-events: none;
    user-select: none;
}

.range-scale-inner span {
    pointer-events: auto;
    cursor: pointer;
    min-width: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 2px;
    color: rgba(0, 0, 0, 0.55);
    transition: color 0.15s ease;
}

.range-scale-inner span:hover {
    color: rgba(0, 0, 0, 0.85);
}

.range-scale-inner span.active {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* === FlightHub-2-Einrichtung: Preflight-Checkliste (fh2-*) === */

/* Karte mit Farbverlaufs-Kante oben — markiert den FlightHub-Bereich */
.fh2-card {
    position: relative;
    overflow: hidden;
}

.fh2-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--accent, #4a90d9) 0%,
        var(--green, #2ecc71) 55%,
        var(--yellow, #f1c40f) 100%);
}

/* Abschnittstitel mit Ziellinien links/rechts */
.fh2-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent, #4a90d9);
}

.fh2-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border, rgba(128,128,128,0.35)));
}

.fh2-section-line:first-child {
    background: linear-gradient(90deg, var(--border, rgba(128,128,128,0.35)), transparent);
}

/* Stepper: nummerierte Kreise mit Verbindungslinie */
.fh2-step {
    position: relative;
    padding: 0 0 22px 52px;
}

.fh2-step:not(.fh2-step--last)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent, #4a90d9), var(--border, rgba(128,128,128,0.35)));
    opacity: 0.5;
}

.fh2-step-num {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--accent, #4a90d9);
    border: 2px solid var(--accent, #4a90d9);
    background: var(--bg-card, transparent);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Schritt erledigt (Wert gesetzt): Kreis wird grün mit Haken */
.fh2-step--done .fh2-step-num {
    background: var(--green, #2ecc71);
    border-color: var(--green, #2ecc71);
    color: #fff;
}

.fh2-step--done .fh2-step-num::after {
    content: ' ✓';
    font-size: 11px;
}

.fh2-step-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

/* "Woher?"-Hinweiszeilen */
.fh2-source {
    margin-top: 6px;
    padding: 7px 10px;
    border-left: 3px solid var(--accent, #4a90d9);
    border-radius: 0 6px 6px 0;
    background: rgba(74, 144, 217, 0.08);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary, #999);
}

.fh2-source a {
    color: var(--accent, #4a90d9);
    font-weight: 600;
}

.fh2-source code {
    font-size: 11px;
    opacity: 0.9;
}

.secret-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
}

.secret-input-wrap .form-control {
    min-width: 0;
    padding-right: 46px;
}

.secret-toggle {
    position: static;
    min-width: 112px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border, rgba(255,255,255,.2));
    border-radius: 8px;
    background: rgba(74, 144, 217, 0.08);
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.secret-toggle:hover,
.secret-toggle:focus-visible,
.secret-toggle[aria-pressed="true"] {
    color: var(--accent, #4a90d9);
    border-color: var(--accent, #4a90d9);
    background: rgba(74, 144, 217, 0.1);
    outline: none;
}

.secret-toggle:disabled {
    cursor: wait;
    opacity: 0.55;
}

.fh2-explainer {
    margin: 0 0 14px;
    line-height: 1.55;
}

.dji-setup-assistant {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(74, 144, 217, 0.55);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.13), rgba(34, 197, 94, 0.05));
}

.dji-assistant-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.dji-assistant-head h4,
.dji-assistant-head p {
    margin: 0;
}

.dji-assistant-head p {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.dji-assistant-head > strong {
    color: var(--accent, #4a90d9);
    white-space: nowrap;
}

.dji-assistant-progress {
    height: 8px;
    margin: 13px 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
}

.dji-assistant-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent, #4a90d9), #22c55e);
    transition: width .25s ease;
}

.dji-assistant-next {
    padding: 10px 12px;
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, .08);
    font-size: 13px;
    line-height: 1.5;
}

.dji-assistant-next[data-complete="true"] {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, .08);
}

.dji-assistant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.dji-assistant-actions .btn {
    width: auto;
}

.dji-assistant-safety {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.dji-wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(3, 7, 18, .82);
    backdrop-filter: blur(4px);
}

.dji-wizard-overlay[hidden],
.dji-wizard-page[hidden],
.dji-wizard-footer [hidden] {
    display: none !important;
}

.dji-wizard-dialog {
    width: min(760px, 100%);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid rgba(74, 144, 217, .65);
    border-radius: 16px;
    background: var(--bg-secondary, #17213d);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

.dji-wizard-header,
.dji-wizard-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
}

.dji-wizard-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.12));
}

.dji-wizard-header h3,
.dji-wizard-page h4,
.dji-wizard-page p {
    margin-top: 0;
}

.dji-wizard-header h3 {
    margin-bottom: 0;
}

.dji-wizard-kicker {
    color: var(--accent, #4a90d9);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dji-wizard-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border, rgba(255,255,255,.15));
    border-radius: 50%;
    background: transparent;
    color: var(--text, #fff);
    font-size: 25px;
    cursor: pointer;
}

.dji-wizard-stepbar {
    padding: 14px 22px 0;
}

.dji-wizard-progress {
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
}

.dji-wizard-progress span {
    display: block;
    width: 20%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent, #4a90d9), #22c55e);
    transition: width .2s ease;
}

.dji-wizard-page {
    min-height: 330px;
    padding: 22px;
}

.dji-wizard-page label:not(.dji-wizard-check) {
    display: block;
    margin: 15px 0 6px;
    font-weight: 700;
}

.dji-wizard-page small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.dji-wizard-proof,
.dji-wizard-warning,
.dji-wizard-finish-note {
    margin: 16px 0;
    padding: 12px 14px;
    border-left: 4px solid #22c55e;
    background: rgba(34, 197, 94, .09);
    line-height: 1.5;
}

.dji-wizard-warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, .09);
}

.dji-wizard-scope {
    line-height: 1.7;
}

.dji-wizard-eye {
    min-width: 112px;
    border: 1px solid var(--border, rgba(255,255,255,.15));
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    color: var(--text, #fff);
    font-weight: 700;
    cursor: pointer;
}

.dji-wizard-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 18px;
    font-weight: 700;
    line-height: 1.45;
}

.dji-wizard-check input {
    margin-top: 4px;
}

.dji-wizard-values {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.dji-wizard-values > div {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border, rgba(255,255,255,.12));
    border-radius: 8px;
}

.dji-wizard-values span {
    color: var(--text-secondary);
}

.dji-wizard-validation {
    margin: 0 22px 4px;
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, .6);
    border-radius: 8px;
    background: rgba(239, 68, 68, .09);
    color: #fca5a5;
}

.dji-wizard-footer {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    border-top: 1px solid var(--border, rgba(255,255,255,.12));
}

.dji-wizard-footer .btn {
    width: auto;
}

.dji-assistant-details {
    margin-top: 12px;
}

.dji-assistant-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.dji-assistant-list {
    display: grid;
    gap: 7px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.dji-assistant-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--border, rgba(255,255,255,.12));
    border-radius: 8px;
    background: rgba(0,0,0,.08);
}

.dji-assistant-list li[data-state="done"] {
    border-color: rgba(34, 197, 94, .55);
}

.dji-assistant-list li[data-state="missing"] {
    border-color: rgba(245, 158, 11, .6);
}

.dji-assistant-list li[data-state="error"] {
    border-color: rgba(239, 68, 68, .65);
}

.dji-assistant-state {
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.dji-assistant-list li[data-state="done"] .dji-assistant-state { color: #22c55e; }
.dji-assistant-list li[data-state="missing"] .dji-assistant-state { color: #f59e0b; }
.dji-assistant-list li[data-state="error"] .dji-assistant-state { color: #ef4444; }

.dji-assistant-list small {
    display: block;
    margin-top: 2px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.dji-assistant-jump {
    padding: 6px 9px;
    border: 1px solid var(--accent, #4a90d9);
    border-radius: 7px;
    background: transparent;
    color: var(--accent, #4a90d9);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.fh2-section-title--compact {
    margin-top: 18px;
}

@media (max-width: 600px) {
    .secret-input-wrap {
        grid-template-columns: 1fr;
    }

    .secret-toggle {
        min-height: 40px;
    }

    .dji-assistant-head {
        display: block;
    }

    .dji-assistant-head > strong {
        display: block;
        margin-top: 8px;
    }

    .dji-assistant-list li {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .dji-assistant-jump {
        grid-column: 2;
        justify-self: start;
    }

    .dji-wizard-overlay {
        align-items: end;
        padding: 0;
    }

    .dji-wizard-dialog {
        max-height: 96vh;
        border-radius: 16px 16px 0 0;
    }

    .dji-wizard-page {
        min-height: 0;
    }

    .dji-wizard-values > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .dji-wizard-footer {
        grid-template-columns: 1fr 1fr;
    }

    .dji-wizard-footer > span {
        display: none;
    }
}

.fh2-routing-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.fh2-route-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid rgba(241, 196, 15, 0.45);
    border-radius: 8px;
    background: rgba(241, 196, 15, 0.06);
    color: var(--text-secondary, #999);
    font-size: 12px;
    line-height: 1.45;
}

.fh2-route-card strong {
    color: var(--text-primary, #fff);
    font-size: 13px;
}

.fh2-route-card--app {
    border-color: rgba(46, 204, 113, 0.45);
    background: rgba(46, 204, 113, 0.06);
}

/* Erfassungsformular – Akku-Info und Warnungen (Welle 2.4b) */
.log-event-battery-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-card, #16213e);
    border-radius: var(--radius-sm, 10px);
    border: 1px solid var(--border, #2a2a4a);
}
.log-event-battery-info .log-event-bat-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #e8e8e8);
}
.log-event-battery-info .log-event-bat-sn {
    font-size: 12px;
    color: var(--text-secondary, #a0a0b0);
}
.log-event-battery-info .log-event-bat-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--accent, #007AFF);
    color: #fff;
    font-weight: 500;
}
.log-event-warning {
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--yellow, #ffcc00);
    border-left: 2px solid var(--yellow, #ffcc00);
    background: rgba(255, 204, 0, 0.08);
    border-radius: 0 4px 4px 0;
}
.log-event-hint {
    margin: 8px 0 12px;
}

/* Status-Cockpit */
.fh2-cockpit {
    margin: 6px 0 14px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(128,128,128,0.35));
    background: var(--bg-secondary, rgba(0,0,0,0.15));
}

.fh2-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.fh2-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border, rgba(128,128,128,0.35));
    color: var(--text-secondary, #999);
}

.fh2-chip::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-secondary, #999);
    flex-shrink: 0;
}

.fh2-chip--ok {
    border-color: var(--green, #2ecc71);
    color: var(--green, #2ecc71);
}

.fh2-chip--ok::before {
    background: var(--green, #2ecc71);
    animation: fh2-pulse 2s infinite;
}

.fh2-chip--warn {
    border-color: var(--yellow, #f1c40f);
    color: var(--yellow, #f1c40f);
}

.fh2-chip--warn::before {
    background: var(--yellow, #f1c40f);
}

.fh2-chip--err {
    border-color: var(--red, #e74c3c);
    color: var(--red, #e74c3c);
}

.fh2-chip--err::before {
    background: var(--red, #e74c3c);
}

@keyframes fh2-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.fh2-statusgrid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 14px;
    font-size: 12px;
    color: var(--text-secondary, #999);
}

.fh2-error {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--red, #e74c3c);
    background: rgba(231, 76, 60, 0.1);
    color: var(--red, #e74c3c);
    font-size: 12px;
    font-weight: 600;
}

/* Aktionsleiste + Legende */
.fh2-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fh2-badge-biz {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: var(--yellow, #f1c40f);
    color: #1a1a2e;
    vertical-align: middle;
}

.fh2-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--text-secondary, #999);
}

.fh2-legend-item {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.fh2-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transform: translateY(1px);
}

.fh2-dot--ok { background: var(--green, #2ecc71); }
.fh2-dot--warn { background: var(--yellow, #f1c40f); }
.fh2-dot--err { background: var(--red, #e74c3c); }
.fh2-dot--idle { background: var(--text-secondary, #999); }

@media (max-width: 760px) {
    .fh2-routing-guide {
        grid-template-columns: 1fr;
    }
}

/* === System-Einstellungen: einheitliche Optik (kompakte Pill-Buttons, Akzentkanten) === */

/* Alle Buttons in den Einstellungen: kompakt und pill-förmig statt voller Breite */
#section-settings .btn {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 999px;
}

/* Haupt-Speichern-Button: kompakt, aber prominent zentriert */
#section-settings > #btn-save-settings {
    display: block;
    margin: 6px auto 4px;
    padding: 10px 36px;
}

/* Jede Einstellungskarte hat eine eigene Akzentfarbe (--set-accent) für
   Kante, Titelpunkt, Unterblöcke und Hinweisboxen */
#section-settings .admin-card {
    position: relative;
    overflow: hidden;
    --set-accent: var(--accent, #4a90d9);
}

.set-card--green  { --set-accent: var(--green, #2ecc71); }
.set-card--yellow { --set-accent: var(--yellow, #f1c40f); }
.set-card--orange { --set-accent: var(--orange, #ff9500); }
.set-card--red    { --set-accent: var(--red, #e74c3c); }

#section-settings .admin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--set-accent);
    opacity: 0.6;
}

/* Akku-Karte: Kante im Slider-Farbverlauf */
#section-settings .set-card--battery::before {
    background: linear-gradient(90deg,
        var(--green, #2ecc71), var(--yellow, #f1c40f) 55%, var(--red, #e74c3c));
    opacity: 1;
}

/* FlightHub-Karte behält ihren Farbverlauf in voller Stärke */
#section-settings .fh2-card::before {
    background: linear-gradient(90deg,
        var(--accent, #4a90d9) 0%,
        var(--green, #2ecc71) 55%,
        var(--yellow, #f1c40f) 100%);
    opacity: 1;
}

/* Kartentitel mit leuchtendem Markierungspunkt in Kartenfarbe */
#section-settings .admin-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

#section-settings .admin-card h3::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--set-accent);
    box-shadow: 0 0 8px var(--set-accent);
}

/* Hinweisboxen (fh2-source) übernehmen die Kartenfarbe */
#section-settings .admin-card .fh2-source {
    border-left-color: var(--set-accent);
}

/* Unterblöcke im FlightHub-Stil: farbige Seitenkante + Uppercase-Titel */
.set-sub {
    border: 1px solid var(--border, rgba(128, 128, 128, 0.35));
    border-left: 3px solid var(--set-accent, var(--accent, #4a90d9));
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.set-sub h4 {
    margin: 0 0 12px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--set-accent, var(--accent, #4a90d9));
}

/* Zentrale Speichern-Leiste als klarer Seitenabschluss */
.set-savebar {
    display: flex;
    justify-content: center;
    margin: 22px 0;
}

#section-settings .set-savebar .btn {
    padding: 11px 44px;
    font-size: 14px;
    border-radius: 999px;
    box-shadow: 0 2px 14px rgba(74, 144, 217, 0.35);
}

/* Button-Gruppen in den Karten: nebeneinander mit Abstand statt gestapelt */
#section-settings .admin-card .form-row .btn {
    align-self: flex-end;
}

/* === Preflight-Design-Rollout: Admin-Bereiche (Welle 2.4c) ===
   Überträgt die Formensprache des Einstellungs-Bereichs (Farbcodes,
   Pill-Buttons, Leuchtpunkte, Akzentkanten, Hover-Effekte) auf
   Dashboard, Benutzer, Drohnen, Akkus, Docks, Fernbedienungen, Piloten.
   Alle Farben über var(--…, fallback) — Theme-kompatibel. */

/* --- 1. Admin-Navigation: gefüllte Akzent-Pill + Sektions-Farbpunkte --- */

.admin-nav-item {
    position: relative;
    padding-left: 22px;
    transition: color 0.2s, border-color 0.2s, background 0.2s,
                box-shadow 0.2s, transform 0.1s;
}

/* Farbpunkte vor jedem Nav-Item — Sektionsfarbe */
.admin-nav-item::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-secondary, #a0a0b0);
    opacity: 0.5;
    transition: background 0.2s, opacity 0.2s, box-shadow 0.2s;
}

/* Sektions-Farbzuordnung für Nav-Punkte */
.admin-nav-item[data-section="dashboard"]::before    { background: var(--accent, #007AFF); }
.admin-nav-item[data-section="logo"]::before         { background: var(--accent, #007AFF); }
.admin-nav-item[data-section="users"]::before        { background: var(--yellow, #ffcc00); }
.admin-nav-item[data-section="drones"]::before       { background: var(--accent, #007AFF); }
.admin-nav-item[data-section="batteries"]::before    { background: var(--green, #34c759); }
.admin-nav-item[data-section="docks"]::before        { background: var(--orange, #ff9500); }
.admin-nav-item[data-section="remotes"]::before      { background: var(--accent, #007AFF); }
.admin-nav-item[data-section="pilots"]::before       { background: var(--red, #ff3b30); }
.admin-nav-item[data-section="settings"]::before     { background: var(--accent, #007AFF); }

/* Hover: leichte Anhebung */
.admin-nav-item:hover {
    border-color: var(--text-secondary, #a0a0b0);
    background: rgba(255, 255, 255, 0.04);
}

.admin-nav-item:hover::before {
    opacity: 0.8;
}

/* Aktiver Zustand: gefüllte Akzent-Pill mit Glow */
.admin-nav-item.active {
    color: #fff;
    border-color: transparent;
    background: var(--accent, #007AFF);
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.admin-nav-item.active::before {
    background: #fff;
    opacity: 0.9;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* --- 2. Sektionstitel: Leuchtpunkt + farbiger Unterstrich je Sektion --- */

/* Gemeinsame Basis: Leuchtpunkt vor dem Titel */
.admin-section .view-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
}

.admin-section .view-title::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Farbzuordnung: Leuchtpunkt + Unterstrich je Sektion */
#section-dashboard .view-title::before {
    background: var(--accent, #007AFF);
    box-shadow: 0 0 8px var(--accent, #007AFF);
}
#section-dashboard .view-title {
    border-bottom-color: rgba(0, 122, 255, 0.25);
}

#section-logo .view-title::before {
    background: var(--accent, #007AFF);
    box-shadow: 0 0 8px var(--accent, #007AFF);
}
#section-logo .view-title {
    border-bottom-color: rgba(0, 122, 255, 0.25);
}

#section-users .view-title::before {
    background: var(--yellow, #ffcc00);
    box-shadow: 0 0 8px var(--yellow, #ffcc00);
}
#section-users .view-title {
    border-bottom-color: rgba(255, 204, 0, 0.25);
}

#section-drones .view-title::before {
    background: var(--accent, #007AFF);
    box-shadow: 0 0 8px var(--accent, #007AFF);
}
#section-drones .view-title {
    border-bottom-color: rgba(0, 122, 255, 0.25);
}

#section-batteries .view-title::before {
    background: var(--green, #34c759);
    box-shadow: 0 0 8px var(--green, #34c759);
}
#section-batteries .view-title {
    border-bottom-color: rgba(52, 199, 89, 0.25);
}

#section-docks .view-title::before {
    background: var(--orange, #ff9500);
    box-shadow: 0 0 8px var(--orange, #ff9500);
}
#section-docks .view-title {
    border-bottom-color: rgba(255, 149, 0, 0.25);
}

#section-remotes .view-title::before {
    background: var(--accent, #007AFF);
    box-shadow: 0 0 8px var(--accent, #007AFF);
}
#section-remotes .view-title {
    border-bottom-color: rgba(0, 122, 255, 0.25);
}

#section-pilots .view-title::before {
    background: var(--red, #ff3b30);
    box-shadow: 0 0 8px var(--red, #ff3b30);
}
#section-pilots .view-title {
    border-bottom-color: rgba(255, 59, 48, 0.25);
}

#section-settings .view-title::before {
    background: var(--accent, #007AFF);
    box-shadow: 0 0 8px var(--accent, #007AFF);
}
#section-settings .view-title {
    border-bottom-color: rgba(0, 122, 255, 0.25);
}

/* --- 3. Toolbar-Buttons: kompakte Pills (analog Einstellungen) --- */

.admin-toolbar .btn {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 999px;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.admin-toolbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

/* --- 4. Dashboard-Karten: Hover-Anhebung, Leuchtpunkt, konsistente Abstände --- */

.dashboard-tile {
    position: relative;
    overflow: hidden;
    transition: background 0.2s, transform 0.2s ease, opacity 0.2s,
                border-color 0.3s, box-shadow 0.3s;
}

/* Leuchtpunkt oben links in der Kachel */
.dashboard-tile::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    opacity: 0.7;
    transition: opacity 0.2s, box-shadow 0.2s;
}

/* Farbzuordnung für Dashboard-Leuchtpunkte (parallel zu border-top) */
.dashboard-tile:nth-child(1)::after { background: #38BDF8; box-shadow: 0 0 6px #38BDF8; }
.dashboard-tile:nth-child(2)::after { background: #4ADE80; box-shadow: 0 0 6px #4ADE80; }
.dashboard-tile:nth-child(3)::after { background: #FB923C; box-shadow: 0 0 6px #FB923C; }
.dashboard-tile:nth-child(4)::after { background: #F87171; box-shadow: 0 0 6px #F87171; }
.dashboard-tile:nth-child(5)::after { background: #A78BFA; box-shadow: 0 0 6px #A78BFA; }
.dashboard-tile:nth-child(6)::after { background: #38BDF8; box-shadow: 0 0 6px #38BDF8; }

/* Hover: Anhebung + verstärkter Glow */
.dashboard-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.dashboard-tile:hover::after {
    opacity: 1;
}

/* --- 5. Listen-Bereich: Tabellen-Hover, Badge-Chips, Aktions-Buttons --- */

/* Tabellenzeilen-Hover (für dynamisch generierte Tabellen) */
.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Karten-Hover in Listen (admin-card-grid) */
.admin-card-grid .admin-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.admin-card-grid .admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    border-color: var(--accent, #007AFF);
}

/* Rollen-/Status-Badges als Chips (fh2-chip-Optik) */
.role-badge {
    border-radius: 999px;
    letter-spacing: 0.03em;
    transition: background 0.2s;
}

.status-active,
.status-inactive,
.status-warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Leuchtpunkte vor Status-Texten */
.status-active::before,
.status-inactive::before,
.status-warning::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-active::before {
    background: var(--green, #34c759);
    box-shadow: 0 0 5px var(--green, #34c759);
}

.status-inactive::before {
    background: var(--red, #ff3b30);
    box-shadow: 0 0 5px var(--red, #ff3b30);
}

.status-warning::before {
    background: var(--yellow, #ffcc00);
    box-shadow: 0 0 5px var(--yellow, #ffcc00);
}

/* Pilot-Badge als Chip */
.pilot-badge-yes {
    border-radius: 999px;
}

/* Aktions-Buttons in Karten: kleiner, pill-förmig */
.admin-card-actions .btn-icon {
    border-radius: 8px;
    transition: background 0.2s, transform 0.1s;
}

.admin-card-actions .btn-icon:hover {
    transform: scale(1.1);
}

/* --- 6. Akku-Verwaltung: Karten-Hover, Gruppen-Akzente --- */

/* Akku-Management-Gruppen: dezente Seitenkante */
.battery-mgmt-group {
    position: relative;
    border-left: 3px solid var(--green, #34c759);
    border-radius: 0 8px 8px 0;
    transition: border-color 0.2s;
}

/* Akku-Reihen: Hover-Effekt */
.battery-mgmt-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Battery-Badges als Chips */
.battery-badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* --- 7. Sektions-spezifische Karten-Akzente (analog set-card--*) ---
   Admin-Cards außerhalb der Einstellungen erhalten per Sektion
   eine dezente Akzentkante oben */

/* Logo-Sektion */
#section-logo .admin-card {
    position: relative;
    overflow: hidden;
}
#section-logo .admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, #007AFF);
    opacity: 0.6;
}

/* Drohnen-Listen: Karten mit Akzentkante */
#section-drones .admin-card-grid .admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, #007AFF);
    opacity: 0.5;
}

/* Akku-Listen: Karten mit grüner Akzentkante */
#section-batteries .admin-card-grid .admin-card {
    position: relative;
    overflow: hidden;
}
#section-batteries .admin-card-grid .admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--green, #34c759);
    opacity: 0.5;
}

/* Dock-Listen: Karten mit oranger Akzentkante */
#section-docks .admin-card-grid .admin-card {
    position: relative;
    overflow: hidden;
}
#section-docks .admin-card-grid .admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--orange, #ff9500);
    opacity: 0.5;
}

/* Fernbedienungen: Karten mit blauer Akzentkante */
#section-remotes .admin-card-grid .admin-card {
    position: relative;
    overflow: hidden;
}
#section-remotes .admin-card-grid .admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, #007AFF);
    opacity: 0.5;
}

/* Piloten: Karten mit roter Akzentkante */
#section-pilots .admin-card-grid .admin-card {
    position: relative;
    overflow: hidden;
}
#section-pilots .admin-card-grid .admin-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--red, #ff3b30);
    opacity: 0.5;
}

/* --- 8. Leere Zustände: dezente Chip-Optik --- */
.empty-state {
    border-radius: var(--radius-sm, 10px);
    border: 1px dashed var(--border, #2a2a4a);
    text-align: center;
}

/* --- 9. Device-Detail-Zeilen: einheitlicher Hover --- */
.device-detail:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

/* --- 10. Einheiten-Schiebeschalter (Wind: m/s ⇄ km/h) ---
   Sitzt direkt hinter der Beschriftung, nicht am rechten Rand.
   Umgesetzt mit Radio-Feldern, damit Tastatur und Vorlesehilfen funktionieren;
   sichtbar ist davon nur der gleitende Knopf. */
.wind-kopf {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.wind-kopf > label {
    margin: 0;
}

.wind-hinweis {
    font-size: 12px;
    color: var(--text-secondary, #a0a0b0);
    margin-top: 4px;
    min-height: 16px;
}

.einheit-schalter {
    position: relative;
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--border, #2a2a4a);
    border-radius: 999px;
    background: var(--bg-input, #0f3460);
}

.einheit-schalter input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.einheit-schalter label {
    position: relative;
    z-index: 1;
    margin: 0;
    min-width: 48px;
    padding: 3px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-secondary, #a0a0b0);
    cursor: pointer;
    user-select: none;
    transition: color 0.18s ease;
}

.einheit-schalter input:checked + label {
    color: #fff;
}

/* Der gleitende Knopf. Breite = genau eine Hälfte, deshalb verschiebt ihn
   translateX(100%) passgenau auf die zweite Position. */
.einheit-schalter-knopf {
    position: absolute;
    z-index: 0;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: calc(50% - 2px);
    border-radius: 999px;
    background: var(--accent, #007AFF);
    transition: transform 0.18s ease;
}

.einheit-schalter input:last-of-type:checked ~ .einheit-schalter-knopf {
    transform: translateX(100%);
}

.einheit-schalter input:focus-visible + label {
    outline: 2px solid var(--accent, #007AFF);
    outline-offset: 2px;
    border-radius: 999px;
}

/* --- 11. Schnellschalter für das Thema (Kopfzeile) ---
   Zeigt immer das Ziel, nicht den Zustand: Bei dunklem Thema die Sonne
   („hell machen"), bei hellem den Mond. Das ist die Konvention, die Benutzer
   von Telefon-Betriebssystemen kennen. */
.thema-schalter {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thema-icon {
    display: none;
}

/* Dunkle Themen (auch der Ausgangszustand ohne Attribut): Sonne anbieten */
.thema-icon-sonne {
    display: block;
}

body[data-theme="hell"] .thema-icon-sonne,
body[data-theme="sonnenlicht"] .thema-icon-sonne {
    display: none;
}

body[data-theme="hell"] .thema-icon-mond,
body[data-theme="sonnenlicht"] .thema-icon-mond {
    display: block;
}

/* --- 12. Fehleranalyse (Adminbereich) ---
   Die Liste braucht Breite: Meldung, Pfad, Benutzer und Fehlernummer stehen
   nebeneinander. In einer schmalen Spalte bricht alles um und wird unlesbar. */
.fa-breit {
    max-width: none;
}

.fa-kopf {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.fa-unterzeile {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-secondary, #a0a0b0);
    max-width: 70ch;
}

.fa-kopf-aktionen {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.fa-reiter {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.fa-reiter-knopf {
    padding: 7px 16px;
    border: 1px solid var(--border, #2a2a4a);
    border-radius: var(--radius-sm, 10px);
    background: transparent;
    color: var(--text-secondary, #a0a0b0);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.fa-reiter-knopf:hover {
    color: var(--text-primary, #e8e8e8);
}

.fa-reiter-knopf.active {
    background: var(--accent, #007AFF);
    border-color: var(--accent, #007AFF);
    color: #fff;
}

.protokoll-filter {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.protokoll-filter .form-group {
    flex: 1 1 180px;
    margin: 0;
}

.protokoll-filter-knopf {
    flex: 0 0 auto;
}

/* --- Die Liste selbst --- */
.fa-liste {
    max-height: 65vh;
    overflow-y: auto;
}

.fa-leer {
    padding: 24px 4px;
    color: var(--text-secondary, #a0a0b0);
    text-align: center;
}

.fa-tag-kopf {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 4px 6px;
    background: var(--bg-card, #16213e);
    border-bottom: 1px solid var(--border, #2a2a4a);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #a0a0b0);
}

.fa-zeile {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border, #2a2a4a);
    font-size: 13px;
}

.fa-zeile:last-child {
    border-bottom: none;
}

.fa-zeit {
    flex: 0 0 68px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary, #a0a0b0);
}

.fa-punkt {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    align-self: center;
}

.fa-abzeichen {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.fa-inhalt {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.fa-pfad {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--bg-input, #0f3460);
    font-size: 12px;
}

.fa-status,
.fa-benutzer,
.fa-dauer {
    font-size: 12px;
    color: var(--text-secondary, #a0a0b0);
}

.fa-nummer {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px solid var(--border, #2a2a4a);
    font-size: 12px;
    color: var(--text-secondary, #a0a0b0);
}

/* --- Download mit Zeitraum --- */
.fa-download {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fa-download-text {
    font-weight: 600;
}

/* Gerätemeldungen: Hochladen und Häufigkeit */
.gm-titel {
    margin: 0 0 6px;
    font-size: 15px;
}

.gm-upload {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.gm-upload input[type="file"] {
    flex: 1 1 320px;
}

.gm-ergebnis {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary, #a0a0b0);
    min-height: 18px;
}

.gm-anzahl-abzeichen {
    flex: 0 0 auto;
    min-width: 46px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--bg-input, #0f3460);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

/* Werteverlauf: „level 16 → 14" */
.fa-verlauf {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--bg-input, #0f3460);
    font-size: 12px;
}

.fa-feld {
    font-weight: 600;
    opacity: 0.85;
}

.fa-alt {
    text-decoration: line-through;
    opacity: 0.65;
}

.fa-pfeil {
    opacity: 0.6;
}

.fa-neu {
    font-weight: 700;
}

.fa-download label {
    margin: 0;
    color: var(--text-secondary, #a0a0b0);
}

.fa-download input[type="date"] {
    width: auto;
}

/* Mobilfunkmodul: Haken davor, Felder klappen darunter auf.
   Die SIM-Karte steckt im Modul — darum ein eingerueckter Block statt
   fuenf lose Felder zwischen den Stammdaten. */
.form-check-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check-inline input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.form-check-inline label {
    margin: 0;
    cursor: pointer;
}

.mf-block {
    border-left: 2px solid var(--border-color, #2a3f5f);
    padding-left: 14px;
    margin: 4px 0 14px;
}

.mf-block[hidden] {
    display: none;
}

/* Erklaerender Kleintext unter einem Eingabefeld. */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted, #8b98ab);
}

/* Gerätemeldungen zu einem Flug — aufklappbar unter dem Flugeintrag. */
.flight-meldungen-btn {
    margin-top: 8px;
    background: none;
    border: 1px solid var(--border-color, #2a3f5f);
    color: var(--text-secondary, #9fb3c8);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.flight-meldungen-btn:hover {
    border-color: var(--accent-color, #e94560);
    color: var(--accent-color, #e94560);
}

.flight-meldungen {
    margin-top: 8px;
    border-left: 2px solid var(--border-color, #2a3f5f);
    padding-left: 10px;
}

.flight-meldungen[hidden] { display: none; }

.flight-meldungen-fenster,
.flight-meldungen-leer {
    font-size: 12px;
    color: var(--text-muted, #8b98ab);
    margin-bottom: 6px;
}

.flight-meldung {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(128, 128, 128, .12);
}

.flight-meldung:last-child { border-bottom: none; }

.flight-meldung-zeit {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, #8b98ab);
}

.flight-meldung-text { flex: 1 1 auto; }

.flight-meldung-code {
    flex: 0 0 auto;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-muted, #8b98ab);
}

/* Stufe 4 ist die schwerste — sie soll im Flugkontext sofort auffallen. */
.flight-meldung.stufe-4 .flight-meldung-text { color: #d32f2f; font-weight: 600; }
.flight-meldung.stufe-3 .flight-meldung-text { color: #b45309; }

.gm-export {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.gm-export label { font-size: 13px; margin: 0; }
.gm-export select { width: auto; min-width: 160px; }
.gm-export .btn { width: auto; padding: 6px 12px; font-size: 13px; }

/* Warnhinweis in der Telemetrie-Anzeige (z. B. fast volle Speicherkarte).
   Gelb statt rot: der Zustand ist zu beachten, aber kein Ausfall. */
.telemetrie-warnung { color: var(--warning, #e0a800); font-weight: 600; }

/* Einklappbare Telemetrie-Anzeige (Gerätekarte + Gruppen). Standardmäßig
   zugeklappt (bis auf Ausnahmen, die admin.js per Standard-Set steuert) --
   bei 85+ Feldern je Gerät wäre alles aufgeklappt eine Wand aus Text. */
.telemetrie-geraet {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 16px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.telemetrie-geraet > summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    list-style: revert;
}

.telemetrie-geraet-name { font-weight: 700; }

.telemetrie-geraet-sn {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-secondary);
}

.telemetrie-geraet-meta {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-secondary);
}

.telemetrie-gruppe {
    margin: 8px 0 8px 4px;
    padding-left: 8px;
    border-left: 2px solid var(--border);
}

.telemetrie-gruppe > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .02em;
    padding: 4px 0;
}

/* Feldzeile zweispaltig: Label links, Wert rechtsbündig. */
.telemetrie-feld {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
    padding: 3px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.telemetrie-feld > span:last-child {
    text-align: right;
    color: var(--text-primary);
    font-weight: 500;
}

/* ── Mobilfunkmodule (v1.0.11) ───────────────────────────────────────────
   Ein Modul ist ein eigenes Betriebsmittel; die Kernfelder an den Geräten
   sind nur noch eine Kurzansicht darauf. Der Hinweis darüber sagt das laut,
   damit niemand die Kurzansicht für die ganze Wahrheit hält. */
.mf-hinweis {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted, #8b98ab);
}

.mf-modulname {
    font-weight: 600;
    color: var(--text-secondary);
}

.mf-hinweis[hidden] {
    display: none;
}

/* „per DJI bestätigt" ist keine Dekoration: Es unterscheidet einen
   abgetippten Wert von einem, den das Gerät selbst gemeldet hat. */
.mf-bestaetigt {
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

/* Ein Widerspruch wird gezeigt, nicht aufgelöst — deshalb auffällig, aber
   nicht rot: Es ist kein Fehler, sondern eine offene Frage. */
.mf-abweichung {
    color: var(--yellow);
    font-weight: 600;
}

/* Herkunft je Kernfeld. Kein Schmuck: Ein abgetippter und ein vom Gerät
   gemeldeter Wert sehen sonst gleich aus, obwohl nur einer belegt ist.
   Deshalb ruhig gehalten — lesbar, aber nicht lauter als der Wert selbst. */
.herkunft-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    vertical-align: middle;
    background: var(--bg-tertiary, #1c2740);
    color: var(--text-muted, #8b98ab);
}

.herkunft-badge.herkunft-dji {
    color: var(--green);
}

.herkunft-badge.herkunft-altbestand {
    color: var(--text-muted, #8b98ab);
}

/* Eine unvollständige ICCID ist kein Fehler des Nutzers, sondern eine offene
   Aufgabe — gelb wie die Abweichung, nicht rot wie ein Ausfall. */
.badge-warnung {
    background: transparent;
    border: 1px solid var(--yellow);
    color: var(--yellow);
}

.mf-iccid-alt {
    color: var(--yellow);
    font-weight: 600;
}

.mf-leerzeile {
    margin-bottom: 14px;
}

.mf-karte .device-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mf-telemetrie {
    font-size: 13px;
    line-height: 1.5;
}

.mf-zert {
    margin-top: 10px;
    border-top: 1px solid var(--border-color, #2a3f5f);
    padding-top: 8px;
}

.mf-zert > summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

.empty-hint {
    font-size: 13px;
    color: var(--text-muted, #8b98ab);
}

/* === Update-Hinweis (PWA) ===
   Fixiert unten, gelber Rand, ueber allen Ansichten. Erscheint erst, wenn ein
   neuer Service Worker uebernommen hat — das Neuladen bleibt Knopfdruck. */

.update-hinweis {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    border: 2px solid var(--yellow, #f5c518);
    border-radius: 10px;
    background: var(--bg-card, #16213e);
    color: var(--text-primary, #ffffff);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    font-size: 14px;
}

.update-hinweis[hidden] {
    display: none;
}

/* Die Versionszeile im Adminbereich: Commit und Container in Monospace,
   damit Zeichendreher beim Abgleich mit `docker ps` auffallen. */
.admin-versionszeile {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-word;
}

/* Gruppenueberschrift im Mobilfunkdialog (v1.0.12). Trennt SIM,
   Zertifizierungen und Einbau, ohne wie ein eigener Abschnitt zu wirken. */
.dialog-gruppe {
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
}
