:root {
            /* Paleta de Colores */
            --orange: #ff6600;
            --yellow: #ffcc00;
            --dark-blue: #0b192c;
            --dark-blue-light: #162a45;
            --white: #ffffff;
            --metallic-gray: #e0e5ec;
            --gray-dark: #8e9eab;
            --green: #00e676;
            --red: #ff3d00;
            --light-blue: #00b4d8;
            --bg-color: #f0f4f8;
            
            /* UI */
            --radius: 12px;
            --shadow: 0 8px 20px rgba(11, 25, 44, 0.08);
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-color);
            color: var(--dark-blue);
            overflow-x: hidden;
        }

        /* --- HEADER --- */
        header {
            background-color: var(--dark-blue);
            color: var(--white);
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }

        .header-brand {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .header-brand h1 {
            font-family: 'Rajdhani', sans-serif;
            font-size: 24px;
            letter-spacing: 1px;
            color: var(--orange);
            display: flex;
            flex-direction: column;
            line-height: 1;
        }

        .header-brand h1 span {
            font-family: 'Inter', sans-serif;
            font-size: 10px;
            color: var(--gray-dark);
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        .header-info {
            display: flex;
            gap: 25px;
            align-items: center;
            font-size: 13px;
            font-weight: 600;
        }

        .header-info div { display: flex; align-items: center; gap: 8px; }
        .header-info i { color: var(--yellow); }
        .status-dot {
            width: 10px; height: 10px;
            background-color: var(--green);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--green);
            animation: pulse 1.5s infinite;
        }

        .header-actions {
            display: flex;
            gap: 20px;
            align-items: center;
        }

        .search-bar {
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.2);
            padding: 8px 15px;
            border-radius: 20px;
            color: white;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .search-bar input {
            background: none; border: none; color: white; outline: none; width: 150px;
        }
        .profile { display: flex; align-items: center; gap: 10px; cursor: pointer;}
        .profile img { width: 35px; height: 35px; border-radius: 50%; border: 2px solid var(--orange); }

        /* --- MAIN CONTAINER --- */
        .container { padding: 20px 30px; max-width: 1800px; margin: auto; }

        /* --- HERO PRINCIPAL --- */
        .hero {
            background: linear-gradient(135deg, var(--dark-blue) 0%, var(--dark-blue-light) 100%);
            border-radius: var(--radius);
            padding: 30px;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow);
        }

        .hero::after {
            content: '';
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h40v40H0V0zm20 20h20v20H20V20zM0 20h20v20H0V20z" fill="rgba(255,255,255,0.02)" fill-rule="evenodd"/></svg>');
            pointer-events: none;
        }

        .hero-content { flex: 1; max-width: 65%; z-index: 2; }
        .hero-content h2 { color: var(--orange); font-size: 28px; margin-bottom: 15px; font-family: 'Rajdhani', sans-serif;}
        .hero-content p { font-size: 16px; line-height: 1.6; color: var(--metallic-gray); margin-bottom: 20px; }
        .hero-content strong { color: var(--white); font-weight: 600; }
        
        .btn-sage {
            background: var(--orange);
            color: var(--white);
            border: none;
            padding: 12px 25px;
            border-radius: 25px;
            font-weight: 800;
            font-size: 14px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
            transition: var(--transition);
        }
        .btn-sage:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 102, 0, 0.6); }

        .hero-visual {
            flex: 0.3;
            height: 180px;
            position: relative;
            z-index: 2;
        }

        /* Isometric CSS Illustration */
        .iso-warehouse { position: absolute; bottom: 20px; right: 40px; transform: rotateX(60deg) rotateZ(-45deg); transform-style: preserve-3d; }
        .iso-building { width: 120px; height: 100px; background: rgba(255,255,255,0.1); border: 2px solid var(--light-blue); position: relative; box-shadow: 20px 20px 0 rgba(0,0,0,0.2); }
        .iso-building::before { content:''; position:absolute; width:100%; height:40px; background:var(--orange); bottom:-40px; left:0; transform-origin:top; transform:rotateX(-90deg); border: 1px solid rgba(255,255,255,0.2);}
        .iso-building::after { content:''; position:absolute; width:40px; height:100%; background:var(--yellow); top:0; left:-40px; transform-origin:right; transform:rotateY(-90deg); border: 1px solid rgba(255,255,255,0.2);}
        .iso-truck { width: 30px; height: 15px; background: var(--white); position: absolute; bottom: -20px; right: -50px; border-radius: 2px; animation: moveIsoTruck 4s infinite linear;}
        
        @keyframes moveIsoTruck { 0% { transform: translate(0,0); opacity:0;} 10% {opacity:1;} 90% {opacity:1;} 100% { transform: translate(-100px, 100px); opacity:0;} }

        /* --- KPIs --- */
        .kpi-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 15px; margin-bottom: 25px; }
        .kpi-card { background: var(--white); padding: 15px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; overflow: hidden; border-left: 4px solid #ccc;}
        .kpi-card h3 { font-size: 11px; color: var(--gray-dark); text-transform: uppercase; margin-bottom: 5px; }
        .kpi-card .value { font-size: 24px; font-weight: 800; font-family: 'Rajdhani', sans-serif;}
        .kpi-card i { position: absolute; right: 15px; top: 15px; font-size: 20px; opacity: 0.2; }
        
        /* KPI Colors */
        .kpi-orange { border-color: var(--orange); } .kpi-orange .value { color: var(--orange); }
        .kpi-green { border-color: var(--green); } .kpi-green .value { color: var(--green); }
        .kpi-blue { border-color: var(--dark-blue); } .kpi-blue .value { color: var(--dark-blue); }
        .kpi-lightblue { border-color: var(--light-blue); } .kpi-lightblue .value { color: var(--light-blue); }
        .kpi-yellow { border-color: var(--yellow); } .kpi-yellow .value { color: #d4a000; }
        .kpi-gray { border-color: var(--gray-dark); } .kpi-gray .value { color: var(--gray-dark); }
        .kpi-red { border-color: var(--red); background: #fff0ed;} .kpi-red .value { color: var(--red); } .kpi-red .status-dot { background: var(--red); box-shadow: 0 0 10px var(--red); position: absolute; top:10px; right:10px;}
        .kpi-protagonist { background: var(--dark-blue); color: var(--white); border-left: none; box-shadow: 0 0 20px rgba(11,25,44,0.4); transform: scale(1.05); z-index: 10;}
        .kpi-protagonist h3 { color: var(--light-blue); } .kpi-protagonist .value { color: var(--white); font-size: 28px;} .kpi-protagonist i { opacity: 0.8; color: var(--orange);}

        /* --- DASHBOARD GRID --- */
        .dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 25px; }
        .col-left { display: flex; flex-direction: column; gap: 20px; }
        .col-right { display: flex; flex-direction: column; gap: 20px; }

        .module-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
        .module-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--metallic-gray); padding-bottom: 10px;}
        .module-header h2 { font-size: 16px; font-weight: 800; color: var(--dark-blue); display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: 0.5px;}
        .module-header h2 i { color: var(--orange); }

        /* --- MAPA LOGÍSTICO --- */
        .map-container { position: relative; height: 350px; background: #e9eff5; border-radius: 8px; overflow: hidden; border: 1px solid var(--metallic-gray); display: flex; align-items: center; justify-content: center;}
        /* Fondo de mapa abstracto estilo radar */
        .map-bg { position: absolute; width: 100%; height: 100%; background: radial-gradient(circle, transparent 20%, #e9eff5 20%, #e9eff5 80%, transparent 80%, transparent), radial-gradient(circle, transparent 20%, #e9eff5 20%, #e9eff5 80%, transparent 80%, transparent) 25px 25px, linear-gradient(#d1dbe5 2px, transparent 2px) 0 -1px, linear-gradient(90deg, #d1dbe5 2px, #e9eff5 2px) -1px 0; background-size: 50px 50px, 50px 50px, 25px 25px, 25px 25px; opacity: 0.5;}
        
        .node { position: absolute; width: 16px; height: 16px; background: var(--dark-blue); border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 15px var(--dark-blue); z-index: 2; cursor: pointer;}
        .node::before { content: attr(data-name); position: absolute; top: 20px; left: -10px; font-size: 11px; font-weight: 700; background: var(--white); padding: 2px 6px; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); white-space: nowrap;}
        .node.active { background: var(--orange); box-shadow: 0 0 20px var(--orange); animation: pulseMap 1.5s infinite;}
        
        #node-lima { top: 60%; left: 30%; }
        #node-norte { top: 20%; left: 20%; }
        #node-sur { top: 80%; left: 50%; }
        #node-oriente { top: 30%; left: 60%; }

        svg.routes { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
        .route-line { fill: none; stroke: var(--light-blue); stroke-width: 3; stroke-dasharray: 10, 5; animation: dash 20s linear infinite; opacity: 0.6;}
        
        .moving-truck { position: absolute; width: 12px; height: 8px; background: var(--orange); border-radius: 2px; z-index: 3; display: flex; justify-content: center; align-items: center;}
        .moving-truck::after { content:'\f0d1'; font-family:'FontAwesome'; font-size: 6px; color: white;}
        
        /* Animaciones del mapa */
        @keyframes dash { to { stroke-dashoffset: -1000; } }
        @keyframes pulseMap { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.7); } 70% { transform: scale(1.2); box-shadow: 0 0 0 15px rgba(255, 102, 0, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); } }
        
        /* Animación dura por CSS para simular movimiento de camiones en mapa */
        @keyframes driveLimaNorte { 0% {top:60%; left:30%;} 100% {top:20%; left:20%;} }
        @keyframes driveLimaSur { 0% {top:60%; left:30%;} 100% {top:80%; left:50%;} }
        .truck-1 { animation: driveLimaNorte 8s linear infinite alternate; }
        .truck-2 { animation: driveLimaSur 10s linear infinite alternate; }

        /* --- SIMIAN SAGE (AI Feed) --- */
        .sage-feed { background: var(--dark-blue); color: var(--white); padding: 20px; border-radius: var(--radius); position: relative; overflow: hidden; border-left: 5px solid var(--light-blue);}
        .sage-feed h2 { color: var(--light-blue); font-size: 14px; text-transform: uppercase; margin-bottom: 15px; font-weight: 800; display: flex; align-items: center; gap:8px;}
        .sage-feed .ai-icon { animation: spin 4s linear infinite;}
        .sage-message-container { height: 60px; display: flex; align-items: center; }
        .sage-message { font-size: 18px; font-weight: 300; line-height: 1.4; transition: opacity 0.5s ease; }
        
        @keyframes spin { 100% { transform: rotate(360deg); } }

        /* --- PEDIDOS EN CURSO --- */
        .order-list { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; padding-right: 5px;}
        .order-list::-webkit-scrollbar { width: 5px; } .order-list::-webkit-scrollbar-thumb { background: var(--metallic-gray); border-radius: 5px;}
        .order-card { background: var(--bg-color); padding: 15px; border-radius: 8px; border-left: 4px solid var(--dark-blue); display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; align-items: center; gap: 10px; transition: var(--transition);}
        .order-card:hover { transform: translateX(5px); background: #e4e9f0;}
        .order-id { font-weight: 800; color: var(--dark-blue); }
        .order-id span { display: block; font-size: 10px; color: var(--gray-dark); font-weight: 400;}
        .order-route { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 5px;}
        .order-route i { color: var(--orange); }
        .order-status { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 12px; text-align: center;}
        .status-transit { background: rgba(0, 180, 216, 0.1); color: var(--light-blue); border: 1px solid var(--light-blue);}
        .status-urgent { background: rgba(255, 61, 0, 0.1); color: var(--red); border: 1px solid var(--red);}
        .order-progress-container { width: 100%; background: #ddd; height: 6px; border-radius: 3px; position: relative;}
        .order-progress-bar { height: 100%; background: var(--green); border-radius: 3px; }
        
        /* --- CENTROS LOGÍSTICOS --- */
        .centers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
        .center-card { border: 1px solid var(--metallic-gray); padding: 15px; border-radius: 8px; background: var(--white); }
        .center-card h3 { font-size: 14px; margin-bottom: 10px; display: flex; justify-content: space-between;}
        .center-card h3 i { color: var(--dark-blue); }
        .center-stats { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: var(--gray-dark);}
        .center-stats strong { color: var(--dark-blue); }
        .load-bar { width: 100%; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin-top: 10px;}
        .load-fill { height: 100%; }
        .fill-lima { width: 85%; background: var(--orange); }
        .fill-norte { width: 94%; background: var(--red); }
        .fill-sur { width: 45%; background: var(--green); }
        .fill-oriente { width: 60%; background: var(--yellow); }

        /* --- ALMACÉN (Vista Superior Animada) --- */
        .warehouse-view { height: 200px; background: #dce3eb; border-radius: 8px; position: relative; border: 2px solid var(--metallic-gray); padding: 10px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;}
        .wh-zone { position: absolute; font-size: 9px; font-weight: 800; text-transform: uppercase; color: var(--gray-dark); letter-spacing: 1px;}
        .wh-zone.rx { top: 5px; left: 5px; } .wh-zone.tx { bottom: 5px; right: 5px; }
        .rack-container { display: flex; justify-content: center; gap: 20px; height: 120px; margin-top: 15px;}
        .rack { width: 30px; height: 100%; background: var(--dark-blue); border-radius: 2px; display: flex; flex-direction: column; justify-content: space-evenly; padding: 2px;}
        .pallet { width: 100%; height: 15px; background: var(--yellow); border-radius: 1px; opacity: 0.8;}
        .pallet.empty { background: transparent; border: 1px dashed rgba(255,255,255,0.3);}
        .forklift { position: absolute; width: 15px; height: 15px; background: var(--orange); border-radius: 2px; top: 20px; left: 10px; z-index: 10; animation: whMove 12s infinite linear;}
        
        @keyframes whMove {
            0% { top: 20px; left: 10px; }
            20% { top: 20px; left: 150px; transform: rotate(0deg);}
            25% { transform: rotate(90deg); }
            45% { top: 140px; left: 150px; transform: rotate(90deg);}
            50% { transform: rotate(180deg); }
            70% { top: 140px; left: 50px; transform: rotate(180deg);}
            75% { transform: rotate(270deg); }
            95% { top: 20px; left: 50px; transform: rotate(270deg);}
            100% { top: 20px; left: 10px; transform: rotate(360deg);}
        }

        /* --- FLOTA --- */
        .fleet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;}
        .fleet-card { background: var(--bg-color); padding: 10px; border-radius: 8px; text-align: center; border: 1px solid var(--metallic-gray);}
        .fleet-card i { font-size: 24px; color: var(--dark-blue); margin-bottom: 5px; display: block;}
        .fleet-card span { font-size: 11px; font-weight: 700; display: block; margin-bottom: 5px;}
        .f-status { font-size: 9px; padding: 3px 6px; border-radius: 10px; text-transform: uppercase; font-weight: 800;}
        .fs-ruta { background: var(--light-blue); color: white;}
        .fs-carga { background: var(--yellow); color: var(--dark-blue);}
        .fs-mant { background: var(--red); color: white;}
        .fs-disp { background: var(--green); color: white;}

        /* --- INVENTARIO --- */
        .inventory-list { display: flex; flex-direction: column; gap: 12px; }
        .inv-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600;}
        .inv-name { width: 30%; display: flex; align-items: center; gap:8px;}
        .inv-name i { width: 15px; color: var(--gray-dark); text-align: center;}
        .inv-bar-bg { width: 50%; height: 6px; background: #eee; border-radius: 3px; position: relative;}
        .inv-bar-fill { height: 100%; background: var(--dark-blue); border-radius: 3px;}
        .inv-val { width: 15%; text-align: right; color: var(--orange);}

        /* --- TIMELINE DESPACHOS --- */
        .timeline { position: relative; padding-left: 20px; margin-top: 10px;}
        .timeline::before { content:''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--metallic-gray); }
        .tl-item { position: relative; margin-bottom: 15px; font-size: 12px; display: flex; gap: 15px;}
        .tl-item::before { content:''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--dark-blue); border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--metallic-gray);}
        .tl-item.done::before { background: var(--green); border-color: var(--white); box-shadow: 0 0 0 1px var(--green);}
        .tl-item.active::before { background: var(--orange); animation: pulse 1s infinite;}
        .tl-time { font-weight: 800; color: var(--gray-dark); width: 40px;}
        .tl-desc { font-weight: 600; color: var(--dark-blue); }

        /* --- DIFERENCIADORES Y EXTRAS --- */
        .kpi-mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 15px;}
        .kpi-mini { background: #f8fafd; border: 1px solid #e1e8f0; padding: 10px; border-radius: 6px;}
        .kpi-mini p { font-size: 10px; color: var(--gray-dark); text-transform: uppercase; margin-bottom: 3px;}
        .kpi-mini h4 { font-size: 16px; font-weight: 800; color: var(--dark-blue);}

        /* Alertas */
        .alerts-container { display: flex; flex-direction: column; gap: 10px; }
        .alert-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--bg-color); border-left: 3px solid transparent;}
        .alert-item i { font-size: 16px; }
        .alert-item.a-red { border-left-color: var(--red); color: var(--red); background: #fff0ed;}
        .alert-item.a-orange { border-left-color: var(--orange); color: var(--orange); background: #fff5eb;}

        /* Animaciones globales y utilidades */
        @keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
        .blink { animation: pulse 1s infinite; }
        
        /* RESPONSIVE */
        @media (max-width: 1200px) {
            .kpi-grid { grid-template-columns: repeat(4, 1fr); }
            .dash-grid { grid-template-columns: 1fr; }
            .hero-visual { display: none; }
            .hero-content { max-width: 100%; }
        }

        @media (max-width: 768px) {
            .header-info, .search-bar { display: none; }
            .kpi-grid { grid-template-columns: repeat(2, 1fr); }
            .fleet-grid { grid-template-columns: repeat(2, 1fr); }
            /* En móvil, el mapa va primero usando Flex Order (requiere contenedor flex) */
            .dash-grid { display: flex; flex-direction: column; }
            .col-left { order: 1; }
            .col-right { order: 2; }
            .hero { flex-direction: column; text-align: center; }
            .centers-grid { grid-template-columns: 1fr; }
        }