/* ===== ТЕМНАЯ ТЕМА ===== */
@media (prefers-color-scheme: dark), .dark-theme-applied {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }

    .header {
        background: linear-gradient(135deg, #0d2a4a, #134a80);
        color: #ffffff;
    }

    .main-content {
        background: #121212;
    }

    .controls-panel {
        background-color: #1e1e1e;
        border-left: 1px solid #333;        /* темная граница */
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .controls-panel.collapsed {
        border-left: none;
    }

    .tab-controls {
        background: #2d2d2d;
    }

    .tab-button {
        color: #aaa;
    }

    .tab-button.active {
        background: #333;
        color: #64b5f6;
    }

    #bulk-address-input, .modal-input {
        background-color: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }

    #address-list, .route-controls, .optimization-option, .catalog-tree {
        background-color: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .address-item {
        border-bottom-color: #333;
    }

    .address-item:active, .address-item.selected {
        background-color: #2a3a4d;
    }

    .route-point, .route-point-item {
        background-color: #2d2d2d;
    }

    .context-menu, .modal-content {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }

    .menu-title {
        background-color: #252525;
        border-bottom-color: #333;
    }

    .menu-item {
        border-bottom-color: #333;
    }

    .menu-item:hover {
        background-color: #3a3a3a;
    }

    .map-overlay, .location-loading, .location-button {
        background-color: rgba(45, 45, 45, 0.9);
        color: #e0e0e0;
    }

    .location-error {
        background-color: #4a1a1a;
        color: #ff9e9e;
    }

    .route-info {
        background-color: #1e3a5f;
        border-left-color: #3498db;
    }

    .optimization-option {
        background: #1a365d !important;
    }

    .optimization-option label {
        color: #ffffff !important;
        font-weight: 600 !important;
    }

    .counter-badge {
        background: #c62828;
    }

    .catalog-item:hover {
        background-color: #2a3a4d;
    }

    .catalog-item.selected {
        background-color: #1e3a5f;
    }

    .subcatalogs {
        border-left-color: #444;
    }

    .control-icon.remove-icon {
        background: #333;
        border-color: #444;
    }
    
    .route-selectors-container {
        background: rgba(45, 45, 45, 0.9);
    }
    
    .nested-catalogs-option {
        background: #1a365d !important;
    }

    .nested-catalogs-option label {
        color: #ffffff !important;
        font-weight: 600 !important;
    }
	
	.export-button,
	.import-button {
		background: #495057;
		color: white;
	}

	.export-button:hover,
	.import-button:hover {
		background: #6c757d;
	}

    .mock-location-button {
        background: #495057;
    }

    .mock-location-button.active {
        background: #0d6efd;
        box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
    }

    .mock-location-button:hover:not(:disabled) {
        background: #6c757d;
    }

    .mock-location-button:disabled {
        background: #343a40;
        opacity: 0.5;
    }

    /* Стили для режима выделения в тёмной теме */
    .selection-mode-option {
        background: #1a365d !important;
    }

    .selection-mode-option label {
        color: #ffffff !important;
        font-weight: 600 !important;
    }

    .address-item.selection-highlight {
        background-color: #2e7d32 !important;
        border-left-color: #66bb6a;
    }

    .route-icon-btn {
        background: #ff98aa;
        color: white;
        border-color: #f57c00;
    }
}

/* Для мобильной адаптации в темной теме */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .controls-panel {
        border-top: 1px solid #333;
        border-left: none;
    }
}