<style>
        /* Estilos adicionales para las nuevas funcionalidades */
        .admin-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid #e0e0e0;
        }

        .admin-tab {
            padding: 12px 24px;
            background: #f5f5f5;
            border: none;
            border-radius: 10px 10px 0 0;
            cursor: pointer;
            font-weight: 600;
            color: #666;
            transition: all 0.3s ease;
        }

        .admin-tab.active {
            background: #667eea;
            color: white;
        }

        .admin-tab:hover {
            background: #667eea;
            color: white;
        }

        .download-history-table, .audit-history-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .download-history-table th,
        .download-history-table td,
        .audit-history-table th,
        .audit-history-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #e0e0e0;
        }

        .download-history-table th,
        .audit-history-table th {
            background: #667eea;
            color: white;
            font-weight: 600;
        }

        .download-history-table tr:hover,
        .audit-history-table tr:hover {
            background: #f8f9fa;
        }

        .pagination {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 20px;
        }

        .pagination button {
            padding: 8px 16px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .pagination button:hover {
            background: #667eea;
            color: white;
        }

        .pagination button.active {
            background: #667eea;
            color: white;
        }

        .pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .filters-section {
            background: white;
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .filters-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            align-items: end;
        }

        .user-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .user-badge.admin {
            background: #ff9800;
            color: white;
        }

        .user-badge.usuario {
            background: #4caf50;
            color: white;
        }

        .action-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .action-badge.create {
            background: #4caf50;
            color: white;
        }

        .action-badge.update {
            background: #ff9800;
            color: white;
        }

        .action-badge.delete {
            background: #f44336;
            color: white;
        }

        .action-badge.download {
            background: #2196f3;
            color: white;
        }

        .stats-charts {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .chart-container {
            background: white;
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .chart-title {
            font-size: 1.2rem;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .chart-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .chart-item:last-child {
            border-bottom: none;
        }

        .chart-bar {
            height: 20px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 10px;
            margin-top: 5px;
            transition: all 0.3s ease;
        }

        .no-data {
            text-align: center;
            color: #666;
            padding: 40px;
            font-style: italic;
        }

        .data-details {
            max-width: 300px;
            max-height: 100px;
            overflow: auto;
            background: #f8f9fa;
            padding: 10px;
            border-radius: 5px;
            font-size: 0.8rem;
            border: 1px solid #e0e0e0;
        }

        .expandable-content {
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .expandable-content:hover {
            background: #f0f0f0;
        }

        .expanded {
            background: #e3f2fd !important;
        }
        
        /* ===== ESTILOS PARA MODAL DE CAMBIO DE CONTRASEÑA ===== */

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        
        .modal-overlay.show {
            opacity: 1;
            visibility: visible;
        }
        
        .modal {
            background: white;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            transform: scale(0.9);
            transition: transform 0.3s ease;
        }
        
        .modal-overlay.show .modal {
            transform: scale(1);
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 25px;
            border-bottom: 1px solid #e1e8ed;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 15px 15px 0 0;
        }
        
        .modal-title {
            color: white;
            font-size: 18px;
            font-weight: 600;
            margin: 0;
        }
        
        .modal-close {
            background: none;
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            padding: 5px;
            border-radius: 50%;
            width: 35px;
            height: 35px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.3s ease;
        }
        
        .modal-close:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }
        
        .modal-body {
            padding: 25px;
        }
        
        .modal .form-group {
            margin-bottom: 20px;
        }
        
        .modal .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #2c3e50;
        }
        
        .modal .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e1e8ed;
            border-radius: 8px;
            font-size: 14px;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
            box-sizing: border-box;
        }
        
        .modal .form-group input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        /* Estilos específicos para el botón de cambiar contraseña */
        .user-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 25px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 15px;
            margin-bottom: 25px;
            color: white;
        }
        
        .user-info > div:first-child {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .user-info > div:last-child {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        /* Mejorar estilos de botones */
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        
        .btn-info {
            background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
            color: white;
        }
        
        .btn-info:hover {
            background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
        }
        
        .btn-success {
            background: linear-gradient(135deg, #28a745 0%, #20692e 100%);
            color: white;
        }
        
        .btn-success:hover {
            background: linear-gradient(135deg, #20692e 0%, #1e4620 100%);
        }
        
        .btn-danger {
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
            color: white;
        }
        
        .btn-danger:hover {
            background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
        }
        
        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }
        
        .btn:disabled:hover {
            transform: none;
            box-shadow: none;
        }
        
        /* Responsive para móviles */
        @media (max-width: 768px) {
            .modal {
                margin: 10px;
                width: calc(100% - 20px);
            }
            
            .modal-header {
                padding: 15px 20px;
            }
            
            .modal-title {
                font-size: 16px;
            }
            
            .modal-body {
                padding: 20px;
            }
            
            .user-info {
                flex-direction: column;
                gap: 15px;
                text-align: center;
            }
            
            .user-info > div:last-child {
                flex-direction: column;
                gap: 10px;
                width: 100%;
            }
            
            .btn {
                width: 100%;
                justify-content: center;
            }
        }
        
        /* Animaciones adicionales */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .modal-overlay.show .modal {
            animation: fadeInUp 0.3s ease;
        }
        
        /* Mejorar el foco de inputs */
        .modal .form-group input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        /* Estilo para mensajes de ayuda */
        .modal .form-group small {
            color: #666;
            font-size: 12px;
            margin-top: 5px;
            display: block;
        }
        
        .modal .form-group small i {
            margin-right: 5px;
        }
        
        /* Mejorar el estilo del contenedor de información del usuario */
        .modal-body > div:first-child {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            border-left: 4px solid #007bff;
        }
        
        .modal-body > div:first-child > div:first-child {
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 5px;
        }
        
        .modal-body > div:first-child > div:last-child {
            font-size: 14px;
            color: #666;
        }
        
        /* Estilos para íconos en el modal */
        .modal i {
            color: inherit;
        }
        
        /* Mejorar el espaciado en botones del modal */
        .modal .btn i {
            margin-right: 5px;
        }
        
        /* Toast container para asegurar que esté encima del modal */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 2000; /* Más alto que el modal */
            max-width: 400px;
        }
        
        /* Estilos para el overlay del toast cuando es crítico */
        .toast-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
            z-index: 1500;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast-overlay.show {
            opacity: 1;
        }
        
        /* Asegurar que el toast esté visible sobre el modal */
        .toast {
            position: relative;
            z-index: 2100;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            margin-bottom: 10px;
            padding: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }
        
        .toast.show {
            transform: translateX(0);
        }
        
        .toast.hide {
            transform: translateX(100%);
        }
        
        .toast-icon {
            font-size: 20px;
            flex-shrink: 0;
        }
        
        .toast-content {
            flex: 1;
            color: #2c3e50;
            font-weight: 500;
        }
        
        .toast-close {
            background: none;
            border: none;
            color: #666;
            cursor: pointer;
            padding: 2px;
            border-radius: 3px;
            transition: background-color 0.3s ease;
        }
        
        .toast-close:hover {
            background-color: rgba(0, 0, 0, 0.1);
        }
        
        .toast-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            background: #667eea;
            border-radius: 0 0 10px 10px;
            transition: width linear;
        }
        
        .toast-success .toast-icon {
            color: #28a745;
        }
        
        .toast-error .toast-icon {
            color: #dc3545;
        }
        
        .toast-warning .toast-icon {
            color: #ffc107;
        }
        
        .toast-info .toast-icon {
            color: #17a2b8;
        }
        
        .toast-success .toast-progress {
            background: #28a745;
        }
        
        .toast-error .toast-progress {
            background: #dc3545;
        }
        
        .toast-warning .toast-progress {
            background: #ffc107;
        }
        
        .toast-info .toast-progress {
            background: #17a2b8;
        }
    </style>