
        /* Global zoom: render entire app at 75% to avoid cards being clipped */
        body {
            zoom: 0.75;
            /* compensate min-height so body covers the full visual viewport */
            min-height: calc(100vh / 0.75) !important;
        }

        /* HTML matches body background to avoid black strip when body is zoomed */
        html { background-color: #FDFDFD; }

        /* Modern HUD Color System */
        html, body {
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
            overflow-x: hidden !important;
            background-color: #FDFDFD;
            position: relative;
        }

        :root {
            --color-gold: #D4AF37;
            --color-gold-bright: #FFD700;
            --color-black: #0A0A0A;
            --color-white: #F5F5F5;

            --bg-deep: #FDFDFD;
            --bg-grid: rgba(0, 0, 0, 0.04);
            --accent-primary: var(--color-gold); 
            --accent-secondary: #000000;
            
            --text-title: #000000;
            --text-primary: #2D3748;
            --text-muted: #718096;
            
            --hud-bg-dark: rgba(255, 255, 255, 0.9);
            --hud-blur: 24px;
            --hud-border-dark: 1px solid rgba(0, 0, 0, 0.08);
            --hud-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
            
            --status-success: #10b981;
            --status-warning: #f97316;
            --status-error: #ef4444;
            
            --radius-lg: 18px;
            --radius-md: 12px;
            --radius-sm: 8px;
            --hud-offset: 70px;
            --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
        
        body {
            background-color: var(--bg-deep);
            color: var(--text-primary);
            min-height: calc(100vh / 0.75);
            background-image: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F1F5F9 100%);
            overflow-x: hidden;
        }

        /* Custom Scrollbar for the whole page */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: var(--bg-deep); }
        ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }
        ::-webkit-scrollbar-thumb:hover { background: rgba(245, 187, 0, 0.4); }

        /* ==============================
           THE BIM CANVAS (Background environment)
           ============================== */
        #bim-canvas-container {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            z-index: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            perspective: 1200px;
            overflow: hidden;
            /* Light radial gradient */
            background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F1F5F9 100%);
        }

        /* Animated 3D Grid Floor simulating engineering space */
        .grid-floor {
            position: absolute;
            width: 200vw; height: 200vh;
            background-image: 
                linear-gradient(var(--bg-grid) 1px, transparent 1px),
                linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
            background-size: 60px 60px;
            transform: rotateX(80deg) translateZ(-150px);
            transform-origin: center center;
            animation: gridMove 30s linear infinite;
            opacity: 0.8;
            box-shadow: inset 0 0 500px 200px var(--bg-deep);
        }

        @keyframes gridMove {
            0% { background-position: 0px 0px; }
            100% { background-position: 0px 500px; }
        }

        /* Refined Boxed 3D Viewer */
        #bim-canvas-container {
            width: 100%;
            height: 600px;
            position: relative;
            z-index: 1;
            overflow: hidden;
            margin-bottom: 20px;
        }
        
        /* Ensure the grid doesn't overlap the boxed viewer */
        .viewport-bg-grid {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px),
                              linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
            background-size: 60px 60px;
            transform: rotateX(80deg) translateZ(-150px);
            opacity: 0.3;
            z-index: -1;
            pointer-events: none;
        }

        /* The floating HUD layer */
        #hud-layer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 1000;
            padding: 0;
            pointer-events: none;
        }

        .main-grid {
            display: grid;
            grid-template-columns: 300px 1fr 340px;
            gap: 24px;
            width: calc(100% - 60px);
            max-width: 1800px;
            margin: 0 auto;
            padding: calc(var(--hud-offset) + 30px) 0 0;
            box-sizing: border-box;
            z-index: 5;
            align-items: stretch; /* Ensure equal height columns */
        }

        .full-width-container {
            width: calc(100% - 60px);
            max-width: 1800px;
            margin: 24px auto 80px;
            display: block;
            pointer-events: auto !important;
            z-index: 5;
        }

        /* Let Site Content be clickable below HUD */
        .main-grid, .hud-workspace, .main-container {
            pointer-events: auto !important;
        }

        /* Let HUD elements be clickable */
        .hud-panel {
            background: rgba(255, 255, 255, 0.4); /* Brighter for glass effect */
            backdrop-filter: blur(25px) saturate(180%);
            -webkit-backdrop-filter: blur(25px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-top: 1px solid rgba(255, 255, 255, 0.6);
            border-left: 1px solid rgba(255, 255, 255, 0.6);
            border-radius: 24px;
            box-shadow: 
                0 15px 35px -10px rgba(0, 0, 0, 0.1),
                inset 0 1px 1px rgba(255, 255, 255, 0.3);
            position: relative;
            transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
        }

        .hud-panel:hover {
            background: rgba(255, 255, 255, 0.5);
            box-shadow: 
                0 25px 45px -12px rgba(0, 0, 0, 0.12),
                inset 0 1px 1px rgba(255, 255, 255, 0.4);
        }

        /* Inner glow effect from ref */
        .hud-panel::after {
            content: none; /* Removed the old glow for cleaner look */
        }
        header.hud-header {
            background: var(--hud-bg-dark) !important;
            backdrop-filter: blur(var(--hud-blur)) !important;
            -webkit-backdrop-filter: blur(var(--hud-blur));
            border-bottom: var(--hud-border-dark) !important;
            border-radius: 0 !important;
            padding: 0 40px !important;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: var(--hud-shadow) !important;
            transition: var(--transition-smooth);
            pointer-events: auto;
            width: 100% !important;
            height: 70px;
            margin: 0 !important;
            box-sizing: border-box;
            z-index: 1000;
        }
        
        .brand-logo { 
            display: flex; 
            align-items: center; 
            gap: 15px; 
            cursor: pointer; 
            transition: var(--transition-smooth);
        }
        .logo-box-bg {
            background: #FFF; 
            padding: 8px; 
            border-radius: 10px; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
        .brand-logo img { width: 25px; height: 25px; object-fit: contain; }
        .brand-text { 
            font-size: 1.4rem; 
            font-weight: 900; 
            letter-spacing: -0.5px; 
            color: #1a1a1a !important; 
            text-transform: uppercase;
        }
        .brand-text span { color: var(--color-gold) !important; text-transform: lowercase; font-weight: 500; }

        .nav-container { 
            display: flex; 
            height: 70px;
            gap: 0; 
            background: transparent; 
            padding: 0; 
            border-radius: 0; 
        }
        .nav-item {
            text-transform: uppercase; 
            font-weight: 700; 
            font-size: 0.72rem; 
            letter-spacing: 0.8px; 
            padding: 0 25px; 
            color: #1a1a1a !important; 
            text-decoration: none; 
            border-radius: 0; 
            transition: var(--transition-smooth);
            border-bottom: 3px solid transparent;
            height: 70px;
            display: flex;
            align-items: center;
        }
        .nav-item:hover { color: var(--color-gold) !important; background: rgba(0,0,0,0.02); }
        .nav-item.active { 
            background: transparent !important; 
            color: var(--color-gold) !important; 
            border-bottom: 3px solid var(--color-gold);
            box-shadow: none !important;
            opacity: 1;
        }
        .hud-workspace {
            display: flex;
            justify-content: space-between;
            flex: 1;
            width: calc(100% - 80px);
            margin: 0 auto;
            position: relative;
            min-height: 80vh;
            padding-top: calc(var(--hud-offset) + 30px); /* Increased offset */
            padding-bottom: 80px;
            z-index: 5;
        }
        
        .main-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: calc(var(--hud-offset) + 40px) 20px 60px; /* Detailed HUD offset */
            box-sizing: border-box;
            position: relative;
            z-index: 5;
        }

        /* Viewport Controls (Bottom center) */
        .viewport-controls {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 10px;
            padding: 8px 16px;
            border-radius: 30px;
            z-index: 1000; /* Ensure it stays above everything */
        }

        .vp-btn {
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--hud-border);
            color: var(--text-body);
            width: 40px; height: 40px;
            border-radius: 50%;
            font-size: 1.2rem;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .vp-btn:hover { background: rgba(255,255,255,0.15); border-color: var(--accent-primary); color: var(--accent-primary); }

        /* --- LEFT SIDEBAR (Controls & Analytics lists) --- */
        .sidebar-left {
            width: 320px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            flex-shrink: 0;
            padding-bottom: 40px;
        }

        .panel-section {
            padding: 1.25rem;
        }

        .panel-title {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: var(--text-muted);
            font-weight: 700;
            margin-bottom: 1rem;
            display: flex; align-items: center; gap: 8px;
        }
        
        .panel-title::before {
            content: '';
            width: 8px; height: 8px; background: var(--accent-primary); border-radius: 50%;
            box-shadow: 0 0 8px var(--accent-primary);
        }

        /* Custom HUD selects */
        .hud-select-group { margin-bottom: 1rem; }
        .hud-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
        
        .hud-dropdown {
            width: 100%;
            background: #FFFFFF;
            border: 1px solid var(--hud-border);
            color: var(--text-title);
            padding: 10px 14px;
            border-radius: var(--radius-std);
            font-size: 0.9rem;
            font-weight: 400;
            outline: none;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 16px;
            transition: all 0.2s;
        }
        .hud-dropdown:focus { border-color: var(--accent-primary); }

        /* Action lists */
        .issue-list {
            display: flex; flex-direction: column; gap: 8px;
            /* Removed fixed max-height to let it expand naturally inside the scrollable body, or keep a larger one */
            max-height: 400px; overflow-y: auto;
            padding-right: 4px;
        }
        .issue-list::-webkit-scrollbar { width: 4px; }
        .issue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

        .issue-item {
            background: rgba(255, 255, 255, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-left: 4px solid var(--accent-primary);
            padding: 14px 16px;
            border-radius: 12px;
            font-size: 0.8rem;
            transition: all 0.3s ease;
        }
        .issue-item:hover { 
            transform: translateX(5px); 
            background: rgba(255, 255, 255, 0.8);
            box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
        }
        .issue-meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.7rem; margin-top: 6px; }


        /* --- RIGHT SIDEBAR (Core Metrics HUD) --- */
        .sidebar-right {
            width: 350px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            flex-shrink: 0;
            padding-bottom: 40px;
        }
        
        /* Metric Block Display */
        .metric-block {
            display: flex; flex-direction: column;
            padding: 1.5rem;
            position: relative;
            overflow: hidden;
        }
        
        /* Geometric accent element on corners */
        .metric-block::after {
            content: ''; position: absolute; top: 0; right: 0;
            border-top: 15px solid var(--accent-primary);
            border-left: 15px solid transparent;
            opacity: 0.8;
        }

        .metric-value-huge {
            font-family: 'Geist Mono', monospace;
            font-size: 3.5rem;
            font-weight: 700;
            letter-spacing: -2px;
            color: var(--text-title);
            line-height: 0.9;
            margin: 5px 0;
            display: flex; align-items: baseline; gap: 4px;
        }
        
        .metric-unit { font-size: 0.9rem; font-weight: 600; color: var(--accent-secondary); text-transform: uppercase; }

        /* Premium Gauge / Donut Implementation */
        .hud-flex-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
        
        .ring-container {
            width: 80px; height: 80px; position: relative;
            display: flex; align-items: center; justify-content: center;
        }
        
        /* Using SVG for crisp HUD rings */
        .hud-ring { transform: rotate(-90deg); width: 80px; height: 80px; }
        .ring-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; }
        .ring-fill { fill: none; stroke: var(--status-success); stroke-width: 6; stroke-dasharray: 200; stroke-dashoffset: 40; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease-out; }
        
        .ring-score { position: absolute; font-size: 1.2rem; font-weight: 700; color: var(--text-title); }

        /* Sleek Status Bar */
        .status-bar-bg {
            width: 100%; height: 6px; background: rgba(0,0,0,0.5);
            border-radius: 3px; margin: 12px 0 8px 0; overflow: hidden;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
        }
        .status-bar-fill {
            height: 100%; width: 85%;
            background: linear-gradient(90deg, var(--accent-primary) 0%, rgba(245, 187, 0, 0.4) 100%);
            border-radius: 3px;
            box-shadow: 0 0 10px rgba(245, 187, 0, 0.5);
        }

        .trend-tag {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 2px 8px; border-radius: 4px;
            font-size: 0.75rem; font-weight: 600;
            background: rgba(16, 185, 129, 0.15); color: var(--status-success);
            border: 1px solid rgba(16, 185, 129, 0.3);
        }
        
        .trend-tag.negative {
            background: rgba(239, 68, 68, 0.15); color: var(--status-error);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        /* --- HUD MODAL --- */
        .hud-modal-overlay {
            /* width/height compensate the 0.75 zoom on body so the overlay
               covers the FULL real viewport, not just 75% of it */
            position: fixed; top: 0; left: 0;
            width: calc(100vw / 0.75); height: calc(100vh / 0.75);
            background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(6px);
            z-index: 1000;
            display: flex; align-items: flex-start; justify-content: center;
            padding: 4vh 0;
            box-sizing: border-box;
            opacity: 0; pointer-events: none; transition: all 0.3s ease;
            overflow-y: auto;
        }
        .hud-modal-overlay.active { opacity: 1; pointer-events: auto; }

        .hud-modal {
            background: rgba(255, 255, 255, 0.82);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(0,0,0,0.06);
            box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
            border-radius: 16px;
            width: 86%; max-width: 460px;
            display: flex; flex-direction: column;
            transform: scale(0.98) translateY(10px);
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            zoom: 0.92;
        }
        .hud-modal-overlay.active .hud-modal { transform: scale(1) translateY(0); }
        
        .hud-modal-header {
            padding: 30px 40px 20px 40px;
            display: flex; justify-content: space-between; align-items: center;
        }
        .hud-modal-header h3 { font-size: 1.25rem; font-weight: 700; color: #1e293b; letter-spacing: -0.5px; }
        .hud-modal-close {
            background: none; border: none; color: #94a3b8; font-size: 1.8rem; line-height: 1;
            cursor: pointer; transition: color 0.2s; outline: none;
        }
        .hud-modal-close:hover { color: var(--status-error); }
        
        .hud-modal-content {
            padding: 0 40px 40px 40px;
            color: var(--text-primary);
        }
        .hud-modal-content::-webkit-scrollbar { width: 6px; }
        .hud-modal-content::-webkit-scrollbar-track { background: transparent; }
        .hud-modal-content::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
        .hud-modal-content::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

        /* Detail List Items inside Modal - SYNCED TO OBRAS.HTML */
        .detail-item {
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(0,0,0,0.05);
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 20px;
            display: flex;
            flex-direction: column;
            transition: all 0.2s;
            box-shadow: 0 4px 16px rgba(0,0,0,0.02);
            position: relative;
            overflow: hidden;
        }
        .detail-item:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
        
        /* Grid for Technical/Personnel details */
        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 20px;
            width: 100%;
        }

        /* Sub-RIS Tabs Styling */
        .hud-subris-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 25px;
            padding: 4px;
            background: rgba(0,0,0,0.03);
            border-radius: 10px;
            overflow-x: auto;
            scrollbar-width: none;
        }
        .hud-subris-tabs::-webkit-scrollbar { display: none; }
        
        .subris-tab {
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.7rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #64748b;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
            border: 1px solid transparent;
        }
        .subris-tab:hover { background: rgba(0,0,0,0.02); color: #1e293b; }
        .subris-tab.active {
            background: #fff;
            color: var(--accent-primary);
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            border-color: rgba(0,0,0,0.05);
        }

        .detail-info { display: flex; flex-direction: column; gap: 4px; }
        .detail-name { font-weight: 800; color: #0f172a; font-size: 1.1rem; }
        .detail-desc { font-size: 0.75rem; color: #64748b; font-weight: 500; }
        .detail-value { font-weight: 900; font-size: 1.8rem; color: #1e293b; text-align: right; }

        .modal-btn-cancel { padding: 12px 24px; border: none; background: #f1f5f9; color: #475569; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s; }
        .modal-btn-cancel:hover { background: #e2e8f0; }
        .modal-btn-submit { padding: 12px 24px; border: none; background: var(--accent-primary); color: #000; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s; }
        .modal-btn-submit:hover { opacity: 0.9; transform: translateY(-1px); }

    

/* --- OBRAS SPECIFIC --- */
        .page-title {
            font-size: 3.5rem;
            font-weight: 800;
            color: var(--text-title);
            letter-spacing: -2px;
            margin-bottom: 8px;
        }

        /* Grid specific to Obras */
        .obra-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 24px;
            padding: 20px 0;
            width: 100%;
        }

        .obra-card {
            cursor: pointer;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            border-radius: 12px;
            border: 1px solid var(--hud-border);
            padding-bottom: 20px;
        }

        /* Tabs already added */
        
        /* Audit Status Grid inside Cards */
        .audit-status-panel {
            margin-top: 15px;
            padding: 12px;
            background: rgba(0,0,0,0.02);
            border-radius: 8px;
            border: 1px dashed rgba(0,0,0,0.1);
        }
        .audit-status-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            gap: 10px;
        }
        .audit-field {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.6rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .field-ok { color: #059669; }
        .field-missing { color: #dc2626; }
        .field-icon { font-size: 0.8rem; }

        .obra-img {
            width: 100%;
            height: 140px;
            background-size: cover;
            background-position: center;
            border-bottom: 1px solid var(--hud-border);
            filter: grayscale(0.1);
            transition: 0.3s;
        }

        .obra-info {
            padding: 20px;
            flex: 1;
        }

        .obra-status {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 0.55rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 12px;
            background: var(--accent-primary);
            color: #000;
        }

        .obra-name {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 4px;
            color: var(--text-title);
        }

        .obra-desc {
            color: var(--text-muted);
            font-size: 0.75rem;
            margin-bottom: 15px;
            line-height: 1.4;
        }

        .obra-score-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid var(--bg-grid);
            padding-top: 15px;
            margin-top: auto;
        }

        .obra-score {
            font-family: 'Geist Mono', monospace;
            font-size: 1.4rem;
            color: var(--accent-primary);
            font-weight: 800;
        }

        .score-label {
            font-size: 0.6rem;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 600;
        }

        .view-btn-mini {
            display: flex; align-items: center; justify-content: center;
            width: 32px; height: 32px; border-radius: 50%;
            background: var(--accent-primary); color: #000;
            transition: 0.3s;
        }
        .obra-card:hover .view-btn-mini { transform: scale(1.1); background: #000; color: var(--accent-primary); }
        
        /* Maintenance / Integrity Button */
        .btn-maintenance {
            background: rgba(0,0,0,0.02);
            border: 1px solid rgba(0,0,0,0.1);
            color: var(--text-muted);
            padding: 10px 18px;
            border-radius: 8px;
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition-smooth);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-family: inherit;
        }
        .btn-maintenance:hover {
            background: #fff;
            border-color: var(--accent-primary);
            color: var(--accent-primary);
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
            transform: translateY(-1px);
        }
        .btn-maintenance svg { color: inherit; }
        
        .spinner-mini {
            width: 14px; height: 14px;
            border: 2px solid rgba(0,0,0,0.1);
            border-top: 2px solid var(--accent-primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { 100% { transform: rotate(360deg); } }

    

/* --- INSPECAO SPECIFIC --- */
        .main-container { width: 100%; margin: 20px auto; }
        .form-panel { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
        .section-title { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
        .section-title::before { content: ''; width: 4px; height: 20px; background: var(--accent-primary); border-radius: 2px; }
        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
        .input-group { display: flex; flex-direction: column; gap: 8px; }
        .hud-select, .hud-input { padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 6px; outline: none; transition: 0.2s; }
        .hud-select:focus, .hud-input:focus { border-color: var(--accent-primary); background: #FFF; }
        .btn-load { background: var(--accent-primary); color: #000; padding: 12px 24px; border: none; border-radius: 30px; font-weight: 700; cursor: pointer; margin-bottom: 20px; transition: 0.3s; }
        .btn-load:hover { transform: translateY(-2px); box-shadow: var(--hud-shadow); opacity: 0.9; }
        .items-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.85rem; }
        .items-table th { background: rgba(0,0,0,0.03); color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 1px; padding: 12px; text-align: left; border-bottom: 2px solid var(--hud-border); }
        .items-table td { padding: 15px 12px; border-bottom: 1px solid var(--hud-border); vertical-align: top; transition: background 0.2s; }
        .items-table tr:hover td { background: rgba(0,0,0,0.01); }

        /* RIS Totalizer Row Styling */
        .totalizer-row {
            background: rgba(245, 187, 0, 0.03) !important;
            font-weight: 700;
        }
        .totalizer-row td {
            border-top: 2px solid var(--accent-primary) !important;
            padding: 18px 12px !important;
            vertical-align: middle !important;
        }
        .ris-total-label {
            text-transform: uppercase;
            font-size: 0.7rem;
            letter-spacing: 1.5px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .ris-total-label::before {
            content: '';
            width: 8px; height: 8px;
            background: var(--accent-primary);
            border-radius: 50%;
            display: inline-block;
        }
        .ris-total-value {
            font-size: 1.3rem;
            font-family: 'Geist Mono', monospace;
            color: var(--text-title);
            font-weight: 800;
            transition: color 0.3s ease;
        }


        /* Seamless Editable Table UI */
        textarea.edit-text-field, input.edit-text-field {
            width: 100%;
            padding: 4px;
            border-radius: 6px;
            box-sizing: border-box;
            background: transparent;
            border: 1px solid transparent;
            transition: all 0.2s;
            outline: none;
            color: var(--text-primary);
            resize: none;
            overflow: hidden;
            font-family: inherit;
            line-height: 1.4;
        }
        
        textarea.edit-text-field.main-text { font-weight: 500; font-size: 0.85rem; color: #2D3748; }
        textarea.edit-text-field.subtle-text { font-size: 0.75rem; color: #718096; }
        input.item-peso-input { font-weight: 700; width: 65px; text-align: center; }

        textarea.edit-text-field:hover, input.edit-text-field:hover {
            background: rgba(0, 0, 0, 0.02);
            border-color: rgba(0, 0, 0, 0.05);
        }
        
        textarea.edit-text-field:focus, input.edit-text-field:focus {
            background: #ffffff;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 2px rgba(255, 202, 0, 0.15);
            color: #000;
        }

        .btn-remove-row {
            background: transparent;
            border: 1px solid transparent;
            color: #cbd5e1;
            padding: 8px;
            cursor: pointer;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .btn-remove-row:hover {
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.2);
            color: var(--status-error);
            transform: scale(1.05);
        }
        .btn-remove-row:active { transform: scale(0.95); }

        /* Seamless Pill Select */
        .pill-select { 
            appearance: none;
            padding: 4px 24px 4px 8px; 
            border: 1px solid transparent; 
            border-radius: 6px; 
            background-color: transparent;
            font-family: inherit;
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--text-primary);
            cursor: pointer;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 6px center;
            background-size: 14px;
            transition: all 0.2s; 
            outline: none;
        }
        .pill-select:hover { background-color: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.05); }
        .pill-select:focus { border-color: var(--accent-primary); background-color: #fff; box-shadow: 0 0 0 2px rgba(255, 202, 0, 0.15); }

        /* Premium Save Button */
        .btn-save { 
            background: #1e293b; 
            color: #ffffff; 
            padding: 14px 28px; 
            border: none; 
            border-radius: 30px; 
            font-weight: 700; 
            cursor: pointer; 
            display: flex; 
            align-items: center; 
            justify-content: center;
            gap: 10px; 
            font-size: 0.95rem;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 8px 16px rgba(0,0,0,0.1);
            margin-top: 30px;
            float: right;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .btn-save:hover { 
            background: var(--accent-primary); 
            color: #000; 
            transform: translateY(-3px); 
            box-shadow: 0 12px 24px rgba(255, 202, 0, 0.3); 
        }
        .btn-save svg { stroke-width: 2.5px; width: 18px; height: 18px; }

        .empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

/* --- PREMIUM LOGIN SECTION --- */
        .login-body {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: calc(100vh / 0.75);
            padding: 20px;
            background: radial-gradient(circle at 100% 100%, #fdfdfd 0%, #eef1f5 50%, #e2e8f0 100%) !important;
            position: relative;
            overflow: hidden;
        }

        .login-body::before {
            content: '';
            position: absolute;
            top: -100px;
            right: -100px;
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(255, 202, 0, 0.15) 0%, transparent 70%);
            border-radius: 50%;
            z-index: 1;
            filter: blur(60px);
            animation: pulse-glow 8s ease-in-out infinite alternate;
        }

        .login-card {
            background: rgba(255, 255, 255, 0.25);
            backdrop-filter: blur(40px) saturate(200%);
            -webkit-backdrop-filter: blur(40px) saturate(200%);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-top: 1px solid rgba(255, 255, 255, 0.6);
            border-left: 1px solid rgba(255, 255, 255, 0.6);
            border-radius: 40px;
            padding: 40px 35px;
            width: 100%;
            max-width: 360px;
            box-shadow: 
                0 30px 60px -12px rgba(0, 0, 0, 0.2),
                inset 0 1px 1px rgba(255, 255, 255, 0.3);
            position: relative;
            z-index: 10;
            transform: scale(0.9); /* Adds to the "mais longe" effect */
            animation: loginEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes loginEntrance {
            from { 
                opacity: 0; 
                transform: translateY(40px) scale(0.8); 
                filter: blur(15px);
            }
            to { 
                opacity: 1; 
                transform: translateY(0) scale(0.9); 
                filter: blur(0);
            }
        }

        .login-card .brand-logo {
            flex-direction: column;
            gap: 10px;
            margin-bottom: 30px;
            pointer-events: none;
            text-align: center;
            width: 100%;
            justify-content: center;
        }

        .login-card .logo-box-bg {
            width: 60px;
            height: 60px;
            margin: 0 auto;
        }

        .login-card .brand-logo img {
            width: 35px;
            height: 35px;
        }

        .login-card .brand-text {
            font-size: 2rem;
            letter-spacing: -1.5px;
            margin: 0;
        }

        .login-card .input-group {
            margin-bottom: 18px;
        }

        .login-card label {
            display: block;
            font-size: 0.65rem;
            font-weight: 800;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 8px;
            padding-left: 4px;
        }

        .login-card .input-wrapper input {
            width: 100%;
            background: rgba(0, 0, 0, 0.02);
            border: 1px solid rgba(0, 0, 0, 0.04);
            padding: 16px 20px;
            border-radius: 16px;
            font-size: 1rem;
            color: #1e293b;
            outline: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-family: inherit;
        }

        .login-card .input-wrapper input:focus {
            background: #fff;
            border-color: var(--accent-primary);
            box-shadow: 0 10px 25px rgba(255, 202, 0, 0.15), inset 0 0 0 1px var(--accent-primary);
            transform: translateY(-1px);
        }

        .login-btn {
            width: 100%;
            padding: 18px;
            background: #0f172a;
            color: #fff;
            border: none;
            border-radius: 16px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            font-size: 0.85rem;
            cursor: pointer;
            margin-top: 15px;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        .login-btn:hover {
            background: var(--accent-primary) !important;
            color: #000 !important;
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 20px 40px rgba(255, 202, 0, 0.3);
        }

        .error-message {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--status-error);
            text-align: center;
            margin-top: 25px;
            display: none;
            padding: 12px;
            background: rgba(239, 68, 68, 0.05);
            border-radius: 10px;
            border: 1px solid rgba(239, 68, 68, 0.1);
        }

        .error-message.visible {
            display: block;
            animation: fadeIn 0.3s ease forwards;
        }

        .login-card .footer-text {
            margin-top: 30px;
            text-align: center;
            font-size: 0.6rem;
            color: var(--text-muted);
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            opacity: 0.5;
        }

/* --- NEW HOME PAGE NEUMORPHISM --- */
        .home-body {
            background: radial-gradient(circle at 0% 0%, #fdfdfd 0%, #eef1f5 50%, #e2e8f0 100%) !important;
            background-size: cover !important;
            background-attachment: fixed !important;
            background-repeat: no-repeat !important;
            min-height: calc(100vh / 0.75) !important;
            width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            display: flex;
            flex-direction: column;
            overflow-x: hidden !important;
            position: relative;
        }

        /* Ambient background glow */
        .home-body::before {
            content: '';
            position: absolute;
            top: -100px;
            right: -100px;
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(255, 202, 0, 0.15) 0%, transparent 70%);
            border-radius: 50%;
            z-index: 1;
            filter: blur(60px);
            animation: pulse-glow 8s ease-in-out infinite alternate;
        }

        @keyframes pulse-glow {
            from { transform: scale(1); opacity: 0.5; }
            to { transform: scale(1.2); opacity: 0.8; }
        }

        .home-watermark {
            position: absolute;
            right: -10vw; /* Pushed further back */
            top: 50%;
            transform: translateY(-50%);
            height: 90vh; /* Scaled down from 110vh */
            max-width: 100%; /* Ensure it does not push the body width */
            opacity: 0.1; /* Slightly more subtle than 0.12 */
            pointer-events: none;
            filter: grayscale(1) brightness(0.9);
            mix-blend-mode: multiply;
            z-index: 0;
            transition: opacity 0.5s ease;
        }

        .home-splash-container {
            flex: 1;
            min-height: calc(100vh / 0.75);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: calc(var(--hud-offset) + 50px) 40px 50px; /* Adjusted HUD offset */
            position: relative;
            z-index: 10;
            width: 100%;
            box-sizing: border-box;
        }

        .home-top-title { text-align: center; margin-top: 10px; }
        .home-top-title h2 { font-size: 1rem; font-weight: 800; color: #000; letter-spacing: 2px; margin-bottom: 5px; }
        .home-top-title h3 { font-size: 0.85rem; font-weight: 400; color: #4b5563; letter-spacing: 2.5px; text-transform: uppercase; }

        .home-content-flex {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 80px;
            flex: 1;
            margin: 0 auto;
            width: 100%;
        }

        .home-buttons-col { display: flex; flex-direction: column; gap: 24px; width: 260px; }

        /* Outer Glow + Inner shadow replicating image */
        .neumorphic-btn {
            border: 1px solid rgba(255, 255, 255, 0.5);
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            padding: 12px 20px; /* Reduced from 20px 30px */
            border-radius: 12px; /* Reduced from 20px */
            font-size: 0.8rem; /* Reduced from 1rem */
            font-weight: 800;
            cursor: pointer;
            color: #1a202c;
            box-shadow: 
                0 4px 6px -1px rgba(0, 0, 0, 0.05),
                0 10px 15px -3px rgba(0, 0, 0, 0.1),
                inset 0 2px 4px rgba(255, 255, 255, 0.9);
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        .neumorphic-btn:hover {
            transform: translateY(-5px) scale(1.02);
            background: #ffffff;
            border-color: var(--accent-primary);
            box-shadow: 
                0 20px 25px -5px rgba(255, 202, 0, 0.2),
                0 10px 10px -5px rgba(255, 202, 0, 0.1);
            color: #000;
        }
        .neumorphic-btn.dark-text { color: #000; }
        .neumorphic-btn.accent-text { color: var(--accent-primary); }

        .home-center-col { 
            display: flex; 
            flex-direction: column; 
            justify-content: center; 
            align-items: center; 
            gap: 15px;
        }

        .home-center-orb {
            width: 200px; /* Reduced further from 260px */
            height: 200px; /* Reduced further from 260px */
            background: rgba(255, 255, 255, 0.4);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 
                0 25px 50px -12px rgba(0, 0, 0, 0.15),
                inset 0 2px 4px rgba(255, 255, 255, 0.8),
                inset 0 -2px 10px rgba(0, 0, 0, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.4); 
            position: relative;
            transform-style: preserve-3d;
        }

        /* Glass highlight */
        .home-center-orb::before {
            content: '';
            position: absolute;
            top: 20px;
            left: 40px;
            width: 40px;
            height: 20px;
            background: rgba(255, 255, 255, 0.4);
            border-radius: 50%;
            filter: blur(6px);
            transform: rotate(-15deg);
        }

        /* The floating bee logo */
        .home-center-orb img {
            width: 80px; /* Reduced from 110px */
            height: auto;
            position: relative;
            z-index: 2;
            filter: drop-shadow(0 15px 15px rgba(0,0,0,0.15));
            animation: float-logo 5s ease-in-out infinite;
        }

        @keyframes float-logo {
            0% { transform: translateY(0px) rotate(-2deg); }
            50% { transform: translateY(-8px) rotate(2deg); filter: drop-shadow(0 25px 25px rgba(0,0,0,0.12)); }
            100% { transform: translateY(0px) rotate(-2deg); }
        }

        .home-empty-col { width: 260px; }

        .home-bottom-logo {
            text-align: center;
            font-size: 1.8rem; /* Reduced from 2.8rem */
            font-weight: 900;
            color: #000;
            letter-spacing: -1px;
            /* Give it a slight raised impression */
            text-shadow: 2px 2px 4px rgba(0,0,0,0.05), -2px -2px 4px rgba(255,255,255,0.8);
            margin-bottom: 20px;
        }
        .home-bottom-logo span { color: var(--accent-primary); }
        .home-bottom-logo .reg-mark { font-size: 1.2rem; vertical-align: super; font-weight: 700; color: var(--accent-primary); line-height: 0; }

        @media (max-width: 900px) {
            .home-content-flex { flex-direction: column-reverse; gap: 40px; }
            .home-empty-col { display: none; }
            .home-buttons-col { width: 100%; max-width: 320px; }
            .home-center-orb { width: 260px; height: 260px; border-width: 12px; }
            .home-center-orb img { width: 100px; }
            .home-watermark { display: none; }
            .home-top-title h2 { font-size: 1.1rem; }
            .home-top-title h3 { font-size: 0.9rem; }
        }

/* --- HUD MODAL INPUTS (CLEAN DESIGN) --- */
        .hud-modal-content .form-group {
            margin-bottom: 24px;
        }

        .hud-modal-content label {
            display: block;
            font-size: 0.75rem;
            font-weight: 700;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
            padding-left: 4px;
        }

        .hud-modal-content input[type="text"],
        .hud-modal-content input[type="number"],
        .hud-modal-content select {
            width: 100%;
            background: rgba(0, 0, 0, 0.02);
            border: 1px solid rgba(0, 0, 0, 0.04);
            padding: 14px 20px;
            border-radius: 12px;
            font-size: 0.95rem;
            font-family: inherit;
            color: #1e293b;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            outline: none;
            box-sizing: border-box;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
        }

        .hud-modal-content input:hover,
        .hud-modal-content select:hover {
            background: rgba(0, 0, 0, 0.035);
            border-color: rgba(0, 0, 0, 0.08);
        }

        .hud-modal-content input:focus,
        .hud-modal-content select:focus {
            background: #ffffff;
            border-color: var(--accent-primary);
            box-shadow: 0 10px 25px rgba(255, 202, 0, 0.12), inset 0 0 0 1px var(--accent-primary);
            transform: translateY(-1px);
        }

        .hud-modal-content input::placeholder {
            color: #94a3b8;
            opacity: 0.5;
        }

        .modal-btn-submit {
            background: var(--accent-primary);
            color: #000;
            padding: 15px 32px;
            border: none;
            border-radius: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            font-family: inherit;
            font-size: 0.9rem;
            letter-spacing: 0.5px;
        }

        .modal-btn-submit:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 24px rgba(255, 202, 0, 0.3);
        }

        .modal-btn-cancel {
            background: #f1f5f9;
            color: #475569;
            padding: 15px 32px;
            border: none;
            border-radius: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            font-family: inherit;
            font-size: 0.9rem;
            margin-top: 6px;
        }

        /* ============================
           ANALYTICS SECTION
           ============================ */
        .analytics-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            width: calc(100% - 40px);
            max-width: 100%;
            margin: 30px auto 40px;
            padding: 0 20px;
            box-sizing: border-box;
        }
        .analytics-card {
            padding: 24px;
            animation: fadeInUp 0.6s ease forwards;
            opacity: 0;
        }
        .analytics-card:nth-child(1) { animation-delay: 0.1s; }
        .analytics-card:nth-child(2) { animation-delay: 0.2s; }
        .analytics-card:nth-child(3) { animation-delay: 0.3s; }
        .analytics-card:nth-child(4) { animation-delay: 0.4s; }

        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .retrabalho-stat {
            text-align: center;
            padding: 12px 8px;
            background: rgba(0,0,0,0.02);
            border-radius: 12px;
            border: 1px solid rgba(0,0,0,0.04);
        }
        .retrabalho-value {
            font-size: 1.8rem;
            font-weight: 800;
            line-height: 1;
        }
        .retrabalho-label {
            font-size: 0.65rem;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 6px;
        }

        .pavimento-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            font-size: 0.8rem;
        }
        .pavimento-table thead th {
            padding: 12px 16px;
            text-align: left;
            font-size: 0.65rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            border-bottom: 2px solid rgba(0,0,0,0.06);
        }
        .pavimento-table tbody td {
            padding: 14px 16px;
            border-bottom: 1px solid rgba(0,0,0,0.04);
            font-weight: 500;
        }
        .pavimento-table tbody tr:hover {
            background: rgba(245, 187, 0, 0.04);
        }
        .pavimento-table .pav-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 6px;
            font-weight: 700;
            font-size: 0.7rem;
        }

/* --- PORTAL HUD LOADER --- */
        .portal-loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            background: radial-gradient(circle, #1c222b 0%, #0a0e14 100%); /* Preto metálico elegante */
            transition: opacity 0.6s ease, clip-path 1.0s cubic-bezier(0.8, 0, 0.2, 1);
            clip-path: circle(150% at 50% 50%);
        }

        .portal-loader.opening {
            clip-path: circle(0% at 50% 50%);
            opacity: 0;
            pointer-events: none;
        }

        .hud-container {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 280px;
            height: 280px;
            transition: transform 0.6s ease, opacity 0.6s ease;
        }

        .hud-ring {
            position: absolute;
            width: 100%;
            height: 100%;
            border: 1px solid rgba(255, 202, 0, 0.1);
            border-radius: 50%;
            border-top: 2px solid #ffca00;
            animation: hud-rotate 2.5s linear infinite;
        }

        .hud-ring::after {
            content: '';
            position: absolute;
            top: -4px;
            left: 50%;
            transform: translateX(-50%);
            width: 8px;
            height: 8px;
            background: #ffca00;
            border-radius: 50%;
            box-shadow: 0 0 20px #ffca00;
        }

        .hud-logo {
            width: 140px;
            height: auto;
            filter: brightness(0) invert(1) drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
            z-index: 2;
            animation: hud-pulse 2s infinite ease-in-out;
        }

        .portal-loader.opening .hud-container {
            transform: scale(1.5);
            opacity: 0;
        }

        @keyframes hud-rotate {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        @keyframes hud-pulse {
            0%, 100% { transform: scale(1); opacity: 0.9; }
            50% { transform: scale(1.08); opacity: 1; }
        }

        /* Initial state of login content */
        .login-content-hidden {
            opacity: 0;
            transform: scale(0.9);
            filter: blur(10px);
            transition: opacity 1s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1), filter 1s ease;
        }

        .login-content-visible {
            opacity: 1;
            transform: scale(1);
            filter: blur(0);
        }

        /* --- MODAL SUBS-RIS TABS --- */
        .subris-tab {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid transparent;
        }
        .subris-tab:hover {
            background: rgba(0, 0, 0, 0.08) !important;
            color: #1e293b !important;
        }
        .subris-tab.active {
            background: var(--accent-primary) !important;
            color: #000 !important;
            border-color: rgba(0, 0, 0, 0.1) !important;
            box-shadow: 0 4px 12px rgba(255, 202, 0, 0.2);
        }

        /* --- DASHBOARD HUD UTILITIES --- */
        .hud-section-title {
            font-size: 0.72rem;
            font-weight: 800;
            color: #1e293b;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
            opacity: 0.9;
        }
        .hud-section-title::before {
            content: "";
            width: 3px;
            height: 12px;
            background: var(--accent-primary);
            border-radius: 4px;
            box-shadow: 0 0 8px var(--accent-primary);
        }

        .hud-label { 
            display: block; 
            font-size: 0.62rem; 
            font-weight: 800;
            color: var(--text-muted); 
            margin-bottom: 6px; 
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .hud-select-group { margin-bottom: 0; }

        /* --- DASHBOARD HUD UTILITIES --- */
        .hud-section-title {
            font-size: 0.72rem;
            font-weight: 800;
            color: #1e293b;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
            opacity: 0.9;
        }
        .hud-section-title::before {
            content: "";
            width: 3px;
            height: 12px;
            background: var(--accent-primary);
            border-radius: 4px;
            box-shadow: 0 0 8px var(--accent-primary);
        }

        .hud-label { 
            display: block; 
            font-size: 0.68rem; 
            font-weight: 800;
            color: var(--text-muted); 
            margin-bottom: 8px; 
            text-transform: uppercase;
            letter-spacing: 1.2px;
            opacity: 0.8;
        }

        .hud-dropdown {
            width: 100%;
            background: rgba(255, 255, 255, 0.9);
            border: 1px solid rgba(0,0,0,0.08);
            color: var(--text-title);
            padding: 12px 16px;
            border-radius: 14px;
            font-size: 0.85rem;
            font-weight: 500;
            outline: none;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .hud-dropdown:focus { border-color: var(--accent-primary); background: #FFF; box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1); }

        /* Color-coded Note Selects & UI Labels */
        .pill-select {
            padding: 4px 8px;
            border-radius: 6px;
            font-weight: 800;
            font-size: 0.75rem;
            border: 1px solid rgba(0,0,0,0.1);
            transition: all 0.2s ease;
            text-align: center;
        }

        .pill-select.val-a { background: #10b981 !important; color: #fff !important; border-color: #059669 !important; }
        .pill-select.val-r { background: #ef4444 !important; color: #fff !important; border-color: #dc2626 !important; }
        .pill-select.val-cp { background: #f5bb00 !important; color: #000 !important; border-color: #d97706 !important; }
        .pill-select.val-na { background: #3b82f6 !important; color: #fff !important; border-color: #2563eb !important; }
        
        .legend-container {
            display: flex;
            gap: 12px;
            align-items: center;
            background: rgba(255, 255, 255, 0.5);
            padding: 10px 15px;
            border-radius: 12px;
            border: 1px solid rgba(0, 0, 0, 0.04);
            flex-wrap: wrap;
        }
        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.68rem;
            font-weight: 800;
            text-transform: uppercase;
        }
        .legend-marker {
            width: 22px;
            height: 22px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 0.7rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        /* Agravante Square Component */
        .agravante-sq {
            width: 26px;
            height: 26px;
            border: 2px solid rgba(0,0,0,0.1);
            background: rgba(255,255,255,0.8);
            border-radius: 6px;
            cursor: pointer;
            margin: 0 auto;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: transparent;
            font-weight: 900;
            font-size: 14px;
            user-select: none;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
        }
        .agravante-sq:hover {
            border-color: #ef4444;
            background: rgba(239, 68, 68, 0.05);
            transform: scale(1.05);
        }
        .agravante-sq.active {
            background: #ef4444;
            border-color: #dc2626;
            color: #fff;
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
            transform: scale(1.1);
        }
        .agravante-sq.active::after {
            content: "X";
        }

        .ifc-file-list {
            margin-top: 10px;
            padding: 15px;
            background: rgba(0,0,0,0.02);
            border-radius: 12px;
            border: 1px dashed rgba(0,0,0,0.1);
            max-height: 200px;
            overflow-y: auto;
        }
        .ifc-file-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            background: #fff;
            margin-bottom: 8px;
            border-radius: 10px;
            border: 1px solid rgba(0,0,0,0.05);
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-primary);
            transition: all 0.2s;
        }
        .ifc-file-item:hover {
            border-color: var(--accent-primary);
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        }
        .ifc-file-item svg { color: var(--accent-primary); flex-shrink: 0; }
        .ifc-file-name {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
