File size: 55,540 Bytes
bc65b80 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 |
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sistema de Forecast Inteligente</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<style>
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .nav-text {
display: none;
}
.main-content {
transition: margin-left 0.3s ease;
}
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
.chart-tooltip {
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 8px;
border-radius: 4px;
font-size: 12px;
}
.hover-scale:hover {
transform: scale(1.05);
transition: transform 0.3s ease;
}
.fade-in {
animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.slide-in {
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
.confidence-high {
background-color: rgba(40, 167, 69, 0.1);
border-left: 4px solid #28a745;
}
.confidence-medium {
background-color: rgba(255, 193, 7, 0.1);
border-left: 4px solid #ffc107;
}
.confidence-low {
background-color: rgba(220, 53, 69, 0.1);
border-left: 4px solid #dc3545;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<!-- Loading Screen -->
<div id="loadingScreen" class="fixed inset-0 bg-white z-50 flex flex-col items-center justify-center">
<div class="animate-spin rounded-full h-16 w-16 border-t-4 border-b-4 border-blue-500 mb-4"></div>
<p class="text-gray-700">Cargando sistema de forecast...</p>
</div>
<!-- Main Layout -->
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div id="sidebar" class="sidebar bg-gray-800 text-white w-64 flex flex-col">
<!-- Logo and Toggle -->
<div class="p-4 flex items-center justify-between border-b border-gray-700">
<div class="flex items-center">
<i class="fas fa-chart-line text-blue-400 text-2xl mr-3"></i>
<span class="text-xl font-bold">ForecastPro</span>
</div>
<button id="toggleSidebar" class="text-gray-400 hover:text-white">
<i class="fas fa-bars"></i>
</button>
</div>
<!-- User Profile -->
<div class="p-4 border-b border-gray-700 flex items-center">
<div class="h-10 w-10 rounded-full bg-blue-500 flex items-center justify-center text-white font-bold">
<span id="userInitials">JD</span>
</div>
<div class="ml-3">
<p class="font-medium" id="username">Juan Director</p>
<p class="text-xs text-gray-400">Director Comercial</p>
</div>
</div>
<!-- Main Navigation -->
<nav class="flex-1 overflow-y-auto">
<div class="p-2">
<div class="mb-2">
<p class="text-xs uppercase text-gray-500 px-4 py-2">Navegación</p>
</div>
<ul>
<li>
<a href="#" class="flex items-center px-4 py-3 text-white bg-gray-700 rounded mx-2">
<i class="fas fa-tachometer-alt mr-3"></i>
<span class="nav-text">Dashboard Ejecutivo</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-boxes mr-3"></i>
<span class="nav-text">Forecast por Categoría</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-barcode mr-3"></i>
<span class="nav-text">Forecast por SKU</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-industry mr-3"></i>
<span class="nav-text">Planificación Producción</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-shopping-cart mr-3"></i>
<span class="nav-text">Planificación Compras</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-flask mr-3"></i>
<span class="nav-text">Simulador de Escenarios</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-chart-bar mr-3"></i>
<span class="nav-text">Performance de Modelos</span>
</a>
</li>
</ul>
</div>
<div class="p-2 mt-4">
<div class="mb-2">
<p class="text-xs uppercase text-gray-500 px-4 py-2">Configuración</p>
</div>
<ul>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-cog mr-3"></i>
<span class="nav-text">Configuración</span>
</a>
</li>
<li>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded mx-2">
<i class="fas fa-file-alt mr-3"></i>
<span class="nav-text">Reportes</span>
</a>
</li>
</ul>
</div>
</nav>
<!-- Collapse Button -->
<div class="p-4 border-t border-gray-700">
<button id="collapseSidebar" class="w-full flex items-center justify-center text-gray-400 hover:text-white">
<i class="fas fa-chevron-left mr-2"></i>
<span class="nav-text">Colapsar</span>
</button>
</div>
</div>
<!-- Main Content -->
<div class="main-content flex-1 flex flex-col overflow-hidden">
<!-- Top Navigation -->
<header class="bg-white shadow-sm z-10">
<div class="flex items-center justify-between px-6 py-3">
<div class="flex items-center">
<h1 class="text-xl font-semibold text-gray-800">Dashboard Ejecutivo</h1>
<div class="ml-4 text-sm breadcrumbs">
<ul>
<li>Inicio</li>
<li>Dashboard</li>
</ul>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<button id="notificationsBtn" class="text-gray-600 hover:text-gray-900 relative">
<i class="fas fa-bell text-xl"></i>
<span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">3</span>
</button>
<div id="notificationsDropdown" class="hidden absolute right-0 mt-2 w-80 bg-white rounded-md shadow-lg z-20 py-1">
<div class="px-4 py-2 border-b border-gray-200">
<h3 class="font-medium">Notificaciones</h3>
</div>
<div class="max-h-96 overflow-y-auto">
<a href="#" class="block px-4 py-3 hover:bg-gray-100 border-b border-gray-100">
<div class="flex items-start">
<div class="flex-shrink-0 text-red-500">
<i class="fas fa-exclamation-circle"></i>
</div>
<div class="ml-3">
<p class="text-sm font-medium">Stock crítico en SKU-4567</p>
<p class="text-xs text-gray-500">2 horas atrás</p>
</div>
</div>
</a>
<a href="#" class="block px-4 py-3 hover:bg-gray-100 border-b border-gray-100">
<div class="flex items-start">
<div class="flex-shrink-0 text-yellow-500">
<i class="fas fa-chart-line"></i>
</div>
<div class="ml-3">
<p class="text-sm font-medium">Modelo Prophet requiere reentrenamiento</p>
<p class="text-xs text-gray-500">Ayer, 14:30</p>
</div>
</div>
</a>
<a href="#" class="block px-4 py-3 hover:bg-gray-100">
<div class="flex items-start">
<div class="flex-shrink-0 text-blue-500">
<i class="fas fa-info-circle"></i>
</div>
<div class="ml-3">
<p class="text-sm font-medium">Nuevo reporte de performance disponible</p>
<p class="text-xs text-gray-500">Lunes, 9:00</p>
</div>
</div>
</a>
</div>
<div class="px-4 py-2 border-t border-gray-200 text-center">
<a href="#" class="text-sm text-blue-600 hover:text-blue-800">Ver todas las notificaciones</a>
</div>
</div>
</div>
<div class="relative">
<button id="userMenuBtn" class="flex items-center text-gray-600 hover:text-gray-900">
<span class="mr-2 hidden md:inline">Juan Director</span>
<div class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center text-white font-bold">JD</div>
</button>
<div id="userMenuDropdown" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-20 py-1">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Mi perfil</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Configuración</a>
<div class="border-t border-gray-200"></div>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Cerrar sesión</a>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content Area -->
<main class="flex-1 overflow-y-auto p-6 bg-gray-50">
<!-- Alert Banner -->
<div class="bg-red-50 border-l-4 border-red-500 p-4 mb-6">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-exclamation-circle text-red-500"></i>
</div>
<div class="ml-3">
<p class="text-sm text-red-700">
<span class="font-medium">Alerta crítica:</span> Stock insuficiente para el SKU-4567 (Bebidas Energéticas). Solo quedan 2 días de inventario según el forecast actual.
<a href="#" class="font-medium underline text-red-700 hover:text-red-600 ml-2">Ver detalles</a>
</p>
</div>
</div>
</div>
<!-- Quick Stats -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6 hover-scale">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Demanda proyectada (7 días)</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">12,450</p>
</div>
<div class="bg-green-100 rounded-full p-3">
<i class="fas fa-arrow-up text-green-600"></i>
</div>
</div>
<p class="mt-2 text-sm text-gray-500">
<span class="text-green-600 font-medium">+8.2%</span> vs semana anterior
</p>
</div>
<div class="bg-white rounded-lg shadow p-6 hover-scale">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Precisión del modelo</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">92.4%</p>
</div>
<div class="bg-blue-100 rounded-full p-3">
<i class="fas fa-brain text-blue-600"></i>
</div>
</div>
<p class="mt-2 text-sm text-gray-500">
<span class="text-green-600 font-medium">+1.5%</span> vs promedio histórico
</p>
</div>
<div class="bg-white rounded-lg shadow p-6 hover-scale">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Stock crítico</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">3</p>
</div>
<div class="bg-red-100 rounded-full p-3">
<i class="fas fa-exclamation-triangle text-red-600"></i>
</div>
</div>
<p class="mt-2 text-sm text-gray-500">
<span class="text-red-600 font-medium">+1</span> vs semana anterior
</p>
</div>
<div class="bg-white rounded-lg shadow p-6 hover-scale">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Margen estimado</p>
<p class="mt-1 text-3xl font-semibold text-gray-900">34.2%</p>
</div>
<div class="bg-yellow-100 rounded-full p-3">
<i class="fas fa-percent text-yellow-600"></i>
</div>
</div>
<p class="mt-2 text-sm text-gray-500">
<span class="text-green-600 font-medium">+2.1%</span> vs semana anterior
</p>
</div>
</div>
<!-- Main Chart -->
<div class="bg-white rounded-lg shadow p-6 mb-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between mb-4">
<div>
<h2 class="text-lg font-semibold text-gray-900">Forecast por categoría (próximas 4 semanas)</h2>
<p class="text-sm text-gray-500">Actualizado hoy a las 08:45 AM</p>
</div>
<div class="mt-2 md:mt-0">
<div class="flex space-x-2">
<select class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2">
<option selected>Todas las categorías</option>
<option>Bebidas</option>
<option>Snacks</option>
<option>Lácteos</option>
<option>Congelados</option>
</select>
<select class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2">
<option selected>Modelo: Prophet</option>
<option>XGBoost</option>
<option>Random Forest</option>
<option>Ensemble</option>
</select>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm font-medium">
<i class="fas fa-download mr-1"></i> Exportar
</button>
</div>
</div>
</div>
<div class="h-96">
<canvas id="forecastChart"></canvas>
</div>
<div class="mt-4 flex items-center justify-between">
<div class="flex space-x-4">
<div class="flex items-center">
<div class="w-3 h-3 bg-blue-500 rounded-full mr-2"></div>
<span class="text-sm text-gray-600">Histórico</span>
</div>
<div class="flex items-center">
<div class="w-3 h-3 bg-orange-500 rounded-full mr-2"></div>
<span class="text-sm text-gray-600">Forecast</span>
</div>
<div class="flex items-center">
<div class="w-3 h-3 bg-orange-200 rounded-full mr-2"></div>
<span class="text-sm text-gray-600">Banda de confianza</span>
</div>
</div>
<div>
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">
<i class="fas fa-expand mr-1"></i> Pantalla completa
</button>
</div>
</div>
</div>
<!-- Top Insights and Actions -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
<!-- Top Insights -->
<div class="bg-white rounded-lg shadow p-6 lg:col-span-2">
<h2 class="text-lg font-semibold text-gray-900 mb-4">Top Insights</h2>
<div class="space-y-4">
<div class="p-4 border border-gray-200 rounded-lg">
<div class="flex items-start">
<div class="flex-shrink-0 bg-blue-100 p-2 rounded-full">
<i class="fas fa-chart-line text-blue-600"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-gray-900">Pico esperado en Bebidas Energéticas</h3>
<p class="mt-1 text-sm text-gray-600">Se proyecta un aumento del 25% en la demanda para el 15 de junio debido al evento deportivo local.</p>
<div class="mt-2 flex space-x-3">
<button class="inline-flex items-center px-3 py-1 border border-blue-600 text-blue-600 rounded-full text-xs font-medium hover:bg-blue-50">
<i class="fas fa-eye mr-1"></i> Ver detalles
</button>
<button class="inline-flex items-center px-3 py-1 bg-blue-600 text-white rounded-full text-xs font-medium hover:bg-blue-700">
<i class="fas fa-plus-circle mr-1"></i> Programar producción
</button>
</div>
</div>
</div>
</div>
<div class="p-4 border border-gray-200 rounded-lg">
<div class="flex items-start">
<div class="flex-shrink-0 bg-yellow-100 p-2 rounded-full">
<i class="fas fa-exclamation-triangle text-yellow-600"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-gray-900">Tendencia bajista en Snacks Salados</h3>
<p class="mt-1 text-sm text-gray-600">Demanda proyectada disminuye un 12% en las próximas 2 semanas. Revisar estrategia de precios.</p>
<div class="mt-2 flex space-x-3">
<button class="inline-flex items-center px-3 py-1 border border-yellow-600 text-yellow-600 rounded-full text-xs font-medium hover:bg-yellow-50">
<i class="fas fa-eye mr-1"></i> Ver detalles
</button>
<button class="inline-flex items-center px-3 py-1 bg-yellow-600 text-white rounded-full text-xs font-medium hover:bg-yellow-700">
<i class="fas fa-tag mr-1"></i> Crear promoción
</button>
</div>
</div>
</div>
</div>
<div class="p-4 border border-gray-200 rounded-lg">
<div class="flex items-start">
<div class="flex-shrink-0 bg-green-100 p-2 rounded-full">
<i class="fas fa-lightbulb text-green-600"></i>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-gray-900">Oportunidad promocional en Lácteos</h3>
<p class="mt-1 text-sm text-gray-600">Modelo sugiere alta sensibilidad a promociones para yogures naturales (+35% demanda con 10% descuento).</p>
<div class="mt-2 flex space-x-3">
<button class="inline-flex items-center px-3 py-1 border border-green-600 text-green-600 rounded-full text-xs font-medium hover:bg-green-50">
<i class="fas fa-eye mr-1"></i> Ver detalles
</button>
<button class="inline-flex items-center px-3 py-1 bg-green-600 text-white rounded-full text-xs font-medium hover:bg-green-700">
<i class="fas fa-bullhorn mr-1"></i> Planificar campaña
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-900 mb-4">Acciones rápidas</h2>
<div class="space-y-3">
<button class="w-full flex items-center justify-between p-4 bg-blue-50 hover:bg-blue-100 rounded-lg transition-colors">
<div class="flex items-center">
<div class="bg-blue-100 p-2 rounded-full mr-3">
<i class="fas fa-play-circle text-blue-600"></i>
</div>
<span class="font-medium text-gray-800">Ejecutar simulador de escenarios</span>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</button>
<button class="w-full flex items-center justify-between p-4 bg-purple-50 hover:bg-purple-100 rounded-lg transition-colors">
<div class="flex items-center">
<div class="bg-purple-100 p-2 rounded-full mr-3">
<i class="fas fa-file-export text-purple-600"></i>
</div>
<span class="font-medium text-gray-800">Generar reporte ejecutivo</span>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</button>
<button class="w-full flex items-center justify-between p-4 bg-green-50 hover:bg-green-100 rounded-lg transition-colors">
<div class="flex items-center">
<div class="bg-green-100 p-2 rounded-full mr-3">
<i class="fas fa-chart-pie text-green-600"></i>
</div>
<span class="font-medium text-gray-800">Analizar performance de modelos</span>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</button>
<button class="w-full flex items-center justify-between p-4 bg-yellow-50 hover:bg-yellow-100 rounded-lg transition-colors">
<div class="flex items-center">
<div class="bg-yellow-100 p-2 rounded-full mr-3">
<i class="fas fa-bell text-yellow-600"></i>
</div>
<span class="font-medium text-gray-800">Configurar alertas personalizadas</span>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</button>
<button class="w-full flex items-center justify-between p-4 bg-red-50 hover:bg-red-100 rounded-lg transition-colors">
<div class="flex items-center">
<div class="bg-red-100 p-2 rounded-full mr-3">
<i class="fas fa-exclamation-triangle text-red-600"></i>
</div>
<span class="font-medium text-gray-800">Revisar alertas críticas</span>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</button>
</div>
</div>
</div>
<!-- Forecast Table -->
<div class="bg-white rounded-lg shadow overflow-hidden mb-6">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-900">Forecast próximos 7 días</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Forecast</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rango min-max</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Comparación</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Lun, 12 Jun</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1,845</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1,720 - 1,950</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">+5.2%</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3">Detalles</button>
<button class="text-green-600 hover:text-green-900">Acción</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Mar, 13 Jun</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1,920</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1,810 - 2,030</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">+7.8%</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3">Detalles</button>
<button class="text-green-600 hover:text-green-900">Acción</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Mié, 14 Jun</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2,150</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2,020 - 2,280</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">+10.3%</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3">Detalles</button>
<button class="text-green-600 hover:text-green-900">Acción</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Jue, 15 Jun</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2,450</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2,300 - 2,600</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">+15.7%</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3">Detalles</button>
<button class="text-green-600 hover:text-green-900">Acción</button>
</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Vie, 16 Jun</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2,120</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1,980 - 2,260</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">+8.5%</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3">Detalles</button>
<button class="text-green-600 hover:text-green-900">Acción</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="px-6 py-4 border-t border-gray-200">
<button class="text-blue-600 hover:text-blue-900 text-sm font-medium">
<i class="fas fa-plus mr-1"></i> Ver más días
</button>
</div>
</div>
<!-- Model Performance -->
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-900 mb-4">Performance de modelos</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">MAPE global</p>
<p class="mt-1 text-2xl font-semibold text-green-600">7.2%</p>
</div>
<div class="bg-green-100 rounded-full p-3">
<i class="fas fa-check-circle text-green-600"></i>
</div>
</div>
<p class="mt-2 text-xs text-gray-500">
<span class="font-medium">Excelente</span> (menor al 10%)
</p>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">WAPE global</p>
<p class="mt-1 text-2xl font-semibold text-yellow-600">9.8%</p>
</div>
<div class="bg-yellow-100 rounded-full p-3">
<i class="fas fa-exclamation-circle text-yellow-600"></i>
</div>
</div>
<p class="mt-2 text-xs text-gray-500">
<span class="font-medium">Bueno</span> (cerca del límite del 10%)
</p>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-500">Uptime del sistema</p>
<p class="mt-1 text-2xl font-semibold text-green-600">99.7%</p>
</div>
<div class="bg-green-100 rounded-full p-3">
<i class="fas fa-server text-green-600"></i>
</div>
</div>
<p class="mt-2 text-xs text-gray-500">
<span class="font-medium">Excelente</span> (en los últimos 30 días)
</p>
</div>
</div>
<div class="h-64">
<canvas id="modelPerformanceChart"></canvas>
</div>
</div>
</main>
</div>
</div>
<!-- Mobile Navigation -->
<div class="md:hidden fixed bottom-0 left-0 right-0 bg-white shadow-lg z-30">
<div class="flex justify-around">
<a href="#" class="flex flex-col items-center justify-center p-3 text-blue-600">
<i class="fas fa-tachometer-alt text-xl"></i>
<span class="text-xs mt-1">Dashboard</span>
</a>
<a href="#" class="flex flex-col items-center justify-center p-3 text-gray-500">
<i class="fas fa-bell text-xl"></i>
<span class="text-xs mt-1">Alertas</span>
</a>
<a href="#" class="flex flex-col items-center justify-center p-3 text-gray-500">
<i class="fas fa-chart-line text-xl"></i>
<span class="text-xs mt-1">Forecast</span>
</a>
<a href="#" class="flex flex-col items-center justify-center p-3 text-gray-500">
<i class="fas fa-cog text-xl"></i>
<span class="text-xs mt-1">Config</span>
</a>
</div>
</div>
<script>
// Simulate loading
setTimeout(() => {
document.getElementById('loadingScreen').style.display = 'none';
// Initialize charts after loading
initCharts();
setupEventListeners();
}, 1500);
function initCharts() {
// Main Forecast Chart
const forecastCtx = document.getElementById('forecastChart').getContext('2d');
const forecastChart = new Chart(forecastCtx, {
type: 'line',
data: {
labels: ['1 Jun', '2 Jun', '3 Jun', '4 Jun', '5 Jun', '6 Jun', '7 Jun', '8 Jun', '9 Jun', '10 Jun', '11 Jun', '12 Jun', '13 Jun', '14 Jun', '15 Jun', '16 Jun', '17 Jun', '18 Jun', '19 Jun', '20 Jun', '21 Jun', '22 Jun', '23 Jun', '24 Jun', '25 Jun', '26 Jun', '27 Jun', '28 Jun', '29 Jun', '30 Jun'],
datasets: [
{
label: 'Histórico',
data: [1200, 1900, 1700, 1600, 1800, 1500, 2000, 2100, 1900, 2200, 2300, 2100, 2000, 2200, 2400, 2100, 1900, 2000, 2100, 2200, 2300, 2400, 2200, 2100, 2000, 1900, 2100, 2200, 2300, 2400],
borderColor: '#3b82f6',
backgroundColor: 'transparent',
borderWidth: 2,
pointRadius: 0,
tension: 0.1
},
{
label: 'Forecast',
data: [null, null, null, null, null, null, null, null, null, null, null, 1845, 1920, 2150, 2450, 2120, 1950, 2050, 2150, 2250, 2350, 2450, 2250, 2150, 2050, 1950, 2150, 2250, 2350, 2450],
borderColor: '#f97316',
backgroundColor: 'transparent',
borderWidth: 2,
borderDash: [5, 5],
pointRadius: 0,
tension: 0.1
},
{
label: 'Banda de confianza',
data: [null, null, null, null, null, null, null, null, null, null, null, 1720, 1810, 2020, 2300, 1980, 1850, 1950, 2050, 2150, 2250, 2350, 2150, 2050, 1950, 1850, 2050, 2150, 2250, 2350],
borderColor: 'transparent',
backgroundColor: 'rgba(249, 115, 22, 0.1)',
borderWidth: 0,
pointRadius: 0,
tension: 0.1,
fill: '1'
},
{
label: 'Banda de confianza',
data: [null, null, null, null, null, null, null, null, null, null, null, 1950, 2030, 2280, 2600, 2260, 2050, 2150, 2250, 2350, 2450, 2550, 2350, 2250, 2150, 2050, 2250, 2350, 2450, 2550],
borderColor: 'transparent',
backgroundColor: 'rgba(249, 115, 22, 0.1)',
borderWidth: 0,
pointRadius: 0,
tension: 0.1,
fill: '1'
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
},
tooltip: {
mode: 'index',
intersect: false,
backgroundColor: 'rgba(0, 0, 0, 0.8)',
titleFont: {
size: 14,
weight: 'bold'
},
bodyFont: {
size: 12
},
callbacks: {
label: function(context) {
let label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += context.parsed.y.toLocaleString();
}
return label;
}
}
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
beginAtZero: false,
grid: {
color: 'rgba(0, 0, 0, 0.05)'
},
ticks: {
callback: function(value) {
return value.toLocaleString();
}
}
}
},
interaction: {
mode: 'nearest',
axis: 'x',
intersect: false
}
}
});
// Model Performance Chart
const modelCtx = document.getElementById('modelPerformanceChart').getContext('2d');
const modelChart = new Chart(modelCtx, {
type: 'bar',
data: {
labels: ['Prophet', 'XGBoost', 'Random Forest', 'Neural Net', 'Ensemble'],
datasets: [
{
label: 'MAPE',
data: [6.8, 7.5, 8.2, 9.1, 5.9],
backgroundColor: '#3b82f6',
borderRadius: 4
},
{
label: 'Tiempo (ms)',
data: [120, 85, 95, 210, 150],
backgroundColor: '#10b981',
borderRadius: 4,
hidden: true
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
},
tooltip: {
callbacks: {
label: function(context) {
let label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
if (context.dataset.label === 'MAPE') {
label += context.parsed.y + '%';
} else {
label += context.parsed.y + 'ms';
}
}
return label;
}
}
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
beginAtZero: true,
grid: {
color: 'rgba(0, 0, 0, 0.05)'
},
ticks: {
callback: function(value) {
return value + (this.scale.id === 'y' ? '%' : '');
}
}
}
}
}
});
}
function setupEventListeners() {
// Toggle sidebar
document.getElementById('toggleSidebar').addEventListener('click', function() {
document.getElementById('sidebar').classList.toggle('collapsed');
document.querySelector('.main-content').classList.toggle('md:ml-64');
document.querySelector('.main-content').classList.toggle('md:ml-20');
});
// Collapse sidebar
document.getElementById('collapseSidebar').addEventListener('click', function() {
document.getElementById('sidebar').classList.add('collapsed');
document.querySelector('.main-content').classList.remove('md:ml-64');
document.querySelector('.main-content').classList.add('md:ml-20');
});
// Notifications dropdown
document.getElementById('notificationsBtn').addEventListener('click', function(e) {
e.stopPropagation();
document.getElementById('notificationsDropdown').classList.toggle('hidden');
document.getElementById('userMenuDropdown').classList.add('hidden');
});
// User menu dropdown
document.getElementById('userMenuBtn').addEventListener('click', function(e) {
e.stopPropagation();
document.getElementById('userMenuDropdown').classList.toggle('hidden');
document.getElementById('notificationsDropdown').classList.add('hidden');
});
// Close dropdowns when clicking outside
document.addEventListener('click', function() {
document.getElementById('notificationsDropdown').classList.add('hidden');
document.getElementById('userMenuDropdown').classList.add('hidden');
});
// Keyboard shortcuts
document.addEventListener('keydown', function(e) {
if (e.ctrlKey) {
switch (e.key) {
case 'd':
e.preventDefault();
window.location.href = '#';
break;
case 'f':
e.preventDefault();
// Focus search
break;
case 's':
e.preventDefault();
// Open simulator
break;
case 'r':
e.preventDefault();
// Refresh data
break;
case 'e':
e.preventDefault();
// Export
break;
}
}
});
}
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=cocovidal/guacolda" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |