:root {
    /* Premium Dark Mode Palette */
    --bg-color: #0f172a; /* Slate 900 */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --surface-color: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --surface-border: rgba(255, 255, 255, 0.1);
    
    --primary: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.5);
    
    --danger: #ef4444; /* Red 500 */
    --success: #10b981; /* Emerald 500 */
    --warning: #f59e0b; /* Amber 500 */
    
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    
    --input-bg: rgba(30, 41, 59, 0.9);
    --input-border: rgba(255, 255, 255, 0.2);
    --card-hover-bg: rgba(30, 41, 59, 0.9);
    --hover-bg-light: rgba(255, 255, 255, 0.05);
    --hover-bg-med: rgba(255, 255, 255, 0.1);
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --nav-height: 65px;
    --header-height: 60px;
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    height: 100%;
    overflow: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    font-weight: 500;
    color: white;
}

.mobile-only {
    display: none !important;
}

/* App Structure */
#app-root, #main-layout {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--surface-border);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.logo i {
    color: var(--primary);
}

/* Theme-abhängige Logos */
.logo-light { display: none; }
.logo-dark  { display: inline; }

[data-theme="light"] .logo-light { display: inline; }
[data-theme="light"] .logo-dark  { display: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator.online { color: var(--success); }
.status-indicator.offline { color: var(--warning); }

.app-content {
    flex: 1;
    padding: 20px;
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: calc(var(--nav-height) + 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--surface-border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    width: 33%;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
}

.floating-btn-wrapper {
    position: relative;
    top: -20px;
}

.floating-btn {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-btn i {
    line-height: 1;
    margin: 0;
    padding: 0;
}

.nav-item.active .floating-btn {
    transform: scale(1.1);
}

/* Views & Animations */
.view {
    animation: fadeIn 0.4s ease;
}

#view-login {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.view-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.view-header h2 {
    flex: 0 1 auto;
    font-size: 1.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Forms & Inputs */
.form-panel {
    border-radius: var(--radius-lg);
    padding: 20px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 8px;
}

.form-section h3 i {
    color: var(--text-main) !important;
}

.mission-meta i {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-row.triple {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-row .form-group {
    margin-bottom: 0;
    min-width: 0; /* Fix for flex/grid items */
}

/* Image Previews */
.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.preview-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    background: rgba(0,0,0,0.2);
}

.preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9); /* Red */
    color: white;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.btn-remove-image:hover {
    transform: scale(1.1);
    background: var(--danger);
}

.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    min-height: 45px;
    box-sizing: border-box;
}

input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    padding-right: 40px !important;
}

input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    padding-right: 40px !important;
}

[data-theme="light"] input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E") !important;
}

[data-theme="light"] input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E") !important;
}



select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px !important;
}

[data-theme="light"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* Hide number spinners */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Make browser-native picker icons white for dark mode */
::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
}

/* Checkbox Grid for Resources/Members */
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-grid.small {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--hover-bg-light);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
    color: var(--text-main);
    font-size: 0.85rem;
    min-height: 44px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    min-width: 200px;
    flex: 1 1 200px;
}

.checkbox-grid label:hover {
    background: var(--hover-bg-med);
}

/* Custom Checkbox Styling */
.checkbox-grid input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-grid input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.checkbox-grid input[type="checkbox"]:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 11px;
}

.checkbox-grid label:has(input:checked) {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    color: white;
}

input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

/* Material List (with quantity) */
.material-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

.btn-outline:hover {
    background: var(--hover-bg-light);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--hover-bg-light);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--hover-bg-med);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}


.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--surface-border);
}

/* Login View */
.login-container {
    max-width: 400px;
    width: 100%;
    margin: auto;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tabs & Settings Lists */
.tabs {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 5px;
}

.tab-btn {
    background: var(--hover-bg-light);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover:not(.active) {
    background: var(--hover-bg-med);
    color: var(--text-main);
    border-color: var(--primary-glow);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
    border-radius: var(--radius-lg);
    padding: 20px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.data-list {
    list-style: none;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--surface-border);
}

.data-list li:last-child {
    border-bottom: none;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

.admin-table th {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

/* Tom Select Premium Dark Theme */
.ts-wrapper.single .ts-control, .ts-wrapper.single .ts-control input {
    cursor: pointer;
    color: white !important;
}
.ts-control input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}
.ts-control {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: white !important;
    border-radius: var(--radius-sm) !important;
    padding: 10px 12px !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    box-shadow: none !important;
}
.ts-wrapper.focus .ts-control {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-glow) !important;
}
.ts-dropdown {
    background: #1e293b !important;
    color: white !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-sm) !important;
    margin-top: 5px !important;
    box-shadow: var(--shadow-lg) !important;
}
.ts-dropdown .option {
    padding: 10px 12px !important;
}
.ts-dropdown .active {
    background: var(--primary) !important;
    color: white !important;
}
.ts-dropdown .option:hover {
    background: rgba(59, 130, 246, 0.2) !important;
}
.ts-control .item {
    color: white !important;
}

.delete-btn {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

/* Mission Cards */
.card-grid {
    display: grid;
    gap: 15px;
}

.mission-card {
    padding: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.mission-card:hover {
    transform: translateY(-2px);
    background: var(--card-hover-bg);
}

.mission-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.mission-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.mission-type.brand { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.mission-type.technik { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.mission-type.gefahrgut { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.mission-type.brandmelder { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.mission-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mission-location {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.mission-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Vehicle Tag in Report */
.vehicle-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--hover-bg-light);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    min-width: max-content;
}

.vehicle-tag-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Keep name and plate together if possible */
}

.vehicle-tag-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Member List in Report */
.member-list-container {
    display: block;
    width: fit-content;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 10px;
    min-width: 220px;
}

.member-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    white-space: nowrap;
    color: var(--text-main);
    font-size: 0.95rem;
}

.member-list-item i {
    color: var(--success);
    font-size: 0.8rem;
    width: 14px;
}

.member-rank {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 45px;
}

.member-name {
    font-weight: 500;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border);
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: opacity 0.3s, top 0.3s;
}

.notification.success { border-left: 3px solid var(--success); }
.notification.error { border-left: 3px solid var(--danger); }

/* Responsive */
@media (max-width: 1024px) {
    .form-row, .form-row.triple {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 15px;
    }

    .checkbox-grid label {
        width: 100% !important;
        flex: 1 1 100%;
    }

    .tab-content .flex-row {
        flex-direction: column;
        align-items: stretch !important;
    }
}

@media (max-width: 600px) {
    .add-form {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-outline, .btn-primary {
        width: 100%;
    }

    .view-header .btn-outline, 
    .view-header .btn-primary {
        width: auto;
        flex-shrink: 0;
    }

    .btn-icon {
        flex-shrink: 0;
    }

    .data-list li {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .mobile-only {
        display: flex !important;
    }
}

/* Address Suggestions */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 5px;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-border);
    font-size: 0.9rem;
    color: var(--text-main);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.map-container {
    height: 300px;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    margin-top: 10px;
    z-index: 10;
}

/* Fix Leaflet attribution color in dark mode */
[data-theme="dark"] .leaflet-control-attribution,
[data-theme="dark"] .leaflet-control-zoom-in,
[data-theme="dark"] .leaflet-control-zoom-out {
    background-color: var(--bg-color) !important;
    color: var(--text-muted) !important;
    border-color: var(--surface-border) !important;
}

[data-theme="dark"] .leaflet-bar a {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    border-bottom: 1px solid var(--surface-border) !important;
}

[data-theme="dark"] .leaflet-tile {
    filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

/* Custom Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.floating-form-actions {
    position: fixed;
    bottom: calc(var(--nav-height) + 8px);
    right: 5px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    z-index: 2000;
    pointer-events: none;
    align-items: center;
}

.floating-form-actions .btn-fab {
    pointer-events: auto;
}

.btn-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-fab:active {
    transform: scale(0.95);
}

.btn-fab-primary {
    background: var(--primary);
    color: white;
}

.btn-fab-primary:hover {
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-fab-danger {
    background: var(--surface-color);
    color: var(--danger);
    border: 1px solid var(--surface-border);
}

.btn-fab-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 600px) {
    .floating-form-actions {
        justify-content: flex-end;
    }
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

/* ── User Menu Dropdown ─────────────────────────── */
.user-menu {
    position: relative;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    overflow: hidden;
    z-index: 200;
    animation: dropdownIn 0.18s ease;
}

.user-menu-dropdown.open {
    display: block;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}

.user-menu-item:hover {
    background: rgba(255,255,255,0.08);
}

.user-menu-item:not(:last-child) {
    border-bottom: 1px solid var(--surface-border);
}

.user-menu-item i {
    width: 18px;
    text-align: center;
    color: var(--primary);
}

[data-theme="light"] .user-menu-item:hover {
    background: rgba(0,0,0,0.05);
}
/* License Plate Styling */
.license-plate {
    background: white;
    border: 1.5px solid #333;
    border-radius: 4px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    font-family: 'Roboto Condensed', 'DIN', sans-serif;
    font-weight: bold;
    color: #111;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.plate-eu {
    background: #003399;
    color: #fbd116; /* Gold stars */
    font-size: 6px;
    width: 10px;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    border-radius: 1px;
    position: relative;
}

.plate-eu::before {
    content: 'A';
    color: white;
    font-size: 8px;
    font-weight: 900;
}

.plate-wappen {
    width: 14px;
    height: 16px;
    margin: 0 4px;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Wappen_Burgenland.svg/100px-Wappen_Burgenland.svg.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.plate-text {
    padding: 0 2px;
}

.plate-divider {
    margin: 0 2px;
}

/* ── Light Theme Global ────────────────────── */
[data-theme="light"] {
    --bg-color: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    --surface-color: rgba(255, 255, 255, 0.85);
    --surface-border: rgba(0, 0, 0, 0.1);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.3);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-border: rgba(0, 0, 0, 0.15);
    --card-hover-bg: rgba(0, 0, 0, 0.05);
    --hover-bg-light: rgba(0, 0, 0, 0.04);
    --hover-bg-med: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-panel {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-icon {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-main);
}

[data-theme="light"] .btn-outline {
    color: var(--text-main);
}

[data-theme="light"] .tab-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
}

[data-theme="light"] .checkbox-grid label {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

[data-theme="light"] .checkbox-grid label:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ── Light Theme Component Overrides ────────── */
[data-theme="light"] .ts-control {
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
}
[data-theme="light"] .ts-wrapper.single .ts-control input {
    color: var(--text-main) !important;
}
[data-theme="light"] .ts-control input::placeholder {
    color: var(--text-muted) !important;
}
[data-theme="light"] .ts-control .item {
    color: var(--text-main) !important;
}
[data-theme="light"] .ts-dropdown {
    background: #ffffff !important;
    color: var(--text-main) !important;
}
[data-theme="light"] .ts-dropdown .option {
    color: var(--text-main) !important;
}
[data-theme="light"] .ts-dropdown .active {
    background: var(--primary) !important;
    color: white !important;
}

[data-theme="light"] .checkbox-grid input[type="checkbox"] {
    background: #ffffff !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .checkbox-grid input[type="checkbox"]:checked {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

[data-theme="light"] .checkbox-grid label:has(input:checked) {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

[data-theme="light"] #mission-member-search {
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
}

[data-theme="light"] .member-list-container {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .modal {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
}

[data-theme="light"] .modal-content {
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-content h3 {
    color: var(--primary);
}

[data-theme="light"] .modal-content p {
    color: var(--text-main);
}

/* User display responsive rules */
.user-display-desktop {
    margin-right: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

.user-display-mobile {
    display: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .user-display-desktop {
        display: none !important;
    }
    .user-display-mobile {
        display: block !important;
    }
}
