:root {
            --bg-color: #08131A;
            --card-bg: rgba(17, 34, 46, 0.65);
            --card-border: rgba(255, 255, 255, 0.05);
            --text-main: #F3F4F6;
            --text-muted: #8A9AAB;
            --accent-blue: #0088CC;
            --accent-teal: #00F0FF;
            --status-available: #10B981;
            --status-separated: #F59E0B;
            --status-sold: #EF4444;
            --status-nego: #3B82F6;
            --status-reserved: #F3F4F6;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Outfit', sans-serif;
        }

        /* --- MOBILE FIRST BASE --- */
        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            /* Cambiado de overflow hidden/height 100vh a min-height para scroll */
            min-height: 100vh;
            overflow-x: hidden; 
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        /* Utilidades Glassmorphism */
        .glass {
            background: var(--card-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--card-border);
            border-radius: 20px;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .glass:hover {
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.05);
        }

        /* Animaciones base */
        @keyframes pulse-glow {
            0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
            70% { box-shadow: 0 0 20px 10px rgba(0, 240, 255, 0); }
            100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
        }
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-5px); }
            100% { transform: translateY(0px); }
        }
        @keyframes data-update {
            0% { color: var(--text-main); transform: scale(1); }
            50% { color: var(--accent-teal); transform: scale(1.05); }
            100% { color: var(--text-main); transform: scale(1); }
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateX(-10px); }
            to { opacity: 1; transform: translateX(0); }
        }
        @keyframes rotateGlow { 100% { transform: rotate(360deg); } }

        /* Layout Principal */
        .dashboard-container {
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            flex-grow: 1;
            transition: all 0.8s ease-in-out;
        }

        /* --- HEADER MOBILE --- */
        header {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            gap: 1rem;
            padding: 0.5rem;
        }

        .header-left .logo {
            font-size: 1.2rem;
            font-weight: 700;
            letter-spacing: 2px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        .header-left .logo i { color: var(--accent-teal); }
        .header-left .subtitle {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }

        .time-display {
            font-size: 2rem;
            font-weight: 300;
            letter-spacing: 2px;
            text-shadow: 0 0 20px rgba(255,255,255,0.2);
        }
        .date-weather {
            font-size: 0.8rem;
            color: var(--text-muted);
            display: flex;
            gap: 10px;
            justify-content: center;
            align-items: center;
        }

        .header-right {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
        }
        .status-badge {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(16, 185, 129, 0.1);
            color: var(--status-available);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            letter-spacing: 1px;
            border: 1px solid rgba(16, 185, 129, 0.2);
            animation: pulse-glow 2s infinite;
        }
        .status-badge .dot {
            width: 8px;
            height: 8px;
            background: var(--status-available);
            border-radius: 50%;
        }

        /* --- CONTENIDO GRID (MOBILE: APILADO) --- */
        .grid-content {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .kpi-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        
        .kpi-card {
            padding: 1.2rem;
            display: flex;
            flex-direction: column;
            gap: 5px;
            text-align: center;
        }
        .kpi-title {
            color: var(--text-muted);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        .kpi-value {
            font-size: 1.8rem;
            font-weight: 600;
        }

        /* MAIN SECTIONS */
        .map-section {
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
            min-height: 400px;
        }
        .panel-header {
            padding: 1.2rem;
            border-bottom: 1px solid var(--card-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .panel-title {
            font-size: 0.9rem;
            font-weight: 500;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        /* Mapa interactivo adaptado para no desbordar */
        .map-container {
            flex-grow: 1;
            padding: 1rem;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            perspective: 1000px;
            overflow: hidden; /* Evita que el contenedor crezca más que la pantalla */
        }
        .lote-grid {
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            gap: 6px; /* Gap reducido para móviles */
            /* Escala reducida inicial para móviles */
            transform: scale(0.4) rotateX(25deg) rotateZ(-15deg);
            transform-style: preserve-3d;
            transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .lote {
            width: 25px; /* Lotes más pequeños en móvil */
            height: 25px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        }
        .lote:hover {
            transform: translateZ(10px) scale(1.1);
            box-shadow: 0 10px 15px rgba(0,0,0,0.5);
            z-index: 10;
        }
        .lote.available { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.8)); border: 1px solid var(--status-available); }
        .lote.separated { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.8)); border: 1px solid var(--status-separated); }
        .lote.sold { background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.8)); border: 1px solid var(--status-sold); opacity: 0.6; }
        .lote.nego { background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.8)); border: 1px solid var(--status-nego); }
        .lote.reserved { background: linear-gradient(135deg, rgba(243,244,246,0.2), rgba(243,244,246,0.8)); border: 1px solid var(--status-reserved); }

        /* Leyenda Mapa (Ajustada para móvil) */
        .map-legend {
            position: absolute;
            bottom: 0.5rem; 
            right: 0.5rem;
            left: 0.5rem; /* Centrado en móvil */
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            background: rgba(0,0,0,0.7);
            padding: 8px 10px;
            border-radius: 15px;
            font-size: 0.7rem;
        }
        .legend-item { display: flex; align-items: center; gap: 4px; }
        .legend-color { width: 8px; height: 8px; border-radius: 50%; }

        /* Tooltip del lote */
        .tooltip {
            position: absolute;
            background: rgba(8, 19, 26, 0.95);
            border: 1px solid var(--card-border);
            padding: 1rem;
            border-radius: 12px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            z-index: 100;
            width: 160px;
            backdrop-filter: blur(10px);
        }
        .tooltip h4 { color: var(--accent-teal); margin-bottom: 5px; font-size: 1rem; }
        .tooltip p { font-size: 0.75rem; margin: 3px 0; color: var(--text-muted); display: flex; justify-content: space-between;}
        .tooltip p span { color: var(--text-main); font-weight: 500;}

        /* COLUMNAS CENTRAL Y DERECHA (Apiladas por defecto) */
        .center-col, .right-col {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .activity-feed {
            flex-grow: 1;
            padding: 1rem;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-height: 250px;
        }
        .activity-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px;
            border-radius: 12px;
            background: rgba(255,255,255,0.02);
            border: 1px solid transparent;
            transition: all 0.3s ease;
            animation: fadeIn 0.5s ease-out;
        }
        .activity-item:hover {
            background: rgba(255,255,255,0.05);
            border-color: var(--card-border);
        }
        .act-time { font-size: 0.75rem; color: var(--text-muted); width: 40px; }
        .act-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
        .act-icon.v { background: rgba(16,185,129,0.1); color: var(--status-available); }
        .act-icon.s { background: rgba(245,158,11,0.1); color: var(--status-separated); }
        .act-icon.c { background: rgba(59,130,246,0.1); color: var(--status-nego); }
        .act-details h5 { font-size: 0.85rem; font-weight: 500; }
        .act-details p { font-size: 0.75rem; color: var(--text-muted); }

        .ai-panel {
            min-height: 150px;
            padding: 1.2rem;
            position: relative;
            overflow: hidden;
        }
        .ai-bg-glow {
            position: absolute;
            top: -50%; left: -50%;
            width: 200%; height: 200%;
            background: radial-gradient(circle, rgba(0,240,255,0.05) 0%, transparent 60%);
            animation: rotateGlow 10s linear infinite;
            z-index: 0;
        }
        .ai-content {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .ai-message {
            font-size: 0.85rem;
            line-height: 1.4;
            color: var(--text-main);
            border-left: 2px solid var(--accent-teal);
            padding-left: 1rem;
            transition: opacity 0.5s ease;
        }

        .funnel-container {
            padding: 1.2rem;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .funnel-step { display: flex; align-items: center; gap: 10px; }
        .funnel-label { width: 70px; font-size: 0.7rem; color: var(--text-muted); text-align: right;}
        .funnel-bar-bg { flex-grow: 1; height: 6px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden;}
        .funnel-bar { height: 100%; background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal)); border-radius: 10px; transition: width 1s ease-in-out;}
        .funnel-val { width: 25px; font-size: 0.75rem; font-weight: 500;}

        .advisors-panel { padding: 1rem; }
        .advisor {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--card-border);
        }
        .advisor:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
        .adv-avatar { width: 35px; height: 35px; border-radius: 50%; background: #334; position: relative; flex-shrink: 0;}
        .adv-status { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-color);}
        .adv-status.on { background: var(--status-available); }
        .adv-status.busy { background: var(--status-sold); }
        .adv-info { flex-grow: 1; }
        .adv-info h5 { font-size: 0.8rem; font-weight: 500; }
        .adv-info p { font-size: 0.7rem; color: var(--text-muted); }
        .adv-stats { text-align: right; }
        .adv-stats span { font-size: 0.85rem; font-weight: 600; color: var(--accent-teal); }
        .adv-progress { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-top: 5px; width: 50px;}
        .adv-progress div { height: 100%; background: var(--status-available); border-radius: 2px; }

        /* FOOTER (Adaptable) */
        footer {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px;
            padding: 1.5rem 1rem;
            border-top: 1px solid var(--card-border);
            margin-top: 2rem;
        }
        .footer-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            width: 45%; /* 2 columnas en móvil */
            text-align: center;
        }
        .footer-stat span { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;}
        .footer-stat strong { font-size: 1rem; }

        /* BOTÓN FLOTANTE MODO PRESENTACIÓN */
        .fab-presentation {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            background: linear-gradient(135deg, var(--card-bg), #000);
            border: 1px solid var(--accent-teal);
            color: var(--text-main);
            padding: 0.8rem 1.5rem;
            border-radius: 30px;
            font-size: 0.8rem;
            font-weight: 600;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
            transition: all 0.3s ease;
            z-index: 1000;
            backdrop-filter: blur(10px);
        }
        .fab-presentation:hover {
            transform: scale(1.05);
            box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
            background: var(--card-bg);
        }

        /* --- MODO PRESENTACIÓN --- */
        body.presentation-mode .dashboard-container { padding: 0; }
        body.presentation-mode .kpi-row,
        body.presentation-mode .center-col,
        body.presentation-mode .right-col,
        body.presentation-mode header,
        body.presentation-mode footer {
            opacity: 0;
            pointer-events: none;
            position: absolute;
            transform: translateY(20px);
            transition: all 0.5s ease;
        }
        
        body.presentation-mode .map-section {
            position: fixed;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 100vw;
            height: 100vh;
            z-index: 500;
            border: none;
            background: transparent;
            box-shadow: none;
        }
        body.presentation-mode .map-section .panel-header { display: none; }
        
        body.presentation-mode .lote-grid {
            transform: scale(0.7) rotateX(10deg) rotateZ(0deg); /* Escala presentación móvil */
            gap: 12px;
        }
        
        body.presentation-mode .lote {
            box-shadow: 0 0 15px currentColor;
            animation: float 4s infinite ease-in-out;
        }
        body.presentation-mode .lote:nth-child(even) { animation-delay: 1s; }
        body.presentation-mode .lote:nth-child(3n) { animation-delay: 2s; }

        .presentation-tag {
            position: absolute;
            background: rgba(0,0,0,0.8);
            border: 1px solid var(--accent-teal);
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.7rem;
            color: white;
            pointer-events: none;
            opacity: 0;
            transition: all 0.5s ease;
            z-index: 600;
            backdrop-filter: blur(5px);
            box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
        }

        body.presentation-mode .ai-panel {
            position: fixed;
            bottom: 5rem;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 600px;
            opacity: 1;
            pointer-events: auto;
            z-index: 600;
            font-size: 1rem;
            text-align: center;
            border: 1px solid var(--accent-teal);
            background: rgba(8, 19, 26, 0.85);
        }

        /* =========================================
           MEDIA QUERIES - TABLET Y ESCRITORIO
           ========================================= */

        /* Tablet (768px y superior) */
        @media (min-width: 768px) {
            .dashboard-container {
                padding: 1.5rem;
            }
            header {
                flex-direction: row;
                justify-content: space-between;
                text-align: left;
                padding: 0 1rem;
            }
            .header-left .logo { justify-content: flex-start; font-size: 1.5rem; }
            .header-right { align-items: flex-end; }
            .time-display { font-size: 2.5rem; }
            .date-weather { justify-content: flex-start; }
            
            .kpi-row {
                grid-template-columns: repeat(2, 1fr);
            }
            .kpi-card { text-align: left; }
            .kpi-title { justify-content: flex-start; }
            
            .lote-grid {
                transform: scale(0.7) rotateX(25deg) rotateZ(-15deg);
                gap: 8px;
            }
            .lote { width: 35px; height: 35px; }

            .map-legend { right: 1rem; left: auto; justify-content: flex-end; }
            
            body.presentation-mode .lote-grid {
                transform: scale(1) rotateX(10deg) rotateZ(0deg);
            }

            footer {
                justify-content: space-between;
                flex-wrap: nowrap;
            }
            .footer-stat { width: auto; flex-direction: row; }
        }

        /* Escritorio (1024px y superior) */
        @media (min-width: 1024px) {
            /* Retornamos al layout de 3 columnas original */
            .grid-content {
                display: grid;
                grid-template-columns: 2fr 1fr 1fr;
                grid-template-rows: auto 1fr auto;
            }
            
            .kpi-row {
                grid-column: 1 / -1;
                grid-template-columns: repeat(4, 1fr);
            }
            
            .map-section {
                grid-column: 1 / 2;
                grid-row: 2 / 4;
            }
            
            .center-col {
                grid-column: 2 / 3;
                grid-row: 2 / 4;
            }
            
            .right-col {
                grid-column: 3 / 4;
                grid-row: 2 / 4;
            }

            .lote-grid {
                transform: scale(1) rotateX(25deg) rotateZ(-15deg);
            }

            body.presentation-mode .lote-grid {
                transform: scale(1.5) rotateX(10deg) rotateZ(0deg);
            }
        }