* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            background: linear-gradient(145deg, #0F172A 0%, #1E293B 50%, #334155 100%);
            overflow: hidden;
            height: 100vh;
            color: #F8FAFC;
        }

        .container {
            display: grid;
            grid-template-columns: 380px 1fr 420px;
            height: 100vh;
            gap: 12px;
            padding: 12px;
        }

        .panel {
            background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.9));
            border-radius: 20px;
            padding: 24px;
            box-shadow: 
                0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(148, 163, 184, 0.1),
                inset 0 1px 0 rgba(148, 163, 184, 0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(148, 163, 184, 0.1);
        }

        .left-panel {
            overflow-y: auto;
            position: relative;
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
        }

        .right-panel {
            overflow-y: hidden;
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
            display: flex;
            flex-direction: column;
            padding-bottom: 10px; /* Spazio di 20px dalla base */
        }

        .map-container {
            position: relative;
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 
                0 25px 50px -12px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(148, 163, 184, 0.2),
                inset 0 1px 0 rgba(148, 163, 184, 0.1);
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        #map {
            height: 100%;
            width: 100%;
        }

        h2 {
            color: #F1F5F9;
            margin-bottom: 20px;
            font-size: 1.5em;
            font-weight: 700;
            background: linear-gradient(135deg, #06B6D4, #3B82F6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            border-bottom: 2px solid rgba(6, 182, 212, 0.3);
            padding-bottom: 8px;
        }

        h3 {
            color: #E2E8F0;
            margin-bottom: 16px;
            font-size: 1.1em;
            font-weight: 600;
        }

        /* Stili per header statistiche con pulsante info */
        .stats-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            border-bottom: 2px solid rgba(6, 182, 212, 0.3);
            padding-bottom: 8px;
            flex-shrink: 0;
        }

        .stats-title {
            color: #F1F5F9;
            font-size: 1.5em;
            font-weight: 700;
            background: linear-gradient(135deg, #06B6D4, #3B82F6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin: 0;
        }

        .info-btn {
            background: linear-gradient(135deg, #06B6D4, #3B82F6);
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            color: white;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .info-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
            background: linear-gradient(135deg, #0891B2, #2563EB);
        }

        /* Stili per il modal informativo */
        .info-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 20000;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .info-modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .info-modal {
            background: white;
            border-radius: 16px;
            padding: 24px;
            width: 90vw;
            max-width: 500px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            transform: scale(0.9);
            transition: transform 0.3s ease;
            color: #334155;
            line-height: 1.6;
        }

        .info-modal-overlay.active .info-modal {
            transform: scale(1);
        }

        .info-modal-header {
            text-align: center;
            margin-bottom: 20px;
            border-bottom: 2px solid #e2e8f0;
            padding-bottom: 16px;
            position: relative;
        }

        .info-modal-close {
            position: absolute;
            top: -8px;
            right: -8px;
            background: #ef4444;
            color: white;
            border: none;
            border-radius: 50%;
            width: 28px;
            height: 28px;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .info-modal-close:hover {
            background: #dc2626;
            transform: scale(1.1);
        }

        .info-title {
            color: #1e293b;
            font-size: 1.4em;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .info-subtitle {
            color: #64748b;
            font-size: 0.95em;
        }

        .info-feature-section {
            margin-bottom: 20px;
        }

        .info-section-title {
            color: #475569;
            font-weight: 600;
            font-size: 1.1em;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-icon {
            width: 20px;
            height: 20px;
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.8em;
            font-weight: bold;
        }

        .info-feature-list {
            list-style: none;
            padding: 0;
        }

        .info-feature-item {
            background: #f8fafc;
            padding: 10px 14px;
            margin-bottom: 8px;
            border-radius: 8px;
            border-left: 3px solid #3b82f6;
            font-size: 0.95em;
        }

        .info-highlight {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            padding: 16px;
            border-radius: 10px;
            border-left: 4px solid #3b82f6;
            margin: 16px 0;
        }

        .info-highlight-title {
            font-weight: 600;
            color: #1e40af;
            margin-bottom: 8px;
        }

        .info-data-source {
            background: #f0fdf4;
            padding: 12px;
            border-radius: 8px;
            border-left: 3px solid #22c55e;
            font-size: 0.9em;
            margin-top: 16px;
        }

        .filter-group {
            margin-bottom: 24px;
        }

        .filter-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #CBD5E1;
            font-size: 0.9em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .filter-group select, .search-filter input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid rgba(148, 163, 184, 0.3);
            border-radius: 12px;
            background: rgba(15, 23, 42, 0.8);
            color: #F1F5F9;
            font-size: 14px;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .filter-group select:focus, .search-filter input:focus {
            outline: none;
            border-color: #06B6D4;
            box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
            background: rgba(15, 23, 42, 1);
        }

        .filter-group select option {
            background: #0F172A;
            color: #F1F5F9;
        }

        /* Stili per i filtri con ricerca - MIGLIORATI */
        .search-filter {
            position: relative;
        }

        .search-filter input {
            padding-left: 40px;
            padding-right: 40px; /* Spazio extra per il clear button */
        }

        .search-filter .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #64748B;
            font-size: 14px;
            z-index: 1;
            pointer-events: none;
            transition: color 0.3s ease;
        }

        .search-filter input:focus + .search-icon {
            color: #06B6D4;
        }

        .search-filter .clear-btn {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #64748B;
            cursor: pointer;
            font-size: 14px;
            padding: 4px;
            border-radius: 4px;
            display: none;
            z-index: 1;
            transition: all 0.3s ease;
        }

        .search-filter .clear-btn:hover {
            color: #EF4444;
            background: rgba(239, 68, 68, 0.1);
            transform: translateY(-50%) scale(1.1);
        }

        .search-filter .clear-btn.show {
            display: block;
            animation: fadeInScale 0.2s ease;
        }

        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: translateY(-50%) scale(0.8);
            }
            to {
                opacity: 1;
                transform: translateY(-50%) scale(1);
            }
        }

        .filter-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: rgba(15, 23, 42, 0.98);
            border: 1px solid rgba(148, 163, 184, 0.3);
            border-radius: 12px;
            max-height: 250px; /* Aumentato per avvisi lunghi */
            overflow-y: auto;
            z-index: 1000;
            backdrop-filter: blur(20px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
            display: none;
            margin-top: 4px;
            transform: translateY(-10px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .filter-dropdown.show {
            display: block;
            transform: translateY(0);
            opacity: 1;
        }

        .filter-option {
            padding: 12px 16px;
            cursor: pointer;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
            color: #F1F5F9;
            font-size: 14px;
            transition: all 0.2s ease;
            position: relative;
            word-wrap: break-word;
            line-height: 1.4;
        }

        .filter-option:hover {
            background: rgba(6, 182, 212, 0.15);
            padding-left: 20px;
            border-left: 3px solid #06B6D4;
        }

        .filter-option:last-child {
            border-bottom: none;
        }

        .filter-option.no-results {
            color: #64748B;
            cursor: default;
            font-style: italic;
            text-align: center;
            padding: 16px;
        }

        .filter-option.no-results:hover {
            background: transparent;
            padding-left: 16px;
            border-left: none;
        }

        /* Stili specifici per dropdown avvisi lunghi */
        .filter-dropdown .filter-option[title] {
            max-height: none;
            white-space: normal;
        }

        .right-panel h3 {
            flex-shrink: 0; /* Non si comprime */
        }

        .chart-tabs {
            flex-shrink: 0; /* Non si comprime */
        }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 24px;
            flex-shrink: 0;
        }

        .stat-card {
            background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
            color: white;
            padding: 10px;
            border-radius: 16px;
            text-align: center;
            box-shadow: 
                0 20px 25px -5px rgba(6, 182, 212, 0.1),
                0 10px 10px -5px rgba(6, 182, 212, 0.04);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
            pointer-events: none;
        }

        .stat-value {
            font-size: 24px;
            font-weight: 800;
            margin-bottom: 8px;
            position: relative;
            z-index: 1;
        }

        .stat-label {
            font-size: 11px;
            opacity: 0.95;
            font-weight: 500;
            position: relative;
            z-index: 1;
        }

        .chart-container {
            margin-top: 8px;
            overflow-y: auto;
            overflow-x: hidden;
            /* Rimuoviamo max-height fisso e usiamo flex per adattarsi */
            flex: 1; /* Prende tutto lo spazio rimanente */
            min-height: 300px; /* Altezza minima per usabilità */
            background: rgba(15, 23, 42, 0.5);
            border-radius: 16px;
            padding: 16px;
            border: 1px solid rgba(148, 163, 184, 0.1);
        }

        .axis text {
            font-size: 11px;
            fill: #CBD5E1;
            font-weight: 500;
        }

        .axis-label {
            font-size: 12px;
            font-weight: 600;
            fill: #E2E8F0;
        }

        .loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(15, 23, 42, 0.95);
            padding: 32px;
            border-radius: 20px;
            z-index: 1000;
            border: 1px solid rgba(148, 163, 184, 0.2);
            backdrop-filter: blur(20px);
        }

        .loader {
            border: 4px solid rgba(148, 163, 184, 0.3);
            border-top: 4px solid #06B6D4;
            border-radius: 50%;
            width: 48px;
            height: 48px;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .tooltip {
            position: absolute;
            background: rgba(15, 23, 42, 0.95);
            color: #F1F5F9;
            padding: 12px;
            border-radius: 12px;
            font-size: 12px;
            pointer-events: none;
            z-index: 1000;
            max-width: 200px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(148, 163, 184, 0.2);
            backdrop-filter: blur(20px);
        }

        .info-panel {
            background: linear-gradient(145deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
            border: 1px solid rgba(6, 182, 212, 0.3);
            border-radius: 16px;
            padding: 20px;
            margin-top: 24px;
            display: none;
            backdrop-filter: blur(10px);
        }

        .info-panel h4 {
            color: #F1F5F9;
            margin-bottom: 16px;
            font-weight: 700;
        }

        .info-item {
            margin-bottom: 10px;
            font-size: 13px;
            color: #CBD5E1;
        }

        .info-item strong {
            color: #F1F5F9;
            font-weight: 600;
        }

        /* Stili per i pulsanti di azione */
        .action-buttons {
            display: flex;
            gap: 12px;
            margin-top: 16px;
            flex-wrap: wrap;
        }

        .reset-btn, .table-btn {
            border: none;
            padding: 12px 20px;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            font-size: 14px;
            flex: 1;
            min-width: 0;
        }

        .reset-btn {
            background: linear-gradient(135deg, #EF4444, #DC2626);
            color: white;
            box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
        }

        .reset-btn:hover {
            background: linear-gradient(135deg, #DC2626, #B91C1C);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px 0 rgba(239, 68, 68, 0.4);
        }

        .table-btn {
            background: linear-gradient(135deg, #10B981, #059669);
            color: white;
            box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
        }

        .table-btn:hover {
            background: linear-gradient(135deg, #059669, #047857);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px 0 rgba(16, 185, 129, 0.4);
        }

        /* Modal Styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .modal {
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
            border-radius: 24px;
            padding: 32px;
            width: 95vw;
            height: 85vh;
            max-width: 1200px;
            box-shadow: 
                0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(148, 163, 184, 0.2);
            border: 1px solid rgba(148, 163, 184, 0.2);
            backdrop-filter: blur(20px);
            display: flex;
            flex-direction: column;
            transform: scale(0.9);
            transition: transform 0.3s ease;
        }

        .modal-overlay.active .modal {
            transform: scale(1);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            border-bottom: 2px solid rgba(6, 182, 212, 0.3);
            padding-bottom: 16px;
        }

        .modal-title {
            color: #F1F5F9;
            font-size: 1.5em;
            font-weight: 700;
            background: linear-gradient(135deg, #06B6D4, #3B82F6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .modal-close {
            background: none;
            border: none;
            color: #EF4444;
            font-size: 24px;
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
            transition: background 0.3s ease;
        }

        .modal-close:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .modal-content {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .modal-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            gap: 16px;
            flex-wrap: wrap;
        }

        .modal-info {
            color: #CBD5E1;
            font-size: 14px;
        }

        .download-filtered-btn {
            background: linear-gradient(135deg, #3B82F6, #2563EB);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
        }

        .download-filtered-btn:hover {
            background: linear-gradient(135deg, #2563EB, #1D4ED8);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.4);
        }

        .table-container {
            flex: 1;
            overflow: auto;
            background: rgba(15, 23, 42, 0.6);
            border-radius: 16px;
            border: 1px solid rgba(148, 163, 184, 0.1);
        }

        .data-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        .data-table th {
            background: linear-gradient(135deg, #06B6D4, #3B82F6);
            color: white;
            padding: 12px 8px;
            text-align: left;
            font-weight: 600;
            position: sticky;
            top: 0;
            z-index: 1;
            cursor: pointer;
            user-select: none;
            transition: background 0.3s ease;
        }

        .data-table th:hover {
            background: linear-gradient(135deg, #0891B2, #2563EB);
        }

        .data-table th::after {
            content: '↕';
            margin-left: 8px;
            color: rgba(255, 255, 255, 0.7);
            font-size: 12px;
        }

        .data-table th.sort-asc::after {
            content: '↑';
            color: white;
        }

        .data-table th.sort-desc::after {
            content: '↓';
            color: white;
        }

        .data-table td {
            padding: 10px 8px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
            color: #E2E8F0;
            word-break: break-word;
        }

        .data-table tr:nth-child(even) {
            background: rgba(30, 41, 59, 0.3);
        }

        .data-table tr:hover {
            background: rgba(6, 182, 212, 0.1);
        }

        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin-top: 16px;
            flex-wrap: wrap;
        }

        .pagination-btn {
            background: rgba(15, 23, 42, 0.8);
            border: 1px solid rgba(148, 163, 184, 0.3);
            color: #E2E8F0;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s ease;
        }

        .pagination-btn:hover:not(:disabled) {
            background: rgba(6, 182, 212, 0.2);
            border-color: rgba(6, 182, 212, 0.5);
        }

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

        .pagination-btn.active {
            background: linear-gradient(135deg, #06B6D4, #3B82F6);
            border-color: transparent;
            color: white;
        }

        .pagination-info {
            color: #CBD5E1;
            font-size: 12px;
            margin: 0 16px;
        }

        .debug-info {
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 12px;
            padding: 16px;
            margin-top: 20px;
            font-size: 12px;
            color: #94A3B8;
            backdrop-filter: blur(10px);
            display: none;
        }

        .last-update {
            margin-top: 24px;
            padding: 16px;
            background: linear-gradient(145deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
            border-radius: 12px;
            border-left: 4px solid #06B6D4;
            backdrop-filter: blur(10px);
        }

        .last-update label {
            display: block;
            font-weight: 600;
            color: #CBD5E1;
            margin-bottom: 8px;
            font-size: 0.9em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        #lastUpdate, #lastUpdateMobile {
            font-size: 14px;
            color: #E2E8F0;
            font-weight: 500;
        }

        /* Nuovo stile per la sezione dati e licenze */
        .data-sources {
            margin-top: 24px;
            padding: 20px;
            background: linear-gradient(145deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
            border-radius: 16px;
            border-left: 4px solid #10B981;
            backdrop-filter: blur(10px);
        }

        .data-sources h4 {
            color: #F1F5F9;
            margin-bottom: 16px;
            font-weight: 700;
            font-size: 1em;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .sources-grid {
            display: grid;
            gap: 12px;
        }

        .source-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: rgba(15, 23, 42, 0.6);
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.1);
            transition: all 0.3s ease;
            text-decoration: none;
            color: inherit;
        }

        .source-item:hover {
            transform: translateY(-2px);
            background: rgba(15, 23, 42, 0.8);
            border-color: rgba(6, 182, 212, 0.3);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        }

        .source-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            color: white;
            font-size: 18px;
            flex-shrink: 0;
        }

        .github-icon {
            background: linear-gradient(135deg, #24292E, #0D1117);
        }

        .license-icon {
            background: linear-gradient(135deg, #FF6B35, #F7931E);
        }

        .download-icon {
            background: linear-gradient(135deg, #10B981, #059669);
        }

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

        .source-title {
            font-weight: 600;
            color: #F1F5F9;
            font-size: 14px;
            margin-bottom: 4px;
            line-height: 1.3;
        }

        .source-description {
            font-size: 12px;
            color: #CBD5E1;
            opacity: 0.9;
            line-height: 1.4;
        }

        .download-btn {
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
            width: 100%;
            text-align: left;
            color: inherit;
            font-family: inherit;
        }

        .download-btn:hover .source-item {
            transform: translateY(-2px);
            background: rgba(15, 23, 42, 0.8);
            border-color: rgba(16, 185, 129, 0.3);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        }

        .logo-beta {
            position: fixed;
            bottom: 24px;
            left: 24px;
            width: 80px;
            height: auto;
            z-index: 1000;
            opacity: 0.7;
            transition: opacity 0.3s ease;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
        }

        .logo-beta:hover {
            opacity: 1;
        }

        .logo-ods {
            width: 140px;
            height: auto;
            margin-bottom: 20px;
            display: block;
            filter: brightness(1.1) contrast(1.1);
        }

        .mobile-menu-toggle {
            display: none;
            position: fixed;
            top: 24px;
            left: 24px;
            z-index: 1001;
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
            border: 1px solid rgba(148, 163, 184, 0.3);
            border-radius: 16px;
            width: 56px;
            height: 56px;
            font-size: 20px;
            color: #06B6D4;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
            cursor: pointer;
            backdrop-filter: blur(20px);
            transition: all 0.3s ease;
        }

        .mobile-menu-toggle:hover {
            transform: translateY(-2px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
        }

        .mobile-menu {
            position: fixed;
            top: 0;
            left: -100vw;
            width: 90vw;
            max-width: 380px;
            height: 100vh;
            background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
            z-index: 1000;
            transition: left 0.3s ease;
            overflow-y: auto;
            padding: 80px 24px 24px;
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(20px);
            border-right: 1px solid rgba(148, 163, 184, 0.2);
        }

        .mobile-menu.active {
            left: 0;
        }

        .mobile-menu-close {
            position: absolute;
            top: 24px;
            right: 24px;
            background: none;
            border: none;
            font-size: 24px;
            color: #EF4444;
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
            transition: background 0.3s ease;
        }

        .mobile-menu-close:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .mobile-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 999;
            backdrop-filter: blur(4px);
        }

        .mobile-overlay.active {
            display: block;
        }

        /* Scrollbar personalizzata */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(30, 41, 59, 0.5);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(145deg, #06B6D4, #3B82F6);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(145deg, #0891B2, #2563EB);
        }

        /* Responsive Design */
        @media (max-width: 1400px) {
            .container {
                grid-template-columns: 350px 1fr 400px;
            }
        }

        @media (max-width: 1200px) {
            .container {
                grid-template-columns: 320px 1fr 360px;
                gap: 10px;
                padding: 10px;
            }
            
            .panel {
                padding: 20px;
            }
            
            .stats-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }
            
            .stat-card {
                padding: 16px;
            }
            
            .stat-value {
                font-size: 22px;
            }
        }

        @media (max-width: 992px) {
            body {
                overflow: visible;
            }
            
            .container {
                display: flex;
                flex-direction: column;
                height: 100vh;
                gap: 8px;
                padding: 8px;
            }
            
            .panel {
                padding: 18px;
                border-radius: 16px;
            }
            
            .left-panel {
                display: none !important;
            }
            
            .map-container {
                flex: 1;
                min-height: 0;
                height: 60vh;
            }
            
            .right-panel {
                display: block; /* Torna al layout normale su mobile */
                padding-bottom: 24px;
            }
            
            .mobile-menu-toggle {
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            
            .stat-card {
                padding: 12px;
                border-radius: 12px;
            }
            
            .stat-value {
                font-size: 18px;
            }
            
            .stat-label {
                font-size: 11px;
            }
            
            .stats-title {
                font-size: 1.3em;
            }
            
            h3 {
                font-size: 1.1em;
                margin-bottom: 12px;
            }
            
            .filter-group {
                margin-bottom: 18px;
            }
            
            .filter-group select, .search-filter input {
                padding: 10px 14px;
                font-size: 13px;
            }
            
            .chart-container {
                flex: none; /* Disabilita flex su mobile */
                max-height: 200px !important; /* Altezza fissa per mobile come era prima */
                min-height: auto;
            }

            .action-buttons {
                flex-direction: column;
            }

            .modal {
                width: 98vw;
                height: 90vh;
                padding: 20px;
            }

            .modal-actions {
                flex-direction: column;
                align-items: stretch;
            }

            .data-table {
                font-size: 11px;
            }

            .data-table th,
            .data-table td {
                padding: 8px 4px;
            }
        }

        @media (max-width: 576px) {
            .container {
                padding: 6px;
                gap: 6px;
            }
            
            .panel {
                padding: 16px;
                border-radius: 12px;
            }
            
            .map-container {
                height: 55vh;
            }
            
            .right-panel {
                height: 40vh;
            }
            
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
            }
            
            .stat-card {
                padding: 10px;
                border-radius: 10px;
            }
            
            .stat-value {
                font-size: 16px;
            }
            
            .stat-label {
                font-size: 10px;
            }
            
            .filter-group select, .search-filter input {
                padding: 8px 12px;
                font-size: 12px;
            }
            
            .info-panel {
                padding: 16px;
            }
            
            .debug-info {
                padding: 12px;
                font-size: 11px;
            }
            
            .tooltip {
                font-size: 11px;
                padding: 10px;
                max-width: 150px;
            }
            
            .mobile-menu {
                width: 95vw;
                padding: 70px 18px 18px;
                z-index: 10001;
            }
            
            .logo-beta {
                width: 60px;
            }
            
            .chart-container {
                max-height: 150px !important;
                padding: 12px;
            }

            .sources-grid {
                gap: 8px;
            }

            .source-item {
                padding: 10px;
            }

            .source-icon {
                width: 32px;
                height: 32px;
                font-size: 14px;
            }

            .source-title {
                font-size: 12px;
            }

            .source-description {
                font-size: 11px;
            }

            .modal {
                padding: 16px;
                border-radius: 16px;
            }

            .data-table {
                font-size: 10px;
            }

            .data-table th,
            .data-table td {
                padding: 6px 2px;
            }

            .pagination {
                gap: 4px;
            }

            .pagination-btn {
                padding: 6px 8px;
                font-size: 11px;
            }
        }

        /* Stile popup comune */
        .comune-popup .leaflet-popup-content-wrapper {
            background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
            border-radius: 12px;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(148, 163, 184, 0.2);
        }
        
        .comune-popup .leaflet-popup-content {
            margin: 16px;
            font-size: 13px;
            line-height: 1.4;
        }
        
        .comune-popup .leaflet-popup-tip {
            background: linear-gradient(145deg, #F8FAFC, #F1F5F9);
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        @media (pointer: coarse) {
            .filter-group select, .search-filter input {
                padding: 14px 16px;
                font-size: 16px;
            }
            
            .reset-btn, .table-btn {
                padding: 14px 24px;
                font-size: 16px;
            }
            
            .stat-card {
                min-height: 70px;
            }
            
            .mobile-menu-toggle {
                width: 64px;
                height: 64px;
                font-size: 24px;
            }
        }

        .chart-tab {
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        .chart-tab:hover {
            transform: scale(1.05);      /* Ingrandisce leggermente */
            cursor: pointer;
        }

        .chart-tab:active {
            transform: scale(0.95);      /* Effetto "press" */
        }

        /* Stili migliorati per popup comune */
        .comune-popup .leaflet-popup-content-wrapper {
            background: linear-gradient(145deg, #ffffff, #f8fafc);
            border-radius: 16px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            border: 1px solid rgba(148, 163, 184, 0.2);
            padding: 0;
        }

        .comune-popup .leaflet-popup-content {
            margin: 16px;
            font-size: 13px;
            line-height: 1.4;
            max-width: none;
            min-width: 400px;
        }

        .comune-popup .leaflet-popup-tip {
            background: linear-gradient(145deg, #ffffff, #f8fafc);
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        .comune-popup table tr:hover {
            background: #e0f2fe !important;
        }

        .comune-popup .leaflet-popup-close-button {
            background: #ef4444;
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            text-align: center;
            line-height: 24px;
            font-size: 16px;
            font-weight: bold;
            top: 8px;
            right: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .comune-popup .leaflet-popup-close-button:hover {
            background: #dc2626;
            transform: scale(1.1);
        }

        .leaflet-container a.leaflet-popup-close-button {
            color: #ffffff!important;     
            background: #ef4444!important;   
        }

        /* Stili per il controllo home personalizzato della mappa */
        .leaflet-control-custom {
            background: white;
            border: 2px solid rgba(0,0,0,0.2);
            border-radius: 4px;
            box-shadow: 0 1px 5px rgba(0,0,0,0.65);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .leaflet-control-custom:hover {
            background: #f4f4f4;
            border-color: rgba(0,0,0,0.4);
            transform: scale(1.05);
        }

        .leaflet-control-custom:active {
            background: #e8e8e8;
            transform: scale(0.95);
        }

        /* Responsive per mobile */
        @media (max-width: 768px) {
            .leaflet-control-custom {
                width: 28px !important;
                height: 28px !important;
                border-width: 1px;
            }
        }

        /* Miglioramento dell'accessibilità */
        .leaflet-control-custom:focus {
            outline: 2px solid #3b82f6;
            outline-offset: 2px;
        }

        /* Adattamento al tema scuro della mappa */
        .leaflet-control-custom {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
        }

        .leaflet-control-custom:hover {
            background: rgba(255, 255, 255, 1);
        }

        /* Miglioramenti specifici per le animazioni dei dropdown */
        .filter-dropdown {
            will-change: transform, opacity;
        }

        .filter-dropdown.show {
            animation: dropdownSlideIn 0.3s ease;
        }

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

        /* Stili per indicare il filtro attivo */
        .search-filter input:not(:placeholder-shown) {
            border-color: #06B6D4;
            background: rgba(6, 182, 212, 0.1);
        }

        .search-filter input:not(:placeholder-shown) + .search-icon {
            color: #06B6D4;
        }