        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            overflow: hidden;
        }
        
        #map {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
        }
        
        /* Search Bar */
        .search-container {
            position: absolute;
            top: 16px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
            width: 400px;
            max-width: calc(100% - 400px);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 12px 16px 12px 44px;
            background: rgba(255,255,255,0.95);
            border: none;
            border-radius: 12px;
            font-size: 14px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            outline: none;
        }
        
        .search-input:focus {
            box-shadow: 0 4px 20px rgba(0,0,0,0.25);
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 18px;
            opacity: 0.5;
        }
        
        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border-radius: 12px;
            margin-top: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
            max-height: 300px;
            overflow-y: auto;
            display: none;
        }
        
        .search-results.visible {
            display: block;
        }
        
        .search-result-item {
            padding: 12px 16px;
            cursor: pointer;
            border-bottom: 1px solid #eee;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .search-result-item:hover {
            background: #f5f5f5;
        }
        
        .search-result-item:last-child {
            border-bottom: none;
        }
        
        .search-result-icon {
            font-size: 20px;
        }
        
        .search-result-info {
            flex: 1;
        }
        
        .search-result-name {
            font-weight: 500;
            font-size: 14px;
        }
        
        .search-result-type {
            font-size: 12px;
            color: #666;
        }
        
        /* Layer Manager Panel */
        .layer-panel {
            position: absolute;
            top: 0;
            left: 0;
            width: 340px;
            height: 100%;
            background: #233f64;
            color: #fff;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            transform: translateX(-100%);
            transition: transform 0.3s ease;
            box-shadow: 4px 0 20px rgba(0,0,0,0.3);
        }
        
        .layer-panel.open {
            transform: translateX(0);
        }
        
        .layer-panel-header {
            padding: 16px;
            background: #1a3050;
            border-bottom: 1px solid #1a3050;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .layer-panel-header h2 {
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .layer-panel-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 24px;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.2s;
        }
        
        .layer-panel-close:hover {
            opacity: 1;
        }
        
        /* Tabs */
        .layer-tabs {
            display: flex;
            background: #1a3050;
            border-bottom: 1px solid #1a3050;
        }
        
        .layer-tab {
            flex: 1;
            padding: 12px;
            background: none;
            border: none;
            color: #8892b0;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
            border-bottom: 2px solid transparent;
        }
        
        .layer-tab:hover {
            color: #fff;
            background: rgba(255,255,255,0.05);
        }
        
        .layer-tab.active {
            color: #64ffda;
            border-bottom-color: #64ffda;
        }

        .layer-tab-add {
            flex: 0 0 auto;
            padding: 8px 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            cursor: pointer;
        }
        .layer-tab-add svg {
            color: #8892b0;
            transition: color 0.2s, transform 0.2s;
        }
        .layer-tab-add:hover svg {
            color: #64ffda;
            transform: scale(1.1);
        }

        .layer-tab-add.active svg {
            color: #64ffda;
        }
        
        .layer-tab-btn {
            flex: 1;
            padding: 12px;
            background: none;
            border: none;
            color: #8892b0;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
            border-bottom: 2px solid transparent;
        }
        
        .layer-tab-btn:hover {
            color: #64ffda;
            background: rgba(100, 255, 218, 0.05);
        }
        
        /* Tab Content */
        .tab-content {
            flex: 1;
            overflow-y: auto;
            display: none;
        }
        
        .tab-content.active {
            display: block;
        }
        
        /* Active Layers List */
        .layer-list {
            padding: 8px;
        }
        
        .layer-item {
            background: #1a3050;
            border-radius: 8px;
            margin-bottom: 8px;
            overflow: hidden;
            border: 1px solid #1a3050;
            transition: all 0.2s;
        }
        
        .layer-item:hover {
            border-color: #64ffda;
        }
        
        .layer-item.active-terrain {
            border-color: #64ffda;
            background: linear-gradient(135deg, #2c4a6e 0%, #1a2744 100%);
        }
        
        .layer-item.dragging {
            opacity: 0.5;
            transform: scale(1.02);
        }
        
        .layer-item-header {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            gap: 10px;
        }
        
        .layer-drag-handle {
            color: #8892b0;
            cursor: grab;
            padding: 4px;
        }
        
        .layer-drag-handle:active {
            cursor: grabbing;
        }
        
        .layer-icon {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
            background: rgba(255,255,255,0.06);
        }
        
        .layer-icon svg {
            width: 22px;
            height: 22px;
        }
        
        /* DEM Terrain Button - colored/grayscale mountain */
        .dem-terrain-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            border: 2px solid #1a3050;
            background: #2d3436;
            font-size: 18px;
            cursor: pointer;
            transition: all 0.3s ease;
            filter: grayscale(100%);
            opacity: 0.6;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        
        .dem-terrain-btn:hover {
            border-color: #64ffda;
            filter: grayscale(50%);
            opacity: 0.8;
        }
        
        .dem-terrain-btn.active {
            background: linear-gradient(135deg, #ff6b6b, #feca57);
            border-color: #64ffda;
            filter: grayscale(0%);
            opacity: 1;
            box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
        }
        
        .terrain-badge {
            background: #64ffda;
            color: #233f64;
            font-size: 9px;
            padding: 1px 4px;
            border-radius: 3px;
            font-weight: bold;
        }
        
        .temporal-badge {
            color: #ff9f43;
        }
        
        /* Timeline Panel - Hidden, now integrated in layer */
        .timeline-panel {
            display: none !important;
        }
        
        /* Point Cloud Controls */
        .pointcloud-controls {
            background: rgba(162, 155, 254, 0.1);
            border-radius: 8px;
            padding: 10px;
            margin-top: 10px;
            border: 1px solid rgba(162, 155, 254, 0.3);
        }
        
        .pointcloud-controls .layer-control-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }
        
        .pointcloud-controls .layer-control-row:last-child {
            margin-bottom: 0;
        }
        
        .pointcloud-controls label {
            font-size: 11px;
            color: #a29bfe;
            min-width: 65px;
        }
        
        .pointcloud-controls input[type="range"] {
            flex: 1;
        }
        
        .pointcloud-controls span {
            font-size: 11px;
            color: #e6f1ff;
            min-width: 40px;
            text-align: right;
        }
        
        /* Temporal Layer Controls - Integrated in layer item */
        .temporal-controls {
            background: rgba(15, 52, 96, 0.5);
            border-radius: 8px;
            padding: 12px;
            margin-top: 10px;
            border: 1px solid #1a3050;
        }
        
        .temporal-date-range {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
            align-items: center;
        }
        
        .temporal-date-range label {
            font-size: 11px;
            color: #8892b0;
            min-width: 30px;
        }
        
        .temporal-date-range input[type="date"] {
            flex: 1;
            background: #233f64;
            border: 1px solid #1a3050;
            color: #e6f1ff;
            padding: 6px 8px;
            border-radius: 4px;
            font-size: 12px;
        }
        
        .temporal-date-range input[type="date"]:focus {
            outline: none;
            border-color: #64ffda;
        }
        
        .temporal-slider-container {
            margin-bottom: 10px;
        }
        
        .temporal-slider {
            width: 100%;
            height: 6px;
            -webkit-appearance: none;
            background: #1a3050;
            border-radius: 3px;
            outline: none;
        }
        
        .temporal-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            background: #64ffda;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 0 6px rgba(100, 255, 218, 0.5);
        }
        
        .temporal-slider::-moz-range-thumb {
            width: 16px;
            height: 16px;
            background: #64ffda;
            border-radius: 50%;
            cursor: pointer;
            border: none;
        }
        
        .temporal-current-date {
            text-align: center;
            font-size: 14px;
            font-weight: 600;
            color: #64ffda;
            margin-bottom: 10px;
            padding: 6px;
            background: rgba(100, 255, 218, 0.1);
            border-radius: 4px;
        }
        
        .temporal-player {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
        }
        
        .temporal-player button {
            background: #1a3050;
            border: 1px solid #1e5f74;
            color: #e6f1ff;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .temporal-player button:hover {
            background: #1e5f74;
            border-color: #64ffda;
        }
        
        .temporal-player button.play-btn {
            width: 44px;
            height: 44px;
            font-size: 18px;
            background: linear-gradient(135deg, #64ffda, #00d2d3);
            border: none;
            color: #233f64;
        }
        
        .temporal-player button.play-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 0 15px rgba(100, 255, 218, 0.4);
        }
        
        .temporal-player button.play-btn.playing {
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
        }
        
        .temporal-speed {
            background: #233f64;
            border: 1px solid #1a3050;
            color: #e6f1ff;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
        }
        
        .temporal-info {
            display: flex;
            justify-content: space-between;
            font-size: 10px;
            color: #8892b0;
            margin-top: 8px;
        }
        
        .layer-info {
            flex: 1;
            min-width: 0;
            cursor: pointer;
        }
        
        .layer-name {
            font-size: 13px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .layer-type {
            font-size: 11px;
            color: #8892b0;
        }
        
        .layer-actions {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        
        .layer-btn {
            background: none;
            border: none;
            color: #8892b0;
            cursor: pointer;
            font-size: 16px;
            padding: 4px 6px;
            border-radius: 4px;
            transition: all 0.2s;
        }
        
        .layer-btn:hover {
            background: rgba(255,255,255,0.1);
            color: #fff;
        }
        
        .layer-btn.active {
            color: #64ffda;
        }
        
        .layer-btn.zoom:hover {
            color: #64ffda;
        }
        
        .layer-btn.remove:hover {
            color: #ff6b6b;
        }
        
        .layer-item-controls {
            padding: 0 12px 12px;
            display: none;
        }
        
        .layer-item.expanded .layer-item-controls {
            display: block;
        }
        
        /* WMS Layer Legend */
        .layer-legend {
            padding: 4px 12px 8px;
        }
        
        .layer-legend-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            background: none;
            border: none;
            color: #8892b0;
            cursor: pointer;
            font-size: 11px;
            padding: 4px 0;
            transition: color 0.2s;
        }
        
        .layer-legend-toggle:hover {
            color: #64ffda;
        }
        
        .legend-arrow {
            font-size: 9px;
            transition: transform 0.2s;
        }
        
        .layer-legend-content {
            margin-top: 6px;
            padding: 8px;
            background: rgba(255,255,255,0.04);
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.06);
            max-height: 300px;
            overflow-y: auto;
        }
        
        .layer-legend-img {
            max-width: 100%;
            height: auto;
            display: block;
        }
        
        .legend-none {
            color: rgba(255,255,255,0.3);
            font-size: 11px;
            font-style: italic;
        }
        
        /* WMS Style Selector */
        .layer-style-select {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px 8px;
        }
        .layer-style-select label {
            font-size: 11px;
            color: #8b9dc3;
            white-space: nowrap;
        }
        .wms-style-dropdown {
            flex: 1;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(100,255,218,0.2);
            border-radius: 6px;
            color: #e0e0e0;
            font-size: 11px;
            padding: 4px 8px;
            cursor: pointer;
            outline: none;
            appearance: auto;
        }
        .wms-style-dropdown:hover {
            border-color: rgba(100,255,218,0.4);
            background: rgba(255,255,255,0.08);
        }
        .wms-style-dropdown:focus {
            border-color: #64ffda;
        }
        .wms-style-dropdown option {
            background: #1a2d47;
            color: #e0e0e0;
        }
        
        .layer-control-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 8px;
        }
        
        .layer-control-row label {
            font-size: 11px;
            color: #8892b0;
            min-width: 60px;
        }
        
        .layer-control-row input[type="range"] {
            flex: 1;
            height: 4px;
            -webkit-appearance: none;
            background: #1a3050;
            border-radius: 2px;
            outline: none;
        }
        
        .layer-control-row input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 14px;
            height: 14px;
            background: #64ffda;
            border-radius: 50%;
            cursor: pointer;
        }
        
        .layer-control-row span {
            font-size: 11px;
            color: #64ffda;
            min-width: 35px;
            text-align: right;
        }
        
        /* Catalog */
        .catalog-search {
            padding: 12px;
            position: sticky;
            top: 0;
            background: #233f64;
            z-index: 10;
            border-bottom: 1px solid #1a3050;
        }
        
        .catalog-search-wrapper {
            position: relative;
        }
        
        .catalog-search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 14px;
            opacity: 0.6;
        }
        
        .catalog-search-input {
            width: 100%;
            padding: 10px 12px 10px 36px;
            border: 1px solid #3d5a80;
            border-radius: 8px;
            background: #1a3050;
            color: white;
            font-size: 13px;
            outline: none;
        }
        
        .catalog-search-input:focus {
            border-color: #64ffda;
        }
        
        .catalog-search-input::placeholder {
            color: #8b9dc3;
        }
        
        .catalog-item.search-hidden {
            display: none !important;
        }
        
        .catalog-section.search-hidden {
            display: none !important;
        }
        
        .catalog-no-results {
            padding: 30px;
            text-align: center;
            color: #8b9dc3;
            font-size: 13px;
        }
        
        .catalog-section {
            padding: 12px;
            border-bottom: 1px solid #1a3050;
        }
        
        .catalog-section-title {
            font-size: 12px;
            color: #8892b0;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .catalog-item {
            display: flex;
            align-items: center;
            padding: 10px;
            background: #1a3050;
            border-radius: 6px;
            margin-bottom: 6px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
        }
        
        .catalog-item:hover {
            background: #1f2b4a;
            border-color: #1a3050;
        }
        
        .catalog-item.added {
            opacity: 0.5;
            pointer-events: none;
        }
        
        .catalog-item-icon {
            width: 32px;
            height: 32px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            font-size: 16px;
        }
        
        .catalog-item-info {
            flex: 1;
        }
        
        .catalog-item-name {
            font-size: 13px;
            font-weight: 500;
        }
        
        .catalog-item-desc {
            font-size: 11px;
            color: #8892b0;
        }
        
        .catalog-item-add {
            background: #64ffda;
            color: #233f64;
            border: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s;
        }
        
        .catalog-item:hover .catalog-item-add {
            opacity: 1;
        }
        
        /* Add WMS Form */
        .add-wms-form {
            padding: 12px;
        }
        
        .form-group {
            margin-bottom: 12px;
        }
        
        .form-group label {
            display: block;
            font-size: 12px;
            color: #8892b0;
            margin-bottom: 6px;
        }
        
        .form-group input, .form-group select {
            width: 100%;
            padding: 10px;
            background: #1a3050;
            border: 1px solid #1a3050;
            border-radius: 6px;
            color: #fff;
            font-size: 13px;
        }
        
        .form-group input:focus, .form-group select:focus {
            outline: none;
            border-color: #64ffda;
        }
        
        .btn-add-layer {
            width: 100%;
            padding: 12px;
            background: #64ffda;
            color: #233f64;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .btn-add-layer:hover {
            background: #4cd9c4;
        }
        
        /* Toggle Button */
        .layer-panel-toggle {
            position: absolute;
            top: 16px;
            left: 16px;
            width: 50px;
            height: 50px;
            background: #233f64;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s;
            padding: 6px;
        }
        
        .layer-panel-toggle img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
        
        .layer-panel-toggle:hover {
            background: #1a3050;
            transform: scale(1.05);
        }
        
        .layer-panel-toggle.panel-open {
            left: 356px;
        }
        
        /* Active Project Indicator */
        .active-project-indicator {
            position: absolute;
            top: 16px;
            left: 80px;
            background: rgba(35, 63, 100, 0.95);
            padding: 12px 16px;
            border-radius: 12px;
            z-index: 998;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            min-width: 200px;
            max-width: 400px;
            transition: left 0.3s;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
        }
        
        .active-project-indicator.panel-open {
            left: 420px;
        }
        
        .project-indicator-content {
            flex: 1;
            min-width: 0;
        }
        
        .project-indicator-row {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .project-zoom-btn {
            background: rgba(100, 255, 218, 0.2);
            border: 1px solid #64ffda;
            color: #64ffda;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.2s;
        }
        
        .project-zoom-btn:hover {
            background: #64ffda;
            color: #0a192f;
        }
        
        .project-indicator-label {
            font-size: 10px;
            color: #8b9dc3;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .project-indicator-name {
            font-size: 14px;
            font-weight: 600;
            color: #64ffda;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .project-indicator-name.no-project {
            color: #ff6b6b;
        }
        
        .project-indicator-info {
            font-size: 10px;
            color: #8b9dc3;
            margin-top: 2px;
        }

        /* Threshold semaphore in project indicator */
        .project-threshold-semaphore {
            font-size: 16px;
            line-height: 1;
            margin-left: 6px;
            flex-shrink: 0;
        }

        /* Project dropdown */
        .project-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 4px;
            background: rgba(26, 48, 80, 0.98);
            border: 1px solid rgba(100, 255, 218, 0.2);
            border-radius: 8px;
            max-height: 300px;
            overflow-y: auto;
            box-shadow: 0 8px 30px rgba(0,0,0,0.4);
            z-index: 1000;
        }

        .project-dropdown-list {
            padding: 4px;
        }

        .project-dropdown-item {
            padding: 10px 12px;
            cursor: pointer;
            border-radius: 6px;
            transition: background 0.15s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .project-dropdown-item:hover {
            background: rgba(100, 255, 218, 0.1);
        }

        .project-dropdown-item.active {
            background: rgba(100, 255, 218, 0.15);
            border-left: 3px solid #64ffda;
        }

        .project-dropdown-item-name {
            font-size: 13px;
            font-weight: 500;
            color: #ccd6f6;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

        .project-dropdown-item.active .project-dropdown-item-name {
            color: #64ffda;
        }

        .project-dropdown-item-info {
            font-size: 10px;
            color: #8b9dc3;
        }
        
        /* Layer Compare Tool */
        .compare-tool {
            position: absolute;
            top: 16px;
            right: 60px;
            background: rgba(35, 63, 100, 0.95);
            padding: 15px;
            border-radius: 10px;
            z-index: 998;
            box-shadow: 0 2px 15px rgba(0,0,0,0.4);
            min-width: 280px;
        }
        
        .compare-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #2a4060;
        }
        
        .compare-header span {
            color: #64ffda;
            font-weight: 600;
        }
        
        .compare-close {
            background: none;
            border: none;
            color: #8892b0;
            font-size: 18px;
            cursor: pointer;
        }
        
        .compare-close:hover {
            color: #ff6b6b;
        }
        
        .compare-controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .compare-layer-select label {
            display: block;
            font-size: 11px;
            color: #8892b0;
            margin-bottom: 4px;
        }
        
        .compare-layer-select select {
            width: 100%;
            padding: 8px;
            background: #1a3050;
            border: 1px solid #2a4060;
            color: #e6f1ff;
            border-radius: 6px;
            font-size: 13px;
        }
        
        .compare-mode-btns {
            display: flex;
            gap: 6px;
            margin-bottom: 15px;
        }
        
        .compare-mode-btn {
            flex: 1;
            padding: 8px;
            background: #1a3050;
            border: 1px solid #2a4060;
            color: #8892b0;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
        }
        
        .compare-mode-btn:hover {
            border-color: #64ffda;
            color: #e6f1ff;
        }
        
        .compare-mode-btn.active {
            background: rgba(100, 255, 218, 0.2);
            border-color: #64ffda;
            color: #64ffda;
        }
        
        .compare-slider-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .compare-slider-container input[type="range"] {
            flex: 1;
        }
        
        .compare-slider-container span {
            color: #64ffda;
            font-size: 12px;
            min-width: 40px;
        }
        
        .compare-swipe-line {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 4px;
            background: #64ffda;
            z-index: 999;
            cursor: col-resize;
            box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
            user-select: none;
            -webkit-user-select: none;
            touch-action: none;
        }

        /* Area di click più ampia (40px) invisibile */
        .compare-swipe-line::after {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: -18px;
            width: 40px;
            cursor: col-resize;
        }
        
        .compare-swipe-line::before {
            content: '◀▶';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: #64ffda;
            color: #0a192f;
            padding: 8px 4px;
            border-radius: 4px;
            font-size: 12px;
            user-select: none;
            -webkit-user-select: none;
            pointer-events: none;
        }
        
        .compare-btn.active {
            background: rgba(100, 255, 218, 0.3) !important;
            border-color: #64ffda !important;
        }
        
        @media (max-width: 768px) {
            .active-project-indicator {
                top: 76px;
                left: 16px !important;
                max-width: calc(100vw - 100px);
            }
        }
        
        /* Time Series Chart Window */
        .chart-window {
            position: absolute;
            bottom: 80px;
            right: 16px;
            width: 480px;
            background: #233f64;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
            display: none;
            flex-direction: column;
            z-index: 500;
            overflow: hidden;
            resize: both;
            min-width: 350px;
            min-height: 300px;
            max-width: 90vw;
            max-height: 70vh;
        }
        
        .chart-window.visible {
            display: flex;
        }
        
        .chart-window.fullscreen {
            position: fixed;
            top: 20px;
            left: 20px;
            right: 20px;
            bottom: 20px;
            width: auto;
            height: auto;
            max-width: none;
            max-height: none;
        }
        
        .chart-window-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            cursor: move;
        }
        
        .chart-window-title {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #fff;
            font-weight: 600;
            font-size: 14px;
        }
        
        .chart-icon {
            font-size: 18px;
        }
        
        .chart-window-controls {
            display: flex;
            gap: 4px;
        }
        
        .chart-btn {
            width: 28px;
            height: 28px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 6px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all 0.2s;
        }
        
        .chart-btn:hover {
            background: rgba(255,255,255,0.2);
        }
        
        .chart-btn.chart-close:hover {
            background: #ff6b6b;
        }
        
        .chart-window-info {
            padding: 8px 16px;
            background: #152840;
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #aaa;
        }
        
        .chart-window-body {
            flex: 1;
            padding: 16px;
            min-height: 200px;
        }
        
        .chart-window-footer {
            padding: 12px 16px;
            background: #1a3050;
            border-top: 1px solid #152840;
        }
        
        .chart-stats {
            display: flex;
            justify-content: space-around;
        }
        
        .chart-stat {
            text-align: center;
        }
        
        .stat-label {
            display: block;
            font-size: 10px;
            color: #888;
            margin-bottom: 2px;
        }
        
        .stat-value {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: #64ffda;
        }
        
        /* Upload Progress Overlay */
        .upload-progress-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
        }
        
        .upload-progress-overlay.visible {
            display: flex;
        }
        
        .upload-progress-modal {
            background: #233f64;
            border-radius: 16px;
            padding: 32px 40px;
            text-align: center;
            min-width: 320px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        }
        
        .upload-progress-icon {
            font-size: 48px;
            margin-bottom: 16px;
            animation: bounce 1s infinite;
        }
        
        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        
        .upload-progress-title {
            color: #fff;
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .upload-progress-status {
            color: #aaa;
            font-size: 13px;
            margin-bottom: 20px;
        }
        
        .upload-progress-bar-container {
            background: #152840;
            border-radius: 10px;
            height: 12px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .upload-progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #64ffda, #48dbfb);
            border-radius: 10px;
            transition: width 0.3s ease;
        }
        
        .upload-progress-percent {
            color: #64ffda;
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 20px;
        }
        
        .upload-progress-cancel {
            background: transparent;
            border: 1px solid #666;
            color: #999;
            padding: 8px 24px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
        }
        
        .upload-progress-cancel:hover {
            border-color: #ff6b6b;
            color: #ff6b6b;
        }
        
        /* Small button for section titles */
        .btn-small {
            padding: 4px 10px;
            background: #233f64;
            border: 1px solid #64ffda;
            border-radius: 4px;
            color: #64ffda;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .btn-small:hover {
            background: #64ffda;
            color: #233f64;
        }
        
        .btn-small.btn-wms {
            border-color: #82b1ff;
            color: #82b1ff;
        }
        .btn-small.btn-wms:hover {
            background: #82b1ff;
            color: #0d1b2a;
        }
        
        /* Project Modal - Two Panel Layout */
        .project-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.45);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10001;
            backdrop-filter: blur(0px);
        }
        
        .project-modal-overlay.visible {
            display: flex;
        }
        
        .project-modal {
            background: #1a3050;
            border-radius: 16px;
            width: 95%;
            max-width: 1250px;
            height: 85vh;
            max-height: 750px;
            display: flex;
            flex-direction: row;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            overflow: hidden;
        }
        
        /* Left Panel - Project List */
        .project-modal-left {
            width: 340px;
            min-width: 340px;
            background: #152840;
            display: flex;
            flex-direction: column;
            border-right: 1px solid rgba(255,255,255,0.1);
            position: relative;
        }
        
        .project-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        
        .project-list-header h3 {
            margin: 0;
            color: #8b9dc3;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .project-list-container {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            min-height: 0;
        }
        
        /* Modal Search Bar */
        .modal-search-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 8px 10px 4px 10px;
            padding: 7px 12px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            transition: border-color 0.2s;
        }
        
        .modal-search-bar:focus-within {
            border-color: rgba(100, 255, 218, 0.4);
            background: rgba(255,255,255,0.08);
        }
        
        .modal-search-icon {
            font-size: 13px;
            opacity: 0.5;
            flex-shrink: 0;
        }
        
        .modal-search-input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            color: #fff;
            font-size: 12px;
            font-family: inherit;
        }
        
        .modal-search-input::placeholder {
            color: rgba(255,255,255,0.35);
        }
        
        /* Project Item in Modal */
        .project-modal-item {
            background: #1a3050;
            border-radius: 8px;
            padding: 10px 12px;
            margin-bottom: 6px;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }
        
        .project-modal-item:hover {
            background: #233f64;
        }
        
        .project-modal-item.selected {
            border-color: #64ffda;
            background: #1a3a50;
        }
        
        .project-modal-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }
        
        .project-modal-item-name {
            color: #fff;
            font-weight: 600;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .project-modal-item-actions {
            display: flex;
            gap: 6px;
        }
        
        .project-modal-item-btn {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            border: none;
            background: #233f64;
            color: #fff;
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        
        .project-modal-item-btn:hover {
            background: #64ffda;
            color: #152840;
        }
        
        .project-modal-item-btn.select-btn:hover {
            background: #64ffda;
        }
        
        /* Project Preview Badges */
        .project-modal-item-preview {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        
        .project-preview-badge {
            display: flex;
            align-items: center;
            gap: 3px;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 9px;
            font-weight: 600;
            background: rgba(255,255,255,0.1);
        }
        
        .project-preview-badge.dem {
            background: rgba(255, 107, 107, 0.2);
            color: #ff6b6b;
        }
        
        .project-preview-badge.ortho {
            background: rgba(72, 219, 251, 0.2);
            color: #48dbfb;
        }
        
        .project-preview-badge.mbtiles {
            background: rgba(162, 155, 254, 0.2);
            color: #a29bfe;
        }
        
        .project-preview-badge.tiles3d {
            background: rgba(255, 159, 67, 0.2);
            color: #ff9f43;
        }
        
        .project-preview-badge.pointcloud {
            background: rgba(100, 255, 218, 0.2);
            color: #64ffda;
        }
        
        /* Right Panel - Project Details */
        .project-modal-right {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #1a3050;
        }
        
        .project-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            background: #152840;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        
        .project-modal-header h3 {
            margin: 0;
            color: #fff;
            font-size: 18px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .project-modal-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 28px;
            cursor: pointer;
            opacity: 0.7;
            line-height: 1;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: all 0.2s;
        }
        
        .project-modal-close:hover {
            opacity: 1;
            background: rgba(255,255,255,0.1);
        }
        
        .project-modal-body {
            padding: 20px 24px;
            overflow-y: auto;
            flex: 1;
        }
        
        /* Empty state for right panel */
        .project-detail-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: #8b9dc3;
            text-align: center;
            padding: 40px;
        }
        
        .project-detail-empty-icon {
            font-size: 64px;
            margin-bottom: 20px;
            opacity: 0.5;
        }
        
        .project-detail-empty h4 {
            color: #fff;
            margin: 0 0 10px 0;
            font-size: 18px;
        }
        
        .project-detail-empty p {
            margin: 0;
            font-size: 14px;
        }
        
        /* Footer buttons for project detail */
        .project-modal-footer {
            display: flex;
            gap: 16px;
            padding: 20px 24px;
            border-top: 1px solid rgba(255,255,255,0.1);
            background: #152840;
        }
        
        .project-modal-footer .project-btn {
            flex: 1;
            padding: 14px 24px;
            font-size: 14px;
        }
        
        /* Responsive for smaller screens */
        @media (max-width: 900px) {
            .project-modal {
                flex-direction: column;
                height: 90vh;
                max-height: none;
            }
            
            .project-modal-left {
                width: 100%;
                min-width: auto;
                height: auto;
                max-height: 250px;
                border-right: none;
                border-bottom: 1px solid rgba(255,255,255,0.1);
            }
            
            .project-list-container {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                gap: 10px;
                padding: 12px 16px;
            }
            
            .project-modal-item {
                min-width: 200px;
                margin-bottom: 0;
            }
        }
        
        .project-form-group {
            margin-bottom: 16px;
        }
        
        .project-form-group label {
            display: block;
            color: #aaa;
            font-size: 12px;
            margin-bottom: 6px;
        }
        
        .project-form-group input,
        .project-form-group textarea {
            width: 100%;
            padding: 10px 12px;
            background: #152840;
            border: 1px solid #1a3050;
            border-radius: 6px;
            color: #fff;
            font-size: 14px;
            box-sizing: border-box;
        }
        
        .project-form-group input:focus,
        .project-form-group textarea:focus {
            outline: none;
            border-color: #64ffda;
        }
        
        .project-section {
            background: #1a3050;
            border-radius: 10px;
            padding: 16px;
            margin-bottom: 16px;
        }
        
        .project-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }
        
        .project-section-title {
            color: #64ffda;
            font-size: 14px;
            font-weight: 600;
        }
        
        .project-section-buttons {
            display: flex;
            gap: 6px;
        }
        
        .project-section-buttons .btn-small {
            padding: 4px 10px;
            font-size: 11px;
        }
        
        .project-file-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .project-file-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #152840;
            padding: 10px 12px;
            border-radius: 6px;
        }
        
        .project-file-item.active {
            border: 1px solid #64ffda;
        }
        
        .project-file-info {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            min-width: 0;
        }
        
        .project-file-icon {
            font-size: 20px;
        }
        
        .project-file-name {
            color: #fff;
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .project-file-status {
            font-size: 11px;
            color: #888;
        }
        
        .project-file-status.ready {
            color: #64ffda;
        }
        
        .project-file-status.pending {
            color: #ff9f43;
        }
        
        .project-file-actions {
            display: flex;
            gap: 4px;
        }
        
        .project-file-btn {
            width: 28px;
            height: 28px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 4px;
            color: #fff;
            cursor: pointer;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        
        .project-file-btn:hover {
            background: rgba(255,255,255,0.2);
        }
        
        .project-file-btn.delete:hover {
            background: #ff6b6b;
        }
        
        .project-file-btn.convert:hover {
            background: #64ffda;
            color: #233f64;
        }
        
        .project-file-btn.add-map:hover {
            background: #48dbfb;
            color: #233f64;
        }
        
        .project-file-btn.autoload-toggle {
            color: #556;
            transition: color 0.2s, transform 0.2s;
        }
        .project-file-btn.autoload-toggle:hover {
            color: #ffd43b;
            transform: scale(1.2);
            background: transparent;
        }
        .project-file-btn.autoload-toggle.active {
            color: #ffd43b;
        }
        
        .project-empty {
            color: #666;
            font-size: 12px;
            text-align: center;
            padding: 20px;
        }
        
        .project-btn-row {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        
        .project-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .project-btn.primary {
            background: #64ffda;
            color: #233f64;
        }
        
        .project-btn.primary:hover {
            background: #4de8c5;
        }
        
        .project-btn.danger {
            background: transparent;
            border: 1px solid #ff6b6b;
            color: #ff6b6b;
        }
        
        .project-btn.danger:hover {
            background: #ff6b6b;
            color: #fff;
        }
        
        /* Zona Pericolosa - Solo Admin */
        .danger-zone {
            background: rgba(255, 59, 48, 0.1);
            border: 1px solid rgba(255, 59, 48, 0.3);
            border-radius: 8px;
            margin-top: 20px;
        }
        
        .danger-zone .project-section-header {
            background: rgba(255, 59, 48, 0.15);
            border-bottom: 1px solid rgba(255, 59, 48, 0.2);
        }
        
        .danger-zone .project-section-title {
            color: #ff6b6b;
        }
        
        .danger-zone-content {
            padding: 16px;
        }
        
        .danger-zone-warning {
            color: #ccc;
            font-size: 13px;
            margin: 0 0 16px 0;
            line-height: 1.5;
            padding: 12px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 6px;
            border-left: 3px solid #ff6b6b;
        }
        
        .danger-zone-warning strong {
            color: #ff6b6b;
        }
        
        .danger-zone .project-btn.danger {
            width: 100%;
            padding: 12px;
            font-size: 14px;
        }
        
        .project-btn.secondary {
            background: #1a3050;
            color: #fff;
        }
        
        .project-btn.secondary:hover {
            background: #152840;
        }
        
        /* Project list item improvements */
        .project-item {
            background: #1a3050;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }
        
        .project-item:hover {
            background: #152840;
        }
        
        .project-item.active {
            border-color: #64ffda;
            background: #1a3a50;
        }
        
        .project-badge.active {
            background: rgba(100, 255, 218, 0.2);
            color: #64ffda;
        }
        
        .project-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        
        .project-item-name {
            color: #fff;
            font-weight: 600;
            font-size: 14px;
        }
        
        .project-item-actions {
            display: flex;
            gap: 4px;
        }
        
        .project-item-badges {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        
        .project-badge {
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
        }
        
        .project-badge.dem {
            background: rgba(255, 107, 107, 0.2);
            color: #ff6b6b;
        }
        
        .project-badge.ortho {
            background: rgba(72, 219, 251, 0.2);
            color: #48dbfb;
        }
        
        .project-badge.tiles3d {
            background: rgba(255, 159, 67, 0.2);
            color: #ff9f43;
        }
        
        .project-badge.pointcloud {
            background: rgba(162, 155, 254, 0.2);
            color: #a29bfe;
        }
        
        .project-badge.pending {
            background: rgba(255, 255, 255, 0.1);
            color: #888;
        }
        
        /* VR Button */
        .vr-button {
            position: absolute;
            bottom: 36px;
            right: 120px;
            width: 50px;
            height: 50px;
            background: #233f64;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            z-index: 99;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s;
        }
        
        .vr-button:hover {
            background: #1a3050;
            transform: scale(1.05);
        }
        
        .vr-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .vr-button.vr-active {
            background: #64ffda;
            color: #233f64;
        }
        
        .vr-button .vr-icon {
            font-weight: bold;
            font-size: 14px;
        }
        
        /* Fullscreen Button - accanto al VR */
        .fullscreen-btn {
            position: absolute;
            bottom: 36px;
            right: 118px;
            width: 50px;
            height: 50px;
            background: #233f64;
            border: none;
            border-radius: 10px;
            color: #ffffff;
            cursor: pointer;
            z-index: 99;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 25px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s;
        }
        
        .fullscreen-btn:hover {
            background: #1a3050;
            transform: scale(1.05);
            color: #fff;
        }
        
        .fullscreen-btn.active {
            background: #64ffda;
            color: #233f64;
        }
        
        /* Fullscreen Mode Styles */
        body.map-fullscreen:hover /* ============================================
           ANNOTATION TOOLS
           ============================================ */
        
        .annotation-toolbar {
            position: absolute;
            top: 80px;
            right: 16px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            z-index: 100;
          /*  background: rgba(35, 63, 100, 0.95); */
            padding: 10px;
            border-radius: 12px;
          /*  box-shadow: 0 4px 20px rgba(0,0,0,0.3); */
        }
        
        .toolbar-section {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        
        .toolbar-label {
            font-size: 9px;
            color: #8b9dc3;
            text-transform: uppercase;
            letter-spacing: 1px;
            padding: 0 4px;
        }
        
        .toolbar-divider {
            height: 1px;
            background: rgba(255,255,255,0.1);
            margin: 4px 0;
        }
        
        .annotation-btn {
            width: 44px;
            height: 44px;
            background: #1a3050;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            transition: all 0.2s;
        }
        
        .annotation-btn:hover {
            background: #2a4a70;
            transform: scale(1.05);
        }
        
        .annotation-btn.active {
            background: #64ffda;
            color: #233f64;
        }
        
        .annotation-btn.measure-btn.active {
            background: #feca57;
            color: #233f64;
        }
        
        .annotation-btn.cancel {
            background: #dc3545;
        }
        
        .annotation-btn.cancel:hover {
            background: #c82333;
        }
        
        /* Measurement Panel - positioned on left */
        .measure-panel {
            position: absolute;
            top: 280px;
            left: 550px;
            width: 280px;
            background: rgba(35, 63, 100, 0.98);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 99;
            display: none;
            overflow: hidden;
        }
        
        .measure-panel.visible {
            display: block;
        }
        
        .measure-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
            color: #64ffda;
            font-weight: 600;
            font-size: 14px;
        }
        
        .measure-panel-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            opacity: 0.7;
        }
        
        .measure-panel-close:hover {
            opacity: 1;
        }
        
        .measure-panel-content {
            padding: 16px;
        }
        
        .measure-result {
            margin-bottom: 12px;
        }
        
        .measure-result-label {
            font-size: 11px;
            color: #8b9dc3;
            text-transform: uppercase;
            margin-bottom: 4px;
        }
        
        .measure-result-value {
            font-size: 24px;
            font-weight: 700;
            color: #fff;
        }
        
        .measure-result-unit {
            font-size: 14px;
            color: #64ffda;
            margin-left: 4px;
        }
        
        .measure-segments {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #3d5a80;
        }
        
        .measure-segment {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #ccc;
            padding: 4px 0;
        }
        
        /* Elevation Profile Window */
        .elevation-window {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            width: 700px;
            max-width: calc(100vw - 40px);
            background: rgba(35, 63, 100, 0.98);
            border-radius: 12px;
            box-shadow: 0 4px 30px rgba(0,0,0,0.5);
            z-index: 1000;
            display: none;
            overflow: hidden;
        }
        
        .elevation-window.visible {
            display: block;
        }
        
        .elevation-window-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
        }
        
        .elevation-window-title {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #64ffda;
            font-weight: 600;
        }
        
        .elevation-window-controls {
            display: flex;
            gap: 8px;
        }
        
        .elevation-btn {
            background: none;
            border: none;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            opacity: 0.7;
        }
        
        .elevation-btn:hover {
            opacity: 1;
            background: rgba(255,255,255,0.1);
        }
        
        .elevation-btn.elevation-close:hover {
            background: #dc3545;
        }
        
        .elevation-stats {
            display: flex;
            justify-content: space-around;
            padding: 12px 16px;
            background: rgba(0,0,0,0.2);
            border-bottom: 1px solid #3d5a80;
        }
        
        .elevation-stat {
            text-align: center;
        }
        
        .elevation-stat-value {
            font-size: 18px;
            font-weight: 700;
            color: #fff;
        }
        
        .elevation-stat-label {
            font-size: 10px;
            color: #8b9dc3;
            text-transform: uppercase;
        }
        
        .elevation-chart-container {
            padding: 16px;
            height: 200px;
        }
        
        #elevation-chart {
            width: 100% !important;
            height: 100% !important;
        }
        
        /* Measures List Panel */
        .measures-list-panel {
            position: absolute;
            top: 80px;
            right: 130px;
            width: 350px;
            max-height: 350px;
            background: rgba(35, 63, 100, 0.98);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 99;
            display: none;
            overflow: hidden;
        }
        
        .measures-list-panel.visible {
            display: block;
        }
        
        .measures-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
        }
        
        .measures-panel-header h3 {
            margin: 0;
            font-size: 14px;
            color: #feca57;
        }
        
        .measures-panel-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            opacity: 0.7;
        }
        
        .measures-panel-close:hover {
            opacity: 1;
        }
        
        .measures-list {
            max-height: 280px;
            overflow-y: auto;
            padding: 8px;
        }
        
        .measure-list-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: #1a3050;
            border-radius: 8px;
            margin-bottom: 6px;
            cursor: pointer;
            transition: background 0.2s;
        }
        
        .measure-list-item:hover {
            background: #2a4a70;
        }
        
        .measure-list-icon {
            font-size: 18px;
        }
        
        .measure-list-info {
            flex: 1;
            min-width: 0;
        }
        
        .measure-list-name {
            color: #fff;
            font-size: 13px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .measure-list-value {
            color: #8b9dc3;
            font-size: 11px;
        }
        
        .measure-list-actions {
            display: flex;
            gap: 4px;
        }
        
        .measure-list-actions button {
            background: none;
            border: none;
            color: #fff;
            font-size: 14px;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            opacity: 0.7;
        }
        
        .measure-list-actions button:hover {
            opacity: 1;
            background: rgba(255,255,255,0.1);
        }

        /* ============================================================
           ACTIVITY PANEL (Right side collapsible)
           ============================================================ */
        .activity-panel-toggle {
            position: absolute;
            top: 50%;
            right: 16px;
            transform: translateY(-50%);
            width: 44px;
            height: 44px;
            background: #233f64;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s;
        }
        
        .activity-panel-toggle:hover {
            background: #1a3050;
            transform: translateY(-50%) scale(1.05);
        }
        
        .activity-panel-toggle.panel-open {
            right: 356px;
        }
        
        .activity-panel {
            position: absolute;
            top: 50%;
            right: 0;
            transform: translateY(-50%) translateX(100%);
            width: 340px;
            height: 75vh;
            max-height: 800px;
            background: #233f64;
            color: #fff;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            box-shadow: -4px 0 20px rgba(0,0,0,0.3);
            border-radius: 12px 0 0 12px;
        }
        
        .activity-panel.open {
            transform: translateY(-50%) translateX(0);
        }
        
        .activity-panel-header {
            padding: 14px 16px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-radius: 12px 0 0 0;
            flex-shrink: 0;
        }
        
        .activity-panel-header h3 {
            font-size: 15px;
            font-weight: 600;
            margin: 0;
            color: #64ffda;
        }
        
        .activity-panel-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 22px;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.2s;
        }
        
        .activity-panel-close:hover {
            opacity: 1;
        }
        
        /* Project Selector */
        .activity-project-selector {
            padding: 12px 16px;
            border-bottom: 1px solid #3d5a80;
            flex-shrink: 0;
        }
        
        .activity-project-selector label {
            display: block;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #8b9dc3;
            margin-bottom: 6px;
        }
        
        .activity-project-selector select {
            width: 100%;
            padding: 8px 12px;
            background: #1a3050;
            color: #fff;
            border: 1px solid #3d5a80;
            border-radius: 8px;
            font-size: 13px;
            cursor: pointer;
            outline: none;
        }
        
        .activity-project-selector select:focus {
            border-color: #64ffda;
        }
        
        .activity-project-selector select option {
            background: #1a3050;
            color: #fff;
        }
        
        /* Accordion Container */
        .activity-accordion-container {
            flex: 1;
            overflow-y: auto;
            padding: 8px 0;
        }
        
        .activity-accordion {
            border-bottom: 1px solid rgba(61, 90, 128, 0.4);
        }
        
        .activity-accordion:last-child {
            border-bottom: none;
        }
        
        .activity-accordion-header {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            background: none;
            border: none;
            color: #fff;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: background 0.2s;
        }
        
        .activity-accordion-header:hover {
            background: rgba(255,255,255,0.05);
        }
        
        .activity-accordion-header.active {
            background: rgba(100, 255, 218, 0.08);
        }
        
        .accordion-icon {
            font-size: 16px;
            flex-shrink: 0;
        }
        
        .accordion-title {
            flex: 1;
            text-align: left;
        }
        
        .accordion-count {
            background: #1a3050;
            color: #8b9dc3;
            font-size: 11px;
            padding: 2px 8px;
            border-radius: 10px;
            min-width: 24px;
            text-align: center;
        }
        
        .accordion-arrow {
            font-size: 12px;
            color: #8b9dc3;
            transition: transform 0.2s;
        }
        
        .activity-accordion-header.active .accordion-arrow {
            transform: rotate(90deg);
            color: #64ffda;
        }
        
        .activity-accordion-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }
        
        .activity-accordion-body.open {
            max-height: 400px;
            overflow-y: auto;
        }
        
        /* Activity List Items */
        .activity-list {
            padding: 4px 8px 8px;
        }
        
        .activity-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.15s;
        }
        
        .activity-item:hover {
            background: rgba(255,255,255,0.08);
        }
        
        .activity-item-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        
        .activity-item-info {
            flex: 1;
            min-width: 0;
        }
        
        .activity-item-name {
            font-size: 12px;
            font-weight: 500;
            color: #fff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .activity-item-desc {
            font-size: 11px;
            color: #8b9dc3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-top: 2px;
        }
        
        .activity-empty {
            text-align: center;
            color: #8b9dc3;
            font-size: 12px;
            padding: 16px;
        }
        
        /* Export bar */
        .activity-export-bar {
            padding: 10px 16px;
            border-top: 1px solid #3d5a80;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            border-radius: 0 0 0 12px;
        }
        
        /* ============================================================
           MAP TOOLS BAR (Bottom Right)
           ============================================================ */
        .map-tools-bar {
            position: absolute;
            bottom: 60px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 4px;
            background: rgba(35, 63, 100, 0.95);
            padding: 8px 12px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            z-index: 100;
            backdrop-filter: blur(10px);
        }
        
        .map-tools-group {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .map-tools-label {
            font-size: 9px;
            color: #8b9dc3;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            writing-mode: horizontal-tb;
            text-orientation: mixed;
            transform: rotate(0deg);
            margin-right: 2px;
        }
        
        .map-tools-divider {
            width: 1px;
            height: 30px;
            background: rgba(255,255,255,0.15);
            margin: 0 6px;
        }
        
        .map-tool-btn {
            width: 40px;
            height: 40px;
            background: #1a3050;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
        }
        
        .map-tool-btn:hover {
            background: #2a4a70;
            transform: scale(1.08);
        }
        
        .map-tool-btn.active {
            background: #64ffda;
            color: #233f64;
        }
        
        .map-tool-btn.measure-btn.active {
            background: #feca57;
            color: #233f64;
        }
        
        /* CSV Data System */
        .csv-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 10000;
        }
        
        .csv-modal-overlay.visible {
            display: flex;
        }
        
        .csv-modal {
            background: #233f64;
            border-radius: 16px;
            width: 600px;
            max-width: calc(100vw - 40px);
            max-height: calc(100vh - 80px);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 10px 50px rgba(0,0,0,0.5);
        }
        
        .csv-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
        }
        
        .csv-modal-header h3 {
            margin: 0;
            color: #64ffda;
            font-size: 16px;
        }
        
        .csv-modal-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 24px;
            cursor: pointer;
            opacity: 0.7;
        }
        
        .csv-modal-close:hover {
            opacity: 1;
        }
        
        .csv-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }
        
        .csv-upload-area {
            border: 2px dashed #3d5a80;
            border-radius: 12px;
            padding: 40px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .csv-upload-area:hover, .csv-upload-area.dragover {
            border-color: #64ffda;
            background: rgba(100, 255, 218, 0.1);
        }
        
        .csv-upload-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }
        
        .csv-upload-text {
            font-size: 16px;
            color: #fff;
            margin-bottom: 8px;
        }
        
        .csv-upload-subtext {
            font-size: 13px;
            color: #8b9dc3;
        }
        
        .csv-file-info {
            background: #1a3050;
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .csv-file-name {
            color: #64ffda;
            font-weight: 600;
        }
        
        .csv-file-stats {
            color: #8b9dc3;
            font-size: 12px;
        }
        
        .csv-preview-container {
            margin-bottom: 20px;
        }
        
        .csv-preview-label {
            font-size: 12px;
            color: #8b9dc3;
            margin-bottom: 8px;
        }
        
        .csv-preview {
            background: #1a3050;
            border-radius: 8px;
            overflow-x: auto;
            max-height: 150px;
        }
        
        .csv-preview table {
            width: 100%;
            border-collapse: collapse;
            font-size: 11px;
        }
        
        .csv-preview th {
            background: #0d1f35;
            color: #64ffda;
            padding: 8px 12px;
            text-align: left;
            position: sticky;
            top: 0;
        }
        
        .csv-preview td {
            padding: 6px 12px;
            border-bottom: 1px solid #3d5a80;
            color: #fff;
            white-space: nowrap;
        }
        
        .csv-config-section h4 {
            color: #64ffda;
            font-size: 14px;
            margin: 0 0 16px 0;
        }
        
        .csv-config-row {
            margin-bottom: 14px;
        }
        
        .csv-config-row label {
            display: block;
            font-size: 12px;
            color: #8b9dc3;
            margin-bottom: 6px;
        }
        
        .csv-config-row input,
        .csv-config-row select {
            width: 100%;
            padding: 10px 12px;
            background: #1a3050;
            border: 1px solid #3d5a80;
            border-radius: 8px;
            color: #fff;
            font-size: 14px;
        }
        
        .csv-config-row input:focus,
        .csv-config-row select:focus {
            outline: none;
            border-color: #64ffda;
        }
        
        .csv-columns-config {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-top: 16px;
        }
        
        .csv-coords-inputs {
            display: flex;
            gap: 10px;
        }
        
        .csv-coords-inputs input {
            flex: 1;
        }
        
        .btn-map-pick {
            padding: 8px 12px;
            background: #3d5a80;
            border: 1px solid #64ffda;
            border-radius: 6px;
            color: #fff;
            cursor: pointer;
            font-size: 16px;
        }
        
        .btn-map-pick:hover {
            background: #4a6a90;
        }
        
        .btn-map-pick.active {
            background: #64ffda;
            color: #1a3050;
        }
        
        .csv-map-search {
            margin-top: 10px;
            position: relative;
        }
        
        .csv-map-search input {
            width: 100%;
            padding: 10px 12px;
            background: #1a3050;
            border: 1px solid #3d5a80;
            border-radius: 8px;
            color: #fff;
            font-size: 13px;
        }
        
        .csv-search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #1a3050;
            border: 1px solid #3d5a80;
            border-radius: 0 0 8px 8px;
            max-height: 150px;
            overflow-y: auto;
            z-index: 100;
            display: none;
        }
        
        .csv-search-results.visible {
            display: block;
        }
        
        .csv-search-result {
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid #3d5a80;
            font-size: 12px;
        }
        
        .csv-search-result:hover {
            background: #2a4a70;
        }
        
        .csv-search-result:last-child {
            border-bottom: none;
        }
        
        .csv-search-result-name {
            color: #fff;
            font-weight: 500;
        }
        
        .csv-search-result-type {
            color: #8b9dc3;
            font-size: 10px;
        }
        
        .csv-mini-map-container {
            margin-top: 10px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid #3d5a80;
        }
        
        #csv-mini-map {
            height: 200px;
            width: 100%;
        }
        
        .csv-mini-map-info {
            background: rgba(26, 48, 80, 0.9);
            color: #64ffda;
            text-align: center;
            padding: 6px;
            font-size: 11px;
        }
        
        .csv-multi-select {
            max-height: 150px;
            overflow-y: auto;
            background: #1a3050;
            border: 1px solid #3d5a80;
            border-radius: 8px;
            padding: 8px;
        }
        
        .csv-checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            cursor: pointer;
            border-radius: 4px;
            transition: background 0.2s;
        }
        
        .csv-checkbox-label:hover {
            background: rgba(255,255,255,0.1);
        }
        
        .csv-checkbox-label input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }
        
        .csv-checkbox-label span {
            color: #fff;
            font-size: 13px;
        }
        
        /* CSV Source Tabs */
        .csv-source-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }
        
        .csv-source-tab {
            flex: 1;
            padding: 12px;
            background: #1a3050;
            border: 2px solid #3d5a80;
            border-radius: 8px;
            color: #8b9dc3;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .csv-source-tab:hover {
            border-color: #64ffda;
        }
        
        .csv-source-tab.active {
            background: rgba(100, 255, 218, 0.1);
            border-color: #64ffda;
            color: #64ffda;
        }
        
        .csv-auth-row {
            display: flex;
            gap: 10px;
        }
        
        .csv-auth-row input {
            flex: 1;
        }
        
        .csv-config-row label input[type="checkbox"] {
            margin-right: 8px;
        }
        
        .csv-config-row label input[type="number"] {
            width: auto;
            padding: 4px 8px;
        }
        
        .csv-modal-footer {
            padding: 16px 20px;
            background: #1a3050;
            border-top: 1px solid #3d5a80;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        
        .csv-modal-footer .btn {
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
        }
        
        .csv-modal-footer .btn-cancel {
            background: #3d5a80;
            color: #fff;
        }
        
        .csv-modal-footer .btn-back {
            background: transparent;
            color: #8b9dc3;
            border: 1px solid #3d5a80;
        }
        
        .csv-modal-footer .btn-save {
            background: #64ffda;
            color: #1a3050;
        }
        
        /* CSV Chart Window */
        .csv-chart-window {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            width: 800px;
            max-width: calc(100vw - 40px);
            background: rgba(35, 63, 100, 0.98);
            border-radius: 12px;
            box-shadow: 0 4px 30px rgba(0,0,0,0.5);
            z-index: 1000;
            display: none;
            overflow: hidden;
        }
        
        .csv-chart-window.visible {
            display: block;
        }
        
        .csv-chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
        }
        
        .csv-chart-title {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #64ffda;
            font-weight: 600;
        }
        
        .csv-chart-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .csv-chart-select {
            background: #3d5a80;
            border: none;
            border-radius: 6px;
            color: #fff;
            padding: 6px 10px;
            font-size: 12px;
        }
        
        .csv-chart-btn {
            background: none;
            border: none;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            opacity: 0.7;
        }
        
        .csv-chart-btn:hover {
            opacity: 1;
            background: rgba(255,255,255,0.1);
        }
        
        .csv-chart-btn.csv-chart-close:hover {
            background: #dc3545;
        }
        
        .csv-chart-stats {
            display: flex;
            justify-content: space-around;
            padding: 10px 16px;
            background: rgba(0,0,0,0.2);
            border-bottom: 1px solid #3d5a80;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .csv-chart-stat {
            text-align: center;
            min-width: 80px;
        }
        
        .csv-chart-stat-value {
            font-size: 16px;
            font-weight: 700;
            color: #fff;
        }
        
        .csv-chart-stat-label {
            font-size: 10px;
            color: #8b9dc3;
            text-transform: uppercase;
        }
        
        .csv-chart-container {
            padding: 16px;
            height: 250px;
        }
        
        .csv-chart-legend {
            padding: 8px 16px;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            justify-content: center;
            font-size: 12px;
            border-top: 1px solid #3d5a80;
        }
        
        .csv-legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            color: #fff;
        }
        
        .csv-legend-color {
            width: 12px;
            height: 12px;
            border-radius: 3px;
        }
        
        /* CSV List Panel */
        .csv-list-panel {
            position: absolute;
            top: 600px;
            right: 500px;
            width: 350px;
            max-height: 400px;
            background: rgba(35, 63, 100, 0.98);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 99;
            display: none;
            overflow: hidden;
        }
        
        .csv-list-panel.visible {
            display: block;
        }
        
        .csv-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            border-bottom: 1px solid #3d5a80;
        }
        
        .csv-list-header h3 {
            margin: 0;
            font-size: 14px;
            color: #64ffda;
        }
        
        .csv-list-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            opacity: 0.7;
        }
        
        .csv-list {
            max-height: 320px;
            overflow-y: auto;
            padding: 8px;
        }
        
        .csv-list-empty {
            padding: 30px;
            text-align: center;
            color: #8b9dc3;
        }
        
        .csv-list-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            background: #1a3050;
            border-radius: 8px;
            margin-bottom: 6px;
            transition: background 0.2s;
        }
        
        .csv-list-item:hover {
            background: #2a4a70;
        }
        
        .csv-list-item.alarm-active {
            background: rgba(255, 71, 87, 0.2);
            border: 1px solid #ff4757;
            animation: alarm-pulse 2s infinite;
        }
        
        @keyframes alarm-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }
        
        /* Threshold Modal */
        .threshold-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.8);
            z-index: 10000;
            display: none;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        
        .threshold-overlay.visible {
            display: flex;
        }
        
        .threshold-modal {
            background: #1a2744;
            border-radius: 12px;
            max-width: 600px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 10px 40px rgba(0,0,0,0.5);
        }
        
        .threshold-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            border-bottom: 1px solid #2a4060;
        }
        
        .threshold-header h3 {
            margin: 0;
            color: #e6f1ff;
            font-size: 18px;
        }
        
        .threshold-close {
            background: none;
            border: none;
            color: #8892b0;
            font-size: 20px;
            cursor: pointer;
        }
        
        .threshold-close:hover {
            color: #ff6b6b;
        }
        
        .threshold-stats {
            padding: 20px;
            border-bottom: 1px solid #2a4060;
        }
        
        .threshold-stats h4 {
            margin: 0 0 15px 0;
            color: #64ffda;
            font-size: 14px;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }
        
        .stat-item {
            background: #152238;
            padding: 10px;
            border-radius: 6px;
            text-align: center;
        }
        
        .stat-label {
            display: block;
            color: #8892b0;
            font-size: 11px;
            margin-bottom: 4px;
        }
        
        .stat-value {
            display: block;
            color: #e6f1ff;
            font-size: 14px;
            font-weight: 600;
        }
        
        .threshold-list {
            padding: 20px;
            border-bottom: 1px solid #2a4060;
        }
        
        .threshold-list h4 {
            margin: 0 0 15px 0;
            color: #ff6b6b;
            font-size: 14px;
        }
        
        .threshold-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #152238;
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 8px;
        }
        
        .threshold-item.triggered {
            background: rgba(255, 71, 87, 0.2);
            border: 1px solid #ff4757;
        }
        
        .threshold-info {
            flex: 1;
        }
        
        .threshold-name {
            display: block;
            color: #e6f1ff;
            font-weight: 500;
            margin-bottom: 4px;
        }
        
        .threshold-condition {
            color: #8892b0;
            font-size: 12px;
            font-family: monospace;
        }
        
        .threshold-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .threshold-level {
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 11px;
            color: #fff;
            text-transform: uppercase;
        }
        
        .threshold-actions button {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 16px;
        }
        
        .threshold-add {
            padding: 20px;
        }
        
        .threshold-add h4 {
            margin: 0 0 15px 0;
            color: #64ffda;
            font-size: 14px;
        }
        
        .threshold-form {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .threshold-form .form-row {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        
        .threshold-form label {
            color: #8892b0;
            font-size: 12px;
        }
        
        .threshold-form input[type="text"],
        .threshold-form input[type="number"],
        .threshold-form select {
            padding: 10px;
            background: #233f64;
            border: 1px solid #1a3050;
            color: #e6f1ff;
            border-radius: 6px;
            font-size: 14px;
        }
        
        .threshold-form input:focus,
        .threshold-form select:focus {
            outline: none;
            border-color: #64ffda;
        }
        
        .threshold-form .btn-primary {
            background: #64ffda;
            color: #0a192f;
            border: none;
            padding: 12px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 10px;
        }
        
        .threshold-form .btn-primary:hover {
            background: #4cd9b0;
        }
        
        .csv-list-item-icon {
            font-size: 20px;
        }
        
        .csv-list-item-info {
            flex: 1;
            min-width: 0;
        }
        
        .csv-list-item-name {
            color: #fff;
            font-size: 13px;
            font-weight: 500;
        }
        
        .csv-list-item-meta {
            color: #8b9dc3;
            font-size: 11px;
        }
        
        .csv-list-item-actions {
            display: flex;
            gap: 4px;
        }
        
        .csv-list-item-actions button {
            background: none;
            border: none;
            color: #fff;
            font-size: 14px;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            opacity: 0.7;
        }
        
        .csv-list-item-actions button:hover {
            opacity: 1;
            background: rgba(255,255,255,0.1);
        }
        
        @media (max-width: 768px) {
            .csv-modal {
                width: 100%;
                max-width: 100%;
                height: 100%;
                max-height: 100%;
                border-radius: 0;
            }
            
            .csv-chart-window {
                width: calc(100vw - 20px);
                bottom: 10px;
            }
            
            .csv-list-panel {
                right: 10px;
                left: 10px;
                width: auto;
            }
            
            .csv-columns-config {
                grid-template-columns: 1fr;
            }
        }
        
        /* Annotation popup/form */
        .annotation-popup {
            position: absolute;
            background: #233f64;
            border-radius: 12px;
            padding: 16px;
            min-width: 280px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 1000;
            color: #fff;
        }
        
        .annotation-popup h3 {
            margin: 0 0 12px 0;
            font-size: 14px;
            color: #64ffda;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .annotation-popup .form-group {
            margin-bottom: 12px;
        }
        
        .annotation-popup label {
            display: block;
            font-size: 11px;
            color: #aaa;
            margin-bottom: 4px;
            text-transform: uppercase;
        }
        
        .annotation-popup input[type="text"],
        .annotation-popup textarea {
            width: 100%;
            padding: 8px 10px;
            background: #1a3050;
            border: 1px solid #152840;
            border-radius: 6px;
            color: #fff;
            font-size: 13px;
        }
        
        .annotation-popup input[type="text"]:focus,
        .annotation-popup textarea:focus {
            outline: none;
            border-color: #64ffda;
        }
        
        .annotation-popup textarea {
            resize: vertical;
            min-height: 60px;
        }
        
        .annotation-popup input[type="color"] {
            width: 40px;
            height: 30px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            background: none;
        }
        
        .annotation-popup .color-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .annotation-popup .color-presets {
            display: flex;
            gap: 6px;
        }
        
        .annotation-popup .color-preset {
            width: 24px;
            height: 24px;
            border-radius: 4px;
            border: 2px solid transparent;
            cursor: pointer;
            transition: transform 0.2s;
        }
        
        .annotation-popup .color-preset:hover {
            transform: scale(1.1);
        }
        
        .annotation-popup .color-preset.selected {
            border-color: #fff;
        }
        
        .annotation-popup .btn-row {
            display: flex;
            gap: 8px;
            margin-top: 16px;
        }
        
        .annotation-popup .btn {
            flex: 1;
            padding: 8px 12px;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .annotation-popup .btn-save {
            background: #64ffda;
            color: #233f64;
            font-weight: 600;
        }
        
        .annotation-popup .btn-save:hover {
            background: #4de3c2;
        }
        
        .annotation-popup .btn-cancel {
            background: #1a3050;
            color: #fff;
        }
        
        .annotation-popup .btn-cancel:hover {
            background: #152840;
        }
        
        .annotation-popup .btn-delete {
            background: #dc3545;
            color: #fff;
        }
        
        .annotation-popup .btn-delete:hover {
            background: #c82333;
        }
        
        /* Edit Vertices Mode */
        .edit-mode-instruction {
            position: absolute;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(35, 63, 100, 0.95);
            color: white;
            padding: 14px 20px;
            border-radius: 12px;
            font-size: 13px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 2000;
            display: none;
            text-align: center;
            max-width: calc(100vw - 40px);
        }
        
        .edit-mode-instruction.visible {
            display: block;
        }
        
        .edit-mode-instruction .key {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: 2px 8px;
            border-radius: 4px;
            margin: 0 4px;
            font-family: monospace;
        }
        
        @media (max-width: 768px) {
            .edit-mode-instruction {
                bottom: 120px;
            }
            
            .edit-mode-instruction .key {
                display: none;
            }
        }
        
        /* Notification Toast */
        .notification-toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: #233f64;
            color: white;
            padding: 14px 28px;
            border-radius: 25px;
            font-size: 14px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.4);
            z-index: 10000;
            opacity: 0;
            transition: all 0.3s ease;
            border: 1px solid #64ffda;
        }
        
        .notification-toast.visible {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        
        /* Annotations list panel */
        .annotations-panel {
            position: absolute;
            top: 80px;
            right: 130px;
            width: 350px;
            max-height: calc(100vh - 160px);
            background: #233f64;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            z-index: 95;
            display: none;
            overflow: hidden;
        }
        
        .annotations-panel.open {
            display: block;
        }
        
        .annotations-panel-header {
            padding: 12px 16px;
            background: #1a3050;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #152840;
        }
        
        .annotations-panel-header h3 {
            margin: 0;
            font-size: 14px;
            color: #fff;
        }
        
        .annotations-panel-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 18px;
            cursor: pointer;
            opacity: 0.7;
        }
        
        .annotations-panel-close:hover {
            opacity: 1;
        }
        
        .annotations-export-bar {
            padding: 8px 12px;
            background: #0d1f35;
            display: flex;
            align-items: center;
            gap: 8px;
            border-bottom: 1px solid #152840;
        }
        
        .export-btn {
            padding: 5px 10px;
            background: #233f64;
            border: none;
            border-radius: 5px;
            color: #fff;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .export-btn:hover {
            background: #1a3050;
            transform: scale(1.02);
        }
        
        .export-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .annotations-list {
            max-height: calc(100vh - 280px);
            overflow-y: auto;
            padding: 8px;
        }
        
        .annotation-item {
            background: #1a3050;
            border-radius: 8px;
            padding: 10px 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: flex-start;
            gap: 10px;
        }
        
        .annotation-item:hover {
            background: #152840;
        }
        
        .annotation-item-icon {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
        }
        
        .annotation-item-content {
            flex: 1;
            min-width: 0;
        }
        
        .annotation-item-name {
            font-size: 13px;
            color: #fff;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .annotation-item-desc {
            font-size: 11px;
            color: #aaa;
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .annotation-item-actions {
            display: flex;
            gap: 4px;
        }
        
        .annotation-item-btn {
            width: 28px;
            height: 28px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 4px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            opacity: 0;
            transition: all 0.2s;
        }
        
        .annotation-item:hover .annotation-item-btn {
            opacity: 1;
        }
        
        .annotation-item-btn:hover {
            background: rgba(255,255,255,0.2);
        }
        
        .annotation-item-btn.delete:hover {
            background: #dc3545;
        }
        
        .annotations-empty {
            text-align: center;
            padding: 30px 20px;
            color: #aaa;
        }
        
        .annotations-empty-icon {
            font-size: 40px;
            margin-bottom: 10px;
            opacity: 0.5;
        }
        
        /* Drawing cursor styles */
        .drawing-marker {
            cursor: crosshair !important;
        }
        
        .drawing-line {
            cursor: crosshair !important;
        }
        
        .drawing-polygon {
            cursor: crosshair !important;
        }
        
        /* Instruction toast */
        .draw-instruction {
            position: absolute;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(35, 63, 100, 0.95);
            color: #fff;
            padding: 12px 20px;
            border-radius: 12px;
            font-size: 13px;
            z-index: 1000;
            display: none;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            max-width: calc(100vw - 40px);
            text-align: center;
        }
        
        .draw-instruction.visible {
            display: block;
        }
        
        .draw-instruction kbd {
            background: #1a3050;
            padding: 2px 6px;
            border-radius: 4px;
            margin: 0 2px;
        }
        
        .draw-instruction-text {
            margin-bottom: 10px;
        }
        
        .draw-instruction-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 12px;
        }
        
        .draw-instruction-btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        
        .draw-instruction-btn.confirm {
            background: #64ffda;
            color: #1a3050;
        }
        
        .draw-instruction-btn.confirm:hover {
            background: #4de8c8;
        }
        
        .draw-instruction-btn.cancel {
            background: #dc3545;
            color: #fff;
        }
        
        .draw-instruction-btn.cancel:hover {
            background: #c82333;
        }
        
        /* Hide keyboard hints on mobile */
        @media (max-width: 768px) {
            .draw-instruction kbd {
                display: none;
            }
            
            .draw-instruction {
                bottom: 100px;
                padding: 14px 16px;
            }
            
            .annotation-toolbar {
                display: none;
            }
            
            .toolbar-section {
                flex-direction: row;
                flex-wrap: wrap;
            }
            
            .toolbar-label {
                display: none;
            }
            
            .toolbar-divider {
                width: 1px;
                height: 30px;
                margin: 0 8px;
            }
            
            .annotation-btn {
                width: 40px;
                height: 40px;
                font-size: 18px;
            }

            /* Activity Panel mobile */
            .activity-panel {
                width: 100%;
                height: 60vh;
                top: auto;
                bottom: 0;
                transform: translateY(100%);
                border-radius: 12px 12px 0 0;
            }
            
            .activity-panel.open {
                transform: translateY(0);
            }
            
            .activity-panel-toggle {
                top: auto;
                bottom: 80px;
                right: 10px;
                transform: none;
            }
            
            .activity-panel-toggle:hover {
                transform: scale(1.05);
            }
            
            .activity-panel-toggle.panel-open {
                right: 10px;
                bottom: calc(60vh + 10px);
            }
            
            /* Map Tools Bar mobile */
            .map-tools-bar {
                bottom: 16px;
                left: 50%;
                right: auto;
                transform: translateX(-50%);
            }
            
            .map-tools-label {
                display: none;
            }
            
            .measure-panel {
                top: auto;
                bottom: 80px;
                left: 10px;
                right: 10px;
                width: auto;
            }
            
            .measures-list-panel {
                top: auto;
                bottom: 80px;
                right: 10px;
                left: 10px;
                width: auto;
            }
            
            .elevation-window {
                width: calc(100vw - 20px);
                bottom: 10px;
            }
        }
        
        /* VR Overlay */
        #vr-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 10000;
            display: none;
        }
        
        #vr-overlay.active {
            display: block;
        }
        
        #vr-canvas {
            width: 100%;
            height: 100%;
        }
        
        .vr-exit-button {
            position: absolute;
            top: 20px;
            right: 20px;
            padding: 10px 20px;
            background: rgba(255,255,255,0.2);
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 8px;
            color: #fff;
            cursor: pointer;
            font-size: 14px;
            z-index: 10001;
        }
        
        .vr-status {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 10px 20px;
            background: rgba(0,0,0,0.7);
            border-radius: 8px;
            color: #fff;
            font-size: 14px;
            z-index: 10001;
        }
        
        /* Basemap Toggle Button */
        .basemap-toggle {
            position: absolute;
            bottom: 36px;
            right: 56px;
            width: 50px;
            height: 50px;
            background: #233f64;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            z-index: 99;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s;
        }
        
        .basemap-toggle:hover {
            background: #1a3050;
            transform: scale(1.05);
        }
        
        .basemap-toggle.panel-open {
            opacity: 0;
            pointer-events: none;
        }
        
        /* Basemap Panel */
        .control-panel.basemap-panel {
            position: absolute;
            bottom: 36px;
            right: 70px;
            width: auto;
            max-width: 340px;
            background: #233f64;
            border-radius: 12px;
            padding: 0;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            z-index: 1000;
            border: 1px solid #1a3050;
            transform: translateX(400px);
            opacity: 0;
            transition: all 0.3s ease;
            pointer-events: none;
        }
        
        .control-panel.basemap-panel.open {
            transform: translateX(0);
            opacity: 1;
            pointer-events: auto;
        }
        
        .basemap-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: #1a3050;
            border-radius: 12px 12px 0 0;
            border-bottom: 1px solid #152840;
        }
        
        .basemap-panel-header span {
            font-size: 14px;
            font-weight: 600;
            color: #fff;
        }
        
        .basemap-panel-close {
            background: none;
            border: none;
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.2s;
            padding: 0;
            line-height: 1;
        }
        
        .basemap-panel-close:hover {
            opacity: 1;
        }
        
        .basemap-section {
            margin-bottom: 0;
            padding: 12px 16px;
            border-bottom: 1px solid #1a3050;
        }
        
        .basemap-section:last-child {
            margin-bottom: 0;
            border-bottom: none;
        }
        
        .basemap-section-title {
            font-size: 11px;
            color: #64ffda;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .basemap-grid {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            max-width: 320px;
        }
        
        .basemap-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            padding: 4px;
            border-radius: 6px;
            border: 2px solid transparent;
            transition: all 0.2s;
        }
        
        .basemap-option:hover {
            background: rgba(100, 255, 218, 0.1);
        }
        
        .basemap-option.active {
            border-color: #64ffda;
            background: rgba(100, 255, 218, 0.15);
        }
        
        .basemap-preview {
            width: 52px;
            height: 52px;
            border-radius: 6px;
            margin-bottom: 2px;
            background-size: cover;
            background-position: center;
            border: 1px solid rgba(255,255,255,0.1);
        }
        
        .basemap-preview.carto {
            background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
            background-image: url('https://a.basemaps.cartocdn.com/light_all/8/136/95.png');
            background-size: cover;
        }
        
        .basemap-preview.esri {
            background: linear-gradient(135deg, #2d5a27, #4a7c3f);
            background-image: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/8/95/136');
            background-size: cover;
        }
        
        .basemap-preview.google {
            background: linear-gradient(135deg, #1a472a, #2d5a27);
            background-image: url('https://mt0.google.com/vt/lyrs=s&x=136&y=95&z=8');
            background-size: cover;
        }
        
        .basemap-preview.google-hybrid {
            background: linear-gradient(135deg, #1a472a 50%, #f0f0f0 50%);
            background-image: url('https://mt0.google.com/vt/lyrs=y&x=136&y=95&z=8');
            background-size: cover;
        }
        
        .basemap-preview.google-roads {
            background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
            background-image: url('https://mt0.google.com/vt/lyrs=m&x=136&y=95&z=8');
            background-size: cover;
        }
        
        .basemap-preview.google-terrain {
            background: linear-gradient(135deg, #c9d9a5, #a8c686);
            background-image: url('https://mt0.google.com/vt/lyrs=p&x=136&y=95&z=8');
            background-size: cover;
        }
        
        .basemap-preview.osm {
            background: linear-gradient(135deg, #f2efe9, #aad3df);
            background-image: url('https://a.tile.openstreetmap.org/8/136/95.png');
            background-size: cover;
        }
        
        .basemap-preview.maptiler-streets {
            background: linear-gradient(135deg, #f0ece4, #c5e8d0 40%, #aadaef);
            background-image: url('https://api.maptiler.com/maps/streets-v2/256/8/136/95.png?key=95I3OtVAuP8OwUFvvQpP');
            background-size: cover;
        }
        
        .basemap-option span {
            font-size: 9px;
            color: #8892b0;
        }
        
        .basemap-option.active span {
            color: #64ffda;
        }
        
        /* Building Toggles */
        .buildings-section {
            border-top: 1px solid #1a3050;
            padding-top: 12px;
        }
        
        .building-toggles {
            display: flex;
            gap: 16px;
        }
        
        .toggle-switch {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }
        
        .toggle-switch input {
            display: none;
        }
        
        .toggle-slider {
            width: 36px;
            height: 20px;
            background: #1a3050;
            border-radius: 10px;
            position: relative;
            transition: all 0.3s;
        }
        
        .toggle-slider::before {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            background: #8892b0;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: all 0.3s;
        }
        
        .toggle-switch input:checked + .toggle-slider {
            background: #1e5f74;
        }
        
        .toggle-switch input:checked + .toggle-slider::before {
            transform: translateX(16px);
            background: #64ffda;
        }
        
        .toggle-label {
            font-size: 12px;
            color: #8892b0;
        }
        
        .toggle-switch input:checked ~ .toggle-label {
            color: #64ffda;
        }
        
        /* Terrain Controls */
        .terrain-section {
            border-top: 1px solid #1a3050;
            padding-top: 12px;
        }
        
        .terrain-controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .terrain-exaggeration {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .terrain-exaggeration label {
            font-size: 11px;
            color: #8892b0;
        }
        
        .terrain-exaggeration input[type="range"] {
            width: 100%;
            height: 4px;
            -webkit-appearance: none;
            background: #1a3050;
            border-radius: 2px;
            outline: none;
        }
        
        .terrain-exaggeration input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 14px;
            height: 14px;
            background: #64ffda;
            border-radius: 50%;
            cursor: pointer;
        }
        
        .terrain-exaggeration input[type="range"]::-moz-range-thumb {
            width: 14px;
            height: 14px;
            background: #64ffda;
            border-radius: 50%;
            cursor: pointer;
            border: none;
        }
        
        /* Info Panel */
        .info-panel {
            position: absolute;
            bottom: 16px;
            left: 16px;
            background: rgba(26, 45, 71, 0.92);
            backdrop-filter: blur(8px);
            color: #c8d6e5;
            padding: 0 16px;
            border-radius: 10px;
            font-size: 12px;
            font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
            z-index: 100;
            transition: left 0.3s, bottom 0.3s;
            display: flex;
            align-items: center;
            gap: 20px;
            height: 38px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            border: 1px solid rgba(100,255,218,0.08);
        }
        
        .info-panel.panel-open {
            left: 356px;
        }
        
        .info-panel.timeline-open {
            bottom: 116px;
        }
        
        .info-item {
            color: #8892b0;
            white-space: nowrap;
            letter-spacing: 0.3px;
        }
        
        .info-item .info-value {
            color: #fff;
            font-weight: 500;
            margin-left: 4px;
        }
        
        .scale-bar {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-left: 4px;
        }
        
        .scale-bar-line {
            height: 2px;
            background: #fff;
            min-width: 40px;
            position: relative;
            border-radius: 1px;
        }
        
        .scale-bar-line::before,
        .scale-bar-line::after {
            content: '';
            position: absolute;
            width: 2px;
            height: 8px;
            background: #fff;
            top: -3px;
        }
        
        .scale-bar-line::before { left: 0; }
        .scale-bar-line::after { right: 0; }
        
        .scale-bar-label {
            color: #fff;
            font-size: 11px;
            white-space: nowrap;
        }
        
        /* DEM Icon Styles */
        .dem-terrain-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 20px;
            padding: 2px;
            filter: grayscale(100%);
            opacity: 0.5;
            transition: all 0.2s;
        }
        
        .dem-terrain-btn:hover {
            transform: scale(1.1);
            opacity: 0.8;
        }
        
        .dem-terrain-btn.active {
            filter: grayscale(0%);
            opacity: 1;
        }
        
        /* Timeline Panel */
        .timeline-panel {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(26, 26, 46, 0.95);
            color: #fff;
            padding: 12px 20px;
            z-index: 500;
            display: none;
            border-top: 1px solid #1a3050;
            transition: left 0.3s;
        }
        
        .timeline-panel.visible {
            display: block;
        }
        
        .timeline-panel.panel-open {
            left: 340px;
        }
        
        .timeline-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .timeline-title {
            font-size: 13px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .timeline-close {
            background: none;
            border: none;
            color: #8892b0;
            cursor: pointer;
            font-size: 18px;
        }
        
        .timeline-close:hover {
            color: #fff;
        }
        
        .timeline-controls {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        
        .timeline-player {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .timeline-btn {
            background: #1a3050;
            border: none;
            color: #fff;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all 0.2s;
        }
        
        .timeline-btn:hover {
            background: #64ffda;
            color: #233f64;
        }
        
        .timeline-btn.playing {
            background: #ff6b6b;
        }
        
        .timeline-slider-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .timeline-slider {
            width: 100%;
            height: 6px;
            -webkit-appearance: none;
            background: #1a3050;
            border-radius: 3px;
            outline: none;
        }
        
        .timeline-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            background: #64ffda;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0,0,0,0.3);
        }
        
        .timeline-labels {
            display: flex;
            justify-content: space-between;
            font-size: 10px;
            color: #8892b0;
        }
        
        .timeline-current {
            font-size: 14px;
            font-weight: 600;
            color: #64ffda;
            min-width: 100px;
            text-align: center;
        }
        
        .timeline-speed {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: #8892b0;
        }
        
        .timeline-speed select {
            background: #1a3050;
            border: none;
            color: #fff;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
        }
        
        /* Loading */
        .loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(26, 26, 46, 0.95);
            color: #fff;
            padding: 24px 32px;
            border-radius: 12px;
            z-index: 2000;
            text-align: center;
        }
        
        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid #1a3050;
            border-top-color: #64ffda;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 12px;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: #8892b0;
        }
        
        .empty-state-icon {
            font-size: 48px;
            margin-bottom: 12px;
            opacity: 0.5;
        }
        
        .empty-state-text {
            font-size: 13px;
        }
        
        /* Scrollbar */
        .tab-content::-webkit-scrollbar,
        .search-results::-webkit-scrollbar {
            width: 6px;
        }
        
        .tab-content::-webkit-scrollbar-track,
        .search-results::-webkit-scrollbar-track {
            background: #233f64;
        }
        
        .tab-content::-webkit-scrollbar-thumb,
        .search-results::-webkit-scrollbar-thumb {
            background: #1a3050;
            border-radius: 3px;
        }
        
        /* Potree Viewer */
        .potree-viewer-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 10000;
        }
        
        .potree-viewer-overlay.visible {
            display: flex;
            flex-direction: column;
        }
        
        .potree-viewer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 20px;
            background: #233f64;
            color: white;
        }
        
        .potree-viewer-title {
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .potree-viewer-close {
            background: #ff6b6b;
            border: none;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
        }
        
        .potree-viewer-container {
            flex: 1;
            position: relative;
            background: #1a1a2e;
        }
        
        #potree-render-area {
            width: 100%;
            height: 100%;
        }
        
        .potree-viewer-info {
            position: absolute;
            bottom: 20px;
            left: 20px;
            background: rgba(35, 63, 100, 0.9);
            padding: 12px 16px;
            border-radius: 8px;
            color: white;
            font-size: 12px;
        }
        
        .potree-viewer-controls {
            position: absolute;
            top: 20px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .potree-control-btn {
            background: rgba(35, 63, 100, 0.9);
            border: 1px solid #3d5a80;
            color: white;
            padding: 10px 14px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }
        
        .potree-control-btn:hover {
            background: #3d5a80;
        }

        /* Fullscreen Button */
        .fullscreen-btn {
            background: rgba(35, 63, 100, 0.9);
            border: 1px solid rgba(100, 255, 218, 0.3);
            color: #64ffda;
            width: 50px;
            height: 50px;
            border-radius: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            transition: all 0.2s;
            margin-left: 8px;
        }
        
        .fullscreen-btn:hover {
            background: rgba(100, 255, 218, 0.2);
            border-color: #64ffda;
            transform: scale(1.05);
        }
        
        .fullscreen-btn.active {
            background: #64ffda;
            color: #0a192f;
        }

        /* Hide UI in fullscreen mode */
        body.map-fullscreen:hover 
        /* Activity Feed */
        .activity-feed {
            position: absolute;
            top: 160px;
            left: 16px;
            background: rgba(35, 63, 100, 0.95);
            border-radius: 12px;
            z-index: 1001;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            min-width: 320px;
            max-width: 400px;
            transition: left 0.3s, top 0.3s;
            overflow: hidden;
            display: block;
            border: 2px solid red;
        }
        
        .activity-feed.panel-open {
            left: 420px;
        }
        
        .activity-feed-header {
            padding: 10px 14px;
            background: rgba(26, 48, 80, 0.8);
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            border-bottom: 1px solid rgba(100, 255, 218, 0.1);
        }
        
        .activity-feed-header:hover {
            background: rgba(26, 48, 80, 1);
        }
        
        .activity-feed-title {
            font-size: 11px;
            color: #64ffda;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .activity-feed-toggle {
            background: none;
            border: none;
            color: #8b9dc3;
            cursor: pointer;
            font-size: 10px;
            padding: 2px 6px;
            transition: transform 0.3s;
        }
        
        .activity-feed-toggle.collapsed {
            transform: rotate(-90deg);
        }
        
        .activity-feed-list {
            max-height: 250px;
            overflow-y: auto;
            padding: 8px;
            transition: max-height 0.3s ease;
        }
        
        .activity-feed-list.collapsed {
            max-height: 0;
            padding: 0 8px;
            overflow: hidden;
        }
        
        .activity-feed-empty {
            text-align: center;
            color: #8b9dc3;
            font-size: 11px;
            padding: 15px;
        }
        
        .activity-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 8px 10px;
            background: rgba(26, 48, 80, 0.5);
            border-radius: 8px;
            margin-bottom: 6px;
            animation: slideIn 0.3s ease;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(-10px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        
        .activity-item:last-child {
            margin-bottom: 0;
        }
        
        .activity-item-icon {
            font-size: 16px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
        }
        
        .activity-item-content {
            flex: 1;
            min-width: 0;
        }
        
        .activity-item-text {
            font-size: 12px;
            color: #ccd6f6;
            line-height: 1.4;
        }
        
        .activity-item-text strong {
            color: #64ffda;
        }
        
        .activity-item-time {
            font-size: 10px;
            color: #8b9dc3;
            margin-top: 2px;
        }
        
        .activity-item.new {
            background: rgba(100, 255, 218, 0.1);
            border-left: 2px solid #64ffda;
        }
        
        /* Scrollbar per activity feed */
        .activity-feed-list::-webkit-scrollbar {
            width: 4px;
        }
        
        .activity-feed-list::-webkit-scrollbar-track {
            background: rgba(0,0,0,0.1);
            border-radius: 2px;
        }
        
        .activity-feed-list::-webkit-scrollbar-thumb {
            background: #64ffda;
            border-radius: 2px;
        }

/* ============================================================================
   AUTENTICAZIONE
   ============================================================================ */

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 200px;
    height: 200px;
    margin-bottom: 10px;
}

.login-header h1 {
    color: #fff;
    font-size: 28px;
    margin: 0 0 8px 0;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.login-overlay .form-group {
    margin-bottom: 20px;
}

.login-overlay .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-size: 14px;
}

.login-overlay .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.login-overlay .form-group input:focus {
    outline: none;
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 0.15);
}

.login-overlay .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #ff8a80;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4fc3f7 0%, #2196f3 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(79, 195, 247, 0.3);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    margin-top: 25px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* User Indicator */
.user-indicator {
    position: relative;
    background: rgba(35, 63, 100, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 12px 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-role-icon {
    font-size: 18px;
}

.user-name {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.user-menu-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.user-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(35, 63, 100, 0.98);
    border-radius: 10px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    z-index: 100;
}

.user-menu.visible {
    display: block;
}

.user-menu button {
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.user-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hide GeoServer from sidebar catalog (moved to project modal) */
#catalog-geoserver {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* GeoServer accordion in project modal */
.modal-geoserver-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px;
    overflow-y: auto;
    max-height: 40%;
}

.modal-geoserver-section .project-list-header {
    padding: 8px 6px;
    border-bottom: none;
}

.gs-accordion-item {
    margin-bottom: 4px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(100, 150, 255, 0.15);
    background: #1a3050;
}

.gs-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.gs-accordion-header:hover {
    background: rgba(30, 80, 160, 0.4);
}

.gs-accordion-icon {
    width: 28px;
    height: 28px;
    background: #2d6cdf;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.gs-accordion-info {
    flex: 1;
    min-width: 0;
}

.gs-accordion-name {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-accordion-meta {
    color: rgba(255,255,255,0.45);
    font-size: 10px;
}

.gs-accordion-arrow {
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.gs-accordion-item.expanded .gs-accordion-arrow {
    transform: rotate(90deg);
}

.gs-accordion-item.expanded .gs-accordion-header {
    background: rgba(30, 80, 160, 0.3);
    border-bottom: 1px solid rgba(100, 150, 255, 0.1);
}

.gs-accordion-body {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.gs-accordion-item.expanded .gs-accordion-body {
    display: block;
}

.gs-accordion-layer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.gs-accordion-layer:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

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

.gs-accordion-layer-add {
    color: #64ffda;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
    margin-left: 6px;
}

.gs-accordion-layer:hover .gs-accordion-layer-add {
    opacity: 1;
}

.gs-accordion-loading {
    text-align: center;
    padding: 12px;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
}

/* Add Panel Overlay in Modal */
.modal-add-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #152840;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-add-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-add-panel-header h4 {
    margin: 0;
    color: #64ffda;
    font-size: 14px;
    font-weight: 600;
}

.modal-add-panel-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-add-panel-close:hover {
    color: #fff;
}

.modal-add-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.modal-add-section h5 {
    color: #8b9dc3;
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.modal-add-panel .form-group {
    margin-bottom: 10px;
}

.modal-add-panel .form-group label {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    margin-bottom: 4px;
}

.modal-add-panel .form-group input,
.modal-add-panel .form-group select {
    width: 100%;
    padding: 7px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-add-panel .form-group input:focus,
.modal-add-panel .form-group select:focus {
    outline: none;
    border-color: rgba(100, 255, 218, 0.4);
}

/* Make modal-left relative for absolute overlay - already set above */

/* Style Management */
.style-list {
    max-height: 250px;
    overflow-y: auto;
}

.style-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 5px;
    margin-bottom: 2px;
    transition: background 0.15s;
}

.style-list-item:hover {
    background: rgba(255,255,255,0.06);
}

.style-list-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.style-list-name {
    font-size: 12px;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.style-ws-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(100,150,255,0.15);
    color: #7eb3ff;
    white-space: nowrap;
}

.style-ws-badge.global {
    background: rgba(255,255,255,0.06);
    color: #8b9dc3;
}

.style-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.style-action-btn:hover {
    opacity: 1;
}

.style-empty {
    text-align: center;
    padding: 12px;
    color: rgba(255,255,255,0.3);
    font-size: 11px;
}

.style-sld-preview {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 8px;
    font-size: 10px;
    color: #8b9dc3;
    max-height: 150px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
}

/* Layer Style Picker Popup */
.layer-style-picker {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-style-picker-inner {
    background: #1a2d47;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    width: 380px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.layer-style-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.layer-style-picker-header h4 {
    margin: 0;
    color: #fff;
    font-size: 14px;
}

.layer-style-picker-header button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.layer-style-picker-header button:hover {
    color: #fff;
}

.layer-style-picker-current {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.layer-style-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 350px;
}

.style-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 3px;
    transition: background 0.15s;
}

.style-picker-item:hover {
    background: rgba(255,255,255,0.06);
}

.style-picker-item.current {
    background: rgba(100,255,218,0.08);
    border: 1px solid rgba(100,255,218,0.2);
}

.style-picker-name {
    flex: 1;
    font-size: 12px;
    color: #e0e0e0;
}

.style-picker-ws {
    font-size: 9px;
    color: #8b9dc3;
    padding: 1px 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
}

.style-picker-check {
    color: #64ffda;
    font-size: 14px;
    font-weight: bold;
}

.style-picker-apply {
    padding: 3px 10px;
    background: rgba(100,255,218,0.1);
    border: 1px solid rgba(100,255,218,0.3);
    border-radius: 4px;
    color: #64ffda;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.style-picker-apply:hover {
    background: rgba(100,255,218,0.2);
}

/* Style button in project file actions */
.project-file-btn.style-btn {
    opacity: 0.7;
}

.project-file-btn.style-btn:hover {
    opacity: 1;
}

/* Admin Panel */
.admin-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.admin-panel {
    background: #1a2744;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-panel-header h2 {
    color: #fff;
    margin: 0;
    font-size: 20px;
}

.admin-panel-header .close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.admin-panel-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-panel-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.admin-section {
    margin-bottom: 24px;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-section-header h3 {
    color: #fff;
    margin: 0;
    font-size: 16px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card.current-user {
    border-color: #4fc3f7;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-card-icon {
    font-size: 24px;
}

.user-card-info {
    flex: 1;
}

.user-card-name {
    color: #fff;
    font-weight: 500;
}

.user-card-email {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.user-card-role {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.user-card-permissions {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 12px;
}

.permission-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
    margin: 4px 4px 0 0;
    font-size: 12px;
}

.permission-badge.can-edit {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.permission-badge.view-only {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}

.no-permissions {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.user-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-card-actions button {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.user-card-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-card-actions button.btn-danger {
    background: rgba(244, 67, 54, 0.2);
    color: #ff8a80;
}

.user-card-actions button.btn-danger:hover {
    background: rgba(244, 67, 54, 0.3);
}

/* Modal Form */
.modal-form {
    max-width: 500px;
    margin: 0 auto;
}

.modal-form h3 {
    color: #fff;
    margin: 0 0 20px 0;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    font-size: 14px;
}

.modal-form .form-group input,
.modal-form .form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-form .form-group input:focus,
.modal-form .form-group select:focus {
    outline: none;
    border-color: #4fc3f7;
}

.modal-form .form-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-form .form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-form .form-actions button:first-child {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, #4fc3f7 0%, #2196f3 100%) !important;
    color: #fff !important;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

/* Permissions Grid */
.permissions-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    max-height: 300px;
    overflow-y: auto;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.permission-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    cursor: pointer;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.perm-edit-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6) !important;
}

.perm-edit-label input:disabled {
    opacity: 0.4;
}

/* Profile Panel */
.profile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.profile-panel {
    background: #1a2744;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.profile-header {
    text-align: center;
    padding: 30px 24px 20px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.profile-header .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

.profile-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.profile-header h2 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 22px;
}

.profile-role {
    color: #4fc3f7;
    font-size: 14px;
}

.profile-content {
    padding: 24px;
}

.profile-content .form-group {
    margin-bottom: 16px;
}

.profile-content .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    font-size: 14px;
}

.profile-content .form-group input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.profile-content .form-group input:focus {
    outline: none;
    border-color: #4fc3f7;
}

.profile-content .form-group input:disabled {
    opacity: 0.6;
}

.profile-content .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.profile-content .form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.profile-content .form-actions button:first-child {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Hide elements based on role */
.edit-only, .admin-only {
    /* Will be controlled by JS */
}

/* ================================================================
   GEOSERVER UPLOAD SUB-MODAL
   Aggiungere alla fine di styles.css
   ================================================================ */

/* Overlay per sub-modal */
.geoserver-upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 47, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.geoserver-upload-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.geoserver-upload-modal {
    background: var(--card-bg, #112240);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.geoserver-upload-overlay.visible .geoserver-upload-modal {
    transform: scale(1);
}

/* Header */
.geoserver-upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(26, 48, 80, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.geoserver-upload-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #64ffda;
    display: flex;
    align-items: center;
    gap: 10px;
}

.geoserver-upload-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.geoserver-upload-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Body */
.geoserver-upload-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Form Groups */
.gs-form-group {
    margin-bottom: 20px;
}

.gs-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #e6f1ff;
}

.gs-form-group small {
    display: block;
    font-size: 0.8rem;
    color: #8892b0;
    margin-top: 4px;
}

.gs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gs-form-input,
.gs-form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(26, 48, 80, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e6f1ff;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gs-form-input:focus,
.gs-form-textarea:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.gs-form-input::placeholder,
.gs-form-textarea::placeholder {
    color: #8892b0;
    opacity: 0.6;
}

.gs-form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Drop Zone */
.gs-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(26, 48, 80, 0.4);
}

.gs-drop-zone:hover,
.gs-drop-zone.dragover {
    border-color: #64ffda;
    background: rgba(100, 255, 218, 0.05);
}

.gs-drop-zone.has-file {
    border-color: #6bcf7f;
    background: rgba(107, 207, 127, 0.1);
}

.gs-drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.gs-drop-zone-text {
    font-size: 1rem;
    color: #e6f1ff;
    margin-bottom: 8px;
}

.gs-drop-zone-hint {
    font-size: 0.85rem;
    color: #8892b0;
}

.gs-drop-zone input[type="file"] {
    display: none;
}

/* File Info */
.gs-file-info {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(26, 48, 80, 0.6);
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 12px;
}

.gs-file-info.visible {
    display: flex;
}

.gs-file-info-icon {
    font-size: 1.5rem;
}

.gs-file-info-details {
    flex: 1;
}

.gs-file-info-name {
    color: #64ffda;
    font-weight: 500;
    font-size: 0.95rem;
}

.gs-file-info-size {
    color: #8892b0;
    font-size: 0.85rem;
}

.gs-file-info-remove {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.gs-file-info-remove:hover {
    background: rgba(255, 107, 107, 0.2);
}

/* Checkbox */
.gs-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #e6f1ff;
}

.gs-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #64ffda;
}

/* Time Options (Image Mosaic) */
.gs-time-options {
    margin-top: 16px;
    padding: 16px;
    background: rgba(100, 255, 218, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    display: none;
}

.gs-time-options.visible {
    display: block;
}

.gs-time-options .info-text {
    font-size: 0.85rem;
    color: #8892b0;
    line-height: 1.5;
}

.gs-time-options code {
    background: rgba(26, 48, 80, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #64ffda;
}

/* Buttons */
.gs-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gs-btn-primary {
    background: #64ffda;
    color: #0a192f;
}

.gs-btn-primary:hover:not(:disabled) {
    background: #4fd1b0;
}

.gs-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gs-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e6f1ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gs-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.gs-btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 20px;
    padding: 14px 24px;
}

/* Progress */
.gs-progress-container {
    display: none;
    margin-top: 20px;
}

.gs-progress-container.visible {
    display: block;
}

.gs-progress-title {
    font-size: 0.95rem;
    color: #e6f1ff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gs-progress-bar-wrapper {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.gs-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #64ffda, #4fd1b0);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}

.gs-progress-text {
    font-size: 0.85rem;
    color: #8892b0;
    margin-top: 8px;
    text-align: center;
}

/* Status Messages */
.gs-status {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    display: none;
    align-items: center;
    gap: 10px;
}

.gs-status.visible {
    display: flex;
}

.gs-status.success {
    background: rgba(107, 207, 127, 0.15);
    border: 1px solid rgba(107, 207, 127, 0.3);
    color: #6bcf7f;
}

.gs-status.error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.gs-status-icon {
    font-size: 1.2rem;
}

.gs-status-text {
    flex: 1;
    font-size: 0.9rem;
}

/* Workspace Badge */
.gs-workspace-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64ffda;
    margin-bottom: 20px;
}

.gs-workspace-badge-icon {
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .geoserver-upload-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .gs-form-row {
        grid-template-columns: 1fr;
    }
    
    .geoserver-upload-body {
        padding: 16px;
    }
}

.project-section-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.project-section-badge.geoserver {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.geoserver-layer .project-file-icon {
    color: #64ffda;
}

.project-section-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.project-section-badge.geoserver {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.geoserver-layer .project-file-icon {
    color: #64ffda;
}

/* Project Info Header Inline - Aggiungere a styles.css */

.project-info-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-status-badge.active {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.project-status-badge.inactive {
    background: rgba(255, 255, 255, 0.08);
    color: #8892b0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.project-btn-small {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.project-btn-small.primary {
    background: #64ffda;
    color: #0a192f;
}

.project-btn-small.primary:hover {
    background: #4fd1b0;
}

/* Project Info Header Inline - Aggiungere a styles.css */

.project-info-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-status-badge.active {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.project-status-badge.inactive {
    background: rgba(255, 255, 255, 0.08);
    color: #8892b0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.project-btn-small {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.project-btn-small.primary {
    background: #64ffda;
    color: #0a192f;
}

.project-btn-small.primary:hover {
    background: #4fd1b0;
}

/* ============================================
   DANGER ZONE - Eliminazione Progetto
   ============================================ */

.project-danger-zone {
    margin-top: 32px;
}

.project-danger-box {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.project-danger-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.project-danger-icon {
    font-size: 1.3rem;
}

.project-danger-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ff5252;
}

.project-danger-text {
    font-size: 0.9rem;
    color: #a8b2d1;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.project-danger-text strong {
    color: #ff8a80;
}

.project-btn-danger {
    background: transparent;
    border: 1px solid #ff5252;
    color: #ff5252;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.project-btn-danger:hover {
    background: rgba(255, 82, 82, 0.15);
    border-color: #ff8a80;
    color: #ff8a80;
}

.project-danger-note {
    font-size: 0.85rem;
    color: #8892b0;
    font-style: italic;
    margin: 0;
}

/* Project Info Header Inline - Aggiungere a styles.css */

.project-info-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-status-badge.active {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.project-status-badge.inactive {
    background: rgba(255, 255, 255, 0.08);
    color: #8892b0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.project-btn-small {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.project-btn-small.primary {
    background: #64ffda;
    color: #0a192f;
}

.project-btn-small.primary:hover {
    background: #4fd1b0;
}

/* ============================================
   DANGER ZONE - Eliminazione Progetto
   ============================================ */

.project-danger-zone {
    margin-top: 32px;
}

.project-danger-box {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.project-danger-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.project-danger-icon {
    font-size: 1.3rem;
}

.project-danger-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ff5252;
}

.project-danger-text {
    font-size: 0.9rem;
    color: #a8b2d1;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.project-danger-text strong {
    color: #ff8a80;
}

.project-btn-danger {
    background: transparent;
    border: 1px solid #ff5252;
    color: #ff5252;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.project-btn-danger:hover {
    background: rgba(255, 82, 82, 0.15);
    border-color: #ff8a80;
    color: #ff8a80;
}

.project-danger-note {
    font-size: 0.85rem;
    color: #8892b0;
    font-style: italic;
    margin: 0;
}

/* ============================================
   CONVERSION STATUS - Spinner e stati
   ============================================ */

.project-file-item.converting {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.project-file-status.processing {
    color: #ffc107;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-spinner {
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.project-file-btn.convert {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.project-file-btn.convert:hover {
    background: rgba(255, 193, 7, 0.25);
}

/* CRS Options per ASC upload */
#gs-crs-options {
    display: none;
    margin-top: 15px;
}

#gs-crs-options.visible {
    display: block;
}

#gs-optimize-options {
    display: none;
    margin-top: 15px;
    background: rgba(0, 255, 170, 0.05);
    border: 1px solid rgba(0, 255, 170, 0.15);
    border-radius: 8px;
    padding: 12px 14px;
}

#gs-optimize-options.visible {
    display: block;
}

/* ========================================================================
   KML MANAGER - Stili CSS
   ======================================================================== */

/* Drag & drop indicator */
#map.kml-drag-over {
    outline: 3px dashed #00d4aa;
    outline-offset: -10px;
}

#map.kml-drag-over::after {
    content: '📍 Rilascia per caricare KML/KMZ';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 212, 170, 0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    pointer-events: none;
}

/* KML Popup styling */
.kml-popup {
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
}

.kml-popup strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.kml-popup p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 12px;
}

.kml-popup div small {
    color: #888;
}

/* Sezione KML nel progetto */
.project-section-buttons {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Badge per layer KML temporanei */
.layer-badge-temp {
    background: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 8px;
}/* ========================================
   FIX COMPLETO: Modal Gestione Utenti / Permessi
   AGGIUNGI QUESTI STILI ALLA FINE DI styles.css
   ======================================== */

/* ===== SEZIONE PERMESSI - CONTENITORE ===== */
.permissions-section {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.permissions-section:last-of-type {
    margin-bottom: 0;
}

/* ===== TITOLI SEZIONI (h4) ===== */
.permissions-section h4,
.modal-form h4 {
    color: #4fc3f7;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Secondo h4 nella stessa sezione */
.permissions-section h4:not(:first-child) {
    margin-top: 20px;
}

/* ===== TITOLO PRINCIPALE MODAL ===== */
.modal-form h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== GRIGLIA PERMESSI VEGA MOBILE/WEB ===== */
.vega-permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (max-width: 500px) {
    .vega-permissions-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CHECKBOX PERMESSI ===== */
.perm-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.perm-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
}

.perm-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4fc3f7;
    flex-shrink: 0;
}

.perm-checkbox span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.3;
}

.perm-checkbox:has(input:checked) {
    background: rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.4);
}

.perm-checkbox:has(input:checked) span {
    color: #fff;
}

/* ===== SOTTOTITOLO PROGETTI ===== */
.permissions-section p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin: 0 0 12px 0;
}

/* ===== GRIGLIA PROGETTI ===== */
.permissions-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

/* ===== SINGOLO PROGETTO ===== */
.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
}

.permission-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Label nome progetto */
.permission-item > label:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.permission-item > label:first-child input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4fc3f7;
    flex-shrink: 0;
}

/* Label "Può modificare" */
.perm-edit-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-left: 12px;
    transition: all 0.2s;
}

.perm-edit-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.perm-edit-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #81c784;
}

.perm-edit-label input[type="checkbox"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.perm-edit-label:has(input:checked) {
    background: rgba(129, 199, 132, 0.2);
    color: #81c784;
}

/* Progetto selezionato */
.permission-item:has(.perm-access:checked) {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
}

/* ===== SCROLLBAR PERSONALIZZATA ===== */
.permissions-grid::-webkit-scrollbar {
    width: 6px;
}

.permissions-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.permissions-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.permissions-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== PULSANTI AZIONI ===== */
.modal-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-form .form-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-form .form-actions button:first-child {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.modal-form .form-actions button:first-child:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ===== FIX UPLOAD PROGRESS MODAL ===== */
.upload-progress-details {
    text-align: left;
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.6;
}

.upload-progress-details div {
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== FIX CONVERSION PROGRESS ===== */
.conversion-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4fc3f7;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.conversion-substatus {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 16px;
}

/* ===== UPLOAD DEM DIALOG ===== */
.upload-dem-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.upload-dem-dialog {
    background: #2a2a3a;
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.upload-dem-dialog h3 {
    margin: 0 0 16px;
    font-size: 18px;
}

.upload-dem-form .form-group {
    margin-bottom: 12px;
}

.upload-dem-form label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
}

.upload-dem-form input,
.upload-dem-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.upload-dem-form input[type="file"] {
    padding: 6px;
}

.upload-dem-form select {
    cursor: pointer;
}

.upload-dem-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.upload-dem-actions .btn-cancel {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.upload-dem-actions .btn-primary {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: #4fc3f7;
    color: #000;
    cursor: pointer;
    font-weight: 600;
}

/* DEM Type Badges */
.dem-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dem-type-badge.dem { background: rgba(76, 175, 80, 0.3); color: #66bb6a; }
.dem-type-badge.dsm { background: rgba(255, 152, 0, 0.3); color: #ffa726; }
.dem-type-badge.dtm { background: rgba(33, 150, 243, 0.3); color: #42a5f5; }
.dem-type-badge.chm { background: rgba(156, 39, 176, 0.3); color: #ab47bc; }

.project-file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.project-file-source {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

/* ============================================================================
   PS-InSAR Popup
   ============================================================================ */

#ps-insar-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    max-width: 520px;
    width: 90vw;
    animation: psPopupIn 0.2s ease-out;
}

@keyframes psPopupIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ps-popup-inner {
    background: rgba(20, 27, 55, 0.97);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.ps-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(100, 255, 218, 0.08);
    border-bottom: 1px solid rgba(100, 255, 218, 0.15);
}

.ps-popup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e8ecf1;
    font-size: 13px;
}

.ps-vel-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.ps-popup-close {
    background: none;
    border: none;
    color: #8b9dc3;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.ps-popup-close:hover { color: #ff6b6b; }

.ps-popup-info {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.ps-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.ps-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.ps-info-label {
    font-size: 9px;
    color: #8b9dc3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ps-info-value {
    font-size: 13px;
    color: #e8ecf1;
    font-weight: 600;
}

.ps-popup-chart {
    padding: 8px 10px;
    height: 220px;
}

.ps-popup-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.ps-popup-footer {
    padding: 6px 14px;
    text-align: center;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

/* GeoServer badges placeholder */
.gs-badges-placeholder {
    display: inline;
}
.gs-badges-placeholder .project-preview-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 1px 2px;
}

/* User Avatar Button (top-right) */
.user-avatar-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1000;
}

.user-avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #233f64;
    border: 2px solid rgba(100,255,218,0.25);
    color: #64ffda;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.user-avatar-circle:hover {
    background: #1a3050;
    filter: brightness(1.2);
    transform: scale(1.08);
}

.user-avatar-dropdown {
    display: none;
    position: absolute;
    top: 52px;
    right: 0;
    min-width: 220px;
    background: #1a2d47;
    border: 1px solid rgba(100,255,218,0.15);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    overflow: hidden;
    z-index: 9999;
}

.user-avatar-dropdown.visible {
    display: block;
    animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-avatar-dropdown-header {
    padding: 14px 16px 10px;
}

.user-avatar-dropdown-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.user-avatar-dropdown-role {
    color: #64ffda;
    font-size: 12px;
    margin-top: 2px;
}

.user-avatar-dropdown-divider {
    height: 1px;
    background: rgba(100,255,218,0.1);
    margin: 0 12px;
}

.user-avatar-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    color: #c8d6e5;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.user-avatar-dropdown-btn:hover {
    background: rgba(100,255,218,0.08);
    color: #fff;
}

.user-avatar-dropdown-btn.logout {
    color: #ff6b6b;
}

.user-avatar-dropdown-btn.logout:hover {
    background: rgba(255,107,107,0.1);
}

.user-avatar-dropdown-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* =====================================================
   PROJECT TABS UI - Stile Schedario / Folder Tabs
   ===================================================== */

/* Tab Navigation Bar - Schedario */
.project-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin-bottom: 0;
    position: relative;
    bottom: -1px;          /* overlap col bordo del pannello */
    z-index: 1;
    padding-left: 4px;
    padding-top: 6px;
}

/* Singola linguetta - icon above text */
.project-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px 5px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px 10px 0 0;
    color: rgba(255,255,255,0.4);
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-right: 1px;
    position: relative;
    top: 4px;
    min-width: 52px;
}

.project-tab-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.12);
    top: 2px;
}

/* Linguetta attiva - si alza e si fonde col pannello */
.project-tab-btn.active {
    background: rgba(30, 40, 55, 0.95);
    border-color: rgba(100,255,218,0.25);
    border-bottom-color: rgba(30, 40, 55, 0.95);
    color: #64ffda;
    top: 0;
    padding-bottom: 8px;
    z-index: 2;
}

.tab-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tab-icon svg {
    width: 22px;
    height: 22px;
}

.tab-label {
    pointer-events: none;
    font-size: 9.5px;
    line-height: 1;
}

/* Tab Badge - top right corner */
.tab-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: rgba(100,255,218,0.15);
    color: #64ffda;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1;
}

.tab-badge:empty {
    display: none;
}

/* GeoServer loading pulse */
.tab-badge.gs-loading {
    display: flex;
    width: 16px;
    min-width: 16px;
    background: rgba(255,255,255,0.08);
    animation: tabBadgePulse 1.5s ease-in-out infinite;
}

.tab-badge.gs-loading:empty {
    display: flex;
}

@keyframes tabBadgePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Area contenuto pannelli - bordo che "accoglie" la linguetta */
.project-tabs-content {
    min-height: 120px;
    border: 1px solid rgba(100,255,218,0.15);
    border-radius: 0 8px 8px 8px;
    background: rgba(30, 40, 55, 0.5);
    padding: 14px;
    position: relative;
}

/* Tab Panels */
.project-tab-panel {
    display: none;
    animation: tabPanelFadeIn 0.15s ease;
}

.project-tab-panel.active {
    display: block;
}

@keyframes tabPanelFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tab Panel Header */
.tab-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 10px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}

.tab-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

/* GeoServer loading placeholder */
.gs-loading-ph {
    font-style: italic;
    opacity: 0.5;
}

/* Sidebar: badge conteggio totale layer */
.project-badge.layer-count {
    background: rgba(100,149,237,0.12);
    color: rgba(100,149,237,0.9);
    font-size: 11px;
}

.project-badge.layer-count:empty {
    display: none;
}

/* Modal list: badge totale layer */
.project-preview-badge.layer-total {
    background: rgba(100,149,237,0.12);
    color: rgba(100,149,237,0.9);
}

.project-preview-badge.layer-total:empty {
    display: none;
}

/* Footer Zona Pericolosa - fisso in fondo al modale */
.project-modal-footer {
    padding: 10px 24px;
    border-top: 1px solid rgba(255, 80, 80, 0.15);
    background: rgba(255, 50, 50, 0.04);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.project-btn-danger-compact {
    padding: 6px 16px;
    background: rgba(255, 80, 80, 0.12);
    border: 1px solid rgba(255, 80, 80, 0.25);
    border-radius: 6px;
    color: #ff6b6b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-btn-danger-compact:hover {
    background: rgba(255, 80, 80, 0.25);
    border-color: rgba(255, 80, 80, 0.5);
    color: #ff4444;
}

/* ========== ACTIVITY PANEL TABS ========== */
.activity-panel-tabs {
    display: flex;
    align-items: center;
    background: #1a3050;
    border-bottom: 1px solid #3d5a80;
    border-radius: 12px 0 0 0;
    flex-shrink: 0;
    padding: 0;
}

.activity-panel-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #8b9dc3;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    text-align: center;
}

.activity-panel-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.activity-panel-tab.active {
    color: #64ffda;
    border-bottom-color: #64ffda;
    background: rgba(100, 255, 218, 0.08);
}

.activity-panel-tabs .activity-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 12px 16px;
    flex-shrink: 0;
}

.activity-panel-tabs .activity-panel-close:hover {
    opacity: 1;
}

/* Tab Content */
.activity-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.activity-tab-content.active {
    display: flex;
}

/* ========== LOG TAB ========== */
.activity-log-header {
    padding: 10px 16px;
    border-bottom: 1px solid #3d5a80;
    flex-shrink: 0;
}

.activity-log-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.log-filter-select {
    flex: 1;
    padding: 6px 10px;
    background: #1a3050;
    color: #fff;
    border: 1px solid #3d5a80;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.log-filter-select:focus {
    border-color: #64ffda;
}

.log-filter-select option {
    background: #1a3050;
    color: #fff;
}

.log-refresh-btn {
    background: none;
    border: 1px solid #3d5a80;
    color: #8b9dc3;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.log-refresh-btn:hover {
    border-color: #64ffda;
    color: #64ffda;
}

/* Log List */
.activity-log-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Log Entry */
.log-entry {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(61, 90, 128, 0.3);
    transition: background 0.2s;
}

.log-entry:hover {
    background: rgba(255,255,255,0.03);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.9;
}

.log-entry-content {
    flex: 1;
    min-width: 0;
}

.log-entry-text {
    font-size: 12px;
    color: #e0e6ed;
    line-height: 1.4;
    word-break: break-word;
}

.log-entry-text strong {
    color: #fff;
}

.log-entry-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 10px;
    color: #6b7c93;
}

.log-entry-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.log-entry-time {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Status badge nel log */
.log-status {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.log-status-aperta {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.log-status-in_volo {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.log-status-chiusa {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.log-status-assegnata {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.log-status-accettata {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.log-status-rifiutata {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

.log-status-completata {
    background: rgba(100, 255, 218, 0.2);
    color: #64ffda;
}

/* Load More */
.activity-log-load-more {
    padding: 10px 16px;
    text-align: center;
    flex-shrink: 0;
}

.log-load-more-btn {
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid #3d5a80;
    color: #64ffda;
    padding: 6px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.log-load-more-btn:hover {
    background: rgba(100, 255, 218, 0.2);
    border-color: #64ffda;
}

        /* ============================================================
           UNIFIED BOTTOM BAR (coords + tools)
           ============================================================ */
        .bottom-bar {
            position: absolute;
            bottom: 12px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 0;
            background: rgba(22, 48, 80, 0.92);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            padding: 5px 14px;
            border-radius: 14px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            border: 1px solid rgba(100, 255, 218, 0.08);
            z-index: 100;
            transition: bottom 0.3s, left 0.3s ease;
            white-space: nowrap;
        }
        
        .bottom-bar.timeline-open {
            bottom: 120px;
        }
        
        /* Quando il pannello laterale è aperto, sposta la bottom-bar a destra
           in modo che rimanga centrata nello spazio visibile della mappa.
           Il pannello è largo 340px, quindi il centro è (viewport-340)/2 + 340 */
        body:has(#layer-panel.open) .bottom-bar {
            left: calc(50% + 170px);
        }
        
        .bb-divider {
            width: 1px;
            height: 28px;
            background: rgba(255,255,255,0.12);
            margin: 0 10px;
            flex-shrink: 0;
        }
        
        /* Coords section */
        .bb-coords {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }
        
        .bb-coord-item {
            color: #6b7c93;
            font-size: 10px;
            letter-spacing: 0.3px;
        }
        
        .bb-coord-val {
            color: #a8c4db;
            font-size: 11px;
            font-weight: 500;
            font-variant-numeric: tabular-nums;
            font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
        }
        
        .bb-scale {
            display: flex;
            align-items: center;
            gap: 4px;
            margin-left: 2px;
        }
        
        .bb-scale-line {
            height: 6px;
            border-top: 1.5px solid #6b7c93;
            border-left: 1.5px solid #6b7c93;
            border-right: 1.5px solid #6b7c93;
            min-width: 40px;
        }
        
        .bb-scale-label {
            color: #6b7c93;
            font-size: 10px;
        }
        
        /* Tools section - reuses map-tools styling */
        .bb-tools-group {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .bb-tools-label {
            font-size: 9px;
            color: #8b9dc3;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-right: 2px;
        }
        
        .bb-tool-btn {
            width: 38px;
            height: 38px;
            background: #1a3050;
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
        }
        
        .bb-tool-btn:hover {
            background: #2a4a70;
            transform: scale(1.08);
        }
        
        .bb-tool-btn.active {
            background: #64ffda;
            color: #233f64;
        }
        
        .bb-tool-btn.measure-btn.active {
            background: #feca57;
            color: #233f64;
        }
        
        /* Hide old bars */
        .map-tools-bar {
            display: none !important;
        }
        
        .info-panel {
            display: none !important;
        }
        
        /* Responsive: nascondi scala quando poco spazio */
        @media (max-width: 1000px) {
            .bb-scale {
                display: none;
            }
        }
        
        /* Nascondi lat/lon/elev su viewport strette */
        @media (max-width: 860px) {
            .bb-coords {
                display: none;
            }
            .bb-coords + .bb-divider {
                display: none;
            }
        }
        
        /* Su viewport strette anche con pannello aperto: se lo spazio residuo
           dopo il pannello (340px) è troppo poco, nascondi le coordinate.
           1200 - 340 = 860px di spazio utile per la barra. */
        @media (max-width: 1200px) {
            body:has(#layer-panel.open) .bb-coords,
            body:has(#layer-panel.open) .bb-coords + .bb-divider,
            body:has(#layer-panel.open) .bb-scale {
                display: none;
            }
        }


/* =============================================================
   VEGA sub-roles: Coordinamento / Operatore
   ============================================================= */

/* ── Pannello registrazione Operatore UAS ─────────────────── */
.operatore-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.operatore-panel {
    background: #1a1a2e;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 100%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    margin: auto;
}

.operatore-header {
    padding: 22px 26px 14px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.operatore-header h2 { margin: 0 0 6px; color: #e2e8f0; font-size: 18px; }
.operatore-header p  { margin: 0; font-size: 13px; color: #94a3b8; line-height: 1.5; }

.operatore-body {
    padding: 18px 26px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 200px);
}

.operatore-footer {
    padding: 14px 26px;
    border-top: 1px solid #334155;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #1a1a2e;
    border-radius: 0 0 12px 12px;
}

.op-section {
    margin-bottom: 26px;
    padding-bottom: 22px;
    border-bottom: 1px solid #1e293b;
}
.op-section:last-child { border-bottom: none; margin-bottom: 0; }
.op-section h3 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.op-hint {
    font-size: 12px;
    color: #64748b;
    margin: -8px 0 12px;
    line-height: 1.4;
}

.op-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.op-row input,
.op-row select {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 13px;
    min-width: 0;
}
.op-row input:focus,
.op-row select:focus {
    outline: none;
    border-color: #60a5fa;
}

.op-uas-row {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.op-attivita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 6px;
}
.op-attivita-grid .perm-checkbox { font-size: 13px; align-items: flex-start; }

/* Sub-role group animation */
#new-subrole-group,
#edit-subrole-group {
    transition: opacity 0.15s ease;
}

/* =============================================================
   CoordinamentoPanel + OperatorePanel styles
   ============================================================= */
.coord-op-details {
    margin-top: 10px;
    padding: 10px 0 4px;
    border-top: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.coord-op-row {
    display: flex;
    gap: 10px;
    font-size: 12px;
    align-items: baseline;
}
.coord-op-label {
    color: #60a5fa;
    font-weight: 600;
    white-space: nowrap;
    min-width: 160px;
}
.coord-op-value {
    color: #cbd5e1;
    flex: 1;
}

/* Pannello registrazione Operatore UAS */
.operatore-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.operatore-panel {
    background: #1a1a2e;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 100%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    margin: auto;
}
.operatore-header {
    padding: 22px 26px 14px;
    border-bottom: 1px solid #334155;
}
.operatore-header h2 { margin: 0 0 6px; color: #e2e8f0; font-size: 18px; }
.operatore-header p  { margin: 0; font-size: 13px; color: #94a3b8; line-height: 1.5; }
.operatore-body {
    padding: 18px 26px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}
.operatore-footer {
    padding: 14px 26px;
    border-top: 1px solid #334155;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #1a1a2e;
    border-radius: 0 0 12px 12px;
}
.op-section {
    margin-bottom: 26px;
    padding-bottom: 22px;
    border-bottom: 1px solid #1e293b;
}
.op-section:last-child { border-bottom: none; margin-bottom: 0; }
.op-section h3 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.op-hint { font-size: 12px; color: #64748b; margin: -8px 0 12px; line-height: 1.4; }
.op-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.op-row input, .op-row select {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 13px;
    min-width: 0;
}
.op-row input:focus, .op-row select:focus { outline: none; border-color: #60a5fa; }
.op-uas-row {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.op-attivita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 6px;
}
.op-attivita-grid .perm-checkbox { font-size: 13px; align-items: flex-start; }
#new-subrole-group, #edit-subrole-group { transition: opacity 0.15s ease; }

/* coord-op-persona: riga singola persona/UAS nei dettagli operatore */
.coord-op-persona {
    font-size: 12px;
    color: #cbd5e1;
    padding: 2px 0;
    line-height: 1.5;
}
.coord-op-persona strong {
    color: #e2e8f0;
}

/* ── D-Flight UAS GeoZones ─────────────────────────────────── */
.mappe-utili-section {
    border-top: 1px solid #1a3050;
    padding-top: 12px;
}

.dflight-zone-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dflight-row {
    display: flex;
    align-items: center;
}

.dflight-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dflight-status {
    font-size: 11px;
    color: #8892b0;
    flex: 1;
}

.dflight-delete-btn {
    background: none;
    border: 1px solid rgba(255,82,82,0.4);
    color: #ff5252;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.dflight-delete-btn:hover {
    background: rgba(255,82,82,0.15);
    border-color: #ff5252;
}

.dflight-upload-row {
    display: flex;
}

.dflight-upload-btn {
    flex: 1;
    padding: 6px 12px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.3);
    color: #64ffda;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.dflight-upload-btn:hover {
    background: rgba(100, 255, 218, 0.2);
    border-color: #64ffda;
}

.dflight-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dflight-hint {
    font-size: 10px;
    color: #5a6888;
    line-height: 1.4;
}

.dflight-hint a {
    color: #64ffda;
    text-decoration: none;
}

.dflight-hint a:hover {
    text-decoration: underline;
}

.dflight-legend {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.dflight-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #8892b0;
}

.dflight-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ══════════════════════════════════════════════════════════════
   Aggiungere alla fine di styles.css
   ══════════════════════════════════════════════════════════════ */

/* ── MapLibre Popup Override (VEGA dark theme) ─────────────── */
.maplibregl-popup-content {
    background: #1a3050 !important;
    color: #ccd6f6 !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    border: 1px solid #233f64 !important;
    max-width: 320px;
}

.maplibregl-popup-close-button {
    color: #8892b0 !important;
    font-size: 20px !important;
    right: 6px !important;
    top: 6px !important;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maplibregl-popup-close-button:hover {
    color: #64ffda !important;
    background: rgba(100,255,218,0.1) !important;
    border-radius: 4px;
}

.maplibregl-popup-tip {
    border-top-color: #1a3050 !important;
    border-bottom-color: #1a3050 !important;
}

/* Anchor bottom */
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: #1a3050 !important;
}

/* Anchor top */
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
    border-bottom-color: #1a3050 !important;
}

/* Anchor left */
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #1a3050 !important;
}

/* Anchor right */
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #1a3050 !important;
}

/* ── VEGA Mobile Popup (operazioni, segnalazioni, missioni, annotazioni) ── */
/* Override più specifico del globale: il content è trasparente perché la
   card dark (#233f64) è dentro l'HTML inline del popup. */
.maplibregl-popup.vega-mobile-popup .maplibregl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 12px !important;
    max-width: none;
}

.maplibregl-popup.vega-mobile-popup .maplibregl-popup-tip {
    display: none !important;
}

.maplibregl-popup.vega-mobile-popup .maplibregl-popup-close-button {
    color: #ccd6f6 !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 26px !important;
    padding: 0 !important;
    top: 10px !important;
    right: 10px !important;
    border-radius: 50% !important;
    background: rgba(26, 48, 80, 0.7) !important;
    transition: all 0.15s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maplibregl-popup.vega-mobile-popup .maplibregl-popup-close-button:hover {
    background: rgba(100, 255, 218, 0.2) !important;
    color: #64ffda !important;
}

/* Popup inner styling */
.vega-popup-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #233f64;
}

.vega-popup-row {
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #8892b0;
}

.vega-popup-row b {
    color: #ccd6f6;
    font-weight: 600;
}

.vega-popup-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.vega-popup-note {
    margin-top: 8px;
    padding: 8px;
    background: rgba(100,255,218,0.05);
    border-radius: 6px;
    font-size: 11px;
    color: #5a6888;
    border: 1px solid #233f64;
}

/* ── Accordion per Mappe Utili ─────────────────────────────── */
.mappe-utili-accordion {
    border-top: 1px solid #1a3050;
    margin-top: 6px;
    padding-top: 6px;
}

.mappe-utili-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.mappe-utili-accordion-header:hover {
    opacity: 0.85;
}

.mappe-utili-accordion-arrow {
    font-size: 10px;
    color: #5a6888;
    transition: transform 0.2s;
    margin-left: 6px;
}

.mappe-utili-accordion.open .mappe-utili-accordion-arrow {
    transform: rotate(90deg);
}

.mappe-utili-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.mappe-utili-accordion.open .mappe-utili-accordion-body {
    max-height: 500px;
}

/* Testo lungo nei popup VEGA: scroll interno in tema scuro */
.vega-scroll-text {
    scrollbar-width: thin;
    scrollbar-color: #3a5a8a transparent;
}
.vega-scroll-text::-webkit-scrollbar {
    width: 6px;
}
.vega-scroll-text::-webkit-scrollbar-track {
    background: transparent;
}
.vega-scroll-text::-webkit-scrollbar-thumb {
    background: #3a5a8a;
    border-radius: 3px;
}
.vega-scroll-text::-webkit-scrollbar-thumb:hover {
    background: #4d6fa3;
}
