/* Estilos para gestión de usuarios */

.admin-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.section-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3 i {
    color: #6366f1;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-actions .btn {
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.section-actions .btn i {
    margin-right: 4px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 32px 16px;
}

.user-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: white;
    color: #6366f1;
    border: 1px solid #6366f1;
}

.btn-outline:hover {
    background: #6366f1;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Nuevos estilos para botones de acción */
.btn-action {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 90px;
    text-transform: none;
    letter-spacing: 0.02em;
}

.btn-accept {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.btn-accept:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-reject {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-reject:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-details {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: white;
    box-shadow: 0 2px 4px rgba(56, 189, 248, 0.2);
}

.btn-details:hover {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.user-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* Efectos especiales */
.btn-action {
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-action:hover::before {
    left: 100%;
}

.users-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.section-title {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.pending-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 5px;
    display: none;
}

/* User Filter Bar */
.user-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* User Tables */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.users-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.users-table tr:hover {
    background-color: #f8f9fa;
}

.users-table .no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
}

.user-card .user-info {
    display: flex;
    flex-direction: column;
}

.user-card .user-info strong {
    font-size: 0.95rem;
    color: #2c3e50;
}

.user-card .user-info small {
    color: #666;
    font-size: 0.8rem;
}

.user-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.user-actions .btn {
    padding: 6px 10px;
    min-width: auto;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background-color: #27ae60;
}

.status-pending {
    background-color: #f39c12;
}

.status-suspended {
    background-color: #e74c3c;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: #3498db;
    color: white;
}

.badge-success {
    background-color: #27ae60;
    color: white;
}

.badge-warning {
    background-color: #f39c12;
    color: white;
}

.badge-danger {
    background-color: #e74c3c;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-title i {
    margin-right: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* User Details Modal Content */
.user-details-content {
    padding: 25px;
}

.user-info-section,
.user-password-section,
.user-permissions-section,
.user-activity-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.user-activity-section {
    border-bottom: none;
}

.user-details-content h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.info-item span {
    color: #2c3e50;
    font-size: 0.95rem;
}

.activity-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Password Display */
.password-display {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.password-display .form-input {
    flex: 1;
    padding-right: 45px;
}

.btn-toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: color 0.2s;
}

.btn-toggle-password:hover {
    color: #2c3e50;
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.permission-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s;
}

.permission-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.permission-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.permission-item span {
    font-size: 0.9rem;
    color: #2c3e50;
}

/* Approval Modal Content */
.approval-content {
    padding: 25px;
}

.user-request-info h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.reason-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.reason-section label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
}

.user-reason {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin: 0;
    font-style: italic;
    color: #555;
}

/* Form Styles in Modals */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-hint {
    color: #666;
    font-size: 0.8rem;
    margin-top: 5px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .form-input {
    padding-right: 45px;
}

/* Notifications - Alta especificidad para sobrescribir otros estilos */
.notification,
div.notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1100 !important;
    min-width: 280px !important;
    max-width: 450px !important;
    width: auto !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    animation: slideInRight 0.3s ease-out !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    overflow: visible !important;
    line-height: 1.4 !important;
    transform: none !important;
    transition: none !important;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content,
.notification .notification-content {
    display: flex !important;
    align-items: flex-start !important;
    flex: 1 !important;
    flex-wrap: wrap !important;
}

.notification-content i,
.notification .notification-content i {
    margin-right: 10px !important;
    font-size: 1.1rem !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
}

.notification-content span,
.notification .notification-content span {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
    flex: 1 !important;
    white-space: normal !important;
}

.notification-close,
.notification .notification-close {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 5px !important;
    margin-left: 15px !important;
    border-radius: 3px !important;
    transition: background-color 0.2s !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
    margin-top: 2px !important;
    color: inherit !important;
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.notification-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notification-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .user-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
    }

    .users-table {
        font-size: 0.85rem;
    }

    .user-actions {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }

    .btn-action {
        width: 100%;
        min-width: unset;
        padding: 10px 12px;
        font-size: 0.8rem;
        justify-content: center;
    }

    .user-actions .btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .notification {
        min-width: 280px;
        max-width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        white-space: normal;
        word-wrap: break-word;
    }

    .notification-content {
        flex-wrap: wrap;
    }

    .notification-content span {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* Modal open state */
.modal-open {
    overflow: hidden;
}

/* Focus styles for accessibility */
.btn:focus,
.form-input:focus,
.permission-item input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .modal {
        display: none;
    }

    .notification {
        display: none;
    }

    .user-actions {
        display: none;
    }
}

/* Estilos específicos para botones del modal de aprobación */
#approve-user-modal .modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 0 0 12px 12px;
}

#approve-user-modal .modal-actions .btn {
    flex: 1;
    max-width: 120px;
    min-width: 100px;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón Cancelar - Gradiente celeste a azul/morado */
#approve-user-modal .btn-outline {
    background: linear-gradient(135deg, #38bdf8, #6366f1, #8b5cf6);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(56, 189, 248, 0.3);
}

#approve-user-modal .btn-outline:hover {
    background: linear-gradient(135deg, #0ea5e9, #4f46e5, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

/* Botón Rechazar */
#approve-user-modal .btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

#approve-user-modal .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Botón Aprobar */
#approve-user-modal .btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

#approve-user-modal .btn-success:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Efectos especiales para botones del modal */
#approve-user-modal .modal-actions .btn {
    position: relative;
    overflow: hidden;
}

#approve-user-modal .modal-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#approve-user-modal .modal-actions .btn:hover::before {
    left: 100%;
}

/* Responsive para botones del modal */
@media (max-width: 768px) {
    #approve-user-modal .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    #approve-user-modal .modal-actions .btn {
        max-width: none;
        width: 100%;
        padding: 12px 16px;
    }
}

/* Estilos específicos para botones del modal de cambiar contraseña */
#change-password-modal .modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 0 0 12px 12px;
}

#change-password-modal .modal-actions .btn {
    flex: 1;
    max-width: 120px;
    min-width: 100px;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#change-password-modal .modal-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#change-password-modal .modal-actions .btn:hover::before {
    opacity: 0.1;
}

/* Botón Cancelar - Celeste difuminado */
#change-password-modal .modal-actions .btn-outline {
    background: linear-gradient(135deg, #87ceeb 0%, #4682b4 50%, #9370db 100%);
    color: white;
    border: 2px solid transparent;
}

#change-password-modal .modal-actions .btn-outline:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.4);
}

#change-password-modal .modal-actions .btn-outline::before {
    background: rgba(255, 255, 255, 0.2);
}

/* Botón Cambiar Contraseña - Verde */
#change-password-modal .modal-actions .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
}

#change-password-modal .modal-actions .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

#change-password-modal .modal-actions .btn-success::before {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive para modal de cambiar contraseña */
@media (max-width: 480px) {
    #change-password-modal .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    #change-password-modal .modal-actions .btn {
        max-width: none;
        width: 100%;
        padding: 12px 16px;
    }
}