/* 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;
}

* {
    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;
}

.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-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;
}

.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-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;
}

.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: #1c2a4a;
}

.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 {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.btn-edit-device: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(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .battery-mgmt-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.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: flex;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.4);
    gap: 6px;
    font-size: 12px;
}

.battery-mgmt-row:last-child {
    border-bottom: none;
}

.battery-mgmt-name {
    font-weight: 500;
    flex: 1;
    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 {
    font-weight: 600;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.battery-mgmt-cycles {
    color: var(--text-secondary);
    font-size: 10px;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.battery-mgmt-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.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%;
}

.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;
}

.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;
}
