        /* ==================== VARIABILI CSS ==================== */
        :root {
            --primary-color: #f21d52;
            --secondary-color: #c41642;
            --dark-bg: #0a0e27;
            --panel-bg: rgba(15, 23, 42, 0.95);
            --glass-bg: rgba(255, 255, 255, 0.05);
            --border-color: rgba(255, 255, 255, 0.1);
            --text-primary: #ffffff;
            --text-secondary: #94a3b8;
            --accent-gradient: linear-gradient(135deg, #f21d52 0%, #c41642 100%);
            --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
            --transition-speed: 0.3s;
            --border-radius: 16px;
            --border-radius-sm: 8px;
        }

        /* ==================== RESET E BASE ==================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: var(--dark-bg);
            color: var(--text-primary);
            overflow: hidden;
            height: 100vh;
        }

        /* ==================== BACKGROUND ANIMATO ==================== */
        .bg-animated {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(circle at 20% 50%, rgba(242, 29, 82, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(196, 22, 66, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(242, 29, 82, 0.05) 0%, transparent 50%);
            z-index: -1;
        }

        /* ==================== HEADER ==================== */
        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 2rem;
            background: var(--panel-bg);
            border-bottom: 1px solid var(--border-color);
            backdrop-filter: blur(20px);
            height: 70px;
            position: relative;
            z-index: 100;
        }

        .logo-section {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .logo {
            width: 45px;
            height: 45px;
            background: var(--accent-gradient);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(242, 29, 82, 0.4);
        }

        .logo i {
            font-size: 24px;
            color: white;
        }

        .app-title {
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, #ffffff 0%, var(--primary-color) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -0.5px;
        }

        .header-controls {
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        /* ==================== BOTTONI ==================== */
        .control-btn,
        .icon-btn {
            background: var(--glass-bg);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            cursor: pointer;
            transition: all var(--transition-speed) ease;
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .control-btn {
            padding: 0.6rem 1.2rem;
            border-radius: var(--border-radius-sm);
            font-size: 0.9rem;
            gap: 0.5rem;
        }

        .icon-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            color: var(--text-secondary);
        }

        .control-btn:hover,
        .icon-btn:hover {
            background: rgba(242, 29, 82, 0.2);
            border-color: var(--primary-color);
            color: var(--primary-color);
            transform: translateY(-2px);
        }

        .control-btn.active {
            background: var(--accent-gradient);
            border-color: var(--primary-color);
        }

        /* ==================== LAYOUT PRINCIPALE ==================== */
        .main-container {
            display: flex;
            height: calc(100vh - 70px - 60px);
            gap: 1rem;
            padding: 1rem;
            position: relative;
        }

        /* ==================== PANNELLI BASE ==================== */
        .panel {
            background: var(--panel-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-lg);
            backdrop-filter: blur(20px);
            display: flex;
            flex-direction: column;
            transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 2000;
            overflow: visible;
        }

        .panel-header {
            padding: 1rem 1.5rem;
            background: rgba(255, 255, 255, 0.02);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-height: 60px;
        }

        .panel-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .panel-title i {
            color: var(--primary-color);
        }

        .panel-actions {
            display: flex;
            gap: 0.5rem;
        }

        .panel-content {
            height: calc(100% - 60px);
            position: relative;
        }

        /* ==================== SIDEBAR ==================== */
        .sidebar {
            width: 280px;
        }

        .sidebar-header {
            padding: 1rem 1.5rem;
            background: rgba(255, 255, 255, 0.02);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-height: 60px;
            flex-direction: row-reverse;
        }

        .sidebar-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .sidebar-title i {
            color: var(--primary-color);
        }

        .sidebar-content {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }

        /* ==================== COLLAPSED STATES ==================== */
        .sidebar.collapsed,
        .map-panel.collapsed {
            width: 60px;
            overflow: visible;
        }

        .sidebar.collapsed .sidebar-title,
        .sidebar.collapsed .sidebar-content,
        .map-panel.collapsed .panel-title,
        .map-panel.collapsed .panel-content {
            display: none !important;
        }

        .sidebar.collapsed .panel-actions button:not(.toggle-sidebar),
        .map-panel.collapsed .panel-actions button:not(.toggle-map) {
            display: none !important;
        }

        .sidebar.collapsed .sidebar-header,
        .map-panel.collapsed .panel-header {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0.5rem;
            height: 60px;
            min-height: 60px;
        }

        .sidebar.collapsed .toggle-sidebar,
        .map-panel.collapsed .toggle-map {
            width: 32px;
            height: 32px;
            border-radius: 6px;
        }

        /* ==================== NAVIGAZIONE TAB ==================== */
        .nav-tabs {
            display: flex;
            gap: 0.5rem;
            padding: 1rem;
            border-bottom: 1px solid var(--border-color);
            background: rgba(255, 255, 255, 0.02);
        }

        .nav-tab {
            flex: 1;
            padding: 0.75rem;
            background: var(--glass-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-sm);
            cursor: pointer;
            transition: all var(--transition-speed) ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
        }

        .nav-tab:hover {
            background: rgba(242, 29, 82, 0.1);
            border-color: var(--primary-color);
            color: var(--text-primary);
        }

        .nav-tab.active {
            background: rgba(242, 29, 82, 0.2);
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .nav-tab i {
            font-size: 1.2rem;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* ==================== TREE SEARCH ==================== */
        .tree-search {
            width: 100%;
            padding: 0.65rem 1rem;
            background: var(--glass-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-sm);
            color: var(--text-primary);
            font-size: 0.85rem;
            margin-bottom: 1rem;
            transition: all var(--transition-speed) ease;
        }

        .tree-search:focus {
            outline: none;
            border-color: var(--primary-color);
            background: rgba(242, 29, 82, 0.05);
        }

        .tree-search::placeholder {
            color: var(--text-secondary);
        }

        /* ==================== FILE TREE ==================== */
        .file-tree {
            padding: 0;
        }

        .tree-folder {
            margin-bottom: 0.25rem;
            user-select: none;
        }

        .tree-folder-header {
            padding: 0.5rem 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            border-radius: var(--border-radius-sm);
            transition: all var(--transition-speed) ease;
        }

        .tree-folder-header:hover {
            background: rgba(242, 29, 82, 0.08);
        }

        .tree-folder.expanded > .tree-folder-header {
            background: rgba(242, 29, 82, 0.05);
        }

        .tree-chevron {
            width: 14px;
            height: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            transition: transform 0.2s ease;
        }

        .tree-folder.expanded > .tree-folder-header .tree-chevron {
            transform: rotate(90deg);
        }

        .tree-folder-icon {
            font-size: 0.95rem;
            color: var(--text-secondary);
            transition: color var(--transition-speed) ease;
        }

        .tree-folder.expanded > .tree-folder-header .tree-folder-icon {
            color: var(--primary-color);
        }

        .tree-folder:not(.expanded) .tree-folder-icon.fa-folder-open::before {
            content: '\f07b';
        }

        .tree-folder-label {
            font-size: 0.85rem;
            color: var(--text-primary);
            font-weight: 500;
            flex: 1;
        }

        .tree-folder-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            padding-left: 1.25rem;
        }

        .tree-folder.expanded > .tree-folder-content {
            max-height: 2000px;
            padding-top: 0.25rem;
        }

        .tree-file {
            padding: 0.5rem 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            border-radius: var(--border-radius-sm);
            transition: all var(--transition-speed) ease;
            margin-bottom: 0.15rem;
            position: relative;
        }

        .tree-file:hover {
            background: rgba(242, 29, 82, 0.1);
        }

        .tree-file.active {
            background: rgba(242, 29, 82, 0.2);
        }

        .tree-file.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: var(--primary-color);
            border-radius: 0 2px 2px 0;
        }

        .tree-file-icon {
            font-size: 0.9rem;
            color: var(--text-secondary);
            width: 16px;
            transition: color var(--transition-speed) ease;
        }

        .tree-file.active .tree-file-icon {
            color: var(--primary-color);
        }

        .tree-file[data-type="map"] .tree-file-icon {
            color: #10b981;
        }

        .tree-file[data-type="3d"] .tree-file-icon {
            color: #3b82f6;
        }

        .tree-file[data-type="360"] .tree-file-icon {
            color: #f59e0b;
        }

        .tree-file.active[data-type="map"] .tree-file-icon,
        .tree-file.active[data-type="3d"] .tree-file-icon,
        .tree-file.active[data-type="360"] .tree-file-icon {
            color: var(--primary-color);
        }

        .tree-file-label {
            font-size: 0.85rem;
            color: var(--text-primary);
            flex: 1;
        }

        .tree-file-badge {
            font-size: 0.7rem;
            padding: 0.15rem 0.4rem;
            background: rgba(242, 29, 82, 0.15);
            color: var(--primary-color);
            border-radius: 3px;
            font-weight: 500;
        }

        /* ==================== CHECKBOX STYLING ==================== */
        .filter-checkbox {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: var(--primary-color);
        }

        .filter-label {
            cursor: pointer;
            flex: 1;
            margin-left: 0.5rem;
            font-size: 0.85rem;
            color: var(--text-primary);
            user-select: none;
        }

        .tree-file.filter-item,
        .tree-file.model-item {
            cursor: default;
        }

        .tree-file.filter-item:hover,
        .tree-file.model-item:hover {
            background: rgba(242, 29, 82, 0.05);
        }

        .tree-file.model-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .tree-file.model-item .tree-file-icon {
            margin-left: 0.5rem;
        }

        .tree-file.model-item .tree-file-badge {
            margin-left: auto;
        }

        /* ==================== VIEWER PANEL ==================== */
        .viewer-panel {
            flex: 1;
        }

        /* ==================== MAP PANEL ==================== */
        .map-panel {
            width: 400px;
        }

        .panel-header.invert {
            flex-direction: row-reverse;
        }

        /* ==================== IFRAME ==================== */
        iframe {
            width: 100%;
            height: 100%;
            border: none;
            background: #000;
            border-radius: 0 0 var(--border-radius) var(--border-radius);
        }

        /* ==================== MODAL ==================== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(10, 14, 39, 0.95);
            backdrop-filter: blur(10px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3000;
            opacity: 0;
            transition: opacity var(--transition-speed) ease;
        }

        .modal-overlay.active {
            display: flex;
            opacity: 1;
        }

        .modal-content {
            width: 90vw;
            height: 80vh;
            max-width: 1400px;
            background: var(--panel-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: var(--shadow-lg);
            position: relative;
            transform: scale(0.9);
            transition: transform var(--transition-speed) ease;
        }

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

        .modal-header {
            padding: 1rem 1.5rem;
            background: rgba(255, 255, 255, 0.02);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .modal-title i {
            color: var(--primary-color);
        }

        .close-modal {
            width: 36px;
            height: 36px;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-sm);
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all var(--transition-speed) ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .close-modal:hover {
            background: rgba(242, 29, 82, 0.2);
            color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .modal-body {
            height: calc(100% - 70px);
            background: #000;
        }

        /* ==================== DATA MODAL ==================== */
        .data-modal-body {
            height: calc(100% - 70px);
            background: var(--dark-bg);
            padding: 2rem;
            overflow-y: auto;
        }

        .data-content {
            max-width: 900px;
            margin: 0 auto;
            color: var(--text-primary);
            line-height: 1.8;
        }

        .data-content h1 {
            font-size: 2rem;
            color: var(--text-primary);
            margin-bottom: 1.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--primary-color);
        }

        .data-content h2 {
            font-size: 1.5rem;
            color: var(--text-primary);
            margin-top: 2rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .data-content h2 i {
            color: var(--primary-color);
        }

        .data-content h3 {
            font-size: 1.2rem;
            color: var(--text-primary);
            margin-top: 1.5rem;
            margin-bottom: 0.8rem;
        }

        .data-content p {
            margin-bottom: 1rem;
            color: var(--text-secondary);
        }

        .data-content ul, .data-content ol {
            margin-left: 2rem;
            margin-bottom: 1rem;
            color: var(--text-secondary);
        }

        .data-content li {
            margin-bottom: 0.5rem;
        }

        .data-content code {
            background: rgba(242, 29, 82, 0.1);
            color: var(--primary-color);
            padding: 0.2rem 0.4rem;
            border-radius: 4px;
            font-family: 'Monaco', 'Courier New', monospace;
            font-size: 0.9em;
        }

        .data-content pre {
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-sm);
            padding: 1rem;
            overflow-x: auto;
            margin-bottom: 1rem;
        }

        .data-content pre code {
            background: none;
            padding: 0;
            color: #e2e8f0;
        }

        .data-content table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 1.5rem;
            background: rgba(255, 255, 255, 0.02);
            border-radius: var(--border-radius-sm);
            overflow: hidden;
        }

        .data-content th {
            background: rgba(242, 29, 82, 0.2);
            color: var(--text-primary);
            padding: 0.8rem;
            text-align: left;
            font-weight: 600;
        }

        .data-content td {
            padding: 0.8rem;
            border-top: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .data-content tr:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .data-content blockquote {
            border-left: 4px solid var(--primary-color);
            padding-left: 1rem;
            margin: 1.5rem 0;
            color: var(--text-secondary);
            font-style: italic;
        }

        .data-content a {
            color: var(--primary-color);
            text-decoration: none;
            transition: all var(--transition-speed) ease;
        }

        .data-content a:hover {
            color: var(--secondary-color);
            text-decoration: underline;
        }

        .data-modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .data-modal-body::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }

        .data-modal-body::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 4px;
        }

        .data-modal-body::-webkit-scrollbar-thumb:hover {
            background: var(--secondary-color);
        }

        /* ==================== FOOTER ==================== */
        .footer {
            height: 60px;
            background: var(--panel-bg);
            border-top: 1px solid var(--border-color);
            backdrop-filter: blur(20px);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2rem;
            position: relative;
            z-index: 2000;
        }

        .footer-info {
            display: flex;
            align-items: center;
            gap: 2rem;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .footer-link {
            color: var(--text-secondary);
            text-decoration: none;
            transition: color var(--transition-speed) ease;
        }

        .footer-link:hover {
            color: var(--primary-color);
        }

        .footer-social {
            display: flex;
            gap: 1rem;
        }

        .social-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--glass-bg);
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all var(--transition-speed) ease;
            text-decoration: none;
        }

        .social-btn:hover {
            background: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
            transform: translateY(-3px);
        }

        /* ==================== TOOLTIP ==================== */
        .tooltip {
            position: relative;
        }

        .tooltip::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            padding: 0.5rem 0.8rem;
            background: rgba(0, 0, 0, 0.9);
            color: white;
            font-size: 0.75rem;
            border-radius: 6px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity var(--transition-speed) ease;
            margin-bottom: 0.5rem;
            z-index: 9999;
        }

        .tooltip:hover::after {
            opacity: 1;
        }

        /* ==================== VIEWER CONTENT & EMPTY STATE ==================== */
        #viewer-content {
            width: 100%;
            height: 100%;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #viewer-content .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1.5rem;
            width: 100%;
            height: 100%;
            text-align: center;
            padding: 2rem;
        }

        #viewer-content .empty-state i {
            font-size: 5rem;
            color: var(--primary-color);
            opacity: 0.6;
            animation: pulse 2s ease-in-out infinite;
        }

        #viewer-content .empty-state p {
            font-size: 1.1rem;
            color: var(--text-secondary);
            max-width: 400px;
            line-height: 1.6;
        }

        @keyframes pulse {
            0%, 100% {
                opacity: 0.4;
                transform: scale(1);
            }
            50% {
                opacity: 0.8;
                transform: scale(1.05);
            }
        }

        /* ==================== SCROLLBAR ==================== */
        .sidebar-content::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar-content::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }

        .sidebar-content::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 3px;
        }

        .sidebar-content::-webkit-scrollbar-thumb:hover {
            background: var(--secondary-color);
        }

        /* ==================== RESPONSIVE ==================== */
        @media (max-width: 1024px) {
            .sidebar {
                width: 240px;
            }
            .map-panel {
                width: 320px;
            }
        }

        @media (max-width: 768px) {
            .main-container {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                height: auto;
                max-height: 200px;
            }

            .map-panel {
                width: 100%;
                height: 300px;
            }

            .map-panel.collapsed {
                height: 60px;
                width: 100%;
            }

            .header {
                padding: 1rem;
            }

            .app-title {
                font-size: 1.2rem;
            }

            .footer-info {
                gap: 1rem;
                font-size: 0.75rem;
            }
        }