/**
 * SanLog v3.0 - Lagekarte CSS
 * 
 * Styling für die interaktive Einsatzkarte.
 * 
 * @version 3.0.0
 * @author Michael Hoch, DRK Kreisverband Freiburg i.Br.
 */

/* ============================================================================
   LAYOUT
   ============================================================================ */

.lagekarte-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    height: calc(100vh - 180px);
    min-height: 500px;
}

.lagekarte-toolbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card, #fff);
    border-radius: 8px;
    flex-wrap: wrap;
}

.lagekarte-sidebar-left {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
    width: 250px;
    min-width: 250px;
    transition: width 0.3s ease, min-width 0.3s ease;
    position: relative;
}

.lagekarte-sidebar-left.collapsed {
    width: 0px !important;
    min-width: 0px !important;
    padding: 0 !important;
    overflow: visible !important;
}

.lagekarte-sidebar-left.collapsed .sidebar-toggle-left {
    left: 0;
    right: auto;
}

.lagekarte-map-container {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color, #ddd);
    background: #f0f0f0;
}

#lagekarte-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.lagekarte-sidebar-right {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
    width: 280px;
    min-width: 280px;
    transition: width 0.3s ease, min-width 0.3s ease;
    position: relative;
}

.lagekarte-sidebar-right.collapsed {
    width: 0px !important;
    min-width: 0px !important;
    padding: 0 !important;
    overflow: visible !important;
}

.lagekarte-sidebar-right.collapsed .sidebar-toggle-right {
    right: 0;
    left: auto;
}

/* ============================================================================
   TOOLBAR - KOMPAKT (v3.5.7)
   ============================================================================ */

.lagekarte-toolbar-minimal {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    background: var(--bg-card, #fff);
    border-radius: 4px;
}

.lagekarte-toolbar-minimal input {
    width: 180px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 0.8rem;
}

.btn-mini {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    background: var(--bg-input, #fff);
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mini:hover {
    background: var(--bg-hover, #f0f0f0);
    border-color: var(--primary-color, #E60005);
}

.btn-mini.active {
    background: var(--primary-color, #E60005);
    color: white;
    border-color: var(--primary-color, #E60005);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color, #ddd);
    margin: 0 0.25rem;
}

/* Container mit mehr Höhe */
.lagekarte-container-fullheight {
    height: calc(100vh - 140px) !important;
    min-height: 600px;
}

/* ============================================================================
   TOOLBAR - ALTE VERSION
   ============================================================================ */

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-group-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    font-weight: 500;
    margin-right: 0.25rem;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color, #ddd);
    margin: 0 0.5rem;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: var(--bg-hover, #f5f5f5);
    border-color: var(--primary-color, #E60005);
}

.toolbar-btn.active {
    background: var(--primary-color, #E60005);
    color: white;
    border-color: var(--primary-color, #E60005);
}

.toolbar-input {
    display: flex;
    gap: 0.25rem;
}

.toolbar-input input {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 200px;
}

.toolbar-input button {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--primary-color, #E60005);
    border-radius: 6px;
    background: var(--primary-color, #E60005);
    color: white;
    cursor: pointer;
}

/* ============================================================================
   SIDEBAR PANELS
   ============================================================================ */

.sidebar-panel {
    background: var(--bg-card, #fff);
    border-radius: 8px;
    padding: 0.75rem;
    overflow-y: auto;
}

.sidebar-panel h3 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #ddd);
    color: var(--text-primary, #333);
}

.sidebar-panel.flex-1 {
    flex: 1;
    min-height: 100px;
}

/* ============================================================================
   EINHEITEN LISTE
   ============================================================================ */

.einheiten-gruppe {
    margin-bottom: 0.75rem;
}

.gruppe-header {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
}

.einheit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.85rem;
}

.einheit-item:hover {
    background: var(--bg-hover, #f5f5f5);
}

.einheit-item.selected {
    background: rgba(230, 0, 5, 0.1);
    border-left: 3px solid var(--primary-color, #E60005);
}

.einheit-icon {
    font-size: 1rem;
}

.einheit-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================================
   EINHEIT DETAILS
   ============================================================================ */

.einheit-details h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color, #eee);
}

.detail-label {
    color: var(--text-secondary, #666);
}

.detail-value {
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #ddd);
}

.detail-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* ============================================================================
   LEAFLET MARKER
   ============================================================================ */

.lagekarte-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.lagekarte-marker {
    width: 44px;
    height: 44px;
    background: var(--bg-card, #fff);
    border: 3px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: grab;
}

.lagekarte-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lagekarte-marker.mc {
    width: 52px;
    height: 52px;
    border-radius: 8px;
}

.lagekarte-marker.selected,
.selected .lagekarte-marker {
    box-shadow: 0 0 0 4px rgba(230, 0, 5, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.marker-icon {
    font-size: 1.4rem;
}

.marker-status {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: var(--bg-card, #fff);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: var(--text-primary, #333);
}

/* Dragging */
.leaflet-dragging .lagekarte-marker {
    cursor: grabbing !important;
    opacity: 0.8;
}

/* ============================================================================
   LEAFLET POPUP
   ============================================================================ */

.lagekarte-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lagekarte-popup .leaflet-popup-content {
    margin: 12px;
}

.lagekarte-popup-content h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.popup-status {
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 8px;
}

.popup-info {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.popup-info div {
    margin-bottom: 4px;
}

.popup-funk {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin-bottom: 8px;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #eee);
}

.popup-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
}

/* ============================================================================
   STATUS POPUP MODAL
   ============================================================================ */

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.status-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: var(--bg-input, #fff);
    cursor: pointer;
    transition: all 0.15s ease;
}

.status-option:hover {
    border-color: var(--status-color, #666);
    background: color-mix(in srgb, var(--status-color, #666) 10%, transparent);
}

.status-option.active {
    border-color: var(--status-color, #666);
    background: color-mix(in srgb, var(--status-color, #666) 15%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color, #666) 20%, transparent);
}

.status-icon {
    font-size: 1.5rem;
}

.status-code {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--status-color, #666);
}

.status-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary, #333);
}

/* ============================================================================
   LEGENDE
   ============================================================================ */

.legende-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.legende-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================================
   RESSOURCEN IMPORT DIALOG
   ============================================================================ */

.ressourcen-import-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.ressourcen-import-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-input, #fff);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    font-size: 0.9rem;
}

.ressourcen-import-item:hover {
    background: var(--bg-hover, #f5f5f5);
    border-color: var(--primary-color, #E60005);
}

[data-theme="dark"] .ressourcen-import-item {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #eee);
}

[data-theme="dark"] .ressourcen-import-item:hover {
    background: var(--bg-hover, #3d3d3d);
}

/* Outline Button Stil */
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color, #E60005);
    color: var(--primary-color, #E60005);
}

.btn-outline:hover {
    background: var(--primary-color, #E60005);
    color: white;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1200px) {
    .lagekarte-container {
        grid-template-columns: 200px 1fr 220px;
    }
}

@media (max-width: 1024px) {
    .lagekarte-container {
        grid-template-columns: auto 1fr auto;
        gap: 0.5rem;
    }
    
    .lagekarte-sidebar-left {
        width: 180px;
        min-width: 180px;
    }
    
    .lagekarte-sidebar-left.collapsed {
        width: 40px !important;
        min-width: 40px !important;
    }
    
    .lagekarte-sidebar-right {
        width: 180px;
        min-width: 180px;
    }
    
    .lagekarte-sidebar-right.collapsed {
        width: 40px !important;
        min-width: 40px !important;
    }
    
    .lagekarte-map-container {
        min-height: 400px;
    }
    
    .sidebar-panel {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .lagekarte-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .toolbar-separator {
        display: none;
    }
    
    .toolbar-input input {
        width: 100%;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   DARK MODE
   ============================================================================ */

[data-theme="dark"] .lagekarte-toolbar,
[data-theme="dark"] .sidebar-panel {
    background: #2d2d2d;
}

[data-theme="dark"] .lagekarte-sidebar-left,
[data-theme="dark"] .lagekarte-sidebar-right {
    background: transparent;
}

[data-theme="dark"] .sidebar-panel h3 {
    color: #e5e5e5;
    border-bottom-color: #444;
}

[data-theme="dark"] .toolbar-btn {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #eee);
}

[data-theme="dark"] .toolbar-btn:hover {
    background: var(--bg-hover, #3d3d3d);
}

[data-theme="dark"] .toolbar-input input {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #eee);
}

[data-theme="dark"] .einheit-item:hover {
    background: var(--bg-hover, #2d2d2d);
}

[data-theme="dark"] .lagekarte-marker {
    background: var(--bg-card, #1e1e1e);
}

[data-theme="dark"] .marker-label {
    background: var(--bg-card, #1e1e1e);
    color: var(--text-primary, #eee);
}

[data-theme="dark"] .status-option {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .status-label {
    color: var(--text-primary, #eee);
}

/* Leaflet Dark Mode anpassen */
[data-theme="dark"] .leaflet-popup-content-wrapper,
[data-theme="dark"] .leaflet-popup-tip {
    background: var(--bg-card, #1e1e1e);
    color: var(--text-primary, #eee);
}

[data-theme="dark"] .leaflet-container {
    background: #1a1a1a;
}

/* Leaflet Controls Dark Mode */
[data-theme="dark"] .leaflet-control-zoom a,
[data-theme="dark"] .leaflet-control-attribution {
    background: var(--bg-card, #1e1e1e) !important;
    color: var(--text-primary, #eee) !important;
    border-color: var(--border-color, #444) !important;
}

[data-theme="dark"] .leaflet-control-zoom a:hover {
    background: var(--bg-hover, #2d2d2d) !important;
}

/* ============================================================================
   RESSOURCEN-IMPORT DIALOG
   ============================================================================ */

.ressourcen-import-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ressourcen-import-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.9rem;
}

.ressourcen-import-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* ============================================================================
   POI TYPE GRID
   ============================================================================ */

.poi-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.poi-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
}

.poi-type-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.poi-type-btn .poi-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.poi-type-btn .poi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================================================
   SEARCH RESULTS
   ============================================================================ */

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.9rem;
}

.search-result-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* ============================================================================
   POPUP EINSATZ INFO
   ============================================================================ */

.popup-einsatz {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ============================================================================
   DARK MODE ERWEITERUNGEN
   ============================================================================ */

[data-theme="dark"] .ressourcen-import-item,
[data-theme="dark"] .poi-type-btn,
[data-theme="dark"] .search-result-item {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #eee);
}

[data-theme="dark"] .ressourcen-import-item:hover,
[data-theme="dark"] .poi-type-btn:hover,
[data-theme="dark"] .search-result-item:hover {
    background: var(--bg-hover, #3d3d3d);
}

[data-theme="dark"] .popup-einsatz {
    background: var(--bg-input, #2d2d2d);
}

/* ============================================================================
   TAKTISCHE ZEICHEN DIALOG
   ============================================================================ */

.taktische-zeichen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.taktisch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 80px;
}

.taktisch-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: scale(1.02);
}

.taktisch-svg {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.taktisch-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.25rem;
    line-height: 1.2;
}

/* Marker für SVG-basierte Zeichen */
.lagekarte-marker-svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lagekarte-marker-svg svg {
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}

/* Einsatz-Marker spezifisch */
.einsatz-marker .marker-label {
    background: #FFE0E0;
    border: 1px solid #E60005;
    color: #E60005;
    font-weight: bold;
}

.einsatz-label {
    background: #FFE0E0 !important;
    border: 1px solid #E60005 !important;
    color: #E60005 !important;
}

/* Dark Mode Erweiterungen */
[data-theme="dark"] .taktisch-btn {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .taktisch-btn:hover {
    background: var(--bg-hover, #3d3d3d);
}

[data-theme="dark"] .taktisch-label {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .einsatz-marker .marker-label,
[data-theme="dark"] .einsatz-label {
    background: #4a2020 !important;
    border-color: #E60005 !important;
    color: #ff6666 !important;
}

/* ============================================================================
   EINSATZ ADRESSSUCHE AUTOCOMPLETE
   ============================================================================ */

.address-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: var(--radius-md, 4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 2px;
}

.address-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color, #eee);
    font-size: 0.9rem;
    transition: background 0.15s;
}

.address-result-item:last-child {
    border-bottom: none;
}

.address-result-item:hover {
    background: var(--bg-hover, #f5f5f5);
}

.address-result-item.selected {
    background: var(--primary-light, #e3f2fd);
    border-left: 3px solid var(--primary, #E60005);
}

[data-theme="dark"] .address-autocomplete-results {
    background: var(--bg-card, #2d2d2d);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .address-result-item {
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .address-result-item:hover {
    background: var(--bg-hover, #3d3d3d);
}

[data-theme="dark"] .address-result-item.selected {
    background: #3d3d3d;
    border-left: 3px solid var(--primary, #E60005);
}

/* ============================================================================
   v3.5.7: SIDEBAR TOGGLE BUTTONS
   ============================================================================ */

.sidebar-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 60px;
    background: var(--primary-color, #E60005);
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-toggle:hover {
    background: #c00;
    width: 24px;
}

.sidebar-toggle-left {
    right: -20px;
    border-radius: 0 4px 4px 0;
}

.sidebar-toggle-right {
    left: -20px;
    border-radius: 4px 0 0 4px;
}

.lagekarte-sidebar-left.collapsed .sidebar-content,
.lagekarte-sidebar-right.collapsed .sidebar-content {
    display: none;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    overflow: auto;
}

/* Panel-Header (einklappbar) */
.sidebar-panel h3.panel-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding: 0.5rem;
    margin: -0.75rem -0.75rem 0.5rem -0.75rem;
    background: var(--bg-hover, #f8f8f8);
    border-radius: 8px 8px 0 0;
}

.sidebar-panel h3.panel-header:hover {
    background: var(--bg-input, #eee);
}

.sidebar-panel h3 .collapse-icon {
    font-size: 0.6rem;
    color: var(--text-secondary, #666);
    transition: transform 0.2s;
}

.sidebar-panel .panel-content {
    overflow: hidden;
}

.sidebar-panel .panel-content.collapsed {
    display: none;
}

/* Wenn Panel eingeklappt ist, kein flex-1 mehr */
.sidebar-panel.flex-1:has(.panel-content.collapsed) {
    flex: 0 0 auto;
    min-height: auto;
}
